From: support
Date: Thu, 6 Apr 2023 15:20:12 +0000 (+0000)
Subject: Built motion from commit 1ea47bf4.|2.6.34
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=77bbc5a48582172976bf532fb699f17710a04dcf;p=motion2.git
Built motion from commit 1ea47bf4.|2.6.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 0c3d32a..49e8f0d 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-04-04T07:41:54.877Z",
+ "time": "2023-04-06T15:09:26.848Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index d2ff86a..f794d4d 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-04-04T07:41:54.877Z",
+ "time": "2023-04-06T15:09:26.848Z",
"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 87d1f5f..2dde944 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 _0x6af2=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6af2,0x1d9));var _0x26af=function(_0x1c11a6,_0x154a32){_0x1c11a6=_0x1c11a6-0x0;var _0x1d9786=_0x6af2[_0x1c11a6];return _0x1d9786;};'use strict';var Sequelize=require(_0x26af('0x0'));module[_0x26af('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x191a6d){return this[_0x26af('0x2')]('action');}},'action':{'type':Sequelize[_0x26af('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x26af('0x4'),_0x26af('0x5'),_0x26af('0x6'),_0x26af('0x7'),_0x26af('0x8'),_0x26af('0x9'),_0x26af('0xa')]],'msg':_0x26af('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x26af('0x3')](0x1000),'comment':_0x26af('0xc')},'data2':{'type':Sequelize[_0x26af('0x3')](0x1000),'comment':_0x26af('0xd')},'data3':{'type':Sequelize[_0x26af('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x26af('0x3')](0x1000),'comments':_0x26af('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x26af('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x26af('0x10')},'data7':{'type':Sequelize[_0x26af('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xabe0=['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[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xabe0,0x182));var _0x0abe=function(_0x15601f,_0x35938f){_0x15601f=_0x15601f-0x0;var _0x15d32d=_0xabe0[_0x15601f];return _0x15d32d;};'use strict';var Sequelize=require(_0x0abe('0x0'));module[_0x0abe('0x1')]={'name':{'type':Sequelize[_0x0abe('0x2')],'get':function(_0x2f356a){return this[_0x0abe('0x3')](_0x0abe('0x4'));}},'action':{'type':Sequelize[_0x0abe('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0abe('0x6'),_0x0abe('0x7'),_0x0abe('0x8'),_0x0abe('0x9'),_0x0abe('0xa'),'browser',_0x0abe('0xb'),_0x0abe('0xc')]],'msg':_0x0abe('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x0abe('0xe')},'data2':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comment':_0x0abe('0xf')},'data3':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comment':_0x0abe('0x10')},'data4':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comments':_0x0abe('0x11')},'data5':{'type':Sequelize[_0x0abe('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x0abe('0x5')],'comments':_0x0abe('0x12')},'data7':{'type':Sequelize[_0x0abe('0x13')],'comments':_0x0abe('0x14')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 25a5892..97e09ba 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 _0xc76f=['params','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','find'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xc76f,0x1ba));var _0xfc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc76('0x0'));var rimraf=require(_0xfc76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc76('0x2'));var rp=require('request-promise');var moment=require(_0xfc76('0x3'));var BPromise=require(_0xfc76('0x4'));var Mustache=require('mustache');var util=require(_0xfc76('0x5'));var path=require(_0xfc76('0x6'));var sox=require(_0xfc76('0x7'));var csv=require('to-csv');var ejs=require(_0xfc76('0x8'));var fs=require('fs');var fs_extra=require(_0xfc76('0x9'));var _=require(_0xfc76('0xa'));var squel=require(_0xfc76('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc76('0xc'));var toCsv=require(_0xfc76('0xd'));var querystring=require(_0xfc76('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfc76('0xf'));var as=require(_0xfc76('0x10'));var hardwareService=require(_0xfc76('0x11'));var logger=require(_0xfc76('0x12'))(_0xfc76('0x13'));var utils=require(_0xfc76('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5be805,_0x4d038b){_0x4d038b=_0x4d038b||0xcc;return function(_0x292e29){if(_0x292e29){return _0x5be805[_0xfc76('0x15')](_0x4d038b);}return _0x5be805[_0xfc76('0x16')](_0x4d038b)[_0xfc76('0x17')]();};}function respondWithResult(_0x69fc7a,_0x5e9530){_0x5e9530=_0x5e9530||0xc8;return function(_0x2abee2){if(_0x2abee2){return _0x69fc7a['status'](_0x5e9530)[_0xfc76('0x18')](_0x2abee2);}};}function respondWithFilteredResult(_0x5834e0,_0x45ac7a){return function(_0x4a721c){if(_0x4a721c){var _0x2e71dc=typeof _0x45ac7a[_0xfc76('0x19')]===_0xfc76('0x1a')&&typeof _0x45ac7a[_0xfc76('0x1b')]===_0xfc76('0x1a');var _0x542e1c=_0x4a721c['count'];var _0x44a3c=_0x2e71dc?0x0:_0x45ac7a[_0xfc76('0x19')];var _0x39725e=_0x2e71dc?_0x4a721c[_0xfc76('0x1c')]:_0x45ac7a[_0xfc76('0x19')]+_0x45ac7a[_0xfc76('0x1b')];var _0x49cc6b;if(_0x39725e>=_0x542e1c){_0x39725e=_0x542e1c;_0x49cc6b=0xc8;}else{_0x49cc6b=0xce;}_0x5834e0['status'](_0x49cc6b);return _0x5834e0[_0xfc76('0x1d')](_0xfc76('0x1e'),_0x44a3c+'-'+_0x39725e+'/'+_0x542e1c)[_0xfc76('0x18')](_0x4a721c);}return null;};}function patchUpdates(_0x1a0483){return function(_0x431a64){try{jsonpatch[_0xfc76('0x1f')](_0x431a64,_0x1a0483,!![]);}catch(_0x1a8dbb){return BPromise[_0xfc76('0x20')](_0x1a8dbb);}return _0x431a64['save']();};}function saveUpdates(_0x4e673b,_0x5ad14a){return function(_0x547b3a){if(_0x547b3a){return _0x547b3a[_0xfc76('0x21')](_0x4e673b)[_0xfc76('0x22')](function(_0x4f379e){return _0x4f379e;});}return null;};}function removeEntity(_0x128687,_0xbaffad){return function(_0x4790d6){if(_0x4790d6){return _0x4790d6[_0xfc76('0x23')]()[_0xfc76('0x22')](function(){_0x128687['status'](0xcc)[_0xfc76('0x17')]();});}};}function handleEntityNotFound(_0x2d0421,_0x8d4b8){return function(_0x1c8f3d){if(!_0x1c8f3d){_0x2d0421[_0xfc76('0x15')](0x194);}return _0x1c8f3d;};}function handleError(_0x474f1e,_0x3663a3){_0x3663a3=_0x3663a3||0x1f4;return function(_0x1a70bd){logger[_0xfc76('0x24')](_0x1a70bd[_0xfc76('0x25')]);if(_0x1a70bd['name']){delete _0x1a70bd[_0xfc76('0x26')];}_0x474f1e['status'](_0x3663a3)[_0xfc76('0x27')](_0x1a70bd);};}exports[_0xfc76('0x21')]=function(_0x551b81,_0x2a53c1){if(_0x551b81['body']['id']){delete _0x551b81[_0xfc76('0x28')]['id'];}return db['Action'][_0xfc76('0x29')]({'where':{'id':_0x551b81[_0xfc76('0x2a')]['id']}})[_0xfc76('0x22')](handleEntityNotFound(_0x2a53c1,null))[_0xfc76('0x22')](saveUpdates(_0x551b81['body'],null))[_0xfc76('0x22')](respondWithResult(_0x2a53c1,null))[_0xfc76('0x2b')](handleError(_0x2a53c1,null));};exports['destroy']=function(_0x10504c,_0xce724c){return db['Action']['find']({'where':{'id':_0x10504c[_0xfc76('0x2a')]['id']}})[_0xfc76('0x22')](handleEntityNotFound(_0xce724c,null))['then'](removeEntity(_0xce724c,null))[_0xfc76('0x2b')](handleError(_0xce724c,null));};
\ No newline at end of file
+var _0xc216=['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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','body','find','params','catch'];(function(_0x2261d1,_0x514c90){var _0x36c3ce=function(_0x465c49){while(--_0x465c49){_0x2261d1['push'](_0x2261d1['shift']());}};_0x36c3ce(++_0x514c90);}(_0xc216,0xc4));var _0x6c21=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xc216[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c21('0x0'));var zipdir=require(_0x6c21('0x1'));var jsonpatch=require(_0x6c21('0x2'));var rp=require(_0x6c21('0x3'));var moment=require(_0x6c21('0x4'));var BPromise=require(_0x6c21('0x5'));var Mustache=require(_0x6c21('0x6'));var util=require(_0x6c21('0x7'));var path=require('path');var sox=require(_0x6c21('0x8'));var csv=require(_0x6c21('0x9'));var ejs=require(_0x6c21('0xa'));var fs=require('fs');var fs_extra=require(_0x6c21('0xb'));var _=require(_0x6c21('0xc'));var squel=require(_0x6c21('0xd'));var crypto=require(_0x6c21('0xe'));var jsforce=require(_0x6c21('0xf'));var deskjs=require(_0x6c21('0x10'));var toCsv=require(_0x6c21('0x9'));var querystring=require(_0x6c21('0x11'));var Papa=require(_0x6c21('0x12'));var Redis=require(_0x6c21('0x13'));var authService=require(_0x6c21('0x14'));var qs=require(_0x6c21('0x15'));var as=require(_0x6c21('0x16'));var hardwareService=require(_0x6c21('0x17'));var logger=require('../../config/logger')(_0x6c21('0x18'));var utils=require(_0x6c21('0x19'));var config=require(_0x6c21('0x1a'));var licenseUtil=require(_0x6c21('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5b97,_0x17baa8){_0x17baa8=_0x17baa8||0xcc;return function(_0x552436){if(_0x552436){return _0x1e5b97[_0x6c21('0x1c')](_0x17baa8);}return _0x1e5b97[_0x6c21('0x1d')](_0x17baa8)[_0x6c21('0x1e')]();};}function respondWithResult(_0x1ec8e0,_0x7c50fd){_0x7c50fd=_0x7c50fd||0xc8;return function(_0x24030a){if(_0x24030a){return _0x1ec8e0['status'](_0x7c50fd)[_0x6c21('0x1f')](_0x24030a);}};}function respondWithFilteredResult(_0x29dfe8,_0x3284fc){return function(_0xae5259){if(_0xae5259){var _0x3e7429=typeof _0x3284fc[_0x6c21('0x20')]===_0x6c21('0x21')&&typeof _0x3284fc[_0x6c21('0x22')]===_0x6c21('0x21');var _0x4d976c=_0xae5259[_0x6c21('0x23')];var _0x38de0b=_0x3e7429?0x0:_0x3284fc['offset'];var _0x408219=_0x3e7429?_0xae5259['count']:_0x3284fc[_0x6c21('0x20')]+_0x3284fc['limit'];var _0x1637b6;if(_0x408219>=_0x4d976c){_0x408219=_0x4d976c;_0x1637b6=0xc8;}else{_0x1637b6=0xce;}_0x29dfe8[_0x6c21('0x1d')](_0x1637b6);return _0x29dfe8[_0x6c21('0x24')]('Content-Range',_0x38de0b+'-'+_0x408219+'/'+_0x4d976c)[_0x6c21('0x1f')](_0xae5259);}return null;};}function patchUpdates(_0x505dac){return function(_0x1a476d){try{jsonpatch[_0x6c21('0x25')](_0x1a476d,_0x505dac,!![]);}catch(_0x26af81){return BPromise['reject'](_0x26af81);}return _0x1a476d[_0x6c21('0x26')]();};}function saveUpdates(_0x35ad90,_0x365287){return function(_0xf24cce){if(_0xf24cce){return _0xf24cce[_0x6c21('0x27')](_0x35ad90)[_0x6c21('0x28')](function(_0x1b2c61){return _0x1b2c61;});}return null;};}function removeEntity(_0xd261a3,_0xcaf75c){return function(_0x141c09){if(_0x141c09){return _0x141c09[_0x6c21('0x29')]()[_0x6c21('0x28')](function(){_0xd261a3[_0x6c21('0x1d')](0xcc)[_0x6c21('0x1e')]();});}};}function handleEntityNotFound(_0x365d11,_0x28de92){return function(_0x40ef52){if(!_0x40ef52){_0x365d11[_0x6c21('0x1c')](0x194);}return _0x40ef52;};}function handleError(_0x24ee81,_0x2fb173){_0x2fb173=_0x2fb173||0x1f4;return function(_0x173dea){logger[_0x6c21('0x2a')](_0x173dea['stack']);if(_0x173dea['name']){delete _0x173dea[_0x6c21('0x2b')];}_0x24ee81[_0x6c21('0x1d')](_0x2fb173)[_0x6c21('0x2c')](_0x173dea);};}exports[_0x6c21('0x27')]=function(_0x5d488b,_0x5d8916){if(_0x5d488b[_0x6c21('0x2d')]['id']){delete _0x5d488b[_0x6c21('0x2d')]['id'];}return db['Action'][_0x6c21('0x2e')]({'where':{'id':_0x5d488b['params']['id']}})[_0x6c21('0x28')](handleEntityNotFound(_0x5d8916,null))[_0x6c21('0x28')](saveUpdates(_0x5d488b[_0x6c21('0x2d')],null))[_0x6c21('0x28')](respondWithResult(_0x5d8916,null))['catch'](handleError(_0x5d8916,null));};exports['destroy']=function(_0x5959d1,_0x2e8864){return db['Action'][_0x6c21('0x2e')]({'where':{'id':_0x5959d1[_0x6c21('0x2f')]['id']}})[_0x6c21('0x28')](handleEntityNotFound(_0x2e8864,null))[_0x6c21('0x28')](removeEntity(_0x2e8864,null))[_0x6c21('0x30')](handleError(_0x2e8864,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 47d82a1..011237c 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 _0xa893=['path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','util','moment','bluebird','request-promise'];(function(_0x882c95,_0x2fd99f){var _0x26d96b=function(_0x2d73a6){while(--_0x2d73a6){_0x882c95['push'](_0x882c95['shift']());}};_0x26d96b(++_0x2fd99f);}(_0xa893,0x1c3));var _0x3a89=function(_0x39bc8f,_0x5f4e5d){_0x39bc8f=_0x39bc8f-0x0;var _0x162014=_0xa893[_0x39bc8f];return _0x162014;};'use strict';var _=require(_0x3a89('0x0'));var util=require(_0x3a89('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3a89('0x2'));var BPromise=require(_0x3a89('0x3'));var rp=require(_0x3a89('0x4'));var fs=require('fs');var path=require(_0x3a89('0x5'));var rimraf=require(_0x3a89('0x6'));var config=require(_0x3a89('0x7'));var attributes=require(_0x3a89('0x8'));module[_0x3a89('0x9')]=function(_0x3946e7,_0x1b85d0){return _0x3946e7[_0x3a89('0xa')](_0x3a89('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1d9=['request-promise','rimraf','./action.attributes','exports','tools_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd1d9,0x13b));var _0x9d1d=function(_0x154f26,_0x228c67){_0x154f26=_0x154f26-0x0;var _0x2a1b3f=_0xd1d9[_0x154f26];return _0x2a1b3f;};'use strict';var _=require(_0x9d1d('0x0'));var util=require(_0x9d1d('0x1'));var logger=require(_0x9d1d('0x2'))('api');var moment=require(_0x9d1d('0x3'));var BPromise=require(_0x9d1d('0x4'));var rp=require(_0x9d1d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d1d('0x6'));var config=require('../../config/environment');var attributes=require(_0x9d1d('0x7'));module[_0x9d1d('0x8')]=function(_0x1bde9f,_0xad9da9){return _0x1bde9f['define']('Action',attributes,{'tableName':_0x9d1d('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 e7737b4..45c9a95 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x37de7d,_0x1e80f4){var _0x53211c=function(_0xdfeb92){while(--_0xdfeb92){_0x37de7d['push'](_0x37de7d['shift']());}};_0x53211c(++_0x1e80f4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5fc3[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2d5abe,_0x421434){var _0x4a603c=function(_0x196bac){while(--_0x196bac){_0x2d5abe['push'](_0x2d5abe['shift']());}};_0x4a603c(++_0x421434);}(_0x1261,0x144));var _0x1126=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0x1261[_0x380307];return _0x9ea14b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 92fe177..821edcd 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 _0x94bf=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','delete','destroy','exports','multer','connect-timeout'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x94bf,0x1da));var _0xf94b=function(_0x44c596,_0xe8d581){_0x44c596=_0x44c596-0x0;var _0x37930f=_0x94bf[_0x44c596];return _0x37930f;};'use strict';var multer=require(_0xf94b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf94b('0x1'));var express=require(_0xf94b('0x2'));var router=express[_0xf94b('0x3')]();var fs_extra=require(_0xf94b('0x4'));var auth=require(_0xf94b('0x5'));var interaction=require(_0xf94b('0x6'));var config=require(_0xf94b('0x7'));var controller=require(_0xf94b('0x8'));router['put'](_0xf94b('0x9'),auth[_0xf94b('0xa')](),controller['update']);router[_0xf94b('0xb')](_0xf94b('0x9'),auth[_0xf94b('0xa')](),controller[_0xf94b('0xc')]);module[_0xf94b('0xd')]=router;
\ No newline at end of file
+var _0x7600=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x4c0ca7,_0x267486){var _0x198a33=function(_0xd3c479){while(--_0xd3c479){_0x4c0ca7['push'](_0x4c0ca7['shift']());}};_0x198a33(++_0x267486);}(_0x7600,0xf3));var _0x0760=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x7600[_0xef8146];return _0x5a6cb0;};'use strict';var multer=require(_0x0760('0x0'));var util=require(_0x0760('0x1'));var path=require(_0x0760('0x2'));var timeout=require(_0x0760('0x3'));var express=require('express');var router=express[_0x0760('0x4')]();var fs_extra=require(_0x0760('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0760('0x6'));var config=require(_0x0760('0x7'));var controller=require(_0x0760('0x8'));router[_0x0760('0x9')](_0x0760('0xa'),auth[_0x0760('0xb')](),controller[_0x0760('0xc')]);router[_0x0760('0xd')](_0x0760('0xa'),auth[_0x0760('0xb')](),controller[_0x0760('0xe')]);module[_0x0760('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 1b37389..922a17f 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 _0xa630=['STRING','TEXT','sequelize','exports'];(function(_0x1a8651,_0x5252e4){var _0x50984b=function(_0x37ebfb){while(--_0x37ebfb){_0x1a8651['push'](_0x1a8651['shift']());}};_0x50984b(++_0x5252e4);}(_0xa630,0xbe));var _0x0a63=function(_0x337fb9,_0x2c5935){_0x337fb9=_0x337fb9-0x0;var _0x1e1d20=_0xa630[_0x337fb9];return _0x1e1d20;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0a63('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x0a63('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0x17de62,_0x561f1b){var _0x1014d4=function(_0x4dd9f1){while(--_0x4dd9f1){_0x17de62['push'](_0x17de62['shift']());}};_0x1014d4(++_0x561f1b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index b91f29a..f1338a5 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 _0xba5c=['COUNT(*)','SELECT','run','runReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','options','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','operator','field','ValidationErrorItem','select','DESC','includes','clone','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable'];(function(_0x275550,_0x1be9f6){var _0x2655ec=function(_0x6fc2cf){while(--_0x6fc2cf){_0x275550['push'](_0x275550['shift']());}};_0x2655ec(++_0x1be9f6);}(_0xba5c,0x154));var _0xcba5=function(_0x3638dd,_0x238cb4){_0x3638dd=_0x3638dd-0x0;var _0x3ab130=_0xba5c[_0x3638dd];return _0x3ab130;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcba5('0x0'));var jsonpatch=require(_0xcba5('0x1'));var rp=require(_0xcba5('0x2'));var moment=require(_0xcba5('0x3'));var BPromise=require(_0xcba5('0x4'));var Mustache=require('mustache');var util=require(_0xcba5('0x5'));var path=require(_0xcba5('0x6'));var sox=require(_0xcba5('0x7'));var csv=require(_0xcba5('0x8'));var ejs=require(_0xcba5('0x9'));var fs=require('fs');var fs_extra=require(_0xcba5('0xa'));var _=require(_0xcba5('0xb'));var squel=require('squel');var crypto=require(_0xcba5('0xc'));var jsforce=require(_0xcba5('0xd'));var deskjs=require(_0xcba5('0xe'));var toCsv=require(_0xcba5('0x8'));var querystring=require('querystring');var Papa=require(_0xcba5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcba5('0x10'));var as=require(_0xcba5('0x11'));var hardwareService=require(_0xcba5('0x12'));var logger=require('../../config/logger')(_0xcba5('0x13'));var utils=require(_0xcba5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcba5('0x15'));var db=require(_0xcba5('0x16'))['db'];var dbH=require(_0xcba5('0x16'))[_0xcba5('0x17')];function respondWithStatusCode(_0x41adcc,_0x37530e){_0x37530e=_0x37530e||0xcc;return function(_0x1b0cd4){if(_0x1b0cd4){return _0x41adcc['sendStatus'](_0x37530e);}return _0x41adcc[_0xcba5('0x18')](_0x37530e)[_0xcba5('0x19')]();};}function respondWithResult(_0x4adc49,_0x2233a1){_0x2233a1=_0x2233a1||0xc8;return function(_0x592e41){if(_0x592e41){return _0x4adc49['status'](_0x2233a1)[_0xcba5('0x1a')](_0x592e41);}};}function respondWithFilteredResult(_0x350914,_0xfb50e0){return function(_0x3d7f12){if(_0x3d7f12){var _0x3fb0d9=typeof _0xfb50e0[_0xcba5('0x1b')]===_0xcba5('0x1c')&&typeof _0xfb50e0[_0xcba5('0x1d')]===_0xcba5('0x1c');var _0x4f9c5b=_0x3d7f12['count'];var _0xd12b0f=_0x3fb0d9?0x0:_0xfb50e0[_0xcba5('0x1b')];var _0x239744=_0x3fb0d9?_0x3d7f12['count']:_0xfb50e0['offset']+_0xfb50e0[_0xcba5('0x1d')];var _0x514b41;if(_0x239744>=_0x4f9c5b){_0x239744=_0x4f9c5b;_0x514b41=0xc8;}else{_0x514b41=0xce;}_0x350914[_0xcba5('0x18')](_0x514b41);return _0x350914[_0xcba5('0x1e')](_0xcba5('0x1f'),_0xd12b0f+'-'+_0x239744+'/'+_0x4f9c5b)['json'](_0x3d7f12);}return null;};}function patchUpdates(_0x1580b9){return function(_0x36db21){try{jsonpatch[_0xcba5('0x20')](_0x36db21,_0x1580b9,!![]);}catch(_0x3a57f4){return BPromise['reject'](_0x3a57f4);}return _0x36db21[_0xcba5('0x21')]();};}function saveUpdates(_0x56c494,_0x1d3e80){return function(_0x510f6f){if(_0x510f6f){return _0x510f6f[_0xcba5('0x22')](_0x56c494)[_0xcba5('0x23')](function(_0x3addcb){return _0x3addcb;});}return null;};}function removeEntity(_0x4cada7,_0x4205f7){return function(_0x2032b7){if(_0x2032b7){return _0x2032b7[_0xcba5('0x24')]()[_0xcba5('0x23')](function(){var _0x22fe93=_0x2032b7['get']({'plain':!![]});var _0x71a928='CustomReports';return db[_0xcba5('0x25')][_0xcba5('0x24')]({'where':{'type':_0x71a928,'resourceId':_0x22fe93['id']}})[_0xcba5('0x23')](function(){return _0x2032b7;});})[_0xcba5('0x23')](function(){_0x4cada7['status'](0xcc)[_0xcba5('0x19')]();});}};}function handleEntityNotFound(_0x4916cc,_0x3f327d){return function(_0x262e6a){if(!_0x262e6a){_0x4916cc[_0xcba5('0x26')](0x194);}return _0x262e6a;};}function handleError(_0xa5d4b8,_0x3375e8){_0x3375e8=_0x3375e8||0x1f4;return function(_0x21a109){logger[_0xcba5('0x27')](_0x21a109[_0xcba5('0x28')]);if(_0x21a109[_0xcba5('0x29')]){delete _0x21a109[_0xcba5('0x29')];}_0xa5d4b8[_0xcba5('0x18')](_0x3375e8)[_0xcba5('0x2a')](_0x21a109);};}exports[_0xcba5('0x2b')]=function(_0x2c352a,_0x28f6d7){var _0x27899d={},_0x5f00c9={},_0x24fb9b={'count':0x0,'rows':[]};var _0x214aa3=_[_0xcba5('0x2c')](db[_0xcba5('0x2d')][_0xcba5('0x2e')],function(_0x43b0a5){return{'name':_0x43b0a5['fieldName'],'type':_0x43b0a5[_0xcba5('0x2f')][_0xcba5('0x30')]};});_0x5f00c9[_0xcba5('0x31')]=_[_0xcba5('0x2c')](_0x214aa3,_0xcba5('0x29'));_0x5f00c9[_0xcba5('0x32')]=_[_0xcba5('0x33')](_0x2c352a['query']);_0x5f00c9[_0xcba5('0x34')]=_[_0xcba5('0x35')](_0x5f00c9['model'],_0x5f00c9[_0xcba5('0x32')]);_0x27899d[_0xcba5('0x36')]=_[_0xcba5('0x35')](_0x5f00c9[_0xcba5('0x31')],qs[_0xcba5('0x37')](_0x2c352a[_0xcba5('0x32')][_0xcba5('0x37')]));_0x27899d[_0xcba5('0x36')]=_0x27899d[_0xcba5('0x36')][_0xcba5('0x38')]?_0x27899d[_0xcba5('0x36')]:_0x5f00c9['model'];if(!_0x2c352a[_0xcba5('0x32')][_0xcba5('0x39')](_0xcba5('0x3a'))){_0x27899d[_0xcba5('0x1d')]=qs[_0xcba5('0x1d')](_0x2c352a['query']['limit']);_0x27899d['offset']=qs[_0xcba5('0x1b')](_0x2c352a[_0xcba5('0x32')][_0xcba5('0x1b')]);}_0x27899d[_0xcba5('0x3b')]=qs[_0xcba5('0x3c')](_0x2c352a[_0xcba5('0x32')][_0xcba5('0x3c')]);_0x27899d[_0xcba5('0x3d')]=qs[_0xcba5('0x34')](_[_0xcba5('0x3e')](_0x2c352a['query'],_0x5f00c9[_0xcba5('0x34')]),_0x214aa3);if(_0x2c352a['query'][_0xcba5('0x3f')]){_0x27899d[_0xcba5('0x3d')]=_['merge'](_0x27899d[_0xcba5('0x3d')],{'$or':_[_0xcba5('0x2c')](_0x214aa3,function(_0x45ada4){if(_0x45ada4[_0xcba5('0x2f')]!==_0xcba5('0x40')){var _0x187ce2={};_0x187ce2[_0x45ada4[_0xcba5('0x29')]]={'$like':'%'+_0x2c352a[_0xcba5('0x32')][_0xcba5('0x3f')]+'%'};return _0x187ce2;}})});}_0x27899d=_[_0xcba5('0x41')]({},_0x27899d,_0x2c352a['options']);var _0x45faa7={'where':_0x27899d['where']};return db[_0xcba5('0x2d')][_0xcba5('0x42')](_0x45faa7)[_0xcba5('0x23')](function(_0xddad8b){_0x24fb9b['count']=_0xddad8b;if(_0x2c352a[_0xcba5('0x32')][_0xcba5('0x43')]){_0x27899d[_0xcba5('0x44')]=[{'all':!![]}];}return db[_0xcba5('0x2d')][_0xcba5('0x45')](_0x27899d);})[_0xcba5('0x23')](function(_0x247df1){_0x24fb9b[_0xcba5('0x46')]=_0x247df1;return _0x24fb9b;})[_0xcba5('0x23')](respondWithFilteredResult(_0x28f6d7,_0x27899d))[_0xcba5('0x47')](handleError(_0x28f6d7,null));};exports[_0xcba5('0x48')]=function(_0x8307,_0x3cc5f3){var _0x3d33aa={'raw':![],'where':{'id':_0x8307[_0xcba5('0x49')]['id']}},_0x418b3d={};_0x418b3d[_0xcba5('0x31')]=_['keys'](db['AnalyticCustomReport'][_0xcba5('0x2e')]);_0x418b3d[_0xcba5('0x32')]=_[_0xcba5('0x33')](_0x8307[_0xcba5('0x32')]);_0x418b3d[_0xcba5('0x34')]=_[_0xcba5('0x35')](_0x418b3d[_0xcba5('0x31')],_0x418b3d[_0xcba5('0x32')]);_0x3d33aa[_0xcba5('0x36')]=_[_0xcba5('0x35')](_0x418b3d['model'],qs[_0xcba5('0x37')](_0x8307[_0xcba5('0x32')][_0xcba5('0x37')]));_0x3d33aa[_0xcba5('0x36')]=_0x3d33aa['attributes'][_0xcba5('0x38')]?_0x3d33aa[_0xcba5('0x36')]:_0x418b3d[_0xcba5('0x31')];if(_0x8307[_0xcba5('0x32')][_0xcba5('0x43')]){_0x3d33aa[_0xcba5('0x44')]=[{'all':!![]}];}_0x3d33aa=_['merge']({},_0x3d33aa,_0x8307['options']);return db['AnalyticCustomReport'][_0xcba5('0x4a')](_0x3d33aa)[_0xcba5('0x23')](handleEntityNotFound(_0x3cc5f3,null))[_0xcba5('0x23')](respondWithResult(_0x3cc5f3,null))['catch'](handleError(_0x3cc5f3,null));};exports[_0xcba5('0x4b')]=function(_0x57a3fa,_0x2e91c6){return db[_0xcba5('0x2d')][_0xcba5('0x4b')](_0x57a3fa['body'],{})[_0xcba5('0x23')](function(_0x2160be){var _0x845dc9=_0x57a3fa['user']['get']({'plain':!![]});if(!_0x845dc9)throw new Error(_0xcba5('0x4c'));if(_0x845dc9['role']===_0xcba5('0x4d')){var _0x85ebd5=_0x2160be[_0xcba5('0x4e')]({'plain':!![]});var _0x2a85f6=_0xcba5('0x4f');return db[_0xcba5('0x50')][_0xcba5('0x4a')]({'where':{'name':_0x2a85f6,'userProfileId':_0x845dc9[_0xcba5('0x51')]},'raw':!![]})[_0xcba5('0x23')](function(_0x43765d){if(_0x43765d&&_0x43765d[_0xcba5('0x52')]===0x0){return db[_0xcba5('0x25')][_0xcba5('0x4b')]({'name':_0x85ebd5[_0xcba5('0x29')],'resourceId':_0x85ebd5['id'],'type':'CustomReports','sectionId':_0x43765d['id']},{})['then'](function(){return _0x2160be;});}else{return _0x2160be;}})[_0xcba5('0x47')](function(_0x7b4a3d){logger[_0xcba5('0x27')](_0xcba5('0x53'),_0x7b4a3d);throw _0x7b4a3d;});}return _0x2160be;})[_0xcba5('0x23')](respondWithResult(_0x2e91c6,0xc9))['catch'](handleError(_0x2e91c6,null));};exports['update']=function(_0x1dc235,_0x8750ff){if(_0x1dc235[_0xcba5('0x54')]['id']){delete _0x1dc235[_0xcba5('0x54')]['id'];}return db[_0xcba5('0x2d')][_0xcba5('0x4a')]({'where':{'id':_0x1dc235[_0xcba5('0x49')]['id']}})[_0xcba5('0x23')](handleEntityNotFound(_0x8750ff,null))[_0xcba5('0x23')](saveUpdates(_0x1dc235[_0xcba5('0x54')],null))['then'](respondWithResult(_0x8750ff,null))['catch'](handleError(_0x8750ff,null));};exports[_0xcba5('0x24')]=function(_0x525102,_0x1d9f8d){return db[_0xcba5('0x2d')]['find']({'where':{'id':_0x525102[_0xcba5('0x49')]['id']}})[_0xcba5('0x23')](handleEntityNotFound(_0x1d9f8d,null))[_0xcba5('0x23')](removeEntity(_0x1d9f8d,null))[_0xcba5('0x47')](handleError(_0x1d9f8d,null));};exports['preview']=function(_0x2d0273,_0x21a770){var _0xc2acd1=0xa;var _0x1780fe=[_0xcba5('0x55'),_0xcba5('0x56'),_0xcba5('0x57'),_0xcba5('0x58')];var _0xa4f65b={'SUM':_0xcba5('0x59'),'COUNT':_0xcba5('0x5a'),'COUNT DISTINCT':_0xcba5('0x5b'),'MAX':_0xcba5('0x5c'),'MIN':_0xcba5('0x5d'),'AVG':_0xcba5('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcba5('0x5f')};var _0x5239d4={'SEC_TO_TIME':_0xcba5('0x60'),'DATE':_0xcba5('0x61'),'HOUR':_0xcba5('0x62'),'ROUND':_0xcba5('0x63'),'UNIX_TIMESTAMP':_0xcba5('0x64')};var _0x5bfc19=function(_0x10c838){return!_['includes']([_0xcba5('0x65'),_0xcba5('0x66'),_0xcba5('0x67'),_0xcba5('0x68')],_0x10c838);};var _0x43f109=function(_0x2b68d5){if(!_0x2b68d5||!_0x2b68d5[_0xcba5('0x69')][_0xcba5('0x38')]){return'';}for(var _0x489a63='(',_0x387352=0x0;_0x387352<_0x2b68d5['rules']['length'];_0x387352+=0x1){_0x387352>0x0&&(_0x489a63+='\x20'+_0x2b68d5['operator']+'\x20');_0x489a63+=_0x2b68d5['rules'][_0x387352]['group']?_0x43f109(_0x2b68d5['rules'][_0x387352][_0xcba5('0x6a')]):_0x2b68d5[_0xcba5('0x69')][_0x387352]['field']+'\x20'+_0x2b68d5[_0xcba5('0x69')][_0x387352][_0xcba5('0x6b')]+(_0x5bfc19(_0x2b68d5[_0xcba5('0x69')][_0x387352][_0xcba5('0x6b')])?'\x20'+_0x2b68d5[_0xcba5('0x69')][_0x387352][_0xcba5('0x6c')]:'');}return _0x489a63+')';};var _0x192794={'where':{'id':_0x2d0273['params']['id']}},_0x54f11c,_0x39408e,_0x589d16,_0xa96998,_0x1c6ac8;_0x192794=_[_0xcba5('0x41')]({},_0x192794,_0x2d0273[_0xcba5('0x6d')]);return db[_0xcba5('0x2d')][_0xcba5('0x4a')](_0x192794)[_0xcba5('0x23')](function(_0x1df0dd){if(_0x1df0dd){_0x54f11c=_0x1df0dd;return _0x1df0dd[_0xcba5('0x6e')]();}return null;})[_0xcba5('0x23')](function(_0x3bdc00){if(_0x3bdc00){if(!_0x3bdc00[_0xcba5('0x38')]){throw new db[(_0xcba5('0x6f'))]['ValidationErrorItem'](_0xcba5('0x70'),0x193);}_0x39408e=_0x3bdc00;return db[_0xcba5('0x71')][_0xcba5('0x45')]({'raw':!![]});}return null;})['then'](function(_0x4216fd){if(_0x4216fd){_0x589d16=_[_0xcba5('0x72')](_0x4216fd,'id');var _0x31ed6f;var _0x3cff1e=squel['select']();_0x3cff1e[_0xcba5('0x73')](_0x54f11c[_0xcba5('0x74')]);for(var _0x134067=0x0;_0x134067<_0x39408e[_0xcba5('0x38')];_0x134067+=0x1){_0x31ed6f=_0x39408e[_0x134067]['MetricId']?_0x589d16[_0x39408e[_0x134067][_0xcba5('0x75')]][_0xcba5('0x76')]:_0x39408e[_0x134067]['field'];_0x31ed6f=_0x39408e[_0x134067][_0xcba5('0x77')]?_[_0xcba5('0x78')](_0xa4f65b[_0x39408e[_0x134067]['function']],'%s',_0x31ed6f):_0x31ed6f;_0x31ed6f=_0x39408e[_0x134067][_0xcba5('0x79')]?_[_0xcba5('0x78')](_0x5239d4[_0x39408e[_0x134067]['format']],'%s',_0x31ed6f):_0x31ed6f;if(_0x39408e[_0x134067][_0xcba5('0x7a')]){_0x3cff1e[_0xcba5('0x6a')](_0x31ed6f);}_0x39408e[_0x134067][_0xcba5('0x7b')]&&_0x3cff1e[_0xcba5('0x3b')](_0x31ed6f,_0x39408e[_0x134067][_0xcba5('0x7b')]==='DESC'?![]:!![]);_0x3cff1e['field'](_0x31ed6f,_0x39408e[_0x134067][_0xcba5('0x7c')]||_0x31ed6f);}if(_0x54f11c[_0xcba5('0x7d')]){_0x54f11c[_0xcba5('0x7d')]=JSON[_0xcba5('0x7e')](_0x54f11c[_0xcba5('0x7d')]);for(var _0x29083f=0x0;_0x29083f<_0x54f11c[_0xcba5('0x7d')][_0xcba5('0x38')];_0x29083f+=0x1){if(_0x54f11c['joins'][_0x29083f][_0xcba5('0x2f')]&&_['includes'](_0x1780fe,_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x2f')])&&_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x7f')]&&_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x80')]&&_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x81')]){_0x3cff1e[_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x2f')]](_0x54f11c[_0xcba5('0x7d')][_0x29083f]['foreignTable'],null,util[_0xcba5('0x79')](_0xcba5('0x82'),_0x54f11c[_0xcba5('0x74')],_0x54f11c['joins'][_0x29083f][_0xcba5('0x7f')],_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x80')],_0x54f11c[_0xcba5('0x7d')][_0x29083f][_0xcba5('0x81')]));}}}if(_0x54f11c[_0xcba5('0x83')]){_0x54f11c[_0xcba5('0x83')]=JSON[_0xcba5('0x7e')](_0x54f11c[_0xcba5('0x83')]);_0x3cff1e[_0xcba5('0x3d')](_0x43f109(_0x54f11c['conditions']['group']));}_0x1c6ac8=_0x3cff1e['clone']();_0x3cff1e[_0xcba5('0x1d')](_0xc2acd1);_0x3cff1e[_0xcba5('0x1b')](0x0);logger[_0xcba5('0x84')](_0xcba5('0x85'),_0x3cff1e[_0xcba5('0x86')]());return dbH[_0xcba5('0x87')]['query'](_0x3cff1e[_0xcba5('0x86')](),{'type':dbH[_0xcba5('0x87')][_0xcba5('0x88')]['SELECT']});}})['then'](respondWithResult(_0x21a770,null))[_0xcba5('0x47')](handleError(_0x21a770,null));};function runReport(_0x3ae65a,_0x9fbb19,_0x3181e2){var _0x170e3d=_0x9fbb19[_0xcba5('0x29')];var _0x46a38f=0xa;var _0xe511bb=[_0xcba5('0x55'),_0xcba5('0x56'),_0xcba5('0x57'),_0xcba5('0x58')];var _0x1f517b={'SUM':_0xcba5('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcba5('0x5b'),'MAX':'MAX(%s)','MIN':_0xcba5('0x5d'),'AVG':_0xcba5('0x5e'),'GROUP_CONCAT':_0xcba5('0x89'),'GROUP_CONCAT ASC':_0xcba5('0x8a'),'GROUP_CONCAT DESC':_0xcba5('0x5f')};var _0x41aef3={'SEC_TO_TIME':_0xcba5('0x60'),'DATE':_0xcba5('0x61'),'HOUR':_0xcba5('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xcba5('0x64')};var _0x6d5e48=function(_0x244a6c){return!_['includes']([_0xcba5('0x65'),_0xcba5('0x66'),_0xcba5('0x67'),_0xcba5('0x68')],_0x244a6c);};var _0x3d1895=function(_0x79a571){if(!_0x79a571||!_0x79a571[_0xcba5('0x69')][_0xcba5('0x38')]){return'';}for(var _0x176f1b='(',_0x5090ae=0x0;_0x5090ae<_0x79a571[_0xcba5('0x69')][_0xcba5('0x38')];_0x5090ae+=0x1){_0x5090ae>0x0&&(_0x176f1b+='\x20'+_0x79a571[_0xcba5('0x8b')]+'\x20');_0x176f1b+=_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x6a')]?_0x3d1895(_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x6a')]):_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x8c')]+'\x20'+_0x79a571['rules'][_0x5090ae][_0xcba5('0x6b')]+(_0x6d5e48(_0x79a571[_0xcba5('0x69')][_0x5090ae]['condition'])?'\x20'+_0x79a571[_0xcba5('0x69')][_0x5090ae][_0xcba5('0x6c')]:'');}return _0x176f1b+')';};var _0x6a6ed0={'where':{'id':_0x3ae65a['id']}},_0x290b2a,_0x57c7c4,_0xe18f8e,_0x5d35b4,_0x1c9ff2;_0x6a6ed0=_[_0xcba5('0x41')]({},_0x6a6ed0,_0x3181e2);return db[_0xcba5('0x2d')]['find'](_0x6a6ed0)[_0xcba5('0x23')](function(_0x261bd4){if(_0x261bd4){_0x290b2a=_0x261bd4;return _0x261bd4[_0xcba5('0x6e')]();}return null;})['then'](function(_0x1abf6b){if(_0x1abf6b){if(!_0x1abf6b[_0xcba5('0x38')]){throw new db[(_0xcba5('0x6f'))][(_0xcba5('0x8d'))](_0xcba5('0x70'),0x193);}_0x57c7c4=_0x1abf6b;return db['AnalyticMetric'][_0xcba5('0x45')]({'raw':!![]});}return null;})[_0xcba5('0x23')](function(_0x10ac0f){if(_0x10ac0f){_0xe18f8e=_[_0xcba5('0x72')](_0x10ac0f,'id');var _0x239da6;var _0x3335e3=squel[_0xcba5('0x8e')]();_0x3335e3[_0xcba5('0x73')](_0x290b2a[_0xcba5('0x74')]);for(var _0x5f08a7=0x0;_0x5f08a7<_0x57c7c4[_0xcba5('0x38')];_0x5f08a7+=0x1){_0x239da6=_0x57c7c4[_0x5f08a7][_0xcba5('0x75')]?_0xe18f8e[_0x57c7c4[_0x5f08a7][_0xcba5('0x75')]]['metric']:_0x57c7c4[_0x5f08a7]['field'];_0x239da6=_0x57c7c4[_0x5f08a7][_0xcba5('0x77')]?_[_0xcba5('0x78')](_0x1f517b[_0x57c7c4[_0x5f08a7][_0xcba5('0x77')]],'%s',_0x239da6):_0x239da6;_0x239da6=_0x57c7c4[_0x5f08a7][_0xcba5('0x79')]?_[_0xcba5('0x78')](_0x41aef3[_0x57c7c4[_0x5f08a7][_0xcba5('0x79')]],'%s',_0x239da6):_0x239da6;if(_0x57c7c4[_0x5f08a7][_0xcba5('0x7a')]){_0x3335e3[_0xcba5('0x6a')](_0x239da6);}_0x57c7c4[_0x5f08a7]['orderBy']&&_0x3335e3[_0xcba5('0x3b')](_0x239da6,_0x57c7c4[_0x5f08a7][_0xcba5('0x7b')]===_0xcba5('0x8f')?![]:!![]);_0x3335e3[_0xcba5('0x8c')](_0x239da6,_0x57c7c4[_0x5f08a7]['alias']||_0x239da6);}if(_0x290b2a[_0xcba5('0x7d')]){_0x290b2a['joins']=JSON[_0xcba5('0x7e')](_0x290b2a[_0xcba5('0x7d')]);for(var _0x344bd2=0x0;_0x344bd2<_0x290b2a[_0xcba5('0x7d')][_0xcba5('0x38')];_0x344bd2+=0x1){if(_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x2f')]&&_[_0xcba5('0x90')](_0xe511bb,_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x2f')])&&_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x7f')]&&_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x80')]&&_0x290b2a['joins'][_0x344bd2]['foreignKey']){_0x3335e3[_0x290b2a[_0xcba5('0x7d')][_0x344bd2]['type']](_0x290b2a[_0xcba5('0x7d')][_0x344bd2]['foreignTable'],null,util[_0xcba5('0x79')](_0xcba5('0x82'),_0x290b2a[_0xcba5('0x74')],_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x7f')],_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x80')],_0x290b2a[_0xcba5('0x7d')][_0x344bd2][_0xcba5('0x81')]));}}}if(_0x290b2a[_0xcba5('0x83')]){_0x290b2a[_0xcba5('0x83')]=JSON[_0xcba5('0x7e')](_0x290b2a[_0xcba5('0x83')]);_0x3335e3[_0xcba5('0x3d')](_0x3d1895(_0x290b2a[_0xcba5('0x83')][_0xcba5('0x6a')]));}_0x1c9ff2=_0x3335e3[_0xcba5('0x91')]();_0x3335e3[_0xcba5('0x1d')](_0x46a38f);_0x3335e3[_0xcba5('0x1b')](0x0);return;}})[_0xcba5('0x23')](function(){if(_0x9fbb19[_0xcba5('0x92')]===_0xcba5('0x93')){return null;}var _0x14557c=_['merge'](_0x9fbb19,{'name':_0x9fbb19[_0xcba5('0x94')]||_0x9fbb19['name']||_0x290b2a[_0xcba5('0x29')],'basename':_0x170e3d,'savename':util[_0xcba5('0x79')](_0xcba5('0x95'),_0x9fbb19[_0xcba5('0x29')]||_0x290b2a[_0xcba5('0x29')],require('randomstring')[_0xcba5('0x96')](0x4),_0x9fbb19[_0xcba5('0x92')]||_0xcba5('0x97')),'reportId':_0x290b2a['id'],'reportType':_0xcba5('0x98')});return db[_0xcba5('0x99')][_0xcba5('0x4b')](_0x14557c,{'raw':!![]});})[_0xcba5('0x23')](function(_0x290183){if(_0x290b2a[_0xcba5('0x74')]===_0xcba5('0x9a')){_0x1c9ff2[_0xcba5('0x3d')](_0x290b2a[_0xcba5('0x74')]+_0xcba5('0x9b'),_0x9fbb19[_0xcba5('0x9c')],_0x9fbb19['endDate']);}else{_0x1c9ff2[_0xcba5('0x3d')](_0x290b2a[_0xcba5('0x74')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9fbb19[_0xcba5('0x9c')],_0x9fbb19['endDate']);}if(_0x290183){logger['info'](_0xcba5('0x9d'),_0x1c9ff2[_0xcba5('0x86')]());require(_0xcba5('0x9e'))[_0xcba5('0x9f')](path['join'](__dirname,_0xcba5('0xa0'),_0x290183[_0xcba5('0x92')]),[_0x290183['id'],_0x1c9ff2[_0xcba5('0x86')](),path[_0xcba5('0x55')](__dirname,_0xcba5('0xa1'),_0x290183[_0xcba5('0xa2')]),_0x170e3d]);return _0x290183;}else{var _0xa0e481=squel[_0xcba5('0x8e')]();_0xa0e481[_0xcba5('0x73')]('('+_0x1c9ff2[_0xcba5('0x86')]()+')',_0xcba5('0xa3'));_0xa0e481['field'](_0xcba5('0xa4'),_0xcba5('0x42'));_0x1c9ff2[_0xcba5('0x1d')](_0x9fbb19[_0xcba5('0x1d')]||_0x46a38f);_0x1c9ff2[_0xcba5('0x1b')](_0x9fbb19[_0xcba5('0x1b')]||0x0);return dbH[_0xcba5('0x87')][_0xcba5('0x32')](_0xa0e481[_0xcba5('0x86')](),{'type':dbH[_0xcba5('0x87')]['QueryTypes']['SELECT']})[_0xcba5('0x23')](function(_0x3d14cb){if(!_0x3d14cb[_0xcba5('0x38')]){_0x5d35b4=0x0;}else{_0x5d35b4=_0x3d14cb[0x0][_0xcba5('0x42')]||0x0;}return dbH['sequelize'][_0xcba5('0x32')](_0x1c9ff2[_0xcba5('0x86')](),{'type':dbH['sequelize'][_0xcba5('0x88')][_0xcba5('0xa5')]});})[_0xcba5('0x23')](function(_0x48abce){return{'rows':_0x48abce||[],'count':_0x5d35b4};});}});}exports[_0xcba5('0xa6')]=function(_0x32b12b,_0x2a04ad){return runReport(_0x32b12b[_0xcba5('0x49')],_0x32b12b[_0xcba5('0x32')],_0x32b12b[_0xcba5('0x6d')])[_0xcba5('0x23')](respondWithResult(_0x2a04ad,null))[_0xcba5('0x47')](handleError(_0x2a04ad,null));};exports[_0xcba5('0xa7')]=runReport;exports['query']=function(_0x4196e2,_0xa3a8a4){var _0x4e3da5=0xa;var _0x436e4a=[_0xcba5('0x55'),_0xcba5('0x56'),_0xcba5('0x57'),_0xcba5('0x58')];var _0x54547a={'SUM':_0xcba5('0x59'),'COUNT':_0xcba5('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xcba5('0x5d'),'AVG':_0xcba5('0x5e'),'GROUP_CONCAT':_0xcba5('0x89'),'GROUP_CONCAT ASC':_0xcba5('0x8a'),'GROUP_CONCAT DESC':_0xcba5('0x5f')};var _0x5118ef={'SEC_TO_TIME':_0xcba5('0x60'),'DATE':_0xcba5('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xcba5('0x63'),'UNIX_TIMESTAMP':_0xcba5('0x64')};var _0x55dd4e=function(_0x1eee35){return!_[_0xcba5('0x90')]([_0xcba5('0x65'),_0xcba5('0x66'),_0xcba5('0x67'),_0xcba5('0x68')],_0x1eee35);};var _0x2cfab9=function(_0x564bd6){if(!_0x564bd6||!_0x564bd6[_0xcba5('0x69')]['length']){return'';}for(var _0x28f01e='(',_0x332777=0x0;_0x332777<_0x564bd6[_0xcba5('0x69')][_0xcba5('0x38')];_0x332777+=0x1){_0x332777>0x0&&(_0x28f01e+='\x20'+_0x564bd6[_0xcba5('0x8b')]+'\x20');_0x28f01e+=_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6a')]?_0x2cfab9(_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6a')]):_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x8c')]+'\x20'+_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6b')]+(_0x55dd4e(_0x564bd6[_0xcba5('0x69')][_0x332777][_0xcba5('0x6b')])?'\x20'+_0x564bd6['rules'][_0x332777][_0xcba5('0x6c')]:'');}return _0x28f01e+')';};var _0x565338={'where':{'id':_0x4196e2[_0xcba5('0x49')]['id']}},_0x179217,_0x22f7b0,_0x18b783,_0x903a09,_0x4e9724;_0x565338=_[_0xcba5('0x41')]({},_0x565338,_0x4196e2[_0xcba5('0x6d')]);return db[_0xcba5('0x2d')][_0xcba5('0x4a')](_0x565338)[_0xcba5('0x23')](function(_0x512811){if(_0x512811){_0x179217=_0x512811;return _0x512811[_0xcba5('0x6e')]();}return null;})[_0xcba5('0x23')](function(_0x4227ac){if(_0x4227ac){if(!_0x4227ac[_0xcba5('0x38')]){throw new db[(_0xcba5('0x6f'))][(_0xcba5('0x8d'))](_0xcba5('0x70'),0x193);}_0x22f7b0=_0x4227ac;return db['AnalyticMetric'][_0xcba5('0x45')]({'raw':!![]});}return null;})[_0xcba5('0x23')](function(_0x30ed05){if(_0x30ed05){_0x18b783=_['keyBy'](_0x30ed05,'id');var _0x46c214;var _0x5a8e16=squel['select']();_0x5a8e16['from'](_0x179217[_0xcba5('0x74')]);for(var _0x54f67a=0x0;_0x54f67a<_0x22f7b0[_0xcba5('0x38')];_0x54f67a+=0x1){_0x46c214=_0x22f7b0[_0x54f67a]['MetricId']?_0x18b783[_0x22f7b0[_0x54f67a][_0xcba5('0x75')]][_0xcba5('0x76')]:_0x22f7b0[_0x54f67a][_0xcba5('0x8c')];_0x46c214=_0x22f7b0[_0x54f67a][_0xcba5('0x77')]?_['replace'](_0x54547a[_0x22f7b0[_0x54f67a][_0xcba5('0x77')]],'%s',_0x46c214):_0x46c214;_0x46c214=_0x22f7b0[_0x54f67a][_0xcba5('0x79')]?_[_0xcba5('0x78')](_0x5118ef[_0x22f7b0[_0x54f67a]['format']],'%s',_0x46c214):_0x46c214;if(_0x22f7b0[_0x54f67a][_0xcba5('0x7a')]){_0x5a8e16[_0xcba5('0x6a')](_0x46c214);}_0x22f7b0[_0x54f67a][_0xcba5('0x7b')]&&_0x5a8e16[_0xcba5('0x3b')](_0x46c214,_0x22f7b0[_0x54f67a][_0xcba5('0x7b')]===_0xcba5('0x8f')?![]:!![]);_0x5a8e16[_0xcba5('0x8c')](_0x46c214,_0x22f7b0[_0x54f67a]['alias']||_0x46c214);}if(_0x179217[_0xcba5('0x7d')]){_0x179217['joins']=JSON[_0xcba5('0x7e')](_0x179217['joins']);for(var _0x5b778c=0x0;_0x5b778c<_0x179217[_0xcba5('0x7d')][_0xcba5('0x38')];_0x5b778c+=0x1){if(_0x179217['joins'][_0x5b778c]['type']&&_[_0xcba5('0x90')](_0x436e4a,_0x179217[_0xcba5('0x7d')][_0x5b778c]['type'])&&_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x7f')]&&_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x80')]&&_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x81')]){_0x5a8e16[_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x2f')]](_0x179217['joins'][_0x5b778c][_0xcba5('0x80')],null,util[_0xcba5('0x79')]('%s.%s\x20=\x20%s.%s',_0x179217['table'],_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x7f')],_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x80')],_0x179217[_0xcba5('0x7d')][_0x5b778c][_0xcba5('0x81')]));}}}if(_0x179217[_0xcba5('0x83')]){_0x179217[_0xcba5('0x83')]=JSON['parse'](_0x179217[_0xcba5('0x83')]);_0x5a8e16['where'](_0x2cfab9(_0x179217['conditions']['group']));}_0x4e9724=_0x5a8e16[_0xcba5('0x91')]();_0x5a8e16[_0xcba5('0x1d')](_0x4e3da5);_0x5a8e16[_0xcba5('0x1b')](0x0);logger[_0xcba5('0x84')]('Limited\x20Query:',_0x5a8e16['toString']());return dbH[_0xcba5('0x87')][_0xcba5('0x32')](_0x5a8e16[_0xcba5('0x86')](),{'type':dbH[_0xcba5('0x87')]['QueryTypes'][_0xcba5('0xa5')]});}})[_0xcba5('0x23')](function(){return{'sql':_0x4e9724[_0xcba5('0x86')]()};})[_0xcba5('0x23')](respondWithResult(_0xa3a8a4,null))[_0xcba5('0x47')](handleError(_0xa3a8a4,null));};
\ No newline at end of file
+var _0x93f4=['CustomReports','UserProfileResource','sendStatus','error','stack','name','index','AnalyticCustomReport','rawAttributes','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','COUNT(%s)','IS\x20EMPTY','operator','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','groupBy','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','MAX(%s)','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','set','apply','then','destroy','get'];(function(_0x149cbe,_0x37e5b8){var _0x70795=function(_0x4cb85c){while(--_0x4cb85c){_0x149cbe['push'](_0x149cbe['shift']());}};_0x70795(++_0x37e5b8);}(_0x93f4,0x124));var _0x493f=function(_0xb29e9b,_0x6dee8c){_0xb29e9b=_0xb29e9b-0x0;var _0x10b5dc=_0x93f4[_0xb29e9b];return _0x10b5dc;};'use strict';var emlformat=require(_0x493f('0x0'));var rimraf=require(_0x493f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x493f('0x2'));var rp=require('request-promise');var moment=require(_0x493f('0x3'));var BPromise=require(_0x493f('0x4'));var Mustache=require(_0x493f('0x5'));var util=require(_0x493f('0x6'));var path=require(_0x493f('0x7'));var sox=require(_0x493f('0x8'));var csv=require(_0x493f('0x9'));var ejs=require(_0x493f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x493f('0xb'));var squel=require(_0x493f('0xc'));var crypto=require(_0x493f('0xd'));var jsforce=require(_0x493f('0xe'));var deskjs=require(_0x493f('0xf'));var toCsv=require(_0x493f('0x9'));var querystring=require(_0x493f('0x10'));var Papa=require(_0x493f('0x11'));var Redis=require(_0x493f('0x12'));var authService=require(_0x493f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x493f('0x14'));var hardwareService=require(_0x493f('0x15'));var logger=require('../../config/logger')(_0x493f('0x16'));var utils=require(_0x493f('0x17'));var config=require(_0x493f('0x18'));var licenseUtil=require(_0x493f('0x19'));var db=require(_0x493f('0x1a'))['db'];var dbH=require(_0x493f('0x1a'))[_0x493f('0x1b')];function respondWithStatusCode(_0x4bdc5e,_0x43a352){_0x43a352=_0x43a352||0xcc;return function(_0x436b02){if(_0x436b02){return _0x4bdc5e['sendStatus'](_0x43a352);}return _0x4bdc5e[_0x493f('0x1c')](_0x43a352)[_0x493f('0x1d')]();};}function respondWithResult(_0x2e83df,_0x1e7156){_0x1e7156=_0x1e7156||0xc8;return function(_0x33a910){if(_0x33a910){return _0x2e83df[_0x493f('0x1c')](_0x1e7156)[_0x493f('0x1e')](_0x33a910);}};}function respondWithFilteredResult(_0x13884f,_0x408fe1){return function(_0x2fe523){if(_0x2fe523){var _0x6905d0=typeof _0x408fe1[_0x493f('0x1f')]==='undefined'&&typeof _0x408fe1['limit']===_0x493f('0x20');var _0x208568=_0x2fe523[_0x493f('0x21')];var _0x276eaf=_0x6905d0?0x0:_0x408fe1['offset'];var _0x571a7c=_0x6905d0?_0x2fe523[_0x493f('0x21')]:_0x408fe1['offset']+_0x408fe1[_0x493f('0x22')];var _0x36cef8;if(_0x571a7c>=_0x208568){_0x571a7c=_0x208568;_0x36cef8=0xc8;}else{_0x36cef8=0xce;}_0x13884f[_0x493f('0x1c')](_0x36cef8);return _0x13884f[_0x493f('0x23')]('Content-Range',_0x276eaf+'-'+_0x571a7c+'/'+_0x208568)[_0x493f('0x1e')](_0x2fe523);}return null;};}function patchUpdates(_0x26cd55){return function(_0x1913ef){try{jsonpatch[_0x493f('0x24')](_0x1913ef,_0x26cd55,!![]);}catch(_0x233db6){return BPromise['reject'](_0x233db6);}return _0x1913ef['save']();};}function saveUpdates(_0x43830c,_0xb21fe6){return function(_0x13c0c9){if(_0x13c0c9){return _0x13c0c9['update'](_0x43830c)[_0x493f('0x25')](function(_0x404d47){return _0x404d47;});}return null;};}function removeEntity(_0x3eb068,_0xe9b085){return function(_0x58d06){if(_0x58d06){return _0x58d06[_0x493f('0x26')]()['then'](function(){var _0x3eb381=_0x58d06[_0x493f('0x27')]({'plain':!![]});var _0x2b7108=_0x493f('0x28');return db[_0x493f('0x29')][_0x493f('0x26')]({'where':{'type':_0x2b7108,'resourceId':_0x3eb381['id']}})['then'](function(){return _0x58d06;});})[_0x493f('0x25')](function(){_0x3eb068['status'](0xcc)[_0x493f('0x1d')]();});}};}function handleEntityNotFound(_0x180052,_0x45d0be){return function(_0x4209b8){if(!_0x4209b8){_0x180052[_0x493f('0x2a')](0x194);}return _0x4209b8;};}function handleError(_0xc552c,_0x24681b){_0x24681b=_0x24681b||0x1f4;return function(_0x1dfa3e){logger[_0x493f('0x2b')](_0x1dfa3e[_0x493f('0x2c')]);if(_0x1dfa3e[_0x493f('0x2d')]){delete _0x1dfa3e['name'];}_0xc552c['status'](_0x24681b)['send'](_0x1dfa3e);};}exports[_0x493f('0x2e')]=function(_0x588180,_0x3b4bf3){var _0x4bcf53={},_0x45609b={},_0x352656={'count':0x0,'rows':[]};var _0x5d9347=_['map'](db[_0x493f('0x2f')][_0x493f('0x30')],function(_0x230d35){return{'name':_0x230d35['fieldName'],'type':_0x230d35[_0x493f('0x31')][_0x493f('0x32')]};});_0x45609b['model']=_[_0x493f('0x33')](_0x5d9347,'name');_0x45609b[_0x493f('0x34')]=_['keys'](_0x588180[_0x493f('0x34')]);_0x45609b['filters']=_[_0x493f('0x35')](_0x45609b['model'],_0x45609b['query']);_0x4bcf53['attributes']=_[_0x493f('0x35')](_0x45609b[_0x493f('0x36')],qs['fields'](_0x588180[_0x493f('0x34')][_0x493f('0x37')]));_0x4bcf53[_0x493f('0x38')]=_0x4bcf53[_0x493f('0x38')][_0x493f('0x39')]?_0x4bcf53['attributes']:_0x45609b[_0x493f('0x36')];if(!_0x588180[_0x493f('0x34')][_0x493f('0x3a')](_0x493f('0x3b'))){_0x4bcf53[_0x493f('0x22')]=qs['limit'](_0x588180[_0x493f('0x34')]['limit']);_0x4bcf53[_0x493f('0x1f')]=qs[_0x493f('0x1f')](_0x588180[_0x493f('0x34')]['offset']);}_0x4bcf53[_0x493f('0x3c')]=qs[_0x493f('0x3d')](_0x588180[_0x493f('0x34')]['sort']);_0x4bcf53[_0x493f('0x3e')]=qs['filters'](_[_0x493f('0x3f')](_0x588180[_0x493f('0x34')],_0x45609b[_0x493f('0x40')]),_0x5d9347);if(_0x588180[_0x493f('0x34')][_0x493f('0x41')]){_0x4bcf53['where']=_['merge'](_0x4bcf53[_0x493f('0x3e')],{'$or':_[_0x493f('0x33')](_0x5d9347,function(_0x4ffa01){if(_0x4ffa01[_0x493f('0x31')]!=='VIRTUAL'){var _0x5c259e={};_0x5c259e[_0x4ffa01['name']]={'$like':'%'+_0x588180[_0x493f('0x34')][_0x493f('0x41')]+'%'};return _0x5c259e;}})});}_0x4bcf53=_[_0x493f('0x42')]({},_0x4bcf53,_0x588180[_0x493f('0x43')]);var _0x4c0230={'where':_0x4bcf53[_0x493f('0x3e')]};return db['AnalyticCustomReport'][_0x493f('0x21')](_0x4c0230)[_0x493f('0x25')](function(_0x5ea662){_0x352656[_0x493f('0x21')]=_0x5ea662;if(_0x588180[_0x493f('0x34')][_0x493f('0x44')]){_0x4bcf53[_0x493f('0x45')]=[{'all':!![]}];}return db[_0x493f('0x2f')][_0x493f('0x46')](_0x4bcf53);})[_0x493f('0x25')](function(_0x25d373){_0x352656[_0x493f('0x47')]=_0x25d373;return _0x352656;})[_0x493f('0x25')](respondWithFilteredResult(_0x3b4bf3,_0x4bcf53))[_0x493f('0x48')](handleError(_0x3b4bf3,null));};exports['show']=function(_0x28b3f9,_0x3fc614){var _0x122b1f={'raw':![],'where':{'id':_0x28b3f9['params']['id']}},_0x2b1150={};_0x2b1150['model']=_['keys'](db[_0x493f('0x2f')][_0x493f('0x30')]);_0x2b1150[_0x493f('0x34')]=_['keys'](_0x28b3f9['query']);_0x2b1150[_0x493f('0x40')]=_['intersection'](_0x2b1150[_0x493f('0x36')],_0x2b1150[_0x493f('0x34')]);_0x122b1f['attributes']=_[_0x493f('0x35')](_0x2b1150[_0x493f('0x36')],qs['fields'](_0x28b3f9[_0x493f('0x34')][_0x493f('0x37')]));_0x122b1f[_0x493f('0x38')]=_0x122b1f[_0x493f('0x38')]['length']?_0x122b1f[_0x493f('0x38')]:_0x2b1150[_0x493f('0x36')];if(_0x28b3f9[_0x493f('0x34')][_0x493f('0x44')]){_0x122b1f[_0x493f('0x45')]=[{'all':!![]}];}_0x122b1f=_[_0x493f('0x42')]({},_0x122b1f,_0x28b3f9['options']);return db[_0x493f('0x2f')][_0x493f('0x49')](_0x122b1f)[_0x493f('0x25')](handleEntityNotFound(_0x3fc614,null))[_0x493f('0x25')](respondWithResult(_0x3fc614,null))['catch'](handleError(_0x3fc614,null));};exports['create']=function(_0x5ae1d2,_0x5a61f1){return db[_0x493f('0x2f')][_0x493f('0x4a')](_0x5ae1d2[_0x493f('0x4b')],{})[_0x493f('0x25')](function(_0x32075d){var _0x35dc3e=_0x5ae1d2[_0x493f('0x4c')][_0x493f('0x27')]({'plain':!![]});if(!_0x35dc3e)throw new Error(_0x493f('0x4d'));if(_0x35dc3e['role']===_0x493f('0x4c')){var _0x4ee012=_0x32075d[_0x493f('0x27')]({'plain':!![]});var _0x1dc8d4=_0x493f('0x4e');return db['UserProfileSection'][_0x493f('0x49')]({'where':{'name':_0x1dc8d4,'userProfileId':_0x35dc3e[_0x493f('0x4f')]},'raw':!![]})[_0x493f('0x25')](function(_0x1e8c9b){if(_0x1e8c9b&&_0x1e8c9b[_0x493f('0x50')]===0x0){return db[_0x493f('0x29')][_0x493f('0x4a')]({'name':_0x4ee012[_0x493f('0x2d')],'resourceId':_0x4ee012['id'],'type':'CustomReports','sectionId':_0x1e8c9b['id']},{})[_0x493f('0x25')](function(){return _0x32075d;});}else{return _0x32075d;}})['catch'](function(_0x35b104){logger[_0x493f('0x2b')](_0x493f('0x51'),_0x35b104);throw _0x35b104;});}return _0x32075d;})['then'](respondWithResult(_0x5a61f1,0xc9))[_0x493f('0x48')](handleError(_0x5a61f1,null));};exports[_0x493f('0x52')]=function(_0x414e43,_0x581704){if(_0x414e43[_0x493f('0x4b')]['id']){delete _0x414e43[_0x493f('0x4b')]['id'];}return db[_0x493f('0x2f')][_0x493f('0x49')]({'where':{'id':_0x414e43[_0x493f('0x53')]['id']}})[_0x493f('0x25')](handleEntityNotFound(_0x581704,null))[_0x493f('0x25')](saveUpdates(_0x414e43['body'],null))[_0x493f('0x25')](respondWithResult(_0x581704,null))[_0x493f('0x48')](handleError(_0x581704,null));};exports['destroy']=function(_0x1aa548,_0x565995){return db[_0x493f('0x2f')]['find']({'where':{'id':_0x1aa548[_0x493f('0x53')]['id']}})[_0x493f('0x25')](handleEntityNotFound(_0x565995,null))['then'](removeEntity(_0x565995,null))[_0x493f('0x48')](handleError(_0x565995,null));};exports['preview']=function(_0x9c6e08,_0x2db416){var _0x44ffde=0xa;var _0x5ed462=['join',_0x493f('0x54'),_0x493f('0x55'),_0x493f('0x56')];var _0x2b95d1={'SUM':_0x493f('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x493f('0x58'),'MAX':'MAX(%s)','MIN':_0x493f('0x59'),'AVG':_0x493f('0x5a'),'GROUP_CONCAT':_0x493f('0x5b'),'GROUP_CONCAT ASC':_0x493f('0x5c'),'GROUP_CONCAT DESC':_0x493f('0x5d')};var _0x2bc93b={'SEC_TO_TIME':_0x493f('0x5e'),'DATE':_0x493f('0x5f'),'HOUR':_0x493f('0x60'),'ROUND':_0x493f('0x61'),'UNIX_TIMESTAMP':_0x493f('0x62')};var _0x1eb8e7=function(_0x23a273){return!_[_0x493f('0x63')]([_0x493f('0x64'),_0x493f('0x65'),'IS\x20EMPTY',_0x493f('0x66')],_0x23a273);};var _0x507376=function(_0x472a06){if(!_0x472a06||!_0x472a06[_0x493f('0x67')][_0x493f('0x39')]){return'';}for(var _0x215327='(',_0x4ebd9b=0x0;_0x4ebd9b<_0x472a06[_0x493f('0x67')]['length'];_0x4ebd9b+=0x1){_0x4ebd9b>0x0&&(_0x215327+='\x20'+_0x472a06['operator']+'\x20');_0x215327+=_0x472a06['rules'][_0x4ebd9b]['group']?_0x507376(_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x68')]):_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x69')]+'\x20'+_0x472a06['rules'][_0x4ebd9b]['condition']+(_0x1eb8e7(_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x6a')])?'\x20'+_0x472a06[_0x493f('0x67')][_0x4ebd9b][_0x493f('0x6b')]:'');}return _0x215327+')';};var _0x54cdbd={'where':{'id':_0x9c6e08[_0x493f('0x53')]['id']}},_0x269988,_0x31c420,_0x276acb,_0x59a0e8,_0x28b988;_0x54cdbd=_[_0x493f('0x42')]({},_0x54cdbd,_0x9c6e08[_0x493f('0x43')]);return db['AnalyticCustomReport'][_0x493f('0x49')](_0x54cdbd)[_0x493f('0x25')](function(_0x5edc4c){if(_0x5edc4c){_0x269988=_0x5edc4c;return _0x5edc4c['getFields']();}return null;})['then'](function(_0x3c8692){if(_0x3c8692){if(!_0x3c8692['length']){throw new db[(_0x493f('0x6c'))][(_0x493f('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x31c420=_0x3c8692;return db['AnalyticMetric'][_0x493f('0x46')]({'raw':!![]});}return null;})[_0x493f('0x25')](function(_0x2a192d){if(_0x2a192d){_0x276acb=_[_0x493f('0x6e')](_0x2a192d,'id');var _0x17571d;var _0x380e6d=squel[_0x493f('0x6f')]();_0x380e6d['from'](_0x269988[_0x493f('0x70')]);for(var _0x481d7e=0x0;_0x481d7e<_0x31c420[_0x493f('0x39')];_0x481d7e+=0x1){_0x17571d=_0x31c420[_0x481d7e][_0x493f('0x71')]?_0x276acb[_0x31c420[_0x481d7e][_0x493f('0x71')]][_0x493f('0x72')]:_0x31c420[_0x481d7e][_0x493f('0x69')];_0x17571d=_0x31c420[_0x481d7e][_0x493f('0x73')]?_[_0x493f('0x74')](_0x2b95d1[_0x31c420[_0x481d7e][_0x493f('0x73')]],'%s',_0x17571d):_0x17571d;_0x17571d=_0x31c420[_0x481d7e][_0x493f('0x75')]?_[_0x493f('0x74')](_0x2bc93b[_0x31c420[_0x481d7e][_0x493f('0x75')]],'%s',_0x17571d):_0x17571d;if(_0x31c420[_0x481d7e]['groupBy']){_0x380e6d[_0x493f('0x68')](_0x17571d);}_0x31c420[_0x481d7e][_0x493f('0x76')]&&_0x380e6d[_0x493f('0x3c')](_0x17571d,_0x31c420[_0x481d7e]['orderBy']===_0x493f('0x77')?![]:!![]);_0x380e6d[_0x493f('0x69')](_0x17571d,_0x31c420[_0x481d7e][_0x493f('0x78')]||_0x17571d);}if(_0x269988['joins']){_0x269988[_0x493f('0x79')]=JSON['parse'](_0x269988['joins']);for(var _0x1cfa36=0x0;_0x1cfa36<_0x269988[_0x493f('0x79')][_0x493f('0x39')];_0x1cfa36+=0x1){if(_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x31')]&&_[_0x493f('0x63')](_0x5ed462,_0x269988[_0x493f('0x79')][_0x1cfa36]['type'])&&_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7a')]&&_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7b')]&&_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7c')]){_0x380e6d[_0x269988[_0x493f('0x79')][_0x1cfa36]['type']](_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7b')],null,util['format'](_0x493f('0x7d'),_0x269988[_0x493f('0x70')],_0x269988['joins'][_0x1cfa36]['parentKey'],_0x269988[_0x493f('0x79')][_0x1cfa36][_0x493f('0x7b')],_0x269988[_0x493f('0x79')][_0x1cfa36]['foreignKey']));}}}if(_0x269988[_0x493f('0x7e')]){_0x269988[_0x493f('0x7e')]=JSON[_0x493f('0x7f')](_0x269988[_0x493f('0x7e')]);_0x380e6d['where'](_0x507376(_0x269988[_0x493f('0x7e')]['group']));}_0x28b988=_0x380e6d[_0x493f('0x80')]();_0x380e6d['limit'](_0x44ffde);_0x380e6d[_0x493f('0x1f')](0x0);logger[_0x493f('0x81')](_0x493f('0x82'),_0x380e6d[_0x493f('0x83')]());return dbH[_0x493f('0x84')]['query'](_0x380e6d['toString'](),{'type':dbH[_0x493f('0x84')][_0x493f('0x85')][_0x493f('0x86')]});}})[_0x493f('0x25')](respondWithResult(_0x2db416,null))[_0x493f('0x48')](handleError(_0x2db416,null));};function runReport(_0x2a0a75,_0x15a0a5,_0x1a77ee){var _0x268523=_0x15a0a5['name'];var _0x41bf51=0xa;var _0x17aa99=[_0x493f('0x87'),_0x493f('0x54'),_0x493f('0x55'),'cross_join'];var _0x5b9ee3={'SUM':_0x493f('0x57'),'COUNT':_0x493f('0x88'),'COUNT DISTINCT':_0x493f('0x58'),'MAX':'MAX(%s)','MIN':_0x493f('0x59'),'AVG':_0x493f('0x5a'),'GROUP_CONCAT':_0x493f('0x5b'),'GROUP_CONCAT ASC':_0x493f('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x153bf8={'SEC_TO_TIME':_0x493f('0x5e'),'DATE':_0x493f('0x5f'),'HOUR':_0x493f('0x60'),'ROUND':_0x493f('0x61'),'UNIX_TIMESTAMP':_0x493f('0x62')};var _0x4eccc3=function(_0xaf934){return!_[_0x493f('0x63')]([_0x493f('0x64'),'IS\x20NOT\x20NULL',_0x493f('0x89'),'IS\x20NOT\x20EMPTY'],_0xaf934);};var _0x2b1bfe=function(_0x373ce3){if(!_0x373ce3||!_0x373ce3[_0x493f('0x67')]['length']){return'';}for(var _0x300b42='(',_0x5bab0a=0x0;_0x5bab0a<_0x373ce3[_0x493f('0x67')][_0x493f('0x39')];_0x5bab0a+=0x1){_0x5bab0a>0x0&&(_0x300b42+='\x20'+_0x373ce3[_0x493f('0x8a')]+'\x20');_0x300b42+=_0x373ce3['rules'][_0x5bab0a]['group']?_0x2b1bfe(_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x68')]):_0x373ce3['rules'][_0x5bab0a]['field']+'\x20'+_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x6a')]+(_0x4eccc3(_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x6a')])?'\x20'+_0x373ce3[_0x493f('0x67')][_0x5bab0a][_0x493f('0x6b')]:'');}return _0x300b42+')';};var _0x131b58={'where':{'id':_0x2a0a75['id']}},_0x3204dc,_0x22e77d,_0xc628d4,_0xee874b,_0xdb2949;_0x131b58=_[_0x493f('0x42')]({},_0x131b58,_0x1a77ee);return db[_0x493f('0x2f')][_0x493f('0x49')](_0x131b58)['then'](function(_0x1122e9){if(_0x1122e9){_0x3204dc=_0x1122e9;return _0x1122e9[_0x493f('0x8b')]();}return null;})['then'](function(_0xe82b58){if(_0xe82b58){if(!_0xe82b58['length']){throw new db[(_0x493f('0x6c'))][(_0x493f('0x6d'))](_0x493f('0x8c'),0x193);}_0x22e77d=_0xe82b58;return db[_0x493f('0x8d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xa46a16){if(_0xa46a16){_0xc628d4=_[_0x493f('0x6e')](_0xa46a16,'id');var _0xf24eef;var _0x5895c1=squel[_0x493f('0x6f')]();_0x5895c1[_0x493f('0x8e')](_0x3204dc['table']);for(var _0x1c55d6=0x0;_0x1c55d6<_0x22e77d[_0x493f('0x39')];_0x1c55d6+=0x1){_0xf24eef=_0x22e77d[_0x1c55d6][_0x493f('0x71')]?_0xc628d4[_0x22e77d[_0x1c55d6][_0x493f('0x71')]]['metric']:_0x22e77d[_0x1c55d6][_0x493f('0x69')];_0xf24eef=_0x22e77d[_0x1c55d6][_0x493f('0x73')]?_['replace'](_0x5b9ee3[_0x22e77d[_0x1c55d6]['function']],'%s',_0xf24eef):_0xf24eef;_0xf24eef=_0x22e77d[_0x1c55d6]['format']?_[_0x493f('0x74')](_0x153bf8[_0x22e77d[_0x1c55d6][_0x493f('0x75')]],'%s',_0xf24eef):_0xf24eef;if(_0x22e77d[_0x1c55d6][_0x493f('0x8f')]){_0x5895c1[_0x493f('0x68')](_0xf24eef);}_0x22e77d[_0x1c55d6]['orderBy']&&_0x5895c1['order'](_0xf24eef,_0x22e77d[_0x1c55d6][_0x493f('0x76')]==='DESC'?![]:!![]);_0x5895c1[_0x493f('0x69')](_0xf24eef,_0x22e77d[_0x1c55d6][_0x493f('0x78')]||_0xf24eef);}if(_0x3204dc[_0x493f('0x79')]){_0x3204dc[_0x493f('0x79')]=JSON['parse'](_0x3204dc[_0x493f('0x79')]);for(var _0x10845e=0x0;_0x10845e<_0x3204dc[_0x493f('0x79')][_0x493f('0x39')];_0x10845e+=0x1){if(_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x31')]&&_['includes'](_0x17aa99,_0x3204dc[_0x493f('0x79')][_0x10845e]['type'])&&_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x7a')]&&_0x3204dc[_0x493f('0x79')][_0x10845e]['foreignTable']&&_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x7c')]){_0x5895c1[_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x31')]](_0x3204dc['joins'][_0x10845e][_0x493f('0x7b')],null,util[_0x493f('0x75')](_0x493f('0x7d'),_0x3204dc['table'],_0x3204dc[_0x493f('0x79')][_0x10845e][_0x493f('0x7a')],_0x3204dc[_0x493f('0x79')][_0x10845e]['foreignTable'],_0x3204dc[_0x493f('0x79')][_0x10845e]['foreignKey']));}}}if(_0x3204dc[_0x493f('0x7e')]){_0x3204dc[_0x493f('0x7e')]=JSON[_0x493f('0x7f')](_0x3204dc[_0x493f('0x7e')]);_0x5895c1[_0x493f('0x3e')](_0x2b1bfe(_0x3204dc[_0x493f('0x7e')]['group']));}_0xdb2949=_0x5895c1[_0x493f('0x80')]();_0x5895c1[_0x493f('0x22')](_0x41bf51);_0x5895c1[_0x493f('0x1f')](0x0);return;}})[_0x493f('0x25')](function(){if(_0x15a0a5[_0x493f('0x90')]==='web'){return null;}var _0x44ff76=_['merge'](_0x15a0a5,{'name':_0x15a0a5[_0x493f('0x91')]||_0x15a0a5['name']||_0x3204dc[_0x493f('0x2d')],'basename':_0x268523,'savename':util['format'](_0x493f('0x92'),_0x15a0a5['name']||_0x3204dc[_0x493f('0x2d')],require(_0x493f('0x93'))[_0x493f('0x94')](0x4),_0x15a0a5[_0x493f('0x90')]||_0x493f('0x95')),'reportId':_0x3204dc['id'],'reportType':_0x493f('0x96')});return db[_0x493f('0x97')][_0x493f('0x4a')](_0x44ff76,{'raw':!![]});})[_0x493f('0x25')](function(_0xe73fed){if(_0x3204dc['table']==='cdr'){_0xdb2949[_0x493f('0x3e')](_0x3204dc[_0x493f('0x70')]+_0x493f('0x98'),_0x15a0a5[_0x493f('0x99')],_0x15a0a5['endDate']);}else{_0xdb2949[_0x493f('0x3e')](_0x3204dc[_0x493f('0x70')]+_0x493f('0x9a'),_0x15a0a5['startDate'],_0x15a0a5[_0x493f('0x9b')]);}if(_0xe73fed){logger[_0x493f('0x9c')](_0x493f('0x9d'),_0xdb2949[_0x493f('0x83')]());require(_0x493f('0x9e'))['fork'](path[_0x493f('0x87')](__dirname,'../../components/export/',_0xe73fed[_0x493f('0x90')]),[_0xe73fed['id'],_0xdb2949[_0x493f('0x83')](),path[_0x493f('0x87')](__dirname,_0x493f('0x9f'),_0xe73fed[_0x493f('0xa0')]),_0x268523]);return _0xe73fed;}else{var _0x3859ef=squel[_0x493f('0x6f')]();_0x3859ef[_0x493f('0x8e')]('('+_0xdb2949[_0x493f('0x83')]()+')',_0x493f('0xa1'));_0x3859ef[_0x493f('0x69')](_0x493f('0xa2'),_0x493f('0x21'));_0xdb2949[_0x493f('0x22')](_0x15a0a5['limit']||_0x41bf51);_0xdb2949['offset'](_0x15a0a5[_0x493f('0x1f')]||0x0);return dbH[_0x493f('0x84')]['query'](_0x3859ef[_0x493f('0x83')](),{'type':dbH['sequelize'][_0x493f('0x85')]['SELECT']})[_0x493f('0x25')](function(_0x39bf78){if(!_0x39bf78[_0x493f('0x39')]){_0xee874b=0x0;}else{_0xee874b=_0x39bf78[0x0][_0x493f('0x21')]||0x0;}return dbH[_0x493f('0x84')][_0x493f('0x34')](_0xdb2949[_0x493f('0x83')](),{'type':dbH[_0x493f('0x84')][_0x493f('0x85')][_0x493f('0x86')]});})['then'](function(_0x4ab383){return{'rows':_0x4ab383||[],'count':_0xee874b};});}});}exports[_0x493f('0xa3')]=function(_0x4f232f,_0x3ac606){return runReport(_0x4f232f[_0x493f('0x53')],_0x4f232f[_0x493f('0x34')],_0x4f232f[_0x493f('0x43')])[_0x493f('0x25')](respondWithResult(_0x3ac606,null))[_0x493f('0x48')](handleError(_0x3ac606,null));};exports[_0x493f('0xa4')]=runReport;exports[_0x493f('0x34')]=function(_0x3896a3,_0x1138da){var _0x435789=0xa;var _0x3ae1ea=[_0x493f('0x87'),_0x493f('0x54'),_0x493f('0x55'),_0x493f('0x56')];var _0x35a20a={'SUM':_0x493f('0x57'),'COUNT':_0x493f('0x88'),'COUNT DISTINCT':_0x493f('0x58'),'MAX':_0x493f('0xa5'),'MIN':_0x493f('0x59'),'AVG':_0x493f('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x493f('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x362a15={'SEC_TO_TIME':_0x493f('0x5e'),'DATE':_0x493f('0x5f'),'HOUR':_0x493f('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x493f('0x62')};var _0x5d7d13=function(_0x39aec6){return!_[_0x493f('0x63')]([_0x493f('0x64'),_0x493f('0x65'),_0x493f('0x89'),'IS\x20NOT\x20EMPTY'],_0x39aec6);};var _0x2fff0c=function(_0x521633){if(!_0x521633||!_0x521633['rules'][_0x493f('0x39')]){return'';}for(var _0x3f28fe='(',_0x54f17f=0x0;_0x54f17f<_0x521633['rules'][_0x493f('0x39')];_0x54f17f+=0x1){_0x54f17f>0x0&&(_0x3f28fe+='\x20'+_0x521633['operator']+'\x20');_0x3f28fe+=_0x521633['rules'][_0x54f17f][_0x493f('0x68')]?_0x2fff0c(_0x521633[_0x493f('0x67')][_0x54f17f][_0x493f('0x68')]):_0x521633['rules'][_0x54f17f]['field']+'\x20'+_0x521633[_0x493f('0x67')][_0x54f17f]['condition']+(_0x5d7d13(_0x521633['rules'][_0x54f17f][_0x493f('0x6a')])?'\x20'+_0x521633[_0x493f('0x67')][_0x54f17f]['value']:'');}return _0x3f28fe+')';};var _0x4dbaf8={'where':{'id':_0x3896a3[_0x493f('0x53')]['id']}},_0x1fdf35,_0x4d5cac,_0x20d5c3,_0x40ea7e,_0x5abf64;_0x4dbaf8=_[_0x493f('0x42')]({},_0x4dbaf8,_0x3896a3[_0x493f('0x43')]);return db['AnalyticCustomReport'][_0x493f('0x49')](_0x4dbaf8)['then'](function(_0x1b745f){if(_0x1b745f){_0x1fdf35=_0x1b745f;return _0x1b745f[_0x493f('0x8b')]();}return null;})[_0x493f('0x25')](function(_0x2531a6){if(_0x2531a6){if(!_0x2531a6[_0x493f('0x39')]){throw new db[(_0x493f('0x6c'))]['ValidationErrorItem'](_0x493f('0x8c'),0x193);}_0x4d5cac=_0x2531a6;return db[_0x493f('0x8d')][_0x493f('0x46')]({'raw':!![]});}return null;})[_0x493f('0x25')](function(_0x3e93a5){if(_0x3e93a5){_0x20d5c3=_['keyBy'](_0x3e93a5,'id');var _0x245265;var _0x3168d1=squel[_0x493f('0x6f')]();_0x3168d1['from'](_0x1fdf35['table']);for(var _0x5a3707=0x0;_0x5a3707<_0x4d5cac['length'];_0x5a3707+=0x1){_0x245265=_0x4d5cac[_0x5a3707][_0x493f('0x71')]?_0x20d5c3[_0x4d5cac[_0x5a3707][_0x493f('0x71')]][_0x493f('0x72')]:_0x4d5cac[_0x5a3707][_0x493f('0x69')];_0x245265=_0x4d5cac[_0x5a3707]['function']?_[_0x493f('0x74')](_0x35a20a[_0x4d5cac[_0x5a3707][_0x493f('0x73')]],'%s',_0x245265):_0x245265;_0x245265=_0x4d5cac[_0x5a3707][_0x493f('0x75')]?_[_0x493f('0x74')](_0x362a15[_0x4d5cac[_0x5a3707][_0x493f('0x75')]],'%s',_0x245265):_0x245265;if(_0x4d5cac[_0x5a3707][_0x493f('0x8f')]){_0x3168d1['group'](_0x245265);}_0x4d5cac[_0x5a3707][_0x493f('0x76')]&&_0x3168d1[_0x493f('0x3c')](_0x245265,_0x4d5cac[_0x5a3707][_0x493f('0x76')]===_0x493f('0x77')?![]:!![]);_0x3168d1[_0x493f('0x69')](_0x245265,_0x4d5cac[_0x5a3707][_0x493f('0x78')]||_0x245265);}if(_0x1fdf35[_0x493f('0x79')]){_0x1fdf35[_0x493f('0x79')]=JSON[_0x493f('0x7f')](_0x1fdf35[_0x493f('0x79')]);for(var _0x956283=0x0;_0x956283<_0x1fdf35[_0x493f('0x79')][_0x493f('0x39')];_0x956283+=0x1){if(_0x1fdf35['joins'][_0x956283]['type']&&_[_0x493f('0x63')](_0x3ae1ea,_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x31')])&&_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7a')]&&_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7b')]&&_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7c')]){_0x3168d1[_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x31')]](_0x1fdf35['joins'][_0x956283][_0x493f('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1fdf35['table'],_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7a')],_0x1fdf35['joins'][_0x956283][_0x493f('0x7b')],_0x1fdf35[_0x493f('0x79')][_0x956283][_0x493f('0x7c')]));}}}if(_0x1fdf35[_0x493f('0x7e')]){_0x1fdf35[_0x493f('0x7e')]=JSON[_0x493f('0x7f')](_0x1fdf35[_0x493f('0x7e')]);_0x3168d1['where'](_0x2fff0c(_0x1fdf35['conditions'][_0x493f('0x68')]));}_0x5abf64=_0x3168d1[_0x493f('0x80')]();_0x3168d1[_0x493f('0x22')](_0x435789);_0x3168d1['offset'](0x0);logger[_0x493f('0x81')](_0x493f('0x82'),_0x3168d1[_0x493f('0x83')]());return dbH[_0x493f('0x84')][_0x493f('0x34')](_0x3168d1['toString'](),{'type':dbH[_0x493f('0x84')][_0x493f('0x85')]['SELECT']});}})['then'](function(){return{'sql':_0x5abf64['toString']()};})[_0x493f('0x25')](respondWithResult(_0x1138da,null))[_0x493f('0x48')](handleError(_0x1138da,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 08da3d7..635aa01 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 _0x8f52=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport'];(function(_0x499be0,_0x44d273){var _0x212ec6=function(_0x44397a){while(--_0x44397a){_0x499be0['push'](_0x499be0['shift']());}};_0x212ec6(++_0x44d273);}(_0x8f52,0x76));var _0x28f5=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0x8f52[_0x11dc39];return _0x457277;};'use strict';var _=require('lodash');var util=require(_0x28f5('0x0'));var logger=require(_0x28f5('0x1'))(_0x28f5('0x2'));var moment=require(_0x28f5('0x3'));var BPromise=require(_0x28f5('0x4'));var rp=require(_0x28f5('0x5'));var fs=require('fs');var path=require(_0x28f5('0x6'));var rimraf=require(_0x28f5('0x7'));var config=require(_0x28f5('0x8'));var attributes=require(_0x28f5('0x9'));module[_0x28f5('0xa')]=function(_0x504845,_0x123931){return _0x504845['define'](_0x28f5('0xb'),attributes,{'tableName':_0x28f5('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1052=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x4e8099,_0x1372ed){var _0x535f9e=function(_0x5238c4){while(--_0x5238c4){_0x4e8099['push'](_0x4e8099['shift']());}};_0x535f9e(++_0x1372ed);}(_0x1052,0x168));var _0x2105=function(_0x4c8779,_0x399ca4){_0x4c8779=_0x4c8779-0x0;var _0x55a207=_0x1052[_0x4c8779];return _0x55a207;};'use strict';var _=require(_0x2105('0x0'));var util=require(_0x2105('0x1'));var logger=require(_0x2105('0x2'))(_0x2105('0x3'));var moment=require('moment');var BPromise=require(_0x2105('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2105('0x5'));var rimraf=require(_0x2105('0x6'));var config=require(_0x2105('0x7'));var attributes=require(_0x2105('0x8'));module[_0x2105('0x9')]=function(_0x16f76c,_0x34e4eb){return _0x16f76c[_0x2105('0xa')](_0x2105('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 40246b3..c9d568a 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 _0x0794=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug'];(function(_0x1541d2,_0x4c1463){var _0x4a7e10=function(_0x48a3a9){while(--_0x48a3a9){_0x1541d2['push'](_0x1541d2['shift']());}};_0x4a7e10(++_0x4c1463);}(_0x0794,0xd5));var _0x4079=function(_0x428d93,_0x16b0ba){_0x428d93=_0x428d93-0x0;var _0x2a2002=_0x0794[_0x428d93];return _0x2a2002;};'use strict';var _=require(_0x4079('0x0'));var util=require(_0x4079('0x1'));var moment=require('moment');var BPromise=require(_0x4079('0x2'));var rs=require(_0x4079('0x3'));var fs=require('fs');var Redis=require(_0x4079('0x4'));var db=require(_0x4079('0x5'))['db'];var utils=require(_0x4079('0x6'));var logger=require(_0x4079('0x7'))('rpc');var config=require(_0x4079('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4079('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x378592,_0x5edcaa,_0x1f1b58){return new BPromise(function(_0x590517,_0x266a5f){return client[_0x4079('0xa')](_0x378592,_0x1f1b58)[_0x4079('0xb')](function(_0x2457eb){logger[_0x4079('0xc')](_0x4079('0xd'),_0x5edcaa,'request\x20sent');logger[_0x4079('0xe')](_0x4079('0xf'),_0x5edcaa,'request\x20sent',JSON['stringify'](_0x2457eb));if(_0x2457eb[_0x4079('0x10')]){if(_0x2457eb[_0x4079('0x10')]['code']===0x1f4){logger[_0x4079('0x10')](_0x4079('0xd'),_0x5edcaa,_0x2457eb[_0x4079('0x10')][_0x4079('0x11')]);return _0x266a5f(_0x2457eb[_0x4079('0x10')]['message']);}logger[_0x4079('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5edcaa,_0x2457eb[_0x4079('0x10')][_0x4079('0x11')]);return _0x590517(_0x2457eb[_0x4079('0x10')][_0x4079('0x11')]);}else{logger['info'](_0x4079('0xd'),_0x5edcaa,'request\x20sent');_0x590517(_0x2457eb[_0x4079('0x12')][_0x4079('0x11')]);}})['catch'](function(_0x42d6af){logger[_0x4079('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5edcaa,_0x42d6af);_0x266a5f(_0x42d6af);});});}
\ No newline at end of file
+var _0x7768=['../../config/utils','rpc','../../config/environment','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2f560e,_0x1cc398){var _0x652c1c=function(_0x320efa){while(--_0x320efa){_0x2f560e['push'](_0x2f560e['shift']());}};_0x652c1c(++_0x1cc398);}(_0x7768,0x1f0));var _0x8776=function(_0x3d9669,_0x471ea2){_0x3d9669=_0x3d9669-0x0;var _0x5c63ea=_0x7768[_0x3d9669];return _0x5c63ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8776('0x0'));var BPromise=require(_0x8776('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8776('0x2'));var db=require(_0x8776('0x3'))['db'];var utils=require(_0x8776('0x4'));var logger=require('../../config/logger')(_0x8776('0x5'));var config=require(_0x8776('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8776('0x7')][_0x8776('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f158a,_0x569785,_0xac3149){return new BPromise(function(_0x3be907,_0x5da419){return client[_0x8776('0x9')](_0x1f158a,_0xac3149)['then'](function(_0x14a348){logger[_0x8776('0xa')](_0x8776('0xb'),_0x569785,'request\x20sent');logger[_0x8776('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x569785,_0x8776('0xd'),JSON[_0x8776('0xe')](_0x14a348));if(_0x14a348[_0x8776('0xf')]){if(_0x14a348[_0x8776('0xf')][_0x8776('0x10')]===0x1f4){logger[_0x8776('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x569785,_0x14a348[_0x8776('0xf')][_0x8776('0x11')]);return _0x5da419(_0x14a348[_0x8776('0xf')]['message']);}logger[_0x8776('0xf')](_0x8776('0xb'),_0x569785,_0x14a348[_0x8776('0xf')][_0x8776('0x11')]);return _0x3be907(_0x14a348['error']['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x569785,_0x8776('0xd'));_0x3be907(_0x14a348[_0x8776('0x12')][_0x8776('0x11')]);}})[_0x8776('0x13')](function(_0xe5ac83){logger[_0x8776('0xf')](_0x8776('0xb'),_0x569785,_0xe5ac83);_0x5da419(_0xe5ac83);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8f44461..a9132da 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 _0xaee4=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaee4,0x65));var _0x4aee=function(_0x70f3ff,_0x3599b0){_0x70f3ff=_0x70f3ff-0x0;var _0x87a145=_0xaee4[_0x70f3ff];return _0x87a145;};'use strict';var multer=require('multer');var util=require(_0x4aee('0x0'));var path=require(_0x4aee('0x1'));var timeout=require(_0x4aee('0x2'));var express=require(_0x4aee('0x3'));var router=express[_0x4aee('0x4')]();var fs_extra=require(_0x4aee('0x5'));var auth=require(_0x4aee('0x6'));var interaction=require(_0x4aee('0x7'));var config=require(_0x4aee('0x8'));var controller=require(_0x4aee('0x9'));router['get']('/',auth[_0x4aee('0xa')](),controller[_0x4aee('0xb')]);router[_0x4aee('0xc')]('/:id',auth[_0x4aee('0xa')](),controller[_0x4aee('0xd')]);router[_0x4aee('0xc')](_0x4aee('0xe'),auth['isAuthenticated'](),controller[_0x4aee('0xf')]);router['get'](_0x4aee('0x10'),auth[_0x4aee('0xa')](),controller[_0x4aee('0x11')]);router[_0x4aee('0xc')](_0x4aee('0x12'),auth[_0x4aee('0xa')](),controller[_0x4aee('0x13')]);router[_0x4aee('0x14')]('/',auth[_0x4aee('0xa')](),controller[_0x4aee('0x15')]);router[_0x4aee('0x16')](_0x4aee('0x17'),auth[_0x4aee('0xa')](),controller[_0x4aee('0x18')]);router[_0x4aee('0x19')]('/:id',auth[_0x4aee('0xa')](),controller['destroy']);module[_0x4aee('0x1a')]=router;
\ No newline at end of file
+var _0x347e=['put','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create'];(function(_0x58943d,_0x18b43e){var _0x238275=function(_0x3e0413){while(--_0x3e0413){_0x58943d['push'](_0x58943d['shift']());}};_0x238275(++_0x18b43e);}(_0x347e,0x18f));var _0xe347=function(_0x434c42,_0x4f687b){_0x434c42=_0x434c42-0x0;var _0x272e65=_0x347e[_0x434c42];return _0x272e65;};'use strict';var multer=require(_0xe347('0x0'));var util=require(_0xe347('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe347('0x2'));var router=express[_0xe347('0x3')]();var fs_extra=require(_0xe347('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe347('0x5'));var config=require(_0xe347('0x6'));var controller=require(_0xe347('0x7'));router[_0xe347('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe347('0x8')](_0xe347('0x9'),auth[_0xe347('0xa')](),controller[_0xe347('0xb')]);router['get'](_0xe347('0xc'),auth[_0xe347('0xa')](),controller[_0xe347('0xd')]);router[_0xe347('0x8')](_0xe347('0xe'),auth[_0xe347('0xa')](),controller[_0xe347('0xf')]);router[_0xe347('0x8')](_0xe347('0x10'),auth[_0xe347('0xa')](),controller[_0xe347('0x11')]);router['post']('/',auth[_0xe347('0xa')](),controller[_0xe347('0x12')]);router[_0xe347('0x13')](_0xe347('0x9'),auth[_0xe347('0xa')](),controller['update']);router[_0xe347('0x14')](_0xe347('0x9'),auth[_0xe347('0xa')](),controller['destroy']);module[_0xe347('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 50801ad..31826d4 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f47=['TEXT','exports','STRING'];(function(_0x31259c,_0x31488d){var _0x220546=function(_0x347f7a){while(--_0x347f7a){_0x31259c['push'](_0x31259c['shift']());}};_0x220546(++_0x31488d);}(_0x6f47,0xc7));var _0x76f4=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x6f47[_0x576170];return _0x397c70;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x25a741,_0x5a072a){var _0x245fd3=function(_0x548856){while(--_0x548856){_0x25a741['push'](_0x25a741['shift']());}};_0x245fd3(++_0x5a072a);}(_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/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index e1b82a0..eff830c 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0xb331b1,_0x1e66e6){var _0x1ba713=function(_0x26ab5e){while(--_0x26ab5e){_0xb331b1['push'](_0xb331b1['shift']());}};_0x1ba713(++_0x1e66e6);}(_0x1967,0x173));var _0x7196=function(_0x3a7497,_0x2a27a4){_0x3a7497=_0x3a7497-0x0;var _0x5b8342=_0x1967[_0x3a7497];return _0x5b8342;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
+var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x39489a,_0x451b19){var _0x4490c4=function(_0x403970){while(--_0x403970){_0x39489a['push'](_0x39489a['shift']());}};_0x4490c4(++_0x451b19);}(_0x1967,0x173));var _0x7196=function(_0x4d0cf9,_0x24f340){_0x4d0cf9=_0x4d0cf9-0x0;var _0x3dfa90=_0x1967[_0x4d0cf9];return _0x3dfa90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index da78ea2..f45fd1f 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 _0x1749=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36edd2,_0x44c0b5){var _0x55bdb7=function(_0x12a3a7){while(--_0x12a3a7){_0x36edd2['push'](_0x36edd2['shift']());}};_0x55bdb7(++_0x44c0b5);}(_0x1749,0xba));var _0x9174=function(_0x4f5b11,_0x44a329){_0x4f5b11=_0x4f5b11-0x0;var _0x1d81a8=_0x1749[_0x4f5b11];return _0x1d81a8;};'use strict';var _=require(_0x9174('0x0'));var util=require(_0x9174('0x1'));var logger=require(_0x9174('0x2'))('api');var moment=require(_0x9174('0x3'));var BPromise=require(_0x9174('0x4'));var rp=require(_0x9174('0x5'));var fs=require('fs');var path=require(_0x9174('0x6'));var rimraf=require(_0x9174('0x7'));var config=require(_0x9174('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x9174('0x9')]=function(_0x85b92d,_0x185cd6){return _0x85b92d[_0x9174('0xa')](_0x9174('0xb'),attributes,{'tableName':_0x9174('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xadfa=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x26b9ec,_0x5363de){var _0x2321aa=function(_0x5e8458){while(--_0x5e8458){_0x26b9ec['push'](_0x26b9ec['shift']());}};_0x2321aa(++_0x5363de);}(_0xadfa,0x99));var _0xaadf=function(_0x247175,_0x7f804d){_0x247175=_0x247175-0x0;var _0x14ccf6=_0xadfa[_0x247175];return _0x14ccf6;};'use strict';var _=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var logger=require(_0xaadf('0x2'))('api');var moment=require(_0xaadf('0x3'));var BPromise=require(_0xaadf('0x4'));var rp=require(_0xaadf('0x5'));var fs=require('fs');var path=require(_0xaadf('0x6'));var rimraf=require(_0xaadf('0x7'));var config=require(_0xaadf('0x8'));var attributes=require(_0xaadf('0x9'));module[_0xaadf('0xa')]=function(_0x2db6a2,_0x1abebb){return _0x2db6a2[_0xaadf('0xb')](_0xaadf('0xc'),attributes,{'tableName':_0xaadf('0xd'),'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 9eb36d2..8a17d3f 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 _0x5c1d=['code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xd988e6,_0x4f84fa){var _0x5b2947=function(_0x405a30){while(--_0x405a30){_0xd988e6['push'](_0xd988e6['shift']());}};_0x5b2947(++_0x4f84fa);}(_0x5c1d,0x1bb));var _0xd5c1=function(_0x7bb360,_0x1984aa){_0x7bb360=_0x7bb360-0x0;var _0x19f0a0=_0x5c1d[_0x7bb360];return _0x19f0a0;};'use strict';var _=require(_0xd5c1('0x0'));var util=require(_0xd5c1('0x1'));var moment=require(_0xd5c1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5c1('0x3'));var db=require(_0xd5c1('0x4'))['db'];var utils=require(_0xd5c1('0x5'));var logger=require('../../config/logger')(_0xd5c1('0x6'));var config=require('../../config/environment');var jayson=require(_0xd5c1('0x7'));var client=jayson[_0xd5c1('0x8')][_0xd5c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42798b,_0x819d2f,_0x258681){return new BPromise(function(_0x3983aa,_0x15ee50){return client[_0xd5c1('0xa')](_0x42798b,_0x258681)['then'](function(_0x4dfc26){logger[_0xd5c1('0xb')](_0xd5c1('0xc'),_0x819d2f,'request\x20sent');logger['debug'](_0xd5c1('0xd'),_0x819d2f,_0xd5c1('0xe'),JSON[_0xd5c1('0xf')](_0x4dfc26));if(_0x4dfc26[_0xd5c1('0x10')]){if(_0x4dfc26[_0xd5c1('0x10')][_0xd5c1('0x11')]===0x1f4){logger[_0xd5c1('0x10')](_0xd5c1('0xc'),_0x819d2f,_0x4dfc26[_0xd5c1('0x10')][_0xd5c1('0x12')]);return _0x15ee50(_0x4dfc26['error'][_0xd5c1('0x12')]);}logger['error'](_0xd5c1('0xc'),_0x819d2f,_0x4dfc26['error'][_0xd5c1('0x12')]);return _0x3983aa(_0x4dfc26['error'][_0xd5c1('0x12')]);}else{logger[_0xd5c1('0xb')](_0xd5c1('0xc'),_0x819d2f,_0xd5c1('0xe'));_0x3983aa(_0x4dfc26['result']['message']);}})[_0xd5c1('0x13')](function(_0x2f4a10){logger[_0xd5c1('0x10')](_0xd5c1('0xc'),_0x819d2f,_0x2f4a10);_0x15ee50(_0x2f4a10);});});}
\ No newline at end of file
+var _0x93fa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1a6d6b,_0x1c5439){var _0x170bcd=function(_0x5df420){while(--_0x5df420){_0x1a6d6b['push'](_0x1a6d6b['shift']());}};_0x170bcd(++_0x1c5439);}(_0x93fa,0x141));var _0xa93f=function(_0x56aab0,_0x4afd25){_0x56aab0=_0x56aab0-0x0;var _0xa15bf4=_0x93fa[_0x56aab0];return _0xa15bf4;};'use strict';var _=require(_0xa93f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa93f('0x1'));var rs=require(_0xa93f('0x2'));var fs=require('fs');var Redis=require(_0xa93f('0x3'));var db=require(_0xa93f('0x4'))['db'];var utils=require(_0xa93f('0x5'));var logger=require(_0xa93f('0x6'))(_0xa93f('0x7'));var config=require(_0xa93f('0x8'));var jayson=require(_0xa93f('0x9'));var client=jayson[_0xa93f('0xa')][_0xa93f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb0a3e5,_0x2ff3f7,_0x1ff97e){return new BPromise(function(_0x12e311,_0x27b322){return client[_0xa93f('0xc')](_0xb0a3e5,_0x1ff97e)[_0xa93f('0xd')](function(_0x24ff06){logger[_0xa93f('0xe')](_0xa93f('0xf'),_0x2ff3f7,_0xa93f('0x10'));logger[_0xa93f('0x11')](_0xa93f('0x12'),_0x2ff3f7,_0xa93f('0x10'),JSON[_0xa93f('0x13')](_0x24ff06));if(_0x24ff06[_0xa93f('0x14')]){if(_0x24ff06[_0xa93f('0x14')][_0xa93f('0x15')]===0x1f4){logger[_0xa93f('0x14')](_0xa93f('0xf'),_0x2ff3f7,_0x24ff06[_0xa93f('0x14')][_0xa93f('0x16')]);return _0x27b322(_0x24ff06['error'][_0xa93f('0x16')]);}logger['error'](_0xa93f('0xf'),_0x2ff3f7,_0x24ff06[_0xa93f('0x14')][_0xa93f('0x16')]);return _0x12e311(_0x24ff06[_0xa93f('0x14')][_0xa93f('0x16')]);}else{logger[_0xa93f('0xe')](_0xa93f('0xf'),_0x2ff3f7,_0xa93f('0x10'));_0x12e311(_0x24ff06[_0xa93f('0x17')][_0xa93f('0x16')]);}})[_0xa93f('0x18')](function(_0x5d341a){logger[_0xa93f('0x14')](_0xa93f('0xf'),_0x2ff3f7,_0x5d341a);_0x27b322(_0x5d341a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index d279a74..34bde10 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 _0x08d4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2f8ef3,_0xc96ff2){var _0x223a26=function(_0x22aa0a){while(--_0x22aa0a){_0x2f8ef3['push'](_0x2f8ef3['shift']());}};_0x223a26(++_0xc96ff2);}(_0x08d4,0x1af));var _0x408d=function(_0x402b42,_0x205681){_0x402b42=_0x402b42-0x0;var _0x1b4560=_0x08d4[_0x402b42];return _0x1b4560;};'use strict';var multer=require(_0x408d('0x0'));var util=require(_0x408d('0x1'));var path=require(_0x408d('0x2'));var timeout=require(_0x408d('0x3'));var express=require(_0x408d('0x4'));var router=express[_0x408d('0x5')]();var fs_extra=require(_0x408d('0x6'));var auth=require(_0x408d('0x7'));var interaction=require(_0x408d('0x8'));var config=require(_0x408d('0x9'));var controller=require('./analyticDefaultReport.controller');router[_0x408d('0xa')]('/',auth[_0x408d('0xb')](),controller[_0x408d('0xc')]);router[_0x408d('0xa')](_0x408d('0xd'),auth[_0x408d('0xb')](),controller[_0x408d('0xe')]);router[_0x408d('0xa')](_0x408d('0xf'),auth[_0x408d('0xb')](),controller[_0x408d('0x10')]);router['get']('/:id/run',auth[_0x408d('0xb')](),controller[_0x408d('0x11')]);router['get'](_0x408d('0x12'),auth['isAuthenticated'](),controller[_0x408d('0x13')]);router[_0x408d('0x14')]('/',auth[_0x408d('0xb')](),controller[_0x408d('0x15')]);router[_0x408d('0x16')]('/:id',auth[_0x408d('0xb')](),controller[_0x408d('0x17')]);router[_0x408d('0x18')](_0x408d('0xd'),auth[_0x408d('0xb')](),controller[_0x408d('0x19')]);module[_0x408d('0x1a')]=router;
\ No newline at end of file
+var _0x4149=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','update','delete','destroy','exports','util','path'];(function(_0x2d6a5b,_0x39bb49){var _0x127cda=function(_0x5deff9){while(--_0x5deff9){_0x2d6a5b['push'](_0x2d6a5b['shift']());}};_0x127cda(++_0x39bb49);}(_0x4149,0xa6));var _0x9414=function(_0x32c7aa,_0x238e2f){_0x32c7aa=_0x32c7aa-0x0;var _0x201abc=_0x4149[_0x32c7aa];return _0x201abc;};'use strict';var multer=require('multer');var util=require(_0x9414('0x0'));var path=require(_0x9414('0x1'));var timeout=require(_0x9414('0x2'));var express=require(_0x9414('0x3'));var router=express[_0x9414('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9414('0x5'));var interaction=require(_0x9414('0x6'));var config=require('../../config/environment');var controller=require(_0x9414('0x7'));router['get']('/',auth[_0x9414('0x8')](),controller[_0x9414('0x9')]);router[_0x9414('0xa')](_0x9414('0xb'),auth[_0x9414('0x8')](),controller[_0x9414('0xc')]);router[_0x9414('0xa')](_0x9414('0xd'),auth[_0x9414('0x8')](),controller[_0x9414('0xe')]);router[_0x9414('0xa')]('/:id/run',auth[_0x9414('0x8')](),controller[_0x9414('0xf')]);router[_0x9414('0xa')](_0x9414('0x10'),auth[_0x9414('0x8')](),controller[_0x9414('0x11')]);router[_0x9414('0x12')]('/',auth[_0x9414('0x8')](),controller[_0x9414('0x13')]);router['put'](_0x9414('0xb'),auth['isAuthenticated'](),controller[_0x9414('0x14')]);router[_0x9414('0x15')]('/:id',auth[_0x9414('0x8')](),controller[_0x9414('0x16')]);module[_0x9414('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 4b98df0..95a1edd 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 _0x3e2c=['DATE','Loading','scheduled','manual','INTEGER','sequelize','moment','exports','STRING','ENUM','pdf','xlsx'];(function(_0x4a1315,_0x58b7d5){var _0x16125a=function(_0x4854f7){while(--_0x4854f7){_0x4a1315['push'](_0x4a1315['shift']());}};_0x16125a(++_0x58b7d5);}(_0x3e2c,0x1cd));var _0xc3e2=function(_0x486f8e,_0x52fb5f){_0x486f8e=_0x486f8e-0x0;var _0x528b66=_0x3e2c[_0x486f8e];return _0x528b66;};'use strict';var Sequelize=require(_0xc3e2('0x0'));var moment=require(_0xc3e2('0x1'));module[_0xc3e2('0x2')]={'name':{'type':Sequelize[_0xc3e2('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc3e2('0x4')]('csv',_0xc3e2('0x5'),_0xc3e2('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc3e2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc3e2('0x7')]},'endDate':{'type':Sequelize[_0xc3e2('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc3e2('0x8')},'type':{'type':Sequelize[_0xc3e2('0x4')]('manual',_0xc3e2('0x9')),'allowNull':![],'defaultValue':_0xc3e2('0xa')},'reportId':{'type':Sequelize[_0xc3e2('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xc3e2('0x3')]}};
\ No newline at end of file
+var _0x8270=['moment','STRING','ENUM','pdf','csv','DATE','Loading','manual','scheduled'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x8270,0xb4));var _0x0827=function(_0x4e44ae,_0x51df27){_0x4e44ae=_0x4e44ae-0x0;var _0x4cb789=_0x8270[_0x4e44ae];return _0x4cb789;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0827('0x0'));module['exports']={'name':{'type':Sequelize[_0x0827('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x0827('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x0827('0x2')]('csv',_0x0827('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0x0827('0x4')},'savename':{'type':Sequelize[_0x0827('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0827('0x5')]},'endDate':{'type':Sequelize[_0x0827('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x0827('0x6')},'type':{'type':Sequelize[_0x0827('0x2')](_0x0827('0x7'),_0x0827('0x8')),'allowNull':![],'defaultValue':_0x0827('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 3693d97..e1d6fcb 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 _0x7759=['AnalyticExtractedReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0x7759,0x194));var _0x9775=function(_0x22662a,_0x1cbd57){_0x22662a=_0x22662a-0x0;var _0x2aba64=_0x7759[_0x22662a];return _0x2aba64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9775('0x0'));var zipdir=require(_0x9775('0x1'));var jsonpatch=require(_0x9775('0x2'));var rp=require(_0x9775('0x3'));var moment=require('moment');var BPromise=require(_0x9775('0x4'));var Mustache=require(_0x9775('0x5'));var util=require(_0x9775('0x6'));var path=require(_0x9775('0x7'));var sox=require('sox');var csv=require(_0x9775('0x8'));var ejs=require(_0x9775('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9775('0xa'));var squel=require(_0x9775('0xb'));var crypto=require(_0x9775('0xc'));var jsforce=require(_0x9775('0xd'));var deskjs=require(_0x9775('0xe'));var toCsv=require(_0x9775('0x8'));var querystring=require(_0x9775('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9775('0x10'));var qs=require(_0x9775('0x11'));var as=require(_0x9775('0x12'));var hardwareService=require(_0x9775('0x13'));var logger=require(_0x9775('0x14'))('api');var utils=require(_0x9775('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9775('0x16'));var db=require(_0x9775('0x17'))['db'];function respondWithStatusCode(_0x5b6809,_0xd1c228){_0xd1c228=_0xd1c228||0xcc;return function(_0x282fb5){if(_0x282fb5){return _0x5b6809[_0x9775('0x18')](_0xd1c228);}return _0x5b6809['status'](_0xd1c228)[_0x9775('0x19')]();};}function respondWithResult(_0x253102,_0x4bb0cd){_0x4bb0cd=_0x4bb0cd||0xc8;return function(_0x636671){if(_0x636671){return _0x253102[_0x9775('0x1a')](_0x4bb0cd)[_0x9775('0x1b')](_0x636671);}};}function respondWithFilteredResult(_0x47e5fa,_0x2483f9){return function(_0x584f82){if(_0x584f82){var _0x426fc5=typeof _0x2483f9[_0x9775('0x1c')]===_0x9775('0x1d')&&typeof _0x2483f9[_0x9775('0x1e')]===_0x9775('0x1d');var _0x307af3=_0x584f82[_0x9775('0x1f')];var _0x532fc8=_0x426fc5?0x0:_0x2483f9[_0x9775('0x1c')];var _0x2320e0=_0x426fc5?_0x584f82['count']:_0x2483f9[_0x9775('0x1c')]+_0x2483f9[_0x9775('0x1e')];var _0x1ed595;if(_0x2320e0>=_0x307af3){_0x2320e0=_0x307af3;_0x1ed595=0xc8;}else{_0x1ed595=0xce;}_0x47e5fa[_0x9775('0x1a')](_0x1ed595);return _0x47e5fa[_0x9775('0x20')]('Content-Range',_0x532fc8+'-'+_0x2320e0+'/'+_0x307af3)['json'](_0x584f82);}return null;};}function patchUpdates(_0x38cf19){return function(_0x448f4b){try{jsonpatch['apply'](_0x448f4b,_0x38cf19,!![]);}catch(_0x4d004e){return BPromise[_0x9775('0x21')](_0x4d004e);}return _0x448f4b[_0x9775('0x22')]();};}function saveUpdates(_0x428b48,_0x5a280f){return function(_0x28d255){if(_0x28d255){return _0x28d255[_0x9775('0x23')](_0x428b48)[_0x9775('0x24')](function(_0x5d948a){return _0x5d948a;});}return null;};}function removeEntity(_0x4c1042,_0xfd46de){return function(_0x2247b1){if(_0x2247b1){return _0x2247b1[_0x9775('0x25')]()[_0x9775('0x24')](function(){var _0x9bd5a8=_0x2247b1[_0x9775('0x26')]({'plain':!![]});var _0x2517a4=_0x9775('0x27');return db[_0x9775('0x28')]['destroy']({'where':{'type':_0x2517a4,'resourceId':_0x9bd5a8['id']}})[_0x9775('0x24')](function(){return _0x2247b1;});})['then'](function(){_0x4c1042[_0x9775('0x1a')](0xcc)[_0x9775('0x19')]();});}};}function handleEntityNotFound(_0x5f409e,_0x8806a6){return function(_0x57af3d){if(!_0x57af3d){_0x5f409e[_0x9775('0x18')](0x194);}return _0x57af3d;};}function handleError(_0x1b8d84,_0x173f2b){_0x173f2b=_0x173f2b||0x1f4;return function(_0x1f385b){logger[_0x9775('0x29')](_0x1f385b[_0x9775('0x2a')]);if(_0x1f385b[_0x9775('0x2b')]){delete _0x1f385b['name'];}_0x1b8d84['status'](_0x173f2b)['send'](_0x1f385b);};}exports[_0x9775('0x2c')]=function(_0x5c5751,_0x5e7f1f){var _0x366530={},_0x573909={},_0x3971ef={'count':0x0,'rows':[]};var _0x114b91=_[_0x9775('0x2d')](db[_0x9775('0x2e')][_0x9775('0x2f')],function(_0x55726d){return{'name':_0x55726d['fieldName'],'type':_0x55726d[_0x9775('0x30')][_0x9775('0x31')]};});_0x573909[_0x9775('0x32')]=_[_0x9775('0x2d')](_0x114b91,_0x9775('0x2b'));_0x573909['query']=_[_0x9775('0x33')](_0x5c5751[_0x9775('0x34')]);_0x573909['filters']=_[_0x9775('0x35')](_0x573909[_0x9775('0x32')],_0x573909['query']);_0x366530[_0x9775('0x36')]=_[_0x9775('0x35')](_0x573909[_0x9775('0x32')],qs[_0x9775('0x37')](_0x5c5751[_0x9775('0x34')][_0x9775('0x37')]));_0x366530[_0x9775('0x36')]=_0x366530['attributes'][_0x9775('0x38')]?_0x366530['attributes']:_0x573909[_0x9775('0x32')];if(!_0x5c5751['query']['hasOwnProperty'](_0x9775('0x39'))){_0x366530[_0x9775('0x1e')]=qs[_0x9775('0x1e')](_0x5c5751[_0x9775('0x34')][_0x9775('0x1e')]);_0x366530[_0x9775('0x1c')]=qs[_0x9775('0x1c')](_0x5c5751[_0x9775('0x34')][_0x9775('0x1c')]);}_0x366530['order']=qs[_0x9775('0x3a')](_0x5c5751[_0x9775('0x34')]['sort']);_0x366530['where']=qs[_0x9775('0x3b')](_['pick'](_0x5c5751[_0x9775('0x34')],_0x573909[_0x9775('0x3b')]),_0x114b91);if(_0x5c5751[_0x9775('0x34')][_0x9775('0x3c')]){_0x366530[_0x9775('0x3d')]=_[_0x9775('0x3e')](_0x366530[_0x9775('0x3d')],{'$or':_[_0x9775('0x2d')](_0x114b91,function(_0x30fa76){if(_0x30fa76[_0x9775('0x30')]!==_0x9775('0x3f')){var _0x2466dc={};_0x2466dc[_0x30fa76['name']]={'$like':'%'+_0x5c5751[_0x9775('0x34')][_0x9775('0x3c')]+'%'};return _0x2466dc;}})});}_0x366530=_[_0x9775('0x3e')]({},_0x366530,_0x5c5751[_0x9775('0x40')]);var _0x582ee2={'where':_0x366530[_0x9775('0x3d')]};return db[_0x9775('0x2e')]['count'](_0x582ee2)[_0x9775('0x24')](function(_0x2df0ce){_0x3971ef['count']=_0x2df0ce;if(_0x5c5751[_0x9775('0x34')][_0x9775('0x41')]){_0x366530[_0x9775('0x42')]=[{'all':!![]}];}return db[_0x9775('0x2e')]['findAll'](_0x366530);})[_0x9775('0x24')](function(_0x5c8031){_0x3971ef[_0x9775('0x43')]=_0x5c8031;return _0x3971ef;})['then'](respondWithFilteredResult(_0x5e7f1f,_0x366530))[_0x9775('0x44')](handleError(_0x5e7f1f,null));};exports[_0x9775('0x45')]=function(_0x4e858f,_0x4891db){var _0xcc1c42={'raw':!![],'where':{'id':_0x4e858f[_0x9775('0x46')]['id']}},_0x395970={};_0x395970[_0x9775('0x32')]=_['keys'](db['AnalyticExtractedReport'][_0x9775('0x2f')]);_0x395970[_0x9775('0x34')]=_[_0x9775('0x33')](_0x4e858f[_0x9775('0x34')]);_0x395970[_0x9775('0x3b')]=_[_0x9775('0x35')](_0x395970['model'],_0x395970[_0x9775('0x34')]);_0xcc1c42['attributes']=_[_0x9775('0x35')](_0x395970[_0x9775('0x32')],qs[_0x9775('0x37')](_0x4e858f['query'][_0x9775('0x37')]));_0xcc1c42[_0x9775('0x36')]=_0xcc1c42[_0x9775('0x36')][_0x9775('0x38')]?_0xcc1c42[_0x9775('0x36')]:_0x395970['model'];if(_0x4e858f['query'][_0x9775('0x41')]){_0xcc1c42[_0x9775('0x42')]=[{'all':!![]}];}_0xcc1c42=_['merge']({},_0xcc1c42,_0x4e858f[_0x9775('0x40')]);return db[_0x9775('0x2e')][_0x9775('0x47')](_0xcc1c42)[_0x9775('0x24')](handleEntityNotFound(_0x4891db,null))['then'](respondWithResult(_0x4891db,null))['catch'](handleError(_0x4891db,null));};exports[_0x9775('0x48')]=function(_0x10c69f,_0x383eb9){return db['AnalyticExtractedReport'][_0x9775('0x48')](_0x10c69f[_0x9775('0x49')],{})[_0x9775('0x24')](function(_0x1dd075){var _0xa1687d=_0x10c69f[_0x9775('0x4a')][_0x9775('0x26')]({'plain':!![]});if(!_0xa1687d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa1687d[_0x9775('0x4b')]===_0x9775('0x4a')){var _0x527546=_0x1dd075[_0x9775('0x26')]({'plain':!![]});var _0x57e073=_0x9775('0x27');return db[_0x9775('0x4c')][_0x9775('0x47')]({'where':{'name':_0x57e073,'userProfileId':_0xa1687d[_0x9775('0x4d')]},'raw':!![]})[_0x9775('0x24')](function(_0x2cf963){if(_0x2cf963&&_0x2cf963['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x527546[_0x9775('0x2b')],'resourceId':_0x527546['id'],'type':_0x2cf963['name'],'sectionId':_0x2cf963['id']},{})[_0x9775('0x24')](function(){return _0x1dd075;});}else{return _0x1dd075;}})['catch'](function(_0x50dbb0){logger['error'](_0x9775('0x4e'),_0x50dbb0);throw _0x50dbb0;});}return _0x1dd075;})[_0x9775('0x24')](respondWithResult(_0x383eb9,0xc9))['catch'](handleError(_0x383eb9,null));};exports['update']=function(_0x236004,_0x275f00){if(_0x236004['body']['id']){delete _0x236004[_0x9775('0x49')]['id'];}return db[_0x9775('0x2e')][_0x9775('0x47')]({'where':{'id':_0x236004[_0x9775('0x46')]['id']}})[_0x9775('0x24')](handleEntityNotFound(_0x275f00,null))[_0x9775('0x24')](saveUpdates(_0x236004[_0x9775('0x49')],null))[_0x9775('0x24')](respondWithResult(_0x275f00,null))[_0x9775('0x44')](handleError(_0x275f00,null));};exports[_0x9775('0x25')]=function(_0x3bc5f1,_0x1159ff){return db[_0x9775('0x2e')][_0x9775('0x47')]({'where':{'id':_0x3bc5f1[_0x9775('0x46')]['id']}})[_0x9775('0x24')](handleEntityNotFound(_0x1159ff,null))[_0x9775('0x24')](removeEntity(_0x1159ff,null))[_0x9775('0x44')](handleError(_0x1159ff,null));};exports[_0x9775('0x4f')]=function(_0x1b3f96,_0xee0fc0,_0x53fa5d){return db[_0x9775('0x2e')][_0x9775('0x47')]({'where':{'id':_0x1b3f96[_0x9775('0x46')]['id']},'attributes':[_0x9775('0x2b'),_0x9775('0x50'),'savename',_0x9775('0x51')],'raw':!![]})[_0x9775('0x24')](handleEntityNotFound(_0xee0fc0,null))[_0x9775('0x24')](function(_0x1403ff){if(_0x1403ff){if(!fs[_0x9775('0x52')](path['join'](config[_0x9775('0x53')],_0x9775('0x54'),_0x1403ff['savename']))){throw new db['Sequelize'][(_0x9775('0x55'))](_0x9775('0x56'));}if(_0x1b3f96[_0x9775('0x34')][_0x9775('0x57')]){return _0xee0fc0['sendStatus'](0xc8);}return _0xee0fc0[_0x9775('0x4f')](path['join'](config[_0x9775('0x53')],'server/files/reports',_0x1403ff[_0x9775('0x58')]),util['format']('%s.%s',_0x1403ff[_0x9775('0x50')]||_0x1403ff[_0x9775('0x2b')],_0x1403ff[_0x9775('0x51')][_0x9775('0x59')]()));}})['catch'](handleError(_0xee0fc0,null));};
\ No newline at end of file
+var _0x7d50=['includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','user','UserProfileSection','UserProfileResource','error','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','download','format','basename','toLowerCase','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','ExtractedReports','destroy','sendStatus','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options'];(function(_0x23f44d,_0x5d6a85){var _0x16b62b=function(_0x17b8df){while(--_0x17b8df){_0x23f44d['push'](_0x23f44d['shift']());}};_0x16b62b(++_0x5d6a85);}(_0x7d50,0x7e));var _0x07d5=function(_0x20aeb5,_0x16cd11){_0x20aeb5=_0x20aeb5-0x0;var _0x325c0e=_0x7d50[_0x20aeb5];return _0x325c0e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x07d5('0x0'));var jsonpatch=require(_0x07d5('0x1'));var rp=require('request-promise');var moment=require(_0x07d5('0x2'));var BPromise=require(_0x07d5('0x3'));var Mustache=require(_0x07d5('0x4'));var util=require(_0x07d5('0x5'));var path=require(_0x07d5('0x6'));var sox=require(_0x07d5('0x7'));var csv=require('to-csv');var ejs=require(_0x07d5('0x8'));var fs=require('fs');var fs_extra=require(_0x07d5('0x9'));var _=require(_0x07d5('0xa'));var squel=require('squel');var crypto=require(_0x07d5('0xb'));var jsforce=require(_0x07d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x07d5('0xd'));var querystring=require(_0x07d5('0xe'));var Papa=require(_0x07d5('0xf'));var Redis=require(_0x07d5('0x10'));var authService=require(_0x07d5('0x11'));var qs=require(_0x07d5('0x12'));var as=require(_0x07d5('0x13'));var hardwareService=require(_0x07d5('0x14'));var logger=require(_0x07d5('0x15'))(_0x07d5('0x16'));var utils=require('../../config/utils');var config=require(_0x07d5('0x17'));var licenseUtil=require(_0x07d5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46f2ce,_0x5c70ae){_0x5c70ae=_0x5c70ae||0xcc;return function(_0x161e09){if(_0x161e09){return _0x46f2ce['sendStatus'](_0x5c70ae);}return _0x46f2ce[_0x07d5('0x19')](_0x5c70ae)[_0x07d5('0x1a')]();};}function respondWithResult(_0x579385,_0x5de016){_0x5de016=_0x5de016||0xc8;return function(_0x270fb6){if(_0x270fb6){return _0x579385[_0x07d5('0x19')](_0x5de016)[_0x07d5('0x1b')](_0x270fb6);}};}function respondWithFilteredResult(_0x3b3e70,_0x31b20d){return function(_0x1940f0){if(_0x1940f0){var _0x55b268=typeof _0x31b20d[_0x07d5('0x1c')]===_0x07d5('0x1d')&&typeof _0x31b20d[_0x07d5('0x1e')]==='undefined';var _0x1467fc=_0x1940f0[_0x07d5('0x1f')];var _0x2b5859=_0x55b268?0x0:_0x31b20d[_0x07d5('0x1c')];var _0x36b3fb=_0x55b268?_0x1940f0[_0x07d5('0x1f')]:_0x31b20d[_0x07d5('0x1c')]+_0x31b20d['limit'];var _0x23dd12;if(_0x36b3fb>=_0x1467fc){_0x36b3fb=_0x1467fc;_0x23dd12=0xc8;}else{_0x23dd12=0xce;}_0x3b3e70[_0x07d5('0x19')](_0x23dd12);return _0x3b3e70[_0x07d5('0x20')](_0x07d5('0x21'),_0x2b5859+'-'+_0x36b3fb+'/'+_0x1467fc)[_0x07d5('0x1b')](_0x1940f0);}return null;};}function patchUpdates(_0x345320){return function(_0x587469){try{jsonpatch[_0x07d5('0x22')](_0x587469,_0x345320,!![]);}catch(_0x2c8427){return BPromise[_0x07d5('0x23')](_0x2c8427);}return _0x587469['save']();};}function saveUpdates(_0x915e80,_0x2466f5){return function(_0x420aa3){if(_0x420aa3){return _0x420aa3[_0x07d5('0x24')](_0x915e80)[_0x07d5('0x25')](function(_0x5b6371){return _0x5b6371;});}return null;};}function removeEntity(_0x27d40b,_0x40e968){return function(_0x4f253b){if(_0x4f253b){return _0x4f253b['destroy']()[_0x07d5('0x25')](function(){var _0x2e79da=_0x4f253b['get']({'plain':!![]});var _0x2568a8=_0x07d5('0x26');return db['UserProfileResource'][_0x07d5('0x27')]({'where':{'type':_0x2568a8,'resourceId':_0x2e79da['id']}})[_0x07d5('0x25')](function(){return _0x4f253b;});})['then'](function(){_0x27d40b[_0x07d5('0x19')](0xcc)[_0x07d5('0x1a')]();});}};}function handleEntityNotFound(_0x26d527,_0x40cb54){return function(_0x4fc2d8){if(!_0x4fc2d8){_0x26d527[_0x07d5('0x28')](0x194);}return _0x4fc2d8;};}function handleError(_0x62bb73,_0x249208){_0x249208=_0x249208||0x1f4;return function(_0x228782){logger['error'](_0x228782[_0x07d5('0x29')]);if(_0x228782[_0x07d5('0x2a')]){delete _0x228782['name'];}_0x62bb73[_0x07d5('0x19')](_0x249208)[_0x07d5('0x2b')](_0x228782);};}exports[_0x07d5('0x2c')]=function(_0x5ada8c,_0x51e224){var _0x2b9f12={},_0x22a115={},_0x2e6b60={'count':0x0,'rows':[]};var _0x4f52d7=_[_0x07d5('0x2d')](db[_0x07d5('0x2e')]['rawAttributes'],function(_0x1f7507){return{'name':_0x1f7507[_0x07d5('0x2f')],'type':_0x1f7507['type'][_0x07d5('0x30')]};});_0x22a115[_0x07d5('0x31')]=_[_0x07d5('0x2d')](_0x4f52d7,_0x07d5('0x2a'));_0x22a115[_0x07d5('0x32')]=_[_0x07d5('0x33')](_0x5ada8c[_0x07d5('0x32')]);_0x22a115[_0x07d5('0x34')]=_[_0x07d5('0x35')](_0x22a115[_0x07d5('0x31')],_0x22a115[_0x07d5('0x32')]);_0x2b9f12[_0x07d5('0x36')]=_[_0x07d5('0x35')](_0x22a115[_0x07d5('0x31')],qs[_0x07d5('0x37')](_0x5ada8c['query'][_0x07d5('0x37')]));_0x2b9f12[_0x07d5('0x36')]=_0x2b9f12[_0x07d5('0x36')][_0x07d5('0x38')]?_0x2b9f12[_0x07d5('0x36')]:_0x22a115[_0x07d5('0x31')];if(!_0x5ada8c['query'][_0x07d5('0x39')](_0x07d5('0x3a'))){_0x2b9f12[_0x07d5('0x1e')]=qs['limit'](_0x5ada8c['query'][_0x07d5('0x1e')]);_0x2b9f12[_0x07d5('0x1c')]=qs[_0x07d5('0x1c')](_0x5ada8c['query'][_0x07d5('0x1c')]);}_0x2b9f12[_0x07d5('0x3b')]=qs['sort'](_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x3c')]);_0x2b9f12['where']=qs[_0x07d5('0x34')](_[_0x07d5('0x3d')](_0x5ada8c[_0x07d5('0x32')],_0x22a115[_0x07d5('0x34')]),_0x4f52d7);if(_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x3e')]){_0x2b9f12['where']=_[_0x07d5('0x3f')](_0x2b9f12[_0x07d5('0x40')],{'$or':_['map'](_0x4f52d7,function(_0x4ec811){if(_0x4ec811[_0x07d5('0x41')]!==_0x07d5('0x42')){var _0x393c15={};_0x393c15[_0x4ec811[_0x07d5('0x2a')]]={'$like':'%'+_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x3e')]+'%'};return _0x393c15;}})});}_0x2b9f12=_[_0x07d5('0x3f')]({},_0x2b9f12,_0x5ada8c[_0x07d5('0x43')]);var _0x1a85c8={'where':_0x2b9f12['where']};return db[_0x07d5('0x2e')][_0x07d5('0x1f')](_0x1a85c8)[_0x07d5('0x25')](function(_0x166ec8){_0x2e6b60['count']=_0x166ec8;if(_0x5ada8c[_0x07d5('0x32')][_0x07d5('0x44')]){_0x2b9f12[_0x07d5('0x45')]=[{'all':!![]}];}return db[_0x07d5('0x2e')][_0x07d5('0x46')](_0x2b9f12);})[_0x07d5('0x25')](function(_0xc39f3e){_0x2e6b60[_0x07d5('0x47')]=_0xc39f3e;return _0x2e6b60;})[_0x07d5('0x25')](respondWithFilteredResult(_0x51e224,_0x2b9f12))[_0x07d5('0x48')](handleError(_0x51e224,null));};exports[_0x07d5('0x49')]=function(_0x26787a,_0x3c2991){var _0x5950ce={'raw':!![],'where':{'id':_0x26787a[_0x07d5('0x4a')]['id']}},_0xb9b954={};_0xb9b954['model']=_[_0x07d5('0x33')](db[_0x07d5('0x2e')][_0x07d5('0x4b')]);_0xb9b954['query']=_['keys'](_0x26787a[_0x07d5('0x32')]);_0xb9b954['filters']=_[_0x07d5('0x35')](_0xb9b954[_0x07d5('0x31')],_0xb9b954[_0x07d5('0x32')]);_0x5950ce[_0x07d5('0x36')]=_[_0x07d5('0x35')](_0xb9b954[_0x07d5('0x31')],qs[_0x07d5('0x37')](_0x26787a[_0x07d5('0x32')][_0x07d5('0x37')]));_0x5950ce['attributes']=_0x5950ce[_0x07d5('0x36')]['length']?_0x5950ce[_0x07d5('0x36')]:_0xb9b954['model'];if(_0x26787a[_0x07d5('0x32')][_0x07d5('0x44')]){_0x5950ce['include']=[{'all':!![]}];}_0x5950ce=_['merge']({},_0x5950ce,_0x26787a[_0x07d5('0x43')]);return db[_0x07d5('0x2e')][_0x07d5('0x4c')](_0x5950ce)[_0x07d5('0x25')](handleEntityNotFound(_0x3c2991,null))[_0x07d5('0x25')](respondWithResult(_0x3c2991,null))[_0x07d5('0x48')](handleError(_0x3c2991,null));};exports[_0x07d5('0x4d')]=function(_0x444fab,_0x4345a4){return db[_0x07d5('0x2e')][_0x07d5('0x4d')](_0x444fab[_0x07d5('0x4e')],{})[_0x07d5('0x25')](function(_0x43db19){var _0x1f5061=_0x444fab['user'][_0x07d5('0x4f')]({'plain':!![]});if(!_0x1f5061)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f5061['role']===_0x07d5('0x50')){var _0x2dac65=_0x43db19[_0x07d5('0x4f')]({'plain':!![]});var _0x2e7bee=_0x07d5('0x26');return db[_0x07d5('0x51')]['find']({'where':{'name':_0x2e7bee,'userProfileId':_0x1f5061['userProfileId']},'raw':!![]})[_0x07d5('0x25')](function(_0x27374e){if(_0x27374e&&_0x27374e['autoAssociation']===0x0){return db[_0x07d5('0x52')][_0x07d5('0x4d')]({'name':_0x2dac65[_0x07d5('0x2a')],'resourceId':_0x2dac65['id'],'type':_0x27374e[_0x07d5('0x2a')],'sectionId':_0x27374e['id']},{})[_0x07d5('0x25')](function(){return _0x43db19;});}else{return _0x43db19;}})[_0x07d5('0x48')](function(_0x456b75){logger[_0x07d5('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x456b75);throw _0x456b75;});}return _0x43db19;})[_0x07d5('0x25')](respondWithResult(_0x4345a4,0xc9))[_0x07d5('0x48')](handleError(_0x4345a4,null));};exports['update']=function(_0x332d2e,_0x181119){if(_0x332d2e[_0x07d5('0x4e')]['id']){delete _0x332d2e[_0x07d5('0x4e')]['id'];}return db[_0x07d5('0x2e')]['find']({'where':{'id':_0x332d2e[_0x07d5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x181119,null))[_0x07d5('0x25')](saveUpdates(_0x332d2e[_0x07d5('0x4e')],null))[_0x07d5('0x25')](respondWithResult(_0x181119,null))['catch'](handleError(_0x181119,null));};exports[_0x07d5('0x27')]=function(_0x12c6ec,_0x29431b){return db[_0x07d5('0x2e')][_0x07d5('0x4c')]({'where':{'id':_0x12c6ec[_0x07d5('0x4a')]['id']}})[_0x07d5('0x25')](handleEntityNotFound(_0x29431b,null))['then'](removeEntity(_0x29431b,null))[_0x07d5('0x48')](handleError(_0x29431b,null));};exports['download']=function(_0xfb1401,_0xece9bc,_0x2d4a5a){return db[_0x07d5('0x2e')][_0x07d5('0x4c')]({'where':{'id':_0xfb1401[_0x07d5('0x4a')]['id']},'attributes':[_0x07d5('0x2a'),'basename',_0x07d5('0x54'),_0x07d5('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0xece9bc,null))[_0x07d5('0x25')](function(_0x1eddac){if(_0x1eddac){if(!fs[_0x07d5('0x56')](path[_0x07d5('0x57')](config[_0x07d5('0x58')],_0x07d5('0x59'),_0x1eddac[_0x07d5('0x54')]))){throw new db[(_0x07d5('0x5a'))][(_0x07d5('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0xfb1401[_0x07d5('0x32')][_0x07d5('0x5c')]){return _0xece9bc[_0x07d5('0x28')](0xc8);}return _0xece9bc[_0x07d5('0x5d')](path['join'](config[_0x07d5('0x58')],'server/files/reports',_0x1eddac[_0x07d5('0x54')]),util[_0x07d5('0x5e')]('%s.%s',_0x1eddac[_0x07d5('0x5f')]||_0x1eddac['name'],_0x1eddac[_0x07d5('0x55')][_0x07d5('0x60')]()));}})['catch'](handleError(_0xece9bc,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 4de52ac..f557dd8 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 _0x10da=['exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes'];(function(_0x3854e6,_0x45df01){var _0x1ee60d=function(_0x569ec0){while(--_0x569ec0){_0x3854e6['push'](_0x3854e6['shift']());}};_0x1ee60d(++_0x45df01);}(_0x10da,0x1b0));var _0xa10d=function(_0x48912e,_0x2276f4){_0x48912e=_0x48912e-0x0;var _0x4d00c2=_0x10da[_0x48912e];return _0x4d00c2;};'use strict';var _=require(_0xa10d('0x0'));var util=require(_0xa10d('0x1'));var logger=require(_0xa10d('0x2'))(_0xa10d('0x3'));var moment=require('moment');var BPromise=require(_0xa10d('0x4'));var rp=require(_0xa10d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa10d('0x6'));var config=require('../../config/environment');var attributes=require(_0xa10d('0x7'));module[_0xa10d('0x8')]=function(_0x398681,_0x1443b8){return _0x398681[_0xa10d('0x9')](_0xa10d('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd37=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5e390e,_0x396801){var _0x34b044=function(_0x59f5d9){while(--_0x59f5d9){_0x5e390e['push'](_0x5e390e['shift']());}};_0x34b044(++_0x396801);}(_0xfd37,0x78));var _0x7fd3=function(_0x2b191e,_0x3f477d){_0x2b191e=_0x2b191e-0x0;var _0x420881=_0xfd37[_0x2b191e];return _0x420881;};'use strict';var _=require(_0x7fd3('0x0'));var util=require(_0x7fd3('0x1'));var logger=require(_0x7fd3('0x2'))(_0x7fd3('0x3'));var moment=require('moment');var BPromise=require(_0x7fd3('0x4'));var rp=require(_0x7fd3('0x5'));var fs=require('fs');var path=require(_0x7fd3('0x6'));var rimraf=require(_0x7fd3('0x7'));var config=require(_0x7fd3('0x8'));var attributes=require(_0x7fd3('0x9'));module[_0x7fd3('0xa')]=function(_0x3d24c8,_0x158d16){return _0x3d24c8[_0x7fd3('0xb')](_0x7fd3('0xc'),attributes,{'tableName':_0x7fd3('0xd'),'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 de852df..91124e9 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 _0xa153=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xa153,0x85));var _0x3a15=function(_0xf8bfc3,_0x29cf48){_0xf8bfc3=_0xf8bfc3-0x0;var _0x4d7a6b=_0xa153[_0xf8bfc3];return _0x4d7a6b;};'use strict';var _=require(_0x3a15('0x0'));var util=require(_0x3a15('0x1'));var moment=require(_0x3a15('0x2'));var BPromise=require(_0x3a15('0x3'));var rs=require(_0x3a15('0x4'));var fs=require('fs');var Redis=require(_0x3a15('0x5'));var db=require(_0x3a15('0x6'))['db'];var utils=require(_0x3a15('0x7'));var logger=require(_0x3a15('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a15('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x476fb0,_0xd33b23,_0x22eaf8){return new BPromise(function(_0x35b5cc,_0x46bde5){return client['request'](_0x476fb0,_0x22eaf8)[_0x3a15('0xa')](function(_0x21eee8){logger[_0x3a15('0xb')](_0x3a15('0xc'),_0xd33b23,_0x3a15('0xd'));logger[_0x3a15('0xe')](_0x3a15('0xf'),_0xd33b23,_0x3a15('0xd'),JSON[_0x3a15('0x10')](_0x21eee8));if(_0x21eee8['error']){if(_0x21eee8[_0x3a15('0x11')][_0x3a15('0x12')]===0x1f4){logger['error'](_0x3a15('0xc'),_0xd33b23,_0x21eee8['error']['message']);return _0x46bde5(_0x21eee8[_0x3a15('0x11')]['message']);}logger['error'](_0x3a15('0xc'),_0xd33b23,_0x21eee8['error'][_0x3a15('0x13')]);return _0x35b5cc(_0x21eee8[_0x3a15('0x11')][_0x3a15('0x13')]);}else{logger['info'](_0x3a15('0xc'),_0xd33b23,_0x3a15('0xd'));_0x35b5cc(_0x21eee8[_0x3a15('0x14')][_0x3a15('0x13')]);}})[_0x3a15('0x15')](function(_0x5a8111){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xd33b23,_0x5a8111);_0x46bde5(_0x5a8111);});});}
\ No newline at end of file
+var _0x4b39=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x468148,_0x50e263){var _0x2b67ab=function(_0x1baee5){while(--_0x1baee5){_0x468148['push'](_0x468148['shift']());}};_0x2b67ab(++_0x50e263);}(_0x4b39,0x133));var _0x94b3=function(_0x4b17da,_0x3b50b4){_0x4b17da=_0x4b17da-0x0;var _0x1dce95=_0x4b39[_0x4b17da];return _0x1dce95;};'use strict';var _=require(_0x94b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x94b3('0x1'));var rs=require(_0x94b3('0x2'));var fs=require('fs');var Redis=require(_0x94b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x94b3('0x4'));var logger=require(_0x94b3('0x5'))(_0x94b3('0x6'));var config=require(_0x94b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94b3('0x8')][_0x94b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25daa0,_0x547e4d,_0x19a221){return new BPromise(function(_0x538ad5,_0x363a67){return client['request'](_0x25daa0,_0x19a221)[_0x94b3('0xa')](function(_0x4e6307){logger[_0x94b3('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x94b3('0xc'));logger['debug'](_0x94b3('0xd'),_0x547e4d,_0x94b3('0xc'),JSON[_0x94b3('0xe')](_0x4e6307));if(_0x4e6307['error']){if(_0x4e6307[_0x94b3('0xf')]['code']===0x1f4){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);return _0x363a67(_0x4e6307['error']['message']);}logger[_0x94b3('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x4e6307[_0x94b3('0xf')]['message']);return _0x538ad5(_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);}else{logger['info'](_0x94b3('0x10'),_0x547e4d,_0x94b3('0xc'));_0x538ad5(_0x4e6307['result'][_0x94b3('0x11')]);}})[_0x94b3('0x12')](function(_0x1896ec){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x1896ec);_0x363a67(_0x1896ec);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 9538a1e..4233a3e 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 _0xc6e4=['../../config/environment','get','isAuthenticated','index','show','download','post','create','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x2371a3,_0x84a147){var _0x41f614=function(_0x219ba7){while(--_0x219ba7){_0x2371a3['push'](_0x2371a3['shift']());}};_0x41f614(++_0x84a147);}(_0xc6e4,0x11c));var _0x4c6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6e4[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4c6e('0x0'));var util=require('util');var path=require(_0x4c6e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c6e('0x2')]();var fs_extra=require(_0x4c6e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4c6e('0x4'));var config=require(_0x4c6e('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x4c6e('0x6')]('/',auth[_0x4c6e('0x7')](),controller[_0x4c6e('0x8')]);router['get']('/:id',auth[_0x4c6e('0x7')](),controller[_0x4c6e('0x9')]);router[_0x4c6e('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x4c6e('0xa')]);router[_0x4c6e('0xb')]('/',auth[_0x4c6e('0x7')](),controller[_0x4c6e('0xc')]);router['put'](_0x4c6e('0xd'),auth[_0x4c6e('0x7')](),controller['update']);router[_0x4c6e('0xe')](_0x4c6e('0xd'),auth[_0x4c6e('0x7')](),controller[_0x4c6e('0xf')]);module[_0x4c6e('0x10')]=router;
\ No newline at end of file
+var _0x97c2=['./analyticExtractedReport.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29b65b,_0x3b7633){var _0x2d80ba=function(_0x6a7752){while(--_0x6a7752){_0x29b65b['push'](_0x29b65b['shift']());}};_0x2d80ba(++_0x3b7633);}(_0x97c2,0x138));var _0x297c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x97c2[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x297c('0x0'));var util=require(_0x297c('0x1'));var path=require(_0x297c('0x2'));var timeout=require(_0x297c('0x3'));var express=require(_0x297c('0x4'));var router=express[_0x297c('0x5')]();var fs_extra=require(_0x297c('0x6'));var auth=require(_0x297c('0x7'));var interaction=require(_0x297c('0x8'));var config=require(_0x297c('0x9'));var controller=require(_0x297c('0xa'));router[_0x297c('0xb')]('/',auth['isAuthenticated'](),controller[_0x297c('0xc')]);router['get'](_0x297c('0xd'),auth['isAuthenticated'](),controller[_0x297c('0xe')]);router[_0x297c('0xb')](_0x297c('0xf'),auth[_0x297c('0x10')](),controller[_0x297c('0x11')]);router[_0x297c('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x297c('0x13')]('/:id',auth[_0x297c('0x10')](),controller[_0x297c('0x14')]);router['delete']('/:id',auth[_0x297c('0x10')](),controller[_0x297c('0x15')]);module[_0x297c('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index aa34234..59c649c 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 _0x86f2=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x5a4795,_0x7db3ad){var _0x3549d6=function(_0x2e66e9){while(--_0x2e66e9){_0x5a4795['push'](_0x5a4795['shift']());}};_0x3549d6(++_0x7db3ad);}(_0x86f2,0x76));var _0x286f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x86f2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x286f('0x0'));module['exports']={'field':{'type':Sequelize[_0x286f('0x1')]},'alias':{'type':Sequelize[_0x286f('0x2')]},'function':{'type':Sequelize[_0x286f('0x2')]},'format':{'type':Sequelize[_0x286f('0x2')]},'groupBy':{'type':Sequelize[_0x286f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x286f('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x7f80=['sequelize','exports','TEXT','STRING'];(function(_0x9cae0c,_0x42b12d){var _0x45542e=function(_0x31623a){while(--_0x31623a){_0x9cae0c['push'](_0x9cae0c['shift']());}};_0x45542e(++_0x42b12d);}(_0x7f80,0xec));var _0x07f8=function(_0x51304d,_0x42c2e7){_0x51304d=_0x51304d-0x0;var _0x588e90=_0x7f80[_0x51304d];return _0x588e90;};'use strict';var Sequelize=require(_0x07f8('0x0'));module[_0x07f8('0x1')]={'field':{'type':Sequelize[_0x07f8('0x2')]},'alias':{'type':Sequelize[_0x07f8('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x07f8('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 7fe080f..e6ce079 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 _0xaffb=['length','options','find','create','body','bulkCreate','bulkDestroy','ids','findOne','transaction','CustomReportId','findAll','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','params','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaffb,0x1e6));var _0xbaff=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xaffb[_0x55d8c5];return _0x225ae5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbaff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbaff('0x1'));var moment=require(_0xbaff('0x2'));var BPromise=require(_0xbaff('0x3'));var Mustache=require(_0xbaff('0x4'));var util=require(_0xbaff('0x5'));var path=require(_0xbaff('0x6'));var sox=require(_0xbaff('0x7'));var csv=require(_0xbaff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaff('0x9'));var squel=require(_0xbaff('0xa'));var crypto=require(_0xbaff('0xb'));var jsforce=require(_0xbaff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbaff('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbaff('0xd'));var authService=require(_0xbaff('0xe'));var qs=require(_0xbaff('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbaff('0x10'))(_0xbaff('0x11'));var utils=require('../../config/utils');var config=require(_0xbaff('0x12'));var licenseUtil=require(_0xbaff('0x13'));var db=require(_0xbaff('0x14'))['db'];function respondWithStatusCode(_0x574fd4,_0x12917f){_0x12917f=_0x12917f||0xcc;return function(_0x578409){if(_0x578409){return _0x574fd4[_0xbaff('0x15')](_0x12917f);}return _0x574fd4['status'](_0x12917f)[_0xbaff('0x16')]();};}function respondWithResult(_0x34420d,_0x23fb1c){_0x23fb1c=_0x23fb1c||0xc8;return function(_0x16e356){if(_0x16e356){return _0x34420d['status'](_0x23fb1c)[_0xbaff('0x17')](_0x16e356);}};}function respondWithFilteredResult(_0x30e3fa,_0x541636){return function(_0x5c4c6c){if(_0x5c4c6c){var _0x1f3506=typeof _0x541636[_0xbaff('0x18')]===_0xbaff('0x19')&&typeof _0x541636['limit']===_0xbaff('0x19');var _0x5a01e0=_0x5c4c6c[_0xbaff('0x1a')];var _0x3947e0=_0x1f3506?0x0:_0x541636[_0xbaff('0x18')];var _0x3f9258=_0x1f3506?_0x5c4c6c[_0xbaff('0x1a')]:_0x541636[_0xbaff('0x18')]+_0x541636[_0xbaff('0x1b')];var _0x5dcb6a;if(_0x3f9258>=_0x5a01e0){_0x3f9258=_0x5a01e0;_0x5dcb6a=0xc8;}else{_0x5dcb6a=0xce;}_0x30e3fa['status'](_0x5dcb6a);return _0x30e3fa[_0xbaff('0x1c')](_0xbaff('0x1d'),_0x3947e0+'-'+_0x3f9258+'/'+_0x5a01e0)[_0xbaff('0x17')](_0x5c4c6c);}return null;};}function patchUpdates(_0x4382de){return function(_0xddf46f){try{jsonpatch[_0xbaff('0x1e')](_0xddf46f,_0x4382de,!![]);}catch(_0x2df365){return BPromise[_0xbaff('0x1f')](_0x2df365);}return _0xddf46f['save']();};}function saveUpdates(_0x4009a4,_0x1fbb65){return function(_0x36b462){if(_0x36b462){return _0x36b462[_0xbaff('0x20')](_0x4009a4)[_0xbaff('0x21')](function(_0x524501){return _0x524501;});}return null;};}function removeEntity(_0x302765,_0x3598d4){return function(_0x52f1e8){if(_0x52f1e8){return _0x52f1e8[_0xbaff('0x22')]()[_0xbaff('0x21')](function(){_0x302765[_0xbaff('0x23')](0xcc)[_0xbaff('0x16')]();});}};}function handleEntityNotFound(_0x444296,_0x4cafc9){return function(_0x36d017){if(!_0x36d017){_0x444296[_0xbaff('0x15')](0x194);}return _0x36d017;};}function handleError(_0x390ce3,_0x340225){_0x340225=_0x340225||0x1f4;return function(_0x4aa8b4){logger[_0xbaff('0x24')](_0x4aa8b4[_0xbaff('0x25')]);if(_0x4aa8b4['name']){delete _0x4aa8b4[_0xbaff('0x26')];}_0x390ce3[_0xbaff('0x23')](_0x340225)[_0xbaff('0x27')](_0x4aa8b4);};}exports[_0xbaff('0x28')]=function(_0x1bd18e,_0x13c91f){var _0x5a096e={},_0x14300c={},_0x62292f={'count':0x0,'rows':[]};var _0x5b6f01=_['map'](db[_0xbaff('0x29')][_0xbaff('0x2a')],function(_0x48d2d1){return{'name':_0x48d2d1[_0xbaff('0x2b')],'type':_0x48d2d1[_0xbaff('0x2c')][_0xbaff('0x2d')]};});_0x14300c[_0xbaff('0x2e')]=_[_0xbaff('0x2f')](_0x5b6f01,_0xbaff('0x26'));_0x14300c[_0xbaff('0x30')]=_[_0xbaff('0x31')](_0x1bd18e[_0xbaff('0x30')]);_0x14300c[_0xbaff('0x32')]=_[_0xbaff('0x33')](_0x14300c['model'],_0x14300c[_0xbaff('0x30')]);_0x5a096e[_0xbaff('0x34')]=_[_0xbaff('0x33')](_0x14300c[_0xbaff('0x2e')],qs['fields'](_0x1bd18e['query']['fields']));_0x5a096e[_0xbaff('0x34')]=_0x5a096e[_0xbaff('0x34')]['length']?_0x5a096e['attributes']:_0x14300c[_0xbaff('0x2e')];if(!_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x35')]('nolimit')){_0x5a096e[_0xbaff('0x1b')]=qs[_0xbaff('0x1b')](_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x1b')]);_0x5a096e[_0xbaff('0x18')]=qs[_0xbaff('0x18')](_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x18')]);}_0x5a096e[_0xbaff('0x36')]=qs[_0xbaff('0x37')](_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x37')]);_0x5a096e['where']=qs['filters'](_[_0xbaff('0x38')](_0x1bd18e[_0xbaff('0x30')],_0x14300c[_0xbaff('0x32')]),_0x5b6f01);if(_0x1bd18e['query'][_0xbaff('0x39')]){_0x5a096e[_0xbaff('0x3a')]=_[_0xbaff('0x3b')](_0x5a096e['where'],{'$or':_[_0xbaff('0x2f')](_0x5b6f01,function(_0x35f980){if(_0x35f980['type']!==_0xbaff('0x3c')){var _0x114fe5={};_0x114fe5[_0x35f980[_0xbaff('0x26')]]={'$like':'%'+_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x39')]+'%'};return _0x114fe5;}})});}_0x5a096e=_[_0xbaff('0x3b')]({},_0x5a096e,_0x1bd18e['options']);var _0x18c543={'where':_0x5a096e[_0xbaff('0x3a')]};return db[_0xbaff('0x29')][_0xbaff('0x1a')](_0x18c543)['then'](function(_0x40c6c7){_0x62292f[_0xbaff('0x1a')]=_0x40c6c7;if(_0x1bd18e[_0xbaff('0x30')][_0xbaff('0x3d')]){_0x5a096e[_0xbaff('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x5a096e);})[_0xbaff('0x21')](function(_0x4c8604){_0x62292f[_0xbaff('0x3f')]=_0x4c8604;return _0x62292f;})[_0xbaff('0x21')](respondWithFilteredResult(_0x13c91f,_0x5a096e))[_0xbaff('0x40')](handleError(_0x13c91f,null));};exports['show']=function(_0x2a7159,_0x2c24ef){var _0x183b9c={'raw':![],'where':{'id':_0x2a7159[_0xbaff('0x41')]['id']}},_0x25262a={};_0x25262a[_0xbaff('0x2e')]=_[_0xbaff('0x31')](db[_0xbaff('0x29')][_0xbaff('0x2a')]);_0x25262a['query']=_['keys'](_0x2a7159['query']);_0x25262a[_0xbaff('0x32')]=_[_0xbaff('0x33')](_0x25262a[_0xbaff('0x2e')],_0x25262a[_0xbaff('0x30')]);_0x183b9c[_0xbaff('0x34')]=_[_0xbaff('0x33')](_0x25262a[_0xbaff('0x2e')],qs['fields'](_0x2a7159[_0xbaff('0x30')][_0xbaff('0x42')]));_0x183b9c['attributes']=_0x183b9c[_0xbaff('0x34')][_0xbaff('0x43')]?_0x183b9c[_0xbaff('0x34')]:_0x25262a['model'];if(_0x2a7159[_0xbaff('0x30')]['includeAll']){_0x183b9c[_0xbaff('0x3e')]=[{'all':!![]}];}_0x183b9c=_['merge']({},_0x183b9c,_0x2a7159[_0xbaff('0x44')]);return db['AnalyticFieldReport'][_0xbaff('0x45')](_0x183b9c)[_0xbaff('0x21')](handleEntityNotFound(_0x2c24ef,null))[_0xbaff('0x21')](respondWithResult(_0x2c24ef,null))[_0xbaff('0x40')](handleError(_0x2c24ef,null));};exports[_0xbaff('0x46')]=function(_0x3fb500,_0x56d08d){return db[_0xbaff('0x29')][_0xbaff('0x46')](_0x3fb500[_0xbaff('0x47')],{})[_0xbaff('0x21')](respondWithResult(_0x56d08d,0xc9))[_0xbaff('0x40')](handleError(_0x56d08d,null));};exports[_0xbaff('0x48')]=function(_0x14c4ac,_0x52bacf){return db[_0xbaff('0x29')][_0xbaff('0x48')](_0x14c4ac[_0xbaff('0x47')],{'raw':![],'individualHooks':!![]})[_0xbaff('0x21')](respondWithResult(_0x52bacf,0xc9))['catch'](handleError(_0x52bacf,null));};exports[_0xbaff('0x20')]=function(_0x980c31,_0x93936c){if(_0x980c31[_0xbaff('0x47')]['id']){delete _0x980c31[_0xbaff('0x47')]['id'];}return db[_0xbaff('0x29')][_0xbaff('0x45')]({'where':{'id':_0x980c31[_0xbaff('0x41')]['id']}})[_0xbaff('0x21')](handleEntityNotFound(_0x93936c,null))['then'](saveUpdates(_0x980c31[_0xbaff('0x47')],null))[_0xbaff('0x21')](respondWithResult(_0x93936c,null))[_0xbaff('0x40')](handleError(_0x93936c,null));};exports[_0xbaff('0x22')]=function(_0x327c53,_0x54bd9f){return db[_0xbaff('0x29')][_0xbaff('0x45')]({'where':{'id':_0x327c53[_0xbaff('0x41')]['id']}})['then'](handleEntityNotFound(_0x54bd9f,null))[_0xbaff('0x21')](removeEntity(_0x54bd9f,null))[_0xbaff('0x40')](handleError(_0x54bd9f,null));};exports[_0xbaff('0x49')]=function(_0x660c88,_0x53b3e3){return db[_0xbaff('0x29')][_0xbaff('0x22')]({'where':{'id':_0x660c88[_0xbaff('0x30')][_0xbaff('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xbaff('0x21')](respondWithResult(_0x53b3e3,0xcc))[_0xbaff('0x40')](handleError(_0x53b3e3,null));};exports['addFields']=function(_0x24ac62,_0x94618a,_0xbd3a69){return db['AnalyticCustomReport'][_0xbaff('0x4b')]({'where':{'id':_0x24ac62[_0xbaff('0x41')]['id']}})[_0xbaff('0x21')](handleEntityNotFound(_0x94618a,null))[_0xbaff('0x21')](function(_0x4542ba){if(_0x4542ba){return db['sequelize'][_0xbaff('0x4c')](function(_0x4c3771){return db[_0xbaff('0x29')]['destroy']({'where':{'CustomReportId':_0x24ac62[_0xbaff('0x41')]['id']},'transaction':_0x4c3771})[_0xbaff('0x21')](function(_0x14b8c7){var _0x40f159=_[_0xbaff('0x2f')](_0x24ac62[_0xbaff('0x47')],function(_0x197f48){delete _0x197f48['id'];_0x197f48[_0xbaff('0x4d')]=_0x24ac62[_0xbaff('0x41')]['id'];return _0x197f48;});return db[_0xbaff('0x29')][_0xbaff('0x48')](_0x40f159,{'transaction':_0x4c3771});});})[_0xbaff('0x21')](function(){return db['AnalyticFieldReport'][_0xbaff('0x4e')]({'where':{'CustomReportId':_0x24ac62[_0xbaff('0x41')]['id']}});});}})['then'](respondWithResult(_0x94618a,null))['catch'](handleError(_0x94618a,null));};
\ No newline at end of file
+var _0x78b9=['moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise'];(function(_0xab477c,_0x4ee058){var _0x466db2=function(_0x3b9522){while(--_0x3b9522){_0xab477c['push'](_0xab477c['shift']());}};_0x466db2(++_0x4ee058);}(_0x78b9,0x191));var _0x978b=function(_0x58df49,_0x109194){_0x58df49=_0x58df49-0x0;var _0x123dba=_0x78b9[_0x58df49];return _0x123dba;};'use strict';var emlformat=require(_0x978b('0x0'));var rimraf=require(_0x978b('0x1'));var zipdir=require(_0x978b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x978b('0x3'));var moment=require(_0x978b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x978b('0x5'));var path=require(_0x978b('0x6'));var sox=require(_0x978b('0x7'));var csv=require(_0x978b('0x8'));var ejs=require(_0x978b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x978b('0xa'));var squel=require(_0x978b('0xb'));var crypto=require('crypto');var jsforce=require(_0x978b('0xc'));var deskjs=require(_0x978b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x978b('0xe'));var Papa=require(_0x978b('0xf'));var Redis=require(_0x978b('0x10'));var authService=require(_0x978b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x978b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x978b('0x13'));var config=require(_0x978b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x137c02,_0x1c200b){_0x1c200b=_0x1c200b||0xcc;return function(_0x191a39){if(_0x191a39){return _0x137c02['sendStatus'](_0x1c200b);}return _0x137c02[_0x978b('0x15')](_0x1c200b)[_0x978b('0x16')]();};}function respondWithResult(_0x5f19dc,_0x2f6d8a){_0x2f6d8a=_0x2f6d8a||0xc8;return function(_0x2f5a7f){if(_0x2f5a7f){return _0x5f19dc[_0x978b('0x15')](_0x2f6d8a)['json'](_0x2f5a7f);}};}function respondWithFilteredResult(_0x4b0165,_0x1bc253){return function(_0x439dac){if(_0x439dac){var _0x1056f2=typeof _0x1bc253[_0x978b('0x17')]===_0x978b('0x18')&&typeof _0x1bc253[_0x978b('0x19')]===_0x978b('0x18');var _0x3103aa=_0x439dac[_0x978b('0x1a')];var _0xc66865=_0x1056f2?0x0:_0x1bc253[_0x978b('0x17')];var _0x5413de=_0x1056f2?_0x439dac[_0x978b('0x1a')]:_0x1bc253[_0x978b('0x17')]+_0x1bc253['limit'];var _0x56fdd1;if(_0x5413de>=_0x3103aa){_0x5413de=_0x3103aa;_0x56fdd1=0xc8;}else{_0x56fdd1=0xce;}_0x4b0165[_0x978b('0x15')](_0x56fdd1);return _0x4b0165['set'](_0x978b('0x1b'),_0xc66865+'-'+_0x5413de+'/'+_0x3103aa)[_0x978b('0x1c')](_0x439dac);}return null;};}function patchUpdates(_0x396538){return function(_0x1808a6){try{jsonpatch['apply'](_0x1808a6,_0x396538,!![]);}catch(_0x498a50){return BPromise[_0x978b('0x1d')](_0x498a50);}return _0x1808a6[_0x978b('0x1e')]();};}function saveUpdates(_0x9f4a97,_0x343ce3){return function(_0x66c66e){if(_0x66c66e){return _0x66c66e[_0x978b('0x1f')](_0x9f4a97)[_0x978b('0x20')](function(_0x100d01){return _0x100d01;});}return null;};}function removeEntity(_0x384cd1,_0x417ad7){return function(_0x9492c9){if(_0x9492c9){return _0x9492c9[_0x978b('0x21')]()[_0x978b('0x20')](function(){_0x384cd1[_0x978b('0x15')](0xcc)[_0x978b('0x16')]();});}};}function handleEntityNotFound(_0x11208e,_0x5b8d14){return function(_0x3ffebd){if(!_0x3ffebd){_0x11208e[_0x978b('0x22')](0x194);}return _0x3ffebd;};}function handleError(_0x331948,_0x22f2a5){_0x22f2a5=_0x22f2a5||0x1f4;return function(_0x1c07d5){logger[_0x978b('0x23')](_0x1c07d5[_0x978b('0x24')]);if(_0x1c07d5[_0x978b('0x25')]){delete _0x1c07d5['name'];}_0x331948[_0x978b('0x15')](_0x22f2a5)[_0x978b('0x26')](_0x1c07d5);};}exports[_0x978b('0x27')]=function(_0x508a81,_0x40fa30){var _0xb52846={},_0x24fefb={},_0x3aa5ae={'count':0x0,'rows':[]};var _0xc55a67=_[_0x978b('0x28')](db[_0x978b('0x29')][_0x978b('0x2a')],function(_0x233525){return{'name':_0x233525['fieldName'],'type':_0x233525['type'][_0x978b('0x2b')]};});_0x24fefb[_0x978b('0x2c')]=_[_0x978b('0x28')](_0xc55a67,_0x978b('0x25'));_0x24fefb[_0x978b('0x2d')]=_[_0x978b('0x2e')](_0x508a81['query']);_0x24fefb[_0x978b('0x2f')]=_[_0x978b('0x30')](_0x24fefb[_0x978b('0x2c')],_0x24fefb[_0x978b('0x2d')]);_0xb52846['attributes']=_['intersection'](_0x24fefb[_0x978b('0x2c')],qs['fields'](_0x508a81[_0x978b('0x2d')][_0x978b('0x31')]));_0xb52846[_0x978b('0x32')]=_0xb52846[_0x978b('0x32')][_0x978b('0x33')]?_0xb52846['attributes']:_0x24fefb['model'];if(!_0x508a81['query'][_0x978b('0x34')](_0x978b('0x35'))){_0xb52846['limit']=qs[_0x978b('0x19')](_0x508a81[_0x978b('0x2d')]['limit']);_0xb52846[_0x978b('0x17')]=qs[_0x978b('0x17')](_0x508a81[_0x978b('0x2d')][_0x978b('0x17')]);}_0xb52846[_0x978b('0x36')]=qs[_0x978b('0x37')](_0x508a81['query'][_0x978b('0x37')]);_0xb52846[_0x978b('0x38')]=qs[_0x978b('0x2f')](_[_0x978b('0x39')](_0x508a81[_0x978b('0x2d')],_0x24fefb[_0x978b('0x2f')]),_0xc55a67);if(_0x508a81[_0x978b('0x2d')][_0x978b('0x3a')]){_0xb52846['where']=_[_0x978b('0x3b')](_0xb52846['where'],{'$or':_[_0x978b('0x28')](_0xc55a67,function(_0x493d75){if(_0x493d75[_0x978b('0x3c')]!==_0x978b('0x3d')){var _0x32e06b={};_0x32e06b[_0x493d75['name']]={'$like':'%'+_0x508a81[_0x978b('0x2d')]['filter']+'%'};return _0x32e06b;}})});}_0xb52846=_['merge']({},_0xb52846,_0x508a81[_0x978b('0x3e')]);var _0x218737={'where':_0xb52846['where']};return db['AnalyticFieldReport'][_0x978b('0x1a')](_0x218737)[_0x978b('0x20')](function(_0x31b771){_0x3aa5ae['count']=_0x31b771;if(_0x508a81[_0x978b('0x2d')][_0x978b('0x3f')]){_0xb52846['include']=[{'all':!![]}];}return db[_0x978b('0x29')][_0x978b('0x40')](_0xb52846);})['then'](function(_0x5e2b1d){_0x3aa5ae[_0x978b('0x41')]=_0x5e2b1d;return _0x3aa5ae;})[_0x978b('0x20')](respondWithFilteredResult(_0x40fa30,_0xb52846))['catch'](handleError(_0x40fa30,null));};exports[_0x978b('0x42')]=function(_0x433ef2,_0x1e573e){var _0x559e88={'raw':![],'where':{'id':_0x433ef2[_0x978b('0x43')]['id']}},_0x24ff3d={};_0x24ff3d[_0x978b('0x2c')]=_[_0x978b('0x2e')](db[_0x978b('0x29')][_0x978b('0x2a')]);_0x24ff3d[_0x978b('0x2d')]=_[_0x978b('0x2e')](_0x433ef2[_0x978b('0x2d')]);_0x24ff3d[_0x978b('0x2f')]=_['intersection'](_0x24ff3d[_0x978b('0x2c')],_0x24ff3d['query']);_0x559e88[_0x978b('0x32')]=_['intersection'](_0x24ff3d[_0x978b('0x2c')],qs[_0x978b('0x31')](_0x433ef2[_0x978b('0x2d')][_0x978b('0x31')]));_0x559e88['attributes']=_0x559e88[_0x978b('0x32')][_0x978b('0x33')]?_0x559e88[_0x978b('0x32')]:_0x24ff3d[_0x978b('0x2c')];if(_0x433ef2['query']['includeAll']){_0x559e88[_0x978b('0x44')]=[{'all':!![]}];}_0x559e88=_[_0x978b('0x3b')]({},_0x559e88,_0x433ef2[_0x978b('0x3e')]);return db[_0x978b('0x29')][_0x978b('0x45')](_0x559e88)[_0x978b('0x20')](handleEntityNotFound(_0x1e573e,null))[_0x978b('0x20')](respondWithResult(_0x1e573e,null))[_0x978b('0x46')](handleError(_0x1e573e,null));};exports[_0x978b('0x47')]=function(_0x3fa71f,_0x35510e){return db[_0x978b('0x29')][_0x978b('0x47')](_0x3fa71f[_0x978b('0x48')],{})[_0x978b('0x20')](respondWithResult(_0x35510e,0xc9))['catch'](handleError(_0x35510e,null));};exports['bulkCreate']=function(_0x33f857,_0x272345){return db[_0x978b('0x29')][_0x978b('0x49')](_0x33f857[_0x978b('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x272345,0xc9))['catch'](handleError(_0x272345,null));};exports[_0x978b('0x1f')]=function(_0x26a165,_0x37a24d){if(_0x26a165[_0x978b('0x48')]['id']){delete _0x26a165['body']['id'];}return db[_0x978b('0x29')][_0x978b('0x45')]({'where':{'id':_0x26a165[_0x978b('0x43')]['id']}})[_0x978b('0x20')](handleEntityNotFound(_0x37a24d,null))[_0x978b('0x20')](saveUpdates(_0x26a165[_0x978b('0x48')],null))[_0x978b('0x20')](respondWithResult(_0x37a24d,null))['catch'](handleError(_0x37a24d,null));};exports['destroy']=function(_0x3b28c1,_0x1bc616){return db[_0x978b('0x29')][_0x978b('0x45')]({'where':{'id':_0x3b28c1[_0x978b('0x43')]['id']}})[_0x978b('0x20')](handleEntityNotFound(_0x1bc616,null))[_0x978b('0x20')](removeEntity(_0x1bc616,null))[_0x978b('0x46')](handleError(_0x1bc616,null));};exports[_0x978b('0x4a')]=function(_0x4c2d2d,_0x10578e){return db[_0x978b('0x29')][_0x978b('0x21')]({'where':{'id':_0x4c2d2d[_0x978b('0x2d')][_0x978b('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x10578e,0xcc))['catch'](handleError(_0x10578e,null));};exports[_0x978b('0x4c')]=function(_0x292ecf,_0x1ec4c9,_0x356c40){return db[_0x978b('0x4d')]['findOne']({'where':{'id':_0x292ecf[_0x978b('0x43')]['id']}})[_0x978b('0x20')](handleEntityNotFound(_0x1ec4c9,null))[_0x978b('0x20')](function(_0x542ff4){if(_0x542ff4){return db[_0x978b('0x4e')][_0x978b('0x4f')](function(_0x3c1b50){return db[_0x978b('0x29')][_0x978b('0x21')]({'where':{'CustomReportId':_0x292ecf[_0x978b('0x43')]['id']},'transaction':_0x3c1b50})[_0x978b('0x20')](function(_0x558489){var _0xfd41be=_[_0x978b('0x28')](_0x292ecf[_0x978b('0x48')],function(_0x4037f4){delete _0x4037f4['id'];_0x4037f4[_0x978b('0x50')]=_0x292ecf[_0x978b('0x43')]['id'];return _0x4037f4;});return db[_0x978b('0x29')][_0x978b('0x49')](_0xfd41be,{'transaction':_0x3c1b50});});})['then'](function(){return db[_0x978b('0x29')]['findAll']({'where':{'CustomReportId':_0x292ecf['params']['id']}});});}})[_0x978b('0x20')](respondWithResult(_0x1ec4c9,null))[_0x978b('0x46')](handleError(_0x1ec4c9,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 4e35902..3129142 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 _0xc9dc=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x3ec744,_0x340800){var _0x239fba=function(_0x256f79){while(--_0x256f79){_0x3ec744['push'](_0x3ec744['shift']());}};_0x239fba(++_0x340800);}(_0xc9dc,0xda));var _0xcc9d=function(_0x5e8ba5,_0x40e58d){_0x5e8ba5=_0x5e8ba5-0x0;var _0x420ab4=_0xc9dc[_0x5e8ba5];return _0x420ab4;};'use strict';var _=require(_0xcc9d('0x0'));var util=require(_0xcc9d('0x1'));var logger=require(_0xcc9d('0x2'))(_0xcc9d('0x3'));var moment=require(_0xcc9d('0x4'));var BPromise=require(_0xcc9d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc9d('0x6'));var rimraf=require('rimraf');var config=require(_0xcc9d('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xcc9d('0x8')]=function(_0x480968,_0xbaf26b){return _0x480968[_0xcc9d('0x9')](_0xcc9d('0xa'),attributes,{'tableName':_0xcc9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe0a2=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xe0a2,0x155));var _0x2e0a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe0a2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2e0a('0x0'));var util=require(_0x2e0a('0x1'));var logger=require(_0x2e0a('0x2'))('api');var moment=require(_0x2e0a('0x3'));var BPromise=require(_0x2e0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e0a('0x5'));var rimraf=require('rimraf');var config=require(_0x2e0a('0x6'));var attributes=require(_0x2e0a('0x7'));module[_0x2e0a('0x8')]=function(_0x32a4bd,_0xdded2a){return _0x32a4bd['define'](_0x2e0a('0x9'),attributes,{'tableName':_0x2e0a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 7405631..8da4975 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 _0x25d5=['../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x2921a8,_0x30e287){var _0xc8ff65=function(_0x469ac0){while(--_0x469ac0){_0x2921a8['push'](_0x2921a8['shift']());}};_0xc8ff65(++_0x30e287);}(_0x25d5,0x165));var _0x525d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x525d('0x0'));var moment=require('moment');var BPromise=require(_0x525d('0x1'));var rs=require(_0x525d('0x2'));var fs=require('fs');var Redis=require(_0x525d('0x3'));var db=require(_0x525d('0x4'))['db'];var utils=require(_0x525d('0x5'));var logger=require(_0x525d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x525d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17bb4d,_0x2bd3e4,_0x4021c7){return new BPromise(function(_0x56c076,_0x8210c3){return client[_0x525d('0x8')](_0x17bb4d,_0x4021c7)[_0x525d('0x9')](function(_0x439b18){logger[_0x525d('0xa')](_0x525d('0xb'),_0x2bd3e4,_0x525d('0xc'));logger['debug'](_0x525d('0xd'),_0x2bd3e4,_0x525d('0xc'),JSON[_0x525d('0xe')](_0x439b18));if(_0x439b18[_0x525d('0xf')]){if(_0x439b18['error']['code']===0x1f4){logger[_0x525d('0xf')](_0x525d('0xb'),_0x2bd3e4,_0x439b18['error'][_0x525d('0x10')]);return _0x8210c3(_0x439b18[_0x525d('0xf')][_0x525d('0x10')]);}logger[_0x525d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2bd3e4,_0x439b18[_0x525d('0xf')][_0x525d('0x10')]);return _0x56c076(_0x439b18[_0x525d('0xf')][_0x525d('0x10')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2bd3e4,_0x525d('0xc'));_0x56c076(_0x439b18[_0x525d('0x11')][_0x525d('0x10')]);}})[_0x525d('0x12')](function(_0x3844f3){logger[_0x525d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2bd3e4,_0x3844f3);_0x8210c3(_0x3844f3);});});}
\ No newline at end of file
+var _0xe402=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x42aff9,_0xe4fd11){var _0xa54edd=function(_0x2d3190){while(--_0x2d3190){_0x42aff9['push'](_0x42aff9['shift']());}};_0xa54edd(++_0xe4fd11);}(_0xe402,0x1c5));var _0x2e40=function(_0x2aecf8,_0x22eef6){_0x2aecf8=_0x2aecf8-0x0;var _0x36b77=_0xe402[_0x2aecf8];return _0x36b77;};'use strict';var _=require(_0x2e40('0x0'));var util=require(_0x2e40('0x1'));var moment=require(_0x2e40('0x2'));var BPromise=require(_0x2e40('0x3'));var rs=require(_0x2e40('0x4'));var fs=require('fs');var Redis=require(_0x2e40('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e40('0x6'));var logger=require(_0x2e40('0x7'))('rpc');var config=require(_0x2e40('0x8'));var jayson=require(_0x2e40('0x9'));var client=jayson['client'][_0x2e40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x415f63,_0x2345b1,_0x35ce24){return new BPromise(function(_0x59680a,_0x4f745f){return client[_0x2e40('0xb')](_0x415f63,_0x35ce24)[_0x2e40('0xc')](function(_0x1a4a68){logger[_0x2e40('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2345b1,_0x2e40('0xe'));logger[_0x2e40('0xf')](_0x2e40('0x10'),_0x2345b1,_0x2e40('0xe'),JSON[_0x2e40('0x11')](_0x1a4a68));if(_0x1a4a68[_0x2e40('0x12')]){if(_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x13')]===0x1f4){logger['error'](_0x2e40('0x14'),_0x2345b1,_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x15')]);return _0x4f745f(_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x15')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2345b1,_0x1a4a68[_0x2e40('0x12')][_0x2e40('0x15')]);return _0x59680a(_0x1a4a68[_0x2e40('0x12')]['message']);}else{logger[_0x2e40('0xd')](_0x2e40('0x14'),_0x2345b1,_0x2e40('0xe'));_0x59680a(_0x1a4a68[_0x2e40('0x16')][_0x2e40('0x15')]);}})[_0x2e40('0x17')](function(_0x16f983){logger[_0x2e40('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2345b1,_0x16f983);_0x4f745f(_0x16f983);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 2b2907f..799779c 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(_0x3c9010,_0x970251){var _0x373e8a=function(_0x3a8a9e){while(--_0x3a8a9e){_0x3c9010['push'](_0x3c9010['shift']());}};_0x373e8a(++_0x970251);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x5dcfe2,_0x397a20){var _0x373e3a=function(_0x54e6d7){while(--_0x54e6d7){_0x5dcfe2['push'](_0x5dcfe2['shift']());}};_0x373e3a(++_0x397a20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 c8b6b78..ff25487 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 _0x0c1a=['exports','STRING','TEXT','sequelize'];(function(_0x18412f,_0x441675){var _0x130b9d=function(_0x4a3aff){while(--_0x4a3aff){_0x18412f['push'](_0x18412f['shift']());}};_0x130b9d(++_0x441675);}(_0x0c1a,0x127));var _0xa0c1=function(_0xb496cf,_0x45e1fa){_0xb496cf=_0xb496cf-0x0;var _0x769aac=_0x0c1a[_0xb496cf];return _0x769aac;};'use strict';var Sequelize=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]={'name':{'type':Sequelize[_0xa0c1('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xa0c1('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9a1b=['TEXT','sequelize','STRING'];(function(_0x1bef23,_0x331853){var _0x2c0295=function(_0x1613eb){while(--_0x1613eb){_0x1bef23['push'](_0x1bef23['shift']());}};_0x2c0295(++_0x331853);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x293181,_0x1f01ae){_0x293181=_0x293181-0x0;var _0x20680b=_0x9a1b[_0x293181];return _0x20680b;};'use strict';var Sequelize=require(_0xb9a1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xb9a1('0x1')]},'metric':{'type':Sequelize[_0xb9a1('0x2')]},'description':{'type':Sequelize[_0xb9a1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7d53070..abbbc49 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x84ab,0x12f));var _0xb84a=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0x84ab[_0x77d310];return _0x2cdce4;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));};
\ No newline at end of file
+var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x20c993,_0xca841c){var _0x3fc1e2=function(_0x1e134f){while(--_0x1e134f){_0x20c993['push'](_0x20c993['shift']());}};_0x3fc1e2(++_0xca841c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xe445b3,_0x26ae0c){_0xe445b3=_0xe445b3-0x0;var _0x266a98=_0x9c5a[_0xe445b3];return _0x266a98;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index fe0680c..391a13a 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 _0xae30=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xc153db,_0x516c10){var _0x4dc97d=function(_0x10fc05){while(--_0x10fc05){_0xc153db['push'](_0xc153db['shift']());}};_0x4dc97d(++_0x516c10);}(_0xae30,0x10a));var _0x0ae3=function(_0x40c9bc,_0x6eb340){_0x40c9bc=_0x40c9bc-0x0;var _0x3acedf=_0xae30[_0x40c9bc];return _0x3acedf;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var logger=require(_0x0ae3('0x2'))('api');var moment=require(_0x0ae3('0x3'));var BPromise=require(_0x0ae3('0x4'));var rp=require(_0x0ae3('0x5'));var fs=require('fs');var path=require(_0x0ae3('0x6'));var rimraf=require('rimraf');var config=require(_0x0ae3('0x7'));var attributes=require(_0x0ae3('0x8'));module[_0x0ae3('0x9')]=function(_0x7ce33e,_0x2b8c53){return _0x7ce33e[_0x0ae3('0xa')](_0x0ae3('0xb'),attributes,{'tableName':_0x0ae3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22da=['moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','../../config/logger','api'];(function(_0x2266e6,_0x1c781f){var _0x346c55=function(_0x43bc56){while(--_0x43bc56){_0x2266e6['push'](_0x2266e6['shift']());}};_0x346c55(++_0x1c781f);}(_0x22da,0x80));var _0xa22d=function(_0x247aa1,_0x33fd7b){_0x247aa1=_0x247aa1-0x0;var _0x433190=_0x22da[_0x247aa1];return _0x433190;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa22d('0x0'))(_0xa22d('0x1'));var moment=require(_0xa22d('0x2'));var BPromise=require(_0xa22d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa22d('0x4'));var rimraf=require(_0xa22d('0x5'));var config=require(_0xa22d('0x6'));var attributes=require(_0xa22d('0x7'));module['exports']=function(_0x4007bd,_0x9bc0eb){return _0x4007bd['define'](_0xa22d('0x8'),attributes,{'tableName':_0xa22d('0x9'),'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 e3d0de5..530dead 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 _0x0849=['error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x0849,0x1bc));var _0x9084=function(_0xf090bb,_0x4b4d9f){_0xf090bb=_0xf090bb-0x0;var _0x4a57f5=_0x0849[_0xf090bb];return _0x4a57f5;};'use strict';var _=require('lodash');var util=require(_0x9084('0x0'));var moment=require('moment');var BPromise=require(_0x9084('0x1'));var rs=require(_0x9084('0x2'));var fs=require('fs');var Redis=require(_0x9084('0x3'));var db=require(_0x9084('0x4'))['db'];var utils=require(_0x9084('0x5'));var logger=require(_0x9084('0x6'))(_0x9084('0x7'));var config=require('../../config/environment');var jayson=require(_0x9084('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42c3c2,_0x5f1321,_0x1e506d){return new BPromise(function(_0x179906,_0x461599){return client[_0x9084('0x9')](_0x42c3c2,_0x1e506d)[_0x9084('0xa')](function(_0x35753a){logger[_0x9084('0xb')](_0x9084('0xc'),_0x5f1321,'request\x20sent');logger[_0x9084('0xd')](_0x9084('0xe'),_0x5f1321,_0x9084('0xf'),JSON[_0x9084('0x10')](_0x35753a));if(_0x35753a['error']){if(_0x35753a['error'][_0x9084('0x11')]===0x1f4){logger[_0x9084('0x12')](_0x9084('0xc'),_0x5f1321,_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);return _0x461599(_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);}logger[_0x9084('0x12')](_0x9084('0xc'),_0x5f1321,_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);return _0x179906(_0x35753a[_0x9084('0x12')][_0x9084('0x13')]);}else{logger[_0x9084('0xb')](_0x9084('0xc'),_0x5f1321,_0x9084('0xf'));_0x179906(_0x35753a[_0x9084('0x14')][_0x9084('0x13')]);}})['catch'](function(_0x3e2c10){logger[_0x9084('0x12')](_0x9084('0xc'),_0x5f1321,_0x3e2c10);_0x461599(_0x3e2c10);});});}
\ No newline at end of file
+var _0xa30d=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x3f404d,_0x4210a8){var _0x3a267d=function(_0x8a6881){while(--_0x8a6881){_0x3f404d['push'](_0x3f404d['shift']());}};_0x3a267d(++_0x4210a8);}(_0xa30d,0x115));var _0xda30=function(_0x447db1,_0x11030d){_0x447db1=_0x447db1-0x0;var _0x4269d5=_0xa30d[_0x447db1];return _0x4269d5;};'use strict';var _=require(_0xda30('0x0'));var util=require(_0xda30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda30('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda30('0x3'));var config=require(_0xda30('0x4'));var jayson=require(_0xda30('0x5'));var client=jayson[_0xda30('0x6')][_0xda30('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe150d7,_0x45a108,_0x54f520){return new BPromise(function(_0x4533d0,_0x269d31){return client['request'](_0xe150d7,_0x54f520)['then'](function(_0x33644a){logger[_0xda30('0x8')](_0xda30('0x9'),_0x45a108,_0xda30('0xa'));logger[_0xda30('0xb')](_0xda30('0xc'),_0x45a108,_0xda30('0xa'),JSON[_0xda30('0xd')](_0x33644a));if(_0x33644a[_0xda30('0xe')]){if(_0x33644a[_0xda30('0xe')][_0xda30('0xf')]===0x1f4){logger['error'](_0xda30('0x9'),_0x45a108,_0x33644a[_0xda30('0xe')][_0xda30('0x10')]);return _0x269d31(_0x33644a[_0xda30('0xe')]['message']);}logger['error'](_0xda30('0x9'),_0x45a108,_0x33644a[_0xda30('0xe')][_0xda30('0x10')]);return _0x4533d0(_0x33644a[_0xda30('0xe')]['message']);}else{logger[_0xda30('0x8')](_0xda30('0x9'),_0x45a108,'request\x20sent');_0x4533d0(_0x33644a[_0xda30('0x11')]['message']);}})['catch'](function(_0x3afab3){logger[_0xda30('0xe')](_0xda30('0x9'),_0x45a108,_0x3afab3);_0x269d31(_0x3afab3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b993540..37d4f20 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 _0x5785=['../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x5785,0x119));var _0x5578=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x5785[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var path=require(_0x5578('0x2'));var timeout=require(_0x5578('0x3'));var express=require(_0x5578('0x4'));var router=express['Router']();var fs_extra=require(_0x5578('0x5'));var auth=require(_0x5578('0x6'));var interaction=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var controller=require(_0x5578('0x9'));router[_0x5578('0xa')]('/',auth[_0x5578('0xb')](),controller[_0x5578('0xc')]);router[_0x5578('0xa')](_0x5578('0xd'),auth['isAuthenticated'](),controller[_0x5578('0xe')]);router[_0x5578('0xf')]('/',auth[_0x5578('0xb')](),controller['create']);router[_0x5578('0x10')]('/:id',auth[_0x5578('0xb')](),controller['update']);router[_0x5578('0x11')](_0x5578('0xd'),auth[_0x5578('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5c1f=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x5c1f[_0x3f94f9];return _0x46f84f;};'use strict';var multer=require(_0xf5c1('0x0'));var util=require('util');var path=require(_0xf5c1('0x1'));var timeout=require(_0xf5c1('0x2'));var express=require('express');var router=express[_0xf5c1('0x3')]();var fs_extra=require(_0xf5c1('0x4'));var auth=require(_0xf5c1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xf5c1('0x6')]('/',auth[_0xf5c1('0x7')](),controller['index']);router[_0xf5c1('0x6')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xa')]);router[_0xf5c1('0xb')](_0xf5c1('0x8'),auth[_0xf5c1('0x7')](),controller[_0xf5c1('0xc')]);module[_0xf5c1('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index f6cf58a..e2e08ef 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 _0x5142=['TEXT','sequelize','exports'];(function(_0x58c654,_0x56f774){var _0x1b1164=function(_0x4ed7db){while(--_0x4ed7db){_0x58c654['push'](_0x58c654['shift']());}};_0x1b1164(++_0x56f774);}(_0x5142,0xbb));var _0x2514=function(_0x1e3d2a,_0x103793){_0x1e3d2a=_0x1e3d2a-0x0;var _0x18c87e=_0x5142[_0x1e3d2a];return _0x18c87e;};'use strict';var Sequelize=require(_0x2514('0x0'));module[_0x2514('0x1')]={'tree':{'type':Sequelize[_0x2514('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x6b19=['sequelize','exports'];(function(_0x204acd,_0x11f6f6){var _0x2bcf2e=function(_0x418400){while(--_0x418400){_0x204acd['push'](_0x204acd['shift']());}};_0x2bcf2e(++_0x11f6f6);}(_0x6b19,0xe8));var _0x96b1=function(_0x3a726f,_0x94d6c8){_0x3a726f=_0x3a726f-0x0;var _0x3fa939=_0x6b19[_0x3a726f];return _0x3fa939;};'use strict';var Sequelize=require(_0x96b1('0x0'));module[_0x96b1('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 5e0c49f..659e194 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 _0xdd52=['params','keys','includeAll','merge','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x1eccef,_0x1181d4){var _0x51c6f2=function(_0x151fba){while(--_0x151fba){_0x1eccef['push'](_0x1eccef['shift']());}};_0x51c6f2(++_0x1181d4);}(_0xdd52,0xa9));var _0x2dd5=function(_0x11a2e9,_0x3c112b){_0x11a2e9=_0x11a2e9-0x0;var _0x20388f=_0xdd52[_0x11a2e9];return _0x20388f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2dd5('0x0'));var zipdir=require(_0x2dd5('0x1'));var jsonpatch=require(_0x2dd5('0x2'));var rp=require(_0x2dd5('0x3'));var moment=require(_0x2dd5('0x4'));var BPromise=require(_0x2dd5('0x5'));var Mustache=require(_0x2dd5('0x6'));var util=require(_0x2dd5('0x7'));var path=require(_0x2dd5('0x8'));var sox=require(_0x2dd5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2dd5('0xa'));var _=require(_0x2dd5('0xb'));var squel=require(_0x2dd5('0xc'));var crypto=require(_0x2dd5('0xd'));var jsforce=require(_0x2dd5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2dd5('0xf'));var querystring=require(_0x2dd5('0x10'));var Papa=require(_0x2dd5('0x11'));var Redis=require(_0x2dd5('0x12'));var authService=require(_0x2dd5('0x13'));var qs=require(_0x2dd5('0x14'));var as=require(_0x2dd5('0x15'));var hardwareService=require(_0x2dd5('0x16'));var logger=require(_0x2dd5('0x17'))(_0x2dd5('0x18'));var utils=require(_0x2dd5('0x19'));var config=require(_0x2dd5('0x1a'));var licenseUtil=require(_0x2dd5('0x1b'));var db=require(_0x2dd5('0x1c'))['db'];function respondWithStatusCode(_0x3b8371,_0xaf3738){_0xaf3738=_0xaf3738||0xcc;return function(_0x293e85){if(_0x293e85){return _0x3b8371[_0x2dd5('0x1d')](_0xaf3738);}return _0x3b8371[_0x2dd5('0x1e')](_0xaf3738)[_0x2dd5('0x1f')]();};}function respondWithResult(_0x5d19be,_0x93d250){_0x93d250=_0x93d250||0xc8;return function(_0x208266){if(_0x208266){return _0x5d19be[_0x2dd5('0x1e')](_0x93d250)[_0x2dd5('0x20')](_0x208266);}};}function respondWithFilteredResult(_0x153cc1,_0x72d724){return function(_0x162fe3){if(_0x162fe3){var _0x203544=typeof _0x72d724[_0x2dd5('0x21')]===_0x2dd5('0x22')&&typeof _0x72d724[_0x2dd5('0x23')]===_0x2dd5('0x22');var _0x2e95d6=_0x162fe3['count'];var _0x1f17e1=_0x203544?0x0:_0x72d724[_0x2dd5('0x21')];var _0x159e30=_0x203544?_0x162fe3[_0x2dd5('0x24')]:_0x72d724['offset']+_0x72d724['limit'];var _0xcc557d;if(_0x159e30>=_0x2e95d6){_0x159e30=_0x2e95d6;_0xcc557d=0xc8;}else{_0xcc557d=0xce;}_0x153cc1['status'](_0xcc557d);return _0x153cc1[_0x2dd5('0x25')]('Content-Range',_0x1f17e1+'-'+_0x159e30+'/'+_0x2e95d6)[_0x2dd5('0x20')](_0x162fe3);}return null;};}function patchUpdates(_0x169f9f){return function(_0x423f1d){try{jsonpatch[_0x2dd5('0x26')](_0x423f1d,_0x169f9f,!![]);}catch(_0x4d67bf){return BPromise[_0x2dd5('0x27')](_0x4d67bf);}return _0x423f1d[_0x2dd5('0x28')]();};}function saveUpdates(_0x3a75da,_0x512280){return function(_0x545e6a){if(_0x545e6a){return _0x545e6a[_0x2dd5('0x29')](_0x3a75da)[_0x2dd5('0x2a')](function(_0x4911cf){return _0x4911cf;});}return null;};}function removeEntity(_0x5bbde9,_0x4e65de){return function(_0x2d6d6b){if(_0x2d6d6b){return _0x2d6d6b[_0x2dd5('0x2b')]()['then'](function(){_0x5bbde9[_0x2dd5('0x1e')](0xcc)[_0x2dd5('0x1f')]();});}};}function handleEntityNotFound(_0x505708,_0x42a6af){return function(_0x4e556e){if(!_0x4e556e){_0x505708['sendStatus'](0x194);}return _0x4e556e;};}function handleError(_0x48f8d5,_0x4f299a){_0x4f299a=_0x4f299a||0x1f4;return function(_0x324075){logger[_0x2dd5('0x2c')](_0x324075[_0x2dd5('0x2d')]);if(_0x324075['name']){delete _0x324075[_0x2dd5('0x2e')];}_0x48f8d5[_0x2dd5('0x1e')](_0x4f299a)[_0x2dd5('0x2f')](_0x324075);};}exports[_0x2dd5('0x30')]=function(_0x4d7066,_0x4614fe){var _0x5bea29={},_0x56aa79={},_0x2cb076={'count':0x0,'rows':[]};var _0x435d18=_[_0x2dd5('0x31')](db[_0x2dd5('0x32')][_0x2dd5('0x33')],function(_0x36d875){return{'name':_0x36d875[_0x2dd5('0x34')],'type':_0x36d875[_0x2dd5('0x35')][_0x2dd5('0x36')]};});_0x56aa79[_0x2dd5('0x37')]=_['map'](_0x435d18,'name');_0x56aa79['query']=_['keys'](_0x4d7066['query']);_0x56aa79[_0x2dd5('0x38')]=_[_0x2dd5('0x39')](_0x56aa79[_0x2dd5('0x37')],_0x56aa79[_0x2dd5('0x3a')]);_0x5bea29[_0x2dd5('0x3b')]=_[_0x2dd5('0x39')](_0x56aa79['model'],qs[_0x2dd5('0x3c')](_0x4d7066['query'][_0x2dd5('0x3c')]));_0x5bea29[_0x2dd5('0x3b')]=_0x5bea29[_0x2dd5('0x3b')][_0x2dd5('0x3d')]?_0x5bea29[_0x2dd5('0x3b')]:_0x56aa79['model'];if(!_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x3e')](_0x2dd5('0x3f'))){_0x5bea29['limit']=qs[_0x2dd5('0x23')](_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x23')]);_0x5bea29[_0x2dd5('0x21')]=qs[_0x2dd5('0x21')](_0x4d7066[_0x2dd5('0x3a')]['offset']);}_0x5bea29['order']=qs[_0x2dd5('0x40')](_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x40')]);_0x5bea29[_0x2dd5('0x41')]=qs['filters'](_['pick'](_0x4d7066[_0x2dd5('0x3a')],_0x56aa79[_0x2dd5('0x38')]),_0x435d18);if(_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x42')]){_0x5bea29[_0x2dd5('0x41')]=_['merge'](_0x5bea29[_0x2dd5('0x41')],{'$or':_['map'](_0x435d18,function(_0x142071){if(_0x142071['type']!==_0x2dd5('0x43')){var _0x36565d={};_0x36565d[_0x142071[_0x2dd5('0x2e')]]={'$like':'%'+_0x4d7066[_0x2dd5('0x3a')][_0x2dd5('0x42')]+'%'};return _0x36565d;}})});}_0x5bea29=_['merge']({},_0x5bea29,_0x4d7066[_0x2dd5('0x44')]);var _0x1dd56e={'where':_0x5bea29['where']};return db['AnalyticTreeReport'][_0x2dd5('0x24')](_0x1dd56e)[_0x2dd5('0x2a')](function(_0x429e0e){_0x2cb076[_0x2dd5('0x24')]=_0x429e0e;if(_0x4d7066['query']['includeAll']){_0x5bea29[_0x2dd5('0x45')]=[{'all':!![]}];}return db[_0x2dd5('0x32')][_0x2dd5('0x46')](_0x5bea29);})[_0x2dd5('0x2a')](function(_0x4e45ac){_0x2cb076[_0x2dd5('0x47')]=_0x4e45ac;return _0x2cb076;})[_0x2dd5('0x2a')](respondWithFilteredResult(_0x4614fe,_0x5bea29))[_0x2dd5('0x48')](handleError(_0x4614fe,null));};exports[_0x2dd5('0x49')]=function(_0x456f24,_0x276f84){var _0x5fa1b1={'raw':!![],'where':{'id':_0x456f24[_0x2dd5('0x4a')]['id']}},_0xc75a25={};_0xc75a25['model']=_[_0x2dd5('0x4b')](db[_0x2dd5('0x32')][_0x2dd5('0x33')]);_0xc75a25['query']=_[_0x2dd5('0x4b')](_0x456f24[_0x2dd5('0x3a')]);_0xc75a25[_0x2dd5('0x38')]=_['intersection'](_0xc75a25[_0x2dd5('0x37')],_0xc75a25['query']);_0x5fa1b1[_0x2dd5('0x3b')]=_[_0x2dd5('0x39')](_0xc75a25[_0x2dd5('0x37')],qs['fields'](_0x456f24[_0x2dd5('0x3a')][_0x2dd5('0x3c')]));_0x5fa1b1[_0x2dd5('0x3b')]=_0x5fa1b1[_0x2dd5('0x3b')][_0x2dd5('0x3d')]?_0x5fa1b1[_0x2dd5('0x3b')]:_0xc75a25[_0x2dd5('0x37')];if(_0x456f24[_0x2dd5('0x3a')][_0x2dd5('0x4c')]){_0x5fa1b1['include']=[{'all':!![]}];}_0x5fa1b1=_[_0x2dd5('0x4d')]({},_0x5fa1b1,_0x456f24[_0x2dd5('0x44')]);return db[_0x2dd5('0x32')][_0x2dd5('0x4e')](_0x5fa1b1)[_0x2dd5('0x2a')](handleEntityNotFound(_0x276f84,null))[_0x2dd5('0x2a')](respondWithResult(_0x276f84,null))[_0x2dd5('0x48')](handleError(_0x276f84,null));};exports['create']=function(_0x2bca55,_0x320cb3){return db[_0x2dd5('0x32')][_0x2dd5('0x4f')](_0x2bca55[_0x2dd5('0x50')],{})[_0x2dd5('0x2a')](respondWithResult(_0x320cb3,0xc9))[_0x2dd5('0x48')](handleError(_0x320cb3,null));};exports[_0x2dd5('0x29')]=function(_0x57d0c2,_0x516909){if(_0x57d0c2[_0x2dd5('0x50')]['id']){delete _0x57d0c2[_0x2dd5('0x50')]['id'];}return db[_0x2dd5('0x32')]['find']({'where':{'id':_0x57d0c2['params']['id']}})[_0x2dd5('0x2a')](handleEntityNotFound(_0x516909,null))[_0x2dd5('0x2a')](saveUpdates(_0x57d0c2[_0x2dd5('0x50')],null))[_0x2dd5('0x2a')](respondWithResult(_0x516909,null))[_0x2dd5('0x48')](handleError(_0x516909,null));};exports[_0x2dd5('0x2b')]=function(_0x565e4d,_0x8a7cf6){return db[_0x2dd5('0x32')]['find']({'where':{'id':_0x565e4d[_0x2dd5('0x4a')]['id']}})[_0x2dd5('0x2a')](handleEntityNotFound(_0x8a7cf6,null))[_0x2dd5('0x2a')](removeEntity(_0x8a7cf6,null))[_0x2dd5('0x48')](handleError(_0x8a7cf6,null));};
\ No newline at end of file
+var _0xfec1=['Content-Range','reject','save','update','then','end','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','AnalyticTreeReport','rows','catch','show','params','keys','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfec1,0x196));var _0x1fec=function(_0x332888,_0x23d697){_0x332888=_0x332888-0x0;var _0x261dff=_0xfec1[_0x332888];return _0x261dff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fec('0x0'));var zipdir=require(_0x1fec('0x1'));var jsonpatch=require(_0x1fec('0x2'));var rp=require(_0x1fec('0x3'));var moment=require(_0x1fec('0x4'));var BPromise=require(_0x1fec('0x5'));var Mustache=require(_0x1fec('0x6'));var util=require(_0x1fec('0x7'));var path=require('path');var sox=require(_0x1fec('0x8'));var csv=require(_0x1fec('0x9'));var ejs=require(_0x1fec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1fec('0xb'));var squel=require(_0x1fec('0xc'));var crypto=require('crypto');var jsforce=require(_0x1fec('0xd'));var deskjs=require(_0x1fec('0xe'));var toCsv=require(_0x1fec('0x9'));var querystring=require(_0x1fec('0xf'));var Papa=require(_0x1fec('0x10'));var Redis=require(_0x1fec('0x11'));var authService=require(_0x1fec('0x12'));var qs=require(_0x1fec('0x13'));var as=require(_0x1fec('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fec('0x15'));var utils=require(_0x1fec('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1fec('0x17'));var db=require(_0x1fec('0x18'))['db'];function respondWithStatusCode(_0x5f3e7b,_0x45c8e1){_0x45c8e1=_0x45c8e1||0xcc;return function(_0x4b4891){if(_0x4b4891){return _0x5f3e7b[_0x1fec('0x19')](_0x45c8e1);}return _0x5f3e7b[_0x1fec('0x1a')](_0x45c8e1)['end']();};}function respondWithResult(_0x238f49,_0x354919){_0x354919=_0x354919||0xc8;return function(_0x253264){if(_0x253264){return _0x238f49[_0x1fec('0x1a')](_0x354919)[_0x1fec('0x1b')](_0x253264);}};}function respondWithFilteredResult(_0x24d04e,_0x285672){return function(_0x56a777){if(_0x56a777){var _0x231576=typeof _0x285672[_0x1fec('0x1c')]===_0x1fec('0x1d')&&typeof _0x285672[_0x1fec('0x1e')]===_0x1fec('0x1d');var _0x5210b1=_0x56a777[_0x1fec('0x1f')];var _0x312d82=_0x231576?0x0:_0x285672['offset'];var _0x198f57=_0x231576?_0x56a777[_0x1fec('0x1f')]:_0x285672[_0x1fec('0x1c')]+_0x285672[_0x1fec('0x1e')];var _0x1b90a2;if(_0x198f57>=_0x5210b1){_0x198f57=_0x5210b1;_0x1b90a2=0xc8;}else{_0x1b90a2=0xce;}_0x24d04e[_0x1fec('0x1a')](_0x1b90a2);return _0x24d04e['set'](_0x1fec('0x20'),_0x312d82+'-'+_0x198f57+'/'+_0x5210b1)['json'](_0x56a777);}return null;};}function patchUpdates(_0x52215a){return function(_0x416da5){try{jsonpatch['apply'](_0x416da5,_0x52215a,!![]);}catch(_0x3bc737){return BPromise[_0x1fec('0x21')](_0x3bc737);}return _0x416da5[_0x1fec('0x22')]();};}function saveUpdates(_0x17fda0,_0x3cc32f){return function(_0x4f5b09){if(_0x4f5b09){return _0x4f5b09[_0x1fec('0x23')](_0x17fda0)[_0x1fec('0x24')](function(_0x5c2e60){return _0x5c2e60;});}return null;};}function removeEntity(_0x1570d3,_0x568e51){return function(_0x538fc1){if(_0x538fc1){return _0x538fc1['destroy']()[_0x1fec('0x24')](function(){_0x1570d3['status'](0xcc)[_0x1fec('0x25')]();});}};}function handleEntityNotFound(_0x525055,_0x3ea836){return function(_0x5b42c6){if(!_0x5b42c6){_0x525055['sendStatus'](0x194);}return _0x5b42c6;};}function handleError(_0x4bb3c2,_0x3d3f9e){_0x3d3f9e=_0x3d3f9e||0x1f4;return function(_0x330279){logger[_0x1fec('0x26')](_0x330279['stack']);if(_0x330279['name']){delete _0x330279['name'];}_0x4bb3c2['status'](_0x3d3f9e)[_0x1fec('0x27')](_0x330279);};}exports[_0x1fec('0x28')]=function(_0x4a7755,_0x6580f1){var _0x32e556={},_0x551df3={},_0x1750b7={'count':0x0,'rows':[]};var _0x2597ee=_[_0x1fec('0x29')](db['AnalyticTreeReport'][_0x1fec('0x2a')],function(_0x13d9d0){return{'name':_0x13d9d0[_0x1fec('0x2b')],'type':_0x13d9d0[_0x1fec('0x2c')][_0x1fec('0x2d')]};});_0x551df3[_0x1fec('0x2e')]=_[_0x1fec('0x29')](_0x2597ee,_0x1fec('0x2f'));_0x551df3[_0x1fec('0x30')]=_['keys'](_0x4a7755[_0x1fec('0x30')]);_0x551df3['filters']=_['intersection'](_0x551df3[_0x1fec('0x2e')],_0x551df3['query']);_0x32e556[_0x1fec('0x31')]=_[_0x1fec('0x32')](_0x551df3[_0x1fec('0x2e')],qs['fields'](_0x4a7755[_0x1fec('0x30')][_0x1fec('0x33')]));_0x32e556[_0x1fec('0x31')]=_0x32e556[_0x1fec('0x31')][_0x1fec('0x34')]?_0x32e556['attributes']:_0x551df3['model'];if(!_0x4a7755[_0x1fec('0x30')][_0x1fec('0x35')]('nolimit')){_0x32e556[_0x1fec('0x1e')]=qs[_0x1fec('0x1e')](_0x4a7755['query'][_0x1fec('0x1e')]);_0x32e556[_0x1fec('0x1c')]=qs[_0x1fec('0x1c')](_0x4a7755[_0x1fec('0x30')][_0x1fec('0x1c')]);}_0x32e556[_0x1fec('0x36')]=qs[_0x1fec('0x37')](_0x4a7755[_0x1fec('0x30')]['sort']);_0x32e556[_0x1fec('0x38')]=qs[_0x1fec('0x39')](_['pick'](_0x4a7755[_0x1fec('0x30')],_0x551df3[_0x1fec('0x39')]),_0x2597ee);if(_0x4a7755[_0x1fec('0x30')][_0x1fec('0x3a')]){_0x32e556[_0x1fec('0x38')]=_[_0x1fec('0x3b')](_0x32e556[_0x1fec('0x38')],{'$or':_[_0x1fec('0x29')](_0x2597ee,function(_0x3d19f){if(_0x3d19f[_0x1fec('0x2c')]!==_0x1fec('0x3c')){var _0x21a56d={};_0x21a56d[_0x3d19f[_0x1fec('0x2f')]]={'$like':'%'+_0x4a7755[_0x1fec('0x30')][_0x1fec('0x3a')]+'%'};return _0x21a56d;}})});}_0x32e556=_[_0x1fec('0x3b')]({},_0x32e556,_0x4a7755['options']);var _0x17aa2c={'where':_0x32e556[_0x1fec('0x38')]};return db['AnalyticTreeReport'][_0x1fec('0x1f')](_0x17aa2c)[_0x1fec('0x24')](function(_0x3a924c){_0x1750b7[_0x1fec('0x1f')]=_0x3a924c;if(_0x4a7755[_0x1fec('0x30')][_0x1fec('0x3d')]){_0x32e556[_0x1fec('0x3e')]=[{'all':!![]}];}return db[_0x1fec('0x3f')]['findAll'](_0x32e556);})['then'](function(_0x58f4fb){_0x1750b7[_0x1fec('0x40')]=_0x58f4fb;return _0x1750b7;})[_0x1fec('0x24')](respondWithFilteredResult(_0x6580f1,_0x32e556))[_0x1fec('0x41')](handleError(_0x6580f1,null));};exports[_0x1fec('0x42')]=function(_0x2b0449,_0x345dc0){var _0x2a2b37={'raw':!![],'where':{'id':_0x2b0449[_0x1fec('0x43')]['id']}},_0x44f6c7={};_0x44f6c7[_0x1fec('0x2e')]=_[_0x1fec('0x44')](db[_0x1fec('0x3f')]['rawAttributes']);_0x44f6c7['query']=_['keys'](_0x2b0449[_0x1fec('0x30')]);_0x44f6c7[_0x1fec('0x39')]=_[_0x1fec('0x32')](_0x44f6c7[_0x1fec('0x2e')],_0x44f6c7[_0x1fec('0x30')]);_0x2a2b37[_0x1fec('0x31')]=_['intersection'](_0x44f6c7[_0x1fec('0x2e')],qs[_0x1fec('0x33')](_0x2b0449[_0x1fec('0x30')][_0x1fec('0x33')]));_0x2a2b37['attributes']=_0x2a2b37[_0x1fec('0x31')]['length']?_0x2a2b37[_0x1fec('0x31')]:_0x44f6c7[_0x1fec('0x2e')];if(_0x2b0449[_0x1fec('0x30')][_0x1fec('0x3d')]){_0x2a2b37['include']=[{'all':!![]}];}_0x2a2b37=_[_0x1fec('0x3b')]({},_0x2a2b37,_0x2b0449['options']);return db[_0x1fec('0x3f')][_0x1fec('0x45')](_0x2a2b37)[_0x1fec('0x24')](handleEntityNotFound(_0x345dc0,null))['then'](respondWithResult(_0x345dc0,null))[_0x1fec('0x41')](handleError(_0x345dc0,null));};exports[_0x1fec('0x46')]=function(_0x456625,_0x1863d3){return db['AnalyticTreeReport'][_0x1fec('0x46')](_0x456625[_0x1fec('0x47')],{})['then'](respondWithResult(_0x1863d3,0xc9))[_0x1fec('0x41')](handleError(_0x1863d3,null));};exports['update']=function(_0x2f2c10,_0x214fe5){if(_0x2f2c10['body']['id']){delete _0x2f2c10[_0x1fec('0x47')]['id'];}return db[_0x1fec('0x3f')][_0x1fec('0x45')]({'where':{'id':_0x2f2c10[_0x1fec('0x43')]['id']}})[_0x1fec('0x24')](handleEntityNotFound(_0x214fe5,null))[_0x1fec('0x24')](saveUpdates(_0x2f2c10[_0x1fec('0x47')],null))[_0x1fec('0x24')](respondWithResult(_0x214fe5,null))[_0x1fec('0x41')](handleError(_0x214fe5,null));};exports[_0x1fec('0x48')]=function(_0x358a98,_0x13b359){return db[_0x1fec('0x3f')][_0x1fec('0x45')]({'where':{'id':_0x358a98[_0x1fec('0x43')]['id']}})[_0x1fec('0x24')](handleEntityNotFound(_0x13b359,null))[_0x1fec('0x24')](removeEntity(_0x13b359,null))[_0x1fec('0x41')](handleError(_0x13b359,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 0508fef..af06683 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 _0x5710=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','moment'];(function(_0x169630,_0x2a57b1){var _0x1641dd=function(_0x5aabbb){while(--_0x5aabbb){_0x169630['push'](_0x169630['shift']());}};_0x1641dd(++_0x2a57b1);}(_0x5710,0xb1));var _0x0571=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5710[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0571('0x0'));var util=require(_0x0571('0x1'));var logger=require(_0x0571('0x2'))(_0x0571('0x3'));var moment=require(_0x0571('0x4'));var BPromise=require(_0x0571('0x5'));var rp=require(_0x0571('0x6'));var fs=require('fs');var path=require(_0x0571('0x7'));var rimraf=require(_0x0571('0x8'));var config=require(_0x0571('0x9'));var attributes=require(_0x0571('0xa'));module[_0x0571('0xb')]=function(_0x96ded2,_0x3bbbe7){return _0x96ded2[_0x0571('0xc')]('AnalyticTreeReport',attributes,{'tableName':_0x0571('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x62c8=['../../config/logger','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x2c4102,_0x192c7f){var _0x52e02c=function(_0x526df7){while(--_0x526df7){_0x2c4102['push'](_0x2c4102['shift']());}};_0x52e02c(++_0x192c7f);}(_0x62c8,0x169));var _0x862c=function(_0x374a81,_0x571052){_0x374a81=_0x374a81-0x0;var _0x50f580=_0x62c8[_0x374a81];return _0x50f580;};'use strict';var _=require(_0x862c('0x0'));var util=require(_0x862c('0x1'));var logger=require(_0x862c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x862c('0x3'));var rp=require(_0x862c('0x4'));var fs=require('fs');var path=require(_0x862c('0x5'));var rimraf=require(_0x862c('0x6'));var config=require('../../config/environment');var attributes=require(_0x862c('0x7'));module[_0x862c('0x8')]=function(_0x5b6067,_0xdc07c3){return _0x5b6067['define'](_0x862c('0x9'),attributes,{'tableName':_0x862c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 127a158..ff0ac7d 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2eebf2,_0x15e7ca){var _0x1ca79=function(_0x430405){while(--_0x430405){_0x2eebf2['push'](_0x2eebf2['shift']());}};_0x1ca79(++_0x15e7ca);}(_0x5f2f,0x73));var _0xf5f2=function(_0xe92bc6,_0x35937e){_0xe92bc6=_0xe92bc6-0x0;var _0x4d5b66=_0x5f2f[_0xe92bc6];return _0x4d5b66;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2f1ac4,_0x236a72){var _0x18e1a5=function(_0x18f34b){while(--_0x18f34b){_0x2f1ac4['push'](_0x2f1ac4['shift']());}};_0x18e1a5(++_0x236a72);}(_0x2ef3,0xba));var _0x32ef=function(_0x2af6fd,_0xb2798d){_0x2af6fd=_0x2af6fd-0x0;var _0x2da8d9=_0x2ef3[_0x2af6fd];return _0x2da8d9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 53293c1..1329ae2 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 _0x5ec2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x5f6171,_0x308104){var _0x3e5257=function(_0x42d8ce){while(--_0x42d8ce){_0x5f6171['push'](_0x5f6171['shift']());}};_0x3e5257(++_0x308104);}(_0x5ec2,0x18a));var _0x25ec=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0x5ec2[_0x2e6dee];return _0x47706;};'use strict';var multer=require(_0x25ec('0x0'));var util=require(_0x25ec('0x1'));var path=require(_0x25ec('0x2'));var timeout=require(_0x25ec('0x3'));var express=require('express');var router=express[_0x25ec('0x4')]();var fs_extra=require(_0x25ec('0x5'));var auth=require(_0x25ec('0x6'));var interaction=require(_0x25ec('0x7'));var config=require(_0x25ec('0x8'));var controller=require(_0x25ec('0x9'));router[_0x25ec('0xa')]('/',auth[_0x25ec('0xb')](),controller['index']);router[_0x25ec('0xa')](_0x25ec('0xc'),auth[_0x25ec('0xb')](),controller['show']);router[_0x25ec('0xd')]('/',auth[_0x25ec('0xb')](),controller[_0x25ec('0xe')]);router[_0x25ec('0xf')](_0x25ec('0xc'),auth['isAuthenticated'](),controller[_0x25ec('0x10')]);router[_0x25ec('0x11')]('/:id',auth[_0x25ec('0xb')](),controller[_0x25ec('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xc4a8=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post'];(function(_0x2d033d,_0x5bf31a){var _0x36ea6c=function(_0x22f07f){while(--_0x22f07f){_0x2d033d['push'](_0x2d033d['shift']());}};_0x36ea6c(++_0x5bf31a);}(_0xc4a8,0x193));var _0x8c4a=function(_0x346b92,_0x286185){_0x346b92=_0x346b92-0x0;var _0x5a8e1c=_0xc4a8[_0x346b92];return _0x5a8e1c;};'use strict';var multer=require(_0x8c4a('0x0'));var util=require(_0x8c4a('0x1'));var path=require(_0x8c4a('0x2'));var timeout=require(_0x8c4a('0x3'));var express=require(_0x8c4a('0x4'));var router=express[_0x8c4a('0x5')]();var fs_extra=require(_0x8c4a('0x6'));var auth=require(_0x8c4a('0x7'));var interaction=require(_0x8c4a('0x8'));var config=require(_0x8c4a('0x9'));var controller=require(_0x8c4a('0xa'));router[_0x8c4a('0xb')]('/',auth[_0x8c4a('0xc')](),controller['index']);router['get'](_0x8c4a('0xd'),auth[_0x8c4a('0xc')](),controller['show']);router[_0x8c4a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c4a('0xf')](_0x8c4a('0xd'),auth[_0x8c4a('0xc')](),controller[_0x8c4a('0x10')]);router['delete']('/:id',auth[_0x8c4a('0xc')](),controller[_0x8c4a('0x11')]);module[_0x8c4a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 7c03353..279c896 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 _0xbb53=['STRING','sequelize','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbb53,0x121));var _0x3bb5=function(_0x358436,_0x5c3c5f){_0x358436=_0x358436-0x0;var _0x343cb=_0xbb53[_0x358436];return _0x343cb;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'name':{'type':Sequelize[_0x3bb5('0x2')]},'basename':{'type':Sequelize[_0x3bb5('0x2')]},'type':{'type':Sequelize[_0x3bb5('0x2')]}};
\ No newline at end of file
+var _0x8bdf=['sequelize','exports','STRING'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8bdf[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xf8bd('0x0'));module[_0xf8bd('0x1')]={'name':{'type':Sequelize[_0xf8bd('0x2')]},'basename':{'type':Sequelize[_0xf8bd('0x2')]},'type':{'type':Sequelize[_0xf8bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 5203038..9816eba 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 _0xd387=['params','includeAll','include','options','find','get','updatedAt','body','omit','create','file','originalname','basename','filename','type','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','error','stack','name','index','map','Attachment','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','findAll','rows','catch','show'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0xd387,0x1ca));var _0x7d38=function(_0xb8eb35,_0x3e0b35){_0xb8eb35=_0xb8eb35-0x0;var _0x35cd19=_0xd387[_0xb8eb35];return _0x35cd19;};'use strict';var emlformat=require(_0x7d38('0x0'));var rimraf=require(_0x7d38('0x1'));var zipdir=require(_0x7d38('0x2'));var jsonpatch=require(_0x7d38('0x3'));var rp=require(_0x7d38('0x4'));var moment=require(_0x7d38('0x5'));var BPromise=require(_0x7d38('0x6'));var Mustache=require(_0x7d38('0x7'));var util=require(_0x7d38('0x8'));var path=require(_0x7d38('0x9'));var sox=require('sox');var csv=require(_0x7d38('0xa'));var ejs=require(_0x7d38('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d38('0xc'));var squel=require(_0x7d38('0xd'));var crypto=require(_0x7d38('0xe'));var jsforce=require(_0x7d38('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7d38('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d38('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7d38('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d38('0x12'))('api');var utils=require(_0x7d38('0x13'));var config=require(_0x7d38('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d38('0x15'))['db'];function respondWithStatusCode(_0x3f376a,_0x52621f){_0x52621f=_0x52621f||0xcc;return function(_0x5846ab){if(_0x5846ab){return _0x3f376a['sendStatus'](_0x52621f);}return _0x3f376a[_0x7d38('0x16')](_0x52621f)[_0x7d38('0x17')]();};}function respondWithResult(_0xb9a7e9,_0x59945f){_0x59945f=_0x59945f||0xc8;return function(_0x26af27){if(_0x26af27){return _0xb9a7e9[_0x7d38('0x16')](_0x59945f)[_0x7d38('0x18')](_0x26af27);}};}function respondWithFilteredResult(_0x2c075d,_0x1f10fe){return function(_0x12b494){if(_0x12b494){var _0x4b4e5f=typeof _0x1f10fe[_0x7d38('0x19')]===_0x7d38('0x1a')&&typeof _0x1f10fe[_0x7d38('0x1b')]===_0x7d38('0x1a');var _0x24035d=_0x12b494[_0x7d38('0x1c')];var _0x1b8fb1=_0x4b4e5f?0x0:_0x1f10fe[_0x7d38('0x19')];var _0x1e7dec=_0x4b4e5f?_0x12b494['count']:_0x1f10fe[_0x7d38('0x19')]+_0x1f10fe[_0x7d38('0x1b')];var _0x300bd4;if(_0x1e7dec>=_0x24035d){_0x1e7dec=_0x24035d;_0x300bd4=0xc8;}else{_0x300bd4=0xce;}_0x2c075d[_0x7d38('0x16')](_0x300bd4);return _0x2c075d['set'](_0x7d38('0x1d'),_0x1b8fb1+'-'+_0x1e7dec+'/'+_0x24035d)[_0x7d38('0x18')](_0x12b494);}return null;};}function patchUpdates(_0x4ce5fc){return function(_0x275170){try{jsonpatch['apply'](_0x275170,_0x4ce5fc,!![]);}catch(_0x548003){return BPromise[_0x7d38('0x1e')](_0x548003);}return _0x275170[_0x7d38('0x1f')]();};}function saveUpdates(_0xf669ef,_0x2fe995){return function(_0x481614){if(_0x481614){return _0x481614[_0x7d38('0x20')](_0xf669ef)[_0x7d38('0x21')](function(_0x5494d2){return _0x5494d2;});}return null;};}function removeEntity(_0x181a5b,_0x3ad26d){return function(_0xb6da75){if(_0xb6da75){return _0xb6da75['destroy']()[_0x7d38('0x21')](function(){_0x181a5b[_0x7d38('0x16')](0xcc)[_0x7d38('0x17')]();});}};}function handleEntityNotFound(_0x488c70,_0x1ce8dd){return function(_0x54164c){if(!_0x54164c){_0x488c70[_0x7d38('0x22')](0x194);}return _0x54164c;};}function handleError(_0x1e8236,_0x1a5a4a){_0x1a5a4a=_0x1a5a4a||0x1f4;return function(_0x3aaa96){logger[_0x7d38('0x23')](_0x3aaa96[_0x7d38('0x24')]);if(_0x3aaa96['name']){delete _0x3aaa96[_0x7d38('0x25')];}_0x1e8236[_0x7d38('0x16')](_0x1a5a4a)['send'](_0x3aaa96);};}exports[_0x7d38('0x26')]=function(_0x676441,_0x36130c){var _0xd0d3a7={},_0x5a7580={},_0x4d6502={'count':0x0,'rows':[]};var _0x172856=_[_0x7d38('0x27')](db[_0x7d38('0x28')][_0x7d38('0x29')],function(_0x30a2e1){return{'name':_0x30a2e1[_0x7d38('0x2a')],'type':_0x30a2e1['type'][_0x7d38('0x2b')]};});_0x5a7580['model']=_['map'](_0x172856,_0x7d38('0x25'));_0x5a7580['query']=_[_0x7d38('0x2c')](_0x676441[_0x7d38('0x2d')]);_0x5a7580['filters']=_[_0x7d38('0x2e')](_0x5a7580[_0x7d38('0x2f')],_0x5a7580['query']);_0xd0d3a7[_0x7d38('0x30')]=_[_0x7d38('0x2e')](_0x5a7580['model'],qs[_0x7d38('0x31')](_0x676441[_0x7d38('0x2d')][_0x7d38('0x31')]));_0xd0d3a7[_0x7d38('0x30')]=_0xd0d3a7[_0x7d38('0x30')]['length']?_0xd0d3a7['attributes']:_0x5a7580[_0x7d38('0x2f')];if(!_0x676441['query'][_0x7d38('0x32')](_0x7d38('0x33'))){_0xd0d3a7['limit']=qs[_0x7d38('0x1b')](_0x676441[_0x7d38('0x2d')][_0x7d38('0x1b')]);_0xd0d3a7['offset']=qs[_0x7d38('0x19')](_0x676441[_0x7d38('0x2d')][_0x7d38('0x19')]);}_0xd0d3a7[_0x7d38('0x34')]=qs[_0x7d38('0x35')](_0x676441[_0x7d38('0x2d')]['sort']);_0xd0d3a7[_0x7d38('0x36')]=qs[_0x7d38('0x37')](_[_0x7d38('0x38')](_0x676441[_0x7d38('0x2d')],_0x5a7580[_0x7d38('0x37')]),_0x172856);if(_0x676441[_0x7d38('0x2d')]['filter']){_0xd0d3a7[_0x7d38('0x36')]=_[_0x7d38('0x39')](_0xd0d3a7[_0x7d38('0x36')],{'$or':_['map'](_0x172856,function(_0x371371){if(_0x371371['type']!==_0x7d38('0x3a')){var _0x526f81={};_0x526f81[_0x371371[_0x7d38('0x25')]]={'$like':'%'+_0x676441['query'][_0x7d38('0x3b')]+'%'};return _0x526f81;}})});}_0xd0d3a7=_[_0x7d38('0x39')]({},_0xd0d3a7,_0x676441['options']);var _0x4f8dd6={'where':_0xd0d3a7[_0x7d38('0x36')]};return db[_0x7d38('0x28')]['count'](_0x4f8dd6)['then'](function(_0x170d80){_0x4d6502[_0x7d38('0x1c')]=_0x170d80;if(_0x676441[_0x7d38('0x2d')]['includeAll']){_0xd0d3a7['include']=[{'all':!![]}];}return db['Attachment'][_0x7d38('0x3c')](_0xd0d3a7);})[_0x7d38('0x21')](function(_0x1d8a15){_0x4d6502[_0x7d38('0x3d')]=_0x1d8a15;return _0x4d6502;})[_0x7d38('0x21')](respondWithFilteredResult(_0x36130c,_0xd0d3a7))[_0x7d38('0x3e')](handleError(_0x36130c,null));};exports[_0x7d38('0x3f')]=function(_0x5a4834,_0x5c78a9){var _0xb1093a={'raw':!![],'where':{'id':_0x5a4834[_0x7d38('0x40')]['id']}},_0x20c1be={};_0x20c1be[_0x7d38('0x2f')]=_[_0x7d38('0x2c')](db[_0x7d38('0x28')][_0x7d38('0x29')]);_0x20c1be[_0x7d38('0x2d')]=_[_0x7d38('0x2c')](_0x5a4834[_0x7d38('0x2d')]);_0x20c1be['filters']=_['intersection'](_0x20c1be['model'],_0x20c1be['query']);_0xb1093a['attributes']=_['intersection'](_0x20c1be[_0x7d38('0x2f')],qs['fields'](_0x5a4834[_0x7d38('0x2d')][_0x7d38('0x31')]));_0xb1093a[_0x7d38('0x30')]=_0xb1093a[_0x7d38('0x30')]['length']?_0xb1093a[_0x7d38('0x30')]:_0x20c1be[_0x7d38('0x2f')];if(_0x5a4834['query'][_0x7d38('0x41')]){_0xb1093a[_0x7d38('0x42')]=[{'all':!![]}];}_0xb1093a=_[_0x7d38('0x39')]({},_0xb1093a,_0x5a4834[_0x7d38('0x43')]);return db[_0x7d38('0x28')][_0x7d38('0x44')](_0xb1093a)[_0x7d38('0x21')](handleEntityNotFound(_0x5c78a9,null))[_0x7d38('0x21')](respondWithResult(_0x5c78a9,null))[_0x7d38('0x3e')](handleError(_0x5c78a9,null));};exports['clone']=function(_0x25de27,_0x51d563){var _0x236ed9={'where':{'id':_0x25de27[_0x7d38('0x40')]['id']}},_0x371462={};_0x371462[_0x7d38('0x2f')]=_[_0x7d38('0x2c')](db[_0x7d38('0x28')][_0x7d38('0x29')]);_0x236ed9[_0x7d38('0x30')]=_[_0x7d38('0x2e')](_0x371462[_0x7d38('0x2f')],qs['fields'](_0x25de27[_0x7d38('0x2d')][_0x7d38('0x31')]));_0x236ed9[_0x7d38('0x30')]=_0x236ed9[_0x7d38('0x30')]['length']?_0x236ed9[_0x7d38('0x30')]:_0x371462[_0x7d38('0x2f')];if(_0x25de27[_0x7d38('0x2d')][_0x7d38('0x41')]){_0x236ed9[_0x7d38('0x42')]=[{'all':!![]}];}_0x236ed9=_[_0x7d38('0x39')]({},_0x236ed9,_0x25de27[_0x7d38('0x43')]);return db['Attachment'][_0x7d38('0x44')](_0x236ed9)[_0x7d38('0x21')](handleEntityNotFound(_0x51d563,null))[_0x7d38('0x21')](function(_0x5048cc){if(_0x5048cc){var _0x5b45a9=_0x5048cc[_0x7d38('0x45')]({'plain':!![]});_0x5b45a9=qs['omit'](_0x5b45a9,['id','createdAt',_0x7d38('0x46')]);_0x25de27[_0x7d38('0x47')]=_[_0x7d38('0x48')](_0x25de27[_0x7d38('0x47')],['id','createdAt',_0x7d38('0x46')]);return db[_0x7d38('0x28')][_0x7d38('0x49')](_['merge'](_0x5b45a9,_0x25de27[_0x7d38('0x47')]),{'include':_0x25de27[_0x7d38('0x2d')][_0x7d38('0x41')]?[{'all':!![]}]:undefined});}})[_0x7d38('0x21')](respondWithResult(_0x51d563,0xc9))[_0x7d38('0x3e')](handleError(_0x51d563,null));};exports[_0x7d38('0x20')]=function(_0x382a94,_0x3f287b){if(_0x382a94['body']['id']){delete _0x382a94['body']['id'];}return db[_0x7d38('0x28')][_0x7d38('0x44')]({'where':{'id':_0x382a94[_0x7d38('0x40')]['id']}})['then'](handleEntityNotFound(_0x3f287b,null))[_0x7d38('0x21')](saveUpdates(_0x382a94['body'],null))[_0x7d38('0x21')](respondWithResult(_0x3f287b,null))[_0x7d38('0x3e')](handleError(_0x3f287b,null));};exports['destroy']=function(_0x3e4145,_0x28be2a){return db[_0x7d38('0x28')][_0x7d38('0x44')]({'where':{'id':_0x3e4145[_0x7d38('0x40')]['id']}})[_0x7d38('0x21')](handleEntityNotFound(_0x28be2a,null))[_0x7d38('0x21')](removeEntity(_0x28be2a,null))[_0x7d38('0x3e')](handleError(_0x28be2a,null));};exports['create']=function(_0x1b92d6,_0x1c9e80,_0x27fb3c){_0x1b92d6['body']['name']=_0x1b92d6[_0x7d38('0x4a')][_0x7d38('0x4b')];_0x1b92d6[_0x7d38('0x47')][_0x7d38('0x4c')]=_0x1b92d6[_0x7d38('0x4a')][_0x7d38('0x4d')];_0x1b92d6[_0x7d38('0x47')][_0x7d38('0x4e')]=_0x1b92d6['file'][_0x7d38('0x4f')];return db['Attachment'][_0x7d38('0x49')](_0x1b92d6['body'])['then'](respondWithResult(_0x1c9e80,0xc9))[_0x7d38('0x3e')](handleError(_0x1c9e80,null));};exports[_0x7d38('0x50')]=function(_0x45d099,_0x2e3f0e,_0x5695a5){return db[_0x7d38('0x28')][_0x7d38('0x51')]({'where':{'id':_0x45d099[_0x7d38('0x40')]['id']},'raw':!![]})[_0x7d38('0x21')](handleEntityNotFound(_0x2e3f0e,null))['then'](function(_0x13d7c5){if(_0x13d7c5){var _0x4537af=_0x13d7c5[_0x7d38('0x52')]!==null;var _0x209053=path['join'](config[_0x7d38('0x53')],_0x7d38('0x54'));if(_0x4537af){_0x209053=path['join'](_0x209053,_0x7d38('0x55'));}var _0x311e62=path[_0x7d38('0x56')](_0x209053,_0x13d7c5[_0x7d38('0x4c')]);return _0x2e3f0e[_0x7d38('0x50')](_0x311e62);}})[_0x7d38('0x3e')](handleError(_0x2e3f0e,null));};
\ No newline at end of file
+var _0xf1d9=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','Attachment','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','clone','params','get','updatedAt','body','createdAt','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0xf1d9,0x1a9));var _0x9f1d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9f1d('0x0'));var rimraf=require(_0x9f1d('0x1'));var zipdir=require(_0x9f1d('0x2'));var jsonpatch=require(_0x9f1d('0x3'));var rp=require(_0x9f1d('0x4'));var moment=require(_0x9f1d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f1d('0x6'));var util=require(_0x9f1d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9f1d('0x8'));var ejs=require(_0x9f1d('0x9'));var fs=require('fs');var fs_extra=require(_0x9f1d('0xa'));var _=require(_0x9f1d('0xb'));var squel=require('squel');var crypto=require(_0x9f1d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f1d('0xd'));var toCsv=require(_0x9f1d('0x8'));var querystring=require('querystring');var Papa=require(_0x9f1d('0xe'));var Redis=require(_0x9f1d('0xf'));var authService=require(_0x9f1d('0x10'));var qs=require(_0x9f1d('0x11'));var as=require(_0x9f1d('0x12'));var hardwareService=require(_0x9f1d('0x13'));var logger=require(_0x9f1d('0x14'))(_0x9f1d('0x15'));var utils=require(_0x9f1d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9f1d('0x17'));var db=require(_0x9f1d('0x18'))['db'];function respondWithStatusCode(_0x5e28dc,_0x205f19){_0x205f19=_0x205f19||0xcc;return function(_0x58791d){if(_0x58791d){return _0x5e28dc[_0x9f1d('0x19')](_0x205f19);}return _0x5e28dc['status'](_0x205f19)[_0x9f1d('0x1a')]();};}function respondWithResult(_0x5a7564,_0x2501fd){_0x2501fd=_0x2501fd||0xc8;return function(_0x47bba3){if(_0x47bba3){return _0x5a7564[_0x9f1d('0x1b')](_0x2501fd)[_0x9f1d('0x1c')](_0x47bba3);}};}function respondWithFilteredResult(_0x4855d4,_0x5140a5){return function(_0x32d667){if(_0x32d667){var _0x4966f6=typeof _0x5140a5['offset']==='undefined'&&typeof _0x5140a5['limit']==='undefined';var _0x542ad5=_0x32d667[_0x9f1d('0x1d')];var _0x33a1d3=_0x4966f6?0x0:_0x5140a5[_0x9f1d('0x1e')];var _0x24a270=_0x4966f6?_0x32d667['count']:_0x5140a5[_0x9f1d('0x1e')]+_0x5140a5[_0x9f1d('0x1f')];var _0x431f98;if(_0x24a270>=_0x542ad5){_0x24a270=_0x542ad5;_0x431f98=0xc8;}else{_0x431f98=0xce;}_0x4855d4[_0x9f1d('0x1b')](_0x431f98);return _0x4855d4[_0x9f1d('0x20')](_0x9f1d('0x21'),_0x33a1d3+'-'+_0x24a270+'/'+_0x542ad5)[_0x9f1d('0x1c')](_0x32d667);}return null;};}function patchUpdates(_0xdadd76){return function(_0x9382af){try{jsonpatch['apply'](_0x9382af,_0xdadd76,!![]);}catch(_0x39e9b9){return BPromise[_0x9f1d('0x22')](_0x39e9b9);}return _0x9382af[_0x9f1d('0x23')]();};}function saveUpdates(_0x172803,_0x3fcdf1){return function(_0xf95710){if(_0xf95710){return _0xf95710[_0x9f1d('0x24')](_0x172803)['then'](function(_0x2cf093){return _0x2cf093;});}return null;};}function removeEntity(_0x32adbf,_0x199a03){return function(_0xec41b5){if(_0xec41b5){return _0xec41b5[_0x9f1d('0x25')]()['then'](function(){_0x32adbf[_0x9f1d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7264da,_0x5dea66){return function(_0x3a6d63){if(!_0x3a6d63){_0x7264da[_0x9f1d('0x19')](0x194);}return _0x3a6d63;};}function handleError(_0x209691,_0x29ef53){_0x29ef53=_0x29ef53||0x1f4;return function(_0x3304fc){logger[_0x9f1d('0x26')](_0x3304fc[_0x9f1d('0x27')]);if(_0x3304fc['name']){delete _0x3304fc[_0x9f1d('0x28')];}_0x209691[_0x9f1d('0x1b')](_0x29ef53)[_0x9f1d('0x29')](_0x3304fc);};}exports[_0x9f1d('0x2a')]=function(_0xbdf40d,_0x2a538a){var _0x5a1e9e={},_0x5b87e1={},_0xe5425b={'count':0x0,'rows':[]};var _0x8c25ce=_[_0x9f1d('0x2b')](db[_0x9f1d('0x2c')]['rawAttributes'],function(_0x1387a8){return{'name':_0x1387a8['fieldName'],'type':_0x1387a8['type']['key']};});_0x5b87e1[_0x9f1d('0x2d')]=_[_0x9f1d('0x2b')](_0x8c25ce,_0x9f1d('0x28'));_0x5b87e1[_0x9f1d('0x2e')]=_['keys'](_0xbdf40d[_0x9f1d('0x2e')]);_0x5b87e1[_0x9f1d('0x2f')]=_[_0x9f1d('0x30')](_0x5b87e1[_0x9f1d('0x2d')],_0x5b87e1[_0x9f1d('0x2e')]);_0x5a1e9e['attributes']=_['intersection'](_0x5b87e1[_0x9f1d('0x2d')],qs[_0x9f1d('0x31')](_0xbdf40d[_0x9f1d('0x2e')]['fields']));_0x5a1e9e['attributes']=_0x5a1e9e[_0x9f1d('0x32')][_0x9f1d('0x33')]?_0x5a1e9e[_0x9f1d('0x32')]:_0x5b87e1['model'];if(!_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x34')](_0x9f1d('0x35'))){_0x5a1e9e[_0x9f1d('0x1f')]=qs[_0x9f1d('0x1f')](_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x1f')]);_0x5a1e9e[_0x9f1d('0x1e')]=qs[_0x9f1d('0x1e')](_0xbdf40d[_0x9f1d('0x2e')]['offset']);}_0x5a1e9e[_0x9f1d('0x36')]=qs['sort'](_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x37')]);_0x5a1e9e[_0x9f1d('0x38')]=qs[_0x9f1d('0x2f')](_['pick'](_0xbdf40d[_0x9f1d('0x2e')],_0x5b87e1[_0x9f1d('0x2f')]),_0x8c25ce);if(_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x39')]){_0x5a1e9e[_0x9f1d('0x38')]=_[_0x9f1d('0x3a')](_0x5a1e9e['where'],{'$or':_[_0x9f1d('0x2b')](_0x8c25ce,function(_0x1567c2){if(_0x1567c2[_0x9f1d('0x3b')]!==_0x9f1d('0x3c')){var _0x1a3c99={};_0x1a3c99[_0x1567c2['name']]={'$like':'%'+_0xbdf40d[_0x9f1d('0x2e')]['filter']+'%'};return _0x1a3c99;}})});}_0x5a1e9e=_[_0x9f1d('0x3a')]({},_0x5a1e9e,_0xbdf40d['options']);var _0x498141={'where':_0x5a1e9e[_0x9f1d('0x38')]};return db['Attachment'][_0x9f1d('0x1d')](_0x498141)[_0x9f1d('0x3d')](function(_0xfaf88a){_0xe5425b[_0x9f1d('0x1d')]=_0xfaf88a;if(_0xbdf40d[_0x9f1d('0x2e')][_0x9f1d('0x3e')]){_0x5a1e9e[_0x9f1d('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x9f1d('0x40')](_0x5a1e9e);})[_0x9f1d('0x3d')](function(_0x5a1992){_0xe5425b[_0x9f1d('0x41')]=_0x5a1992;return _0xe5425b;})['then'](respondWithFilteredResult(_0x2a538a,_0x5a1e9e))[_0x9f1d('0x42')](handleError(_0x2a538a,null));};exports[_0x9f1d('0x43')]=function(_0x23ca40,_0x73260b){var _0x56cef3={'raw':!![],'where':{'id':_0x23ca40['params']['id']}},_0x383ef5={};_0x383ef5[_0x9f1d('0x2d')]=_['keys'](db[_0x9f1d('0x2c')][_0x9f1d('0x44')]);_0x383ef5['query']=_[_0x9f1d('0x45')](_0x23ca40[_0x9f1d('0x2e')]);_0x383ef5[_0x9f1d('0x2f')]=_[_0x9f1d('0x30')](_0x383ef5[_0x9f1d('0x2d')],_0x383ef5[_0x9f1d('0x2e')]);_0x56cef3[_0x9f1d('0x32')]=_['intersection'](_0x383ef5[_0x9f1d('0x2d')],qs['fields'](_0x23ca40[_0x9f1d('0x2e')][_0x9f1d('0x31')]));_0x56cef3[_0x9f1d('0x32')]=_0x56cef3['attributes'][_0x9f1d('0x33')]?_0x56cef3[_0x9f1d('0x32')]:_0x383ef5['model'];if(_0x23ca40[_0x9f1d('0x2e')][_0x9f1d('0x3e')]){_0x56cef3[_0x9f1d('0x3f')]=[{'all':!![]}];}_0x56cef3=_[_0x9f1d('0x3a')]({},_0x56cef3,_0x23ca40[_0x9f1d('0x46')]);return db[_0x9f1d('0x2c')][_0x9f1d('0x47')](_0x56cef3)[_0x9f1d('0x3d')](handleEntityNotFound(_0x73260b,null))[_0x9f1d('0x3d')](respondWithResult(_0x73260b,null))['catch'](handleError(_0x73260b,null));};exports[_0x9f1d('0x48')]=function(_0x171b4d,_0x4905a3){var _0x22a3af={'where':{'id':_0x171b4d[_0x9f1d('0x49')]['id']}},_0x29ad15={};_0x29ad15['model']=_[_0x9f1d('0x45')](db[_0x9f1d('0x2c')][_0x9f1d('0x44')]);_0x22a3af[_0x9f1d('0x32')]=_[_0x9f1d('0x30')](_0x29ad15[_0x9f1d('0x2d')],qs[_0x9f1d('0x31')](_0x171b4d[_0x9f1d('0x2e')][_0x9f1d('0x31')]));_0x22a3af[_0x9f1d('0x32')]=_0x22a3af[_0x9f1d('0x32')][_0x9f1d('0x33')]?_0x22a3af[_0x9f1d('0x32')]:_0x29ad15[_0x9f1d('0x2d')];if(_0x171b4d[_0x9f1d('0x2e')]['includeAll']){_0x22a3af[_0x9f1d('0x3f')]=[{'all':!![]}];}_0x22a3af=_[_0x9f1d('0x3a')]({},_0x22a3af,_0x171b4d['options']);return db[_0x9f1d('0x2c')][_0x9f1d('0x47')](_0x22a3af)['then'](handleEntityNotFound(_0x4905a3,null))[_0x9f1d('0x3d')](function(_0x5e414d){if(_0x5e414d){var _0x3d1f6a=_0x5e414d[_0x9f1d('0x4a')]({'plain':!![]});_0x3d1f6a=qs['omit'](_0x3d1f6a,['id','createdAt',_0x9f1d('0x4b')]);_0x171b4d[_0x9f1d('0x4c')]=_['omit'](_0x171b4d[_0x9f1d('0x4c')],['id',_0x9f1d('0x4d'),_0x9f1d('0x4b')]);return db[_0x9f1d('0x2c')][_0x9f1d('0x4e')](_[_0x9f1d('0x3a')](_0x3d1f6a,_0x171b4d[_0x9f1d('0x4c')]),{'include':_0x171b4d[_0x9f1d('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x9f1d('0x3d')](respondWithResult(_0x4905a3,0xc9))[_0x9f1d('0x42')](handleError(_0x4905a3,null));};exports[_0x9f1d('0x24')]=function(_0xbf603b,_0x861258){if(_0xbf603b['body']['id']){delete _0xbf603b[_0x9f1d('0x4c')]['id'];}return db[_0x9f1d('0x2c')]['find']({'where':{'id':_0xbf603b[_0x9f1d('0x49')]['id']}})[_0x9f1d('0x3d')](handleEntityNotFound(_0x861258,null))[_0x9f1d('0x3d')](saveUpdates(_0xbf603b[_0x9f1d('0x4c')],null))[_0x9f1d('0x3d')](respondWithResult(_0x861258,null))[_0x9f1d('0x42')](handleError(_0x861258,null));};exports['destroy']=function(_0x1a4fb0,_0x197eaa){return db[_0x9f1d('0x2c')][_0x9f1d('0x47')]({'where':{'id':_0x1a4fb0[_0x9f1d('0x49')]['id']}})[_0x9f1d('0x3d')](handleEntityNotFound(_0x197eaa,null))[_0x9f1d('0x3d')](removeEntity(_0x197eaa,null))[_0x9f1d('0x42')](handleError(_0x197eaa,null));};exports['create']=function(_0xfbb8c5,_0x5cdc31,_0x30ddf7){_0xfbb8c5[_0x9f1d('0x4c')]['name']=_0xfbb8c5[_0x9f1d('0x4f')][_0x9f1d('0x50')];_0xfbb8c5['body'][_0x9f1d('0x51')]=_0xfbb8c5[_0x9f1d('0x4f')][_0x9f1d('0x52')];_0xfbb8c5[_0x9f1d('0x4c')][_0x9f1d('0x3b')]=_0xfbb8c5[_0x9f1d('0x4f')]['mimetype'];return db[_0x9f1d('0x2c')]['create'](_0xfbb8c5[_0x9f1d('0x4c')])[_0x9f1d('0x3d')](respondWithResult(_0x5cdc31,0xc9))[_0x9f1d('0x42')](handleError(_0x5cdc31,null));};exports['download']=function(_0xd6089a,_0x4568f1,_0x38bf92){return db[_0x9f1d('0x2c')][_0x9f1d('0x53')]({'where':{'id':_0xd6089a[_0x9f1d('0x49')]['id']},'raw':!![]})[_0x9f1d('0x3d')](handleEntityNotFound(_0x4568f1,null))[_0x9f1d('0x3d')](function(_0xeaa598){if(_0xeaa598){var _0x498890=_0xeaa598[_0x9f1d('0x54')]!==null;var _0x5e6163=path[_0x9f1d('0x55')](config[_0x9f1d('0x56')],_0x9f1d('0x57'));if(_0x498890){_0x5e6163=path[_0x9f1d('0x55')](_0x5e6163,'offline-chat/');}var _0x5a759e=path[_0x9f1d('0x55')](_0x5e6163,_0xeaa598[_0x9f1d('0x51')]);return _0x4568f1[_0x9f1d('0x58')](_0x5a759e);}})[_0x9f1d('0x42')](handleError(_0x4568f1,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 2a519f5..5569d09 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 _0x4824=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x55ea33,_0x448c1e){var _0x3e4081=function(_0x290b02){while(--_0x290b02){_0x55ea33['push'](_0x55ea33['shift']());}};_0x3e4081(++_0x448c1e);}(_0x4824,0xd9));var _0x4482=function(_0x23ed50,_0x483c69){_0x23ed50=_0x23ed50-0x0;var _0x1eff7d=_0x4824[_0x23ed50];return _0x1eff7d;};'use strict';var _=require(_0x4482('0x0'));var util=require(_0x4482('0x1'));var logger=require(_0x4482('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4482('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4482('0x4'));var rimraf=require(_0x4482('0x5'));var config=require(_0x4482('0x6'));var attributes=require(_0x4482('0x7'));module['exports']=function(_0xa645fc,_0x3fe9fb){return _0xa645fc[_0x4482('0x8')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc978=['request-promise','path','../../config/environment','./attachment.attributes','exports','define','lodash','api','moment','bluebird'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xc978,0xce));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8c97('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));var BPromise=require(_0x8c97('0x3'));var rp=require(_0x8c97('0x4'));var fs=require('fs');var path=require(_0x8c97('0x5'));var rimraf=require('rimraf');var config=require(_0x8c97('0x6'));var attributes=require(_0x8c97('0x7'));module[_0x8c97('0x8')]=function(_0x398d4c,_0x145a9e){return _0x398d4c[_0x8c97('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index b678bc8..2cc7a6e 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','options','raw'];(function(_0x2f0bfc,_0x1e0d82){var _0x2e4ed1=function(_0x1f3821){while(--_0x1f3821){_0x2f0bfc['push'](_0x2f0bfc['shift']());}};_0x2e4ed1(++_0x1e0d82);}(_0x34e8,0x12c));var _0x834e=function(_0x39bd93,_0x1cd986){_0x39bd93=_0x39bd93-0x0;var _0x368ce7=_0x34e8[_0x39bd93];return _0x368ce7;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('Attachment,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('Attachment,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}exports[_0x834e('0x19')]=function(_0x211e9a){var _0x34e41a=this;return new Promise(function(_0xb993a1,_0x237947){return db[_0x834e('0x1a')][_0x834e('0x1b')](_0x211e9a['body'],{'raw':_0x211e9a[_0x834e('0x1c')]?_0x211e9a[_0x834e('0x1c')][_0x834e('0x1d')]===undefined?!![]:![]:!![]})[_0x834e('0xd')](function(_0x4ab05d){logger[_0x834e('0xe')](_0x834e('0x19'),_0x211e9a);logger['debug'](_0x834e('0x19'),_0x211e9a,JSON[_0x834e('0x13')](_0x4ab05d));_0xb993a1(_0x4ab05d);})[_0x834e('0x18')](function(_0x5c55ca){logger['error'](_0x834e('0x19'),_0x5c55ca[_0x834e('0x16')],_0x211e9a);_0x237947(_0x34e41a['error'](0x1f4,_0x5c55ca[_0x834e('0x16')]));});});};
\ No newline at end of file
+var _0xeea4=['Attachment,\x20%s,\x20%s','message','result','CreateAttachment','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x29e401,_0x4d374d){var _0x4d8b63=function(_0x1a3225){while(--_0x1a3225){_0x29e401['push'](_0x29e401['shift']());}};_0x4d8b63(++_0x4d374d);}(_0xeea4,0x19e));var _0x4eea=function(_0x278fd6,_0x4cd636){_0x278fd6=_0x278fd6-0x0;var _0x1d24ba=_0xeea4[_0x278fd6];return _0x1d24ba;};'use strict';var _=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var moment=require(_0x4eea('0x2'));var BPromise=require(_0x4eea('0x3'));var rs=require(_0x4eea('0x4'));var fs=require('fs');var Redis=require(_0x4eea('0x5'));var db=require(_0x4eea('0x6'))['db'];var utils=require(_0x4eea('0x7'));var logger=require(_0x4eea('0x8'))('rpc');var config=require(_0x4eea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4eea('0xa')][_0x4eea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d5aa8,_0x48538e,_0x1a2e5e){return new BPromise(function(_0x44116a,_0x4cc630){return client[_0x4eea('0xc')](_0x3d5aa8,_0x1a2e5e)[_0x4eea('0xd')](function(_0x2bba91){logger[_0x4eea('0xe')]('Attachment,\x20%s,\x20%s',_0x48538e,_0x4eea('0xf'));logger[_0x4eea('0x10')](_0x4eea('0x11'),_0x48538e,_0x4eea('0xf'),JSON[_0x4eea('0x12')](_0x2bba91));if(_0x2bba91[_0x4eea('0x13')]){if(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x14')]===0x1f4){logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x2bba91['error']['message']);return _0x4cc630(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);}logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);return _0x44116a(_0x2bba91[_0x4eea('0x13')][_0x4eea('0x16')]);}else{logger['info'](_0x4eea('0x15'),_0x48538e,_0x4eea('0xf'));_0x44116a(_0x2bba91[_0x4eea('0x17')][_0x4eea('0x16')]);}})['catch'](function(_0x446474){logger[_0x4eea('0x13')](_0x4eea('0x15'),_0x48538e,_0x446474);_0x4cc630(_0x446474);});});}exports[_0x4eea('0x18')]=function(_0x27a227){var _0x5bd90b=this;return new Promise(function(_0x1571f3,_0x29de0e){return db['Attachment'][_0x4eea('0x19')](_0x27a227[_0x4eea('0x1a')],{'raw':_0x27a227[_0x4eea('0x1b')]?_0x27a227[_0x4eea('0x1b')][_0x4eea('0x1c')]===undefined?!![]:![]:!![]})[_0x4eea('0xd')](function(_0x56fefc){logger[_0x4eea('0xe')](_0x4eea('0x18'),_0x27a227);logger[_0x4eea('0x10')](_0x4eea('0x18'),_0x27a227,JSON[_0x4eea('0x12')](_0x56fefc));_0x1571f3(_0x56fefc);})['catch'](function(_0x4898e8){logger[_0x4eea('0x13')]('CreateAttachment',_0x4898e8['message'],_0x27a227);_0x29de0e(_0x5bd90b['error'](0x1f4,_0x4898e8[_0x4eea('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 346b227..d5d41d1 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x5891f6,_0x280aef){var _0x33114b=function(_0x580fd8){while(--_0x580fd8){_0x5891f6['push'](_0x5891f6['shift']());}};_0x33114b(++_0x280aef);}(_0x757a,0xde));var _0xa757=function(_0x18f693,_0x312616){_0x18f693=_0x18f693-0x0;var _0x13a5c9=_0x757a[_0x18f693];return _0x13a5c9;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x1aece3,_0x1360b7){_0x1aece3=_0x1aece3-0x0;var _0x7f3a5a=_0xdb28[_0x1aece3];return _0x7f3a5a;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 1e1e60b..0370564 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 _0x697e=['status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/environment','activedirectory','undefined','baseDN','url','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','admin','agent','domain','blockedAt','clearBlockUser','getLicense','catch'];(function(_0x2a5bc6,_0x4f72e3){var _0x22348a=function(_0x4bb6a6){while(--_0x4bb6a6){_0x2a5bc6['push'](_0x2a5bc6['shift']());}};_0x22348a(++_0x4f72e3);}(_0x697e,0x178));var _0xe697=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x697e[_0x20a584];return _0x4b41a8;};'use strict';var passport=require(_0xe697('0x0'));var LocalStrategy=require(_0xe697('0x1'))[_0xe697('0x2')];var moment=require(_0xe697('0x3'));var ActiveDirectory=require(_0xe697('0x4'));var BPromise=require(_0xe697('0x5'));var util=require(_0xe697('0x6'));var db=require(_0xe697('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0xe697('0x8'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x4908df){var _0x2cfd52=![];if(typeof _0x4908df[_0xe697('0x9')]!==_0xe697('0xa')){_0x2cfd52=_0x4908df['activedirectory'][_0xe697('0xb')]&&_0x4908df[_0xe697('0x9')][_0xe697('0xc')]&&_0x4908df[_0xe697('0x9')]['domain'];}return _0x2cfd52;}function adAuthenticate(_0x5c845d,_0x33787b,_0x713797){return new BPromise(function(_0x390a7a,_0x53daef){try{var _0x341b76=new ActiveDirectory(_0x5c845d);_0x341b76[_0xe697('0xd')](_0x33787b,_0x713797,function(_0x1bc10e,_0x4286ef){if(_0x1bc10e){logger['error'](_0xe697('0xe'),_0x33787b,util[_0xe697('0xf')](_0x1bc10e,{'showHidden':![],'depth':null}));_0x53daef(_0xe697('0x10'));}else if(!_0x4286ef){logger['error'](_0xe697('0x11'),_0x33787b);_0x53daef(_0xe697('0x10'));}else{_0x390a7a(_0x4286ef);}});}catch(_0x142140){_0x53daef(_0x142140);}});}function ActiveDirectoryAuthenticate(_0x2abd5d,_0x25cc29,_0x31a514,_0x203e48){var _0x12128d,_0x5ce42c;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xe697('0x12'),_0x25cc29);return _0x203e48(null,![],{'message':_0xe697('0x10')});}return db[_0xe697('0x13')][_0xe697('0x14')]({'where':{'id':0x1},'attributes':[_0xe697('0x15'),_0xe697('0x16')],'raw':!![]})[_0xe697('0x17')](function(_0x37f417){_0x12128d=_0x37f417;if(!_0x12128d[_0xe697('0x15')]){logger['error'](_0xe697('0x18'),_0x25cc29);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x2abd5d['findOne']({'attributes':['id',_0xe697('0x19'),_0xe697('0x1a'),_0xe697('0x1b'),_0xe697('0x1c'),_0xe697('0x1d'),_0xe697('0x1e'),'blockedAt','online'],'where':{'name':_0x25cc29,'role':{'$or':[_0xe697('0x1f'),'user',_0xe697('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x26b78d){if(!_0x26b78d||_0x26b78d&&_0x26b78d[_0xe697('0x19')]!==_0x25cc29){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x5ce42c=_0x26b78d;var _0xfd7965=_0x5ce42c[_0xe697('0x19')]+'@'+config[_0xe697('0x9')][_0xe697('0x21')];return adAuthenticate(config['activedirectory'],_0xfd7965,_0x31a514);})[_0xe697('0x17')](function(_0x15746f){if(_0x5ce42c[_0xe697('0x1d')]){throw new Error(_0xe697('0x10'));}if(_0x12128d[_0xe697('0x16')]>0x0){if(_0x5ce42c[_0xe697('0x1e')]){if(moment(_0x5ce42c[_0xe697('0x22')])['add'](_0x12128d[_0xe697('0x16')],'minutes')>moment()){throw new Error(_0xe697('0x10'));}return utils[_0xe697('0x23')](_0x5ce42c,0x0,![],null)[_0xe697('0x17')](function(){return utils['getLicense'](_0x5ce42c);})[_0xe697('0x17')](function(){return _0x203e48(null,_0x5ce42c);});}else{return utils[_0xe697('0x24')](_0x5ce42c)[_0xe697('0x17')](function(){return _0x203e48(null,_0x5ce42c);});}}else{return utils['getLicense'](_0x5ce42c)[_0xe697('0x17')](function(){return _0x203e48(null,_0x5ce42c);});}})[_0xe697('0x25')](function(_0x120230){return _0x203e48(null,![],_0x120230);});}function handleError(_0x17e16e,_0x522236,_0x1e9817){return _0x17e16e[_0xe697('0x26')](_0x522236||0x1f4)[_0xe697('0x27')]({'message':_0x1e9817?_0x1e9817[_0xe697('0x28')]||_0x1e9817:''});}exports[_0xe697('0x29')]=function(_0x117bc4,_0x50e40f,_0x22ff8c){passport[_0xe697('0xd')]('ad-login',function(_0x570ae1,_0x4c9381,_0x57840e){var _0x1e8574=_0x570ae1||_0x57840e;if(_0x1e8574){return handleError(_0x50e40f,0x191,_0x1e8574);}if(!_0x4c9381){return handleError(_0x50e40f,0x194,{'message':_0xe697('0x2a')});}else{var _0x1f2f1c={'payload':{'id':_0x4c9381['id'],'role':_0x4c9381['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1f2f1c)[_0xe697('0x17')](function(_0x2ddec3){_0x50e40f['json']({'id':_0x4c9381['id'],'token':_0x2ddec3,'statusCall':'','isAlreadyLogged':_0x4c9381[_0xe697('0x2b')]});});}})(_0x117bc4,_0x50e40f,_0x22ff8c);};passport['use'](_0xe697('0x2c'),new LocalStrategy({'usernameField':_0xe697('0x19'),'passwordField':_0xe697('0x1a')},function(_0x2bb42e,_0x3927d1,_0x5fdd92){return ActiveDirectoryAuthenticate(db[_0xe697('0x2d')],_0x2bb42e,_0x3927d1,_0x5fdd92);}));
\ No newline at end of file
+var _0xc3ef=['online','User','passport','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','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','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt','admin','user','agent','add','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x59b589,_0x11a824){var _0x4782d6=function(_0x24aa49){while(--_0x24aa49){_0x59b589['push'](_0x59b589['shift']());}};_0x4782d6(++_0x11a824);}(_0xc3ef,0x122));var _0xfc3e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc3ef[_0x8c43de];return _0xa6591b;};'use strict';var passport=require(_0xfc3e('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xfc3e('0x1'));var ActiveDirectory=require(_0xfc3e('0x2'));var BPromise=require(_0xfc3e('0x3'));var util=require('util');var db=require(_0xfc3e('0x4'))['db'];var authService=require(_0xfc3e('0x5'));var utils=require(_0xfc3e('0x6'));var config=require('../../config/environment');var logger=require(_0xfc3e('0x7'))(_0xfc3e('0x8'));function isActiveDirectoryConfigured(_0x419560){var _0x531371=![];if(typeof _0x419560[_0xfc3e('0x9')]!=='undefined'){_0x531371=_0x419560['activedirectory'][_0xfc3e('0xa')]&&_0x419560[_0xfc3e('0x9')][_0xfc3e('0xb')]&&_0x419560[_0xfc3e('0x9')][_0xfc3e('0xc')];}return _0x531371;}function adAuthenticate(_0x48acb3,_0x31f208,_0x24cfbc){return new BPromise(function(_0x5e9e92,_0x514c5e){try{var _0x3246de=new ActiveDirectory(_0x48acb3);_0x3246de[_0xfc3e('0xd')](_0x31f208,_0x24cfbc,function(_0x55e343,_0x5448e4){if(_0x55e343){logger[_0xfc3e('0xe')](_0xfc3e('0xf'),_0x31f208,util[_0xfc3e('0x10')](_0x55e343,{'showHidden':![],'depth':null}));_0x514c5e(_0xfc3e('0x11'));}else if(!_0x5448e4){logger[_0xfc3e('0xe')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x31f208);_0x514c5e(_0xfc3e('0x11'));}else{_0x5e9e92(_0x5448e4);}});}catch(_0x2eb7d2){_0x514c5e(_0x2eb7d2);}});}function ActiveDirectoryAuthenticate(_0x16bcf9,_0x4fabdf,_0x4ce346,_0x456c21){var _0x3dd3f5,_0x479d37;if(!isActiveDirectoryConfigured(config)){logger[_0xfc3e('0xe')](_0xfc3e('0x12'),_0x4fabdf);return _0x456c21(null,![],{'message':_0xfc3e('0x11')});}return db[_0xfc3e('0x13')][_0xfc3e('0x14')]({'where':{'id':0x1},'attributes':[_0xfc3e('0x15'),_0xfc3e('0x16')],'raw':!![]})[_0xfc3e('0x17')](function(_0x257cdc){_0x3dd3f5=_0x257cdc;if(!_0x3dd3f5[_0xfc3e('0x15')]){logger[_0xfc3e('0xe')](_0xfc3e('0x18'),_0x4fabdf);throw new Error(_0xfc3e('0x11'));}return _0x16bcf9[_0xfc3e('0x14')]({'attributes':['id',_0xfc3e('0x19'),_0xfc3e('0x1a'),'salt',_0xfc3e('0x1b'),_0xfc3e('0x1c'),_0xfc3e('0x1d'),_0xfc3e('0x1e'),'online'],'where':{'name':_0x4fabdf,'role':{'$or':[_0xfc3e('0x1f'),_0xfc3e('0x20'),_0xfc3e('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x4fd6f5){if(!_0x4fd6f5||_0x4fd6f5&&_0x4fd6f5['name']!==_0x4fabdf){throw new Error(_0xfc3e('0x11'));}_0x479d37=_0x4fd6f5;var _0x1ee6ca=_0x479d37['name']+'@'+config[_0xfc3e('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x1ee6ca,_0x4ce346);})['then'](function(_0x4f4401){if(_0x479d37['disabled']){throw new Error(_0xfc3e('0x11'));}if(_0x3dd3f5[_0xfc3e('0x16')]>0x0){if(_0x479d37['blocked']){if(moment(_0x479d37['blockedAt'])[_0xfc3e('0x22')](_0x3dd3f5[_0xfc3e('0x16')],_0xfc3e('0x23'))>moment()){throw new Error(_0xfc3e('0x11'));}return utils[_0xfc3e('0x24')](_0x479d37,0x0,![],null)['then'](function(){return utils[_0xfc3e('0x25')](_0x479d37);})[_0xfc3e('0x17')](function(){return _0x456c21(null,_0x479d37);});}else{return utils['getLicense'](_0x479d37)['then'](function(){return _0x456c21(null,_0x479d37);});}}else{return utils[_0xfc3e('0x25')](_0x479d37)[_0xfc3e('0x17')](function(){return _0x456c21(null,_0x479d37);});}})['catch'](function(_0x409d5a){return _0x456c21(null,![],_0x409d5a);});}function handleError(_0x18499a,_0x471801,_0x20b82e){return _0x18499a[_0xfc3e('0x26')](_0x471801||0x1f4)[_0xfc3e('0x27')]({'message':_0x20b82e?_0x20b82e[_0xfc3e('0x28')]||_0x20b82e:''});}exports[_0xfc3e('0x29')]=function(_0x5e4423,_0x5dbea8,_0x261e92){passport[_0xfc3e('0xd')](_0xfc3e('0x2a'),function(_0x5bfeb2,_0x40e8fd,_0x5e5f31){var _0x216108=_0x5bfeb2||_0x5e5f31;if(_0x216108){return handleError(_0x5dbea8,0x191,_0x216108);}if(!_0x40e8fd){return handleError(_0x5dbea8,0x194,{'message':_0xfc3e('0x2b')});}else{var _0x164da0={'payload':{'id':_0x40e8fd['id'],'role':_0x40e8fd['role']},'options':{'expiresIn':0x15180}};return authService[_0xfc3e('0x2c')](_0x164da0)[_0xfc3e('0x17')](function(_0x96a76d){_0x5dbea8[_0xfc3e('0x2d')]({'id':_0x40e8fd['id'],'token':_0x96a76d,'statusCall':'','isAlreadyLogged':_0x40e8fd[_0xfc3e('0x2e')]});});}})(_0x5e4423,_0x5dbea8,_0x261e92);};passport['use'](_0xfc3e('0x2a'),new LocalStrategy({'usernameField':_0xfc3e('0x19'),'passwordField':_0xfc3e('0x1a')},function(_0x465689,_0x498ac8,_0xb3c188){return ActiveDirectoryAuthenticate(db[_0xfc3e('0x2f')],_0x465689,_0x498ac8,_0xb3c188);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index e61e5c3..814d631 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 _0x8202=['./authActiveDirectory.controller','post','login','exports','express'];(function(_0x5d9af0,_0x52930a){var _0x23ac2d=function(_0x35cdb6){while(--_0x35cdb6){_0x5d9af0['push'](_0x5d9af0['shift']());}};_0x23ac2d(++_0x52930a);}(_0x8202,0x1e9));var _0x2820=function(_0xf0abca,_0x23ccaf){_0xf0abca=_0xf0abca-0x0;var _0x242f10=_0x8202[_0xf0abca];return _0x242f10;};'use strict';var express=require(_0x2820('0x0'));var router=express['Router']();var controller=require(_0x2820('0x1'));router[_0x2820('0x2')]('/',controller[_0x2820('0x3')]);module[_0x2820('0x4')]=router;
\ No newline at end of file
+var _0xf1fc=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x5e4813,_0x21ef94){var _0x3a18b5=function(_0xe5348){while(--_0xe5348){_0x5e4813['push'](_0x5e4813['shift']());}};_0x3a18b5(++_0x21ef94);}(_0xf1fc,0xfc));var _0xcf1f=function(_0x51fdab,_0x25059f){_0x51fdab=_0x51fdab-0x0;var _0x5ddf22=_0xf1fc[_0x51fdab];return _0x5ddf22;};'use strict';var express=require(_0xcf1f('0x0'));var router=express[_0xcf1f('0x1')]();var controller=require(_0xcf1f('0x2'));router[_0xcf1f('0x3')]('/',controller[_0xcf1f('0x4')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 8a4efee..eff82f2 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x428029,_0x1a5eb3){var _0x52033a=function(_0x5d73a8){while(--_0x5d73a8){_0x428029['push'](_0x428029['shift']());}};_0x52033a(++_0x1a5eb3);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x7a54,0x106));var _0x47a5=function(_0x2a1645,_0x35d23f){_0x2a1645=_0x2a1645-0x0;var _0x17f545=_0x7a54[_0x2a1645];return _0x17f545;};'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 c397e3b..211389e 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 _0xb879=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','setTokenCookie','exports','Router'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb879,0x15d));var _0x9b87=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb879[_0x1694f5];return _0x5b4321;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x9b87('0x0')]();var controller=require(_0x9b87('0x1'));var userController=require(_0x9b87('0x2'));var authService=require(_0x9b87('0x3'));router['get']('/',controller[_0x9b87('0x4')]);router[_0x9b87('0x5')](_0x9b87('0x6'),controller[_0x9b87('0x7')],authService['isMiddleware'],userController[_0x9b87('0x4')],authService[_0x9b87('0x8')]);module[_0x9b87('0x9')]=router;
\ No newline at end of file
+var _0x3dc7=['login','/callback','callback','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3dc7,0x138));var _0x73dc=function(_0x51dc0f,_0x18379f){_0x51dc0f=_0x51dc0f-0x0;var _0x3d004e=_0x3dc7[_0x51dc0f];return _0x3d004e;};'use strict';var express=require(_0x73dc('0x0'));var passport=require(_0x73dc('0x1'));var router=express[_0x73dc('0x2')]();var controller=require(_0x73dc('0x3'));var userController=require(_0x73dc('0x4'));var authService=require(_0x73dc('0x5'));router[_0x73dc('0x6')]('/',controller[_0x73dc('0x7')]);router[_0x73dc('0x6')](_0x73dc('0x8'),controller[_0x73dc('0x9')],authService['isMiddleware'],userController[_0x73dc('0x7')],authService[_0x73dc('0xa')]);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 9cad76b..780560a 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 _0xa5b9=['CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','request','error','format','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','local-login','util','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','then','findOne','name','password','salt','role','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp'];(function(_0x15c5b8,_0x3b670f){var _0xd45fe6=function(_0x15a775){while(--_0x15a775){_0x15c5b8['push'](_0x15c5b8['shift']());}};_0xd45fe6(++_0x3b670f);}(_0xa5b9,0x1cc));var _0x9a5b=function(_0x41ba8c,_0x304ef3){_0x41ba8c=_0x41ba8c-0x0;var _0x5245fa=_0xa5b9[_0x41ba8c];return _0x5245fa;};'use strict';var util=require(_0x9a5b('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9a5b('0x1'))['Strategy'];var jayson=require(_0x9a5b('0x2'));var _=require(_0x9a5b('0x3'));var rs=require(_0x9a5b('0x4'));var moment=require(_0x9a5b('0x5'));var db=require(_0x9a5b('0x6'))['db'];var authService=require(_0x9a5b('0x7'));var utils=require(_0x9a5b('0x8'));var client=jayson[_0x9a5b('0x9')][_0x9a5b('0xa')]({'port':0x232b});function localAuthenticate(_0x302ada,_0x599918,_0x4b80a1,_0x34a315){var _0x25a525,_0xd1737a;return db[_0x9a5b('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x9a5b('0xc'),'blockDuration'],'raw':!![]})[_0x9a5b('0xd')](function(_0x413d4c){_0x25a525=_0x413d4c;return _0x302ada[_0x9a5b('0xe')]({'attributes':['id',_0x9a5b('0xf'),_0x9a5b('0x10'),_0x9a5b('0x11'),_0x9a5b('0x12'),'disabled',_0x9a5b('0x13'),_0x9a5b('0x14'),'loginAttempts'],'where':{'name':_0x599918,'role':{'$or':[_0x9a5b('0x15'),_0x9a5b('0x16'),_0x9a5b('0x17')]}}});})[_0x9a5b('0xd')](function(_0x3f8e55){if(!_0x3f8e55||_0x3f8e55&&_0x3f8e55[_0x9a5b('0xf')]!==_0x599918){throw new Error(_0x9a5b('0x18'));}else{_0xd1737a=_0x3f8e55;return _0xd1737a;}})['then'](function(){_0xd1737a[_0x9a5b('0x19')](_0x4b80a1,function(_0x2aa4bc,_0x1d9d2a){var _0x2385d2=_0xd1737a[_0x9a5b('0x1a')]+0x1;if(_0x2aa4bc){return _0x34a315(_0x2aa4bc);}else if(!_0x1d9d2a){if(_0xd1737a[_0x9a5b('0x1b')]){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else if(_0x25a525['allowedLoginAttempts']>0x0){if(_0xd1737a[_0x9a5b('0x13')]){if(_0x25a525[_0x9a5b('0x1c')]>0x0){if(moment(_0xd1737a[_0x9a5b('0x14')])[_0x9a5b('0x1d')](_0x25a525[_0x9a5b('0x1c')],_0x9a5b('0x1e'))>moment()){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else{return utils[_0x9a5b('0x1f')](_0xd1737a,_0x2385d2,![],null)[_0x9a5b('0xd')](function(){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});});}}else{return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2385d2>=_0x25a525[_0x9a5b('0xc')]){return utils[_0x9a5b('0x1f')](_0xd1737a,0x0,!![],moment())[_0x9a5b('0xd')](function(){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});});}else{return utils[_0x9a5b('0x1f')](_0xd1737a,_0x2385d2,![],null)[_0x9a5b('0xd')](function(){return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xd1737a[_0x9a5b('0x1b')]){return _0x34a315(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x25a525[_0x9a5b('0xc')]>0x0){if(_0xd1737a[_0x9a5b('0x13')]){if(_0x25a525['blockDuration']>0x0){if(moment(_0xd1737a[_0x9a5b('0x14')])[_0x9a5b('0x1d')](_0x25a525[_0x9a5b('0x1c')],_0x9a5b('0x1e'))>moment()){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else{return utils[_0x9a5b('0x1f')](_0xd1737a,0x0,![],null)['then'](function(){return utils['getLicense'](_0xd1737a);})[_0x9a5b('0xd')](function(){return _0x34a315(null,_0xd1737a);});}}else{return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}}else{return utils['clearBlockUser'](_0xd1737a,0x0,![],null)[_0x9a5b('0xd')](function(){return utils[_0x9a5b('0x20')](_0xd1737a);})[_0x9a5b('0xd')](function(){return _0x34a315(null,_0xd1737a);})[_0x9a5b('0x21')](function(_0x33eebe){return _0x34a315(null,![],_0x33eebe);});}}else{if(_0xd1737a[_0x9a5b('0x13')]){return _0x34a315(null,![],{'message':_0x9a5b('0x18')});}else{return utils['getLicense'](_0xd1737a)[_0x9a5b('0xd')](function(){return _0x34a315(null,_0xd1737a);});}}}});})['catch'](function(_0x17a7dc){return _0x34a315(null,![],_0x17a7dc);});}function sendServiceMail(_0x2e9038){return db['MailAccount'][_0x9a5b('0x22')]({'where':{'service':!![]},'attributes':['id',_0x9a5b('0xf'),_0x9a5b('0x23')],'include':[{'model':db[_0x9a5b('0x24')],'as':_0x9a5b('0x25'),'include':[{'model':db['CloudProvider'],'as':_0x9a5b('0x26')}]}]})['then'](function(_0x2a3f65){if(!_0x2a3f65){throw new Error(_0x9a5b('0x27'));}var _0xdea8b7=_0x2a3f65[_0x9a5b('0x28')]();var _0x37a49d={'account':_0xdea8b7,'message':_[_0x9a5b('0x29')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x2a3f65[_0x9a5b('0xf')],_0x2a3f65['email']||_0x2a3f65['Smtp'][_0x9a5b('0x16')])},_0x2e9038)};return client[_0x9a5b('0x2a')]('SendMail',_0x37a49d);})[_0x9a5b('0xd')](function(_0x66f609){if(_0x66f609[_0x9a5b('0x2b')]){throw new Error(util[_0x9a5b('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x66f609[_0x9a5b('0x2b')][_0x9a5b('0x2d')]||JSON[_0x9a5b('0x2e')](_0x66f609[_0x9a5b('0x2b')])));}return!![];});}function handleError(_0x5d17ef,_0x13875f,_0x9fe6dd){return _0x5d17ef[_0x9a5b('0x2f')](_0x13875f||0x1f4)[_0x9a5b('0x30')]({'message':_0x9fe6dd?_0x9fe6dd[_0x9a5b('0x2d')]||_0x9fe6dd:''});}exports[_0x9a5b('0x31')]=function(_0x1fda88,_0x502b72,_0x220f9d){passport[_0x9a5b('0x19')]('local-login',function(_0x2f8704,_0x47a295,_0x42b818){var _0x5ec66c=_0x2f8704||_0x42b818;if(_0x5ec66c){return handleError(_0x502b72,0x191,_0x5ec66c);}if(!_0x47a295){return handleError(_0x502b72,0x194,{'message':_0x9a5b('0x32')});}else{var _0x7c7b1d={'payload':{'id':_0x47a295['id'],'role':_0x47a295[_0x9a5b('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x9a5b('0x33')](_0x7c7b1d)[_0x9a5b('0xd')](function(_0x3288e0){_0x502b72[_0x9a5b('0x34')]({'id':_0x47a295['id'],'token':_0x3288e0,'statusCall':'','isAlreadyLogged':_0x47a295[_0x9a5b('0x35')]});});}})(_0x1fda88,_0x502b72,_0x220f9d);};exports[_0x9a5b('0x36')]=function(_0x376872,_0x23670e){if(!_0x376872[_0x9a5b('0x37')][_0x9a5b('0x23')]){return handleError(_0x23670e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xa1faf8=rs['generate']();_0x376872[_0x9a5b('0x37')][_0x9a5b('0x23')]=_0x376872[_0x9a5b('0x37')]['email'][_0x9a5b('0x38')]()[_0x9a5b('0x39')]();var _0x107a20;return db[_0x9a5b('0xb')][_0x9a5b('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9a5b('0x1c')],'raw':!![]})[_0x9a5b('0xd')](function(_0x2d03e2){_0x107a20=_0x2d03e2;return db[_0x9a5b('0x3a')][_0x9a5b('0x22')]({'where':{'email':_0x376872[_0x9a5b('0x37')]['email']}});})[_0x9a5b('0xd')](function(_0x101848){if(!_0x101848){throw new Error(_0x9a5b('0x3b'));}if(_0x101848[_0x9a5b('0x1b')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x101848['blocked']){if(moment(_0x101848[_0x9a5b('0x14')])[_0x9a5b('0x1d')](_0x107a20['blockDuration'],_0x9a5b('0x1e'))>moment()){throw new Error(_0x9a5b('0x3c'));}else{_0x101848['blocked']=![];_0x101848[_0x9a5b('0x14')]=null;}}_0x101848[_0x9a5b('0x3d')]=_0xa1faf8;_0x101848[_0x9a5b('0x3e')]=Date[_0x9a5b('0x3f')]()+0x36ee80;return _0x101848[_0x9a5b('0x40')]();})[_0x9a5b('0xd')](function(){return sendServiceMail({'to':_0x376872[_0x9a5b('0x37')][_0x9a5b('0x23')],'subject':_0x9a5b('0x41'),'text':_0x9a5b('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9a5b('0x43')+_0x376872['headers'][_0x9a5b('0x44')]+'/reset/'+_0xa1faf8+'\x0a\x0a'+_0x9a5b('0x45')});})[_0x9a5b('0xd')](function(){_0x23670e[_0x9a5b('0x2f')](0xc8)[_0x9a5b('0x30')]({'message':_0x9a5b('0x46')});})[_0x9a5b('0x21')](function(_0x9824b5){return handleError(_0x23670e,0x1f4,_0x9824b5);});};exports[_0x9a5b('0x47')]=function(_0x15ac14,_0x15dcb6){return db[_0x9a5b('0x3a')]['find']({'where':{'resetPasswordToken':_0x15ac14[_0x9a5b('0x48')][_0x9a5b('0x49')],'resetPasswordExpires':{'$gt':Date[_0x9a5b('0x3f')]()}}})[_0x9a5b('0xd')](function(_0x5d4171){if(!_0x5d4171){throw new Error(_0x9a5b('0x4a'));}return db[_0x9a5b('0xb')]['findOne']({'attributes':['id',_0x9a5b('0x4b'),_0x9a5b('0x4c'),_0x9a5b('0x4d')]})[_0x9a5b('0xd')](function(_0x23a0ef){if(_0x23a0ef[_0x9a5b('0x4b')])authService['validatePasswordPattern'](_0x15ac14[_0x9a5b('0x37')][_0x9a5b('0x10')]);if(!_0x23a0ef[_0x9a5b('0x4c')]||!_0x5d4171[_0x9a5b('0x4e')])return _0x5d4171;authService[_0x9a5b('0x4f')](_0x15ac14[_0x9a5b('0x37')][_0x9a5b('0x10')],_0x5d4171[_0x9a5b('0x4e')],_0x23a0ef[_0x9a5b('0x4d')]);return _0x5d4171;})[_0x9a5b('0xd')](function(){_0x5d4171[_0x9a5b('0x10')]=_0x15ac14[_0x9a5b('0x37')]['password'];_0x5d4171[_0x9a5b('0x3d')]=null;_0x5d4171[_0x9a5b('0x3e')]=null;return _0x5d4171[_0x9a5b('0x40')]();});})['then'](function(){_0x15dcb6['status'](0xc8)[_0x9a5b('0x30')]({'message':_0x9a5b('0x50')});})['catch'](function(_0xffaea3){return handleError(_0x15dcb6,0x1f4,_0xffaea3);});};passport[_0x9a5b('0x51')](_0x9a5b('0x52'),new LocalStrategy({'usernameField':_0x9a5b('0xf'),'passwordField':'password'},function(_0x4bab76,_0xa35269,_0x404321){return localAuthenticate(db[_0x9a5b('0x3a')],_0x4bab76,_0xa35269,_0x404321);}));
\ No newline at end of file
+var _0x8d66=['body','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','name','password','salt','role','blocked','blockedAt','admin','user','agent','then','authenticate','loginAttempts','disabled','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','minutes','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','Smtp','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','error','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','Email\x20parameter\x20is\x20missing','generate','toLowerCase','findOne','User','find'];(function(_0x18bfdb,_0x241d43){var _0x44334c=function(_0x55e999){while(--_0x55e999){_0x18bfdb['push'](_0x18bfdb['shift']());}};_0x44334c(++_0x241d43);}(_0x8d66,0x1c0));var _0x68d6=function(_0x48bb9c,_0x34c5f4){_0x48bb9c=_0x48bb9c-0x0;var _0x31cc55=_0x8d66[_0x48bb9c];return _0x31cc55;};'use strict';var util=require(_0x68d6('0x0'));var passport=require('passport');var LocalStrategy=require(_0x68d6('0x1'))[_0x68d6('0x2')];var jayson=require(_0x68d6('0x3'));var _=require(_0x68d6('0x4'));var rs=require(_0x68d6('0x5'));var moment=require('moment');var db=require(_0x68d6('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x68d6('0x7'));var client=jayson['client'][_0x68d6('0x8')]({'port':0x232b});function localAuthenticate(_0xf9a177,_0x3a58b,_0x5b17cc,_0x1c361d){var _0x48e223,_0x40424e;return db[_0x68d6('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x68d6('0xa'),_0x68d6('0xb')],'raw':!![]})['then'](function(_0x5b0366){_0x48e223=_0x5b0366;return _0xf9a177['findOne']({'attributes':['id',_0x68d6('0xc'),_0x68d6('0xd'),_0x68d6('0xe'),_0x68d6('0xf'),'disabled',_0x68d6('0x10'),_0x68d6('0x11'),'loginAttempts'],'where':{'name':_0x3a58b,'role':{'$or':[_0x68d6('0x12'),_0x68d6('0x13'),_0x68d6('0x14')]}}});})['then'](function(_0x2a4dbf){if(!_0x2a4dbf||_0x2a4dbf&&_0x2a4dbf[_0x68d6('0xc')]!==_0x3a58b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x40424e=_0x2a4dbf;return _0x40424e;}})[_0x68d6('0x15')](function(){_0x40424e[_0x68d6('0x16')](_0x5b17cc,function(_0x183e4f,_0xd2db08){var _0x5a522a=_0x40424e[_0x68d6('0x17')]+0x1;if(_0x183e4f){return _0x1c361d(_0x183e4f);}else if(!_0xd2db08){if(_0x40424e[_0x68d6('0x18')]){return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x48e223['allowedLoginAttempts']>0x0){if(_0x40424e[_0x68d6('0x10')]){if(_0x48e223[_0x68d6('0xb')]>0x0){if(moment(_0x40424e[_0x68d6('0x11')])[_0x68d6('0x19')](_0x48e223['blockDuration'],'minutes')>moment()){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}else{return utils[_0x68d6('0x1b')](_0x40424e,_0x5a522a,![],null)[_0x68d6('0x15')](function(){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});});}}else{return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}}else{if(_0x5a522a>=_0x48e223[_0x68d6('0xa')]){return utils['clearBlockUser'](_0x40424e,0x0,!![],moment())[_0x68d6('0x15')](function(){return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x40424e,_0x5a522a,![],null)['then'](function(){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});});}}}else{return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}}else{if(_0x40424e[_0x68d6('0x18')]){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}else if(_0x48e223['allowedLoginAttempts']>0x0){if(_0x40424e['blocked']){if(_0x48e223[_0x68d6('0xb')]>0x0){if(moment(_0x40424e[_0x68d6('0x11')])[_0x68d6('0x19')](_0x48e223[_0x68d6('0xb')],_0x68d6('0x1c'))>moment()){return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x68d6('0x1b')](_0x40424e,0x0,![],null)[_0x68d6('0x15')](function(){return utils['getLicense'](_0x40424e);})[_0x68d6('0x15')](function(){return _0x1c361d(null,_0x40424e);});}}else{return _0x1c361d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x68d6('0x1b')](_0x40424e,0x0,![],null)['then'](function(){return utils[_0x68d6('0x1d')](_0x40424e);})[_0x68d6('0x15')](function(){return _0x1c361d(null,_0x40424e);})[_0x68d6('0x1e')](function(_0x59bb3a){return _0x1c361d(null,![],_0x59bb3a);});}}else{if(_0x40424e[_0x68d6('0x10')]){return _0x1c361d(null,![],{'message':_0x68d6('0x1a')});}else{return utils[_0x68d6('0x1d')](_0x40424e)[_0x68d6('0x15')](function(){return _0x1c361d(null,_0x40424e);});}}}});})[_0x68d6('0x1e')](function(_0x583e1c){return _0x1c361d(null,![],_0x583e1c);});}function sendServiceMail(_0x6be2db){return db[_0x68d6('0x1f')]['find']({'where':{'service':!![]},'attributes':['id',_0x68d6('0xc'),_0x68d6('0x20')],'include':[{'model':db[_0x68d6('0x21')],'as':'Smtp','include':[{'model':db[_0x68d6('0x22')],'as':_0x68d6('0x22')}]}]})[_0x68d6('0x15')](function(_0x3a6c18){if(!_0x3a6c18){throw new Error(_0x68d6('0x23'));}var _0x125743=_0x3a6c18[_0x68d6('0x24')]();var _0x7251bc={'account':_0x125743,'message':_['merge']({'from':util[_0x68d6('0x25')]('\x22%s\x22\x20<%s>',_0x3a6c18['name'],_0x3a6c18[_0x68d6('0x20')]||_0x3a6c18[_0x68d6('0x26')][_0x68d6('0x13')])},_0x6be2db)};return client['request'](_0x68d6('0x27'),_0x7251bc);})[_0x68d6('0x15')](function(_0xc16799){if(_0xc16799['error']){throw new Error(util[_0x68d6('0x25')](_0x68d6('0x28'),_0xc16799['error'][_0x68d6('0x29')]||JSON['stringify'](_0xc16799[_0x68d6('0x2a')])));}return!![];});}function handleError(_0x15b202,_0x31d00b,_0x12067c){return _0x15b202[_0x68d6('0x2b')](_0x31d00b||0x1f4)[_0x68d6('0x2c')]({'message':_0x12067c?_0x12067c[_0x68d6('0x29')]||_0x12067c:''});}exports[_0x68d6('0x2d')]=function(_0x31781d,_0x529626,_0x512448){passport[_0x68d6('0x16')](_0x68d6('0x2e'),function(_0x103cc0,_0x1ad9d6,_0x3931dd){var _0x11c8d0=_0x103cc0||_0x3931dd;if(_0x11c8d0){return handleError(_0x529626,0x191,_0x11c8d0);}if(!_0x1ad9d6){return handleError(_0x529626,0x194,{'message':_0x68d6('0x2f')});}else{var _0x44a44c={'payload':{'id':_0x1ad9d6['id'],'role':_0x1ad9d6[_0x68d6('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x68d6('0x30')](_0x44a44c)[_0x68d6('0x15')](function(_0x356397){_0x529626['json']({'id':_0x1ad9d6['id'],'token':_0x356397,'statusCall':'','isAlreadyLogged':_0x1ad9d6['online']});});}})(_0x31781d,_0x529626,_0x512448);};exports[_0x68d6('0x31')]=function(_0x32acba,_0x141093){if(!_0x32acba['body'][_0x68d6('0x20')]){return handleError(_0x141093,0x1f4,{'message':_0x68d6('0x32')});}var _0x127908=rs[_0x68d6('0x33')]();_0x32acba['body'][_0x68d6('0x20')]=_0x32acba['body'][_0x68d6('0x20')]['trim']()[_0x68d6('0x34')]();var _0x213c7a;return db[_0x68d6('0x9')][_0x68d6('0x35')]({'where':{'id':0x1},'attributes':[_0x68d6('0xa'),_0x68d6('0xb')],'raw':!![]})[_0x68d6('0x15')](function(_0x4338ba){_0x213c7a=_0x4338ba;return db[_0x68d6('0x36')][_0x68d6('0x37')]({'where':{'email':_0x32acba[_0x68d6('0x38')]['email']}});})['then'](function(_0x47f03c){if(!_0x47f03c){throw new Error(_0x68d6('0x39'));}if(_0x47f03c[_0x68d6('0x18')]){throw new Error(_0x68d6('0x3a'));}if(_0x47f03c[_0x68d6('0x10')]){if(moment(_0x47f03c['blockedAt'])[_0x68d6('0x19')](_0x213c7a[_0x68d6('0xb')],_0x68d6('0x1c'))>moment()){throw new Error(_0x68d6('0x3b'));}else{_0x47f03c[_0x68d6('0x10')]=![];_0x47f03c[_0x68d6('0x11')]=null;}}_0x47f03c['resetPasswordToken']=_0x127908;_0x47f03c[_0x68d6('0x3c')]=Date[_0x68d6('0x3d')]()+0x36ee80;return _0x47f03c[_0x68d6('0x3e')]();})[_0x68d6('0x15')](function(){return sendServiceMail({'to':_0x32acba[_0x68d6('0x38')]['email'],'subject':_0x68d6('0x3f'),'text':_0x68d6('0x40')+_0x68d6('0x41')+_0x68d6('0x42')+_0x32acba[_0x68d6('0x43')][_0x68d6('0x44')]+'/reset/'+_0x127908+'\x0a\x0a'+_0x68d6('0x45')});})['then'](function(){_0x141093[_0x68d6('0x2b')](0xc8)[_0x68d6('0x2c')]({'message':_0x68d6('0x46')});})['catch'](function(_0x4771c0){return handleError(_0x141093,0x1f4,_0x4771c0);});};exports[_0x68d6('0x47')]=function(_0x3f266b,_0x557bbe){return db[_0x68d6('0x36')][_0x68d6('0x37')]({'where':{'resetPasswordToken':_0x3f266b[_0x68d6('0x48')][_0x68d6('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x68d6('0x15')](function(_0x398b73){if(!_0x398b73){throw new Error(_0x68d6('0x4a'));}return db['Setting'][_0x68d6('0x35')]({'attributes':['id',_0x68d6('0x4b'),_0x68d6('0x4c'),'passwordHistoryLimit']})[_0x68d6('0x15')](function(_0x127b1a){if(_0x127b1a[_0x68d6('0x4b')])authService[_0x68d6('0x4d')](_0x3f266b['body'][_0x68d6('0xd')]);if(!_0x127b1a[_0x68d6('0x4c')]||!_0x398b73[_0x68d6('0x4e')])return _0x398b73;authService[_0x68d6('0x4f')](_0x3f266b[_0x68d6('0x38')][_0x68d6('0xd')],_0x398b73[_0x68d6('0x4e')],_0x127b1a[_0x68d6('0x50')]);return _0x398b73;})[_0x68d6('0x15')](function(){_0x398b73[_0x68d6('0xd')]=_0x3f266b[_0x68d6('0x38')][_0x68d6('0xd')];_0x398b73[_0x68d6('0x51')]=null;_0x398b73[_0x68d6('0x3c')]=null;return _0x398b73[_0x68d6('0x3e')]();});})['then'](function(){_0x557bbe[_0x68d6('0x2b')](0xc8)[_0x68d6('0x2c')]({'message':_0x68d6('0x52')});})['catch'](function(_0xe75d77){return handleError(_0x557bbe,0x1f4,_0xe75d77);});};passport[_0x68d6('0x53')](_0x68d6('0x2e'),new LocalStrategy({'usernameField':_0x68d6('0xc'),'passwordField':_0x68d6('0xd')},function(_0x3e26ee,_0x297aca,_0x53bb46){return localAuthenticate(db[_0x68d6('0x36')],_0x3e26ee,_0x297aca,_0x53bb46);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 022744f..3ae3741 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 _0x2cd9=['post','/reset/:token','exports','express','Router','./authLocal.controller','login','/forgot','forgot'];(function(_0x4cb394,_0x2922dd){var _0xfaa442=function(_0x14470f){while(--_0x14470f){_0x4cb394['push'](_0x4cb394['shift']());}};_0xfaa442(++_0x2922dd);}(_0x2cd9,0x135));var _0x92cd=function(_0x454b43,_0xbbd840){_0x454b43=_0x454b43-0x0;var _0x18b44b=_0x2cd9[_0x454b43];return _0x18b44b;};'use strict';var express=require(_0x92cd('0x0'));var router=express[_0x92cd('0x1')]();var controller=require(_0x92cd('0x2'));router['post']('/',controller[_0x92cd('0x3')]);router['post'](_0x92cd('0x4'),controller[_0x92cd('0x5')]);router[_0x92cd('0x6')](_0x92cd('0x7'),controller['reset']);module[_0x92cd('0x8')]=router;
\ No newline at end of file
+var _0x6914=['Router','./authLocal.controller','post','login','/reset/:token','reset','express'];(function(_0x39b8a8,_0x25ca73){var _0x34737e=function(_0x699b){while(--_0x699b){_0x39b8a8['push'](_0x39b8a8['shift']());}};_0x34737e(++_0x25ca73);}(_0x6914,0xd8));var _0x4691=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x6914[_0x12fc8d];return _0x3f9d04;};'use strict';var express=require(_0x4691('0x0'));var router=express[_0x4691('0x1')]();var controller=require(_0x4691('0x2'));router[_0x4691('0x3')]('/',controller[_0x4691('0x4')]);router[_0x4691('0x3')]('/forgot',controller['forgot']);router['post'](_0x4691('0x5'),controller[_0x4691('0x6')]);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 eb6d89b..9e63b8a 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 _0x3e31=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x1b60e6,_0x2e8a31){var _0x1bbb3d=function(_0x3b07f0){while(--_0x3b07f0){_0x1b60e6['push'](_0x1b60e6['shift']());}};_0x1bbb3d(++_0x2e8a31);}(_0x3e31,0xfe));var _0x13e3=function(_0xf3fd05,_0x23ce73){_0xf3fd05=_0xf3fd05-0x0;var _0x7b9231=_0x3e31[_0xf3fd05];return _0x7b9231;};'use strict';var Sequelize=require(_0x13e3('0x0'));module[_0x13e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x13e3('0x2')]},'description':{'type':Sequelize[_0x13e3('0x2')]},'status':{'type':Sequelize[_0x13e3('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x13e3('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xb3eb=['exports','STRING','INTEGER','sequelize'];(function(_0x5505b7,_0x5e1ab5){var _0x4e58d1=function(_0x368e17){while(--_0x368e17){_0x5505b7['push'](_0x5505b7['shift']());}};_0x4e58d1(++_0x5e1ab5);}(_0xb3eb,0x127));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbb3e('0x0'));module[_0xbb3e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xbb3e('0x2')]},'description':{'type':Sequelize[_0xbb3e('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbb3e('0x3')],'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 5cfe34e..bf6e830 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 _0x1248=['../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','filters','intersection','model','attributes','length','query','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','Automation','includeAll','include','findAll','params','fields','options','find','catch','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x56716d,_0x2f6690){var _0x126a2c=function(_0x5bf306){while(--_0x5bf306){_0x56716d['push'](_0x56716d['shift']());}};_0x126a2c(++_0x2f6690);}(_0x1248,0xe9));var _0x8124=function(_0x9f90cf,_0x503641){_0x9f90cf=_0x9f90cf-0x0;var _0x4d2bd3=_0x1248[_0x9f90cf];return _0x4d2bd3;};'use strict';var emlformat=require(_0x8124('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8124('0x1'));var jsonpatch=require(_0x8124('0x2'));var rp=require(_0x8124('0x3'));var moment=require(_0x8124('0x4'));var BPromise=require(_0x8124('0x5'));var Mustache=require(_0x8124('0x6'));var util=require(_0x8124('0x7'));var path=require(_0x8124('0x8'));var sox=require(_0x8124('0x9'));var csv=require(_0x8124('0xa'));var ejs=require(_0x8124('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8124('0xc'));var squel=require(_0x8124('0xd'));var crypto=require('crypto');var jsforce=require(_0x8124('0xe'));var deskjs=require(_0x8124('0xf'));var toCsv=require(_0x8124('0xa'));var querystring=require(_0x8124('0x10'));var Papa=require(_0x8124('0x11'));var Redis=require(_0x8124('0x12'));var authService=require(_0x8124('0x13'));var qs=require(_0x8124('0x14'));var as=require(_0x8124('0x15'));var hardwareService=require(_0x8124('0x16'));var logger=require(_0x8124('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8124('0x18'));var db=require(_0x8124('0x19'))['db'];function respondWithStatusCode(_0x508a45,_0x4a9785){_0x4a9785=_0x4a9785||0xcc;return function(_0x54d42b){if(_0x54d42b){return _0x508a45[_0x8124('0x1a')](_0x4a9785);}return _0x508a45[_0x8124('0x1b')](_0x4a9785)[_0x8124('0x1c')]();};}function respondWithResult(_0x4fbe93,_0x12b0e6){_0x12b0e6=_0x12b0e6||0xc8;return function(_0xc735a5){if(_0xc735a5){return _0x4fbe93['status'](_0x12b0e6)['json'](_0xc735a5);}};}function respondWithFilteredResult(_0x4a9816,_0x3aaf5d){return function(_0x352064){if(_0x352064){var _0x6bee46=typeof _0x3aaf5d[_0x8124('0x1d')]===_0x8124('0x1e')&&typeof _0x3aaf5d['limit']===_0x8124('0x1e');var _0x732edb=_0x352064[_0x8124('0x1f')];var _0x1b6810=_0x6bee46?0x0:_0x3aaf5d[_0x8124('0x1d')];var _0x441dbd=_0x6bee46?_0x352064[_0x8124('0x1f')]:_0x3aaf5d[_0x8124('0x1d')]+_0x3aaf5d['limit'];var _0x5410aa;if(_0x441dbd>=_0x732edb){_0x441dbd=_0x732edb;_0x5410aa=0xc8;}else{_0x5410aa=0xce;}_0x4a9816[_0x8124('0x1b')](_0x5410aa);return _0x4a9816['set'](_0x8124('0x20'),_0x1b6810+'-'+_0x441dbd+'/'+_0x732edb)[_0x8124('0x21')](_0x352064);}return null;};}function patchUpdates(_0x5f4290){return function(_0x207aec){try{jsonpatch[_0x8124('0x22')](_0x207aec,_0x5f4290,!![]);}catch(_0x5a770d){return BPromise[_0x8124('0x23')](_0x5a770d);}return _0x207aec[_0x8124('0x24')]();};}function saveUpdates(_0x1d77ac,_0x407ea9){return function(_0x33e63d){if(_0x33e63d){return _0x33e63d[_0x8124('0x25')](_0x1d77ac)[_0x8124('0x26')](function(_0x558721){return _0x558721;});}return null;};}function removeEntity(_0xb1d8ec,_0x1003eb){return function(_0x280607){if(_0x280607){return _0x280607[_0x8124('0x27')]()[_0x8124('0x26')](function(){_0xb1d8ec[_0x8124('0x1b')](0xcc)[_0x8124('0x1c')]();});}};}function handleEntityNotFound(_0x5387f4,_0x4db46b){return function(_0x566ac4){if(!_0x566ac4){_0x5387f4['sendStatus'](0x194);}return _0x566ac4;};}function handleError(_0x2a8332,_0x303171){_0x303171=_0x303171||0x1f4;return function(_0xfb5031){logger[_0x8124('0x28')](_0xfb5031[_0x8124('0x29')]);if(_0xfb5031['name']){delete _0xfb5031[_0x8124('0x2a')];}_0x2a8332[_0x8124('0x1b')](_0x303171)[_0x8124('0x2b')](_0xfb5031);};}exports[_0x8124('0x2c')]=function(_0x2bb32c,_0x451d85){var _0x2fca90={},_0x216f17={},_0xb114c2={'count':0x0,'rows':[]};var _0x158a79=_[_0x8124('0x2d')](db['Automation'][_0x8124('0x2e')],function(_0x5b03d3){return{'name':_0x5b03d3[_0x8124('0x2f')],'type':_0x5b03d3[_0x8124('0x30')]['key']};});_0x216f17['model']=_['map'](_0x158a79,_0x8124('0x2a'));_0x216f17['query']=_[_0x8124('0x31')](_0x2bb32c['query']);_0x216f17[_0x8124('0x32')]=_[_0x8124('0x33')](_0x216f17[_0x8124('0x34')],_0x216f17['query']);_0x2fca90[_0x8124('0x35')]=_[_0x8124('0x33')](_0x216f17[_0x8124('0x34')],qs['fields'](_0x2bb32c['query']['fields']));_0x2fca90['attributes']=_0x2fca90[_0x8124('0x35')][_0x8124('0x36')]?_0x2fca90[_0x8124('0x35')]:_0x216f17[_0x8124('0x34')];if(!_0x2bb32c[_0x8124('0x37')][_0x8124('0x38')](_0x8124('0x39'))){_0x2fca90[_0x8124('0x3a')]=qs[_0x8124('0x3a')](_0x2bb32c[_0x8124('0x37')][_0x8124('0x3a')]);_0x2fca90[_0x8124('0x1d')]=qs[_0x8124('0x1d')](_0x2bb32c[_0x8124('0x37')][_0x8124('0x1d')]);}_0x2fca90[_0x8124('0x3b')]=qs[_0x8124('0x3c')](_0x2bb32c['query']['sort']);_0x2fca90['where']=qs[_0x8124('0x32')](_[_0x8124('0x3d')](_0x2bb32c[_0x8124('0x37')],_0x216f17['filters']),_0x158a79);if(_0x2bb32c[_0x8124('0x37')][_0x8124('0x3e')]){_0x2fca90['where']=_[_0x8124('0x3f')](_0x2fca90[_0x8124('0x40')],{'$or':_[_0x8124('0x2d')](_0x158a79,function(_0x21f1d8){if(_0x21f1d8[_0x8124('0x30')]!=='VIRTUAL'){var _0x5439a6={};_0x5439a6[_0x21f1d8[_0x8124('0x2a')]]={'$like':'%'+_0x2bb32c[_0x8124('0x37')]['filter']+'%'};return _0x5439a6;}})});}_0x2fca90=_[_0x8124('0x3f')]({},_0x2fca90,_0x2bb32c['options']);var _0x55478f={'where':_0x2fca90[_0x8124('0x40')]};return db[_0x8124('0x41')][_0x8124('0x1f')](_0x55478f)[_0x8124('0x26')](function(_0x5648ae){_0xb114c2[_0x8124('0x1f')]=_0x5648ae;if(_0x2bb32c[_0x8124('0x37')][_0x8124('0x42')]){_0x2fca90[_0x8124('0x43')]=[{'all':!![]}];}return db[_0x8124('0x41')][_0x8124('0x44')](_0x2fca90);})[_0x8124('0x26')](function(_0x2a6a89){_0xb114c2['rows']=_0x2a6a89;return _0xb114c2;})[_0x8124('0x26')](respondWithFilteredResult(_0x451d85,_0x2fca90))['catch'](handleError(_0x451d85,null));};exports['show']=function(_0x4d2ff8,_0xabaf08){var _0x371e40={'raw':![],'where':{'id':_0x4d2ff8[_0x8124('0x45')]['id']}},_0x35edd7={};_0x35edd7[_0x8124('0x34')]=_[_0x8124('0x31')](db[_0x8124('0x41')][_0x8124('0x2e')]);_0x35edd7[_0x8124('0x37')]=_[_0x8124('0x31')](_0x4d2ff8[_0x8124('0x37')]);_0x35edd7[_0x8124('0x32')]=_[_0x8124('0x33')](_0x35edd7[_0x8124('0x34')],_0x35edd7[_0x8124('0x37')]);_0x371e40[_0x8124('0x35')]=_[_0x8124('0x33')](_0x35edd7['model'],qs[_0x8124('0x46')](_0x4d2ff8[_0x8124('0x37')]['fields']));_0x371e40[_0x8124('0x35')]=_0x371e40[_0x8124('0x35')][_0x8124('0x36')]?_0x371e40[_0x8124('0x35')]:_0x35edd7[_0x8124('0x34')];if(_0x4d2ff8['query'][_0x8124('0x42')]){_0x371e40[_0x8124('0x43')]=[{'all':!![]}];}_0x371e40=_[_0x8124('0x3f')]({},_0x371e40,_0x4d2ff8[_0x8124('0x47')]);return db['Automation'][_0x8124('0x48')](_0x371e40)['then'](handleEntityNotFound(_0xabaf08,null))['then'](respondWithResult(_0xabaf08,null))[_0x8124('0x49')](handleError(_0xabaf08,null));};exports[_0x8124('0x4a')]=function(_0x4ea287,_0x37edb1){return db[_0x8124('0x41')][_0x8124('0x4a')](_0x4ea287[_0x8124('0x4b')],{})['then'](respondWithResult(_0x37edb1,0xc9))[_0x8124('0x49')](handleError(_0x37edb1,null));};exports[_0x8124('0x25')]=function(_0x172414,_0x1f8311){if(_0x172414['body']['id']){delete _0x172414['body']['id'];}return db[_0x8124('0x41')][_0x8124('0x48')]({'where':{'id':_0x172414[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f8311,null))[_0x8124('0x26')](saveUpdates(_0x172414[_0x8124('0x4b')],null))[_0x8124('0x26')](respondWithResult(_0x1f8311,null))[_0x8124('0x49')](handleError(_0x1f8311,null));};exports['destroy']=function(_0x343450,_0x2c878a){return db[_0x8124('0x41')][_0x8124('0x48')]({'where':{'id':_0x343450['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x2c878a,null))[_0x8124('0x26')](removeEntity(_0x2c878a,null))[_0x8124('0x49')](handleError(_0x2c878a,null));};exports[_0x8124('0x4c')]=function(_0xee7f87,_0x20a0c9,_0x4a093f){return db[_0x8124('0x4d')][_0x8124('0x48')]({'where':{'id':_0xee7f87[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x20a0c9,null))['then'](function(_0x3b6d4c){if(_0x3b6d4c){return _0x3b6d4c[_0x8124('0x4c')](_0xee7f87[_0x8124('0x4b')][_0x8124('0x4e')],_['omit'](_0xee7f87[_0x8124('0x4b')],[_0x8124('0x4e'),'id'])||{});}})[_0x8124('0x26')](respondWithResult(_0x20a0c9,null))[_0x8124('0x49')](handleError(_0x20a0c9,null));};exports[_0x8124('0x4f')]=function(_0x1c6d72,_0x28c5cb,_0x17bb2a){var _0x4edf6f={};var _0x524e1f={};var _0x4da122;var _0x4a82c8;return db[_0x8124('0x41')][_0x8124('0x50')]({'where':{'id':_0x1c6d72[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x28c5cb,null))[_0x8124('0x26')](function(_0x293981){if(_0x293981){_0x4da122=_0x293981;_0x524e1f[_0x8124('0x34')]=_[_0x8124('0x31')](db[_0x8124('0x4d')][_0x8124('0x2e')]);_0x524e1f['query']=_[_0x8124('0x31')](_0x1c6d72[_0x8124('0x37')]);_0x524e1f[_0x8124('0x32')]=_['intersection'](_0x524e1f[_0x8124('0x34')],_0x524e1f[_0x8124('0x37')]);_0x4edf6f[_0x8124('0x35')]=_[_0x8124('0x33')](_0x524e1f['model'],qs['fields'](_0x1c6d72[_0x8124('0x37')][_0x8124('0x46')]));_0x4edf6f[_0x8124('0x35')]=_0x4edf6f['attributes'][_0x8124('0x36')]?_0x4edf6f[_0x8124('0x35')]:_0x524e1f['model'];_0x4edf6f['order']=qs['sort'](_0x1c6d72[_0x8124('0x37')][_0x8124('0x3c')]);_0x4edf6f[_0x8124('0x40')]=qs['filters'](_[_0x8124('0x3d')](_0x1c6d72['query'],_0x524e1f[_0x8124('0x32')]));if(_0x1c6d72[_0x8124('0x37')][_0x8124('0x3e')]){_0x4edf6f['where']=_[_0x8124('0x3f')](_0x4edf6f['where'],{'$or':_[_0x8124('0x2d')](_0x4edf6f[_0x8124('0x35')],function(_0x325fef){var _0x290ca3={};_0x290ca3[_0x325fef]={'$like':'%'+_0x1c6d72[_0x8124('0x37')][_0x8124('0x3e')]+'%'};return _0x290ca3;})});}_0x4edf6f=_['merge']({},_0x4edf6f,_0x1c6d72[_0x8124('0x47')]);return _0x4da122['getConditions'](_0x4edf6f);}})[_0x8124('0x26')](function(_0x3a9ece){if(_0x3a9ece){_0x4a82c8=_0x3a9ece[_0x8124('0x36')];if(!_0x1c6d72[_0x8124('0x37')]['hasOwnProperty']('nolimit')){_0x4edf6f[_0x8124('0x3a')]=qs[_0x8124('0x3a')](_0x1c6d72[_0x8124('0x37')]['limit']);_0x4edf6f[_0x8124('0x1d')]=qs['offset'](_0x1c6d72[_0x8124('0x37')][_0x8124('0x1d')]);}return _0x4da122[_0x8124('0x4f')](_0x4edf6f);}})[_0x8124('0x26')](function(_0x13c71e){if(_0x13c71e){return _0x13c71e?{'count':_0x4a82c8,'rows':_0x13c71e}:null;}})[_0x8124('0x26')](respondWithResult(_0x28c5cb,null))[_0x8124('0x49')](handleError(_0x28c5cb,null));};exports[_0x8124('0x51')]=function(_0x273d3c,_0x5403b5,_0x5dadfd){return db[_0x8124('0x52')][_0x8124('0x48')]({'where':{'id':_0x273d3c['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x5403b5,null))[_0x8124('0x26')](function(_0x574cc4){if(_0x574cc4){return _0x574cc4[_0x8124('0x51')](_0x273d3c[_0x8124('0x4b')][_0x8124('0x4e')],_[_0x8124('0x53')](_0x273d3c[_0x8124('0x4b')],[_0x8124('0x4e'),'id'])||{});}})[_0x8124('0x26')](respondWithResult(_0x5403b5,null))[_0x8124('0x49')](handleError(_0x5403b5,null));};exports['getActions']=function(_0x25b580,_0x355aa2,_0x202996){var _0xb03614={};var _0x41f1e4={};var _0x41f1a0;var _0x4f7599;return db['Automation'][_0x8124('0x50')]({'where':{'id':_0x25b580['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x355aa2,null))['then'](function(_0x13a140){if(_0x13a140){_0x41f1a0=_0x13a140;_0x41f1e4['model']=_[_0x8124('0x31')](db[_0x8124('0x52')][_0x8124('0x2e')]);_0x41f1e4[_0x8124('0x37')]=_[_0x8124('0x31')](_0x25b580[_0x8124('0x37')]);_0x41f1e4[_0x8124('0x32')]=_[_0x8124('0x33')](_0x41f1e4[_0x8124('0x34')],_0x41f1e4[_0x8124('0x37')]);_0xb03614[_0x8124('0x35')]=_[_0x8124('0x33')](_0x41f1e4['model'],qs[_0x8124('0x46')](_0x25b580[_0x8124('0x37')][_0x8124('0x46')]));_0xb03614['attributes']=_0xb03614[_0x8124('0x35')][_0x8124('0x36')]?_0xb03614[_0x8124('0x35')]:_0x41f1e4['model'];_0xb03614['order']=qs[_0x8124('0x3c')](_0x25b580[_0x8124('0x37')][_0x8124('0x3c')]);_0xb03614[_0x8124('0x40')]=qs['filters'](_[_0x8124('0x3d')](_0x25b580['query'],_0x41f1e4[_0x8124('0x32')]));if(_0x25b580[_0x8124('0x37')][_0x8124('0x3e')]){_0xb03614[_0x8124('0x40')]=_['merge'](_0xb03614['where'],{'$or':_[_0x8124('0x2d')](_0xb03614[_0x8124('0x35')],function(_0x26c669){var _0x1ea639={};_0x1ea639[_0x26c669]={'$like':'%'+_0x25b580[_0x8124('0x37')][_0x8124('0x3e')]+'%'};return _0x1ea639;})});}_0xb03614=_['merge']({},_0xb03614,_0x25b580['options']);return _0x41f1a0[_0x8124('0x54')](_0xb03614);}})[_0x8124('0x26')](function(_0x639570){if(_0x639570){_0x4f7599=_0x639570[_0x8124('0x36')];if(!_0x25b580['query'][_0x8124('0x38')](_0x8124('0x39'))){_0xb03614[_0x8124('0x3a')]=qs[_0x8124('0x3a')](_0x25b580['query']['limit']);_0xb03614[_0x8124('0x1d')]=qs[_0x8124('0x1d')](_0x25b580[_0x8124('0x37')][_0x8124('0x1d')]);}return _0x41f1a0[_0x8124('0x54')](_0xb03614);}})[_0x8124('0x26')](function(_0x137b9d){if(_0x137b9d){return _0x137b9d?{'count':_0x4f7599,'rows':_0x137b9d}:null;}})[_0x8124('0x26')](respondWithResult(_0x355aa2,null))[_0x8124('0x49')](handleError(_0x355aa2,null));};
\ No newline at end of file
+var _0x5442=['to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','Automation','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','rawAttributes','length','find','create','body','update','addConditions','Condition','ids','getConditions','findOne','Action','omit','getActions','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x5442,0xf3));var _0x2544=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x5442[_0x5c7a85];return _0x35290f;};'use strict';var emlformat=require(_0x2544('0x0'));var rimraf=require(_0x2544('0x1'));var zipdir=require(_0x2544('0x2'));var jsonpatch=require(_0x2544('0x3'));var rp=require(_0x2544('0x4'));var moment=require(_0x2544('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2544('0x6'));var util=require(_0x2544('0x7'));var path=require(_0x2544('0x8'));var sox=require('sox');var csv=require(_0x2544('0x9'));var ejs=require(_0x2544('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2544('0xb'));var crypto=require(_0x2544('0xc'));var jsforce=require(_0x2544('0xd'));var deskjs=require(_0x2544('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2544('0xf'));var Redis=require('ioredis');var authService=require(_0x2544('0x10'));var qs=require(_0x2544('0x11'));var as=require(_0x2544('0x12'));var hardwareService=require(_0x2544('0x13'));var logger=require(_0x2544('0x14'))(_0x2544('0x15'));var utils=require(_0x2544('0x16'));var config=require(_0x2544('0x17'));var licenseUtil=require(_0x2544('0x18'));var db=require(_0x2544('0x19'))['db'];function respondWithStatusCode(_0x303a76,_0x472155){_0x472155=_0x472155||0xcc;return function(_0x14b1a9){if(_0x14b1a9){return _0x303a76[_0x2544('0x1a')](_0x472155);}return _0x303a76['status'](_0x472155)['end']();};}function respondWithResult(_0x3bdb47,_0x451c11){_0x451c11=_0x451c11||0xc8;return function(_0x401e97){if(_0x401e97){return _0x3bdb47[_0x2544('0x1b')](_0x451c11)[_0x2544('0x1c')](_0x401e97);}};}function respondWithFilteredResult(_0x5e5401,_0xca1d77){return function(_0x102a03){if(_0x102a03){var _0x4d934d=typeof _0xca1d77[_0x2544('0x1d')]===_0x2544('0x1e')&&typeof _0xca1d77[_0x2544('0x1f')]===_0x2544('0x1e');var _0xc19ad8=_0x102a03[_0x2544('0x20')];var _0x2870eb=_0x4d934d?0x0:_0xca1d77['offset'];var _0x96cfac=_0x4d934d?_0x102a03[_0x2544('0x20')]:_0xca1d77[_0x2544('0x1d')]+_0xca1d77['limit'];var _0x1e9110;if(_0x96cfac>=_0xc19ad8){_0x96cfac=_0xc19ad8;_0x1e9110=0xc8;}else{_0x1e9110=0xce;}_0x5e5401[_0x2544('0x1b')](_0x1e9110);return _0x5e5401['set'](_0x2544('0x21'),_0x2870eb+'-'+_0x96cfac+'/'+_0xc19ad8)[_0x2544('0x1c')](_0x102a03);}return null;};}function patchUpdates(_0x15fa11){return function(_0x1366d2){try{jsonpatch[_0x2544('0x22')](_0x1366d2,_0x15fa11,!![]);}catch(_0x2be4f8){return BPromise[_0x2544('0x23')](_0x2be4f8);}return _0x1366d2[_0x2544('0x24')]();};}function saveUpdates(_0x3928a7,_0xc0f864){return function(_0x34b1a1){if(_0x34b1a1){return _0x34b1a1['update'](_0x3928a7)[_0x2544('0x25')](function(_0x2b3d7d){return _0x2b3d7d;});}return null;};}function removeEntity(_0x14dfb2,_0x36156d){return function(_0x2dc649){if(_0x2dc649){return _0x2dc649[_0x2544('0x26')]()[_0x2544('0x25')](function(){_0x14dfb2[_0x2544('0x1b')](0xcc)[_0x2544('0x27')]();});}};}function handleEntityNotFound(_0x487b18,_0x3c17ca){return function(_0x36d6ec){if(!_0x36d6ec){_0x487b18[_0x2544('0x1a')](0x194);}return _0x36d6ec;};}function handleError(_0xeec4e6,_0x3d26a6){_0x3d26a6=_0x3d26a6||0x1f4;return function(_0x53ab39){logger['error'](_0x53ab39[_0x2544('0x28')]);if(_0x53ab39[_0x2544('0x29')]){delete _0x53ab39[_0x2544('0x29')];}_0xeec4e6[_0x2544('0x1b')](_0x3d26a6)[_0x2544('0x2a')](_0x53ab39);};}exports[_0x2544('0x2b')]=function(_0x1d289e,_0x3f55ab){var _0x42252={},_0x2029c0={},_0x427ed4={'count':0x0,'rows':[]};var _0x511d6c=_[_0x2544('0x2c')](db[_0x2544('0x2d')]['rawAttributes'],function(_0x401b84){return{'name':_0x401b84['fieldName'],'type':_0x401b84[_0x2544('0x2e')][_0x2544('0x2f')]};});_0x2029c0[_0x2544('0x30')]=_[_0x2544('0x2c')](_0x511d6c,'name');_0x2029c0[_0x2544('0x31')]=_['keys'](_0x1d289e['query']);_0x2029c0[_0x2544('0x32')]=_[_0x2544('0x33')](_0x2029c0[_0x2544('0x30')],_0x2029c0['query']);_0x42252[_0x2544('0x34')]=_[_0x2544('0x33')](_0x2029c0[_0x2544('0x30')],qs['fields'](_0x1d289e['query'][_0x2544('0x35')]));_0x42252[_0x2544('0x34')]=_0x42252[_0x2544('0x34')]['length']?_0x42252[_0x2544('0x34')]:_0x2029c0[_0x2544('0x30')];if(!_0x1d289e['query'][_0x2544('0x36')](_0x2544('0x37'))){_0x42252[_0x2544('0x1f')]=qs['limit'](_0x1d289e['query'][_0x2544('0x1f')]);_0x42252[_0x2544('0x1d')]=qs[_0x2544('0x1d')](_0x1d289e[_0x2544('0x31')][_0x2544('0x1d')]);}_0x42252[_0x2544('0x38')]=qs['sort'](_0x1d289e['query']['sort']);_0x42252['where']=qs[_0x2544('0x32')](_[_0x2544('0x39')](_0x1d289e['query'],_0x2029c0[_0x2544('0x32')]),_0x511d6c);if(_0x1d289e[_0x2544('0x31')][_0x2544('0x3a')]){_0x42252[_0x2544('0x3b')]=_[_0x2544('0x3c')](_0x42252['where'],{'$or':_['map'](_0x511d6c,function(_0x4da934){if(_0x4da934[_0x2544('0x2e')]!==_0x2544('0x3d')){var _0x50bca3={};_0x50bca3[_0x4da934[_0x2544('0x29')]]={'$like':'%'+_0x1d289e[_0x2544('0x31')][_0x2544('0x3a')]+'%'};return _0x50bca3;}})});}_0x42252=_['merge']({},_0x42252,_0x1d289e[_0x2544('0x3e')]);var _0x32fedc={'where':_0x42252['where']};return db['Automation'][_0x2544('0x20')](_0x32fedc)[_0x2544('0x25')](function(_0x19951e){_0x427ed4[_0x2544('0x20')]=_0x19951e;if(_0x1d289e[_0x2544('0x31')][_0x2544('0x3f')]){_0x42252[_0x2544('0x40')]=[{'all':!![]}];}return db[_0x2544('0x2d')]['findAll'](_0x42252);})[_0x2544('0x25')](function(_0x276618){_0x427ed4['rows']=_0x276618;return _0x427ed4;})['then'](respondWithFilteredResult(_0x3f55ab,_0x42252))[_0x2544('0x41')](handleError(_0x3f55ab,null));};exports[_0x2544('0x42')]=function(_0x2a2a4d,_0x551e93){var _0x2c47c5={'raw':![],'where':{'id':_0x2a2a4d[_0x2544('0x43')]['id']}},_0x6df698={};_0x6df698[_0x2544('0x30')]=_[_0x2544('0x44')](db[_0x2544('0x2d')][_0x2544('0x45')]);_0x6df698[_0x2544('0x31')]=_[_0x2544('0x44')](_0x2a2a4d[_0x2544('0x31')]);_0x6df698['filters']=_['intersection'](_0x6df698[_0x2544('0x30')],_0x6df698[_0x2544('0x31')]);_0x2c47c5[_0x2544('0x34')]=_[_0x2544('0x33')](_0x6df698[_0x2544('0x30')],qs['fields'](_0x2a2a4d[_0x2544('0x31')][_0x2544('0x35')]));_0x2c47c5['attributes']=_0x2c47c5['attributes'][_0x2544('0x46')]?_0x2c47c5['attributes']:_0x6df698[_0x2544('0x30')];if(_0x2a2a4d[_0x2544('0x31')][_0x2544('0x3f')]){_0x2c47c5[_0x2544('0x40')]=[{'all':!![]}];}_0x2c47c5=_[_0x2544('0x3c')]({},_0x2c47c5,_0x2a2a4d[_0x2544('0x3e')]);return db[_0x2544('0x2d')][_0x2544('0x47')](_0x2c47c5)[_0x2544('0x25')](handleEntityNotFound(_0x551e93,null))[_0x2544('0x25')](respondWithResult(_0x551e93,null))['catch'](handleError(_0x551e93,null));};exports[_0x2544('0x48')]=function(_0x4e8673,_0x1491ce){return db['Automation'][_0x2544('0x48')](_0x4e8673[_0x2544('0x49')],{})[_0x2544('0x25')](respondWithResult(_0x1491ce,0xc9))[_0x2544('0x41')](handleError(_0x1491ce,null));};exports[_0x2544('0x4a')]=function(_0x493331,_0x30d8d2){if(_0x493331['body']['id']){delete _0x493331[_0x2544('0x49')]['id'];}return db[_0x2544('0x2d')][_0x2544('0x47')]({'where':{'id':_0x493331[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x30d8d2,null))[_0x2544('0x25')](saveUpdates(_0x493331['body'],null))['then'](respondWithResult(_0x30d8d2,null))[_0x2544('0x41')](handleError(_0x30d8d2,null));};exports[_0x2544('0x26')]=function(_0x186b0f,_0x2aeac7){return db['Automation'][_0x2544('0x47')]({'where':{'id':_0x186b0f[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x2aeac7,null))['then'](removeEntity(_0x2aeac7,null))[_0x2544('0x41')](handleError(_0x2aeac7,null));};exports[_0x2544('0x4b')]=function(_0x5b4de5,_0x3701b2,_0x19dfa8){return db[_0x2544('0x4c')][_0x2544('0x47')]({'where':{'id':_0x5b4de5[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x3701b2,null))['then'](function(_0x419720){if(_0x419720){return _0x419720['addConditions'](_0x5b4de5[_0x2544('0x49')][_0x2544('0x4d')],_['omit'](_0x5b4de5['body'],[_0x2544('0x4d'),'id'])||{});}})[_0x2544('0x25')](respondWithResult(_0x3701b2,null))[_0x2544('0x41')](handleError(_0x3701b2,null));};exports[_0x2544('0x4e')]=function(_0x127fd3,_0x241089,_0x2c4149){var _0x46b820={};var _0x39d5d6={};var _0x2007ee;var _0x781233;return db[_0x2544('0x2d')][_0x2544('0x4f')]({'where':{'id':_0x127fd3['params']['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x241089,null))['then'](function(_0x4f0474){if(_0x4f0474){_0x2007ee=_0x4f0474;_0x39d5d6[_0x2544('0x30')]=_[_0x2544('0x44')](db[_0x2544('0x4c')][_0x2544('0x45')]);_0x39d5d6[_0x2544('0x31')]=_[_0x2544('0x44')](_0x127fd3['query']);_0x39d5d6[_0x2544('0x32')]=_['intersection'](_0x39d5d6[_0x2544('0x30')],_0x39d5d6['query']);_0x46b820[_0x2544('0x34')]=_[_0x2544('0x33')](_0x39d5d6[_0x2544('0x30')],qs['fields'](_0x127fd3[_0x2544('0x31')]['fields']));_0x46b820['attributes']=_0x46b820['attributes']['length']?_0x46b820[_0x2544('0x34')]:_0x39d5d6['model'];_0x46b820['order']=qs['sort'](_0x127fd3[_0x2544('0x31')]['sort']);_0x46b820[_0x2544('0x3b')]=qs['filters'](_[_0x2544('0x39')](_0x127fd3[_0x2544('0x31')],_0x39d5d6[_0x2544('0x32')]));if(_0x127fd3[_0x2544('0x31')][_0x2544('0x3a')]){_0x46b820[_0x2544('0x3b')]=_[_0x2544('0x3c')](_0x46b820[_0x2544('0x3b')],{'$or':_[_0x2544('0x2c')](_0x46b820['attributes'],function(_0x3d98f9){var _0xa8f35d={};_0xa8f35d[_0x3d98f9]={'$like':'%'+_0x127fd3['query']['filter']+'%'};return _0xa8f35d;})});}_0x46b820=_[_0x2544('0x3c')]({},_0x46b820,_0x127fd3['options']);return _0x2007ee[_0x2544('0x4e')](_0x46b820);}})[_0x2544('0x25')](function(_0x5f4b42){if(_0x5f4b42){_0x781233=_0x5f4b42[_0x2544('0x46')];if(!_0x127fd3[_0x2544('0x31')][_0x2544('0x36')](_0x2544('0x37'))){_0x46b820[_0x2544('0x1f')]=qs[_0x2544('0x1f')](_0x127fd3[_0x2544('0x31')][_0x2544('0x1f')]);_0x46b820[_0x2544('0x1d')]=qs[_0x2544('0x1d')](_0x127fd3[_0x2544('0x31')][_0x2544('0x1d')]);}return _0x2007ee[_0x2544('0x4e')](_0x46b820);}})['then'](function(_0x40d37b){if(_0x40d37b){return _0x40d37b?{'count':_0x781233,'rows':_0x40d37b}:null;}})['then'](respondWithResult(_0x241089,null))[_0x2544('0x41')](handleError(_0x241089,null));};exports['addActions']=function(_0x40a622,_0x44cd33,_0x4c4d7a){return db[_0x2544('0x50')][_0x2544('0x47')]({'where':{'id':_0x40a622[_0x2544('0x43')]['id']}})['then'](handleEntityNotFound(_0x44cd33,null))[_0x2544('0x25')](function(_0x2d60cf){if(_0x2d60cf){return _0x2d60cf['addActions'](_0x40a622[_0x2544('0x49')][_0x2544('0x4d')],_[_0x2544('0x51')](_0x40a622[_0x2544('0x49')],[_0x2544('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x44cd33,null))[_0x2544('0x41')](handleError(_0x44cd33,null));};exports[_0x2544('0x52')]=function(_0x2dbaef,_0x425275,_0x175247){var _0x1befe4={};var _0x463295={};var _0x585fc9;var _0x17cb78;return db[_0x2544('0x2d')]['findOne']({'where':{'id':_0x2dbaef[_0x2544('0x43')]['id']}})[_0x2544('0x25')](handleEntityNotFound(_0x425275,null))[_0x2544('0x25')](function(_0x448f26){if(_0x448f26){_0x585fc9=_0x448f26;_0x463295[_0x2544('0x30')]=_[_0x2544('0x44')](db[_0x2544('0x50')][_0x2544('0x45')]);_0x463295[_0x2544('0x31')]=_[_0x2544('0x44')](_0x2dbaef[_0x2544('0x31')]);_0x463295['filters']=_[_0x2544('0x33')](_0x463295['model'],_0x463295['query']);_0x1befe4['attributes']=_[_0x2544('0x33')](_0x463295[_0x2544('0x30')],qs[_0x2544('0x35')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x35')]));_0x1befe4['attributes']=_0x1befe4[_0x2544('0x34')][_0x2544('0x46')]?_0x1befe4[_0x2544('0x34')]:_0x463295[_0x2544('0x30')];_0x1befe4[_0x2544('0x38')]=qs[_0x2544('0x53')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x53')]);_0x1befe4[_0x2544('0x3b')]=qs[_0x2544('0x32')](_[_0x2544('0x39')](_0x2dbaef[_0x2544('0x31')],_0x463295[_0x2544('0x32')]));if(_0x2dbaef['query'][_0x2544('0x3a')]){_0x1befe4[_0x2544('0x3b')]=_[_0x2544('0x3c')](_0x1befe4['where'],{'$or':_[_0x2544('0x2c')](_0x1befe4[_0x2544('0x34')],function(_0x522f0f){var _0x5532c4={};_0x5532c4[_0x522f0f]={'$like':'%'+_0x2dbaef['query'][_0x2544('0x3a')]+'%'};return _0x5532c4;})});}_0x1befe4=_[_0x2544('0x3c')]({},_0x1befe4,_0x2dbaef[_0x2544('0x3e')]);return _0x585fc9[_0x2544('0x52')](_0x1befe4);}})[_0x2544('0x25')](function(_0x4f9a45){if(_0x4f9a45){_0x17cb78=_0x4f9a45[_0x2544('0x46')];if(!_0x2dbaef[_0x2544('0x31')]['hasOwnProperty']('nolimit')){_0x1befe4['limit']=qs[_0x2544('0x1f')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x1f')]);_0x1befe4[_0x2544('0x1d')]=qs[_0x2544('0x1d')](_0x2dbaef[_0x2544('0x31')][_0x2544('0x1d')]);}return _0x585fc9[_0x2544('0x52')](_0x1befe4);}})[_0x2544('0x25')](function(_0x2b6616){if(_0x2b6616){return _0x2b6616?{'count':_0x17cb78,'rows':_0x2b6616}:null;}})[_0x2544('0x25')](respondWithResult(_0x425275,null))['catch'](handleError(_0x425275,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 40d6118..763943d 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 _0xb270=['../../config/logger','api','moment','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0xb270,0x167));var _0x0b27=function(_0x2b0690,_0x4f742f){_0x2b0690=_0x2b0690-0x0;var _0x82be1=_0xb270[_0x2b0690];return _0x82be1;};'use strict';var _=require('lodash');var util=require(_0x0b27('0x0'));var logger=require(_0x0b27('0x1'))(_0x0b27('0x2'));var moment=require(_0x0b27('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b27('0x4'));var rimraf=require(_0x0b27('0x5'));var config=require(_0x0b27('0x6'));var attributes=require(_0x0b27('0x7'));module[_0x0b27('0x8')]=function(_0x2cab45,_0x436017){return _0x2cab45[_0x0b27('0x9')](_0x0b27('0xa'),attributes,{'tableName':_0x0b27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x292a=['./automation.attributes','exports','define','Automation','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x492547,_0x4cd3bc){var _0x43c08a=function(_0xbba0c5){while(--_0xbba0c5){_0x492547['push'](_0x492547['shift']());}};_0x43c08a(++_0x4cd3bc);}(_0x292a,0x68));var _0xa292=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x292a[_0xf51c06];return _0x1d5420;};'use strict';var _=require('lodash');var util=require(_0xa292('0x0'));var logger=require(_0xa292('0x1'))(_0xa292('0x2'));var moment=require('moment');var BPromise=require(_0xa292('0x3'));var rp=require(_0xa292('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa292('0x5'));var config=require('../../config/environment');var attributes=require(_0xa292('0x6'));module[_0xa292('0x7')]=function(_0x4f8de3,_0x242c49){return _0x4f8de3[_0xa292('0x8')](_0xa292('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index dfbab14..41a993d 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 _0x4959=['../../config/logger','rpc','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4959,0x9b));var _0x9495=function(_0x3156c9,_0x3ee8b8){_0x3156c9=_0x3156c9-0x0;var _0x486742=_0x4959[_0x3156c9];return _0x486742;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9495('0x0'));var BPromise=require(_0x9495('0x1'));var rs=require(_0x9495('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9495('0x3'))['db'];var utils=require(_0x9495('0x4'));var logger=require(_0x9495('0x5'))(_0x9495('0x6'));var config=require('../../config/environment');var jayson=require(_0x9495('0x7'));var client=jayson[_0x9495('0x8')][_0x9495('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f4e7,_0xd77231,_0x34744d){return new BPromise(function(_0x2a4754,_0x19f08c){return client[_0x9495('0xa')](_0x21f4e7,_0x34744d)[_0x9495('0xb')](function(_0x6b1466){logger['info'](_0x9495('0xc'),_0xd77231,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xd77231,'request\x20sent',JSON[_0x9495('0xd')](_0x6b1466));if(_0x6b1466[_0x9495('0xe')]){if(_0x6b1466[_0x9495('0xe')][_0x9495('0xf')]===0x1f4){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x19f08c(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x2a4754(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}else{logger['info'](_0x9495('0xc'),_0xd77231,_0x9495('0x11'));_0x2a4754(_0x6b1466[_0x9495('0x12')][_0x9495('0x10')]);}})[_0x9495('0x13')](function(_0x4c1d9d){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x4c1d9d);_0x19f08c(_0x4c1d9d);});});}
\ No newline at end of file
+var _0x5a13=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','stringify','code','message','error'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x5a13,0x145));var _0x35a1=function(_0x11ba2d,_0xb2a851){_0x11ba2d=_0x11ba2d-0x0;var _0x5c3efd=_0x5a13[_0x11ba2d];return _0x5c3efd;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index af5dfcc..8a2b500 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 _0xb205=['Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','post','create','addActions','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x28e459,_0x1a066b){var _0x5ccc9e=function(_0x36e31a){while(--_0x36e31a){_0x28e459['push'](_0x28e459['shift']());}};_0x5ccc9e(++_0x1a066b);}(_0xb205,0x156));var _0x5b20=function(_0x43a129,_0x17d8ab){_0x43a129=_0x43a129-0x0;var _0x314353=_0xb205[_0x43a129];return _0x314353;};'use strict';var multer=require(_0x5b20('0x0'));var util=require('util');var path=require(_0x5b20('0x1'));var timeout=require(_0x5b20('0x2'));var express=require('express');var router=express[_0x5b20('0x3')]();var fs_extra=require(_0x5b20('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5b20('0x5'));var config=require(_0x5b20('0x6'));var controller=require(_0x5b20('0x7'));router[_0x5b20('0x8')]('/',auth[_0x5b20('0x9')](),controller[_0x5b20('0xa')]);router[_0x5b20('0x8')](_0x5b20('0xb'),auth[_0x5b20('0x9')](),controller[_0x5b20('0xc')]);router[_0x5b20('0x8')](_0x5b20('0xd'),auth[_0x5b20('0x9')](),controller['getConditions']);router[_0x5b20('0x8')](_0x5b20('0xe'),auth[_0x5b20('0x9')](),controller[_0x5b20('0xf')]);router[_0x5b20('0x10')]('/',auth[_0x5b20('0x9')](),controller[_0x5b20('0x11')]);router['post']('/:id/conditions',auth[_0x5b20('0x9')](),controller['addConditions']);router[_0x5b20('0x10')](_0x5b20('0xe'),auth[_0x5b20('0x9')](),controller[_0x5b20('0x12')]);router['put'](_0x5b20('0xb'),auth[_0x5b20('0x9')](),controller[_0x5b20('0x13')]);router[_0x5b20('0x14')](_0x5b20('0xb'),auth['isAuthenticated'](),controller[_0x5b20('0x15')]);module[_0x5b20('0x16')]=router;
\ No newline at end of file
+var _0x0cd6=['/:id/conditions','getConditions','/:id/actions','post','addConditions','addActions','/:id','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./automation.controller','get','isAuthenticated','show'];(function(_0x3c8b42,_0x3429fa){var _0x6f8135=function(_0x5e4b40){while(--_0x5e4b40){_0x3c8b42['push'](_0x3c8b42['shift']());}};_0x6f8135(++_0x3429fa);}(_0x0cd6,0x113));var _0x60cd=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x0cd6[_0x26f1b2];return _0x1624a4;};'use strict';var multer=require(_0x60cd('0x0'));var util=require(_0x60cd('0x1'));var path=require('path');var timeout=require(_0x60cd('0x2'));var express=require(_0x60cd('0x3'));var router=express['Router']();var fs_extra=require(_0x60cd('0x4'));var auth=require(_0x60cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60cd('0x6'));router[_0x60cd('0x7')]('/',auth[_0x60cd('0x8')](),controller['index']);router[_0x60cd('0x7')]('/:id',auth[_0x60cd('0x8')](),controller[_0x60cd('0x9')]);router[_0x60cd('0x7')](_0x60cd('0xa'),auth[_0x60cd('0x8')](),controller[_0x60cd('0xb')]);router[_0x60cd('0x7')](_0x60cd('0xc'),auth[_0x60cd('0x8')](),controller['getActions']);router[_0x60cd('0xd')]('/',auth[_0x60cd('0x8')](),controller['create']);router[_0x60cd('0xd')]('/:id/conditions',auth[_0x60cd('0x8')](),controller[_0x60cd('0xe')]);router['post'](_0x60cd('0xc'),auth[_0x60cd('0x8')](),controller[_0x60cd('0xf')]);router['put'](_0x60cd('0x10'),auth[_0x60cd('0x8')](),controller['update']);router[_0x60cd('0x11')]('/:id',auth[_0x60cd('0x8')](),controller[_0x60cd('0x12')]);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 66ce21e..1ebdea5 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 _0x0f46=['name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING'];(function(_0x53d93e,_0x371336){var _0x11b182=function(_0x3e87fe){while(--_0x3e87fe){_0x53d93e['push'](_0x53d93e['shift']());}};_0x11b182(++_0x371336);}(_0x0f46,0x1a1));var _0x60f4=function(_0x812db,_0x2e8c4d){_0x812db=_0x812db-0x0;var _0xbff811=_0x0f46[_0x812db];return _0xbff811;};'use strict';var Sequelize=require(_0x60f4('0x0'));module[_0x60f4('0x1')]={'name':{'type':Sequelize[_0x60f4('0x2')],'unique':_0x60f4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x60f4('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x60f4('0x5')],'defaultValue':0x0,'comment':_0x60f4('0x6')},'limitCalls':{'type':Sequelize[_0x60f4('0x7')](0x4)[_0x60f4('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x60f4('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x60f4('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x60f4('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'comment':_0x60f4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x60f4('0xe')},'dialTimezone':{'type':Sequelize[_0x60f4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x60f4('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x60f4('0xf')](_0x60f4('0x10'),'never','onlyIfOpen'),'defaultValue':_0x60f4('0x10')},'dialAMDActive':{'type':Sequelize[_0x60f4('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x60f4('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x60f4('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x60f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x60f4('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x60f4('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x60f4('0x7')](0x9)[_0x60f4('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x60f4('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x60f4('0x7')](0x9)[_0x60f4('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x60f4('0x7')](0x9)[_0x60f4('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x60f4('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x60f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x60f4('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x60f4('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x60f4('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x60f4('0xf')](_0x60f4('0x17'),_0x60f4('0x18')),'defaultValue':_0x60f4('0x17')},'dialPrefix':{'type':Sequelize[_0x60f4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x60f4('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x60f4('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x60f4('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x60f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x60f4('0x7')](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x60f4('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x60f4('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x60f4('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x6bfc=['INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','STRING'];(function(_0x14b4b2,_0x42aed0){var _0x2710fd=function(_0x2bb074){while(--_0x2bb074){_0x14b4b2['push'](_0x14b4b2['shift']());}};_0x2710fd(++_0x42aed0);}(_0x6bfc,0x1da));var _0xc6bf=function(_0x39ddf1,_0x4ddf8a){_0x39ddf1=_0x39ddf1-0x0;var _0xe30e04=_0x6bfc[_0x39ddf1];return _0xe30e04;};'use strict';var Sequelize=require(_0xc6bf('0x0'));module[_0xc6bf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xc6bf('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc6bf('0x3')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xc6bf('0x4')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc6bf('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc6bf('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc6bf('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xc6bf('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'comment':_0xc6bf('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc6bf('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc6bf('0x6')],'defaultValue':_0xc6bf('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xc6bf('0xf')](_0xc6bf('0x10'),_0xc6bf('0x11'),'onlyIfOpen'),'defaultValue':_0xc6bf('0x10')},'dialAMDActive':{'type':Sequelize[_0xc6bf('0x12')],'defaultValue':0x0,'comment':_0xc6bf('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc6bf('0x4')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc6bf('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc6bf('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc6bf('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc6bf('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc6bf('0x7')](0x9)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc6bf('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc6bf('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc6bf('0xf')](_0xc6bf('0x19'),_0xc6bf('0x1a')),'defaultValue':_0xc6bf('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc6bf('0x4')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc6bf('0x1b')},'dialCutDigit':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc6bf('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xc6bf('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc6bf('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc6bf('0x4')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc6bf('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc6bf('0x7')](0x5)[_0xc6bf('0x4')],'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 3e01ead..522e686 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 _0x0f92=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','ListId\x20=\x20?','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','IvrCampaigns','UserProfileResource','name','send','index','Campaign','fieldName','type'];(function(_0xd94f9c,_0x12791e){var _0x2e867a=function(_0x59d098){while(--_0x59d098){_0xd94f9c['push'](_0xd94f9c['shift']());}};_0x2e867a(++_0x12791e);}(_0x0f92,0xfd));var _0x20f9=function(_0x2d733c,_0x5893ce){_0x2d733c=_0x2d733c-0x0;var _0x10582d=_0x0f92[_0x2d733c];return _0x10582d;};'use strict';var emlformat=require(_0x20f9('0x0'));var rimraf=require(_0x20f9('0x1'));var zipdir=require(_0x20f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20f9('0x3'));var moment=require(_0x20f9('0x4'));var BPromise=require(_0x20f9('0x5'));var Mustache=require(_0x20f9('0x6'));var util=require(_0x20f9('0x7'));var path=require(_0x20f9('0x8'));var sox=require(_0x20f9('0x9'));var csv=require(_0x20f9('0xa'));var ejs=require(_0x20f9('0xb'));var fs=require('fs');var fs_extra=require(_0x20f9('0xc'));var _=require(_0x20f9('0xd'));var squel=require('squel');var crypto=require(_0x20f9('0xe'));var jsforce=require(_0x20f9('0xf'));var deskjs=require(_0x20f9('0x10'));var toCsv=require(_0x20f9('0xa'));var querystring=require(_0x20f9('0x11'));var Papa=require('papaparse');var Redis=require(_0x20f9('0x12'));var authService=require(_0x20f9('0x13'));var qs=require(_0x20f9('0x14'));var as=require(_0x20f9('0x15'));var hardwareService=require(_0x20f9('0x16'));var logger=require('../../config/logger')(_0x20f9('0x17'));var utils=require(_0x20f9('0x18'));var config=require(_0x20f9('0x19'));var licenseUtil=require(_0x20f9('0x1a'));var db=require(_0x20f9('0x1b'))['db'];function respondWithStatusCode(_0x44a279,_0x15cc0d){_0x15cc0d=_0x15cc0d||0xcc;return function(_0x128cbf){if(_0x128cbf){return _0x44a279[_0x20f9('0x1c')](_0x15cc0d);}return _0x44a279[_0x20f9('0x1d')](_0x15cc0d)[_0x20f9('0x1e')]();};}function respondWithResult(_0x510cdf,_0x57b2ba){_0x57b2ba=_0x57b2ba||0xc8;return function(_0x56091c){if(_0x56091c){return _0x510cdf['status'](_0x57b2ba)[_0x20f9('0x1f')](_0x56091c);}};}function respondWithFilteredResult(_0x2a8e47,_0x50b9d0){return function(_0x520dd6){if(_0x520dd6){var _0x342fa8=typeof _0x50b9d0[_0x20f9('0x20')]==='undefined'&&typeof _0x50b9d0[_0x20f9('0x21')]==='undefined';var _0x42a7b0=_0x520dd6['count'];var _0x47b815=_0x342fa8?0x0:_0x50b9d0[_0x20f9('0x20')];var _0x55bf75=_0x342fa8?_0x520dd6[_0x20f9('0x22')]:_0x50b9d0[_0x20f9('0x20')]+_0x50b9d0[_0x20f9('0x21')];var _0x1ba7ef;if(_0x55bf75>=_0x42a7b0){_0x55bf75=_0x42a7b0;_0x1ba7ef=0xc8;}else{_0x1ba7ef=0xce;}_0x2a8e47[_0x20f9('0x1d')](_0x1ba7ef);return _0x2a8e47[_0x20f9('0x23')](_0x20f9('0x24'),_0x47b815+'-'+_0x55bf75+'/'+_0x42a7b0)[_0x20f9('0x1f')](_0x520dd6);}return null;};}function patchUpdates(_0x1ab050){return function(_0x7bece3){try{jsonpatch[_0x20f9('0x25')](_0x7bece3,_0x1ab050,!![]);}catch(_0x3e3768){return BPromise[_0x20f9('0x26')](_0x3e3768);}return _0x7bece3['save']();};}function saveUpdates(_0x39fd68,_0x35f54d){return function(_0x555b1a){if(_0x555b1a){return _0x555b1a[_0x20f9('0x27')](_0x39fd68)['then'](function(_0x4497d4){return _0x4497d4;});}return null;};}function removeEntity(_0x525aaa,_0x41cb76){return function(_0x51c604){if(_0x51c604){return _0x51c604[_0x20f9('0x28')]()[_0x20f9('0x29')](function(){var _0x576539=_0x51c604[_0x20f9('0x2a')]({'plain':!![]});var _0x2d466a=_0x20f9('0x2b');return db[_0x20f9('0x2c')]['destroy']({'where':{'type':_0x2d466a,'resourceId':_0x576539['id']}})[_0x20f9('0x29')](function(){return _0x51c604;});})['then'](function(){_0x525aaa['status'](0xcc)[_0x20f9('0x1e')]();});}};}function handleEntityNotFound(_0x180045,_0x3b3379){return function(_0x3b94e3){if(!_0x3b94e3){_0x180045[_0x20f9('0x1c')](0x194);}return _0x3b94e3;};}function handleError(_0x190cc8,_0x64e240){_0x64e240=_0x64e240||0x1f4;return function(_0x21bf24){logger['error'](_0x21bf24['stack']);if(_0x21bf24[_0x20f9('0x2d')]){delete _0x21bf24['name'];}_0x190cc8[_0x20f9('0x1d')](_0x64e240)[_0x20f9('0x2e')](_0x21bf24);};}exports[_0x20f9('0x2f')]=function(_0x39bfde,_0x1d8259){var _0x56eb57={},_0x3d4bf7={},_0x85a502={'count':0x0,'rows':[]};var _0x511acf=_['map'](db[_0x20f9('0x30')]['rawAttributes'],function(_0x460c78){return{'name':_0x460c78[_0x20f9('0x31')],'type':_0x460c78[_0x20f9('0x32')]['key']};});_0x3d4bf7[_0x20f9('0x33')]=_['map'](_0x511acf,_0x20f9('0x2d'));_0x3d4bf7[_0x20f9('0x34')]=_['keys'](_0x39bfde['query']);_0x3d4bf7[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x3d4bf7[_0x20f9('0x33')],_0x3d4bf7['query']);_0x56eb57[_0x20f9('0x37')]=_[_0x20f9('0x36')](_0x3d4bf7[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x39bfde['query'][_0x20f9('0x38')]));_0x56eb57[_0x20f9('0x37')]=_0x56eb57[_0x20f9('0x37')][_0x20f9('0x39')]?_0x56eb57[_0x20f9('0x37')]:_0x3d4bf7[_0x20f9('0x33')];if(!_0x39bfde[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x56eb57[_0x20f9('0x21')]=qs['limit'](_0x39bfde[_0x20f9('0x34')][_0x20f9('0x21')]);_0x56eb57['offset']=qs[_0x20f9('0x20')](_0x39bfde['query'][_0x20f9('0x20')]);}_0x56eb57[_0x20f9('0x3c')]=qs[_0x20f9('0x3d')](_0x39bfde['query']['sort']);_0x56eb57[_0x20f9('0x3e')]=qs[_0x20f9('0x35')](_[_0x20f9('0x3f')](_0x39bfde[_0x20f9('0x34')],_0x3d4bf7[_0x20f9('0x35')]),_0x511acf);if(_0x39bfde[_0x20f9('0x34')][_0x20f9('0x40')]){_0x56eb57['where']=_['merge'](_0x56eb57[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x511acf,function(_0x207369){if(_0x207369[_0x20f9('0x32')]!==_0x20f9('0x42')){var _0x3979e4={};_0x3979e4[_0x207369[_0x20f9('0x2d')]]={'$like':'%'+_0x39bfde[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x3979e4;}})});}_0x56eb57=_[_0x20f9('0x43')]({},_0x56eb57,_0x39bfde[_0x20f9('0x44')]);var _0x57d30b={'where':_0x56eb57['where']};return db[_0x20f9('0x30')][_0x20f9('0x22')](_0x57d30b)['then'](function(_0x1e49fe){_0x85a502['count']=_0x1e49fe;if(_0x39bfde[_0x20f9('0x34')][_0x20f9('0x45')]){_0x56eb57[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x30')][_0x20f9('0x47')](_0x56eb57);})['then'](function(_0x3693b7){_0x85a502[_0x20f9('0x48')]=_0x3693b7;return _0x85a502;})[_0x20f9('0x29')](respondWithFilteredResult(_0x1d8259,_0x56eb57))[_0x20f9('0x49')](handleError(_0x1d8259,null));};exports[_0x20f9('0x4a')]=function(_0x29ff1f,_0x11e65f){var _0x1c2fdd={'raw':![],'where':{'id':_0x29ff1f['params']['id']}},_0x3d97b1={};_0x3d97b1[_0x20f9('0x33')]=_['keys'](db[_0x20f9('0x30')][_0x20f9('0x4b')]);_0x3d97b1[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x29ff1f[_0x20f9('0x34')]);_0x3d97b1[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x3d97b1['model'],_0x3d97b1[_0x20f9('0x34')]);_0x1c2fdd[_0x20f9('0x37')]=_['intersection'](_0x3d97b1['model'],qs[_0x20f9('0x38')](_0x29ff1f[_0x20f9('0x34')][_0x20f9('0x38')]));_0x1c2fdd[_0x20f9('0x37')]=_0x1c2fdd['attributes'][_0x20f9('0x39')]?_0x1c2fdd[_0x20f9('0x37')]:_0x3d97b1['model'];if(_0x29ff1f[_0x20f9('0x34')][_0x20f9('0x45')]){_0x1c2fdd['include']=[{'all':!![]}];}_0x1c2fdd=_[_0x20f9('0x43')]({},_0x1c2fdd,_0x29ff1f[_0x20f9('0x44')]);return db[_0x20f9('0x30')]['find'](_0x1c2fdd)[_0x20f9('0x29')](handleEntityNotFound(_0x11e65f,null))[_0x20f9('0x29')](respondWithResult(_0x11e65f,null))['catch'](handleError(_0x11e65f,null));};exports['create']=function(_0x153a8e,_0x5694e0){return db[_0x20f9('0x30')][_0x20f9('0x4d')](_0x153a8e[_0x20f9('0x4e')],{})[_0x20f9('0x29')](function(_0x10a94d){var _0x5e8e5f=_0x153a8e[_0x20f9('0x4f')][_0x20f9('0x2a')]({'plain':!![]});if(!_0x5e8e5f)throw new Error(_0x20f9('0x50'));if(_0x5e8e5f[_0x20f9('0x51')]===_0x20f9('0x4f')){var _0x261b2b=_0x10a94d[_0x20f9('0x2a')]({'plain':!![]});var _0x4fa068=_0x20f9('0x2b');return db[_0x20f9('0x52')]['find']({'where':{'name':_0x4fa068,'userProfileId':_0x5e8e5f[_0x20f9('0x53')]},'raw':!![]})['then'](function(_0x454948){if(_0x454948&&_0x454948[_0x20f9('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x261b2b[_0x20f9('0x2d')],'resourceId':_0x261b2b['id'],'type':_0x454948[_0x20f9('0x2d')],'sectionId':_0x454948['id']},{})[_0x20f9('0x29')](function(){return _0x10a94d;});}else{return _0x10a94d;}})[_0x20f9('0x49')](function(_0x45475e){logger[_0x20f9('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45475e);throw _0x45475e;});}return _0x10a94d;})[_0x20f9('0x29')](respondWithResult(_0x5694e0,0xc9))[_0x20f9('0x49')](handleError(_0x5694e0,null));};exports[_0x20f9('0x56')]=function(_0x13e638,_0x575b57){var _0x3c3e46={'where':{'id':_0x13e638['params']['id']}},_0x18a97d={};_0x18a97d[_0x20f9('0x33')]=_[_0x20f9('0x4c')](db[_0x20f9('0x30')]['rawAttributes']);_0x3c3e46[_0x20f9('0x37')]=_[_0x20f9('0x36')](_0x18a97d[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x13e638[_0x20f9('0x34')][_0x20f9('0x38')]));_0x3c3e46[_0x20f9('0x37')]=_0x3c3e46[_0x20f9('0x37')]['length']?_0x3c3e46[_0x20f9('0x37')]:_0x18a97d[_0x20f9('0x33')];if(_0x13e638['query'][_0x20f9('0x45')]){_0x3c3e46[_0x20f9('0x46')]=[{'all':!![]}];}_0x3c3e46=_[_0x20f9('0x43')]({},_0x3c3e46,_0x13e638[_0x20f9('0x44')]);return db[_0x20f9('0x30')][_0x20f9('0x57')](_0x3c3e46)[_0x20f9('0x29')](handleEntityNotFound(_0x575b57,null))['then'](function(_0x5e7cec){if(_0x5e7cec){var _0x4046dc=_0x5e7cec[_0x20f9('0x2a')]({'plain':!![]});_0x4046dc=qs[_0x20f9('0x58')](_0x4046dc,['id',_0x20f9('0x59'),_0x20f9('0x5a')]);_0x13e638['body']=_[_0x20f9('0x58')](_0x13e638[_0x20f9('0x4e')],['id','createdAt',_0x20f9('0x5a')]);return db[_0x20f9('0x30')][_0x20f9('0x4d')](_[_0x20f9('0x43')](_0x4046dc,_0x13e638[_0x20f9('0x4e')]),{'include':_0x13e638['query']['includeAll']?[{'all':!![]}]:undefined})[_0x20f9('0x29')](function(_0x15b746){var _0x2c0255=_0x13e638['user'][_0x20f9('0x2a')]({'plain':!![]});if(!_0x2c0255)throw new Error(_0x20f9('0x50'));if(_0x2c0255[_0x20f9('0x51')]===_0x20f9('0x4f')){var _0x502e1d=_0x15b746[_0x20f9('0x2a')]({'plain':!![]});var _0x8c2388=_0x20f9('0x2b');return db[_0x20f9('0x52')][_0x20f9('0x57')]({'where':{'name':_0x8c2388,'userProfileId':_0x2c0255[_0x20f9('0x53')]},'raw':!![]})[_0x20f9('0x29')](function(_0x57514c){if(_0x57514c&&_0x57514c[_0x20f9('0x54')]===0x0){return db[_0x20f9('0x2c')][_0x20f9('0x4d')]({'name':_0x502e1d[_0x20f9('0x2d')],'resourceId':_0x502e1d['id'],'type':_0x57514c[_0x20f9('0x2d')],'sectionId':_0x57514c['id']},{})[_0x20f9('0x29')](function(){return _0x15b746;});}else{return _0x15b746;}})[_0x20f9('0x49')](function(_0x640f44){logger[_0x20f9('0x55')](_0x20f9('0x5b'),_0x640f44);throw _0x640f44;});}return _0x15b746;});}})[_0x20f9('0x29')](respondWithResult(_0x575b57,0xc9))[_0x20f9('0x49')](handleError(_0x575b57,null));};exports['update']=function(_0x3e3ef2,_0x156421){if(_0x3e3ef2[_0x20f9('0x4e')]['id']){delete _0x3e3ef2[_0x20f9('0x4e')]['id'];}return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x3e3ef2[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x156421,null))[_0x20f9('0x29')](saveUpdates(_0x3e3ef2[_0x20f9('0x4e')],null))[_0x20f9('0x29')](respondWithResult(_0x156421,null))['catch'](handleError(_0x156421,null));};exports['destroy']=function(_0x334fe0,_0x49e293){return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x334fe0[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x49e293,null))['then'](removeEntity(_0x49e293,null))[_0x20f9('0x49')](handleError(_0x49e293,null));};exports[_0x20f9('0x5d')]=function(_0x3f62c3,_0x574403,_0x3aa622){var _0x18cb22={'raw':!![],'where':{}};var _0x3b2739={};var _0x3cb783={'count':0x0,'rows':[]};return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x3f62c3[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x574403,null))[_0x20f9('0x29')](function(_0x1d6c14){if(_0x1d6c14){_0x3b2739[_0x20f9('0x33')]=_[_0x20f9('0x4c')](db[_0x20f9('0x5f')][_0x20f9('0x4b')]);_0x3b2739[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x3f62c3['query']);_0x3b2739[_0x20f9('0x35')]=_['intersection'](_0x3b2739[_0x20f9('0x33')],_0x3b2739[_0x20f9('0x34')]);_0x18cb22['attributes']=_[_0x20f9('0x36')](_0x3b2739[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x38')]));_0x18cb22[_0x20f9('0x37')]=_0x18cb22[_0x20f9('0x37')]['length']?_0x18cb22[_0x20f9('0x37')]:_0x3b2739[_0x20f9('0x33')];if(!_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x18cb22[_0x20f9('0x21')]=qs[_0x20f9('0x21')](_0x3f62c3['query']['limit']);_0x18cb22[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x20')]);}_0x18cb22[_0x20f9('0x3c')]=qs[_0x20f9('0x3d')](_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x18cb22['where']=qs[_0x20f9('0x35')](_['pick'](_0x3f62c3['query'],_0x3b2739[_0x20f9('0x35')]));_0x18cb22[_0x20f9('0x3e')]['CampaignId']=_0x1d6c14['id'];if(_0x3f62c3['query']['filter']){_0x18cb22[_0x20f9('0x3e')]=_['merge'](_0x18cb22[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x18cb22[_0x20f9('0x37')],function(_0x24f606){var _0x15638b={};_0x15638b[_0x24f606]={'$like':'%'+_0x3f62c3[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x15638b;})});}_0x18cb22=_[_0x20f9('0x43')]({},_0x18cb22,_0x3f62c3['options']);return db['CmHopper']['count']({'where':_0x18cb22[_0x20f9('0x3e')]})[_0x20f9('0x29')](function(_0x256c14){_0x3cb783['count']=_0x256c14;if(_0x3f62c3['query'][_0x20f9('0x45')]){_0x18cb22[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x5f')][_0x20f9('0x47')](_0x18cb22);})[_0x20f9('0x29')](function(_0x4d7493){_0x3cb783[_0x20f9('0x48')]=_0x4d7493;return _0x3cb783;});}})[_0x20f9('0x29')](respondWithFilteredResult(_0x574403,_0x18cb22))[_0x20f9('0x49')](handleError(_0x574403,null));};exports[_0x20f9('0x60')]=function(_0x4680a0,_0xab2b20,_0xe74ea4){var _0x24d68c={'raw':!![],'where':{}};var _0x44b524={};var _0x12d386={'count':0x0,'rows':[]};return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x4680a0[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0xab2b20,null))[_0x20f9('0x29')](function(_0x4e1813){if(_0x4e1813){_0x44b524[_0x20f9('0x33')]=_[_0x20f9('0x4c')](db['CmHopperHistory'][_0x20f9('0x4b')]);_0x44b524[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x4680a0[_0x20f9('0x34')]);_0x44b524[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x44b524[_0x20f9('0x33')],_0x44b524[_0x20f9('0x34')]);_0x24d68c[_0x20f9('0x37')]=_['intersection'](_0x44b524[_0x20f9('0x33')],qs['fields'](_0x4680a0[_0x20f9('0x34')][_0x20f9('0x38')]));_0x24d68c['attributes']=_0x24d68c[_0x20f9('0x37')][_0x20f9('0x39')]?_0x24d68c[_0x20f9('0x37')]:_0x44b524[_0x20f9('0x33')];if(!_0x4680a0[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x24d68c[_0x20f9('0x21')]=qs[_0x20f9('0x21')](_0x4680a0[_0x20f9('0x34')][_0x20f9('0x21')]);_0x24d68c[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x4680a0[_0x20f9('0x34')][_0x20f9('0x20')]);}_0x24d68c['order']=qs['sort'](_0x4680a0['query'][_0x20f9('0x3d')]);_0x24d68c['where']=qs['filters'](_['pick'](_0x4680a0[_0x20f9('0x34')],_0x44b524[_0x20f9('0x35')]));_0x24d68c[_0x20f9('0x3e')][_0x20f9('0x61')]=_0x4e1813['id'];if(_0x4680a0[_0x20f9('0x34')][_0x20f9('0x40')]){_0x24d68c[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0x24d68c[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x24d68c['attributes'],function(_0x16026b){var _0x29b6ce={};_0x29b6ce[_0x16026b]={'$like':'%'+_0x4680a0[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x29b6ce;})});}_0x24d68c=_['merge']({},_0x24d68c,_0x4680a0['options']);return db[_0x20f9('0x62')][_0x20f9('0x22')]({'where':_0x24d68c[_0x20f9('0x3e')]})['then'](function(_0x28f0b3){_0x12d386[_0x20f9('0x22')]=_0x28f0b3;if(_0x4680a0[_0x20f9('0x34')]['includeAll']){_0x24d68c[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x62')]['findAll'](_0x24d68c);})[_0x20f9('0x29')](function(_0x2fdd2a){_0x12d386[_0x20f9('0x48')]=_0x2fdd2a;return _0x12d386;});}})[_0x20f9('0x29')](respondWithFilteredResult(_0xab2b20,_0x24d68c))['catch'](handleError(_0xab2b20,null));};exports['getHopperFinals']=function(_0x59ca1f,_0x48ec95,_0x4bee73){var _0xcbacf9={'raw':!![],'where':{}};var _0x1f88f8={};var _0x291c7e={'count':0x0,'rows':[]};return db[_0x20f9('0x30')]['findOne']({'where':{'id':_0x59ca1f['params']['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x48ec95,null))['then'](function(_0x263503){if(_0x263503){_0x1f88f8['model']=_[_0x20f9('0x4c')](db[_0x20f9('0x63')][_0x20f9('0x4b')]);_0x1f88f8['query']=_[_0x20f9('0x4c')](_0x59ca1f[_0x20f9('0x34')]);_0x1f88f8[_0x20f9('0x35')]=_['intersection'](_0x1f88f8['model'],_0x1f88f8[_0x20f9('0x34')]);_0xcbacf9[_0x20f9('0x37')]=_[_0x20f9('0x36')](_0x1f88f8['model'],qs[_0x20f9('0x38')](_0x59ca1f['query'][_0x20f9('0x38')]));_0xcbacf9['attributes']=_0xcbacf9[_0x20f9('0x37')][_0x20f9('0x39')]?_0xcbacf9[_0x20f9('0x37')]:_0x1f88f8[_0x20f9('0x33')];if(!_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0xcbacf9[_0x20f9('0x21')]=qs[_0x20f9('0x21')](_0x59ca1f['query'][_0x20f9('0x21')]);_0xcbacf9[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x20')]);}_0xcbacf9['order']=qs[_0x20f9('0x3d')](_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x3d')]);_0xcbacf9['where']=qs[_0x20f9('0x35')](_['pick'](_0x59ca1f[_0x20f9('0x34')],_0x1f88f8[_0x20f9('0x35')]));_0xcbacf9['where'][_0x20f9('0x61')]=_0x263503['id'];if(_0x59ca1f['query']['filter']){_0xcbacf9[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0xcbacf9[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0xcbacf9[_0x20f9('0x37')],function(_0x20a323){var _0x2373f5={};_0x2373f5[_0x20a323]={'$like':'%'+_0x59ca1f[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x2373f5;})});}_0xcbacf9=_[_0x20f9('0x43')]({},_0xcbacf9,_0x59ca1f[_0x20f9('0x44')]);return db['CmHopperFinal'][_0x20f9('0x22')]({'where':_0xcbacf9[_0x20f9('0x3e')]})[_0x20f9('0x29')](function(_0x3dd80e){_0x291c7e[_0x20f9('0x22')]=_0x3dd80e;if(_0x59ca1f['query'][_0x20f9('0x45')]){_0xcbacf9['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x20f9('0x47')](_0xcbacf9);})[_0x20f9('0x29')](function(_0x1f10f5){_0x291c7e[_0x20f9('0x48')]=_0x1f10f5;return _0x291c7e;});}})['then'](respondWithFilteredResult(_0x48ec95,_0xcbacf9))['catch'](handleError(_0x48ec95,null));};exports[_0x20f9('0x64')]=function(_0x43f05e,_0x213cb6,_0x312e5d){var _0x2ab112={'raw':!![],'where':{}};var _0x4d6b7d={};var _0x4f8e07={'count':0x0,'rows':[]};return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x43f05e[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x213cb6,null))['then'](function(_0x22a1f4){if(_0x22a1f4){_0x4d6b7d[_0x20f9('0x33')]=_['keys'](db[_0x20f9('0x65')][_0x20f9('0x4b')]);_0x4d6b7d[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x43f05e[_0x20f9('0x34')]);_0x4d6b7d[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x4d6b7d['model'],_0x4d6b7d[_0x20f9('0x34')]);_0x2ab112['attributes']=_[_0x20f9('0x36')](_0x4d6b7d['model'],qs[_0x20f9('0x38')](_0x43f05e[_0x20f9('0x34')][_0x20f9('0x38')]));_0x2ab112[_0x20f9('0x37')]=_0x2ab112['attributes'][_0x20f9('0x39')]?_0x2ab112[_0x20f9('0x37')]:_0x4d6b7d['model'];if(!_0x43f05e[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x2ab112[_0x20f9('0x21')]=qs['limit'](_0x43f05e[_0x20f9('0x34')][_0x20f9('0x21')]);_0x2ab112[_0x20f9('0x20')]=qs['offset'](_0x43f05e[_0x20f9('0x34')]['offset']);}_0x2ab112['order']=qs[_0x20f9('0x3d')](_0x43f05e[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x2ab112['where']=qs[_0x20f9('0x35')](_['pick'](_0x43f05e[_0x20f9('0x34')],_0x4d6b7d[_0x20f9('0x35')]));_0x2ab112[_0x20f9('0x3e')][_0x20f9('0x61')]=_0x22a1f4['id'];if(_0x43f05e['query']['filter']){_0x2ab112[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0x2ab112[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x2ab112[_0x20f9('0x37')],function(_0x434269){var _0x1ca22f={};_0x1ca22f[_0x434269]={'$like':'%'+_0x43f05e[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x1ca22f;})});}_0x2ab112=_[_0x20f9('0x43')]({},_0x2ab112,_0x43f05e[_0x20f9('0x44')]);return db[_0x20f9('0x65')][_0x20f9('0x22')]({'where':_0x2ab112[_0x20f9('0x3e')]})[_0x20f9('0x29')](function(_0x548742){_0x4f8e07[_0x20f9('0x22')]=_0x548742;if(_0x43f05e[_0x20f9('0x34')][_0x20f9('0x45')]){_0x2ab112[_0x20f9('0x46')]=[{'all':!![]}];}return db[_0x20f9('0x65')][_0x20f9('0x47')](_0x2ab112);})['then'](function(_0x2689ac){_0x4f8e07['rows']=_0x2689ac;return _0x4f8e07;});}})[_0x20f9('0x29')](respondWithFilteredResult(_0x213cb6,_0x2ab112))['catch'](handleError(_0x213cb6,null));};exports[_0x20f9('0x66')]=function(_0x14a48c,_0x30a713,_0x65e3a){var _0x5925cc={};var _0x5ad507={};var _0x538be1;var _0x7929f5;return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x14a48c['params']['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x30a713,null))[_0x20f9('0x29')](function(_0x221f97){if(_0x221f97){_0x538be1=_0x221f97;_0x5ad507['model']=_[_0x20f9('0x4c')](db[_0x20f9('0x67')][_0x20f9('0x4b')]);_0x5ad507[_0x20f9('0x34')]=_['keys'](_0x14a48c['query']);_0x5ad507['filters']=_[_0x20f9('0x36')](_0x5ad507['model'],_0x5ad507[_0x20f9('0x34')]);_0x5925cc[_0x20f9('0x37')]=_['intersection'](_0x5ad507[_0x20f9('0x33')],qs['fields'](_0x14a48c[_0x20f9('0x34')]['fields']));_0x5925cc[_0x20f9('0x37')]=_0x5925cc[_0x20f9('0x37')][_0x20f9('0x39')]?_0x5925cc[_0x20f9('0x37')]:_0x5ad507['model'];_0x5925cc['order']=qs[_0x20f9('0x3d')](_0x14a48c[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x5925cc[_0x20f9('0x3e')]=qs['filters'](_[_0x20f9('0x3f')](_0x14a48c[_0x20f9('0x34')],_0x5ad507[_0x20f9('0x35')]));if(_0x14a48c[_0x20f9('0x34')][_0x20f9('0x40')]){_0x5925cc[_0x20f9('0x3e')]=_[_0x20f9('0x43')](_0x5925cc[_0x20f9('0x3e')],{'$or':_[_0x20f9('0x41')](_0x5925cc['attributes'],function(_0x54d801){var _0x4483d9={};_0x4483d9[_0x54d801]={'$like':'%'+_0x14a48c[_0x20f9('0x34')][_0x20f9('0x40')]+'%'};return _0x4483d9;})});}_0x5925cc=_[_0x20f9('0x43')]({},_0x5925cc,_0x14a48c[_0x20f9('0x44')]);return _0x538be1['getLists'](_0x5925cc);}})[_0x20f9('0x29')](function(_0x1a1165){if(_0x1a1165){_0x7929f5=_0x1a1165[_0x20f9('0x39')];if(!_0x14a48c[_0x20f9('0x34')]['hasOwnProperty'](_0x20f9('0x3b'))){_0x5925cc['limit']=qs['limit'](_0x14a48c[_0x20f9('0x34')][_0x20f9('0x21')]);_0x5925cc[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x14a48c[_0x20f9('0x34')][_0x20f9('0x20')]);}return _0x538be1['getLists'](_0x5925cc);}})[_0x20f9('0x29')](function(_0x31d1e7){if(_0x31d1e7){return _0x31d1e7?{'count':_0x7929f5,'rows':_0x31d1e7}:null;}})['then'](respondWithResult(_0x30a713,null))[_0x20f9('0x49')](handleError(_0x30a713,null));};exports[_0x20f9('0x68')]=function(_0x5bd33b,_0x1a2f9d,_0x503cca){var _0x2dc66a,_0x488f2a;var _0x1bd3c8=[];var _0x1ce109=moment()[_0x20f9('0x69')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x20f9('0x57')]({'where':{'id':_0x5bd33b[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x1a2f9d,null))[_0x20f9('0x29')](function(_0xa1aa8e){if(_0xa1aa8e){_0x488f2a=_0xa1aa8e;return _0xa1aa8e[_0x20f9('0x68')](_0x5bd33b[_0x20f9('0x4e')]['ids'],_[_0x20f9('0x58')](_0x5bd33b['body'],[_0x20f9('0x6a'),'id'])||{});}return null;})[_0x20f9('0x6b')](function(_0x2fc634){var _0x3d0708;var _0x5cfb58;_0x2dc66a=_0x2fc634||[];var _0x59bf20=[];if(_0x2fc634){for(var _0x481371=0x0;_0x481371<_0x2fc634[_0x20f9('0x39')];_0x481371+=0x1){var _0x2e6dfd=_0x2fc634[_0x481371][_0x20f9('0x2a')]({'plain':!![]});_0x488f2a['dialCheckDuplicateType']=_0x5bd33b[_0x20f9('0x4e')]['dialCheckDuplicateType']?_0x5bd33b[_0x20f9('0x4e')]['dialCheckDuplicateType']:_0x488f2a[_0x20f9('0x6c')];switch(_0x488f2a[_0x20f9('0x6c')]){case _0x20f9('0x6d'):_0x3d0708=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')]('cm_hopper')[_0x20f9('0x70')](['phone',_0x20f9('0x71'),_0x20f9('0x72'),_0x20f9('0x73'),_0x20f9('0x61'),_0x20f9('0x59'),'updatedAt'],squel['select']()[_0x20f9('0x74')](_0x20f9('0x75'),_0x20f9('0x75'))['field'](_0x20f9('0x76'),_0x20f9('0x71'))['field']('id',_0x20f9('0x72'))[_0x20f9('0x74')](_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')](),_0x20f9('0x73'))['field'](_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')](),'CampaignId')[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27','createdAt')['field']('\x27'+_0x1ce109+'\x27','updatedAt')[_0x20f9('0x79')](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')]('ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')](_0x20f9('0x7c'))[_0x20f9('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x20f9('0x7d')]()['field'](_0x20f9('0x7e'))[_0x20f9('0x79')](_0x20f9('0x7f'))[_0x20f9('0x3e')](_0x20f9('0x80'),_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]()))[_0x20f9('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x20f9('0x74')](_0x20f9('0x81'))[_0x20f9('0x79')](_0x20f9('0x82'))[_0x20f9('0x3e')]('CampaignId\x20=\x20?',_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]())))[_0x20f9('0x78')]();break;case _0x20f9('0x83'):_0x3d0708=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')](_0x20f9('0x82'))[_0x20f9('0x70')]([_0x20f9('0x75'),_0x20f9('0x71'),'ContactId',_0x20f9('0x73'),'CampaignId','createdAt',_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()['field'](_0x20f9('0x75'),_0x20f9('0x75'))[_0x20f9('0x74')](_0x20f9('0x76'),_0x20f9('0x71'))[_0x20f9('0x74')]('id',_0x20f9('0x72'))[_0x20f9('0x74')](_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')](),'ListId')[_0x20f9('0x74')](_0x5bd33b[_0x20f9('0x5c')]['id']['toString'](),'CampaignId')[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x59'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x5a'))['from'](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')]('ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x20f9('0x3e')](_0x20f9('0x84'),squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x81'))[_0x20f9('0x79')](_0x20f9('0x82'))[_0x20f9('0x3e')]('CampaignId\x20=\x20?',_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]())))['toString']();break;default:_0x3d0708=squel[_0x20f9('0x6e')]()['into']('cm_hopper')['fromQuery']([_0x20f9('0x75'),'scheduledAt',_0x20f9('0x72'),_0x20f9('0x73'),_0x20f9('0x61'),_0x20f9('0x59'),_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x75'),_0x20f9('0x75'))[_0x20f9('0x74')](_0x20f9('0x76'),'scheduledAt')[_0x20f9('0x74')]('id','ContactId')[_0x20f9('0x74')](_0x2e6dfd[_0x20f9('0x77')]['toString'](),_0x20f9('0x73'))[_0x20f9('0x74')](_0x5bd33b['params']['id'][_0x20f9('0x78')](),'CampaignId')[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x59'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27','updatedAt')[_0x20f9('0x79')](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')]('ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x20f9('0x78')]();}_0x5cfb58=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')](_0x20f9('0x85'))[_0x20f9('0x70')](['cmHopperId',_0x20f9('0x71'),_0x20f9('0x75'),_0x20f9('0x86'),_0x20f9('0x59'),_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x87'),'id')[_0x20f9('0x74')]('NOW()',_0x20f9('0x71'))[_0x20f9('0x74')](_0x20f9('0x88'),_0x20f9('0x75'))[_0x20f9('0x74')]('ci.OrderBY',_0x20f9('0x86'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27',_0x20f9('0x59'))[_0x20f9('0x74')]('\x27'+_0x1ce109+'\x27','updatedAt')['from'](_0x20f9('0x89'),'ci')[_0x20f9('0x8a')]('cm_hopper','h',_0x20f9('0x8b'))['where']('h.ListId\x20=\x20?',_0x2e6dfd[_0x20f9('0x77')]['toString']())[_0x20f9('0x3e')](_0x20f9('0x8c'),_0x5bd33b[_0x20f9('0x5c')]['id'][_0x20f9('0x78')]())[_0x20f9('0x3e')](_0x20f9('0x8d'),_0x1ce109))['toString']();_0x59bf20[_0x20f9('0x8e')](db[_0x20f9('0x8f')]['query'](_0x3d0708));_0x1bd3c8['push'](db[_0x20f9('0x8f')][_0x20f9('0x34')](_0x5cfb58));}return BPromise['all'](_0x59bf20);}})[_0x20f9('0x29')](function(){return BPromise[_0x20f9('0x90')](_0x1bd3c8);})[_0x20f9('0x29')](function(){return _0x2dc66a;})[_0x20f9('0x29')](respondWithResult(_0x1a2f9d,null))[_0x20f9('0x49')](handleError(_0x1a2f9d,null));};exports[_0x20f9('0x91')]=function(_0x4deb28,_0xbdf2cf,_0x319926){return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x4deb28['params']['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0xbdf2cf,null))[_0x20f9('0x29')](function(_0x4353d2){if(_0x4353d2){return _0x4353d2[_0x20f9('0x91')](_0x4deb28['query']['ids']);}})[_0x20f9('0x29')](function(_0x4fc9c6){if(_0x4fc9c6){return db[_0x20f9('0x5f')][_0x20f9('0x28')]({'where':{'ListId':_0x4deb28[_0x20f9('0x34')][_0x20f9('0x6a')],'CampaignId':_0x4deb28['params']['id']}})[_0x20f9('0x29')](function(){return _0x4fc9c6;});}})[_0x20f9('0x29')](respondWithStatusCode(_0xbdf2cf,null))['catch'](handleError(_0xbdf2cf,null));};exports['getBlackLists']=function(_0x32ea1b,_0x77e4ab,_0x485b18){var _0x164918={};var _0x1726e3={};var _0x399d19;var _0x408a47;return db[_0x20f9('0x30')][_0x20f9('0x5e')]({'where':{'id':_0x32ea1b[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0x77e4ab,null))[_0x20f9('0x29')](function(_0x68f949){if(_0x68f949){_0x399d19=_0x68f949;_0x1726e3[_0x20f9('0x33')]=_['keys'](db['CmList'][_0x20f9('0x4b')]);_0x1726e3[_0x20f9('0x34')]=_[_0x20f9('0x4c')](_0x32ea1b[_0x20f9('0x34')]);_0x1726e3[_0x20f9('0x35')]=_[_0x20f9('0x36')](_0x1726e3[_0x20f9('0x33')],_0x1726e3[_0x20f9('0x34')]);_0x164918['attributes']=_[_0x20f9('0x36')](_0x1726e3[_0x20f9('0x33')],qs[_0x20f9('0x38')](_0x32ea1b[_0x20f9('0x34')][_0x20f9('0x38')]));_0x164918[_0x20f9('0x37')]=_0x164918[_0x20f9('0x37')][_0x20f9('0x39')]?_0x164918[_0x20f9('0x37')]:_0x1726e3[_0x20f9('0x33')];_0x164918[_0x20f9('0x3c')]=qs[_0x20f9('0x3d')](_0x32ea1b[_0x20f9('0x34')][_0x20f9('0x3d')]);_0x164918[_0x20f9('0x3e')]=qs['filters'](_[_0x20f9('0x3f')](_0x32ea1b[_0x20f9('0x34')],_0x1726e3[_0x20f9('0x35')]));if(_0x32ea1b['query'][_0x20f9('0x40')]){_0x164918[_0x20f9('0x3e')]=_['merge'](_0x164918['where'],{'$or':_['map'](_0x164918[_0x20f9('0x37')],function(_0x1260dd){var _0x834ae6={};_0x834ae6[_0x1260dd]={'$like':'%'+_0x32ea1b['query'][_0x20f9('0x40')]+'%'};return _0x834ae6;})});}_0x164918=_[_0x20f9('0x43')]({},_0x164918,_0x32ea1b[_0x20f9('0x44')]);return _0x399d19[_0x20f9('0x92')](_0x164918);}})[_0x20f9('0x29')](function(_0x7e6695){if(_0x7e6695){_0x408a47=_0x7e6695[_0x20f9('0x39')];if(!_0x32ea1b[_0x20f9('0x34')][_0x20f9('0x3a')](_0x20f9('0x3b'))){_0x164918[_0x20f9('0x21')]=qs['limit'](_0x32ea1b[_0x20f9('0x34')]['limit']);_0x164918[_0x20f9('0x20')]=qs[_0x20f9('0x20')](_0x32ea1b['query'][_0x20f9('0x20')]);}return _0x399d19[_0x20f9('0x92')](_0x164918);}})[_0x20f9('0x29')](function(_0x400c29){if(_0x400c29){return _0x400c29?{'count':_0x408a47,'rows':_0x400c29}:null;}})[_0x20f9('0x29')](respondWithResult(_0x77e4ab,null))['catch'](handleError(_0x77e4ab,null));};exports[_0x20f9('0x93')]=function(_0xaf1354,_0x759a7c,_0x3fa404){var _0x2af093,_0x56bc21;var _0x149a0f=[];var _0x3faad1=moment()['format'](_0x20f9('0x94'));return db['Campaign'][_0x20f9('0x57')]({'where':{'id':_0xaf1354[_0x20f9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x759a7c,null))[_0x20f9('0x29')](function(_0x501fda){if(_0x501fda){_0x56bc21=_0x501fda;return _0x501fda[_0x20f9('0x93')](_0xaf1354['body'][_0x20f9('0x6a')],_[_0x20f9('0x58')](_0xaf1354[_0x20f9('0x4e')],['ids','id'])||{});}return null;})[_0x20f9('0x6b')](function(_0x14d06c){var _0x1be974;var _0x13bdf9;_0x2af093=_0x14d06c||[];var _0x1841f9=[];if(_0x14d06c){for(var _0xb71fb6=0x0;_0xb71fb6<_0x14d06c[_0x20f9('0x39')];_0xb71fb6+=0x1){var _0x460eb9=_0x14d06c[_0xb71fb6][_0x20f9('0x2a')]({'plain':!![]});_0x1be974=squel[_0x20f9('0x6e')]()[_0x20f9('0x6f')](_0x20f9('0x95'))['fromQuery']([_0x20f9('0x75'),_0x20f9('0x72'),'ListId','CampaignId',_0x20f9('0x59'),_0x20f9('0x5a')],squel[_0x20f9('0x7d')]()[_0x20f9('0x74')](_0x20f9('0x75'),'phone')[_0x20f9('0x74')]('id',_0x20f9('0x72'))['field'](_0x460eb9[_0x20f9('0x77')][_0x20f9('0x78')](),'ListId')[_0x20f9('0x74')](_0xaf1354[_0x20f9('0x5c')]['id'][_0x20f9('0x78')](),_0x20f9('0x61'))['field'](_0x20f9('0x76'),'createdAt')[_0x20f9('0x74')](_0x20f9('0x76'),_0x20f9('0x5a'))[_0x20f9('0x79')](_0x20f9('0x7a'))[_0x20f9('0x3e')](_0x20f9('0x7b'))[_0x20f9('0x3e')](_0x20f9('0x96'),_0x460eb9[_0x20f9('0x77')][_0x20f9('0x78')]())[_0x20f9('0x3e')](_0x20f9('0x7c')))['toString']();_0x1841f9['push'](db['sequelize']['query'](_0x1be974));}return BPromise[_0x20f9('0x90')](_0x1841f9);}})[_0x20f9('0x29')](function(){return _0x2af093;})[_0x20f9('0x29')](respondWithResult(_0x759a7c,null))[_0x20f9('0x49')](handleError(_0x759a7c,null));};exports[_0x20f9('0x97')]=function(_0x5c0dde,_0xde96d2,_0x327ad7){return db[_0x20f9('0x30')][_0x20f9('0x57')]({'where':{'id':_0x5c0dde[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](handleEntityNotFound(_0xde96d2,null))[_0x20f9('0x29')](function(_0x166c3f){if(_0x166c3f){return _0x166c3f[_0x20f9('0x97')](_0x5c0dde['query'][_0x20f9('0x6a')]);}})['then'](function(_0x4e64be){if(_0x4e64be){return db[_0x20f9('0x65')]['destroy']({'where':{'ListId':_0x5c0dde['query'][_0x20f9('0x6a')],'CampaignId':_0x5c0dde[_0x20f9('0x5c')]['id']}})[_0x20f9('0x29')](function(){return _0x4e64be;});}})[_0x20f9('0x29')](respondWithStatusCode(_0xde96d2,null))[_0x20f9('0x49')](handleError(_0xde96d2,null));};
\ No newline at end of file
+var _0x9bb4=['clone','createdAt','omit','updatedAt','user','error','getHoppers','findOne','CmHopper','hasOwnProperty','order','pick','CampaignId','findAll','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','cmHopperId','h.id','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','IvrCampaigns','UserProfileResource','destroy','stack','name','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x157f75,_0x28cb0e){var _0x25a52d=function(_0x5b5856){while(--_0x5b5856){_0x157f75['push'](_0x157f75['shift']());}};_0x25a52d(++_0x28cb0e);}(_0x9bb4,0xd5));var _0x49bb=function(_0x41eab3,_0x2949fa){_0x41eab3=_0x41eab3-0x0;var _0x1318a3=_0x9bb4[_0x41eab3];return _0x1318a3;};'use strict';var emlformat=require(_0x49bb('0x0'));var rimraf=require(_0x49bb('0x1'));var zipdir=require(_0x49bb('0x2'));var jsonpatch=require(_0x49bb('0x3'));var rp=require(_0x49bb('0x4'));var moment=require(_0x49bb('0x5'));var BPromise=require(_0x49bb('0x6'));var Mustache=require(_0x49bb('0x7'));var util=require(_0x49bb('0x8'));var path=require('path');var sox=require(_0x49bb('0x9'));var csv=require(_0x49bb('0xa'));var ejs=require(_0x49bb('0xb'));var fs=require('fs');var fs_extra=require(_0x49bb('0xc'));var _=require('lodash');var squel=require(_0x49bb('0xd'));var crypto=require(_0x49bb('0xe'));var jsforce=require(_0x49bb('0xf'));var deskjs=require(_0x49bb('0x10'));var toCsv=require(_0x49bb('0xa'));var querystring=require('querystring');var Papa=require(_0x49bb('0x11'));var Redis=require('ioredis');var authService=require(_0x49bb('0x12'));var qs=require(_0x49bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49bb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x49bb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x49bb('0x16'));var db=require(_0x49bb('0x17'))['db'];function respondWithStatusCode(_0xfab080,_0x3b85fc){_0x3b85fc=_0x3b85fc||0xcc;return function(_0x1ff6d1){if(_0x1ff6d1){return _0xfab080[_0x49bb('0x18')](_0x3b85fc);}return _0xfab080[_0x49bb('0x19')](_0x3b85fc)[_0x49bb('0x1a')]();};}function respondWithResult(_0x3beb36,_0x59472f){_0x59472f=_0x59472f||0xc8;return function(_0x13c850){if(_0x13c850){return _0x3beb36['status'](_0x59472f)[_0x49bb('0x1b')](_0x13c850);}};}function respondWithFilteredResult(_0x1f7573,_0x1f0210){return function(_0x230f20){if(_0x230f20){var _0x145d52=typeof _0x1f0210[_0x49bb('0x1c')]===_0x49bb('0x1d')&&typeof _0x1f0210[_0x49bb('0x1e')]==='undefined';var _0x2d76be=_0x230f20[_0x49bb('0x1f')];var _0x5b45c0=_0x145d52?0x0:_0x1f0210[_0x49bb('0x1c')];var _0x3d41f2=_0x145d52?_0x230f20['count']:_0x1f0210[_0x49bb('0x1c')]+_0x1f0210[_0x49bb('0x1e')];var _0x4af5e0;if(_0x3d41f2>=_0x2d76be){_0x3d41f2=_0x2d76be;_0x4af5e0=0xc8;}else{_0x4af5e0=0xce;}_0x1f7573[_0x49bb('0x19')](_0x4af5e0);return _0x1f7573[_0x49bb('0x20')]('Content-Range',_0x5b45c0+'-'+_0x3d41f2+'/'+_0x2d76be)[_0x49bb('0x1b')](_0x230f20);}return null;};}function patchUpdates(_0x5387ed){return function(_0x1728e9){try{jsonpatch['apply'](_0x1728e9,_0x5387ed,!![]);}catch(_0x47918a){return BPromise[_0x49bb('0x21')](_0x47918a);}return _0x1728e9['save']();};}function saveUpdates(_0x5b18f0,_0x16b8fa){return function(_0x1ade8b){if(_0x1ade8b){return _0x1ade8b[_0x49bb('0x22')](_0x5b18f0)[_0x49bb('0x23')](function(_0x4f2764){return _0x4f2764;});}return null;};}function removeEntity(_0x490c3e,_0x5cacdb){return function(_0x4eae24){if(_0x4eae24){return _0x4eae24['destroy']()[_0x49bb('0x23')](function(){var _0x570847=_0x4eae24['get']({'plain':!![]});var _0x6dac61=_0x49bb('0x24');return db[_0x49bb('0x25')][_0x49bb('0x26')]({'where':{'type':_0x6dac61,'resourceId':_0x570847['id']}})[_0x49bb('0x23')](function(){return _0x4eae24;});})['then'](function(){_0x490c3e[_0x49bb('0x19')](0xcc)[_0x49bb('0x1a')]();});}};}function handleEntityNotFound(_0x1a6afb,_0x712959){return function(_0x5370d7){if(!_0x5370d7){_0x1a6afb[_0x49bb('0x18')](0x194);}return _0x5370d7;};}function handleError(_0x3d025d,_0x3985a6){_0x3985a6=_0x3985a6||0x1f4;return function(_0x47540c){logger['error'](_0x47540c[_0x49bb('0x27')]);if(_0x47540c[_0x49bb('0x28')]){delete _0x47540c[_0x49bb('0x28')];}_0x3d025d[_0x49bb('0x19')](_0x3985a6)['send'](_0x47540c);};}exports[_0x49bb('0x29')]=function(_0x1537ef,_0x5cd7c2){var _0x38108d={},_0x56b65b={},_0x2fbea2={'count':0x0,'rows':[]};var _0x242371=_['map'](db[_0x49bb('0x2a')][_0x49bb('0x2b')],function(_0x521e09){return{'name':_0x521e09[_0x49bb('0x2c')],'type':_0x521e09[_0x49bb('0x2d')][_0x49bb('0x2e')]};});_0x56b65b[_0x49bb('0x2f')]=_[_0x49bb('0x30')](_0x242371,_0x49bb('0x28'));_0x56b65b[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x1537ef['query']);_0x56b65b[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x56b65b[_0x49bb('0x2f')],_0x56b65b[_0x49bb('0x31')]);_0x38108d['attributes']=_[_0x49bb('0x34')](_0x56b65b['model'],qs[_0x49bb('0x35')](_0x1537ef['query'][_0x49bb('0x35')]));_0x38108d['attributes']=_0x38108d[_0x49bb('0x36')][_0x49bb('0x37')]?_0x38108d['attributes']:_0x56b65b['model'];if(!_0x1537ef['query']['hasOwnProperty']('nolimit')){_0x38108d[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x1537ef[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x38108d[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x1537ef[_0x49bb('0x31')]['offset']);}_0x38108d['order']=qs[_0x49bb('0x38')](_0x1537ef[_0x49bb('0x31')]['sort']);_0x38108d[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_['pick'](_0x1537ef['query'],_0x56b65b[_0x49bb('0x33')]),_0x242371);if(_0x1537ef['query'][_0x49bb('0x3a')]){_0x38108d[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x38108d[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x242371,function(_0x72d90e){if(_0x72d90e[_0x49bb('0x2d')]!==_0x49bb('0x3c')){var _0x783852={};_0x783852[_0x72d90e[_0x49bb('0x28')]]={'$like':'%'+_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x783852;}})});}_0x38108d=_[_0x49bb('0x3b')]({},_0x38108d,_0x1537ef[_0x49bb('0x3d')]);var _0x25c70e={'where':_0x38108d[_0x49bb('0x39')]};return db[_0x49bb('0x2a')][_0x49bb('0x1f')](_0x25c70e)[_0x49bb('0x23')](function(_0x41b969){_0x2fbea2[_0x49bb('0x1f')]=_0x41b969;if(_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x38108d['include']=[{'all':!![]}];}return db[_0x49bb('0x2a')]['findAll'](_0x38108d);})[_0x49bb('0x23')](function(_0x1eac94){_0x2fbea2[_0x49bb('0x3f')]=_0x1eac94;return _0x2fbea2;})[_0x49bb('0x23')](respondWithFilteredResult(_0x5cd7c2,_0x38108d))[_0x49bb('0x40')](handleError(_0x5cd7c2,null));};exports['show']=function(_0x445e15,_0x31aaee){var _0x138f2b={'raw':![],'where':{'id':_0x445e15[_0x49bb('0x41')]['id']}},_0x46912f={};_0x46912f['model']=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x46912f[_0x49bb('0x31')]=_['keys'](_0x445e15['query']);_0x46912f[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x46912f[_0x49bb('0x2f')],_0x46912f[_0x49bb('0x31')]);_0x138f2b[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x46912f['model'],qs[_0x49bb('0x35')](_0x445e15['query'][_0x49bb('0x35')]));_0x138f2b[_0x49bb('0x36')]=_0x138f2b['attributes']['length']?_0x138f2b['attributes']:_0x46912f['model'];if(_0x445e15[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x138f2b[_0x49bb('0x42')]=[{'all':!![]}];}_0x138f2b=_[_0x49bb('0x3b')]({},_0x138f2b,_0x445e15['options']);return db['Campaign'][_0x49bb('0x43')](_0x138f2b)[_0x49bb('0x23')](handleEntityNotFound(_0x31aaee,null))[_0x49bb('0x23')](respondWithResult(_0x31aaee,null))[_0x49bb('0x40')](handleError(_0x31aaee,null));};exports['create']=function(_0x3b0f01,_0x382bc4){return db['Campaign'][_0x49bb('0x44')](_0x3b0f01[_0x49bb('0x45')],{})[_0x49bb('0x23')](function(_0x46bb56){var _0xbad45a=_0x3b0f01['user'][_0x49bb('0x46')]({'plain':!![]});if(!_0xbad45a)throw new Error(_0x49bb('0x47'));if(_0xbad45a[_0x49bb('0x48')]==='user'){var _0x266abf=_0x46bb56[_0x49bb('0x46')]({'plain':!![]});var _0x144a77=_0x49bb('0x24');return db[_0x49bb('0x49')]['find']({'where':{'name':_0x144a77,'userProfileId':_0xbad45a[_0x49bb('0x4a')]},'raw':!![]})[_0x49bb('0x23')](function(_0xfae9ab){if(_0xfae9ab&&_0xfae9ab[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x266abf[_0x49bb('0x28')],'resourceId':_0x266abf['id'],'type':_0xfae9ab[_0x49bb('0x28')],'sectionId':_0xfae9ab['id']},{})[_0x49bb('0x23')](function(){return _0x46bb56;});}else{return _0x46bb56;}})[_0x49bb('0x40')](function(_0x2ead0f){logger['error'](_0x49bb('0x4c'),_0x2ead0f);throw _0x2ead0f;});}return _0x46bb56;})[_0x49bb('0x23')](respondWithResult(_0x382bc4,0xc9))[_0x49bb('0x40')](handleError(_0x382bc4,null));};exports[_0x49bb('0x4d')]=function(_0x10327c,_0x3fc2f1){var _0x4151c5={'where':{'id':_0x10327c[_0x49bb('0x41')]['id']}},_0x23e8bc={};_0x23e8bc[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x4151c5[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x23e8bc[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x10327c[_0x49bb('0x31')][_0x49bb('0x35')]));_0x4151c5[_0x49bb('0x36')]=_0x4151c5[_0x49bb('0x36')][_0x49bb('0x37')]?_0x4151c5[_0x49bb('0x36')]:_0x23e8bc['model'];if(_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x4151c5[_0x49bb('0x42')]=[{'all':!![]}];}_0x4151c5=_[_0x49bb('0x3b')]({},_0x4151c5,_0x10327c[_0x49bb('0x3d')]);return db[_0x49bb('0x2a')][_0x49bb('0x43')](_0x4151c5)[_0x49bb('0x23')](handleEntityNotFound(_0x3fc2f1,null))[_0x49bb('0x23')](function(_0x348da4){if(_0x348da4){var _0x48a8d6=_0x348da4['get']({'plain':!![]});_0x48a8d6=qs['omit'](_0x48a8d6,['id',_0x49bb('0x4e'),'updatedAt']);_0x10327c[_0x49bb('0x45')]=_[_0x49bb('0x4f')](_0x10327c[_0x49bb('0x45')],['id',_0x49bb('0x4e'),_0x49bb('0x50')]);return db[_0x49bb('0x2a')][_0x49bb('0x44')](_[_0x49bb('0x3b')](_0x48a8d6,_0x10327c['body']),{'include':_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]?[{'all':!![]}]:undefined})[_0x49bb('0x23')](function(_0x435761){var _0x225341=_0x10327c[_0x49bb('0x51')][_0x49bb('0x46')]({'plain':!![]});if(!_0x225341)throw new Error(_0x49bb('0x47'));if(_0x225341['role']===_0x49bb('0x51')){var _0x35bb5b=_0x435761[_0x49bb('0x46')]({'plain':!![]});var _0xb2d741='IvrCampaigns';return db[_0x49bb('0x49')][_0x49bb('0x43')]({'where':{'name':_0xb2d741,'userProfileId':_0x225341['userProfileId']},'raw':!![]})[_0x49bb('0x23')](function(_0x36ff04){if(_0x36ff04&&_0x36ff04[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x35bb5b['name'],'resourceId':_0x35bb5b['id'],'type':_0x36ff04[_0x49bb('0x28')],'sectionId':_0x36ff04['id']},{})[_0x49bb('0x23')](function(){return _0x435761;});}else{return _0x435761;}})[_0x49bb('0x40')](function(_0x1f273a){logger[_0x49bb('0x52')](_0x49bb('0x4c'),_0x1f273a);throw _0x1f273a;});}return _0x435761;});}})['then'](respondWithResult(_0x3fc2f1,0xc9))[_0x49bb('0x40')](handleError(_0x3fc2f1,null));};exports[_0x49bb('0x22')]=function(_0x56b2e7,_0x4b13e5){if(_0x56b2e7[_0x49bb('0x45')]['id']){delete _0x56b2e7[_0x49bb('0x45')]['id'];}return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x56b2e7[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b13e5,null))[_0x49bb('0x23')](saveUpdates(_0x56b2e7[_0x49bb('0x45')],null))[_0x49bb('0x23')](respondWithResult(_0x4b13e5,null))['catch'](handleError(_0x4b13e5,null));};exports[_0x49bb('0x26')]=function(_0x4a3906,_0x4478f4){return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x4a3906[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4478f4,null))[_0x49bb('0x23')](removeEntity(_0x4478f4,null))[_0x49bb('0x40')](handleError(_0x4478f4,null));};exports[_0x49bb('0x53')]=function(_0xcc062f,_0x52ac3b,_0x29a1b7){var _0x28da4a={'raw':!![],'where':{}};var _0x277e04={};var _0x193259={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0xcc062f[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x52ac3b,null))[_0x49bb('0x23')](function(_0x437d3b){if(_0x437d3b){_0x277e04['model']=_[_0x49bb('0x32')](db[_0x49bb('0x55')][_0x49bb('0x2b')]);_0x277e04[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0xcc062f[_0x49bb('0x31')]);_0x277e04[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x277e04['model'],_0x277e04[_0x49bb('0x31')]);_0x28da4a[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x277e04[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x35')]));_0x28da4a['attributes']=_0x28da4a[_0x49bb('0x36')][_0x49bb('0x37')]?_0x28da4a[_0x49bb('0x36')]:_0x277e04[_0x49bb('0x2f')];if(!_0xcc062f['query'][_0x49bb('0x56')]('nolimit')){_0x28da4a[_0x49bb('0x1e')]=qs['limit'](_0xcc062f['query']['limit']);_0x28da4a[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xcc062f['query']['offset']);}_0x28da4a[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x38')]);_0x28da4a[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0xcc062f[_0x49bb('0x31')],_0x277e04[_0x49bb('0x33')]));_0x28da4a[_0x49bb('0x39')][_0x49bb('0x59')]=_0x437d3b['id'];if(_0xcc062f['query'][_0x49bb('0x3a')]){_0x28da4a[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x28da4a[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x28da4a[_0x49bb('0x36')],function(_0x3454be){var _0x500af1={};_0x500af1[_0x3454be]={'$like':'%'+_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x500af1;})});}_0x28da4a=_['merge']({},_0x28da4a,_0xcc062f[_0x49bb('0x3d')]);return db[_0x49bb('0x55')]['count']({'where':_0x28da4a[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x37f97b){_0x193259[_0x49bb('0x1f')]=_0x37f97b;if(_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x28da4a['include']=[{'all':!![]}];}return db['CmHopper'][_0x49bb('0x5a')](_0x28da4a);})[_0x49bb('0x23')](function(_0x1499b6){_0x193259[_0x49bb('0x3f')]=_0x1499b6;return _0x193259;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x52ac3b,_0x28da4a))[_0x49bb('0x40')](handleError(_0x52ac3b,null));};exports[_0x49bb('0x5b')]=function(_0xc7016a,_0x136726,_0x36db19){var _0x3459de={'raw':!![],'where':{}};var _0x426505={};var _0x81e179={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0xc7016a['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x136726,null))['then'](function(_0x7897dd){if(_0x7897dd){_0x426505[_0x49bb('0x2f')]=_['keys'](db['CmHopperHistory'][_0x49bb('0x2b')]);_0x426505[_0x49bb('0x31')]=_['keys'](_0xc7016a[_0x49bb('0x31')]);_0x426505[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],_0x426505[_0x49bb('0x31')]);_0x3459de[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],qs['fields'](_0xc7016a[_0x49bb('0x31')]['fields']));_0x3459de[_0x49bb('0x36')]=_0x3459de[_0x49bb('0x36')][_0x49bb('0x37')]?_0x3459de['attributes']:_0x426505[_0x49bb('0x2f')];if(!_0xc7016a[_0x49bb('0x31')][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x3459de[_0x49bb('0x1e')]=qs['limit'](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x3459de[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x3459de[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x38')]);_0x3459de[_0x49bb('0x39')]=qs['filters'](_[_0x49bb('0x58')](_0xc7016a[_0x49bb('0x31')],_0x426505[_0x49bb('0x33')]));_0x3459de[_0x49bb('0x39')]['CampaignId']=_0x7897dd['id'];if(_0xc7016a[_0x49bb('0x31')]['filter']){_0x3459de[_0x49bb('0x39')]=_['merge'](_0x3459de[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x3459de[_0x49bb('0x36')],function(_0x2b953a){var _0x5d4c93={};_0x5d4c93[_0x2b953a]={'$like':'%'+_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x5d4c93;})});}_0x3459de=_[_0x49bb('0x3b')]({},_0x3459de,_0xc7016a[_0x49bb('0x3d')]);return db[_0x49bb('0x5d')]['count']({'where':_0x3459de[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x46fcc5){_0x81e179['count']=_0x46fcc5;if(_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x3459de['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x49bb('0x5a')](_0x3459de);})[_0x49bb('0x23')](function(_0x2a40aa){_0x81e179[_0x49bb('0x3f')]=_0x2a40aa;return _0x81e179;});}})['then'](respondWithFilteredResult(_0x136726,_0x3459de))[_0x49bb('0x40')](handleError(_0x136726,null));};exports[_0x49bb('0x5e')]=function(_0x535bed,_0x137965,_0x208e1b){var _0x1c9cfb={'raw':!![],'where':{}};var _0x4157ae={};var _0x1b0529={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0x535bed['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x137965,null))['then'](function(_0x36bf90){if(_0x36bf90){_0x4157ae[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x5f')][_0x49bb('0x2b')]);_0x4157ae[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x535bed['query']);_0x4157ae[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x4157ae['model'],_0x4157ae[_0x49bb('0x31')]);_0x1c9cfb[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x4157ae[_0x49bb('0x2f')],qs['fields'](_0x535bed['query'][_0x49bb('0x35')]));_0x1c9cfb['attributes']=_0x1c9cfb[_0x49bb('0x36')]['length']?_0x1c9cfb[_0x49bb('0x36')]:_0x4157ae[_0x49bb('0x2f')];if(!_0x535bed[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1c9cfb[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x535bed['query']['limit']);_0x1c9cfb[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x535bed['query'][_0x49bb('0x1c')]);}_0x1c9cfb[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x535bed['query'][_0x49bb('0x38')]);_0x1c9cfb[_0x49bb('0x39')]=qs['filters'](_['pick'](_0x535bed['query'],_0x4157ae[_0x49bb('0x33')]));_0x1c9cfb[_0x49bb('0x39')][_0x49bb('0x59')]=_0x36bf90['id'];if(_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x1c9cfb['where']=_['merge'](_0x1c9cfb[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x1c9cfb['attributes'],function(_0x5b1f07){var _0x378128={};_0x378128[_0x5b1f07]={'$like':'%'+_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x378128;})});}_0x1c9cfb=_['merge']({},_0x1c9cfb,_0x535bed[_0x49bb('0x3d')]);return db[_0x49bb('0x5f')]['count']({'where':_0x1c9cfb[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x3b7d47){_0x1b0529[_0x49bb('0x1f')]=_0x3b7d47;if(_0x535bed['query'][_0x49bb('0x3e')]){_0x1c9cfb[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x5f')][_0x49bb('0x5a')](_0x1c9cfb);})['then'](function(_0x2ccf78){_0x1b0529[_0x49bb('0x3f')]=_0x2ccf78;return _0x1b0529;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x137965,_0x1c9cfb))[_0x49bb('0x40')](handleError(_0x137965,null));};exports[_0x49bb('0x60')]=function(_0x4e6e43,_0x5a4f59,_0x251fc8){var _0x382bf9={'raw':!![],'where':{}};var _0x5bdf3d={};var _0x1dcaac={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x4e6e43[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a4f59,null))['then'](function(_0xe5a2){if(_0xe5a2){_0x5bdf3d[_0x49bb('0x2f')]=_['keys'](db['CmHopperBlack'][_0x49bb('0x2b')]);_0x5bdf3d[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x4e6e43['query']);_0x5bdf3d[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],_0x5bdf3d[_0x49bb('0x31')]);_0x382bf9[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],qs['fields'](_0x4e6e43[_0x49bb('0x31')]['fields']));_0x382bf9[_0x49bb('0x36')]=_0x382bf9[_0x49bb('0x36')][_0x49bb('0x37')]?_0x382bf9['attributes']:_0x5bdf3d[_0x49bb('0x2f')];if(!_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x382bf9[_0x49bb('0x1e')]=qs['limit'](_0x4e6e43['query'][_0x49bb('0x1e')]);_0x382bf9['offset']=qs[_0x49bb('0x1c')](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x382bf9[_0x49bb('0x57')]=qs['sort'](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x38')]);_0x382bf9[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x4e6e43[_0x49bb('0x31')],_0x5bdf3d[_0x49bb('0x33')]));_0x382bf9[_0x49bb('0x39')][_0x49bb('0x59')]=_0xe5a2['id'];if(_0x4e6e43[_0x49bb('0x31')]['filter']){_0x382bf9[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x382bf9['where'],{'$or':_[_0x49bb('0x30')](_0x382bf9[_0x49bb('0x36')],function(_0x12b674){var _0x2822f7={};_0x2822f7[_0x12b674]={'$like':'%'+_0x4e6e43['query']['filter']+'%'};return _0x2822f7;})});}_0x382bf9=_[_0x49bb('0x3b')]({},_0x382bf9,_0x4e6e43[_0x49bb('0x3d')]);return db[_0x49bb('0x61')]['count']({'where':_0x382bf9['where']})[_0x49bb('0x23')](function(_0xf5c477){_0x1dcaac['count']=_0xf5c477;if(_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x382bf9[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x61')]['findAll'](_0x382bf9);})['then'](function(_0x1770bc){_0x1dcaac[_0x49bb('0x3f')]=_0x1770bc;return _0x1dcaac;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x5a4f59,_0x382bf9))['catch'](handleError(_0x5a4f59,null));};exports[_0x49bb('0x62')]=function(_0x9f2ff7,_0x3f93bd,_0x504b4f){var _0x582b42={};var _0x2948a0={};var _0x5a861f;var _0xaf6237;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x9f2ff7[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x3f93bd,null))[_0x49bb('0x23')](function(_0x59e5c1){if(_0x59e5c1){_0x5a861f=_0x59e5c1;_0x2948a0[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x63')][_0x49bb('0x2b')]);_0x2948a0[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x9f2ff7[_0x49bb('0x31')]);_0x2948a0[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],_0x2948a0['query']);_0x582b42[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x9f2ff7[_0x49bb('0x31')]['fields']));_0x582b42[_0x49bb('0x36')]=_0x582b42[_0x49bb('0x36')][_0x49bb('0x37')]?_0x582b42[_0x49bb('0x36')]:_0x2948a0[_0x49bb('0x2f')];_0x582b42[_0x49bb('0x57')]=qs['sort'](_0x9f2ff7['query']['sort']);_0x582b42[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x9f2ff7[_0x49bb('0x31')],_0x2948a0[_0x49bb('0x33')]));if(_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x582b42[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x582b42['where'],{'$or':_[_0x49bb('0x30')](_0x582b42[_0x49bb('0x36')],function(_0x42b52f){var _0x22a2e3={};_0x22a2e3[_0x42b52f]={'$like':'%'+_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x22a2e3;})});}_0x582b42=_[_0x49bb('0x3b')]({},_0x582b42,_0x9f2ff7['options']);return _0x5a861f['getLists'](_0x582b42);}})['then'](function(_0x521567){if(_0x521567){_0xaf6237=_0x521567[_0x49bb('0x37')];if(!_0x9f2ff7['query'][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x582b42[_0x49bb('0x1e')]=qs['limit'](_0x9f2ff7['query']['limit']);_0x582b42[_0x49bb('0x1c')]=qs['offset'](_0x9f2ff7['query']['offset']);}return _0x5a861f[_0x49bb('0x62')](_0x582b42);}})[_0x49bb('0x23')](function(_0x5eec09){if(_0x5eec09){return _0x5eec09?{'count':_0xaf6237,'rows':_0x5eec09}:null;}})['then'](respondWithResult(_0x3f93bd,null))['catch'](handleError(_0x3f93bd,null));};exports['addLists']=function(_0x333a64,_0x4742be,_0x3ef899){var _0x29e5f9,_0x38a3d5;var _0xd2cd1a=[];var _0x3d761d=moment()[_0x49bb('0x64')](_0x49bb('0x65'));return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x333a64[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4742be,null))[_0x49bb('0x23')](function(_0x4092df){if(_0x4092df){_0x38a3d5=_0x4092df;return _0x4092df[_0x49bb('0x66')](_0x333a64[_0x49bb('0x45')][_0x49bb('0x67')],_[_0x49bb('0x4f')](_0x333a64[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})[_0x49bb('0x68')](function(_0x534677){var _0x5b27b1;var _0x3d1da9;_0x29e5f9=_0x534677||[];var _0x20a650=[];if(_0x534677){for(var _0x33c254=0x0;_0x33c254<_0x534677[_0x49bb('0x37')];_0x33c254+=0x1){var _0x403726=_0x534677[_0x33c254]['get']({'plain':!![]});_0x38a3d5[_0x49bb('0x69')]=_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]?_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]:_0x38a3d5['dialCheckDuplicateType'];switch(_0x38a3d5[_0x49bb('0x69')]){case _0x49bb('0x6a'):_0x5b27b1=squel[_0x49bb('0x6b')]()['into'](_0x49bb('0x6c'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x6f'),'ContactId',_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),'updatedAt'],squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('phone','phone')[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))['field']('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))['from'](_0x49bb('0x77'))['where'](_0x49bb('0x78'))[_0x49bb('0x39')](_0x49bb('0x79'),_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a'))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()['field'](_0x49bb('0x7c'))[_0x49bb('0x7d')](_0x49bb('0x7e'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]()))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')[_0x49bb('0x7d')](_0x49bb('0x6c'))['where'](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())))[_0x49bb('0x76')]();break;case _0x49bb('0x80'):_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')](_0x49bb('0x6c'))[_0x49bb('0x6d')](['phone',_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x49bb('0x72')](_0x49bb('0x6e'),_0x49bb('0x6e'))['field']('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')](_0x49bb('0x77'))[_0x49bb('0x39')](_0x49bb('0x78'))['where'](_0x49bb('0x79'),_0x403726[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0x49bb('0x6c'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64['params']['id'][_0x49bb('0x76')]())))['toString']();break;default:_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper')['fromQuery']([_0x49bb('0x6e'),_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x6e'),'phone')[_0x49bb('0x72')]('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')]['toString'](),_0x49bb('0x70'))['field'](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')](_0x49bb('0x78'))[_0x49bb('0x39')]('ListId\x20=\x20?',_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();}_0x3d1da9=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper_additional_phones')[_0x49bb('0x6d')]([_0x49bb('0x82'),_0x49bb('0x6f'),_0x49bb('0x6e'),'OrderBy',_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x83'),'id')['field'](_0x49bb('0x73'),_0x49bb('0x6f'))['field']('ci.item',_0x49bb('0x6e'))[_0x49bb('0x72')]('ci.OrderBY','OrderBy')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contact_has_items','ci')[_0x49bb('0x84')](_0x49bb('0x6c'),'h',_0x49bb('0x85'))[_0x49bb('0x39')](_0x49bb('0x86'),_0x403726[_0x49bb('0x75')][_0x49bb('0x76')]())['where'](_0x49bb('0x87'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x88'),_0x3d761d))[_0x49bb('0x76')]();_0x20a650['push'](db['sequelize'][_0x49bb('0x31')](_0x5b27b1));_0xd2cd1a[_0x49bb('0x89')](db[_0x49bb('0x8a')][_0x49bb('0x31')](_0x3d1da9));}return BPromise[_0x49bb('0x8b')](_0x20a650);}})[_0x49bb('0x23')](function(){return BPromise[_0x49bb('0x8b')](_0xd2cd1a);})[_0x49bb('0x23')](function(){return _0x29e5f9;})[_0x49bb('0x23')](respondWithResult(_0x4742be,null))[_0x49bb('0x40')](handleError(_0x4742be,null));};exports[_0x49bb('0x8c')]=function(_0x463ed6,_0x4f887c,_0x6cfddb){return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4f887c,null))['then'](function(_0x2e2e87){if(_0x2e2e87){return _0x2e2e87[_0x49bb('0x8c')](_0x463ed6[_0x49bb('0x31')]['ids']);}})['then'](function(_0x45957b){if(_0x45957b){return db[_0x49bb('0x55')][_0x49bb('0x26')]({'where':{'ListId':_0x463ed6[_0x49bb('0x31')][_0x49bb('0x67')],'CampaignId':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](function(){return _0x45957b;});}})[_0x49bb('0x23')](respondWithStatusCode(_0x4f887c,null))[_0x49bb('0x40')](handleError(_0x4f887c,null));};exports[_0x49bb('0x8d')]=function(_0x5418e4,_0x4e133b,_0x460091){var _0x1346fa={};var _0x52a9d4={};var _0x7f3477;var _0x3b0592;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x5418e4[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4e133b,null))[_0x49bb('0x23')](function(_0x1036f0){if(_0x1036f0){_0x7f3477=_0x1036f0;_0x52a9d4[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db['CmList'][_0x49bb('0x2b')]);_0x52a9d4['query']=_[_0x49bb('0x32')](_0x5418e4[_0x49bb('0x31')]);_0x52a9d4[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x52a9d4[_0x49bb('0x2f')],_0x52a9d4[_0x49bb('0x31')]);_0x1346fa[_0x49bb('0x36')]=_['intersection'](_0x52a9d4[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x5418e4['query'][_0x49bb('0x35')]));_0x1346fa[_0x49bb('0x36')]=_0x1346fa[_0x49bb('0x36')][_0x49bb('0x37')]?_0x1346fa[_0x49bb('0x36')]:_0x52a9d4['model'];_0x1346fa[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x5418e4['query'][_0x49bb('0x38')]);_0x1346fa[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x5418e4[_0x49bb('0x31')],_0x52a9d4['filters']));if(_0x5418e4[_0x49bb('0x31')]['filter']){_0x1346fa['where']=_[_0x49bb('0x3b')](_0x1346fa[_0x49bb('0x39')],{'$or':_['map'](_0x1346fa[_0x49bb('0x36')],function(_0x38bac0){var _0x1021ea={};_0x1021ea[_0x38bac0]={'$like':'%'+_0x5418e4[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x1021ea;})});}_0x1346fa=_['merge']({},_0x1346fa,_0x5418e4[_0x49bb('0x3d')]);return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x162884){if(_0x162884){_0x3b0592=_0x162884[_0x49bb('0x37')];if(!_0x5418e4[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1346fa[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x1346fa[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1c')]);}return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x5bd052){if(_0x5bd052){return _0x5bd052?{'count':_0x3b0592,'rows':_0x5bd052}:null;}})[_0x49bb('0x23')](respondWithResult(_0x4e133b,null))[_0x49bb('0x40')](handleError(_0x4e133b,null));};exports[_0x49bb('0x8e')]=function(_0x5cc812,_0x308a85,_0x526469){var _0x2e4be8,_0x139929;var _0x17f942=[];var _0x4456b3=moment()[_0x49bb('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x5cc812[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x308a85,null))[_0x49bb('0x23')](function(_0xac35e6){if(_0xac35e6){_0x139929=_0xac35e6;return _0xac35e6[_0x49bb('0x8e')](_0x5cc812[_0x49bb('0x45')][_0x49bb('0x67')],_['omit'](_0x5cc812[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})['spread'](function(_0x2caab6){var _0x5cc412;var _0x34e4bb;_0x2e4be8=_0x2caab6||[];var _0x1c7a91=[];if(_0x2caab6){for(var _0x44ef98=0x0;_0x44ef98<_0x2caab6[_0x49bb('0x37')];_0x44ef98+=0x1){var _0x526e52=_0x2caab6[_0x44ef98][_0x49bb('0x46')]({'plain':!![]});_0x5cc412=squel['insert']()[_0x49bb('0x81')](_0x49bb('0x8f'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),'createdAt',_0x49bb('0x50')],squel['select']()[_0x49bb('0x72')]('phone',_0x49bb('0x6e'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x526e52[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x5cc812[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')['field']('NOW()',_0x49bb('0x4e'))[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')]('deletedAt\x20IS\x20NULL')[_0x49bb('0x39')]('ListId\x20=\x20?',_0x526e52[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();_0x1c7a91[_0x49bb('0x89')](db['sequelize']['query'](_0x5cc412));}return BPromise[_0x49bb('0x8b')](_0x1c7a91);}})[_0x49bb('0x23')](function(){return _0x2e4be8;})[_0x49bb('0x23')](respondWithResult(_0x308a85,null))['catch'](handleError(_0x308a85,null));};exports[_0x49bb('0x90')]=function(_0x423817,_0xbf83a4,_0x2084e3){return db[_0x49bb('0x2a')]['find']({'where':{'id':_0x423817[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0xbf83a4,null))[_0x49bb('0x23')](function(_0x32ebdd){if(_0x32ebdd){return _0x32ebdd[_0x49bb('0x90')](_0x423817['query']['ids']);}})[_0x49bb('0x23')](function(_0x8a44b6){if(_0x8a44b6){return db[_0x49bb('0x61')][_0x49bb('0x26')]({'where':{'ListId':_0x423817[_0x49bb('0x31')]['ids'],'CampaignId':_0x423817[_0x49bb('0x41')]['id']}})['then'](function(){return _0x8a44b6;});}})[_0x49bb('0x23')](respondWithStatusCode(_0xbf83a4,null))[_0x49bb('0x40')](handleError(_0xbf83a4,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 011347a..93091ca 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index fc995f3..5079682 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 _0xd6ce=['raw','attributes','limit','map','include','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','GetCampaign','Campaign','options'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd6ce,0x127));var _0xed6c=function(_0x1a3663,_0x48e1ec){_0x1a3663=_0x1a3663-0x0;var _0x57a0ce=_0xd6ce[_0x1a3663];return _0x57a0ce;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var moment=require(_0xed6c('0x2'));var BPromise=require(_0xed6c('0x3'));var rs=require(_0xed6c('0x4'));var fs=require('fs');var Redis=require(_0xed6c('0x5'));var db=require(_0xed6c('0x6'))['db'];var utils=require(_0xed6c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xed6c('0x8'));var jayson=require(_0xed6c('0x9'));var client=jayson[_0xed6c('0xa')][_0xed6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6546,_0x5e0e3a,_0x7668a7){return new BPromise(function(_0x46e2c4,_0x4fd673){return client['request'](_0x4a6546,_0x7668a7)[_0xed6c('0xc')](function(_0xc996c4){logger[_0xed6c('0xd')](_0xed6c('0xe'),_0x5e0e3a,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x5e0e3a,'request\x20sent',JSON[_0xed6c('0xf')](_0xc996c4));if(_0xc996c4['error']){if(_0xc996c4['error'][_0xed6c('0x10')]===0x1f4){logger[_0xed6c('0x11')]('Campaign,\x20%s,\x20%s',_0x5e0e3a,_0xc996c4[_0xed6c('0x11')]['message']);return _0x4fd673(_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);}logger['error'](_0xed6c('0xe'),_0x5e0e3a,_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);return _0x46e2c4(_0xc996c4[_0xed6c('0x11')]['message']);}else{logger['info'](_0xed6c('0xe'),_0x5e0e3a,_0xed6c('0x13'));_0x46e2c4(_0xc996c4[_0xed6c('0x14')]['message']);}})[_0xed6c('0x15')](function(_0x526c54){logger[_0xed6c('0x11')](_0xed6c('0xe'),_0x5e0e3a,_0x526c54);_0x4fd673(_0x526c54);});});}exports[_0xed6c('0x16')]=function(_0x1fe8c0){var _0x4a920e=this;return new Promise(function(_0x387ba1,_0x1856f7){return db[_0xed6c('0x17')]['findAll']({'raw':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')][_0xed6c('0x19')]===undefined?!![]:![]:!![],'where':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')]['where']||null:null,'attributes':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0['options'][_0xed6c('0x1a')]||null:null,'limit':_0x1fe8c0[_0xed6c('0x18')]?_0x1fe8c0[_0xed6c('0x18')][_0xed6c('0x1b')]||null:null,'include':_0x1fe8c0['options']?_0x1fe8c0[_0xed6c('0x18')]['include']?_[_0xed6c('0x1c')](_0x1fe8c0['options'][_0xed6c('0x1d')],function(_0x21e0ba){return{'model':db[_0x21e0ba[_0xed6c('0x1e')]],'as':_0x21e0ba['as'],'attributes':_0x21e0ba[_0xed6c('0x1a')],'include':_0x21e0ba[_0xed6c('0x1d')]?_[_0xed6c('0x1c')](_0x21e0ba[_0xed6c('0x1d')],function(_0x27fb6c){return{'model':db[_0x27fb6c[_0xed6c('0x1e')]],'as':_0x27fb6c['as'],'attributes':_0x27fb6c[_0xed6c('0x1a')],'include':_0x27fb6c[_0xed6c('0x1d')]?_['map'](_0x27fb6c[_0xed6c('0x1d')],function(_0x27484c){return{'model':db[_0x27484c[_0xed6c('0x1e')]],'as':_0x27484c['as'],'attributes':_0x27484c[_0xed6c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xed6c('0xc')](function(_0x3574a3){logger['info'](_0xed6c('0x16'),_0x1fe8c0);logger[_0xed6c('0x1f')](_0xed6c('0x16'),_0x1fe8c0,JSON['stringify'](_0x3574a3));_0x387ba1(_0x3574a3);})['catch'](function(_0x531cd0){logger['error'](_0xed6c('0x16'),_0x531cd0['message'],_0x1fe8c0);_0x1856f7(_0x4a920e[_0xed6c('0x11')](0x1f4,_0x531cd0['message']));});});};
\ No newline at end of file
+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(_0x231a02,_0x2a9e36){var _0x3ae533=function(_0xba726e){while(--_0xba726e){_0x231a02['push'](_0x231a02['shift']());}};_0x3ae533(++_0x2a9e36);}(_0x37b4,0xef));var _0x437b=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x37b4[_0xd1d19a];return _0x52a79d;};'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
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 62924a2..42fb499 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 _0x2932=['post','/:id/clone','clone','/:id/lists','addLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists'];(function(_0x12e930,_0x3b89df){var _0x82603c=function(_0x39ec44){while(--_0x39ec44){_0x12e930['push'](_0x12e930['shift']());}};_0x82603c(++_0x3b89df);}(_0x2932,0x198));var _0x2293=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0x2932[_0x310990];return _0x648534;};'use strict';var multer=require(_0x2293('0x0'));var util=require(_0x2293('0x1'));var path=require(_0x2293('0x2'));var timeout=require('connect-timeout');var express=require(_0x2293('0x3'));var router=express[_0x2293('0x4')]();var fs_extra=require(_0x2293('0x5'));var auth=require(_0x2293('0x6'));var interaction=require(_0x2293('0x7'));var config=require(_0x2293('0x8'));var controller=require('./campaign.controller');router[_0x2293('0x9')]('/',auth['isAuthenticated'](),controller[_0x2293('0xa')]);router['get']('/:id',auth[_0x2293('0xb')](),controller['show']);router['get'](_0x2293('0xc'),auth['isAuthenticated'](),controller[_0x2293('0xd')]);router[_0x2293('0x9')](_0x2293('0xe'),auth[_0x2293('0xb')](),controller[_0x2293('0xf')]);router[_0x2293('0x9')](_0x2293('0x10'),auth[_0x2293('0xb')](),controller[_0x2293('0x11')]);router[_0x2293('0x9')](_0x2293('0x12'),auth[_0x2293('0xb')](),controller['getHopperBlacks']);router[_0x2293('0x9')]('/:id/lists',auth[_0x2293('0xb')](),controller[_0x2293('0x13')]);router[_0x2293('0x9')](_0x2293('0x14'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x2293('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2293('0x16'),auth[_0x2293('0xb')](),controller[_0x2293('0x17')]);router[_0x2293('0x15')](_0x2293('0x18'),auth[_0x2293('0xb')](),controller[_0x2293('0x19')]);router[_0x2293('0x15')](_0x2293('0x14'),auth[_0x2293('0xb')](),controller['addBlackLists']);router[_0x2293('0x1a')](_0x2293('0x1b'),auth[_0x2293('0xb')](),controller[_0x2293('0x1c')]);router[_0x2293('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x2293('0x1e')]);router[_0x2293('0x1d')]('/:id/lists',auth['isAuthenticated'](),controller[_0x2293('0x1f')]);router[_0x2293('0x1d')]('/:id/blacklists',auth[_0x2293('0xb')](),controller[_0x2293('0x20')]);module['exports']=router;
\ No newline at end of file
+var _0xf185=['/:id/lists','getLists','/:id/blacklists','getBlackLists','/:id/clone','clone','post','addLists','addBlackLists','update','removeLists','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0x32ce61,_0x2ba733){var _0x28eded=function(_0x34db11){while(--_0x34db11){_0x32ce61['push'](_0x32ce61['shift']());}};_0x28eded(++_0x2ba733);}(_0xf185,0x1be));var _0x5f18=function(_0x3cd774,_0x1c01b1){_0x3cd774=_0x3cd774-0x0;var _0x1f4922=_0xf185[_0x3cd774];return _0x1f4922;};'use strict';var multer=require(_0x5f18('0x0'));var util=require('util');var path=require(_0x5f18('0x1'));var timeout=require(_0x5f18('0x2'));var express=require(_0x5f18('0x3'));var router=express[_0x5f18('0x4')]();var fs_extra=require(_0x5f18('0x5'));var auth=require(_0x5f18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f18('0x7'));var controller=require(_0x5f18('0x8'));router[_0x5f18('0x9')]('/',auth[_0x5f18('0xa')](),controller['index']);router[_0x5f18('0x9')](_0x5f18('0xb'),auth['isAuthenticated'](),controller[_0x5f18('0xc')]);router['get'](_0x5f18('0xd'),auth[_0x5f18('0xa')](),controller['getHoppers']);router[_0x5f18('0x9')](_0x5f18('0xe'),auth['isAuthenticated'](),controller[_0x5f18('0xf')]);router[_0x5f18('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x5f18('0x10')]);router[_0x5f18('0x9')](_0x5f18('0x11'),auth['isAuthenticated'](),controller[_0x5f18('0x12')]);router[_0x5f18('0x9')](_0x5f18('0x13'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x14')]);router[_0x5f18('0x9')](_0x5f18('0x15'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x16')]);router['post']('/',auth[_0x5f18('0xa')](),controller['create']);router['post'](_0x5f18('0x17'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x18')]);router[_0x5f18('0x19')](_0x5f18('0x13'),auth['isAuthenticated'](),controller[_0x5f18('0x1a')]);router[_0x5f18('0x19')](_0x5f18('0x15'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x1b')]);router['put'](_0x5f18('0xb'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x1c')]);router['delete'](_0x5f18('0xb'),auth[_0x5f18('0xa')](),controller['destroy']);router['delete'](_0x5f18('0x13'),auth[_0x5f18('0xa')](),controller[_0x5f18('0x1d')]);router[_0x5f18('0x1e')](_0x5f18('0x15'),auth[_0x5f18('0xa')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 7f4d009..b784986 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 _0x3d36=['key','sequelize','exports','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0x392750,_0x5c5b7d){var _0x514afd=function(_0x1be1b4){while(--_0x1be1b4){_0x392750['push'](_0x392750['shift']());}};_0x514afd(++_0x5c5b7d);}(_0x3d36,0x171));var _0x63d3=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x3d36[_0x237546];return _0x233e29;};'use strict';var Sequelize=require(_0x63d3('0x0'));module[_0x63d3('0x1')]={'key':{'type':Sequelize[_0x63d3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x63d3('0x3')],'length':_0x63d3('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x63d3('0x2')]},'name':{'type':Sequelize[_0x63d3('0x5')],'get':function(){return this[_0x63d3('0x6')](_0x63d3('0x7'));}}};
\ No newline at end of file
+var _0x98ee=['sequelize','exports','STRING','TEXT','VIRTUAL','key'];(function(_0x236fd6,_0x55fb7d){var _0x479e14=function(_0x7488ef){while(--_0x7488ef){_0x236fd6['push'](_0x236fd6['shift']());}};_0x479e14(++_0x55fb7d);}(_0x98ee,0x144));var _0xe98e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x98ee[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xe98e('0x0'));module[_0xe98e('0x1')]={'key':{'type':Sequelize[_0xe98e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe98e('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe98e('0x4')],'get':function(){return this['getDataValue'](_0xe98e('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 08cde5e..cf0ff41 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 _0x09e2=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','rows','catch','show','params','body','find','create','key','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x09e2,0x1b6));var _0x209e=function(_0x25cfcd,_0x5a294d){_0x25cfcd=_0x25cfcd-0x0;var _0x421a40=_0x09e2[_0x25cfcd];return _0x421a40;};'use strict';var emlformat=require(_0x209e('0x0'));var rimraf=require(_0x209e('0x1'));var zipdir=require(_0x209e('0x2'));var jsonpatch=require(_0x209e('0x3'));var rp=require(_0x209e('0x4'));var moment=require(_0x209e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x209e('0x6'));var util=require(_0x209e('0x7'));var path=require(_0x209e('0x8'));var sox=require(_0x209e('0x9'));var csv=require(_0x209e('0xa'));var ejs=require(_0x209e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x209e('0xc'));var squel=require(_0x209e('0xd'));var crypto=require(_0x209e('0xe'));var jsforce=require(_0x209e('0xf'));var deskjs=require(_0x209e('0x10'));var toCsv=require(_0x209e('0xa'));var querystring=require(_0x209e('0x11'));var Papa=require(_0x209e('0x12'));var Redis=require(_0x209e('0x13'));var authService=require(_0x209e('0x14'));var qs=require(_0x209e('0x15'));var as=require(_0x209e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x209e('0x17'))(_0x209e('0x18'));var utils=require('../../config/utils');var config=require(_0x209e('0x19'));var licenseUtil=require(_0x209e('0x1a'));var db=require(_0x209e('0x1b'))['db'];function respondWithStatusCode(_0x59c41c,_0x3a1040){_0x3a1040=_0x3a1040||0xcc;return function(_0x96c550){if(_0x96c550){return _0x59c41c[_0x209e('0x1c')](_0x3a1040);}return _0x59c41c['status'](_0x3a1040)[_0x209e('0x1d')]();};}function respondWithResult(_0x8627be,_0x55b607){_0x55b607=_0x55b607||0xc8;return function(_0x39c45d){if(_0x39c45d){return _0x8627be[_0x209e('0x1e')](_0x55b607)[_0x209e('0x1f')](_0x39c45d);}};}function respondWithFilteredResult(_0x548200,_0x4a40c1){return function(_0xb0151c){if(_0xb0151c){var _0x4c7eee=typeof _0x4a40c1['offset']==='undefined'&&typeof _0x4a40c1[_0x209e('0x20')]===_0x209e('0x21');var _0x3f5685=_0xb0151c[_0x209e('0x22')];var _0x19460b=_0x4c7eee?0x0:_0x4a40c1[_0x209e('0x23')];var _0x4a3a44=_0x4c7eee?_0xb0151c[_0x209e('0x22')]:_0x4a40c1['offset']+_0x4a40c1[_0x209e('0x20')];var _0x4b204d;if(_0x4a3a44>=_0x3f5685){_0x4a3a44=_0x3f5685;_0x4b204d=0xc8;}else{_0x4b204d=0xce;}_0x548200[_0x209e('0x1e')](_0x4b204d);return _0x548200[_0x209e('0x24')](_0x209e('0x25'),_0x19460b+'-'+_0x4a3a44+'/'+_0x3f5685)[_0x209e('0x1f')](_0xb0151c);}return null;};}function patchUpdates(_0x59cd19){return function(_0x5a1fdb){try{jsonpatch[_0x209e('0x26')](_0x5a1fdb,_0x59cd19,!![]);}catch(_0x4c41b0){return BPromise[_0x209e('0x27')](_0x4c41b0);}return _0x5a1fdb[_0x209e('0x28')]();};}function saveUpdates(_0x2ffcc6,_0x57dfe1){return function(_0x4d383c){if(_0x4d383c){return _0x4d383c[_0x209e('0x29')](_0x2ffcc6)[_0x209e('0x2a')](function(_0xba442e){return _0xba442e;});}return null;};}function removeEntity(_0x113d3d,_0x4ae2e1){return function(_0xbda9d6){if(_0xbda9d6){return _0xbda9d6[_0x209e('0x2b')]()[_0x209e('0x2a')](function(){var _0x29f378=_0xbda9d6['get']({'plain':!![]});var _0x530057=_0x209e('0x2c');return db[_0x209e('0x2d')]['destroy']({'where':{'type':_0x530057,'resourceId':_0x29f378['id']}})[_0x209e('0x2a')](function(){return _0xbda9d6;});})['then'](function(){_0x113d3d[_0x209e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e2938,_0x4de8af){return function(_0x513e3b){if(!_0x513e3b){_0x4e2938[_0x209e('0x1c')](0x194);}return _0x513e3b;};}function handleError(_0x36ccfe,_0x2dad3b){_0x2dad3b=_0x2dad3b||0x1f4;return function(_0x4c6d4){logger['error'](_0x4c6d4[_0x209e('0x2e')]);if(_0x4c6d4[_0x209e('0x2f')]){delete _0x4c6d4[_0x209e('0x2f')];}_0x36ccfe[_0x209e('0x1e')](_0x2dad3b)['send'](_0x4c6d4);};}exports[_0x209e('0x30')]=function(_0x47456a,_0x2b9b8f){var _0x4e3499={},_0x430c9a={},_0x2bccf1={'count':0x0,'rows':[]};var _0x59072a=_[_0x209e('0x31')](db[_0x209e('0x32')][_0x209e('0x33')],function(_0x274992){return{'name':_0x274992[_0x209e('0x34')],'type':_0x274992[_0x209e('0x35')]['key']};});_0x430c9a[_0x209e('0x36')]=_['map'](_0x59072a,_0x209e('0x2f'));_0x430c9a[_0x209e('0x37')]=_[_0x209e('0x38')](_0x47456a[_0x209e('0x37')]);_0x430c9a[_0x209e('0x39')]=_[_0x209e('0x3a')](_0x430c9a['model'],_0x430c9a[_0x209e('0x37')]);_0x4e3499[_0x209e('0x3b')]=_[_0x209e('0x3a')](_0x430c9a[_0x209e('0x36')],qs[_0x209e('0x3c')](_0x47456a[_0x209e('0x37')][_0x209e('0x3c')]));_0x4e3499['attributes']=_0x4e3499[_0x209e('0x3b')][_0x209e('0x3d')]?_0x4e3499[_0x209e('0x3b')]:_0x430c9a[_0x209e('0x36')];if(!_0x47456a['query'][_0x209e('0x3e')]('nolimit')){_0x4e3499[_0x209e('0x20')]=qs[_0x209e('0x20')](_0x47456a['query']['limit']);_0x4e3499[_0x209e('0x23')]=qs[_0x209e('0x23')](_0x47456a['query'][_0x209e('0x23')]);}_0x4e3499[_0x209e('0x3f')]=qs[_0x209e('0x40')](_0x47456a[_0x209e('0x37')][_0x209e('0x40')]);_0x4e3499[_0x209e('0x41')]=qs['filters'](_[_0x209e('0x42')](_0x47456a[_0x209e('0x37')],_0x430c9a[_0x209e('0x39')]),_0x59072a);if(_0x47456a[_0x209e('0x37')][_0x209e('0x43')]){_0x4e3499['where']=_[_0x209e('0x44')](_0x4e3499[_0x209e('0x41')],{'$or':[{'key':{'$like':'%'+_0x47456a['query']['filter']+'%'}},{'value':{'$like':'%'+_0x47456a[_0x209e('0x37')][_0x209e('0x43')]+'%'}}]});}_0x4e3499=_[_0x209e('0x44')]({},_0x4e3499,_0x47456a[_0x209e('0x45')]);var _0x3f41ba={'where':_0x4e3499[_0x209e('0x41')]};return db['CannedAnswer'][_0x209e('0x22')](_0x3f41ba)[_0x209e('0x2a')](function(_0x4a412e){_0x2bccf1[_0x209e('0x22')]=_0x4a412e;if(_0x47456a[_0x209e('0x37')]['includeAll']){_0x4e3499['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4e3499);})[_0x209e('0x2a')](function(_0x114978){_0x2bccf1[_0x209e('0x46')]=_0x114978;return _0x2bccf1;})[_0x209e('0x2a')](respondWithFilteredResult(_0x2b9b8f,_0x4e3499))[_0x209e('0x47')](handleError(_0x2b9b8f,null));};exports[_0x209e('0x48')]=function(_0x418b59,_0xb3fc48){var _0x475208={'raw':!![],'where':{'id':_0x418b59[_0x209e('0x49')]['id']}},_0x193ca7={};_0x193ca7[_0x209e('0x36')]=_[_0x209e('0x38')](db[_0x209e('0x32')][_0x209e('0x33')]);_0x193ca7[_0x209e('0x37')]=_[_0x209e('0x38')](_0x418b59[_0x209e('0x37')]);_0x193ca7['filters']=_[_0x209e('0x3a')](_0x193ca7['model'],_0x193ca7[_0x209e('0x37')]);_0x475208[_0x209e('0x3b')]=_['intersection'](_0x193ca7['model'],qs[_0x209e('0x3c')](_0x418b59[_0x209e('0x37')][_0x209e('0x3c')]));_0x475208['attributes']=_0x475208[_0x209e('0x3b')]['length']?_0x475208[_0x209e('0x3b')]:_0x193ca7['model'];if(_0x418b59['query']['includeAll']){_0x475208['include']=[{'all':!![]}];}_0x475208=_[_0x209e('0x44')]({},_0x475208,_0x418b59[_0x209e('0x45')]);return db[_0x209e('0x32')]['find'](_0x475208)['then'](handleEntityNotFound(_0xb3fc48,null))['then'](respondWithResult(_0xb3fc48,null))[_0x209e('0x47')](handleError(_0xb3fc48,null));};exports[_0x209e('0x29')]=function(_0x4a06a9,_0x456c05){if(_0x4a06a9[_0x209e('0x4a')]['id']){delete _0x4a06a9[_0x209e('0x4a')]['id'];}return db['CannedAnswer'][_0x209e('0x4b')]({'where':{'id':_0x4a06a9[_0x209e('0x49')]['id']}})['then'](handleEntityNotFound(_0x456c05,null))['then'](saveUpdates(_0x4a06a9[_0x209e('0x4a')],null))[_0x209e('0x2a')](respondWithResult(_0x456c05,null))[_0x209e('0x47')](handleError(_0x456c05,null));};exports[_0x209e('0x2b')]=function(_0x28f2fb,_0x1b285f){return db[_0x209e('0x32')][_0x209e('0x4b')]({'where':{'id':_0x28f2fb[_0x209e('0x49')]['id']}})[_0x209e('0x2a')](handleEntityNotFound(_0x1b285f,null))[_0x209e('0x2a')](removeEntity(_0x1b285f,null))['catch'](handleError(_0x1b285f,null));};exports[_0x209e('0x4c')]=function(_0x298cad,_0x37f2ae){var _0x53a30e={'key':_0x298cad[_0x209e('0x4a')][_0x209e('0x4d')]};if(_0x298cad[_0x209e('0x4a')][_0x209e('0x4e')]){_0x53a30e[_0x209e('0x4e')]=_0x298cad['body'][_0x209e('0x4e')];}else if(_0x298cad[_0x209e('0x4a')]['SmsAccountId']){_0x53a30e[_0x209e('0x4f')]=_0x298cad[_0x209e('0x4a')][_0x209e('0x4f')];}else if(_0x298cad[_0x209e('0x4a')]['OpenchannelAccountId']){_0x53a30e['OpenchannelAccountId']=_0x298cad[_0x209e('0x4a')]['OpenchannelAccountId'];}else if(_0x298cad[_0x209e('0x4a')][_0x209e('0x50')]){_0x53a30e[_0x209e('0x50')]=_0x298cad['body'][_0x209e('0x50')];}return db[_0x209e('0x32')][_0x209e('0x4b')]({'where':_0x53a30e})[_0x209e('0x2a')](function(_0x3e9cd3){if(_0x3e9cd3){throw new db[(_0x209e('0x51'))][(_0x209e('0x52'))](_0x209e('0x53'));}return db[_0x209e('0x32')][_0x209e('0x4c')](_0x298cad['body']);})[_0x209e('0x2a')](function(_0x327ae5){var _0x1337d9=_0x298cad['user'][_0x209e('0x54')]({'plain':!![]});if(!_0x1337d9)throw new Error(_0x209e('0x55'));if(_0x1337d9['role']===_0x209e('0x56')){var _0x51883f=_0x327ae5[_0x209e('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x209e('0x4b')]({'where':{'name':_0x209e('0x2c'),'userProfileId':_0x1337d9[_0x209e('0x57')]},'raw':!![]})[_0x209e('0x2a')](function(_0x1a4d5c){if(_0x1a4d5c&&_0x1a4d5c[_0x209e('0x58')]===0x0){return db['UserProfileResource'][_0x209e('0x4c')]({'name':_0x51883f[_0x209e('0x2f')],'resourceId':_0x51883f['id'],'type':_0x1a4d5c[_0x209e('0x2f')],'sectionId':_0x1a4d5c['id']},{})[_0x209e('0x2a')](function(){return _0x327ae5;});}else{return _0x327ae5;}})[_0x209e('0x47')](function(_0x361aa6){logger[_0x209e('0x59')](_0x209e('0x5a'),_0x361aa6);throw _0x361aa6;});}return _0x327ae5;})[_0x209e('0x2a')](respondWithResult(_0x37f2ae,0xc9))[_0x209e('0x47')](handleError(_0x37f2ae,null));};
\ No newline at end of file
+var _0xb65b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','map','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','then','include','findAll','rows','catch','params','CannedAnswer','rawAttributes','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb65b,0x1a1));var _0xbb65=function(_0x4acaee,_0x2a5f32){_0x4acaee=_0x4acaee-0x0;var _0x418cb3=_0xb65b[_0x4acaee];return _0x418cb3;};'use strict';var emlformat=require(_0xbb65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb65('0x1'));var jsonpatch=require(_0xbb65('0x2'));var rp=require(_0xbb65('0x3'));var moment=require(_0xbb65('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb65('0x5'));var util=require(_0xbb65('0x6'));var path=require(_0xbb65('0x7'));var sox=require(_0xbb65('0x8'));var csv=require(_0xbb65('0x9'));var ejs=require(_0xbb65('0xa'));var fs=require('fs');var fs_extra=require(_0xbb65('0xb'));var _=require(_0xbb65('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb65('0xd'));var deskjs=require(_0xbb65('0xe'));var toCsv=require(_0xbb65('0x9'));var querystring=require('querystring');var Papa=require(_0xbb65('0xf'));var Redis=require('ioredis');var authService=require(_0xbb65('0x10'));var qs=require(_0xbb65('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb65('0x12'));var logger=require(_0xbb65('0x13'))(_0xbb65('0x14'));var utils=require(_0xbb65('0x15'));var config=require(_0xbb65('0x16'));var licenseUtil=require(_0xbb65('0x17'));var db=require(_0xbb65('0x18'))['db'];function respondWithStatusCode(_0x4fe5b0,_0x19b33c){_0x19b33c=_0x19b33c||0xcc;return function(_0xbedf9c){if(_0xbedf9c){return _0x4fe5b0[_0xbb65('0x19')](_0x19b33c);}return _0x4fe5b0[_0xbb65('0x1a')](_0x19b33c)[_0xbb65('0x1b')]();};}function respondWithResult(_0x128d92,_0x36dae3){_0x36dae3=_0x36dae3||0xc8;return function(_0x2ede3f){if(_0x2ede3f){return _0x128d92[_0xbb65('0x1a')](_0x36dae3)[_0xbb65('0x1c')](_0x2ede3f);}};}function respondWithFilteredResult(_0x155859,_0x2b9e08){return function(_0xbd544a){if(_0xbd544a){var _0x4e0c59=typeof _0x2b9e08[_0xbb65('0x1d')]===_0xbb65('0x1e')&&typeof _0x2b9e08[_0xbb65('0x1f')]===_0xbb65('0x1e');var _0x55c18f=_0xbd544a[_0xbb65('0x20')];var _0x3a1994=_0x4e0c59?0x0:_0x2b9e08[_0xbb65('0x1d')];var _0x2fc420=_0x4e0c59?_0xbd544a[_0xbb65('0x20')]:_0x2b9e08[_0xbb65('0x1d')]+_0x2b9e08[_0xbb65('0x1f')];var _0x4c3439;if(_0x2fc420>=_0x55c18f){_0x2fc420=_0x55c18f;_0x4c3439=0xc8;}else{_0x4c3439=0xce;}_0x155859[_0xbb65('0x1a')](_0x4c3439);return _0x155859[_0xbb65('0x21')]('Content-Range',_0x3a1994+'-'+_0x2fc420+'/'+_0x55c18f)[_0xbb65('0x1c')](_0xbd544a);}return null;};}function patchUpdates(_0x486203){return function(_0x1e7708){try{jsonpatch['apply'](_0x1e7708,_0x486203,!![]);}catch(_0x5cf0c0){return BPromise[_0xbb65('0x22')](_0x5cf0c0);}return _0x1e7708[_0xbb65('0x23')]();};}function saveUpdates(_0x1d6653,_0x5580e5){return function(_0x1a93d3){if(_0x1a93d3){return _0x1a93d3[_0xbb65('0x24')](_0x1d6653)['then'](function(_0x5e274b){return _0x5e274b;});}return null;};}function removeEntity(_0x381390,_0x4032fb){return function(_0x427d14){if(_0x427d14){return _0x427d14[_0xbb65('0x25')]()['then'](function(){var _0xe37cee=_0x427d14[_0xbb65('0x26')]({'plain':!![]});var _0x4276ba=_0xbb65('0x27');return db[_0xbb65('0x28')][_0xbb65('0x25')]({'where':{'type':_0x4276ba,'resourceId':_0xe37cee['id']}})['then'](function(){return _0x427d14;});})['then'](function(){_0x381390['status'](0xcc)[_0xbb65('0x1b')]();});}};}function handleEntityNotFound(_0x53c926,_0x2359f2){return function(_0x55f2c5){if(!_0x55f2c5){_0x53c926[_0xbb65('0x19')](0x194);}return _0x55f2c5;};}function handleError(_0x42e90b,_0x4254ef){_0x4254ef=_0x4254ef||0x1f4;return function(_0x5867d3){logger[_0xbb65('0x29')](_0x5867d3['stack']);if(_0x5867d3['name']){delete _0x5867d3[_0xbb65('0x2a')];}_0x42e90b[_0xbb65('0x1a')](_0x4254ef)[_0xbb65('0x2b')](_0x5867d3);};}exports[_0xbb65('0x2c')]=function(_0x3d0944,_0x3e4bf9){var _0xdbd450={},_0x53ca66={},_0x3222cf={'count':0x0,'rows':[]};var _0x58825c=_[_0xbb65('0x2d')](db['CannedAnswer']['rawAttributes'],function(_0x44d4d3){return{'name':_0x44d4d3[_0xbb65('0x2e')],'type':_0x44d4d3[_0xbb65('0x2f')][_0xbb65('0x30')]};});_0x53ca66[_0xbb65('0x31')]=_[_0xbb65('0x2d')](_0x58825c,_0xbb65('0x2a'));_0x53ca66['query']=_[_0xbb65('0x32')](_0x3d0944[_0xbb65('0x33')]);_0x53ca66['filters']=_[_0xbb65('0x34')](_0x53ca66[_0xbb65('0x31')],_0x53ca66[_0xbb65('0x33')]);_0xdbd450['attributes']=_[_0xbb65('0x34')](_0x53ca66[_0xbb65('0x31')],qs[_0xbb65('0x35')](_0x3d0944[_0xbb65('0x33')]['fields']));_0xdbd450['attributes']=_0xdbd450[_0xbb65('0x36')][_0xbb65('0x37')]?_0xdbd450['attributes']:_0x53ca66['model'];if(!_0x3d0944[_0xbb65('0x33')][_0xbb65('0x38')](_0xbb65('0x39'))){_0xdbd450[_0xbb65('0x1f')]=qs[_0xbb65('0x1f')](_0x3d0944[_0xbb65('0x33')]['limit']);_0xdbd450[_0xbb65('0x1d')]=qs[_0xbb65('0x1d')](_0x3d0944[_0xbb65('0x33')][_0xbb65('0x1d')]);}_0xdbd450['order']=qs[_0xbb65('0x3a')](_0x3d0944[_0xbb65('0x33')][_0xbb65('0x3a')]);_0xdbd450[_0xbb65('0x3b')]=qs['filters'](_[_0xbb65('0x3c')](_0x3d0944[_0xbb65('0x33')],_0x53ca66[_0xbb65('0x3d')]),_0x58825c);if(_0x3d0944['query'][_0xbb65('0x3e')]){_0xdbd450[_0xbb65('0x3b')]=_[_0xbb65('0x3f')](_0xdbd450[_0xbb65('0x3b')],{'$or':[{'key':{'$like':'%'+_0x3d0944['query'][_0xbb65('0x3e')]+'%'}},{'value':{'$like':'%'+_0x3d0944['query'][_0xbb65('0x3e')]+'%'}}]});}_0xdbd450=_[_0xbb65('0x3f')]({},_0xdbd450,_0x3d0944[_0xbb65('0x40')]);var _0x18627a={'where':_0xdbd450['where']};return db['CannedAnswer']['count'](_0x18627a)[_0xbb65('0x41')](function(_0x350d7e){_0x3222cf[_0xbb65('0x20')]=_0x350d7e;if(_0x3d0944[_0xbb65('0x33')]['includeAll']){_0xdbd450[_0xbb65('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbb65('0x43')](_0xdbd450);})['then'](function(_0x5aacd5){_0x3222cf[_0xbb65('0x44')]=_0x5aacd5;return _0x3222cf;})['then'](respondWithFilteredResult(_0x3e4bf9,_0xdbd450))[_0xbb65('0x45')](handleError(_0x3e4bf9,null));};exports['show']=function(_0x28bc05,_0x353d0e){var _0x3a72c8={'raw':!![],'where':{'id':_0x28bc05[_0xbb65('0x46')]['id']}},_0x2d4c1c={};_0x2d4c1c[_0xbb65('0x31')]=_['keys'](db[_0xbb65('0x47')][_0xbb65('0x48')]);_0x2d4c1c[_0xbb65('0x33')]=_[_0xbb65('0x32')](_0x28bc05[_0xbb65('0x33')]);_0x2d4c1c[_0xbb65('0x3d')]=_[_0xbb65('0x34')](_0x2d4c1c[_0xbb65('0x31')],_0x2d4c1c[_0xbb65('0x33')]);_0x3a72c8[_0xbb65('0x36')]=_['intersection'](_0x2d4c1c[_0xbb65('0x31')],qs[_0xbb65('0x35')](_0x28bc05[_0xbb65('0x33')][_0xbb65('0x35')]));_0x3a72c8['attributes']=_0x3a72c8['attributes'][_0xbb65('0x37')]?_0x3a72c8['attributes']:_0x2d4c1c['model'];if(_0x28bc05[_0xbb65('0x33')][_0xbb65('0x49')]){_0x3a72c8[_0xbb65('0x42')]=[{'all':!![]}];}_0x3a72c8=_[_0xbb65('0x3f')]({},_0x3a72c8,_0x28bc05[_0xbb65('0x40')]);return db[_0xbb65('0x47')][_0xbb65('0x4a')](_0x3a72c8)['then'](handleEntityNotFound(_0x353d0e,null))[_0xbb65('0x41')](respondWithResult(_0x353d0e,null))[_0xbb65('0x45')](handleError(_0x353d0e,null));};exports[_0xbb65('0x24')]=function(_0x371f08,_0x1b7f37){if(_0x371f08[_0xbb65('0x4b')]['id']){delete _0x371f08[_0xbb65('0x4b')]['id'];}return db[_0xbb65('0x47')]['find']({'where':{'id':_0x371f08['params']['id']}})[_0xbb65('0x41')](handleEntityNotFound(_0x1b7f37,null))[_0xbb65('0x41')](saveUpdates(_0x371f08[_0xbb65('0x4b')],null))[_0xbb65('0x41')](respondWithResult(_0x1b7f37,null))[_0xbb65('0x45')](handleError(_0x1b7f37,null));};exports[_0xbb65('0x25')]=function(_0x54f852,_0xd1b1bd){return db[_0xbb65('0x47')][_0xbb65('0x4a')]({'where':{'id':_0x54f852[_0xbb65('0x46')]['id']}})['then'](handleEntityNotFound(_0xd1b1bd,null))[_0xbb65('0x41')](removeEntity(_0xd1b1bd,null))[_0xbb65('0x45')](handleError(_0xd1b1bd,null));};exports[_0xbb65('0x4c')]=function(_0x1a0245,_0x4da031){var _0xa45a9f={'key':_0x1a0245[_0xbb65('0x4b')][_0xbb65('0x30')]};if(_0x1a0245['body']['MailAccountId']){_0xa45a9f[_0xbb65('0x4d')]=_0x1a0245['body'][_0xbb65('0x4d')];}else if(_0x1a0245['body'][_0xbb65('0x4e')]){_0xa45a9f[_0xbb65('0x4e')]=_0x1a0245['body']['SmsAccountId'];}else if(_0x1a0245['body'][_0xbb65('0x4f')]){_0xa45a9f[_0xbb65('0x4f')]=_0x1a0245['body'][_0xbb65('0x4f')];}else if(_0x1a0245[_0xbb65('0x4b')][_0xbb65('0x50')]){_0xa45a9f[_0xbb65('0x50')]=_0x1a0245[_0xbb65('0x4b')][_0xbb65('0x50')];}return db['CannedAnswer']['find']({'where':_0xa45a9f})[_0xbb65('0x41')](function(_0x41ca28){if(_0x41ca28){throw new db['Sequelize']['ValidationError'](_0xbb65('0x51'));}return db[_0xbb65('0x47')][_0xbb65('0x4c')](_0x1a0245[_0xbb65('0x4b')]);})[_0xbb65('0x41')](function(_0x11467c){var _0x1b619f=_0x1a0245[_0xbb65('0x52')][_0xbb65('0x26')]({'plain':!![]});if(!_0x1b619f)throw new Error(_0xbb65('0x53'));if(_0x1b619f[_0xbb65('0x54')]===_0xbb65('0x52')){var _0x7213ee=_0x11467c[_0xbb65('0x26')]({'plain':!![]});return db[_0xbb65('0x55')]['find']({'where':{'name':_0xbb65('0x27'),'userProfileId':_0x1b619f[_0xbb65('0x56')]},'raw':!![]})[_0xbb65('0x41')](function(_0x2b085e){if(_0x2b085e&&_0x2b085e['autoAssociation']===0x0){return db[_0xbb65('0x28')]['create']({'name':_0x7213ee[_0xbb65('0x2a')],'resourceId':_0x7213ee['id'],'type':_0x2b085e['name'],'sectionId':_0x2b085e['id']},{})[_0xbb65('0x41')](function(){return _0x11467c;});}else{return _0x11467c;}})[_0xbb65('0x45')](function(_0x3e2051){logger[_0xbb65('0x29')](_0xbb65('0x57'),_0x3e2051);throw _0x3e2051;});}return _0x11467c;})[_0xbb65('0x41')](respondWithResult(_0x4da031,0xc9))[_0xbb65('0x45')](handleError(_0x4da031,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0818f91..55f7776 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 _0x8f59=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x58d86a,_0x5b2505){var _0x3f5008=function(_0x53ad18){while(--_0x53ad18){_0x58d86a['push'](_0x58d86a['shift']());}};_0x3f5008(++_0x5b2505);}(_0x8f59,0x11d));var _0x98f5=function(_0x5ba736,_0x3470bb){_0x5ba736=_0x5ba736-0x0;var _0xa338e4=_0x8f59[_0x5ba736];return _0xa338e4;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var logger=require(_0x98f5('0x2'))(_0x98f5('0x3'));var moment=require(_0x98f5('0x4'));var BPromise=require(_0x98f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f5('0x6'));var rimraf=require(_0x98f5('0x7'));var config=require(_0x98f5('0x8'));var attributes=require(_0x98f5('0x9'));module['exports']=function(_0xdcce7a,_0x358618){return _0xdcce7a[_0x98f5('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x98f5('0xb'),'collate':_0x98f5('0xc')});};
\ No newline at end of file
+var _0x8ca9=['rimraf','exports','tools_canned_answers','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x56756b,_0x3e8cc7){var _0xa3002=function(_0x5f1386){while(--_0x5f1386){_0x56756b['push'](_0x56756b['shift']());}};_0xa3002(++_0x3e8cc7);}(_0x8ca9,0x1a1));var _0x98ca=function(_0x2b9972,_0x3a8d75){_0x2b9972=_0x2b9972-0x0;var _0x299e8b=_0x8ca9[_0x2b9972];return _0x299e8b;};'use strict';var _=require(_0x98ca('0x0'));var util=require('util');var logger=require(_0x98ca('0x1'))(_0x98ca('0x2'));var moment=require('moment');var BPromise=require(_0x98ca('0x3'));var rp=require(_0x98ca('0x4'));var fs=require('fs');var path=require(_0x98ca('0x5'));var rimraf=require(_0x98ca('0x6'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x98ca('0x7')]=function(_0x51c890,_0x2e5f12){return _0x51c890['define']('CannedAnswer',attributes,{'tableName':_0x98ca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index c65f87c..3d6febb 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(_0x3b5ffd,_0x2548d1){var _0x1fa6d5=function(_0x2237c){while(--_0x2237c){_0x3b5ffd['push'](_0x3b5ffd['shift']());}};_0x1fa6d5(++_0x2548d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x2e7efa,_0x27499d){var _0x47c46f=function(_0x1812ee){while(--_0x1812ee){_0x2e7efa['push'](_0x2e7efa['shift']());}};_0x47c46f(++_0x27499d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 e6e1d0a..c28235d 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 _0x6e54=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','index','get','/:id','post','isAuthenticated','create'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x6e54,0x101));var _0x46e5=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x6e54[_0x324fe8];return _0x4a1cd9;};'use strict';var multer=require(_0x46e5('0x0'));var util=require(_0x46e5('0x1'));var path=require(_0x46e5('0x2'));var timeout=require(_0x46e5('0x3'));var express=require(_0x46e5('0x4'));var router=express[_0x46e5('0x5')]();var fs_extra=require(_0x46e5('0x6'));var auth=require(_0x46e5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x46e5('0x8'));var controller=require(_0x46e5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x46e5('0xa')]);router[_0x46e5('0xb')](_0x46e5('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x46e5('0xd')]('/',auth[_0x46e5('0xe')](),controller[_0x46e5('0xf')]);router[_0x46e5('0x10')](_0x46e5('0xc'),auth['isAuthenticated'](),controller[_0x46e5('0x11')]);router[_0x46e5('0x12')](_0x46e5('0xc'),auth[_0x46e5('0xe')](),controller[_0x46e5('0x13')]);module[_0x46e5('0x14')]=router;
\ No newline at end of file
+var _0x1c9e=['create','put','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x1c9e,0x72));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xe1c9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe1c9('0x1'));var express=require(_0xe1c9('0x2'));var router=express[_0xe1c9('0x3')]();var fs_extra=require(_0xe1c9('0x4'));var auth=require(_0xe1c9('0x5'));var interaction=require(_0xe1c9('0x6'));var config=require(_0xe1c9('0x7'));var controller=require('./cannedAnswer.controller');router[_0xe1c9('0x8')]('/',auth[_0xe1c9('0x9')](),controller[_0xe1c9('0xa')]);router[_0xe1c9('0x8')]('/:id',auth[_0xe1c9('0x9')](),controller['show']);router[_0xe1c9('0xb')]('/',auth[_0xe1c9('0x9')](),controller[_0xe1c9('0xc')]);router[_0xe1c9('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe1c9('0xe')](_0xe1c9('0xf'),auth[_0xe1c9('0x9')](),controller[_0xe1c9('0x10')]);module[_0xe1c9('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index d3c72b4..d72bd4b 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 _0x3a41=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x1ba0f3,_0x4e7ab8){var _0x313c21=function(_0x423f79){while(--_0x423f79){_0x1ba0f3['push'](_0x1ba0f3['shift']());}};_0x313c21(++_0x4e7ab8);}(_0x3a41,0x86));var _0x13a4=function(_0x56de9d,_0x413b89){_0x56de9d=_0x56de9d-0x0;var _0x5b63fd=_0x3a41[_0x56de9d];return _0x5b63fd;};'use strict';var Sequelize=require(_0x13a4('0x0'));module[_0x13a4('0x1')]={'calldate':{'type':Sequelize[_0x13a4('0x2')],'allowNull':![],'defaultValue':_0x13a4('0x3')},'clid':{'type':Sequelize[_0x13a4('0x4')]},'src':{'type':Sequelize[_0x13a4('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x13a4('0x4')]},'channel':{'type':Sequelize[_0x13a4('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x13a4('0x4')]},'duration':{'type':Sequelize[_0x13a4('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x13a4('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x13a4('0x4')]},'amaflags':{'type':Sequelize[_0x13a4('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x13a4('0x4')]},'uniqueid':{'type':Sequelize[_0x13a4('0x4')]},'linkedid':{'type':Sequelize[_0x13a4('0x4')]},'sequence':{'type':Sequelize[_0x13a4('0x4')]},'peeraccount':{'type':Sequelize[_0x13a4('0x4')]},'type':{'type':Sequelize[_0x13a4('0x4')]},'tag':{'type':Sequelize[_0x13a4('0x4')]}};
\ No newline at end of file
+var _0x3c8c=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x3832b8,_0x4491cf){var _0x4b383a=function(_0x27ac30){while(--_0x27ac30){_0x3832b8['push'](_0x3832b8['shift']());}};_0x4b383a(++_0x4491cf);}(_0x3c8c,0xb0));var _0xc3c8=function(_0x122a4a,_0x47d80f){_0x122a4a=_0x122a4a-0x0;var _0x38004a=_0x3c8c[_0x122a4a];return _0x38004a;};'use strict';var Sequelize=require(_0xc3c8('0x0'));module[_0xc3c8('0x1')]={'calldate':{'type':Sequelize[_0xc3c8('0x2')],'allowNull':![],'defaultValue':_0xc3c8('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xc3c8('0x4')]},'dst':{'type':Sequelize[_0xc3c8('0x4')]},'dcontext':{'type':Sequelize[_0xc3c8('0x4')]},'channel':{'type':Sequelize[_0xc3c8('0x4')]},'dstchannel':{'type':Sequelize[_0xc3c8('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc3c8('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc3c8('0x4')]},'amaflags':{'type':Sequelize[_0xc3c8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xc3c8('0x4')]},'uniqueid':{'type':Sequelize[_0xc3c8('0x4')]},'linkedid':{'type':Sequelize[_0xc3c8('0x4')]},'sequence':{'type':Sequelize[_0xc3c8('0x4')]},'peeraccount':{'type':Sequelize[_0xc3c8('0x4')]},'type':{'type':Sequelize[_0xc3c8('0x4')]},'tag':{'type':Sequelize[_0xc3c8('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index adf83cf..ec3f931 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 _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x5292,0xf7));var _0x2529=function(_0x5e3ac2,_0x225614){_0x5e3ac2=_0x5e3ac2-0x0;var _0x29a007=_0x5292[_0x5e3ac2];return _0x29a007;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,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(_0xab766d,_0x607780){var _0x1b57fd=function(_0x22cfeb){while(--_0x22cfeb){_0xab766d['push'](_0xab766d['shift']());}};_0x1b57fd(++_0x607780);}(_0xb647,0xdb));var _0x7b64=function(_0x52c309,_0x52db5e){_0x52c309=_0x52c309-0x0;var _0x1b67ec=_0xb647[_0x52c309];return _0x1b67ec;};'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 988c4d7..3cba8e9 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(_0x178961,_0x55fce6){var _0x18a2c8=function(_0x3412d4){while(--_0x3412d4){_0x178961['push'](_0x178961['shift']());}};_0x18a2c8(++_0x55fce6);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_0x1d7bfc,_0x9dc01){var _0x34d68d=function(_0x3a7380){while(--_0x3a7380){_0x1d7bfc['push'](_0x1d7bfc['shift']());}};_0x34d68d(++_0x9dc01);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 f7c008d..11aba53 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 _0x642e=['error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0x642e,0x1be));var _0xe642=function(_0x41376e,_0x1eb56f){_0x41376e=_0x41376e-0x0;var _0x38a918=_0x642e[_0x41376e];return _0x38a918;};'use strict';var _=require(_0xe642('0x0'));var util=require(_0xe642('0x1'));var moment=require(_0xe642('0x2'));var BPromise=require(_0xe642('0x3'));var rs=require(_0xe642('0x4'));var fs=require('fs');var Redis=require(_0xe642('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe642('0x6'))(_0xe642('0x7'));var config=require(_0xe642('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe642('0x9')][_0xe642('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cab94,_0x56c389,_0x1191c3){return new BPromise(function(_0x3a4297,_0x8e3c35){return client['request'](_0x1cab94,_0x1191c3)[_0xe642('0xb')](function(_0x26c22f){logger['info']('Cdr,\x20%s,\x20%s',_0x56c389,'request\x20sent');logger[_0xe642('0xc')](_0xe642('0xd'),_0x56c389,_0xe642('0xe'),JSON[_0xe642('0xf')](_0x26c22f));if(_0x26c22f['error']){if(_0x26c22f[_0xe642('0x10')][_0xe642('0x11')]===0x1f4){logger[_0xe642('0x10')](_0xe642('0x12'),_0x56c389,_0x26c22f[_0xe642('0x10')][_0xe642('0x13')]);return _0x8e3c35(_0x26c22f[_0xe642('0x10')][_0xe642('0x13')]);}logger[_0xe642('0x10')](_0xe642('0x12'),_0x56c389,_0x26c22f[_0xe642('0x10')]['message']);return _0x3a4297(_0x26c22f['error'][_0xe642('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x56c389,_0xe642('0xe'));_0x3a4297(_0x26c22f[_0xe642('0x14')]['message']);}})[_0xe642('0x15')](function(_0x5edf4a){logger[_0xe642('0x10')]('Cdr,\x20%s,\x20%s',_0x56c389,_0x5edf4a);_0x8e3c35(_0x5edf4a);});});}
\ No newline at end of file
+var _0xe24a=['../../config/logger','rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3c2a87,_0x301e33){var _0x3a4efd=function(_0x2c5e19){while(--_0x2c5e19){_0x3c2a87['push'](_0x3c2a87['shift']());}};_0x3a4efd(++_0x301e33);}(_0xe24a,0x1dc));var _0xae24=function(_0x502a31,_0x1aeeca){_0x502a31=_0x502a31-0x0;var _0x1b003b=_0xe24a[_0x502a31];return _0x1b003b;};'use strict';var _=require(_0xae24('0x0'));var util=require(_0xae24('0x1'));var moment=require(_0xae24('0x2'));var BPromise=require(_0xae24('0x3'));var rs=require(_0xae24('0x4'));var fs=require('fs');var Redis=require(_0xae24('0x5'));var db=require(_0xae24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xae24('0x7'))(_0xae24('0x8'));var config=require(_0xae24('0x9'));var jayson=require(_0xae24('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2da4b4,_0x5d5370,_0x4d4745){return new BPromise(function(_0xebdbb4,_0x64b120){return client['request'](_0x2da4b4,_0x4d4745)['then'](function(_0x2abe37){logger[_0xae24('0xb')]('Cdr,\x20%s,\x20%s',_0x5d5370,_0xae24('0xc'));logger[_0xae24('0xd')](_0xae24('0xe'),_0x5d5370,_0xae24('0xc'),JSON[_0xae24('0xf')](_0x2abe37));if(_0x2abe37['error']){if(_0x2abe37[_0xae24('0x10')]['code']===0x1f4){logger[_0xae24('0x10')]('Cdr,\x20%s,\x20%s',_0x5d5370,_0x2abe37[_0xae24('0x10')][_0xae24('0x11')]);return _0x64b120(_0x2abe37[_0xae24('0x10')]['message']);}logger[_0xae24('0x10')](_0xae24('0x12'),_0x5d5370,_0x2abe37[_0xae24('0x10')][_0xae24('0x11')]);return _0xebdbb4(_0x2abe37[_0xae24('0x10')][_0xae24('0x11')]);}else{logger[_0xae24('0xb')]('Cdr,\x20%s,\x20%s',_0x5d5370,'request\x20sent');_0xebdbb4(_0x2abe37[_0xae24('0x13')][_0xae24('0x11')]);}})[_0xae24('0x14')](function(_0x26b773){logger[_0xae24('0x10')]('Cdr,\x20%s,\x20%s',_0x5d5370,_0x26b773);_0x64b120(_0x26b773);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 4749265..0f99064 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x10548e,_0x80eaff){var _0x540aa4=function(_0x277e0e){while(--_0x277e0e){_0x10548e['push'](_0x10548e['shift']());}};_0x540aa4(++_0x80eaff);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x474030,_0x38397a){var _0x584ab0=function(_0xfd7646){while(--_0xfd7646){_0x474030['push'](_0x474030['shift']());}};_0x584ab0(++_0x38397a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e9903,_0x3ec512){_0x3e9903=_0x3e9903-0x0;var _0xcab758=_0xb10b[_0x3e9903];return _0xcab758;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index ac42c10..a854680 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 _0x9e1b=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x46d772,_0x485fbc){var _0x1fd083=function(_0x4ff622){while(--_0x4ff622){_0x46d772['push'](_0x46d772['shift']());}};_0x1fd083(++_0x485fbc);}(_0x9e1b,0x196));var _0xb9e1=function(_0x23e567,_0x21e539){_0x23e567=_0x23e567-0x0;var _0x5db05c=_0x9e1b[_0x23e567];return _0x5db05c;};'use strict';var Sequelize=require('sequelize');module[_0xb9e1('0x0')]={'priority':{'type':Sequelize[_0xb9e1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb9e1('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb9e1('0x3')]()},'description':{'type':Sequelize[_0xb9e1('0x2')]},'interval':{'type':Sequelize[_0xb9e1('0x2')],'defaultValue':_0xb9e1('0x4')}};
\ No newline at end of file
+var _0x42ab=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x50b342,_0x3fdd5a){var _0x3426d5=function(_0x597d34){while(--_0x597d34){_0x50b342['push'](_0x50b342['shift']());}};_0x3426d5(++_0x3fdd5a);}(_0x42ab,0x194));var _0xb42a=function(_0x262f44,_0x3847ba){_0x262f44=_0x262f44-0x0;var _0x33b27c=_0x42ab[_0x262f44];return _0x33b27c;};'use strict';var Sequelize=require(_0xb42a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb42a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb42a('0x2')],'allowNull':![],'defaultValue':_0xb42a('0x3')},'appdata':{'type':Sequelize[_0xb42a('0x4')]()},'description':{'type':Sequelize[_0xb42a('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ef53151..6282a3d 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 _0x2083=['destroy','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then'];(function(_0x322590,_0x324ba9){var _0x3b12b3=function(_0x588c92){while(--_0x588c92){_0x322590['push'](_0x322590['shift']());}};_0x3b12b3(++_0x324ba9);}(_0x2083,0x137));var _0x3208=function(_0x5d2a59,_0x1d517b){_0x5d2a59=_0x5d2a59-0x0;var _0x361157=_0x2083[_0x5d2a59];return _0x361157;};'use strict';var emlformat=require(_0x3208('0x0'));var rimraf=require(_0x3208('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3208('0x2'));var rp=require(_0x3208('0x3'));var moment=require(_0x3208('0x4'));var BPromise=require(_0x3208('0x5'));var Mustache=require(_0x3208('0x6'));var util=require(_0x3208('0x7'));var path=require(_0x3208('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3208('0x9'));var _=require(_0x3208('0xa'));var squel=require(_0x3208('0xb'));var crypto=require(_0x3208('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3208('0xd'));var toCsv=require(_0x3208('0xe'));var querystring=require(_0x3208('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3208('0x10'));var qs=require(_0x3208('0x11'));var as=require(_0x3208('0x12'));var hardwareService=require(_0x3208('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3208('0x14'));var config=require(_0x3208('0x15'));var licenseUtil=require(_0x3208('0x16'));var db=require(_0x3208('0x17'))['db'];function respondWithStatusCode(_0x174620,_0x394883){_0x394883=_0x394883||0xcc;return function(_0xf232e5){if(_0xf232e5){return _0x174620[_0x3208('0x18')](_0x394883);}return _0x174620[_0x3208('0x19')](_0x394883)[_0x3208('0x1a')]();};}function respondWithResult(_0x3deca8,_0x14c24f){_0x14c24f=_0x14c24f||0xc8;return function(_0xa5067){if(_0xa5067){return _0x3deca8[_0x3208('0x19')](_0x14c24f)['json'](_0xa5067);}};}function respondWithFilteredResult(_0x2f1eaf,_0x153cf8){return function(_0x41cdcf){if(_0x41cdcf){var _0x1ef359=typeof _0x153cf8[_0x3208('0x1b')]==='undefined'&&typeof _0x153cf8[_0x3208('0x1c')]===_0x3208('0x1d');var _0x4c1e4d=_0x41cdcf[_0x3208('0x1e')];var _0x3590c5=_0x1ef359?0x0:_0x153cf8[_0x3208('0x1b')];var _0x28e291=_0x1ef359?_0x41cdcf[_0x3208('0x1e')]:_0x153cf8[_0x3208('0x1b')]+_0x153cf8['limit'];var _0x3d44bd;if(_0x28e291>=_0x4c1e4d){_0x28e291=_0x4c1e4d;_0x3d44bd=0xc8;}else{_0x3d44bd=0xce;}_0x2f1eaf[_0x3208('0x19')](_0x3d44bd);return _0x2f1eaf[_0x3208('0x1f')](_0x3208('0x20'),_0x3590c5+'-'+_0x28e291+'/'+_0x4c1e4d)[_0x3208('0x21')](_0x41cdcf);}return null;};}function patchUpdates(_0x46b227){return function(_0x468cca){try{jsonpatch['apply'](_0x468cca,_0x46b227,!![]);}catch(_0x42d97a){return BPromise[_0x3208('0x22')](_0x42d97a);}return _0x468cca['save']();};}function saveUpdates(_0x28d665,_0x361d1c){return function(_0x3c6e34){if(_0x3c6e34){return _0x3c6e34[_0x3208('0x23')](_0x28d665)[_0x3208('0x24')](function(_0x2ce30e){return _0x2ce30e;});}return null;};}function removeEntity(_0x4673c2,_0x523d75){return function(_0x54aa98){if(_0x54aa98){return _0x54aa98[_0x3208('0x25')]()[_0x3208('0x24')](function(){_0x4673c2[_0x3208('0x19')](0xcc)[_0x3208('0x1a')]();});}};}function handleEntityNotFound(_0x14e491,_0x21dc00){return function(_0x47a021){if(!_0x47a021){_0x14e491[_0x3208('0x18')](0x194);}return _0x47a021;};}function handleError(_0x125ae3,_0x270c69){_0x270c69=_0x270c69||0x1f4;return function(_0x10e471){logger['error'](_0x10e471[_0x3208('0x26')]);if(_0x10e471[_0x3208('0x27')]){delete _0x10e471[_0x3208('0x27')];}_0x125ae3['status'](_0x270c69)[_0x3208('0x28')](_0x10e471);};}exports[_0x3208('0x29')]=function(_0xf9e10c,_0x22b561){var _0x283193={'raw':!![],'where':{'id':_0xf9e10c[_0x3208('0x2a')]['id']}},_0x2b153f={};_0x2b153f[_0x3208('0x2b')]=_[_0x3208('0x2c')](db[_0x3208('0x2d')][_0x3208('0x2e')]);_0x2b153f[_0x3208('0x2f')]=_[_0x3208('0x2c')](_0xf9e10c[_0x3208('0x2f')]);_0x2b153f['filters']=_['intersection'](_0x2b153f[_0x3208('0x2b')],_0x2b153f[_0x3208('0x2f')]);_0x283193[_0x3208('0x30')]=_['intersection'](_0x2b153f[_0x3208('0x2b')],qs[_0x3208('0x31')](_0xf9e10c['query'][_0x3208('0x31')]));_0x283193[_0x3208('0x30')]=_0x283193[_0x3208('0x30')][_0x3208('0x32')]?_0x283193[_0x3208('0x30')]:_0x2b153f[_0x3208('0x2b')];if(_0xf9e10c[_0x3208('0x2f')][_0x3208('0x33')]){_0x283193[_0x3208('0x34')]=[{'all':!![]}];}_0x283193=_[_0x3208('0x35')]({},_0x283193,_0xf9e10c[_0x3208('0x36')]);return db[_0x3208('0x2d')][_0x3208('0x37')](_0x283193)['then'](handleEntityNotFound(_0x22b561,null))[_0x3208('0x24')](respondWithResult(_0x22b561,null))[_0x3208('0x38')](handleError(_0x22b561,null));};exports['update']=function(_0x93b8cd,_0x17f0f6){if(_0x93b8cd[_0x3208('0x39')]['id']){delete _0x93b8cd[_0x3208('0x39')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x93b8cd[_0x3208('0x2a')]['id']}})['then'](handleEntityNotFound(_0x17f0f6,null))[_0x3208('0x24')](saveUpdates(_0x93b8cd[_0x3208('0x39')],null))[_0x3208('0x24')](respondWithResult(_0x17f0f6,null))[_0x3208('0x38')](handleError(_0x17f0f6,null));};exports[_0x3208('0x25')]=function(_0x1588f4,_0x7544fc){return db[_0x3208('0x2d')][_0x3208('0x37')]({'where':{'id':_0x1588f4['params']['id']}})[_0x3208('0x24')](handleEntityNotFound(_0x7544fc,null))['then'](removeEntity(_0x7544fc,null))[_0x3208('0x38')](handleError(_0x7544fc,null));};
\ No newline at end of file
+var _0x2746=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','catch','find','params','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3da001,_0x256e26){var _0x2947e9=function(_0x4afdc0){while(--_0x4afdc0){_0x3da001['push'](_0x3da001['shift']());}};_0x2947e9(++_0x256e26);}(_0x2746,0x19c));var _0x6274=function(_0x85465a,_0x4dfeb2){_0x85465a=_0x85465a-0x0;var _0x57ffb9=_0x2746[_0x85465a];return _0x57ffb9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6274('0x0'));var jsonpatch=require(_0x6274('0x1'));var rp=require(_0x6274('0x2'));var moment=require(_0x6274('0x3'));var BPromise=require(_0x6274('0x4'));var Mustache=require(_0x6274('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6274('0x6'));var csv=require(_0x6274('0x7'));var ejs=require(_0x6274('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6274('0x9'));var squel=require(_0x6274('0xa'));var crypto=require(_0x6274('0xb'));var jsforce=require(_0x6274('0xc'));var deskjs=require(_0x6274('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6274('0xe'));var Papa=require('papaparse');var Redis=require(_0x6274('0xf'));var authService=require(_0x6274('0x10'));var qs=require(_0x6274('0x11'));var as=require(_0x6274('0x12'));var hardwareService=require(_0x6274('0x13'));var logger=require(_0x6274('0x14'))(_0x6274('0x15'));var utils=require(_0x6274('0x16'));var config=require(_0x6274('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59a0a1,_0xd3a0a2){_0xd3a0a2=_0xd3a0a2||0xcc;return function(_0x479fdc){if(_0x479fdc){return _0x59a0a1[_0x6274('0x18')](_0xd3a0a2);}return _0x59a0a1[_0x6274('0x19')](_0xd3a0a2)[_0x6274('0x1a')]();};}function respondWithResult(_0x4f4f9e,_0x58a4e3){_0x58a4e3=_0x58a4e3||0xc8;return function(_0x488b60){if(_0x488b60){return _0x4f4f9e[_0x6274('0x19')](_0x58a4e3)[_0x6274('0x1b')](_0x488b60);}};}function respondWithFilteredResult(_0x4b581a,_0x5e6ff8){return function(_0x425c8b){if(_0x425c8b){var _0x1d0dc4=typeof _0x5e6ff8[_0x6274('0x1c')]===_0x6274('0x1d')&&typeof _0x5e6ff8[_0x6274('0x1e')]==='undefined';var _0x3219d1=_0x425c8b[_0x6274('0x1f')];var _0x40cc32=_0x1d0dc4?0x0:_0x5e6ff8['offset'];var _0x5cdf5e=_0x1d0dc4?_0x425c8b[_0x6274('0x1f')]:_0x5e6ff8['offset']+_0x5e6ff8['limit'];var _0x402b97;if(_0x5cdf5e>=_0x3219d1){_0x5cdf5e=_0x3219d1;_0x402b97=0xc8;}else{_0x402b97=0xce;}_0x4b581a['status'](_0x402b97);return _0x4b581a[_0x6274('0x20')](_0x6274('0x21'),_0x40cc32+'-'+_0x5cdf5e+'/'+_0x3219d1)['json'](_0x425c8b);}return null;};}function patchUpdates(_0x55dab9){return function(_0x3e0248){try{jsonpatch[_0x6274('0x22')](_0x3e0248,_0x55dab9,!![]);}catch(_0xe2b388){return BPromise[_0x6274('0x23')](_0xe2b388);}return _0x3e0248[_0x6274('0x24')]();};}function saveUpdates(_0x221c7a,_0x3b8fb6){return function(_0x12df93){if(_0x12df93){return _0x12df93[_0x6274('0x25')](_0x221c7a)[_0x6274('0x26')](function(_0x1d1a09){return _0x1d1a09;});}return null;};}function removeEntity(_0xc49220,_0x125f14){return function(_0xa0c8bd){if(_0xa0c8bd){return _0xa0c8bd[_0x6274('0x27')]()[_0x6274('0x26')](function(){_0xc49220[_0x6274('0x19')](0xcc)[_0x6274('0x1a')]();});}};}function handleEntityNotFound(_0x5228a1,_0x425241){return function(_0x486d1f){if(!_0x486d1f){_0x5228a1[_0x6274('0x18')](0x194);}return _0x486d1f;};}function handleError(_0x543ac7,_0x234149){_0x234149=_0x234149||0x1f4;return function(_0x1513e8){logger['error'](_0x1513e8[_0x6274('0x28')]);if(_0x1513e8['name']){delete _0x1513e8['name'];}_0x543ac7[_0x6274('0x19')](_0x234149)[_0x6274('0x29')](_0x1513e8);};}exports[_0x6274('0x2a')]=function(_0x490541,_0x3feefd){var _0x49df2e={'raw':!![],'where':{'id':_0x490541['params']['id']}},_0x4818e2={};_0x4818e2[_0x6274('0x2b')]=_[_0x6274('0x2c')](db[_0x6274('0x2d')][_0x6274('0x2e')]);_0x4818e2[_0x6274('0x2f')]=_[_0x6274('0x2c')](_0x490541['query']);_0x4818e2[_0x6274('0x30')]=_[_0x6274('0x31')](_0x4818e2[_0x6274('0x2b')],_0x4818e2[_0x6274('0x2f')]);_0x49df2e[_0x6274('0x32')]=_[_0x6274('0x31')](_0x4818e2[_0x6274('0x2b')],qs['fields'](_0x490541['query'][_0x6274('0x33')]));_0x49df2e[_0x6274('0x32')]=_0x49df2e[_0x6274('0x32')][_0x6274('0x34')]?_0x49df2e[_0x6274('0x32')]:_0x4818e2[_0x6274('0x2b')];if(_0x490541[_0x6274('0x2f')][_0x6274('0x35')]){_0x49df2e[_0x6274('0x36')]=[{'all':!![]}];}_0x49df2e=_[_0x6274('0x37')]({},_0x49df2e,_0x490541[_0x6274('0x38')]);return db[_0x6274('0x2d')]['find'](_0x49df2e)[_0x6274('0x26')](handleEntityNotFound(_0x3feefd,null))[_0x6274('0x26')](respondWithResult(_0x3feefd,null))[_0x6274('0x39')](handleError(_0x3feefd,null));};exports[_0x6274('0x25')]=function(_0x167cba,_0x8b1bd4){if(_0x167cba['body']['id']){delete _0x167cba['body']['id'];}return db['ChatApplication'][_0x6274('0x3a')]({'where':{'id':_0x167cba[_0x6274('0x3b')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x8b1bd4,null))[_0x6274('0x26')](saveUpdates(_0x167cba[_0x6274('0x3c')],null))[_0x6274('0x26')](respondWithResult(_0x8b1bd4,null))[_0x6274('0x39')](handleError(_0x8b1bd4,null));};exports[_0x6274('0x27')]=function(_0x3a63ca,_0x115077){return db[_0x6274('0x2d')][_0x6274('0x3a')]({'where':{'id':_0x3a63ca[_0x6274('0x3b')]['id']}})[_0x6274('0x26')](handleEntityNotFound(_0x115077,null))[_0x6274('0x26')](removeEntity(_0x115077,null))[_0x6274('0x39')](handleError(_0x115077,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 4e370c2..7400fed 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 _0xa678=['exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5c9162,_0x3a87bc){var _0x4d427d=function(_0x4c616a){while(--_0x4c616a){_0x5c9162['push'](_0x5c9162['shift']());}};_0x4d427d(++_0x3a87bc);}(_0xa678,0xe1));var _0x8a67=function(_0x41035d,_0x468124){_0x41035d=_0x41035d-0x0;var _0x53d186=_0xa678[_0x41035d];return _0x53d186;};'use strict';var _=require(_0x8a67('0x0'));var util=require(_0x8a67('0x1'));var logger=require(_0x8a67('0x2'))(_0x8a67('0x3'));var moment=require(_0x8a67('0x4'));var BPromise=require(_0x8a67('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a67('0x6'));var rimraf=require(_0x8a67('0x7'));var config=require(_0x8a67('0x8'));var attributes=require('./chatApplication.attributes');module[_0x8a67('0x9')]=function(_0x5ba4dd,_0x16c745){return _0x5ba4dd['define']('ChatApplication',attributes,{'tableName':_0x8a67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a67('0xb'),'collate':_0x8a67('0xc')});};
\ No newline at end of file
+var _0xfdd7=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdd7,0xa3));var _0x7fdd=function(_0x33aa5f,_0x28b469){_0x33aa5f=_0x33aa5f-0x0;var _0x4774a1=_0xfdd7[_0x33aa5f];return _0x4774a1;};'use strict';var _=require(_0x7fdd('0x0'));var util=require(_0x7fdd('0x1'));var logger=require(_0x7fdd('0x2'))('api');var moment=require(_0x7fdd('0x3'));var BPromise=require(_0x7fdd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7fdd('0x5'));var rimraf=require(_0x7fdd('0x6'));var config=require(_0x7fdd('0x7'));var attributes=require(_0x7fdd('0x8'));module[_0x7fdd('0x9')]=function(_0x54deda,_0x40dbe3){return _0x54deda[_0x7fdd('0xa')](_0x7fdd('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7fdd('0xc'),'collate':_0x7fdd('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0e03ef6..586d00f 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 _0x82b9=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xd05d0e,_0x222ec6){var _0xa812c=function(_0x207028){while(--_0x207028){_0xd05d0e['push'](_0xd05d0e['shift']());}};_0xa812c(++_0x222ec6);}(_0x82b9,0x149));var _0x982b=function(_0x21745c,_0x186f06){_0x21745c=_0x21745c-0x0;var _0x12e0b8=_0x82b9[_0x21745c];return _0x12e0b8;};'use strict';var _=require(_0x982b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x982b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x982b('0x2'));var db=require(_0x982b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x982b('0x4'))(_0x982b('0x5'));var config=require('../../config/environment');var jayson=require(_0x982b('0x6'));var client=jayson[_0x982b('0x7')][_0x982b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x529a26,_0x4006c4,_0x1479d8){return new BPromise(function(_0x3cdf7b,_0x2df147){return client[_0x982b('0x9')](_0x529a26,_0x1479d8)[_0x982b('0xa')](function(_0x5aa8ec){logger[_0x982b('0xb')](_0x982b('0xc'),_0x4006c4,_0x982b('0xd'));logger[_0x982b('0xe')](_0x982b('0xf'),_0x4006c4,_0x982b('0xd'),JSON[_0x982b('0x10')](_0x5aa8ec));if(_0x5aa8ec[_0x982b('0x11')]){if(_0x5aa8ec[_0x982b('0x11')]['code']===0x1f4){logger[_0x982b('0x11')](_0x982b('0xc'),_0x4006c4,_0x5aa8ec['error'][_0x982b('0x12')]);return _0x2df147(_0x5aa8ec[_0x982b('0x11')][_0x982b('0x12')]);}logger[_0x982b('0x11')](_0x982b('0xc'),_0x4006c4,_0x5aa8ec[_0x982b('0x11')][_0x982b('0x12')]);return _0x3cdf7b(_0x5aa8ec[_0x982b('0x11')][_0x982b('0x12')]);}else{logger[_0x982b('0xb')](_0x982b('0xc'),_0x4006c4,'request\x20sent');_0x3cdf7b(_0x5aa8ec['result']['message']);}})[_0x982b('0x13')](function(_0x38b70a){logger[_0x982b('0x11')](_0x982b('0xc'),_0x4006c4,_0x38b70a);_0x2df147(_0x38b70a);});});}
\ No newline at end of file
+var _0x6c36=['code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x19a8b5,_0x3d98c2){var _0xb4e415=function(_0x4c02b7){while(--_0x4c02b7){_0x19a8b5['push'](_0x19a8b5['shift']());}};_0xb4e415(++_0x3d98c2);}(_0x6c36,0x112));var _0x66c3=function(_0x2b7337,_0x324cc6){_0x2b7337=_0x2b7337-0x0;var _0x3d894d=_0x6c36[_0x2b7337];return _0x3d894d;};'use strict';var _=require(_0x66c3('0x0'));var util=require(_0x66c3('0x1'));var moment=require('moment');var BPromise=require(_0x66c3('0x2'));var rs=require(_0x66c3('0x3'));var fs=require('fs');var Redis=require(_0x66c3('0x4'));var db=require(_0x66c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x66c3('0x6'));var config=require(_0x66c3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x66c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41a106,_0x3e017a,_0x47552b){return new BPromise(function(_0x34cb24,_0x3c7ca8){return client['request'](_0x41a106,_0x47552b)[_0x66c3('0x9')](function(_0x5550b9){logger['info'](_0x66c3('0xa'),_0x3e017a,_0x66c3('0xb'));logger[_0x66c3('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x3e017a,_0x66c3('0xb'),JSON['stringify'](_0x5550b9));if(_0x5550b9[_0x66c3('0xd')]){if(_0x5550b9['error'][_0x66c3('0xe')]===0x1f4){logger[_0x66c3('0xd')](_0x66c3('0xa'),_0x3e017a,_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);return _0x3c7ca8(_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);}logger['error'](_0x66c3('0xa'),_0x3e017a,_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);return _0x34cb24(_0x5550b9[_0x66c3('0xd')][_0x66c3('0xf')]);}else{logger[_0x66c3('0x10')]('ChatApplication,\x20%s,\x20%s',_0x3e017a,_0x66c3('0xb'));_0x34cb24(_0x5550b9[_0x66c3('0x11')]['message']);}})['catch'](function(_0x5a6bba){logger['error'](_0x66c3('0xa'),_0x3e017a,_0x5a6bba);_0x3c7ca8(_0x5a6bba);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 9ff5bd7..c4a455b 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 _0xa051=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy','exports','path','connect-timeout','express'];(function(_0xeb6583,_0x7360e0){var _0x326af8=function(_0x3113fd){while(--_0x3113fd){_0xeb6583['push'](_0xeb6583['shift']());}};_0x326af8(++_0x7360e0);}(_0xa051,0xfd));var _0x1a05=function(_0x6c7a8e,_0x1a3ed6){_0x6c7a8e=_0x6c7a8e-0x0;var _0xafab52=_0xa051[_0x6c7a8e];return _0xafab52;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a05('0x0'));var timeout=require(_0x1a05('0x1'));var express=require(_0x1a05('0x2'));var router=express[_0x1a05('0x3')]();var fs_extra=require(_0x1a05('0x4'));var auth=require(_0x1a05('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a05('0x6'));var controller=require(_0x1a05('0x7'));router[_0x1a05('0x8')]('/:id',auth[_0x1a05('0x9')](),controller[_0x1a05('0xa')]);router[_0x1a05('0xb')](_0x1a05('0xc'),auth['isAuthenticated'](),controller[_0x1a05('0xd')]);router['delete'](_0x1a05('0xc'),auth['isAuthenticated'](),controller[_0x1a05('0xe')]);module[_0x1a05('0xf')]=router;
\ No newline at end of file
+var _0x759d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4017fc,_0x4734de){var _0x49b7e4=function(_0x414b2f){while(--_0x414b2f){_0x4017fc['push'](_0x4017fc['shift']());}};_0x49b7e4(++_0x4734de);}(_0x759d,0x10a));var _0xd759=function(_0x226e5d,_0x3d7316){_0x226e5d=_0x226e5d-0x0;var _0x8d9bdc=_0x759d[_0x226e5d];return _0x8d9bdc;};'use strict';var multer=require(_0xd759('0x0'));var util=require('util');var path=require(_0xd759('0x1'));var timeout=require(_0xd759('0x2'));var express=require(_0xd759('0x3'));var router=express[_0xd759('0x4')]();var fs_extra=require(_0xd759('0x5'));var auth=require(_0xd759('0x6'));var interaction=require(_0xd759('0x7'));var config=require(_0xd759('0x8'));var controller=require(_0xd759('0x9'));router['get'](_0xd759('0xa'),auth[_0xd759('0xb')](),controller[_0xd759('0xc')]);router[_0xd759('0xd')](_0xd759('0xa'),auth[_0xd759('0xb')](),controller[_0xd759('0xe')]);router['delete'](_0xd759('0xa'),auth[_0xd759('0xb')](),controller['destroy']);module[_0xd759('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 9191503..9136603 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 _0x2087=['sequelize','exports','STRING'];(function(_0x491e30,_0x1579c2){var _0x53f649=function(_0x42cfbc){while(--_0x42cfbc){_0x491e30['push'](_0x491e30['shift']());}};_0x53f649(++_0x1579c2);}(_0x2087,0xf3));var _0x7208=function(_0x2f70d2,_0x49da1c){_0x2f70d2=_0x2f70d2-0x0;var _0x3581d0=_0x2087[_0x2f70d2];return _0x3581d0;};'use strict';var Sequelize=require(_0x7208('0x0'));module[_0x7208('0x1')]={'name':{'type':Sequelize[_0x7208('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7208('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd668=['STRING','BOOLEAN','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd668,0x18e));var _0x8d66=function(_0x204ef6,_0x14dc9b){_0x204ef6=_0x204ef6-0x0;var _0x5e3a4b=_0xd668[_0x204ef6];return _0x5e3a4b;};'use strict';var Sequelize=require(_0x8d66('0x0'));module['exports']={'name':{'type':Sequelize[_0x8d66('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8d66('0x1')]},'write':{'type':Sequelize[_0x8d66('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 54f4a1c..8ca3743 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 _0xa7ee=['mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','ChatGroup','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','filters','find','create','body','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','rawAttributes','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x3fbe46,_0x12a0d1){var _0x27c406=function(_0x4a1020){while(--_0x4a1020){_0x3fbe46['push'](_0x3fbe46['shift']());}};_0x27c406(++_0x12a0d1);}(_0xa7ee,0xb7));var _0xea7e=function(_0x1546c2,_0x22e822){_0x1546c2=_0x1546c2-0x0;var _0x24583c=_0xa7ee[_0x1546c2];return _0x24583c;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea7e('0x2'));var moment=require(_0xea7e('0x3'));var BPromise=require(_0xea7e('0x4'));var Mustache=require(_0xea7e('0x5'));var util=require('util');var path=require(_0xea7e('0x6'));var sox=require('sox');var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require(_0xea7e('0xa'));var squel=require(_0xea7e('0xb'));var crypto=require(_0xea7e('0xc'));var jsforce=require(_0xea7e('0xd'));var deskjs=require(_0xea7e('0xe'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require(_0xea7e('0xf'));var Redis=require(_0xea7e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0x11'));var as=require(_0xea7e('0x12'));var hardwareService=require(_0xea7e('0x13'));var logger=require('../../config/logger')(_0xea7e('0x14'));var utils=require(_0xea7e('0x15'));var config=require(_0xea7e('0x16'));var licenseUtil=require(_0xea7e('0x17'));var db=require('../../mysqldb')['db'];config[_0xea7e('0x18')]=_[_0xea7e('0x19')](config[_0xea7e('0x18')],{'host':_0xea7e('0x1a'),'port':0x18eb});var socket=require(_0xea7e('0x1b'))(new Redis(config[_0xea7e('0x18')]));require(_0xea7e('0x1c'))['register'](socket);function respondWithStatusCode(_0x269418,_0xbfebb0){_0xbfebb0=_0xbfebb0||0xcc;return function(_0x4881e0){if(_0x4881e0){return _0x269418['sendStatus'](_0xbfebb0);}return _0x269418[_0xea7e('0x1d')](_0xbfebb0)[_0xea7e('0x1e')]();};}function respondWithResult(_0x14fea9,_0x5b2661){_0x5b2661=_0x5b2661||0xc8;return function(_0x27fc7a){if(_0x27fc7a){return _0x14fea9[_0xea7e('0x1d')](_0x5b2661)['json'](_0x27fc7a);}};}function respondWithFilteredResult(_0xe9e38b,_0xb2da33){return function(_0x4ea52b){if(_0x4ea52b){var _0x2f3207=typeof _0xb2da33[_0xea7e('0x1f')]===_0xea7e('0x20')&&typeof _0xb2da33['limit']==='undefined';var _0x257c35=_0x4ea52b[_0xea7e('0x21')];var _0x21334d=_0x2f3207?0x0:_0xb2da33[_0xea7e('0x1f')];var _0xa0e5b0=_0x2f3207?_0x4ea52b[_0xea7e('0x21')]:_0xb2da33[_0xea7e('0x1f')]+_0xb2da33[_0xea7e('0x22')];var _0x5ddf7e;if(_0xa0e5b0>=_0x257c35){_0xa0e5b0=_0x257c35;_0x5ddf7e=0xc8;}else{_0x5ddf7e=0xce;}_0xe9e38b[_0xea7e('0x1d')](_0x5ddf7e);return _0xe9e38b[_0xea7e('0x23')](_0xea7e('0x24'),_0x21334d+'-'+_0xa0e5b0+'/'+_0x257c35)[_0xea7e('0x25')](_0x4ea52b);}return null;};}function patchUpdates(_0x44bf8b){return function(_0x105edb){try{jsonpatch[_0xea7e('0x26')](_0x105edb,_0x44bf8b,!![]);}catch(_0x43b2b9){return BPromise[_0xea7e('0x27')](_0x43b2b9);}return _0x105edb[_0xea7e('0x28')]();};}function saveUpdates(_0x330754,_0x39bba8){return function(_0x2e4ac9){if(_0x2e4ac9){return _0x2e4ac9[_0xea7e('0x29')](_0x330754)[_0xea7e('0x2a')](function(_0x284d6b){return _0x284d6b;});}return null;};}function removeEntity(_0x371a68,_0x409c34){return function(_0x2ec42f){if(_0x2ec42f){return _0x2ec42f[_0xea7e('0x2b')]()[_0xea7e('0x2a')](function(){_0x371a68[_0xea7e('0x1d')](0xcc)[_0xea7e('0x1e')]();});}};}function handleEntityNotFound(_0x8bf0d6,_0x5104d1){return function(_0x3405a7){if(!_0x3405a7){_0x8bf0d6[_0xea7e('0x2c')](0x194);}return _0x3405a7;};}function handleError(_0xf5d8,_0x420b7e){_0x420b7e=_0x420b7e||0x1f4;return function(_0x17c212){logger[_0xea7e('0x2d')](_0x17c212[_0xea7e('0x2e')]);if(_0x17c212[_0xea7e('0x2f')]){delete _0x17c212[_0xea7e('0x2f')];}_0xf5d8[_0xea7e('0x1d')](_0x420b7e)[_0xea7e('0x30')](_0x17c212);};}exports['index']=function(_0x25974b,_0x2ad0b3){var _0x12f4e0={},_0x3214ec={},_0x123e23={'count':0x0,'rows':[]};var _0x1a54ac=_[_0xea7e('0x31')](db[_0xea7e('0x32')]['rawAttributes'],function(_0x30ec98){return{'name':_0x30ec98[_0xea7e('0x33')],'type':_0x30ec98[_0xea7e('0x34')][_0xea7e('0x35')]};});_0x3214ec[_0xea7e('0x36')]=_['map'](_0x1a54ac,_0xea7e('0x2f'));_0x3214ec['query']=_[_0xea7e('0x37')](_0x25974b['query']);_0x3214ec['filters']=_[_0xea7e('0x38')](_0x3214ec[_0xea7e('0x36')],_0x3214ec[_0xea7e('0x39')]);_0x12f4e0[_0xea7e('0x3a')]=_['intersection'](_0x3214ec[_0xea7e('0x36')],qs[_0xea7e('0x3b')](_0x25974b[_0xea7e('0x39')][_0xea7e('0x3b')]));_0x12f4e0[_0xea7e('0x3a')]=_0x12f4e0['attributes'][_0xea7e('0x3c')]?_0x12f4e0[_0xea7e('0x3a')]:_0x3214ec[_0xea7e('0x36')];if(!_0x25974b['query']['hasOwnProperty'](_0xea7e('0x3d'))){_0x12f4e0[_0xea7e('0x22')]=qs[_0xea7e('0x22')](_0x25974b['query'][_0xea7e('0x22')]);_0x12f4e0['offset']=qs[_0xea7e('0x1f')](_0x25974b['query'][_0xea7e('0x1f')]);}_0x12f4e0[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_0x25974b['query'][_0xea7e('0x3f')]);_0x12f4e0[_0xea7e('0x40')]=qs['filters'](_[_0xea7e('0x41')](_0x25974b[_0xea7e('0x39')],_0x3214ec['filters']),_0x1a54ac);if(_0x25974b['query']['filter']){_0x12f4e0[_0xea7e('0x40')]=_[_0xea7e('0x42')](_0x12f4e0[_0xea7e('0x40')],{'$or':_[_0xea7e('0x31')](_0x1a54ac,function(_0x432fe2){if(_0x432fe2['type']!=='VIRTUAL'){var _0x52ffff={};_0x52ffff[_0x432fe2['name']]={'$like':'%'+_0x25974b[_0xea7e('0x39')][_0xea7e('0x43')]+'%'};return _0x52ffff;}})});}_0x12f4e0=_['merge']({},_0x12f4e0,_0x25974b[_0xea7e('0x44')]);var _0x31ca22={'where':_0x12f4e0[_0xea7e('0x40')]};return db[_0xea7e('0x32')][_0xea7e('0x21')](_0x31ca22)[_0xea7e('0x2a')](function(_0x306803){_0x123e23[_0xea7e('0x21')]=_0x306803;if(_0x25974b[_0xea7e('0x39')][_0xea7e('0x45')]){_0x12f4e0[_0xea7e('0x46')]=[{'all':!![]}];}return db[_0xea7e('0x32')]['findAll'](_0x12f4e0);})[_0xea7e('0x2a')](function(_0x203b13){_0x123e23[_0xea7e('0x47')]=_0x203b13;return _0x123e23;})['then'](respondWithFilteredResult(_0x2ad0b3,_0x12f4e0))[_0xea7e('0x48')](handleError(_0x2ad0b3,null));};exports[_0xea7e('0x49')]=function(_0x5120d3,_0x3e10d9){var _0x193e9a={'raw':!![],'where':{'id':_0x5120d3[_0xea7e('0x4a')]['id']}},_0x4990dc={};_0x4990dc[_0xea7e('0x36')]=_[_0xea7e('0x37')](db[_0xea7e('0x32')]['rawAttributes']);_0x4990dc[_0xea7e('0x39')]=_['keys'](_0x5120d3[_0xea7e('0x39')]);_0x4990dc[_0xea7e('0x4b')]=_[_0xea7e('0x38')](_0x4990dc[_0xea7e('0x36')],_0x4990dc[_0xea7e('0x39')]);_0x193e9a[_0xea7e('0x3a')]=_[_0xea7e('0x38')](_0x4990dc['model'],qs[_0xea7e('0x3b')](_0x5120d3[_0xea7e('0x39')]['fields']));_0x193e9a[_0xea7e('0x3a')]=_0x193e9a[_0xea7e('0x3a')][_0xea7e('0x3c')]?_0x193e9a[_0xea7e('0x3a')]:_0x4990dc['model'];if(_0x5120d3[_0xea7e('0x39')][_0xea7e('0x45')]){_0x193e9a[_0xea7e('0x46')]=[{'all':!![]}];}_0x193e9a=_['merge']({},_0x193e9a,_0x5120d3[_0xea7e('0x44')]);return db[_0xea7e('0x32')][_0xea7e('0x4c')](_0x193e9a)[_0xea7e('0x2a')](handleEntityNotFound(_0x3e10d9,null))['then'](respondWithResult(_0x3e10d9,null))[_0xea7e('0x48')](handleError(_0x3e10d9,null));};exports['create']=function(_0x74ff2d,_0x4cdbb8){return db[_0xea7e('0x32')][_0xea7e('0x4d')](_0x74ff2d[_0xea7e('0x4e')],{})[_0xea7e('0x2a')](respondWithResult(_0x4cdbb8,0xc9))[_0xea7e('0x48')](handleError(_0x4cdbb8,null));};exports[_0xea7e('0x29')]=function(_0x1c786c,_0x4f1693){if(_0x1c786c[_0xea7e('0x4e')]['id']){delete _0x1c786c[_0xea7e('0x4e')]['id'];}return db[_0xea7e('0x32')][_0xea7e('0x4c')]({'where':{'id':_0x1c786c[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x4f1693,null))[_0xea7e('0x2a')](saveUpdates(_0x1c786c[_0xea7e('0x4e')],null))[_0xea7e('0x2a')](respondWithResult(_0x4f1693,null))[_0xea7e('0x48')](handleError(_0x4f1693,null));};exports[_0xea7e('0x2b')]=function(_0x9465bf,_0x1f6fe1){return db['ChatGroup'][_0xea7e('0x4c')]({'where':{'id':_0x9465bf[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x1f6fe1,null))[_0xea7e('0x2a')](removeEntity(_0x1f6fe1,null))[_0xea7e('0x48')](handleError(_0x1f6fe1,null));};exports['describe']=function(_0x266f4e,_0x551976){return db[_0xea7e('0x32')]['describe']()[_0xea7e('0x2a')](respondWithResult(_0x551976,null))[_0xea7e('0x48')](handleError(_0x551976,null));};exports['getUnread']=function(_0x3ed578,_0x5a0f35,_0x161b55){return db[_0xea7e('0x4f')][_0xea7e('0x21')]({'where':{'ChatGroupId':_0x3ed578[_0xea7e('0x4a')]['id'],'ToId':_0x3ed578['user']['id'],'read':![]}})[_0xea7e('0x2a')](function(_0x44c68b){return{'id':_[_0xea7e('0x50')](_0x3ed578['params']['id']),'count':_0x44c68b};})[_0xea7e('0x2a')](respondWithResult(_0x5a0f35,null))[_0xea7e('0x48')](handleError(_0x5a0f35,null));};exports['addMembers']=function(_0x4e1ebd,_0x15eca1,_0x12e767){return db[_0xea7e('0x32')][_0xea7e('0x4c')]({'where':{'id':_0x4e1ebd[_0xea7e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15eca1,null))['then'](function(_0x1ded86){if(_0x1ded86){return _0x1ded86[_0xea7e('0x51')](_0x4e1ebd[_0xea7e('0x4e')]['ids'],_['omit'](_0x4e1ebd[_0xea7e('0x4e')],[_0xea7e('0x52'),'id'])||{});}})['then'](respondWithResult(_0x15eca1,null))['catch'](handleError(_0x15eca1,null));};exports[_0xea7e('0x53')]=function(_0x58303e,_0x3614bb,_0x104fb6){var _0x3cd0a9={};var _0x1a228a={};var _0x5ed490;var _0x4863b3;return db[_0xea7e('0x32')][_0xea7e('0x54')]({'where':{'id':_0x58303e['params']['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x3614bb,null))['then'](function(_0x136313){if(_0x136313){_0x5ed490=_0x136313;_0x1a228a[_0xea7e('0x36')]=_['keys'](db['User'][_0xea7e('0x55')]);_0x1a228a['query']=_[_0xea7e('0x37')](_0x58303e['query']);_0x1a228a[_0xea7e('0x4b')]=_['intersection'](_0x1a228a['model'],_0x1a228a[_0xea7e('0x39')]);_0x3cd0a9[_0xea7e('0x3a')]=_['intersection'](_0x1a228a[_0xea7e('0x36')],qs[_0xea7e('0x3b')](_0x58303e[_0xea7e('0x39')]['fields']));_0x3cd0a9[_0xea7e('0x3a')]=_0x3cd0a9[_0xea7e('0x3a')]['length']?_0x3cd0a9['attributes']:_0x1a228a['model'];_0x3cd0a9[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_0x58303e[_0xea7e('0x39')][_0xea7e('0x3f')]);_0x3cd0a9[_0xea7e('0x40')]=qs[_0xea7e('0x4b')](_['pick'](_0x58303e[_0xea7e('0x39')],_0x1a228a[_0xea7e('0x4b')]));if(_0x58303e['query'][_0xea7e('0x43')]){_0x3cd0a9['where']=_[_0xea7e('0x42')](_0x3cd0a9[_0xea7e('0x40')],{'$or':_[_0xea7e('0x31')](_0x3cd0a9[_0xea7e('0x3a')],function(_0x584e9f){var _0x155024={};_0x155024[_0x584e9f]={'$like':'%'+_0x58303e[_0xea7e('0x39')]['filter']+'%'};return _0x155024;})});}_0x3cd0a9=_['merge']({},_0x3cd0a9,_0x58303e['options']);return _0x5ed490[_0xea7e('0x53')](_0x3cd0a9);}})[_0xea7e('0x2a')](function(_0x35d29b){if(_0x35d29b){_0x4863b3=_0x35d29b[_0xea7e('0x3c')];if(!_0x58303e[_0xea7e('0x39')]['hasOwnProperty'](_0xea7e('0x3d'))){_0x3cd0a9['limit']=qs[_0xea7e('0x22')](_0x58303e[_0xea7e('0x39')][_0xea7e('0x22')]);_0x3cd0a9[_0xea7e('0x1f')]=qs[_0xea7e('0x1f')](_0x58303e[_0xea7e('0x39')][_0xea7e('0x1f')]);}return _0x5ed490[_0xea7e('0x53')](_0x3cd0a9);}})[_0xea7e('0x2a')](function(_0x590eaa){if(_0x590eaa){return _0x590eaa?{'count':_0x4863b3,'rows':_0x590eaa}:null;}})[_0xea7e('0x2a')](respondWithResult(_0x3614bb,null))[_0xea7e('0x48')](handleError(_0x3614bb,null));};exports[_0xea7e('0x56')]=function(_0xa825de,_0x4136d4,_0x29d878){return db[_0xea7e('0x32')][_0xea7e('0x4c')]({'where':{'id':_0xa825de[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x4136d4,null))[_0xea7e('0x2a')](function(_0x2f9d8d){if(_0x2f9d8d){return _0x2f9d8d[_0xea7e('0x56')](_0xa825de[_0xea7e('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x4136d4,null))[_0xea7e('0x48')](handleError(_0x4136d4,null));};exports[_0xea7e('0x57')]=function(_0x120700,_0x547c0f,_0x219fb9){if(_0x120700[_0xea7e('0x4e')]['id']){delete _0x120700['body']['id'];}return db['ChatGroup'][_0xea7e('0x4c')]({'where':{'id':_0x120700['params']['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x547c0f,null))[_0xea7e('0x2a')](function(_0x52f355){if(_0x52f355){_0x120700[_0xea7e('0x4e')][_0xea7e('0x58')]=_0x52f355['id'];return db[_0xea7e('0x4f')][_0xea7e('0x4d')](_0x120700[_0xea7e('0x4e')]);}})[_0xea7e('0x2a')](respondWithResult(_0x547c0f,null))[_0xea7e('0x48')](handleError(_0x547c0f,null));};exports[_0xea7e('0x59')]=function(_0x2025ae,_0x305a23,_0x566a2f){var _0x1ae8f2={};var _0x631eff={};var _0x1632f1;var _0x15ea33;return db['ChatGroup'][_0xea7e('0x54')]({'where':{'id':_0x2025ae[_0xea7e('0x4a')]['id']}})[_0xea7e('0x2a')](handleEntityNotFound(_0x305a23,null))[_0xea7e('0x2a')](function(_0x47c84d){if(_0x47c84d){_0x1632f1=_0x47c84d;_0x631eff[_0xea7e('0x36')]=_[_0xea7e('0x37')](db['ChatInternalMessage'][_0xea7e('0x55')]);_0x631eff[_0xea7e('0x39')]=_[_0xea7e('0x37')](_0x2025ae[_0xea7e('0x39')]);_0x631eff[_0xea7e('0x4b')]=_[_0xea7e('0x38')](_0x631eff[_0xea7e('0x36')],_0x631eff['query']);_0x1ae8f2['attributes']=_[_0xea7e('0x38')](_0x631eff[_0xea7e('0x36')],qs[_0xea7e('0x3b')](_0x2025ae[_0xea7e('0x39')][_0xea7e('0x3b')]));_0x1ae8f2[_0xea7e('0x3a')]=_0x1ae8f2[_0xea7e('0x3a')][_0xea7e('0x3c')]?_0x1ae8f2[_0xea7e('0x3a')]:_0x631eff['model'];_0x1ae8f2[_0xea7e('0x3e')]=qs[_0xea7e('0x3f')](_0x2025ae[_0xea7e('0x39')]['sort']);_0x1ae8f2[_0xea7e('0x40')]=qs[_0xea7e('0x4b')](_[_0xea7e('0x41')](_0x2025ae['query'],_0x631eff[_0xea7e('0x4b')]));if(_0x2025ae['query'][_0xea7e('0x43')]){_0x1ae8f2[_0xea7e('0x40')]=_['merge'](_0x1ae8f2[_0xea7e('0x40')],{'$or':_['map'](_0x1ae8f2[_0xea7e('0x3a')],function(_0x480b27){var _0x20ea44={};_0x20ea44[_0x480b27]={'$like':'%'+_0x2025ae[_0xea7e('0x39')]['filter']+'%'};return _0x20ea44;})});}if(_0x2025ae['query'][_0xea7e('0x5a')]){var _0x41295b=_0x2025ae[_0xea7e('0x39')][_0xea7e('0x5a')][_0xea7e('0x5b')](',');var _0x2ddb34={};_0x2ddb34[_0x41295b[0x0]]={'$gte':moment(_0x41295b[0x1])[_0xea7e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1ae8f2[_0xea7e('0x40')]=_[_0xea7e('0x42')](_0x1ae8f2['where'],_0x2ddb34);}_0x1ae8f2=_[_0xea7e('0x42')]({},_0x1ae8f2,_0x2025ae['options']);return _0x1632f1['getMessages'](_0x1ae8f2);}})['then'](function(_0x31c80f){if(_0x31c80f){_0x15ea33=_0x31c80f['length'];if(!_0x2025ae[_0xea7e('0x39')][_0xea7e('0x5d')]('nolimit')){_0x1ae8f2['limit']=qs['limit'](_0x2025ae['query'][_0xea7e('0x22')]);_0x1ae8f2['offset']=qs[_0xea7e('0x1f')](_0x2025ae['query'][_0xea7e('0x1f')]);}return _0x1632f1[_0xea7e('0x59')](_0x1ae8f2);}})[_0xea7e('0x2a')](function(_0x3cbd41){if(_0x3cbd41){return _0x3cbd41?{'count':_0x15ea33,'rows':_0x3cbd41}:null;}})[_0xea7e('0x2a')](respondWithResult(_0x305a23,null))[_0xea7e('0x48')](handleError(_0x305a23,null));};
\ No newline at end of file
+var _0x28c7=['include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','User','pick','removeMembers','addMessage','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ChatGroup','includeAll'];(function(_0x27c0f8,_0xd1bd2f){var _0x426b4e=function(_0x1d3f4b){while(--_0x1d3f4b){_0x27c0f8['push'](_0x27c0f8['shift']());}};_0x426b4e(++_0xd1bd2f);}(_0x28c7,0x7d));var _0x728c=function(_0x476350,_0x481037){_0x476350=_0x476350-0x0;var _0x452d18=_0x28c7[_0x476350];return _0x452d18;};'use strict';var emlformat=require(_0x728c('0x0'));var rimraf=require(_0x728c('0x1'));var zipdir=require(_0x728c('0x2'));var jsonpatch=require(_0x728c('0x3'));var rp=require(_0x728c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x728c('0x5'));var util=require(_0x728c('0x6'));var path=require(_0x728c('0x7'));var sox=require(_0x728c('0x8'));var csv=require(_0x728c('0x9'));var ejs=require(_0x728c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x728c('0xb'));var crypto=require(_0x728c('0xc'));var jsforce=require(_0x728c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x728c('0x9'));var querystring=require('querystring');var Papa=require(_0x728c('0xe'));var Redis=require(_0x728c('0xf'));var authService=require(_0x728c('0x10'));var qs=require(_0x728c('0x11'));var as=require(_0x728c('0x12'));var hardwareService=require(_0x728c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x728c('0x14'));var config=require(_0x728c('0x15'));var licenseUtil=require(_0x728c('0x16'));var db=require(_0x728c('0x17'))['db'];config[_0x728c('0x18')]=_[_0x728c('0x19')](config[_0x728c('0x18')],{'host':_0x728c('0x1a'),'port':0x18eb});var socket=require(_0x728c('0x1b'))(new Redis(config['redis']));require(_0x728c('0x1c'))[_0x728c('0x1d')](socket);function respondWithStatusCode(_0x5ec169,_0x8afd0b){_0x8afd0b=_0x8afd0b||0xcc;return function(_0x4b5046){if(_0x4b5046){return _0x5ec169[_0x728c('0x1e')](_0x8afd0b);}return _0x5ec169[_0x728c('0x1f')](_0x8afd0b)[_0x728c('0x20')]();};}function respondWithResult(_0x11e97f,_0x8ab394){_0x8ab394=_0x8ab394||0xc8;return function(_0x2b621b){if(_0x2b621b){return _0x11e97f[_0x728c('0x1f')](_0x8ab394)['json'](_0x2b621b);}};}function respondWithFilteredResult(_0x594e64,_0x320b3d){return function(_0x2b18dc){if(_0x2b18dc){var _0x3cdf6b=typeof _0x320b3d[_0x728c('0x21')]===_0x728c('0x22')&&typeof _0x320b3d[_0x728c('0x23')]===_0x728c('0x22');var _0x38fb5c=_0x2b18dc[_0x728c('0x24')];var _0x1440f8=_0x3cdf6b?0x0:_0x320b3d[_0x728c('0x21')];var _0xc1a8e3=_0x3cdf6b?_0x2b18dc[_0x728c('0x24')]:_0x320b3d[_0x728c('0x21')]+_0x320b3d[_0x728c('0x23')];var _0x3178e6;if(_0xc1a8e3>=_0x38fb5c){_0xc1a8e3=_0x38fb5c;_0x3178e6=0xc8;}else{_0x3178e6=0xce;}_0x594e64['status'](_0x3178e6);return _0x594e64[_0x728c('0x25')]('Content-Range',_0x1440f8+'-'+_0xc1a8e3+'/'+_0x38fb5c)[_0x728c('0x26')](_0x2b18dc);}return null;};}function patchUpdates(_0x1a3b51){return function(_0x3a24c8){try{jsonpatch[_0x728c('0x27')](_0x3a24c8,_0x1a3b51,!![]);}catch(_0x48ec9b){return BPromise[_0x728c('0x28')](_0x48ec9b);}return _0x3a24c8[_0x728c('0x29')]();};}function saveUpdates(_0x504b2d,_0x35edd6){return function(_0x505c10){if(_0x505c10){return _0x505c10[_0x728c('0x2a')](_0x504b2d)[_0x728c('0x2b')](function(_0x42cf4f){return _0x42cf4f;});}return null;};}function removeEntity(_0x189ddc,_0x40bb3e){return function(_0x3a4645){if(_0x3a4645){return _0x3a4645[_0x728c('0x2c')]()[_0x728c('0x2b')](function(){_0x189ddc['status'](0xcc)[_0x728c('0x20')]();});}};}function handleEntityNotFound(_0x57a8d1,_0x38ea70){return function(_0x510e56){if(!_0x510e56){_0x57a8d1[_0x728c('0x1e')](0x194);}return _0x510e56;};}function handleError(_0x652ad1,_0x1347f4){_0x1347f4=_0x1347f4||0x1f4;return function(_0x4a8da7){logger[_0x728c('0x2d')](_0x4a8da7[_0x728c('0x2e')]);if(_0x4a8da7[_0x728c('0x2f')]){delete _0x4a8da7[_0x728c('0x2f')];}_0x652ad1['status'](_0x1347f4)[_0x728c('0x30')](_0x4a8da7);};}exports['index']=function(_0x21c7ef,_0x9dc0dd){var _0x49c6eb={},_0x11dc0d={},_0x2e9e9f={'count':0x0,'rows':[]};var _0x12c727=_['map'](db['ChatGroup']['rawAttributes'],function(_0xe340fc){return{'name':_0xe340fc[_0x728c('0x31')],'type':_0xe340fc[_0x728c('0x32')][_0x728c('0x33')]};});_0x11dc0d['model']=_[_0x728c('0x34')](_0x12c727,'name');_0x11dc0d['query']=_[_0x728c('0x35')](_0x21c7ef[_0x728c('0x36')]);_0x11dc0d[_0x728c('0x37')]=_[_0x728c('0x38')](_0x11dc0d[_0x728c('0x39')],_0x11dc0d[_0x728c('0x36')]);_0x49c6eb['attributes']=_[_0x728c('0x38')](_0x11dc0d[_0x728c('0x39')],qs[_0x728c('0x3a')](_0x21c7ef[_0x728c('0x36')][_0x728c('0x3a')]));_0x49c6eb[_0x728c('0x3b')]=_0x49c6eb['attributes'][_0x728c('0x3c')]?_0x49c6eb[_0x728c('0x3b')]:_0x11dc0d[_0x728c('0x39')];if(!_0x21c7ef[_0x728c('0x36')][_0x728c('0x3d')](_0x728c('0x3e'))){_0x49c6eb['limit']=qs[_0x728c('0x23')](_0x21c7ef[_0x728c('0x36')][_0x728c('0x23')]);_0x49c6eb[_0x728c('0x21')]=qs[_0x728c('0x21')](_0x21c7ef[_0x728c('0x36')][_0x728c('0x21')]);}_0x49c6eb[_0x728c('0x3f')]=qs[_0x728c('0x40')](_0x21c7ef[_0x728c('0x36')]['sort']);_0x49c6eb[_0x728c('0x41')]=qs['filters'](_['pick'](_0x21c7ef['query'],_0x11dc0d['filters']),_0x12c727);if(_0x21c7ef[_0x728c('0x36')][_0x728c('0x42')]){_0x49c6eb[_0x728c('0x41')]=_[_0x728c('0x43')](_0x49c6eb[_0x728c('0x41')],{'$or':_[_0x728c('0x34')](_0x12c727,function(_0x12e445){if(_0x12e445[_0x728c('0x32')]!=='VIRTUAL'){var _0x38c7d9={};_0x38c7d9[_0x12e445[_0x728c('0x2f')]]={'$like':'%'+_0x21c7ef[_0x728c('0x36')][_0x728c('0x42')]+'%'};return _0x38c7d9;}})});}_0x49c6eb=_[_0x728c('0x43')]({},_0x49c6eb,_0x21c7ef[_0x728c('0x44')]);var _0x42c751={'where':_0x49c6eb[_0x728c('0x41')]};return db[_0x728c('0x45')][_0x728c('0x24')](_0x42c751)[_0x728c('0x2b')](function(_0x128b78){_0x2e9e9f[_0x728c('0x24')]=_0x128b78;if(_0x21c7ef[_0x728c('0x36')][_0x728c('0x46')]){_0x49c6eb[_0x728c('0x47')]=[{'all':!![]}];}return db[_0x728c('0x45')][_0x728c('0x48')](_0x49c6eb);})[_0x728c('0x2b')](function(_0x44259d){_0x2e9e9f[_0x728c('0x49')]=_0x44259d;return _0x2e9e9f;})[_0x728c('0x2b')](respondWithFilteredResult(_0x9dc0dd,_0x49c6eb))[_0x728c('0x4a')](handleError(_0x9dc0dd,null));};exports['show']=function(_0x1fd311,_0x6e83c0){var _0x1ba3c4={'raw':!![],'where':{'id':_0x1fd311[_0x728c('0x4b')]['id']}},_0x3a9a9a={};_0x3a9a9a['model']=_[_0x728c('0x35')](db[_0x728c('0x45')][_0x728c('0x4c')]);_0x3a9a9a[_0x728c('0x36')]=_[_0x728c('0x35')](_0x1fd311[_0x728c('0x36')]);_0x3a9a9a[_0x728c('0x37')]=_[_0x728c('0x38')](_0x3a9a9a[_0x728c('0x39')],_0x3a9a9a['query']);_0x1ba3c4[_0x728c('0x3b')]=_[_0x728c('0x38')](_0x3a9a9a[_0x728c('0x39')],qs[_0x728c('0x3a')](_0x1fd311[_0x728c('0x36')]['fields']));_0x1ba3c4[_0x728c('0x3b')]=_0x1ba3c4[_0x728c('0x3b')]['length']?_0x1ba3c4['attributes']:_0x3a9a9a[_0x728c('0x39')];if(_0x1fd311[_0x728c('0x36')]['includeAll']){_0x1ba3c4[_0x728c('0x47')]=[{'all':!![]}];}_0x1ba3c4=_[_0x728c('0x43')]({},_0x1ba3c4,_0x1fd311[_0x728c('0x44')]);return db[_0x728c('0x45')][_0x728c('0x4d')](_0x1ba3c4)['then'](handleEntityNotFound(_0x6e83c0,null))['then'](respondWithResult(_0x6e83c0,null))[_0x728c('0x4a')](handleError(_0x6e83c0,null));};exports[_0x728c('0x4e')]=function(_0x6a39a5,_0x3dec30){return db[_0x728c('0x45')]['create'](_0x6a39a5[_0x728c('0x4f')],{})[_0x728c('0x2b')](respondWithResult(_0x3dec30,0xc9))[_0x728c('0x4a')](handleError(_0x3dec30,null));};exports[_0x728c('0x2a')]=function(_0x2c2709,_0x2431e0){if(_0x2c2709[_0x728c('0x4f')]['id']){delete _0x2c2709[_0x728c('0x4f')]['id'];}return db[_0x728c('0x45')][_0x728c('0x4d')]({'where':{'id':_0x2c2709[_0x728c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2431e0,null))[_0x728c('0x2b')](saveUpdates(_0x2c2709['body'],null))[_0x728c('0x2b')](respondWithResult(_0x2431e0,null))[_0x728c('0x4a')](handleError(_0x2431e0,null));};exports[_0x728c('0x2c')]=function(_0x9e7300,_0x509cf1){return db['ChatGroup'][_0x728c('0x4d')]({'where':{'id':_0x9e7300[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x509cf1,null))[_0x728c('0x2b')](removeEntity(_0x509cf1,null))[_0x728c('0x4a')](handleError(_0x509cf1,null));};exports['describe']=function(_0x277764,_0x2a1e04){return db[_0x728c('0x45')][_0x728c('0x50')]()[_0x728c('0x2b')](respondWithResult(_0x2a1e04,null))[_0x728c('0x4a')](handleError(_0x2a1e04,null));};exports[_0x728c('0x51')]=function(_0x48630d,_0x4621c9,_0x2fda2e){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x48630d['params']['id'],'ToId':_0x48630d[_0x728c('0x52')]['id'],'read':![]}})[_0x728c('0x2b')](function(_0x20bc46){return{'id':_[_0x728c('0x53')](_0x48630d['params']['id']),'count':_0x20bc46};})['then'](respondWithResult(_0x4621c9,null))['catch'](handleError(_0x4621c9,null));};exports[_0x728c('0x54')]=function(_0x591d64,_0x38e45a,_0x12e3a3){return db['ChatGroup'][_0x728c('0x4d')]({'where':{'id':_0x591d64[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x38e45a,null))[_0x728c('0x2b')](function(_0x8ef293){if(_0x8ef293){return _0x8ef293[_0x728c('0x54')](_0x591d64[_0x728c('0x4f')]['ids'],_['omit'](_0x591d64[_0x728c('0x4f')],[_0x728c('0x55'),'id'])||{});}})[_0x728c('0x2b')](respondWithResult(_0x38e45a,null))[_0x728c('0x4a')](handleError(_0x38e45a,null));};exports[_0x728c('0x56')]=function(_0x3caec6,_0x2acc95,_0x2dbd2b){var _0x197beb={};var _0x45ee62={};var _0x5e772b;var _0x5f29da;return db[_0x728c('0x45')][_0x728c('0x57')]({'where':{'id':_0x3caec6[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x2acc95,null))[_0x728c('0x2b')](function(_0x2fe8cd){if(_0x2fe8cd){_0x5e772b=_0x2fe8cd;_0x45ee62[_0x728c('0x39')]=_[_0x728c('0x35')](db[_0x728c('0x58')][_0x728c('0x4c')]);_0x45ee62['query']=_[_0x728c('0x35')](_0x3caec6[_0x728c('0x36')]);_0x45ee62[_0x728c('0x37')]=_[_0x728c('0x38')](_0x45ee62['model'],_0x45ee62[_0x728c('0x36')]);_0x197beb[_0x728c('0x3b')]=_[_0x728c('0x38')](_0x45ee62[_0x728c('0x39')],qs[_0x728c('0x3a')](_0x3caec6[_0x728c('0x36')][_0x728c('0x3a')]));_0x197beb[_0x728c('0x3b')]=_0x197beb['attributes'][_0x728c('0x3c')]?_0x197beb[_0x728c('0x3b')]:_0x45ee62[_0x728c('0x39')];_0x197beb[_0x728c('0x3f')]=qs['sort'](_0x3caec6[_0x728c('0x36')][_0x728c('0x40')]);_0x197beb[_0x728c('0x41')]=qs[_0x728c('0x37')](_[_0x728c('0x59')](_0x3caec6['query'],_0x45ee62[_0x728c('0x37')]));if(_0x3caec6[_0x728c('0x36')][_0x728c('0x42')]){_0x197beb[_0x728c('0x41')]=_[_0x728c('0x43')](_0x197beb[_0x728c('0x41')],{'$or':_[_0x728c('0x34')](_0x197beb[_0x728c('0x3b')],function(_0x4d047e){var _0x4b899b={};_0x4b899b[_0x4d047e]={'$like':'%'+_0x3caec6[_0x728c('0x36')][_0x728c('0x42')]+'%'};return _0x4b899b;})});}_0x197beb=_[_0x728c('0x43')]({},_0x197beb,_0x3caec6[_0x728c('0x44')]);return _0x5e772b[_0x728c('0x56')](_0x197beb);}})[_0x728c('0x2b')](function(_0x108adf){if(_0x108adf){_0x5f29da=_0x108adf['length'];if(!_0x3caec6[_0x728c('0x36')]['hasOwnProperty'](_0x728c('0x3e'))){_0x197beb[_0x728c('0x23')]=qs['limit'](_0x3caec6[_0x728c('0x36')][_0x728c('0x23')]);_0x197beb[_0x728c('0x21')]=qs['offset'](_0x3caec6[_0x728c('0x36')][_0x728c('0x21')]);}return _0x5e772b[_0x728c('0x56')](_0x197beb);}})[_0x728c('0x2b')](function(_0x5ce0ca){if(_0x5ce0ca){return _0x5ce0ca?{'count':_0x5f29da,'rows':_0x5ce0ca}:null;}})['then'](respondWithResult(_0x2acc95,null))[_0x728c('0x4a')](handleError(_0x2acc95,null));};exports[_0x728c('0x5a')]=function(_0x3f6cf,_0x4dbd70,_0x447601){return db['ChatGroup'][_0x728c('0x4d')]({'where':{'id':_0x3f6cf[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x4dbd70,null))[_0x728c('0x2b')](function(_0x14889b){if(_0x14889b){return _0x14889b['removeMembers'](_0x3f6cf[_0x728c('0x36')][_0x728c('0x55')]);}})[_0x728c('0x2b')](respondWithStatusCode(_0x4dbd70,null))[_0x728c('0x4a')](handleError(_0x4dbd70,null));};exports[_0x728c('0x5b')]=function(_0x4f6be0,_0x511cae,_0x275e67){if(_0x4f6be0[_0x728c('0x4f')]['id']){delete _0x4f6be0['body']['id'];}return db[_0x728c('0x45')][_0x728c('0x4d')]({'where':{'id':_0x4f6be0[_0x728c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x511cae,null))[_0x728c('0x2b')](function(_0x21dd0b){if(_0x21dd0b){_0x4f6be0[_0x728c('0x4f')]['ChatGroupId']=_0x21dd0b['id'];return db[_0x728c('0x5c')][_0x728c('0x4e')](_0x4f6be0[_0x728c('0x4f')]);}})[_0x728c('0x2b')](respondWithResult(_0x511cae,null))['catch'](handleError(_0x511cae,null));};exports['getMessages']=function(_0x59f627,_0x25a662,_0x16e3c1){var _0x4d1a48={};var _0x33dd0c={};var _0x4d2ac5;var _0x4484b3;return db['ChatGroup'][_0x728c('0x57')]({'where':{'id':_0x59f627[_0x728c('0x4b')]['id']}})[_0x728c('0x2b')](handleEntityNotFound(_0x25a662,null))[_0x728c('0x2b')](function(_0x1a78bf){if(_0x1a78bf){_0x4d2ac5=_0x1a78bf;_0x33dd0c[_0x728c('0x39')]=_['keys'](db['ChatInternalMessage'][_0x728c('0x4c')]);_0x33dd0c[_0x728c('0x36')]=_[_0x728c('0x35')](_0x59f627[_0x728c('0x36')]);_0x33dd0c[_0x728c('0x37')]=_[_0x728c('0x38')](_0x33dd0c[_0x728c('0x39')],_0x33dd0c[_0x728c('0x36')]);_0x4d1a48[_0x728c('0x3b')]=_['intersection'](_0x33dd0c[_0x728c('0x39')],qs['fields'](_0x59f627[_0x728c('0x36')][_0x728c('0x3a')]));_0x4d1a48[_0x728c('0x3b')]=_0x4d1a48['attributes'][_0x728c('0x3c')]?_0x4d1a48[_0x728c('0x3b')]:_0x33dd0c[_0x728c('0x39')];_0x4d1a48[_0x728c('0x3f')]=qs['sort'](_0x59f627['query'][_0x728c('0x40')]);_0x4d1a48[_0x728c('0x41')]=qs['filters'](_['pick'](_0x59f627['query'],_0x33dd0c[_0x728c('0x37')]));if(_0x59f627[_0x728c('0x36')][_0x728c('0x42')]){_0x4d1a48[_0x728c('0x41')]=_[_0x728c('0x43')](_0x4d1a48['where'],{'$or':_[_0x728c('0x34')](_0x4d1a48[_0x728c('0x3b')],function(_0x418d2d){var _0x496fda={};_0x496fda[_0x418d2d]={'$like':'%'+_0x59f627[_0x728c('0x36')][_0x728c('0x42')]+'%'};return _0x496fda;})});}if(_0x59f627[_0x728c('0x36')][_0x728c('0x5d')]){var _0x5e3af5=_0x59f627[_0x728c('0x36')][_0x728c('0x5d')][_0x728c('0x5e')](',');var _0x15aafa={};_0x15aafa[_0x5e3af5[0x0]]={'$gte':moment(_0x5e3af5[0x1])[_0x728c('0x5f')](_0x728c('0x60'))};_0x4d1a48[_0x728c('0x41')]=_[_0x728c('0x43')](_0x4d1a48[_0x728c('0x41')],_0x15aafa);}_0x4d1a48=_[_0x728c('0x43')]({},_0x4d1a48,_0x59f627[_0x728c('0x44')]);return _0x4d2ac5[_0x728c('0x61')](_0x4d1a48);}})[_0x728c('0x2b')](function(_0xc795b2){if(_0xc795b2){_0x4484b3=_0xc795b2[_0x728c('0x3c')];if(!_0x59f627[_0x728c('0x36')][_0x728c('0x3d')](_0x728c('0x3e'))){_0x4d1a48[_0x728c('0x23')]=qs[_0x728c('0x23')](_0x59f627[_0x728c('0x36')][_0x728c('0x23')]);_0x4d1a48[_0x728c('0x21')]=qs[_0x728c('0x21')](_0x59f627[_0x728c('0x36')][_0x728c('0x21')]);}return _0x4d2ac5['getMessages'](_0x4d1a48);}})['then'](function(_0x19a3d2){if(_0x19a3d2){return _0x19a3d2?{'count':_0x4484b3,'rows':_0x19a3d2}:null;}})[_0x728c('0x2b')](respondWithResult(_0x25a662,null))[_0x728c('0x4a')](handleError(_0x25a662,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 484ed01..e855f55 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 _0x0b79=['hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0x15eb1a,_0x16dc02){var _0x1e7205=function(_0x32fad8){while(--_0x32fad8){_0x15eb1a['push'](_0x15eb1a['shift']());}};_0x1e7205(++_0x16dc02);}(_0x0b79,0xad));var _0x90b7=function(_0xc85b17,_0x2b981f){_0xc85b17=_0xc85b17-0x0;var _0x490ef8=_0x0b79[_0xc85b17];return _0x490ef8;};'use strict';var EventEmitter=require(_0x90b7('0x0'));var ChatGroup=require(_0x90b7('0x1'))['db'][_0x90b7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x90b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x90b7('0x4'),'afterDestroy':_0x90b7('0x5')};function emitEvent(_0x497698){return function(_0xd3671f,_0x4cd6c5,_0xd50b1b){ChatGroupEvents[_0x90b7('0x6')](_0x497698+':'+_0xd3671f['id'],_0xd3671f);ChatGroupEvents[_0x90b7('0x6')](_0x497698,_0xd3671f);_0xd50b1b(null);};}for(var e in events){if(events[_0x90b7('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x90b7('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xfba2=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1c5896,_0x34e0b1){var _0x91aaff=function(_0x2f05bf){while(--_0x2f05bf){_0x1c5896['push'](_0x1c5896['shift']());}};_0x91aaff(++_0x34e0b1);}(_0xfba2,0xf9));var _0x2fba=function(_0x1d751f,_0xcac928){_0x1d751f=_0x1d751f-0x0;var _0x162d5f=_0xfba2[_0x1d751f];return _0x162d5f;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2fba('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2fba('0x1')](0x0);var events={'afterCreate':_0x2fba('0x2'),'afterUpdate':_0x2fba('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2db851){return function(_0x3eef22,_0x233e9c,_0x16c6ed){ChatGroupEvents[_0x2fba('0x4')](_0x2db851+':'+_0x3eef22['id'],_0x3eef22);ChatGroupEvents['emit'](_0x2db851,_0x3eef22);_0x16c6ed(null);};}for(var e in events){if(events[_0x2fba('0x5')](e)){var event=events[e];ChatGroup[_0x2fba('0x6')](e,emitEvent(event));}}module[_0x2fba('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index d03dd2c..1fae7cb 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 _0x7855=['request-promise','path','./chatGroup.attributes','define','ChatGroup','util','../../config/logger','api','moment','bluebird'];(function(_0xc7f728,_0x4d812f){var _0x3a6dc5=function(_0x8615cd){while(--_0x8615cd){_0xc7f728['push'](_0xc7f728['shift']());}};_0x3a6dc5(++_0x4d812f);}(_0x7855,0x1c7));var _0x5785=function(_0x453c99,_0x4a0d59){_0x453c99=_0x453c99-0x0;var _0x3dc60b=_0x7855[_0x453c99];return _0x3dc60b;};'use strict';var _=require('lodash');var util=require(_0x5785('0x0'));var logger=require(_0x5785('0x1'))(_0x5785('0x2'));var moment=require(_0x5785('0x3'));var BPromise=require(_0x5785('0x4'));var rp=require(_0x5785('0x5'));var fs=require('fs');var path=require(_0x5785('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5785('0x7'));module['exports']=function(_0x483743,_0x2df770){return _0x483743[_0x5785('0x8')](_0x5785('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa2b=['moment','bluebird','request-promise','path','rimraf','exports','ChatGroup','lodash','util','../../config/logger','api'];(function(_0x165ec6,_0x2d6664){var _0x3c475a=function(_0x4ebfdd){while(--_0x4ebfdd){_0x165ec6['push'](_0x165ec6['shift']());}};_0x3c475a(++_0x2d6664);}(_0xfa2b,0x1ca));var _0xbfa2=function(_0x3b0bb4,_0x32a3ac){_0x3b0bb4=_0x3b0bb4-0x0;var _0x57e927=_0xfa2b[_0x3b0bb4];return _0x57e927;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var logger=require(_0xbfa2('0x2'))(_0xbfa2('0x3'));var moment=require(_0xbfa2('0x4'));var BPromise=require(_0xbfa2('0x5'));var rp=require(_0xbfa2('0x6'));var fs=require('fs');var path=require(_0xbfa2('0x7'));var rimraf=require(_0xbfa2('0x8'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xbfa2('0x9')]=function(_0x2fdd37,_0x39f154){return _0x2fdd37['define'](_0xbfa2('0xa'),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 2da4c14..3447f31 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 _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x20ce,0x10d));var _0xe20c=function(_0x45fa95,_0x308dd6){_0x45fa95=_0x45fa95-0x0;var _0x414317=_0x20ce[_0x45fa95];return _0x414317;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});config[_0xe20c('0xd')]=_[_0xe20c('0xe')](config[_0xe20c('0xd')],{'host':_0xe20c('0xf'),'port':0x18eb});var socket=require(_0xe20c('0x10'))(new Redis(config[_0xe20c('0xd')]));require(_0xe20c('0x11'))[_0xe20c('0x12')](socket);function respondWithRpcPromise(_0x41379b,_0x16aaaa,_0xb46255){return new BPromise(function(_0x17ecc8,_0x4517d7){return client[_0xe20c('0x13')](_0x41379b,_0xb46255)['then'](function(_0x201b08){logger[_0xe20c('0x14')](_0xe20c('0x15'),_0x16aaaa,_0xe20c('0x16'));logger[_0xe20c('0x17')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x16aaaa,_0xe20c('0x16'),JSON[_0xe20c('0x18')](_0x201b08));if(_0x201b08['error']){if(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1a')]===0x1f4){logger[_0xe20c('0x19')]('ChatGroup,\x20%s,\x20%s',_0x16aaaa,_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);return _0x4517d7(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);}logger['error'](_0xe20c('0x15'),_0x16aaaa,_0x201b08['error'][_0xe20c('0x1b')]);return _0x17ecc8(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);}else{logger[_0xe20c('0x14')](_0xe20c('0x15'),_0x16aaaa,_0xe20c('0x16'));_0x17ecc8(_0x201b08[_0xe20c('0x1c')][_0xe20c('0x1b')]);}})[_0xe20c('0x1d')](function(_0x3768b0){logger['error'](_0xe20c('0x15'),_0x16aaaa,_0x3768b0);_0x4517d7(_0x3768b0);});});}
\ No newline at end of file
+var _0x3204=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xc844cd,_0x1d55f8){var _0xb85fc7=function(_0xb0b367){while(--_0xb0b367){_0xc844cd['push'](_0xc844cd['shift']());}};_0xb85fc7(++_0x1d55f8);}(_0x3204,0x12e));var _0x4320=function(_0x43a8ff,_0x28ee24){_0x43a8ff=_0x43a8ff-0x0;var _0x44558b=_0x3204[_0x43a8ff];return _0x44558b;};'use strict';var _=require(_0x4320('0x0'));var util=require(_0x4320('0x1'));var moment=require(_0x4320('0x2'));var BPromise=require(_0x4320('0x3'));var rs=require(_0x4320('0x4'));var fs=require('fs');var Redis=require(_0x4320('0x5'));var db=require(_0x4320('0x6'))['db'];var utils=require(_0x4320('0x7'));var logger=require(_0x4320('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4320('0x9'));var client=jayson[_0x4320('0xa')][_0x4320('0xb')]({'port':0x232a});config[_0x4320('0xc')]=_[_0x4320('0xd')](config[_0x4320('0xc')],{'host':_0x4320('0xe'),'port':0x18eb});var socket=require(_0x4320('0xf'))(new Redis(config[_0x4320('0xc')]));require('./chatGroup.socket')[_0x4320('0x10')](socket);function respondWithRpcPromise(_0x2b8f99,_0x33a378,_0x245419){return new BPromise(function(_0x5142c8,_0x3cc8cd){return client[_0x4320('0x11')](_0x2b8f99,_0x245419)['then'](function(_0x505b60){logger['info'](_0x4320('0x12'),_0x33a378,_0x4320('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x33a378,_0x4320('0x13'),JSON[_0x4320('0x14')](_0x505b60));if(_0x505b60[_0x4320('0x15')]){if(_0x505b60[_0x4320('0x15')][_0x4320('0x16')]===0x1f4){logger[_0x4320('0x15')]('ChatGroup,\x20%s,\x20%s',_0x33a378,_0x505b60['error'][_0x4320('0x17')]);return _0x3cc8cd(_0x505b60[_0x4320('0x15')][_0x4320('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x33a378,_0x505b60['error'][_0x4320('0x17')]);return _0x5142c8(_0x505b60[_0x4320('0x15')][_0x4320('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x33a378,_0x4320('0x13'));_0x5142c8(_0x505b60[_0x4320('0x18')][_0x4320('0x17')]);}})['catch'](function(_0x436e6d){logger['error'](_0x4320('0x12'),_0x33a378,_0x436e6d);_0x3cc8cd(_0x436e6d);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index ac5f9c4..b9fdd2d 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 _0x37c6=['chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x1c47e4,_0x86ec7a){var _0x16e15a=function(_0x4663cb){while(--_0x4663cb){_0x1c47e4['push'](_0x1c47e4['shift']());}};_0x16e15a(++_0x86ec7a);}(_0x37c6,0x109));var _0x637c=function(_0x139994,_0x57f3bb){_0x139994=_0x139994-0x0;var _0x40898b=_0x37c6[_0x139994];return _0x40898b;};'use strict';var ChatGroupEvents=require(_0x637c('0x0'));var events=[_0x637c('0x1'),_0x637c('0x2'),_0x637c('0x3')];function createListener(_0x3500ef,_0x52dfde){return function(_0x227182){_0x52dfde[_0x637c('0x4')](_0x3500ef,_0x227182);};}function removeListener(_0x3fd066,_0x319e60){return function(){ChatGroupEvents[_0x637c('0x5')](_0x3fd066,_0x319e60);};}exports[_0x637c('0x6')]=function(_0x3486a5){for(var _0x5f546a=0x0,_0xf638c9=events['length'];_0x5f546a<_0xf638c9;_0x5f546a++){var _0x5d718c=events[_0x5f546a];var _0x4dde1f=createListener(_0x637c('0x7')+_0x5d718c,_0x3486a5);ChatGroupEvents['on'](_0x5d718c,_0x4dde1f);}};
\ No newline at end of file
+var _0x156d=['./chatGroup.events','save','remove','update','register','length','chatGroup:'];(function(_0xd3b64b,_0x189e4a){var _0x4d24ab=function(_0x9efedf){while(--_0x9efedf){_0xd3b64b['push'](_0xd3b64b['shift']());}};_0x4d24ab(++_0x189e4a);}(_0x156d,0x1c0));var _0xd156=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x156d[_0x4b369d];return _0x571a98;};'use strict';var ChatGroupEvents=require(_0xd156('0x0'));var events=[_0xd156('0x1'),_0xd156('0x2'),_0xd156('0x3')];function createListener(_0xec20ea,_0x256dd3){return function(_0x4b7a40){_0x256dd3['emit'](_0xec20ea,_0x4b7a40);};}function removeListener(_0xeed629,_0x3280a8){return function(){ChatGroupEvents['removeListener'](_0xeed629,_0x3280a8);};}exports[_0xd156('0x4')]=function(_0x5ce1d6){for(var _0x157a77=0x0,_0x258561=events[_0xd156('0x5')];_0x157a77<_0x258561;_0x157a77++){var _0x23ed99=events[_0x157a77];var _0x44cc2b=createListener(_0xd156('0x6')+_0x23ed99,_0x5ce1d6);ChatGroupEvents['on'](_0x23ed99,_0x44cc2b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 55d50d7..1072bb8 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 _0xac4d=['get','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','destroy','removeMembers','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','index','/describe','isAuthenticated'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xac4d,0x104));var _0xdac4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xac4d[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xdac4('0x0'));var util=require('util');var path=require(_0xdac4('0x1'));var timeout=require('connect-timeout');var express=require(_0xdac4('0x2'));var router=express['Router']();var fs_extra=require(_0xdac4('0x3'));var auth=require(_0xdac4('0x4'));var interaction=require(_0xdac4('0x5'));var config=require('../../config/environment');var controller=require(_0xdac4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xdac4('0x7')]);router['get'](_0xdac4('0x8'),auth[_0xdac4('0x9')](),controller['describe']);router[_0xdac4('0xa')](_0xdac4('0xb'),auth[_0xdac4('0x9')](),controller[_0xdac4('0xc')]);router['get'](_0xdac4('0xd'),auth['isAuthenticated'](),controller['getUnread']);router[_0xdac4('0xa')](_0xdac4('0xe'),auth[_0xdac4('0x9')](),controller[_0xdac4('0xf')]);router['get'](_0xdac4('0x10'),auth['isAuthenticated'](),controller[_0xdac4('0x11')]);router['post']('/',auth[_0xdac4('0x9')](),controller[_0xdac4('0x12')]);router[_0xdac4('0x13')]('/:id/members',auth[_0xdac4('0x9')](),controller[_0xdac4('0x14')]);router[_0xdac4('0x13')](_0xdac4('0x10'),auth[_0xdac4('0x9')](),controller['addMessage']);router[_0xdac4('0x15')](_0xdac4('0xb'),auth[_0xdac4('0x9')](),controller[_0xdac4('0x16')]);router[_0xdac4('0x17')]('/:id',auth[_0xdac4('0x9')](),controller[_0xdac4('0x18')]);router[_0xdac4('0x17')]('/:id/members',auth[_0xdac4('0x9')](),controller[_0xdac4('0x19')]);module[_0xdac4('0x1a')]=router;
\ No newline at end of file
+var _0x47f7=['./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','post','create','addMembers','put','update','delete','removeMembers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2efd54,_0x241172){var _0x3f923e=function(_0x3cfd1d){while(--_0x3cfd1d){_0x2efd54['push'](_0x2efd54['shift']());}};_0x3f923e(++_0x241172);}(_0x47f7,0x17f));var _0x747f=function(_0x36ac6b,_0x5eba33){_0x36ac6b=_0x36ac6b-0x0;var _0x3068db=_0x47f7[_0x36ac6b];return _0x3068db;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x747f('0x0'));var timeout=require(_0x747f('0x1'));var express=require(_0x747f('0x2'));var router=express[_0x747f('0x3')]();var fs_extra=require(_0x747f('0x4'));var auth=require(_0x747f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x747f('0x6'));var controller=require(_0x747f('0x7'));router[_0x747f('0x8')]('/',auth[_0x747f('0x9')](),controller['index']);router[_0x747f('0x8')](_0x747f('0xa'),auth[_0x747f('0x9')](),controller[_0x747f('0xb')]);router[_0x747f('0x8')](_0x747f('0xc'),auth[_0x747f('0x9')](),controller[_0x747f('0xd')]);router[_0x747f('0x8')](_0x747f('0xe'),auth[_0x747f('0x9')](),controller[_0x747f('0xf')]);router[_0x747f('0x8')](_0x747f('0x10'),auth[_0x747f('0x9')](),controller['getMembers']);router[_0x747f('0x8')](_0x747f('0x11'),auth[_0x747f('0x9')](),controller['getMessages']);router[_0x747f('0x12')]('/',auth[_0x747f('0x9')](),controller[_0x747f('0x13')]);router[_0x747f('0x12')](_0x747f('0x10'),auth[_0x747f('0x9')](),controller[_0x747f('0x14')]);router[_0x747f('0x12')](_0x747f('0x11'),auth[_0x747f('0x9')](),controller['addMessage']);router[_0x747f('0x15')](_0x747f('0xc'),auth['isAuthenticated'](),controller[_0x747f('0x16')]);router[_0x747f('0x17')](_0x747f('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/members',auth[_0x747f('0x9')](),controller[_0x747f('0x18')]);module[_0x747f('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index b36a988..2001151 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 _0x421c=['TEXT','STRING','DATE','long','out','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x1f62c2,_0x3977a6){var _0x302a55=function(_0x53ab47){while(--_0x53ab47){_0x1f62c2['push'](_0x1f62c2['shift']());}};_0x302a55(++_0x3977a6);}(_0x421c,0x1bd));var _0xc421=function(_0x2e6428,_0x37e95e){_0x2e6428=_0x2e6428-0x0;var _0x1e0ee7=_0x421c[_0x2e6428];return _0x1e0ee7;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xc421('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc421('0x1')]},'ratingType':{'type':Sequelize[_0xc421('0x2')](_0xc421('0x3'),_0xc421('0x4')),'defaultValue':_0xc421('0x3')},'ratingMessage':{'type':Sequelize[_0xc421('0x5')]},'pathTranscript':{'type':Sequelize[_0xc421('0x5')]},'mailTranscript':{'type':Sequelize[_0xc421('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc421('0x7')]},'disposition':{'type':Sequelize[_0xc421('0x6')]},'secondDisposition':{'type':Sequelize[_0xc421('0x6')]},'thirdDisposition':{'type':Sequelize[_0xc421('0x6')]},'note':{'type':Sequelize[_0xc421('0x6')]},'browserName':{'type':Sequelize[_0xc421('0x6')]},'browserVersion':{'type':Sequelize[_0xc421('0x6')]},'osName':{'type':Sequelize[_0xc421('0x6')]},'osVersion':{'type':Sequelize[_0xc421('0x6')]},'deviceModel':{'type':Sequelize[_0xc421('0x6')]},'deviceVendor':{'type':Sequelize[_0xc421('0x6')]},'deviceType':{'type':Sequelize[_0xc421('0x6')]},'referer':{'type':Sequelize[_0xc421('0x5')]},'customerIp':{'type':Sequelize[_0xc421('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xc421('0x8'))},'read1stAt':{'type':Sequelize[_0xc421('0x7')]},'lastMsgAt':{'type':Sequelize[_0xc421('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc421('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc421('0x6')]},'customerPort':{'type':Sequelize[_0xc421('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc421('0x1')]}};
\ No newline at end of file
+var _0x0ed1=['out','BOOLEAN','INTEGER','exports','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x0ed1,0x99));var _0x10ed=function(_0x29854a,_0x4d43bb){_0x29854a=_0x29854a-0x0;var _0x357e4b=_0x0ed1[_0x29854a];return _0x357e4b;};'use strict';var Sequelize=require('sequelize');module[_0x10ed('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x10ed('0x1')](_0x10ed('0x2'),'thumb'),'defaultValue':_0x10ed('0x2')},'ratingMessage':{'type':Sequelize[_0x10ed('0x3')]},'pathTranscript':{'type':Sequelize[_0x10ed('0x3')]},'mailTranscript':{'type':Sequelize[_0x10ed('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x10ed('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x10ed('0x4')]},'thirdDisposition':{'type':Sequelize[_0x10ed('0x4')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x10ed('0x4')]},'browserVersion':{'type':Sequelize[_0x10ed('0x4')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x10ed('0x4')]},'deviceModel':{'type':Sequelize[_0x10ed('0x4')]},'deviceVendor':{'type':Sequelize[_0x10ed('0x4')]},'deviceType':{'type':Sequelize[_0x10ed('0x4')]},'referer':{'type':Sequelize[_0x10ed('0x3')]},'customerIp':{'type':Sequelize[_0x10ed('0x4')]},'formData':{'type':Sequelize[_0x10ed('0x3')](_0x10ed('0x6'))},'read1stAt':{'type':Sequelize[_0x10ed('0x5')]},'lastMsgAt':{'type':Sequelize[_0x10ed('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x10ed('0x1')]('in',_0x10ed('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x10ed('0x4')]},'customerPort':{'type':Sequelize[_0x10ed('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x10ed('0x8')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x10ed('0x9')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4c8dc71..72f6346 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 _0x3d7e=['entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','attachmentUpload','originalname','basename','filename','file','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','now','Messages','User','%s%d','agentAlias','System','Visitor','ContactId','website_alias','agent_alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','intersection','hasOwnProperty','sort','where','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','order','includeAgent','alias','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','push','firstName','lastName','Attachment','Account','Owner','get','mkdirSync','Chat','closedAt','toString','disposition','browserName','referer','customerPort','N.A.','tail','createReadStream','pipe','createWriteStream','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','zip-dir','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus','name','merge','body','contact','agent','interaction','account','index','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','user','show','params','keys','query','filters','model','attributes','fields','length','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4b4b4e,_0x341f0c){var _0xf1a943=function(_0x36fb59){while(--_0x36fb59){_0x4b4b4e['push'](_0x4b4b4e['shift']());}};_0xf1a943(++_0x341f0c);}(_0x3d7e,0x133));var _0xe3d7=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x3d7e[_0x3df223];return _0x562d11;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xe3d7('0x0'));var rp=require('request-promise');var moment=require(_0xe3d7('0x1'));var BPromise=require(_0xe3d7('0x2'));var Mustache=require(_0xe3d7('0x3'));var util=require('util');var path=require(_0xe3d7('0x4'));var ejs=require(_0xe3d7('0x5'));var fs=require('fs');var _=require(_0xe3d7('0x6'));var Redis=require(_0xe3d7('0x7'));var interaction=require(_0xe3d7('0x8'));var qs=require(_0xe3d7('0x9'));var pdf=require(_0xe3d7('0xa'));var logger=require(_0xe3d7('0xb'))(_0xe3d7('0xc'));var config=require(_0xe3d7('0xd'));var db=require(_0xe3d7('0xe'))['db'];config['redis']=_[_0xe3d7('0xf')](config['redis'],{'host':_0xe3d7('0x10'),'port':0x18eb});var socket=require(_0xe3d7('0x11'))(new Redis(config[_0xe3d7('0x12')]));require(_0xe3d7('0x13'))[_0xe3d7('0x14')](socket);var jayson=require(_0xe3d7('0x15'));var client=jayson[_0xe3d7('0x16')][_0xe3d7('0x17')]({'port':0x232b});var client9004=jayson[_0xe3d7('0x16')][_0xe3d7('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x8217e0,_0x2e5042,_0x5efa13,_0x4941fc){return new BPromise(function(_0x518fe3,_0x2a18ef){var _0x367588=_0x4941fc||client;return _0x367588[_0xe3d7('0x18')](_0x8217e0,_0x5efa13)[_0xe3d7('0x19')](function(_0x5c5db4){logger[_0xe3d7('0x1a')](_0xe3d7('0x1b'),_0x2e5042,'request\x20sent');logger['debug'](_0xe3d7('0x1c'),_0x2e5042,_0xe3d7('0x1d'),JSON[_0xe3d7('0x1e')](_0x5c5db4));if(_0x5c5db4['error']){if(_0x5c5db4[_0xe3d7('0x1f')][_0xe3d7('0x20')]===0x1f4){logger[_0xe3d7('0x1f')](_0xe3d7('0x1b'),_0x2e5042,_0x5c5db4['error'][_0xe3d7('0x21')]);return _0x2a18ef(_0x5c5db4[_0xe3d7('0x1f')][_0xe3d7('0x21')]);}logger[_0xe3d7('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x2e5042,_0x5c5db4['error'][_0xe3d7('0x21')]);return _0x518fe3(_0x5c5db4[_0xe3d7('0x1f')][_0xe3d7('0x21')]);}else{logger[_0xe3d7('0x1a')](_0xe3d7('0x1b'),_0x2e5042,_0xe3d7('0x1d'));_0x518fe3(_0x5c5db4[_0xe3d7('0x22')][_0xe3d7('0x21')]);}})[_0xe3d7('0x23')](function(_0x43ae31){logger[_0xe3d7('0x1f')](_0xe3d7('0x1b'),_0x2e5042,_0x43ae31);_0x2a18ef(_0x43ae31);});});}function respondWithStatusCode(_0x55d2ec,_0x1a0adb){_0x1a0adb=_0x1a0adb||0xcc;return function(_0x2589ec){if(_0x2589ec){return _0x55d2ec['sendStatus'](_0x1a0adb);}return _0x55d2ec[_0xe3d7('0x24')](_0x1a0adb)[_0xe3d7('0x25')]();};}function respondWithResult(_0x3d8755,_0x1a5513){_0x1a5513=_0x1a5513||0xc8;return function(_0x1a7a29){if(_0x1a7a29){return _0x3d8755[_0xe3d7('0x24')](_0x1a5513)[_0xe3d7('0x26')](_0x1a7a29);}};}function respondWithFilteredResult(_0x2aa9d8,_0x183e90){return function(_0x21bfcb){if(_0x21bfcb){var _0x20328a=typeof _0x183e90[_0xe3d7('0x27')]===_0xe3d7('0x28')&&typeof _0x183e90[_0xe3d7('0x29')]===_0xe3d7('0x28');var _0x159d05=_0x21bfcb[_0xe3d7('0x2a')];var _0x2df044=_0x20328a?0x0:_0x183e90[_0xe3d7('0x27')];var _0x2c0e5d=_0x20328a?_0x21bfcb['count']:_0x183e90[_0xe3d7('0x27')]+_0x183e90[_0xe3d7('0x29')];var _0x316ee3;if(_0x2c0e5d>=_0x159d05){_0x2c0e5d=_0x159d05;_0x316ee3=0xc8;}else{_0x316ee3=0xce;}_0x2aa9d8['status'](_0x316ee3);return _0x2aa9d8[_0xe3d7('0x2b')](_0xe3d7('0x2c'),_0x2df044+'-'+_0x2c0e5d+'/'+_0x159d05)[_0xe3d7('0x26')](_0x21bfcb);}return null;};}function saveUpdates(_0x5f30c2){return function(_0x165a29){if(_0x165a29){return _0x165a29[_0xe3d7('0x2d')](_0x5f30c2)[_0xe3d7('0x19')](function(_0x246421){return _0x246421;});}return null;};}function removeEntity(_0x545862){return function(_0x444236){if(_0x444236){return _0x444236[_0xe3d7('0x2e')]()[_0xe3d7('0x19')](function(){_0x545862[_0xe3d7('0x24')](0xcc)[_0xe3d7('0x25')]();});}};}function handleEntityNotFound(_0x4fa5f2){return function(_0x2bf64e){if(!_0x2bf64e){_0x4fa5f2[_0xe3d7('0x2f')](0x194);}return _0x2bf64e;};}function handleError(_0xcc39e9,_0x46fcf9){_0x46fcf9=_0x46fcf9||0x1f4;return function(_0x42fd61){logger['error'](_0x42fd61['stack']);if(_0x42fd61[_0xe3d7('0x30')]){delete _0x42fd61[_0xe3d7('0x30')];}_0xcc39e9[_0xe3d7('0x24')](_0x46fcf9)['send'](_0x42fd61);};}function getMustacheRender(_0xa93ba3,_0x2644f8){return Mustache['render'](_0xa93ba3,_[_0xe3d7('0x31')](_0x2644f8[_0xe3d7('0x32')],{'contact':_0x2644f8[_0xe3d7('0x33')],'message':_0x2644f8[_0xe3d7('0x21')],'agent':_0x2644f8[_0xe3d7('0x34')],'interaction':_0x2644f8[_0xe3d7('0x35')],'account':_0x2644f8[_0xe3d7('0x36')]}))||'';}exports[_0xe3d7('0x37')]=function(_0x464c01,_0x1ad0f3){var _0x3f8c46={};var _0x142be5=_['map'](db[_0xe3d7('0x38')][_0xe3d7('0x39')],function(_0x48862e){return{'name':_0x48862e['fieldName'],'type':_0x48862e[_0xe3d7('0x3a')]['key']};});_0x3f8c46=qs[_0xe3d7('0x3b')](_0x142be5,_0x464c01);return interaction[_0xe3d7('0x3c')](_0xe3d7('0x3d'),_0x464c01['query'],_0x464c01[_0xe3d7('0x3e')],_0x3f8c46,_0x142be5)[_0xe3d7('0x19')](respondWithFilteredResult(_0x1ad0f3,_0x3f8c46))[_0xe3d7('0x23')](handleError(_0x1ad0f3,null));};exports[_0xe3d7('0x3f')]=function(_0x55a53c,_0x2d3468){var _0x39b9f4={'raw':![],'where':{'id':_0x55a53c[_0xe3d7('0x40')]['id']}},_0x57a2ea={};_0x57a2ea['model']=_[_0xe3d7('0x41')](db[_0xe3d7('0x38')][_0xe3d7('0x39')]);_0x57a2ea[_0xe3d7('0x42')]=_[_0xe3d7('0x41')](_0x55a53c[_0xe3d7('0x42')]);_0x57a2ea[_0xe3d7('0x43')]=_['intersection'](_0x57a2ea[_0xe3d7('0x44')],_0x57a2ea['query']);_0x39b9f4[_0xe3d7('0x45')]=_['intersection'](_0x57a2ea[_0xe3d7('0x44')],qs['fields'](_0x55a53c[_0xe3d7('0x42')][_0xe3d7('0x46')]));_0x39b9f4[_0xe3d7('0x45')]=_0x39b9f4[_0xe3d7('0x45')][_0xe3d7('0x47')]?_0x39b9f4[_0xe3d7('0x45')]:_0x57a2ea[_0xe3d7('0x44')];if(_0x55a53c['query'][_0xe3d7('0x48')]){_0x39b9f4[_0xe3d7('0x49')]=[{'all':!![]}];}_0x39b9f4=_['merge']({},_0x39b9f4,_0x55a53c[_0xe3d7('0x4a')]);return db[_0xe3d7('0x38')][_0xe3d7('0x4b')](_0x39b9f4)[_0xe3d7('0x19')](handleEntityNotFound(_0x2d3468,null))['then'](respondWithResult(_0x2d3468,null))[_0xe3d7('0x23')](handleError(_0x2d3468,null));};exports[_0xe3d7('0x4c')]=function(_0x21e94f,_0x10b7fa){return db[_0xe3d7('0x38')]['create'](_0x21e94f[_0xe3d7('0x32')],{})[_0xe3d7('0x19')](respondWithResult(_0x10b7fa,0xc9))['catch'](handleError(_0x10b7fa,null));};exports[_0xe3d7('0x2d')]=function(_0x21e00c,_0x32deff){if(_0x21e00c[_0xe3d7('0x32')]['id']){delete _0x21e00c[_0xe3d7('0x32')]['id'];}return db[_0xe3d7('0x38')]['find']({'where':{'id':_0x21e00c[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x32deff,null))[_0xe3d7('0x19')](saveUpdates(_0x21e00c[_0xe3d7('0x32')],null))['then'](respondWithResult(_0x32deff,null))[_0xe3d7('0x23')](handleError(_0x32deff,null));};exports[_0xe3d7('0x2e')]=function(_0x49b2be,_0x32f7db){return db['ChatInteraction'][_0xe3d7('0x4b')]({'where':{'id':_0x49b2be[_0xe3d7('0x40')]['id']}})['then'](handleEntityNotFound(_0x32f7db,null))[_0xe3d7('0x19')](removeEntity(_0x32f7db,null))[_0xe3d7('0x23')](handleError(_0x32f7db,null));};exports[_0xe3d7('0x4d')]=function(_0x3036ff,_0x5befd9){return db[_0xe3d7('0x38')]['describe']()['then'](respondWithResult(_0x5befd9,null))[_0xe3d7('0x23')](handleError(_0x5befd9,null));};exports[_0xe3d7('0x4e')]=function(_0x5d4644,_0x397d13){var _0x3ef358=_0x5d4644[_0xe3d7('0x40')]['id'];var _0x17fe58;var _0x3ed197;var _0x2055c2;return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x3ef358}})[_0xe3d7('0x19')](function(_0x687293){_0x17fe58=_0x687293;return db['ChatWebsite'][_0xe3d7('0x4f')]({'where':{'id':_0x687293[_0xe3d7('0x50')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe3d7('0x51'),_0xe3d7('0x52'),_0xe3d7('0x53')],'raw':!![]});})['then'](function(_0x2c354b){if(_0x2c354b&&_0x2c354b[_0xe3d7('0x54')]&&_0x2c354b['vidaooEscalation']){_0x3ed197=_0x2c354b;var _0x1ad71f={'interaction':{'id':_0x3ef358},'agent':{'id':_0x5d4644[_0xe3d7('0x3e')]['id'],'name':_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x30')],'fullname':_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x55')],'email':_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x56')]},'contact':_0x5d4644['body'][_0xe3d7('0x33')],'account':_0x5d4644[_0xe3d7('0x32')][_0xe3d7('0x36')]};var _0x57d18f={'rejectUnauthorized':![],'method':'POST','url':_0xe3d7('0x57'),'headers':{'X-APIKEY':_0x2c354b['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5d4644[_0xe3d7('0x3e')][_0xe3d7('0x56')]],'buttons':null,'topic':_0x3ed197['vidaooTopic'],'note':_['isNull'](_0x3ed197[_0xe3d7('0x52')])?null:getMustacheRender(_0x3ed197[_0xe3d7('0x52')],_0x1ad71f),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe3d7('0x58')](_0x3ed197['vidaooMetadata'])){var _0x4b9300=getMustacheRender(_0x3ed197[_0xe3d7('0x53')],_0x1ad71f);var _0x113998=JSON[_0xe3d7('0x59')](_0x4b9300);_0x57d18f[_0xe3d7('0x32')][_0xe3d7('0x5a')]=_0x113998;}}catch(_0x214f82){throw new db['Sequelize']['ValidationError'](_0xe3d7('0x5b'));}return rp(_0x57d18f);}else{throw new db[(_0xe3d7('0x5c'))][(_0xe3d7('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe3d7('0x19')](function(_0x297581){_0x2055c2=_0x297581;if(_0x2055c2['id']){var _0x25d5fb={'body':_0x2055c2['join_url'],'ChatWebsiteId':_0x3ed197['id'],'ChatInteractionId':_0x17fe58['id'],'direction':_0xe3d7('0x5e'),'UserId':_0x5d4644['user']['id']};return db[_0xe3d7('0x5f')]['create'](_0x25d5fb,{});}else{throw new db[(_0xe3d7('0x5c'))]['ValidationError'](_0xe3d7('0x60'));}})[_0xe3d7('0x19')](function(){return _0x17fe58[_0xe3d7('0x61')]({'vidaooSessionId':_0x2055c2['id']});})[_0xe3d7('0x19')](respondWithResult(_0x397d13,null))[_0xe3d7('0x23')](handleError(_0x397d13,null));};exports[_0xe3d7('0x62')]=function(_0xa76c6e,_0x3f5749){if(_0xa76c6e[_0xe3d7('0x32')]['id']){delete _0xa76c6e[_0xe3d7('0x32')]['id'];}return db[_0xe3d7('0x38')][_0xe3d7('0x4b')]({'where':{'id':_0xa76c6e[_0xe3d7('0x40')]['id']},'include':[{'model':db[_0xe3d7('0x63')],'as':_0xe3d7('0x64')}]})[_0xe3d7('0x19')](handleEntityNotFound(_0x3f5749,null))['then'](saveUpdates(_0xa76c6e[_0xe3d7('0x32')],null))['then'](respondWithResult(_0x3f5749,null))[_0xe3d7('0x23')](handleError(_0x3f5749,null));};exports[_0xe3d7('0x65')]=function(_0xa59867,_0x1ddac0){if(_0xa59867[_0xe3d7('0x32')]['id']){delete _0xa59867[_0xe3d7('0x32')]['id'];}return db[_0xe3d7('0x38')]['find']({'where':{'id':_0xa59867[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](function(_0x4c291e){if(!_0x4c291e){logger['error'](_0xe3d7('0x66'),_0xe3d7('0x65'),0x194,_0xe3d7('0x67'));_0x1ddac0[_0xe3d7('0x2f')](0x194);}else{if(_0x4c291e[_0xe3d7('0x68')]){throw new db[(_0xe3d7('0x5c'))][(_0xe3d7('0x5d'))](_0xe3d7('0x69'));}}return _0x4c291e;})[_0xe3d7('0x19')](function(_0x3022ed){if(_0x3022ed){return _0x3022ed['update']({'closed':_0xa59867['body'][_0xe3d7('0x6a')],'disposition':_0xa59867[_0xe3d7('0x32')]['disposition']})['then'](function(_0x37b4c0){return _0x37b4c0;});}})[_0xe3d7('0x19')](function(){return respondWithRpcPromise('AbandonInteraction',_0xe3d7('0x65'),_0xa59867[_0xe3d7('0x32')],client9004);})[_0xe3d7('0x19')](respondWithResult(_0x1ddac0,null))[_0xe3d7('0x23')](handleError(_0x1ddac0,null));};exports[_0xe3d7('0x6b')]=function(_0x1cfc67,_0x46d178){_0x1cfc67[_0xe3d7('0x32')]['name']=_0x1cfc67['file'][_0xe3d7('0x6c')];_0x1cfc67[_0xe3d7('0x32')][_0xe3d7('0x6d')]=_0x1cfc67['file'][_0xe3d7('0x6e')];_0x1cfc67[_0xe3d7('0x32')]['type']=_0x1cfc67[_0xe3d7('0x6f')][_0xe3d7('0x70')];return db['Attachment'][_0xe3d7('0x4c')](_0x1cfc67[_0xe3d7('0x32')])['then'](respondWithResult(_0x46d178,0xc9))[_0xe3d7('0x23')](handleError(_0x46d178,null));};exports[_0xe3d7('0x71')]=function(_0x54826d,_0x31578f){return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x54826d[_0xe3d7('0x40')]['id']},'raw':!![]})[_0xe3d7('0x19')](handleEntityNotFound(_0x31578f,null))['then'](function(_0x58faa5){if(_0x58faa5){if(_0x58faa5[_0xe3d7('0x6a')]){return _0x31578f['status'](0x193)[_0xe3d7('0x26')]({'status':0x193,'message':_0xe3d7('0x72')});}return db['Attachment'][_0xe3d7('0x4f')]({'where':{'id':_0x54826d[_0xe3d7('0x42')][_0xe3d7('0x73')]},'raw':!![]})[_0xe3d7('0x19')](handleEntityNotFound(_0x31578f,null));}})[_0xe3d7('0x19')](function(_0x23e9a3){if(_0x23e9a3){var _0x4220ba=_0x23e9a3[_0xe3d7('0x74')]!==null;var _0x1d1ab9=path['join'](config[_0xe3d7('0x75')],_0xe3d7('0x76'));if(_0x4220ba){_0x1d1ab9=path[_0xe3d7('0x77')](_0x1d1ab9,_0xe3d7('0x78'));}var _0x1b6c53=path[_0xe3d7('0x77')](_0x1d1ab9,_0x23e9a3[_0xe3d7('0x6d')]);return _0x31578f[_0xe3d7('0x79')](_0x1b6c53);}})[_0xe3d7('0x23')](handleError(_0x31578f,null));};exports[_0xe3d7('0x7a')]=function(_0x12582e,_0x28b098){var _0x2ada23=null;var _0x292d2f=null;var _0x19af44=null;if(_0x12582e['body']['id']){delete _0x12582e[_0xe3d7('0x32')]['id'];}if(_0x12582e[_0xe3d7('0x32')][_0xe3d7('0x7b')]){_0x19af44=path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0x7c'),util[_0xe3d7('0x7d')]('transcript-%s.txt',Date[_0xe3d7('0x7e')]()));_0x12582e[_0xe3d7('0x32')]['pathTranscript']=_0x19af44;}return db[_0xe3d7('0x38')]['find']({'where':{'id':_0x12582e[_0xe3d7('0x40')]['id']},'include':[{'model':db[_0xe3d7('0x5f')],'as':_0xe3d7('0x7f'),'include':[{'model':db[_0xe3d7('0x80')],'as':'User'}]}]})[_0xe3d7('0x19')](handleEntityNotFound(_0x28b098,null))[_0xe3d7('0x19')](saveUpdates(_0x12582e[_0xe3d7('0x32')],null))[_0xe3d7('0x19')](function(_0x188067){if(_0x188067){_0x2ada23=_0x188067;return db['ChatWebsite'][_0xe3d7('0x4b')]({'where':{'id':_0x2ada23['ChatWebsiteId']}});}})[_0xe3d7('0x19')](function(_0x8e9812){if(_0x8e9812){_0x292d2f=_0x8e9812;return db[_0xe3d7('0x63')][_0xe3d7('0x4b')]({'where':{'id':_0x2ada23['ContactId']}});}})[_0xe3d7('0x19')](function(_0x2ee191){if(_0x2ee191){if(_0x19af44){var _0x236da5=null;for(var _0x3cd5b0=0x1;_0x3cd5b0<_0x2ada23[_0xe3d7('0x7f')][_0xe3d7('0x47')];++_0x3cd5b0){_0x236da5=_0x2ada23[_0xe3d7('0x7f')][_0x3cd5b0];var _0x4db57e=_0x236da5['UserId']?util[_0xe3d7('0x7d')](_0xe3d7('0x81'),_0x292d2f[_0xe3d7('0x82')],_0x236da5['UserId']):_0xe3d7('0x83');var _0x5bb26c=_0x12582e[_0xe3d7('0x32')]['customer']||util[_0xe3d7('0x7d')](_0xe3d7('0x81'),_0xe3d7('0x84'),_0x236da5[_0xe3d7('0x85')]);switch(_0x292d2f['agentIdentifier']){case _0xe3d7('0x86'):_0x4db57e=_0x236da5[_0xe3d7('0x68')]?util[_0xe3d7('0x7d')]('%s%d',_0x292d2f[_0xe3d7('0x82')],_0x236da5[_0xe3d7('0x68')]):_0xe3d7('0x83');break;case _0xe3d7('0x87'):_0x4db57e=_0x236da5[_0xe3d7('0x68')]?_0x236da5[_0xe3d7('0x80')]['alias']||_0x236da5[_0xe3d7('0x80')]['fullname']:_0xe3d7('0x83');break;case _0xe3d7('0x88'):_0x4db57e=_0x236da5[_0xe3d7('0x68')]?_0x236da5[_0xe3d7('0x80')][_0xe3d7('0x55')]:_0xe3d7('0x83');break;default:_0x4db57e=_0x236da5[_0xe3d7('0x68')]?util['format']('%s%d',_0x292d2f['agentAlias'],_0x236da5['UserId']):_0xe3d7('0x83');}var _0x57e033=util[_0xe3d7('0x7d')]('[%s]\x20%s:\x20%s\x0a',moment(_0x236da5[_0xe3d7('0x89')])[_0xe3d7('0x7d')](_0xe3d7('0x8a')),_0x236da5[_0xe3d7('0x8b')]==='in'?_0x5bb26c:_0x4db57e,_0x236da5[_0xe3d7('0x32')]);if(!_0x236da5[_0xe3d7('0x8c')]){fs['appendFileSync'](_0x19af44,_0x57e033);}}return db[_0xe3d7('0x8d')][_0xe3d7('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0xe3d7('0x8e')],'as':_0xe3d7('0x8f'),'raw':!![],'include':[{'model':db[_0xe3d7('0x90')],'as':_0xe3d7('0x90'),'raw':!![]}]}]});}}})[_0xe3d7('0x19')](function(_0x1975ff){if(!_0x1975ff||!_0x1975ff[_0xe3d7('0x8f')]||!_0x12582e['body'])return _0x2ada23;var _0x32b15c=_0x1975ff[_0xe3d7('0x91')]();return respondWithRpcPromise(_0xe3d7('0x92'),_0xe3d7('0x93'),{'account':_0x32b15c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1975ff[_0xe3d7('0x30')],_0x1975ff['email']||_0x1975ff['Smtp'][_0xe3d7('0x3e')]),'to':_0x12582e[_0xe3d7('0x32')][_0xe3d7('0x7b')],'subject':_0xe3d7('0x94'),'text':util[_0xe3d7('0x7d')](_0xe3d7('0x95'),_0x12582e['body'][_0xe3d7('0x7b')]),'attachments':[{'path':_0x19af44}]}})[_0xe3d7('0x19')](function(){return _0x2ada23;})[_0xe3d7('0x23')](function(_0x12e2f5){logger[_0xe3d7('0x1f')](_0x12e2f5);});})[_0xe3d7('0x19')](respondWithStatusCode(_0x28b098,0xc8))[_0xe3d7('0x23')](handleError(_0x28b098,null));};exports['addMessage']=function(_0x2f6a65,_0x1d3a0c){return db[_0xe3d7('0x5f')][_0xe3d7('0x4b')]({'where':{'id':_0x2f6a65[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x1d3a0c,null))['then'](function(_0xfbe9e5){if(_0xfbe9e5){return _0xfbe9e5[_0xe3d7('0x96')](_0x2f6a65['body'][_0xe3d7('0x97')],_[_0xe3d7('0x98')](_0x2f6a65['body'],['ids','id'])||{});}})[_0xe3d7('0x19')](respondWithResult(_0x1d3a0c,null))[_0xe3d7('0x23')](handleError(_0x1d3a0c,null));};exports[_0xe3d7('0x99')]=function(_0x1a1711,_0x434abd){var _0x23bead={'raw':![],'where':{}};var _0x4881c8={};var _0x3ed29b={'count':0x0,'rows':[]};return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x1a1711['params']['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x434abd,null))[_0xe3d7('0x19')](function(_0x284d27){if(_0x284d27){_0x4881c8['model']=_['keys'](db[_0xe3d7('0x5f')]['rawAttributes']);_0x4881c8[_0xe3d7('0x42')]=_[_0xe3d7('0x41')](_0x1a1711['query']);_0x4881c8[_0xe3d7('0x43')]=_[_0xe3d7('0x9a')](_0x4881c8[_0xe3d7('0x44')],_0x4881c8[_0xe3d7('0x42')]);_0x23bead[_0xe3d7('0x45')]=_[_0xe3d7('0x9a')](_0x4881c8['model'],qs['fields'](_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x46')]));_0x23bead[_0xe3d7('0x45')]=_0x23bead[_0xe3d7('0x45')][_0xe3d7('0x47')]?_0x23bead['attributes']:_0x4881c8[_0xe3d7('0x44')];if(!_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x9b')]('nolimit')){_0x23bead[_0xe3d7('0x29')]=qs[_0xe3d7('0x29')](_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x29')]);_0x23bead['offset']=qs[_0xe3d7('0x27')](_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x27')]);}_0x23bead['order']=qs[_0xe3d7('0x9c')](_0x1a1711['query'][_0xe3d7('0x9c')]);_0x23bead[_0xe3d7('0x9d')]=qs[_0xe3d7('0x43')](_['pick'](_0x1a1711[_0xe3d7('0x42')],_0x4881c8[_0xe3d7('0x43')]));_0x23bead[_0xe3d7('0x9d')][_0xe3d7('0x9e')]=_0x284d27['id'];if(_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x9f')]){_0x23bead[_0xe3d7('0x9d')]=_[_0xe3d7('0x31')](_0x23bead['where'],{'$or':_['map'](_0x23bead[_0xe3d7('0x45')],function(_0x1eab8d){var _0x192a4b={};_0x192a4b[_0x1eab8d]={'$like':'%'+_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x9f')]+'%'};return _0x192a4b;})});}if(_0x1a1711['query'][_0xe3d7('0xa0')]){var _0x26484b=_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0xa0')]['split'](',');var _0x2a0eed={};_0x2a0eed[_0x26484b[0x0]]={'$gte':moment(_0x26484b[0x1])[_0xe3d7('0x7d')](_0xe3d7('0xa1'))};_0x23bead['where']=_['merge'](_0x23bead['where'],_0x2a0eed);}_0x23bead=_[_0xe3d7('0x31')]({},_0x23bead,_0x1a1711['options']);return db['ChatMessage'][_0xe3d7('0x2a')]({'where':_0x23bead[_0xe3d7('0x9d')]})[_0xe3d7('0x19')](function(_0x3f402c){_0x3ed29b[_0xe3d7('0x2a')]=_0x3f402c;if(_0x1a1711[_0xe3d7('0x42')][_0xe3d7('0x48')]){_0x23bead[_0xe3d7('0x49')]=[{'all':!![]}];}return db[_0xe3d7('0x5f')][_0xe3d7('0x3c')](_0x23bead);})['then'](function(_0x21e252){_0x3ed29b[_0xe3d7('0xa2')]=_0x21e252;return _0x3ed29b;});}})['then'](respondWithFilteredResult(_0x434abd,_0x23bead))[_0xe3d7('0x23')](handleError(_0x434abd,null));};exports[_0xe3d7('0xa3')]=function(_0x404053,_0x242949){var _0x5ae2db={'where':{}},_0x30c228={},_0xe35f4={'count':0x0,'rows':[]};return db[_0xe3d7('0x38')][_0xe3d7('0x4f')]({'where':{'id':_0x404053[_0xe3d7('0x40')]['id']}})[_0xe3d7('0x19')](handleEntityNotFound(_0x242949,null))['then'](function(_0x39ac3d){if(_0x39ac3d){_0x30c228['model']=_['keys'](db[_0xe3d7('0x5f')][_0xe3d7('0x39')]);_0x30c228[_0xe3d7('0x42')]=_[_0xe3d7('0x41')](_0x404053[_0xe3d7('0x42')]);_0x30c228['filters']=_['intersection'](_0x30c228[_0xe3d7('0x44')],_0x30c228[_0xe3d7('0x42')]);_0x5ae2db[_0xe3d7('0x45')]=_[_0xe3d7('0x9a')](_0x30c228[_0xe3d7('0x44')],qs[_0xe3d7('0x46')](_0x404053[_0xe3d7('0x42')][_0xe3d7('0x46')]));_0x5ae2db[_0xe3d7('0x45')]=_0x5ae2db[_0xe3d7('0x45')][_0xe3d7('0x47')]?_0x5ae2db[_0xe3d7('0x45')]:_0x30c228[_0xe3d7('0x44')];if(!_0x404053[_0xe3d7('0x42')][_0xe3d7('0x9b')](_0xe3d7('0xa4'))){_0x5ae2db[_0xe3d7('0x29')]=qs[_0xe3d7('0x29')](_0x404053[_0xe3d7('0x42')][_0xe3d7('0x29')]);_0x5ae2db[_0xe3d7('0x27')]=qs[_0xe3d7('0x27')](_0x404053[_0xe3d7('0x42')]['offset']);}_0x5ae2db[_0xe3d7('0xa5')]=qs[_0xe3d7('0x9c')](_0x404053[_0xe3d7('0x42')]['sort']);_0x5ae2db['where']=qs[_0xe3d7('0x43')](_['pick'](_0x404053[_0xe3d7('0x42')],_0x30c228[_0xe3d7('0x43')]));_0x5ae2db[_0xe3d7('0x9d')][_0xe3d7('0x9e')]=_0x39ac3d['id'];if(_0x404053[_0xe3d7('0x42')]['filter']){_0x5ae2db[_0xe3d7('0x9d')]=_['merge'](_0x5ae2db[_0xe3d7('0x9d')],{'$or':_['map'](_0x5ae2db[_0xe3d7('0x45')],function(_0x2e1d5c){var _0x4e3acd={};_0x4e3acd[_0x2e1d5c]={'$like':'%'+_0x404053[_0xe3d7('0x42')][_0xe3d7('0x9f')]+'%'};return _0x4e3acd;})});}_0x5ae2db['where'][_0xe3d7('0x8c')]=![];if(_0x404053['query']['id']){_0x5ae2db['where']['id']={'$gt':_0x404053[_0xe3d7('0x42')]['id']};}_0x5ae2db=_[_0xe3d7('0x31')]({},_0x5ae2db,_0x404053[_0xe3d7('0x4a')]);return db[_0xe3d7('0x5f')][_0xe3d7('0x2a')]({'where':_0x5ae2db[_0xe3d7('0x9d')]})[_0xe3d7('0x19')](function(_0x22a518){_0xe35f4[_0xe3d7('0x2a')]=_0x22a518;_0x5ae2db['include']=[];if(_0x404053[_0xe3d7('0x42')][_0xe3d7('0xa6')]){_0x5ae2db[_0xe3d7('0x49')]['push']({'model':db['User'],'as':'User','attributes':['id',_0xe3d7('0x55'),_0xe3d7('0xa7')]});}if(_0x404053[_0xe3d7('0x42')][_0xe3d7('0x48')]){_0x5ae2db[_0xe3d7('0x49')]=[{'all':!![]}];}return db[_0xe3d7('0x5f')][_0xe3d7('0x3c')](_0x5ae2db);})[_0xe3d7('0x19')](function(_0x22a42d){_0xe35f4[_0xe3d7('0xa2')]=_0x22a42d;return _0xe35f4;});}})['then'](respondWithFilteredResult(_0x242949,_0x5ae2db))[_0xe3d7('0x23')](handleError(_0x242949,null));};exports[_0xe3d7('0xa8')]=function(_0x3022c4,_0x5cd74b){return db[_0xe3d7('0x38')]['find']({'where':{'id':_0x3022c4[_0xe3d7('0x40')]['id']}})['then'](handleEntityNotFound(_0x5cd74b,null))[_0xe3d7('0x19')](function(_0x1cb3c5){if(_0x1cb3c5){return _0x1cb3c5[_0xe3d7('0xa9')](_0x3022c4[_0xe3d7('0x32')][_0xe3d7('0x97')],_[_0xe3d7('0x98')](_0x3022c4[_0xe3d7('0x32')],['ids','id'])||{})['spread'](function(){return db[_0xe3d7('0xaa')][_0xe3d7('0x3c')]({'attributes':['id',_0xe3d7('0x30'),'color'],'where':{'id':_0x3022c4['body'][_0xe3d7('0x97')]}});})['then'](function(_0x49de37){socket[_0xe3d7('0xab')](_0xe3d7('0xac'),{'id':Number(_0x3022c4['params']['id']),'tags':_0x49de37||[]});return{'id':Number(_0x3022c4[_0xe3d7('0x40')]['id']),'tags':_0x49de37||[]};});}})['then'](respondWithResult(_0x5cd74b,null))[_0xe3d7('0x23')](handleError(_0x5cd74b,null));};exports[_0xe3d7('0xad')]=function(_0x258982,_0x3f500c){return db[_0xe3d7('0x38')][_0xe3d7('0x4b')]({'where':{'id':_0x258982[_0xe3d7('0x40')]['id']}})['then'](handleEntityNotFound(_0x3f500c,null))[_0xe3d7('0x19')](function(_0x3faa22){if(_0x3faa22){return _0x3faa22[_0xe3d7('0xad')](_0x258982[_0xe3d7('0x42')][_0xe3d7('0x97')]);}})[_0xe3d7('0x19')](respondWithStatusCode(_0x3f500c,null))[_0xe3d7('0x23')](handleError(_0x3f500c,null));};exports[_0xe3d7('0x79')]=function(_0x1acf73,_0x304340){var _0xdef376=moment()['unix']()['toString']();var _0x50be80=path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0xae'),_0xe3d7('0xaf'),_0xe3d7('0xb0'));var _0x274b8c=path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0xae'),_0xe3d7('0xaf'),_0xe3d7('0xb1'));var _0x3cc87e=path[_0xe3d7('0x77')](_0x50be80,_0xdef376);var _0x28d423=util[_0xe3d7('0x7d')]('transcript-%d-%s.zip',_0x1acf73['params']['id'],_0xdef376);var _0xe78852=path['join'](_0x50be80,_0x28d423);var _0x31ae0e=[];_0x31ae0e[_0xe3d7('0xb2')]({'model':db[_0xe3d7('0x80')],'as':_0xe3d7('0x80'),'attributes':['id',_0xe3d7('0x55')],'raw':!![]});_0x31ae0e[_0xe3d7('0xb2')]({'model':db['CmContact'],'as':_0xe3d7('0x64'),'attributes':['id',_0xe3d7('0xb3'),_0xe3d7('0xb4')],'raw':!![]});if(_0x1acf73[_0xe3d7('0x42')][_0xe3d7('0xb1')]){_0x31ae0e[_0xe3d7('0xb2')]({'model':db[_0xe3d7('0xb5')],'as':'Attachment','raw':!![]});}var _0x1ab073=[{'model':db[_0xe3d7('0x5f')],'as':_0xe3d7('0x7f'),'attributes':['id','body',_0xe3d7('0x89'),_0xe3d7('0x8b'),_0xe3d7('0x8c'),'read'],'include':_0x31ae0e}];_0x1ab073[_0xe3d7('0xb2')]({'model':db['ChatWebsite'],'as':_0xe3d7('0xb6'),'attributes':['id',_0xe3d7('0x30')]});_0x1ab073[_0xe3d7('0xb2')]({'model':db['User'],'as':_0xe3d7('0xb7'),'attributes':['id',_0xe3d7('0x55')]});return db[_0xe3d7('0x38')][_0xe3d7('0x4b')]({'where':{'id':_0x1acf73[_0xe3d7('0x40')]['id']},'include':_0x1ab073})['then'](handleEntityNotFound(_0x304340,null))[_0xe3d7('0x19')](function(_0x4f0d21){if(_0x4f0d21){var _0x1a25d9=_0x4f0d21[_0xe3d7('0xb8')]({'plain':!![]});fs[_0xe3d7('0xb9')](_0x3cc87e);var _0x3a35ab={'channel':_0xe3d7('0xba'),'account':_0x1a25d9[_0xe3d7('0xb6')][_0xe3d7('0x30')],'agent':_0x1a25d9[_0xe3d7('0xb7')]?_0x1a25d9[_0xe3d7('0xb7')][_0xe3d7('0x55')]:'N.A.','createdAt':moment(_0x1a25d9[_0xe3d7('0x89')])[_0xe3d7('0x7d')](_0xe3d7('0xa1'))['toString'](),'closedAt':_0x1a25d9['closed']?moment(_0x1a25d9[_0xe3d7('0xbb')])['format'](_0xe3d7('0xa1'))[_0xe3d7('0xbc')]():'','disposition':_0x1a25d9[_0xe3d7('0xbd')],'chatInfo':{'browser':_0x1a25d9[_0xe3d7('0xbe')],'os':_0x1a25d9['osName'],'referer':_0x1a25d9[_0xe3d7('0xbf')],'customerIp':_0x1a25d9['customerIp'],'customerPort':_0x1a25d9[_0xe3d7('0xc0')]?_0x1a25d9[_0xe3d7('0xc0')]:_0xe3d7('0xc1')},'messages':_(_0x1a25d9[_0xe3d7('0x7f')])[_0xe3d7('0xc2')]()[_0xe3d7('0x9f')]({'secret':![]})['map'](function(_0x416a57){if(_0x416a57[_0xe3d7('0xb5')]){var _0x5aa021=path['join'](_0x274b8c,_0x416a57['Attachment'][_0xe3d7('0x6d')]);if(fs['existsSync'](_0x5aa021)){fs[_0xe3d7('0xc3')](_0x5aa021)[_0xe3d7('0xc4')](fs[_0xe3d7('0xc5')](path[_0xe3d7('0x77')](_0x3cc87e,_0x416a57[_0xe3d7('0xb5')]['basename'])));}}return{'date':moment(_0x416a57[_0xe3d7('0x89')])['format'](_0xe3d7('0xa1'))[_0xe3d7('0xbc')](),'sender':_0x416a57[_0xe3d7('0x8b')]===_0xe3d7('0x5e')?_0x416a57[_0xe3d7('0x80')]?_0x416a57[_0xe3d7('0x80')][_0xe3d7('0x55')]:_0xe3d7('0x83'):_0x416a57[_0xe3d7('0x64')][_0xe3d7('0xb3')]+(_0x416a57['Contact']['lastName']?'\x20'+_0x416a57['Contact'][_0xe3d7('0xb4')]:''),'body':_0x416a57[_0xe3d7('0xb5')]?_0x416a57['Attachment'][_0xe3d7('0x6d')]:_0x416a57['body'],'direction':_0x416a57[_0xe3d7('0x8b')]===_0xe3d7('0x5e')?'A':'C','secret':_0x416a57[_0xe3d7('0x8c')],'read':_0x416a57['read'],'attachment':_0x416a57[_0xe3d7('0xb5')]};})[_0xe3d7('0xc6')]()};return ejs['renderFile'](path[_0xe3d7('0x77')](config[_0xe3d7('0x75')],_0xe3d7('0xae'),_0xe3d7('0xc7'),_0xe3d7('0xc8')),{'interaction':_0x3a35ab})[_0xe3d7('0x19')](function(_0x798f9e){var _0x30be1b=path[_0xe3d7('0x77')](_0x3cc87e,_0xe3d7('0xc9')+_0x1a25d9['id']+'-'+_0xdef376+_0xe3d7('0xca'));var _0x1e39f4={'path':_0x30be1b,'channel':_0xe3d7('0xba'),'interactionId':_0x1a25d9['id']};return pdf[_0xe3d7('0xcb')](_0x798f9e,_0x1e39f4);})[_0xe3d7('0x19')](function(){return new Promise(function(_0x460708,_0x209a70){zipdir(_0x3cc87e,{'saveTo':_0xe78852},function(_0x34eef1,_0x1c766f){if(_0x34eef1)return _0x209a70(_0x34eef1);return _0x460708(_0x1c766f);});})['then'](function(){return new BPromise(function(_0x1dd09d,_0x5ceac5){rimraf(_0x3cc87e,function(_0x46a526){if(_0x46a526)_0x5ceac5(_0x46a526);return _0x1dd09d();});});})[_0xe3d7('0x19')](function(){return _0x304340[_0xe3d7('0x79')](_0xe78852,_0x28d423,function(_0x38bd23){if(_0x38bd23){logger[_0xe3d7('0x1f')]('err',_0x38bd23);}else{fs[_0xe3d7('0xcc')](_0xe78852);}});});});}else{return _0x304340['sendStatus'](0xc8);}})[_0xe3d7('0x23')](handleError(_0x304340,null));};
\ No newline at end of file
+var _0xe6aa=['removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','ChatWebsite','Account','Owner','mkdirSync','Chat','createdAt','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','out','Contact','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','bluebird','mustache','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','update','name','render','body','contact','agent','account','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','model','ChatInteraction','keys','attributes','intersection','fields','options','find','create','params','destroy','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','email','isNull','follow','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','closed','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','User','ContactId','format','%s%d','agentAlias','customer','Visitor','agentIdentifier','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','omit','ids','getMessages','filters','length','hasOwnProperty','nolimit','sort','where','merge','map','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','order','pick','ChatInteractionId','secret','includeAgent','includeAll','addTags','spread','Tag','color','emit','chatInteractionTags:save'];(function(_0x58bbeb,_0x19caf1){var _0x5d9f3e=function(_0x27e100){while(--_0x27e100){_0x58bbeb['push'](_0x58bbeb['shift']());}};_0x5d9f3e(++_0x19caf1);}(_0xe6aa,0x1ca));var _0xae6a=function(_0x123dba,_0x58ff2d){_0x123dba=_0x123dba-0x0;var _0x41b42d=_0xe6aa[_0x123dba];return _0x41b42d;};'use strict';var rimraf=require(_0xae6a('0x0'));var zipdir=require('zip-dir');var rp=require(_0xae6a('0x1'));var moment=require('moment');var BPromise=require(_0xae6a('0x2'));var Mustache=require(_0xae6a('0x3'));var util=require('util');var path=require(_0xae6a('0x4'));var ejs=require(_0xae6a('0x5'));var fs=require('fs');var _=require(_0xae6a('0x6'));var Redis=require('ioredis');var interaction=require(_0xae6a('0x7'));var qs=require(_0xae6a('0x8'));var pdf=require(_0xae6a('0x9'));var logger=require(_0xae6a('0xa'))('api');var config=require(_0xae6a('0xb'));var db=require(_0xae6a('0xc'))['db'];config['redis']=_[_0xae6a('0xd')](config[_0xae6a('0xe')],{'host':_0xae6a('0xf'),'port':0x18eb});var socket=require(_0xae6a('0x10'))(new Redis(config[_0xae6a('0xe')]));require(_0xae6a('0x11'))[_0xae6a('0x12')](socket);var jayson=require(_0xae6a('0x13'));var client=jayson['client'][_0xae6a('0x14')]({'port':0x232b});var client9004=jayson[_0xae6a('0x15')][_0xae6a('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x4998fd,_0x26572c,_0x148261,_0xb30f94){return new BPromise(function(_0x50d0d5,_0x31527a){var _0x3990cf=_0xb30f94||client;return _0x3990cf[_0xae6a('0x16')](_0x4998fd,_0x148261)[_0xae6a('0x17')](function(_0x1c0015){logger[_0xae6a('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x26572c,_0xae6a('0x19'));logger[_0xae6a('0x1a')](_0xae6a('0x1b'),_0x26572c,_0xae6a('0x19'),JSON[_0xae6a('0x1c')](_0x1c0015));if(_0x1c0015[_0xae6a('0x1d')]){if(_0x1c0015[_0xae6a('0x1d')]['code']===0x1f4){logger['error'](_0xae6a('0x1e'),_0x26572c,_0x1c0015['error'][_0xae6a('0x1f')]);return _0x31527a(_0x1c0015[_0xae6a('0x1d')][_0xae6a('0x1f')]);}logger[_0xae6a('0x1d')](_0xae6a('0x1e'),_0x26572c,_0x1c0015['error']['message']);return _0x50d0d5(_0x1c0015[_0xae6a('0x1d')][_0xae6a('0x1f')]);}else{logger[_0xae6a('0x18')](_0xae6a('0x1e'),_0x26572c,_0xae6a('0x19'));_0x50d0d5(_0x1c0015[_0xae6a('0x20')][_0xae6a('0x1f')]);}})[_0xae6a('0x21')](function(_0x26e83f){logger[_0xae6a('0x1d')](_0xae6a('0x1e'),_0x26572c,_0x26e83f);_0x31527a(_0x26e83f);});});}function respondWithStatusCode(_0x5b71f1,_0x554db7){_0x554db7=_0x554db7||0xcc;return function(_0x4aab98){if(_0x4aab98){return _0x5b71f1[_0xae6a('0x22')](_0x554db7);}return _0x5b71f1[_0xae6a('0x23')](_0x554db7)[_0xae6a('0x24')]();};}function respondWithResult(_0x423a54,_0x28ceff){_0x28ceff=_0x28ceff||0xc8;return function(_0x32724b){if(_0x32724b){return _0x423a54['status'](_0x28ceff)[_0xae6a('0x25')](_0x32724b);}};}function respondWithFilteredResult(_0x5df151,_0x2bb3f4){return function(_0x30968b){if(_0x30968b){var _0x266eab=typeof _0x2bb3f4[_0xae6a('0x26')]==='undefined'&&typeof _0x2bb3f4['limit']===_0xae6a('0x27');var _0x4d2725=_0x30968b[_0xae6a('0x28')];var _0x29ae99=_0x266eab?0x0:_0x2bb3f4[_0xae6a('0x26')];var _0x14213e=_0x266eab?_0x30968b[_0xae6a('0x28')]:_0x2bb3f4['offset']+_0x2bb3f4[_0xae6a('0x29')];var _0x2d70ca;if(_0x14213e>=_0x4d2725){_0x14213e=_0x4d2725;_0x2d70ca=0xc8;}else{_0x2d70ca=0xce;}_0x5df151[_0xae6a('0x23')](_0x2d70ca);return _0x5df151['set']('Content-Range',_0x29ae99+'-'+_0x14213e+'/'+_0x4d2725)[_0xae6a('0x25')](_0x30968b);}return null;};}function saveUpdates(_0x36b8af){return function(_0x23980d){if(_0x23980d){return _0x23980d[_0xae6a('0x2a')](_0x36b8af)[_0xae6a('0x17')](function(_0x2cee1e){return _0x2cee1e;});}return null;};}function removeEntity(_0x1a1f2b){return function(_0x4ae06f){if(_0x4ae06f){return _0x4ae06f['destroy']()[_0xae6a('0x17')](function(){_0x1a1f2b[_0xae6a('0x23')](0xcc)[_0xae6a('0x24')]();});}};}function handleEntityNotFound(_0x1cc51f){return function(_0x3a74e1){if(!_0x3a74e1){_0x1cc51f[_0xae6a('0x22')](0x194);}return _0x3a74e1;};}function handleError(_0x3793e0,_0x208af8){_0x208af8=_0x208af8||0x1f4;return function(_0x3dfbfa){logger[_0xae6a('0x1d')](_0x3dfbfa['stack']);if(_0x3dfbfa[_0xae6a('0x2b')]){delete _0x3dfbfa[_0xae6a('0x2b')];}_0x3793e0[_0xae6a('0x23')](_0x208af8)['send'](_0x3dfbfa);};}function getMustacheRender(_0x56c778,_0xd75e0){return Mustache[_0xae6a('0x2c')](_0x56c778,_['merge'](_0xd75e0[_0xae6a('0x2d')],{'contact':_0xd75e0[_0xae6a('0x2e')],'message':_0xd75e0[_0xae6a('0x1f')],'agent':_0xd75e0[_0xae6a('0x2f')],'interaction':_0xd75e0['interaction'],'account':_0xd75e0[_0xae6a('0x30')]}))||'';}exports['index']=function(_0x592cc4,_0x264e3a){var _0x210645={};var _0x14582f=_['map'](db['ChatInteraction'][_0xae6a('0x31')],function(_0x29bff6){return{'name':_0x29bff6[_0xae6a('0x32')],'type':_0x29bff6[_0xae6a('0x33')][_0xae6a('0x34')]};});_0x210645=qs['getOptions'](_0x14582f,_0x592cc4);return interaction[_0xae6a('0x35')](_0xae6a('0x36'),_0x592cc4[_0xae6a('0x37')],_0x592cc4[_0xae6a('0x38')],_0x210645,_0x14582f)[_0xae6a('0x17')](respondWithFilteredResult(_0x264e3a,_0x210645))[_0xae6a('0x21')](handleError(_0x264e3a,null));};exports[_0xae6a('0x39')]=function(_0x418f48,_0x1c5d79){var _0x92015a={'raw':![],'where':{'id':_0x418f48['params']['id']}},_0x4059b9={};_0x4059b9[_0xae6a('0x3a')]=_['keys'](db[_0xae6a('0x3b')]['rawAttributes']);_0x4059b9[_0xae6a('0x37')]=_[_0xae6a('0x3c')](_0x418f48['query']);_0x4059b9['filters']=_['intersection'](_0x4059b9[_0xae6a('0x3a')],_0x4059b9[_0xae6a('0x37')]);_0x92015a[_0xae6a('0x3d')]=_[_0xae6a('0x3e')](_0x4059b9[_0xae6a('0x3a')],qs[_0xae6a('0x3f')](_0x418f48[_0xae6a('0x37')][_0xae6a('0x3f')]));_0x92015a['attributes']=_0x92015a[_0xae6a('0x3d')]['length']?_0x92015a[_0xae6a('0x3d')]:_0x4059b9[_0xae6a('0x3a')];if(_0x418f48[_0xae6a('0x37')]['includeAll']){_0x92015a['include']=[{'all':!![]}];}_0x92015a=_['merge']({},_0x92015a,_0x418f48[_0xae6a('0x40')]);return db[_0xae6a('0x3b')][_0xae6a('0x41')](_0x92015a)['then'](handleEntityNotFound(_0x1c5d79,null))['then'](respondWithResult(_0x1c5d79,null))['catch'](handleError(_0x1c5d79,null));};exports[_0xae6a('0x42')]=function(_0x4c25ab,_0x3b0b9a){return db[_0xae6a('0x3b')][_0xae6a('0x42')](_0x4c25ab[_0xae6a('0x2d')],{})[_0xae6a('0x17')](respondWithResult(_0x3b0b9a,0xc9))['catch'](handleError(_0x3b0b9a,null));};exports[_0xae6a('0x2a')]=function(_0x10af07,_0x22941f){if(_0x10af07[_0xae6a('0x2d')]['id']){delete _0x10af07[_0xae6a('0x2d')]['id'];}return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0x10af07[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x22941f,null))['then'](saveUpdates(_0x10af07[_0xae6a('0x2d')],null))[_0xae6a('0x17')](respondWithResult(_0x22941f,null))['catch'](handleError(_0x22941f,null));};exports[_0xae6a('0x44')]=function(_0xce0a7e,_0x383d28){return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0xce0a7e[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x383d28,null))[_0xae6a('0x17')](removeEntity(_0x383d28,null))[_0xae6a('0x21')](handleError(_0x383d28,null));};exports[_0xae6a('0x45')]=function(_0x2b2ab7,_0xdb6106){return db['ChatInteraction'][_0xae6a('0x45')]()[_0xae6a('0x17')](respondWithResult(_0xdb6106,null))['catch'](handleError(_0xdb6106,null));};exports[_0xae6a('0x46')]=function(_0x3bc6e7,_0x381ed0){var _0x471c10=_0x3bc6e7[_0xae6a('0x43')]['id'];var _0x1c1bb2;var _0xbfef90;var _0x290da0;return db[_0xae6a('0x3b')][_0xae6a('0x47')]({'where':{'id':_0x471c10}})[_0xae6a('0x17')](function(_0x450b2e){_0x1c1bb2=_0x450b2e;return db['ChatWebsite'][_0xae6a('0x47')]({'where':{'id':_0x450b2e[_0xae6a('0x48')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xae6a('0x49'),_0xae6a('0x4a'),_0xae6a('0x4b')],'raw':!![]});})[_0xae6a('0x17')](function(_0x73bb7a){if(_0x73bb7a&&_0x73bb7a['vidaooApiKey']&&_0x73bb7a['vidaooEscalation']){_0xbfef90=_0x73bb7a;var _0x4aceb7={'interaction':{'id':_0x471c10},'agent':{'id':_0x3bc6e7['user']['id'],'name':_0x3bc6e7[_0xae6a('0x38')]['name'],'fullname':_0x3bc6e7[_0xae6a('0x38')][_0xae6a('0x4c')],'email':_0x3bc6e7['user']['email']},'contact':_0x3bc6e7[_0xae6a('0x2d')][_0xae6a('0x2e')],'account':_0x3bc6e7[_0xae6a('0x2d')][_0xae6a('0x30')]};var _0x43df6e={'rejectUnauthorized':![],'method':_0xae6a('0x4d'),'url':_0xae6a('0x4e'),'headers':{'X-APIKEY':_0x73bb7a[_0xae6a('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3bc6e7[_0xae6a('0x38')][_0xae6a('0x50')]],'buttons':null,'topic':_0xbfef90[_0xae6a('0x49')],'note':_[_0xae6a('0x51')](_0xbfef90[_0xae6a('0x4a')])?null:getMustacheRender(_0xbfef90[_0xae6a('0x4a')],_0x4aceb7),'metadata':null},'redirect':_0xae6a('0x52'),'json':!![]};try{if(!_['isNull'](_0xbfef90[_0xae6a('0x4b')])){var _0x3606fc=getMustacheRender(_0xbfef90[_0xae6a('0x4b')],_0x4aceb7);var _0x2034d5=JSON[_0xae6a('0x53')](_0x3606fc);_0x43df6e[_0xae6a('0x2d')][_0xae6a('0x54')]=_0x2034d5;}}catch(_0x50eb28){throw new db['Sequelize'][(_0xae6a('0x55'))](_0xae6a('0x56'));}return rp(_0x43df6e);}else{throw new db['Sequelize']['ValidationError'](_0xae6a('0x57'));}})[_0xae6a('0x17')](function(_0x2b878b){_0x290da0=_0x2b878b;if(_0x290da0['id']){var _0x52f504={'body':_0x290da0[_0xae6a('0x58')],'ChatWebsiteId':_0xbfef90['id'],'ChatInteractionId':_0x1c1bb2['id'],'direction':'out','UserId':_0x3bc6e7['user']['id']};return db[_0xae6a('0x59')][_0xae6a('0x42')](_0x52f504,{});}else{throw new db[(_0xae6a('0x5a'))]['ValidationError'](_0xae6a('0x5b'));}})[_0xae6a('0x17')](function(){return _0x1c1bb2[_0xae6a('0x5c')]({'vidaooSessionId':_0x290da0['id']});})['then'](respondWithResult(_0x381ed0,null))[_0xae6a('0x21')](handleError(_0x381ed0,null));};exports[_0xae6a('0x5d')]=function(_0x49345a,_0x4f8230){if(_0x49345a[_0xae6a('0x2d')]['id']){delete _0x49345a[_0xae6a('0x2d')]['id'];}return db[_0xae6a('0x3b')]['find']({'where':{'id':_0x49345a[_0xae6a('0x43')]['id']},'include':[{'model':db[_0xae6a('0x5e')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x4f8230,null))[_0xae6a('0x17')](saveUpdates(_0x49345a['body'],null))['then'](respondWithResult(_0x4f8230,null))[_0xae6a('0x21')](handleError(_0x4f8230,null));};exports[_0xae6a('0x5f')]=function(_0x5e5803,_0x2734ce){if(_0x5e5803[_0xae6a('0x2d')]['id']){delete _0x5e5803[_0xae6a('0x2d')]['id'];}return db['ChatInteraction'][_0xae6a('0x41')]({'where':{'id':_0x5e5803['params']['id']}})[_0xae6a('0x17')](function(_0x379253){if(!_0x379253){logger[_0xae6a('0x1d')](_0xae6a('0x60'),_0xae6a('0x5f'),0x194,_0xae6a('0x61'));_0x2734ce[_0xae6a('0x22')](0x194);}else{if(_0x379253[_0xae6a('0x62')]){throw new db['Sequelize'][(_0xae6a('0x55'))]('Interaction\x20already\x20assigned');}}return _0x379253;})['then'](function(_0x2a3639){if(_0x2a3639){return _0x2a3639[_0xae6a('0x2a')]({'closed':_0x5e5803['body']['closed'],'disposition':_0x5e5803[_0xae6a('0x2d')][_0xae6a('0x63')]})[_0xae6a('0x17')](function(_0x316f71){return _0x316f71;});}})['then'](function(){return respondWithRpcPromise(_0xae6a('0x64'),_0xae6a('0x5f'),_0x5e5803[_0xae6a('0x2d')],client9004);})[_0xae6a('0x17')](respondWithResult(_0x2734ce,null))[_0xae6a('0x21')](handleError(_0x2734ce,null));};exports[_0xae6a('0x65')]=function(_0x35322d,_0x2f7403){_0x35322d['body'][_0xae6a('0x2b')]=_0x35322d[_0xae6a('0x66')]['originalname'];_0x35322d[_0xae6a('0x2d')][_0xae6a('0x67')]=_0x35322d[_0xae6a('0x66')][_0xae6a('0x68')];_0x35322d[_0xae6a('0x2d')][_0xae6a('0x33')]=_0x35322d[_0xae6a('0x66')][_0xae6a('0x69')];return db[_0xae6a('0x6a')][_0xae6a('0x42')](_0x35322d['body'])[_0xae6a('0x17')](respondWithResult(_0x2f7403,0xc9))['catch'](handleError(_0x2f7403,null));};exports['attachmentDownload']=function(_0x1165d5,_0x31c015){return db['ChatInteraction'][_0xae6a('0x47')]({'where':{'id':_0x1165d5[_0xae6a('0x43')]['id']},'raw':!![]})[_0xae6a('0x17')](handleEntityNotFound(_0x31c015,null))[_0xae6a('0x17')](function(_0x777720){if(_0x777720){if(_0x777720[_0xae6a('0x6b')]){return _0x31c015['status'](0x193)[_0xae6a('0x25')]({'status':0x193,'message':_0xae6a('0x6c')});}return db[_0xae6a('0x6a')]['findOne']({'where':{'id':_0x1165d5[_0xae6a('0x37')]['attachId']},'raw':!![]})[_0xae6a('0x17')](handleEntityNotFound(_0x31c015,null));}})[_0xae6a('0x17')](function(_0x5022fc){if(_0x5022fc){var _0x44cc44=_0x5022fc[_0xae6a('0x6d')]!==null;var _0x4f3f9d=path['join'](config[_0xae6a('0x6e')],_0xae6a('0x6f'));if(_0x44cc44){_0x4f3f9d=path[_0xae6a('0x70')](_0x4f3f9d,_0xae6a('0x71'));}var _0x3c38b6=path['join'](_0x4f3f9d,_0x5022fc[_0xae6a('0x67')]);return _0x31c015[_0xae6a('0x72')](_0x3c38b6);}})['catch'](handleError(_0x31c015,null));};exports[_0xae6a('0x73')]=function(_0x33ecc9,_0x23ffdd){var _0x42a833=null;var _0x2cf004=null;var _0x1f02b5=null;if(_0x33ecc9[_0xae6a('0x2d')]['id']){delete _0x33ecc9[_0xae6a('0x2d')]['id'];}if(_0x33ecc9['body']['mailTranscript']){_0x1f02b5=path[_0xae6a('0x70')](config['root'],_0xae6a('0x74'),util['format'](_0xae6a('0x75'),Date['now']()));_0x33ecc9[_0xae6a('0x2d')][_0xae6a('0x76')]=_0x1f02b5;}return db['ChatInteraction'][_0xae6a('0x41')]({'where':{'id':_0x33ecc9[_0xae6a('0x43')]['id']},'include':[{'model':db[_0xae6a('0x59')],'as':_0xae6a('0x77'),'include':[{'model':db[_0xae6a('0x78')],'as':'User'}]}]})[_0xae6a('0x17')](handleEntityNotFound(_0x23ffdd,null))[_0xae6a('0x17')](saveUpdates(_0x33ecc9['body'],null))[_0xae6a('0x17')](function(_0x262af3){if(_0x262af3){_0x42a833=_0x262af3;return db['ChatWebsite'][_0xae6a('0x41')]({'where':{'id':_0x42a833[_0xae6a('0x48')]}});}})[_0xae6a('0x17')](function(_0x5f425e){if(_0x5f425e){_0x2cf004=_0x5f425e;return db[_0xae6a('0x5e')][_0xae6a('0x41')]({'where':{'id':_0x42a833[_0xae6a('0x79')]}});}})[_0xae6a('0x17')](function(_0x214b6d){if(_0x214b6d){if(_0x1f02b5){var _0x4eb0cb=null;for(var _0x4af66a=0x1;_0x4af66a<_0x42a833[_0xae6a('0x77')]['length'];++_0x4af66a){_0x4eb0cb=_0x42a833['Messages'][_0x4af66a];var _0x2eacd8=_0x4eb0cb['UserId']?util[_0xae6a('0x7a')](_0xae6a('0x7b'),_0x2cf004[_0xae6a('0x7c')],_0x4eb0cb[_0xae6a('0x62')]):'System';var _0x2db7b4=_0x33ecc9[_0xae6a('0x2d')][_0xae6a('0x7d')]||util['format'](_0xae6a('0x7b'),_0xae6a('0x7e'),_0x4eb0cb[_0xae6a('0x79')]);switch(_0x2cf004[_0xae6a('0x7f')]){case'website_alias':_0x2eacd8=_0x4eb0cb[_0xae6a('0x62')]?util['format']('%s%d',_0x2cf004[_0xae6a('0x7c')],_0x4eb0cb[_0xae6a('0x62')]):_0xae6a('0x80');break;case'agent_alias':_0x2eacd8=_0x4eb0cb[_0xae6a('0x62')]?_0x4eb0cb[_0xae6a('0x78')][_0xae6a('0x81')]||_0x4eb0cb[_0xae6a('0x78')]['fullname']:_0xae6a('0x80');break;case _0xae6a('0x82'):_0x2eacd8=_0x4eb0cb['UserId']?_0x4eb0cb[_0xae6a('0x78')][_0xae6a('0x4c')]:_0xae6a('0x80');break;default:_0x2eacd8=_0x4eb0cb['UserId']?util[_0xae6a('0x7a')](_0xae6a('0x7b'),_0x2cf004[_0xae6a('0x7c')],_0x4eb0cb['UserId']):'System';}var _0x3a34c6=util['format'](_0xae6a('0x83'),moment(_0x4eb0cb['createdAt'])[_0xae6a('0x7a')](_0xae6a('0x84')),_0x4eb0cb[_0xae6a('0x85')]==='in'?_0x2db7b4:_0x2eacd8,_0x4eb0cb[_0xae6a('0x2d')]);if(!_0x4eb0cb['secret']){fs[_0xae6a('0x86')](_0x1f02b5,_0x3a34c6);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xae6a('0x87')],'as':_0xae6a('0x88'),'raw':!![],'include':[{'model':db[_0xae6a('0x89')],'as':_0xae6a('0x89'),'raw':!![]}]}]});}}})[_0xae6a('0x17')](function(_0x48e3e4){if(!_0x48e3e4||!_0x48e3e4[_0xae6a('0x88')]||!_0x33ecc9[_0xae6a('0x2d')])return _0x42a833;var _0x4737d2=_0x48e3e4[_0xae6a('0x8a')]();return respondWithRpcPromise(_0xae6a('0x8b'),_0xae6a('0x8c'),{'account':_0x4737d2,'message':{'from':util[_0xae6a('0x7a')](_0xae6a('0x8d'),_0x48e3e4['name'],_0x48e3e4[_0xae6a('0x50')]||_0x48e3e4[_0xae6a('0x88')][_0xae6a('0x38')]),'to':_0x33ecc9[_0xae6a('0x2d')][_0xae6a('0x8e')],'subject':_0xae6a('0x8f'),'text':util[_0xae6a('0x7a')](_0xae6a('0x90'),_0x33ecc9[_0xae6a('0x2d')]['mailTranscript']),'attachments':[{'path':_0x1f02b5}]}})['then'](function(){return _0x42a833;})[_0xae6a('0x21')](function(_0x17c3ed){logger['error'](_0x17c3ed);});})['then'](respondWithStatusCode(_0x23ffdd,0xc8))[_0xae6a('0x21')](handleError(_0x23ffdd,null));};exports['addMessage']=function(_0x11f794,_0x126fe1){return db[_0xae6a('0x59')][_0xae6a('0x41')]({'where':{'id':_0x11f794[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x126fe1,null))[_0xae6a('0x17')](function(_0x337d64){if(_0x337d64){return _0x337d64['addMessage'](_0x11f794['body']['ids'],_[_0xae6a('0x91')](_0x11f794[_0xae6a('0x2d')],[_0xae6a('0x92'),'id'])||{});}})['then'](respondWithResult(_0x126fe1,null))[_0xae6a('0x21')](handleError(_0x126fe1,null));};exports[_0xae6a('0x93')]=function(_0xc15337,_0x4e2e2d){var _0x1df31a={'raw':![],'where':{}};var _0x4102f4={};var _0x502b73={'count':0x0,'rows':[]};return db[_0xae6a('0x3b')][_0xae6a('0x47')]({'where':{'id':_0xc15337[_0xae6a('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e2e2d,null))[_0xae6a('0x17')](function(_0x2aa14e){if(_0x2aa14e){_0x4102f4[_0xae6a('0x3a')]=_['keys'](db[_0xae6a('0x59')][_0xae6a('0x31')]);_0x4102f4['query']=_[_0xae6a('0x3c')](_0xc15337[_0xae6a('0x37')]);_0x4102f4[_0xae6a('0x94')]=_[_0xae6a('0x3e')](_0x4102f4[_0xae6a('0x3a')],_0x4102f4['query']);_0x1df31a['attributes']=_[_0xae6a('0x3e')](_0x4102f4[_0xae6a('0x3a')],qs[_0xae6a('0x3f')](_0xc15337['query']['fields']));_0x1df31a['attributes']=_0x1df31a[_0xae6a('0x3d')][_0xae6a('0x95')]?_0x1df31a[_0xae6a('0x3d')]:_0x4102f4[_0xae6a('0x3a')];if(!_0xc15337['query'][_0xae6a('0x96')](_0xae6a('0x97'))){_0x1df31a['limit']=qs[_0xae6a('0x29')](_0xc15337['query'][_0xae6a('0x29')]);_0x1df31a[_0xae6a('0x26')]=qs[_0xae6a('0x26')](_0xc15337['query'][_0xae6a('0x26')]);}_0x1df31a['order']=qs[_0xae6a('0x98')](_0xc15337[_0xae6a('0x37')][_0xae6a('0x98')]);_0x1df31a['where']=qs[_0xae6a('0x94')](_['pick'](_0xc15337[_0xae6a('0x37')],_0x4102f4[_0xae6a('0x94')]));_0x1df31a['where']['ChatInteractionId']=_0x2aa14e['id'];if(_0xc15337['query']['filter']){_0x1df31a[_0xae6a('0x99')]=_[_0xae6a('0x9a')](_0x1df31a[_0xae6a('0x99')],{'$or':_[_0xae6a('0x9b')](_0x1df31a[_0xae6a('0x3d')],function(_0x27d60e){var _0x5f3baf={};_0x5f3baf[_0x27d60e]={'$like':'%'+_0xc15337['query'][_0xae6a('0x9c')]+'%'};return _0x5f3baf;})});}if(_0xc15337[_0xae6a('0x37')][_0xae6a('0x9d')]){var _0x3c1174=_0xc15337['query'][_0xae6a('0x9d')][_0xae6a('0x9e')](',');var _0x37c322={};_0x37c322[_0x3c1174[0x0]]={'$gte':moment(_0x3c1174[0x1])[_0xae6a('0x7a')](_0xae6a('0x9f'))};_0x1df31a[_0xae6a('0x99')]=_[_0xae6a('0x9a')](_0x1df31a[_0xae6a('0x99')],_0x37c322);}_0x1df31a=_[_0xae6a('0x9a')]({},_0x1df31a,_0xc15337[_0xae6a('0x40')]);return db[_0xae6a('0x59')][_0xae6a('0x28')]({'where':_0x1df31a[_0xae6a('0x99')]})[_0xae6a('0x17')](function(_0x3ccf5d){_0x502b73['count']=_0x3ccf5d;if(_0xc15337[_0xae6a('0x37')]['includeAll']){_0x1df31a[_0xae6a('0xa0')]=[{'all':!![]}];}return db[_0xae6a('0x59')][_0xae6a('0x35')](_0x1df31a);})[_0xae6a('0x17')](function(_0x2a51f3){_0x502b73[_0xae6a('0xa1')]=_0x2a51f3;return _0x502b73;});}})['then'](respondWithFilteredResult(_0x4e2e2d,_0x1df31a))[_0xae6a('0x21')](handleError(_0x4e2e2d,null));};exports[_0xae6a('0xa2')]=function(_0x467efb,_0x46b413){var _0x2ee7b2={'where':{}},_0x1e618a={},_0x1a0101={'count':0x0,'rows':[]};return db[_0xae6a('0x3b')][_0xae6a('0x47')]({'where':{'id':_0x467efb['params']['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x46b413,null))[_0xae6a('0x17')](function(_0x58b88e){if(_0x58b88e){_0x1e618a[_0xae6a('0x3a')]=_['keys'](db[_0xae6a('0x59')][_0xae6a('0x31')]);_0x1e618a['query']=_['keys'](_0x467efb[_0xae6a('0x37')]);_0x1e618a[_0xae6a('0x94')]=_[_0xae6a('0x3e')](_0x1e618a[_0xae6a('0x3a')],_0x1e618a['query']);_0x2ee7b2['attributes']=_[_0xae6a('0x3e')](_0x1e618a[_0xae6a('0x3a')],qs['fields'](_0x467efb[_0xae6a('0x37')][_0xae6a('0x3f')]));_0x2ee7b2[_0xae6a('0x3d')]=_0x2ee7b2[_0xae6a('0x3d')][_0xae6a('0x95')]?_0x2ee7b2['attributes']:_0x1e618a[_0xae6a('0x3a')];if(!_0x467efb[_0xae6a('0x37')][_0xae6a('0x96')]('nolimit')){_0x2ee7b2[_0xae6a('0x29')]=qs[_0xae6a('0x29')](_0x467efb[_0xae6a('0x37')][_0xae6a('0x29')]);_0x2ee7b2[_0xae6a('0x26')]=qs['offset'](_0x467efb[_0xae6a('0x37')]['offset']);}_0x2ee7b2[_0xae6a('0xa3')]=qs['sort'](_0x467efb['query'][_0xae6a('0x98')]);_0x2ee7b2['where']=qs[_0xae6a('0x94')](_[_0xae6a('0xa4')](_0x467efb[_0xae6a('0x37')],_0x1e618a[_0xae6a('0x94')]));_0x2ee7b2[_0xae6a('0x99')][_0xae6a('0xa5')]=_0x58b88e['id'];if(_0x467efb['query'][_0xae6a('0x9c')]){_0x2ee7b2[_0xae6a('0x99')]=_[_0xae6a('0x9a')](_0x2ee7b2[_0xae6a('0x99')],{'$or':_['map'](_0x2ee7b2['attributes'],function(_0x2f8472){var _0xf46d66={};_0xf46d66[_0x2f8472]={'$like':'%'+_0x467efb[_0xae6a('0x37')]['filter']+'%'};return _0xf46d66;})});}_0x2ee7b2[_0xae6a('0x99')][_0xae6a('0xa6')]=![];if(_0x467efb[_0xae6a('0x37')]['id']){_0x2ee7b2['where']['id']={'$gt':_0x467efb[_0xae6a('0x37')]['id']};}_0x2ee7b2=_[_0xae6a('0x9a')]({},_0x2ee7b2,_0x467efb[_0xae6a('0x40')]);return db['ChatMessage'][_0xae6a('0x28')]({'where':_0x2ee7b2[_0xae6a('0x99')]})[_0xae6a('0x17')](function(_0x42dd4e){_0x1a0101['count']=_0x42dd4e;_0x2ee7b2[_0xae6a('0xa0')]=[];if(_0x467efb[_0xae6a('0x37')][_0xae6a('0xa7')]){_0x2ee7b2[_0xae6a('0xa0')]['push']({'model':db[_0xae6a('0x78')],'as':_0xae6a('0x78'),'attributes':['id',_0xae6a('0x4c'),_0xae6a('0x81')]});}if(_0x467efb['query'][_0xae6a('0xa8')]){_0x2ee7b2[_0xae6a('0xa0')]=[{'all':!![]}];}return db[_0xae6a('0x59')][_0xae6a('0x35')](_0x2ee7b2);})[_0xae6a('0x17')](function(_0x30737d){_0x1a0101['rows']=_0x30737d;return _0x1a0101;});}})['then'](respondWithFilteredResult(_0x46b413,_0x2ee7b2))[_0xae6a('0x21')](handleError(_0x46b413,null));};exports[_0xae6a('0xa9')]=function(_0x2bfc9a,_0x2bafb3){return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0x2bfc9a[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x2bafb3,null))[_0xae6a('0x17')](function(_0x85d6c5){if(_0x85d6c5){return _0x85d6c5['setTags'](_0x2bfc9a[_0xae6a('0x2d')][_0xae6a('0x92')],_['omit'](_0x2bfc9a[_0xae6a('0x2d')],['ids','id'])||{})[_0xae6a('0xaa')](function(){return db[_0xae6a('0xab')][_0xae6a('0x35')]({'attributes':['id',_0xae6a('0x2b'),_0xae6a('0xac')],'where':{'id':_0x2bfc9a[_0xae6a('0x2d')][_0xae6a('0x92')]}});})[_0xae6a('0x17')](function(_0x324adb){socket[_0xae6a('0xad')](_0xae6a('0xae'),{'id':Number(_0x2bfc9a['params']['id']),'tags':_0x324adb||[]});return{'id':Number(_0x2bfc9a['params']['id']),'tags':_0x324adb||[]};});}})[_0xae6a('0x17')](respondWithResult(_0x2bafb3,null))['catch'](handleError(_0x2bafb3,null));};exports[_0xae6a('0xaf')]=function(_0x354a3b,_0x246434){return db['ChatInteraction'][_0xae6a('0x41')]({'where':{'id':_0x354a3b[_0xae6a('0x43')]['id']}})[_0xae6a('0x17')](handleEntityNotFound(_0x246434,null))[_0xae6a('0x17')](function(_0x250ddb){if(_0x250ddb){return _0x250ddb[_0xae6a('0xaf')](_0x354a3b[_0xae6a('0x37')][_0xae6a('0x92')]);}})['then'](respondWithStatusCode(_0x246434,null))['catch'](handleError(_0x246434,null));};exports['download']=function(_0x585885,_0x16e591){var _0xcede78=moment()[_0xae6a('0xb0')]()[_0xae6a('0xb1')]();var _0x4b6e9d=path['join'](config[_0xae6a('0x6e')],'server','files','tmp');var _0x52be63=path[_0xae6a('0x70')](config[_0xae6a('0x6e')],_0xae6a('0xb2'),_0xae6a('0xb3'),_0xae6a('0xb4'));var _0x317b65=path['join'](_0x4b6e9d,_0xcede78);var _0x12c801=util[_0xae6a('0x7a')](_0xae6a('0xb5'),_0x585885[_0xae6a('0x43')]['id'],_0xcede78);var _0x105860=path[_0xae6a('0x70')](_0x4b6e9d,_0x12c801);var _0x3bcf83=[];_0x3bcf83[_0xae6a('0xb6')]({'model':db[_0xae6a('0x78')],'as':'User','attributes':['id',_0xae6a('0x4c')],'raw':!![]});_0x3bcf83[_0xae6a('0xb6')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xae6a('0xb7'),_0xae6a('0xb8')],'raw':!![]});if(_0x585885[_0xae6a('0x37')][_0xae6a('0xb4')]){_0x3bcf83['push']({'model':db[_0xae6a('0x6a')],'as':'Attachment','raw':!![]});}var _0x5eba4b=[{'model':db[_0xae6a('0x59')],'as':_0xae6a('0x77'),'attributes':['id','body','createdAt',_0xae6a('0x85'),_0xae6a('0xa6'),_0xae6a('0xb9')],'include':_0x3bcf83}];_0x5eba4b['push']({'model':db[_0xae6a('0xba')],'as':_0xae6a('0xbb'),'attributes':['id',_0xae6a('0x2b')]});_0x5eba4b[_0xae6a('0xb6')]({'model':db['User'],'as':_0xae6a('0xbc'),'attributes':['id',_0xae6a('0x4c')]});return db[_0xae6a('0x3b')][_0xae6a('0x41')]({'where':{'id':_0x585885[_0xae6a('0x43')]['id']},'include':_0x5eba4b})[_0xae6a('0x17')](handleEntityNotFound(_0x16e591,null))[_0xae6a('0x17')](function(_0x5d0f25){if(_0x5d0f25){var _0x308352=_0x5d0f25['get']({'plain':!![]});fs[_0xae6a('0xbd')](_0x317b65);var _0x2a6113={'channel':_0xae6a('0xbe'),'account':_0x308352['Account']['name'],'agent':_0x308352[_0xae6a('0xbc')]?_0x308352[_0xae6a('0xbc')]['fullname']:'N.A.','createdAt':moment(_0x308352[_0xae6a('0xbf')])[_0xae6a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xae6a('0xb1')](),'closedAt':_0x308352[_0xae6a('0x6b')]?moment(_0x308352[_0xae6a('0xc0')])[_0xae6a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xae6a('0xb1')]():'','disposition':_0x308352['disposition'],'chatInfo':{'browser':_0x308352['browserName'],'os':_0x308352[_0xae6a('0xc1')],'referer':_0x308352[_0xae6a('0xc2')],'customerIp':_0x308352[_0xae6a('0xc3')],'customerPort':_0x308352[_0xae6a('0xc4')]?_0x308352[_0xae6a('0xc4')]:_0xae6a('0xc5')},'messages':_(_0x308352['Messages'])[_0xae6a('0xc6')]()['filter']({'secret':![]})['map'](function(_0x48d949){if(_0x48d949[_0xae6a('0x6a')]){var _0x28af58=path[_0xae6a('0x70')](_0x52be63,_0x48d949[_0xae6a('0x6a')][_0xae6a('0x67')]);if(fs[_0xae6a('0xc7')](_0x28af58)){fs['createReadStream'](_0x28af58)[_0xae6a('0xc8')](fs['createWriteStream'](path['join'](_0x317b65,_0x48d949[_0xae6a('0x6a')][_0xae6a('0x67')])));}}return{'date':moment(_0x48d949['createdAt'])[_0xae6a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xae6a('0xb1')](),'sender':_0x48d949[_0xae6a('0x85')]===_0xae6a('0xc9')?_0x48d949['User']?_0x48d949[_0xae6a('0x78')][_0xae6a('0x4c')]:_0xae6a('0x80'):_0x48d949[_0xae6a('0xca')][_0xae6a('0xb7')]+(_0x48d949[_0xae6a('0xca')][_0xae6a('0xb8')]?'\x20'+_0x48d949[_0xae6a('0xca')][_0xae6a('0xb8')]:''),'body':_0x48d949[_0xae6a('0x6a')]?_0x48d949[_0xae6a('0x6a')][_0xae6a('0x67')]:_0x48d949[_0xae6a('0x2d')],'direction':_0x48d949['direction']===_0xae6a('0xc9')?'A':'C','secret':_0x48d949[_0xae6a('0xa6')],'read':_0x48d949[_0xae6a('0xb9')],'attachment':_0x48d949['Attachment']};})[_0xae6a('0xcb')]()};return ejs[_0xae6a('0xcc')](path[_0xae6a('0x70')](config[_0xae6a('0x6e')],_0xae6a('0xb2'),_0xae6a('0xcd'),_0xae6a('0xce')),{'interaction':_0x2a6113})['then'](function(_0x324b90){var _0x575dfe=path[_0xae6a('0x70')](_0x317b65,_0xae6a('0xcf')+_0x308352['id']+'-'+_0xcede78+'.pdf');var _0x3024df={'path':_0x575dfe,'channel':_0xae6a('0xbe'),'interactionId':_0x308352['id']};return pdf[_0xae6a('0xd0')](_0x324b90,_0x3024df);})[_0xae6a('0x17')](function(){return new Promise(function(_0x4af8bd,_0x2721d3){zipdir(_0x317b65,{'saveTo':_0x105860},function(_0x4fea87,_0x2a9af6){if(_0x4fea87)return _0x2721d3(_0x4fea87);return _0x4af8bd(_0x2a9af6);});})['then'](function(){return new BPromise(function(_0x282223,_0x2ccf18){rimraf(_0x317b65,function(_0x41dfee){if(_0x41dfee)_0x2ccf18(_0x41dfee);return _0x282223();});});})[_0xae6a('0x17')](function(){return _0x16e591[_0xae6a('0x72')](_0x105860,_0x12c801,function(_0x2ff712){if(_0x2ff712){logger[_0xae6a('0x1d')](_0xae6a('0xd1'),_0x2ff712);}else{fs[_0xae6a('0xd2')](_0x105860);}});});});}else{return _0x16e591[_0xae6a('0x22')](0xc8);}})[_0xae6a('0x21')](handleError(_0x16e591,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 8a29c1d..a5c3a6d 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 _0xd563=['update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x74e673,_0x15b0c7){var _0x479ed8=function(_0x2f5e98){while(--_0x2f5e98){_0x74e673['push'](_0x74e673['shift']());}};_0x479ed8(++_0x15b0c7);}(_0xd563,0x182));var _0x3d56=function(_0x5670f2,_0x1ce340){_0x5670f2=_0x5670f2-0x0;var _0x1f8715=_0xd563[_0x5670f2];return _0x1f8715;};'use strict';var EventEmitter=require(_0x3d56('0x0'));var ChatInteraction=require(_0x3d56('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x3d56('0x1'))['db'][_0x3d56('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3d56('0x3')](0x0);var events={'afterCreate':_0x3d56('0x4'),'afterUpdate':_0x3d56('0x5'),'afterDestroy':_0x3d56('0x6')};function emitEvent(_0x13642a){return function(_0x57fad5,_0x5f2f77,_0x58bc46){_0x57fad5[_0x3d56('0x7')]({'attributes':['id'],'raw':!![]})[_0x3d56('0x8')](function(_0x17572f){_0x57fad5[_0x3d56('0x9')](_0x3d56('0xa'),_0x17572f['map'](function(_0x1179db){return{'id':_0x1179db['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x57fad5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d56('0x8')](function(_0x215aed){_0x57fad5['setDataValue'](_0x3d56('0xb'),_0x215aed[_0x3d56('0xc')]);ChatInteractionEvents[_0x3d56('0xd')](_0x13642a+':'+_0x57fad5['id'],_0x57fad5);ChatInteractionEvents[_0x3d56('0xd')](_0x13642a,_0x57fad5);_0x58bc46(null);})[_0x3d56('0xe')](_0x58bc46(null));};}for(var e in events){if(events[_0x3d56('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x3d56('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xca2b=['getUsers','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','save','update','remove'];(function(_0x575006,_0x26719a){var _0x183b83=function(_0x488b77){while(--_0x488b77){_0x575006['push'](_0x575006['shift']());}};_0x183b83(++_0x26719a);}(_0xca2b,0x8a));var _0xbca2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xca2b[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xbca2('0x0'));var ChatInteraction=require(_0xbca2('0x1'))['db'][_0xbca2('0x2')];var ChatMessage=require(_0xbca2('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbca2('0x3'),'afterUpdate':_0xbca2('0x4'),'afterDestroy':_0xbca2('0x5')};function emitEvent(_0x4fe21b){return function(_0xd54425,_0x43cacf,_0x567b50){_0xd54425[_0xbca2('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9011ef){_0xd54425['setDataValue']('Users',_0x9011ef[_0xbca2('0x7')](function(_0x543c0f){return{'id':_0x543c0f['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xd54425['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x6643df){_0xd54425[_0xbca2('0x8')](_0xbca2('0x9'),_0x6643df[_0xbca2('0xa')]);ChatInteractionEvents[_0xbca2('0xb')](_0x4fe21b+':'+_0xd54425['id'],_0xd54425);ChatInteractionEvents[_0xbca2('0xb')](_0x4fe21b,_0xd54425);_0x567b50(null);})[_0xbca2('0xc')](_0x567b50(null));};}for(var e in events){if(events[_0xbca2('0xd')](e)){var event=events[e];ChatInteraction[_0xbca2('0xe')](e,emitEvent(event));}}module[_0xbca2('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index d2d8050..825e8e7 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 _0xb5d3=['path','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x366783,_0x339fd8){var _0x3562b7=function(_0x29b013){while(--_0x29b013){_0x366783['push'](_0x366783['shift']());}};_0x3562b7(++_0x339fd8);}(_0xb5d3,0xa2));var _0x3b5d=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0xb5d3[_0x2e913b];return _0x173899;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3b5d('0x0'))(_0x3b5d('0x1'));var moment=require(_0x3b5d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b5d('0x3'));var rimraf=require(_0x3b5d('0x4'));var config=require('../../config/environment');var attributes=require(_0x3b5d('0x5'));module['exports']=function(_0x510b41,_0x15a7ad){return _0x510b41[_0x3b5d('0x6')](_0x3b5d('0x7'),attributes,{'tableName':_0x3b5d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51d9d4,_0x2966ef,_0x3d2cf0){if(_0x51d9d4['changed'](_0x3b5d('0x9'))){_0x51d9d4[_0x3b5d('0xa')]=moment()[_0x3b5d('0xb')](_0x3b5d('0xc'));}_0x3d2cf0(null,_0x51d9d4);}},'charset':_0x3b5d('0xd'),'collate':_0x3b5d('0xe')});};
\ No newline at end of file
+var _0x3f8c=['api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3f8c,0x1a6));var _0xc3f8=function(_0x5796a6,_0x20267a){_0x5796a6=_0x5796a6-0x0;var _0x1370da=_0x3f8c[_0x5796a6];return _0x1370da;};'use strict';var _=require(_0xc3f8('0x0'));var util=require(_0xc3f8('0x1'));var logger=require(_0xc3f8('0x2'))(_0xc3f8('0x3'));var moment=require(_0xc3f8('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3f8('0x5'));var fs=require('fs');var path=require(_0xc3f8('0x6'));var rimraf=require('rimraf');var config=require(_0xc3f8('0x7'));var attributes=require(_0xc3f8('0x8'));module[_0xc3f8('0x9')]=function(_0x53ca64,_0x555dcb){return _0x53ca64[_0xc3f8('0xa')](_0xc3f8('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x228893,_0x110afe,_0x3ce100){if(_0x228893['changed'](_0xc3f8('0xc'))){_0x228893[_0xc3f8('0xd')]=moment()[_0xc3f8('0xe')](_0xc3f8('0xf'));}_0x3ce100(null,_0x228893);}},'charset':_0xc3f8('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index cbfff7f..fc78229 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 _0x1117=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46ef1d,_0x24926){var _0x49ce69=function(_0x5db4fc){while(--_0x5db4fc){_0x46ef1d['push'](_0x46ef1d['shift']());}};_0x49ce69(++_0x24926);}(_0x1117,0x117));var _0x7111=function(_0x458eef,_0x551783){_0x458eef=_0x458eef-0x0;var _0x2fb384=_0x1117[_0x458eef];return _0x2fb384;};'use strict';var _=require('lodash');var util=require(_0x7111('0x0'));var moment=require(_0x7111('0x1'));var BPromise=require(_0x7111('0x2'));var rs=require(_0x7111('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7111('0x4'))['db'];var utils=require(_0x7111('0x5'));var logger=require('../../config/logger')(_0x7111('0x6'));var config=require(_0x7111('0x7'));var jayson=require(_0x7111('0x8'));var client=jayson[_0x7111('0x9')][_0x7111('0xa')]({'port':0x232a});config[_0x7111('0xb')]=_[_0x7111('0xc')](config[_0x7111('0xb')],{'host':_0x7111('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7111('0xb')]));require(_0x7111('0xe'))[_0x7111('0xf')](socket);function respondWithRpcPromise(_0x22794c,_0xfb969c,_0x1f3988){return new BPromise(function(_0x39e9d7,_0x16549e){return client[_0x7111('0x10')](_0x22794c,_0x1f3988)[_0x7111('0x11')](function(_0x157181){logger[_0x7111('0x12')](_0x7111('0x13'),_0xfb969c,_0x7111('0x14'));logger[_0x7111('0x15')](_0x7111('0x16'),_0xfb969c,_0x7111('0x14'),JSON[_0x7111('0x17')](_0x157181));if(_0x157181[_0x7111('0x18')]){if(_0x157181[_0x7111('0x18')][_0x7111('0x19')]===0x1f4){logger[_0x7111('0x18')](_0x7111('0x13'),_0xfb969c,_0x157181[_0x7111('0x18')]['message']);return _0x16549e(_0x157181[_0x7111('0x18')][_0x7111('0x1a')]);}logger['error'](_0x7111('0x13'),_0xfb969c,_0x157181[_0x7111('0x18')][_0x7111('0x1a')]);return _0x39e9d7(_0x157181[_0x7111('0x18')][_0x7111('0x1a')]);}else{logger[_0x7111('0x12')](_0x7111('0x13'),_0xfb969c,_0x7111('0x14'));_0x39e9d7(_0x157181[_0x7111('0x1b')][_0x7111('0x1a')]);}})['catch'](function(_0x45cde5){logger[_0x7111('0x18')](_0x7111('0x13'),_0xfb969c,_0x45cde5);_0x16549e(_0x45cde5);});});}exports[_0x7111('0x1c')]=function(_0x3f620e){var _0x29e27b=this;return new Promise(function(_0x346579,_0x250bd0){return db[_0x7111('0x1d')][_0x7111('0x1e')](_0x3f620e[_0x7111('0x1f')],{'raw':_0x3f620e[_0x7111('0x20')]?_0x3f620e[_0x7111('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f620e[_0x7111('0x20')]?_0x3f620e['options'][_0x7111('0x21')]||null:null,'attributes':_0x3f620e[_0x7111('0x20')]?_0x3f620e[_0x7111('0x20')][_0x7111('0x22')]||null:null,'limit':_0x3f620e['options']?_0x3f620e[_0x7111('0x20')][_0x7111('0x23')]||null:null})[_0x7111('0x11')](function(_0x1bca1f){logger[_0x7111('0x12')](_0x7111('0x1c'),_0x3f620e);logger['debug'](_0x7111('0x1c'),_0x3f620e,JSON['stringify'](_0x1bca1f));_0x346579(_0x1bca1f);})[_0x7111('0x24')](function(_0x251f22){logger['error'](_0x7111('0x1c'),_0x251f22[_0x7111('0x1a')],_0x3f620e);_0x250bd0(_0x29e27b[_0x7111('0x18')](0x1f4,_0x251f22['message']));});});};exports[_0x7111('0x25')]=function(_0x1f3f30){return new Promise(function(_0x278afa,_0x9ad464){return db['ChatInteraction'][_0x7111('0x26')]({'where':_0x1f3f30[_0x7111('0x20')]?_0x1f3f30[_0x7111('0x20')][_0x7111('0x21')]||null:null})[_0x7111('0x11')](function(_0x24277d){if(_0x24277d){return _0x24277d[_0x7111('0x27')](_0x1f3f30[_0x7111('0x1f')][_0x7111('0x28')],_[_0x7111('0x29')](_0x1f3f30[_0x7111('0x1f')],[_0x7111('0x28'),'id'])||{});}})['spread'](function(_0xfcfd8d){logger[_0x7111('0x12')](_0x7111('0x2a'),_0x1f3f30);logger[_0x7111('0x15')](_0x7111('0x2a'),_0x1f3f30,JSON[_0x7111('0x17')](_0xfcfd8d));_0x278afa(_0xfcfd8d);})[_0x7111('0x24')](function(_0x39df17){logger[_0x7111('0x18')](_0x7111('0x2a'),_0x39df17[_0x7111('0x1a')],_0x1f3f30);_0x9ad464(_this[_0x7111('0x18')](0x1f4,_0x39df17[_0x7111('0x1a')]));});});};
\ No newline at end of file
+var _0xfa89=['message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','where','attributes','stringify','AddTagsToChatInteraction','find','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s'];(function(_0x1833e7,_0x37bda7){var _0x37ee75=function(_0x5b8a59){while(--_0x5b8a59){_0x1833e7['push'](_0x1833e7['shift']());}};_0x37ee75(++_0x37bda7);}(_0xfa89,0xa7));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9fa8('0x0'));var moment=require(_0x9fa8('0x1'));var BPromise=require(_0x9fa8('0x2'));var rs=require(_0x9fa8('0x3'));var fs=require('fs');var Redis=require(_0x9fa8('0x4'));var db=require(_0x9fa8('0x5'))['db'];var utils=require(_0x9fa8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fa8('0x7'));var jayson=require(_0x9fa8('0x8'));var client=jayson['client'][_0x9fa8('0x9')]({'port':0x232a});config[_0x9fa8('0xa')]=_[_0x9fa8('0xb')](config[_0x9fa8('0xa')],{'host':_0x9fa8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fa8('0xa')]));require(_0x9fa8('0xd'))[_0x9fa8('0xe')](socket);function respondWithRpcPromise(_0x951e87,_0x2b68c1,_0x334fdd){return new BPromise(function(_0xee411b,_0x9cd50f){return client[_0x9fa8('0xf')](_0x951e87,_0x334fdd)[_0x9fa8('0x10')](function(_0x551ff9){logger[_0x9fa8('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x2b68c1,_0x9fa8('0x12'));logger[_0x9fa8('0x13')](_0x9fa8('0x14'),_0x2b68c1,_0x9fa8('0x12'),JSON['stringify'](_0x551ff9));if(_0x551ff9['error']){if(_0x551ff9['error']['code']===0x1f4){logger[_0x9fa8('0x15')](_0x9fa8('0x16'),_0x2b68c1,_0x551ff9[_0x9fa8('0x15')][_0x9fa8('0x17')]);return _0x9cd50f(_0x551ff9[_0x9fa8('0x15')][_0x9fa8('0x17')]);}logger[_0x9fa8('0x15')](_0x9fa8('0x16'),_0x2b68c1,_0x551ff9['error'][_0x9fa8('0x17')]);return _0xee411b(_0x551ff9['error']['message']);}else{logger[_0x9fa8('0x11')](_0x9fa8('0x16'),_0x2b68c1,'request\x20sent');_0xee411b(_0x551ff9[_0x9fa8('0x18')][_0x9fa8('0x17')]);}})[_0x9fa8('0x19')](function(_0x11ca25){logger['error'](_0x9fa8('0x16'),_0x2b68c1,_0x11ca25);_0x9cd50f(_0x11ca25);});});}exports[_0x9fa8('0x1a')]=function(_0x52f2cd){var _0x396147=this;return new Promise(function(_0x3a726a,_0x491767){return db[_0x9fa8('0x1b')]['update'](_0x52f2cd[_0x9fa8('0x1c')],{'raw':_0x52f2cd[_0x9fa8('0x1d')]?_0x52f2cd[_0x9fa8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52f2cd[_0x9fa8('0x1d')]?_0x52f2cd[_0x9fa8('0x1d')][_0x9fa8('0x1e')]||null:null,'attributes':_0x52f2cd[_0x9fa8('0x1d')]?_0x52f2cd[_0x9fa8('0x1d')][_0x9fa8('0x1f')]||null:null,'limit':_0x52f2cd['options']?_0x52f2cd[_0x9fa8('0x1d')]['limit']||null:null})[_0x9fa8('0x10')](function(_0x4e3c95){logger[_0x9fa8('0x11')]('UpdateChatInteraction',_0x52f2cd);logger[_0x9fa8('0x13')](_0x9fa8('0x1a'),_0x52f2cd,JSON[_0x9fa8('0x20')](_0x4e3c95));_0x3a726a(_0x4e3c95);})[_0x9fa8('0x19')](function(_0x470b6e){logger[_0x9fa8('0x15')](_0x9fa8('0x1a'),_0x470b6e[_0x9fa8('0x17')],_0x52f2cd);_0x491767(_0x396147[_0x9fa8('0x15')](0x1f4,_0x470b6e[_0x9fa8('0x17')]));});});};exports[_0x9fa8('0x21')]=function(_0x4f84d7){return new Promise(function(_0xa7e9e9,_0x78b12d){return db[_0x9fa8('0x1b')][_0x9fa8('0x22')]({'where':_0x4f84d7[_0x9fa8('0x1d')]?_0x4f84d7['options'][_0x9fa8('0x1e')]||null:null})[_0x9fa8('0x10')](function(_0x4d6711){if(_0x4d6711){return _0x4d6711['addTags'](_0x4f84d7[_0x9fa8('0x1c')]['ids'],_['omit'](_0x4f84d7[_0x9fa8('0x1c')],[_0x9fa8('0x23'),'id'])||{});}})[_0x9fa8('0x24')](function(_0x215867){logger['info'](_0x9fa8('0x25'),_0x4f84d7);logger['debug']('AddTags',_0x4f84d7,JSON[_0x9fa8('0x20')](_0x215867));_0xa7e9e9(_0x215867);})[_0x9fa8('0x19')](function(_0x5d825a){logger['error'](_0x9fa8('0x25'),_0x5d825a[_0x9fa8('0x17')],_0x4f84d7);_0x78b12d(_this['error'](0x1f4,_0x5d825a['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0db110e..c88067b 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 _0x5d9d=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x3c7db0,_0x5a8f48){var _0x4e1435=function(_0x5367fe){while(--_0x5367fe){_0x3c7db0['push'](_0x3c7db0['shift']());}};_0x4e1435(++_0x5a8f48);}(_0x5d9d,0x101));var _0xd5d9=function(_0x4c3f98,_0x30a8a6){_0x4c3f98=_0x4c3f98-0x0;var _0x54612c=_0x5d9d[_0x4c3f98];return _0x54612c;};'use strict';var ChatInteractionEvents=require(_0xd5d9('0x0'));var events=[_0xd5d9('0x1'),_0xd5d9('0x2'),_0xd5d9('0x3')];function createListener(_0x1c1b10,_0x21a891){return function(_0x5ea221){_0x21a891[_0xd5d9('0x4')](_0x1c1b10,_0x5ea221);};}function removeListener(_0x2bc6a1,_0x44f8e2){return function(){ChatInteractionEvents[_0xd5d9('0x5')](_0x2bc6a1,_0x44f8e2);};}exports[_0xd5d9('0x6')]=function(_0x1233dc){for(var _0x2c489e=0x0,_0x3833fe=events[_0xd5d9('0x7')];_0x2c489e<_0x3833fe;_0x2c489e++){var _0x211416=events[_0x2c489e];var _0x2a673a=createListener('chatInteraction:'+_0x211416,_0x1233dc);ChatInteractionEvents['on'](_0x211416,_0x2a673a);}};
\ No newline at end of file
+var _0x7eea=['./chatInteraction.events','save','remove','update','emit','removeListener','chatInteraction:'];(function(_0x2849f5,_0x5d2c3f){var _0x2aa0e4=function(_0xb415a7){while(--_0xb415a7){_0x2849f5['push'](_0x2849f5['shift']());}};_0x2aa0e4(++_0x5d2c3f);}(_0x7eea,0x7e));var _0xa7ee=function(_0x395152,_0x1507a8){_0x395152=_0x395152-0x0;var _0x373b2f=_0x7eea[_0x395152];return _0x373b2f;};'use strict';var ChatInteractionEvents=require(_0xa7ee('0x0'));var events=[_0xa7ee('0x1'),_0xa7ee('0x2'),_0xa7ee('0x3')];function createListener(_0x2a6a72,_0xda5fc6){return function(_0xe2ecac){_0xda5fc6[_0xa7ee('0x4')](_0x2a6a72,_0xe2ecac);};}function removeListener(_0x2779aa,_0xf00933){return function(){ChatInteractionEvents[_0xa7ee('0x5')](_0x2779aa,_0xf00933);};}exports['register']=function(_0x2c726c){for(var _0x3f3417=0x0,_0x35d130=events['length'];_0x3f3417<_0x35d130;_0x3f3417++){var _0x55adc4=events[_0x3f3417];var _0x3c18e5=createListener(_0xa7ee('0x6')+_0x55adc4,_0x2c726c);ChatInteractionEvents['on'](_0x55adc4,_0x3c18e5);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 765c7b9..758d389 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 _0xb983=['tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','originalname','replace','single','file','attachmentUpload','/:id/tags'];(function(_0x44d9f8,_0xd9f940){var _0x310b84=function(_0x5f3990){while(--_0x5f3990){_0x44d9f8['push'](_0x44d9f8['shift']());}};_0x310b84(++_0xd9f940);}(_0xb983,0xdb));var _0x3b98=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xb983[_0x5447aa];return _0xb21e53;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3b98('0x0'));var timeout=require(_0x3b98('0x1'));var express=require(_0x3b98('0x2'));var router=express[_0x3b98('0x3')]();var fs_extra=require(_0x3b98('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3b98('0x5'));var config=require(_0x3b98('0x6'));var controller=require(_0x3b98('0x7'));router[_0x3b98('0x8')]('/',auth[_0x3b98('0x9')](),controller[_0x3b98('0xa')]);router['get'](_0x3b98('0xb'),auth[_0x3b98('0x9')](),controller['describe']);router['get'](_0x3b98('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x3b98('0xd')]);router[_0x3b98('0x8')](_0x3b98('0xe'),auth[_0x3b98('0xf')](),controller[_0x3b98('0x10')]);router['get'](_0x3b98('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x3b98('0x8')](_0x3b98('0x12'),auth[_0x3b98('0xf')](),controller[_0x3b98('0x13')]);router[_0x3b98('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x3b98('0x14')]);router[_0x3b98('0x15')]('/',auth[_0x3b98('0x9')](),controller[_0x3b98('0x16')]);router[_0x3b98('0x15')](_0x3b98('0x17'),auth['isAuthenticated'](),controller[_0x3b98('0x18')]);var upload=multer({'storage':multer[_0x3b98('0x19')]({'destination':function(_0x543741,_0x2b89ec,_0x1d0969){_0x1d0969(null,path['join'](config[_0x3b98('0x1a')],_0x3b98('0x1b')));},'filename':function(_0x30c44d,_0x304bbf,_0xb06b40){_0xb06b40(null,util[_0x3b98('0x1c')]('%s-%s',Date[_0x3b98('0x1d')](),_0x304bbf[_0x3b98('0x1e')][_0x3b98('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3b98('0x15')]('/:id/attachment_upload',upload[_0x3b98('0x20')](_0x3b98('0x21')),controller[_0x3b98('0x22')]);router['post']('/:id/messages',auth[_0x3b98('0xf')](),controller['addMessage']);router['post'](_0x3b98('0x23'),auth[_0x3b98('0x9')](),interaction[_0x3b98('0x24')](_0x3b98('0x25'),_0x3b98('0x26')),controller[_0x3b98('0x27')]);router['put']('/:id',auth[_0x3b98('0x9')](),interaction[_0x3b98('0x24')](_0x3b98('0x25'),'chatinteraction:update'),controller['update']);router[_0x3b98('0x28')](_0x3b98('0x29'),controller[_0x3b98('0x2a')]);router[_0x3b98('0x28')](_0x3b98('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x3b98('0x2c')]);router[_0x3b98('0x28')](_0x3b98('0x2d'),controller[_0x3b98('0x2e')]);router[_0x3b98('0x2f')]('/:id',auth[_0x3b98('0x9')](),interaction[_0x3b98('0x24')]('chat',_0x3b98('0x30')),controller[_0x3b98('0x31')]);router['delete'](_0x3b98('0x23'),auth['isAuthenticated'](),controller['removeTags']);module[_0x3b98('0x32')]=router;
\ No newline at end of file
+var _0x46b0=['%s-%s','now','replace','single','file','addMessage','/:id/tags','tracked','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chat','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/'];(function(_0x4a0a02,_0x4c8dc5){var _0x2beac7=function(_0x32b784){while(--_0x32b784){_0x4a0a02['push'](_0x4a0a02['shift']());}};_0x2beac7(++_0x4c8dc5);}(_0x46b0,0x1bf));var _0x046b=function(_0x4cf252,_0x6c073e){_0x4cf252=_0x4cf252-0x0;var _0x16b1e5=_0x46b0[_0x4cf252];return _0x16b1e5;};'use strict';var multer=require(_0x046b('0x0'));var util=require(_0x046b('0x1'));var path=require('path');var timeout=require(_0x046b('0x2'));var express=require(_0x046b('0x3'));var router=express[_0x046b('0x4')]();var fs_extra=require(_0x046b('0x5'));var auth=require(_0x046b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x046b('0x7'));var controller=require(_0x046b('0x8'));router[_0x046b('0x9')]('/',auth[_0x046b('0xa')](),controller[_0x046b('0xb')]);router['get'](_0x046b('0xc'),auth[_0x046b('0xa')](),controller[_0x046b('0xd')]);router[_0x046b('0x9')](_0x046b('0xe'),auth[_0x046b('0xf')](),controller[_0x046b('0x10')]);router[_0x046b('0x9')]('/:id/attachment_download',auth[_0x046b('0xf')](),controller['attachmentDownload']);router[_0x046b('0x9')](_0x046b('0x11'),auth['isAuthenticated'](),controller[_0x046b('0x12')]);router[_0x046b('0x9')](_0x046b('0x13'),auth[_0x046b('0xf')](),controller[_0x046b('0x14')]);router[_0x046b('0x9')](_0x046b('0x15'),auth['isAuthenticated'](),controller[_0x046b('0x16')]);router[_0x046b('0x17')]('/',auth[_0x046b('0xa')](),controller[_0x046b('0x18')]);router['post'](_0x046b('0x19'),auth[_0x046b('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x046b('0x1a')]({'destination':function(_0x1bb762,_0x2f34af,_0x92d44a){_0x92d44a(null,path[_0x046b('0x1b')](config[_0x046b('0x1c')],_0x046b('0x1d')));},'filename':function(_0xa87a95,_0x3dffe5,_0x7267a2){_0x7267a2(null,util['format'](_0x046b('0x1e'),Date[_0x046b('0x1f')](),_0x3dffe5['originalname'][_0x046b('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x046b('0x21')](_0x046b('0x22')),controller['attachmentUpload']);router['post'](_0x046b('0x11'),auth[_0x046b('0xf')](),controller[_0x046b('0x23')]);router[_0x046b('0x17')](_0x046b('0x24'),auth[_0x046b('0xa')](),interaction[_0x046b('0x25')]('chat','chatinteraction:addtags'),controller[_0x046b('0x26')]);router[_0x046b('0x27')](_0x046b('0xe'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x046b('0x28')),controller[_0x046b('0x29')]);router[_0x046b('0x27')](_0x046b('0x2a'),controller[_0x046b('0x2b')]);router['put'](_0x046b('0x2c'),auth[_0x046b('0xf')](),controller['abandon']);router[_0x046b('0x27')](_0x046b('0x2d'),controller[_0x046b('0x2e')]);router[_0x046b('0x2f')]('/:id',auth[_0x046b('0xa')](),interaction[_0x046b('0x25')](_0x046b('0x30'),_0x046b('0x31')),controller[_0x046b('0x32')]);router[_0x046b('0x2f')](_0x046b('0x24'),auth[_0x046b('0xa')](),controller[_0x046b('0x33')]);module[_0x046b('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index e078b77..227d7a2 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 _0x5a80=['TEXT','BOOLEAN','sequelize'];(function(_0x331f32,_0x194684){var _0x462529=function(_0x301e9c){while(--_0x301e9c){_0x331f32['push'](_0x331f32['shift']());}};_0x462529(++_0x194684);}(_0x5a80,0xf5));var _0x05a8=function(_0x2571f6,_0x555e23){_0x2571f6=_0x2571f6-0x0;var _0x24e6d7=_0x5a80[_0x2571f6];return _0x24e6d7;};'use strict';var Sequelize=require(_0x05a8('0x0'));module['exports']={'body':{'type':Sequelize[_0x05a8('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x05a8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x8abb=['TEXT','medium','INTEGER','sequelize'];(function(_0x53433f,_0x3b7cf7){var _0x526c67=function(_0x274519){while(--_0x274519){_0x53433f['push'](_0x53433f['shift']());}};_0x526c67(++_0x3b7cf7);}(_0x8abb,0x9f));var _0xb8ab=function(_0x48ec35,_0x22bbf5){_0x48ec35=_0x48ec35-0x0;var _0x25f526=_0x8abb[_0x48ec35];return _0x25f526;};'use strict';var Sequelize=require(_0xb8ab('0x0'));module['exports']={'body':{'type':Sequelize[_0xb8ab('0x1')](_0xb8ab('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb8ab('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 428c680..4e737c2 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 _0x9d32=['admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','findAll','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','ChatInternalMessage','includeAll','include','rows','catch','params','options','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent'];(function(_0xff1f6a,_0x4f6b5c){var _0x13673a=function(_0x3fd516){while(--_0x3fd516){_0xff1f6a['push'](_0xff1f6a['shift']());}};_0x13673a(++_0x4f6b5c);}(_0x9d32,0xff));var _0x29d3=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x9d32[_0x30abff];return _0x4c571e;};'use strict';var emlformat=require(_0x29d3('0x0'));var rimraf=require(_0x29d3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29d3('0x2'));var rp=require(_0x29d3('0x3'));var moment=require('moment');var BPromise=require(_0x29d3('0x4'));var Mustache=require('mustache');var util=require(_0x29d3('0x5'));var path=require(_0x29d3('0x6'));var sox=require(_0x29d3('0x7'));var csv=require(_0x29d3('0x8'));var ejs=require(_0x29d3('0x9'));var fs=require('fs');var fs_extra=require(_0x29d3('0xa'));var _=require('lodash');var squel=require(_0x29d3('0xb'));var crypto=require(_0x29d3('0xc'));var jsforce=require(_0x29d3('0xd'));var deskjs=require(_0x29d3('0xe'));var toCsv=require(_0x29d3('0x8'));var querystring=require(_0x29d3('0xf'));var Papa=require('papaparse');var Redis=require(_0x29d3('0x10'));var authService=require(_0x29d3('0x11'));var qs=require(_0x29d3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29d3('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x29d3('0x14'));var config=require(_0x29d3('0x15'));var licenseUtil=require(_0x29d3('0x16'));var db=require(_0x29d3('0x17'))['db'];config[_0x29d3('0x18')]=_[_0x29d3('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29d3('0x1a'))(new Redis(config[_0x29d3('0x18')]));require(_0x29d3('0x1b'))[_0x29d3('0x1c')](socket);function respondWithStatusCode(_0x1a97ec,_0x3a8681){_0x3a8681=_0x3a8681||0xcc;return function(_0x260d83){if(_0x260d83){return _0x1a97ec[_0x29d3('0x1d')](_0x3a8681);}return _0x1a97ec[_0x29d3('0x1e')](_0x3a8681)[_0x29d3('0x1f')]();};}function respondWithResult(_0x246138,_0x2705bc){_0x2705bc=_0x2705bc||0xc8;return function(_0x47074c){if(_0x47074c){return _0x246138[_0x29d3('0x1e')](_0x2705bc)[_0x29d3('0x20')](_0x47074c);}};}function respondWithFilteredResult(_0x32aa16,_0x8e2d4b){return function(_0x448912){if(_0x448912){var _0x3564a7=typeof _0x8e2d4b[_0x29d3('0x21')]===_0x29d3('0x22')&&typeof _0x8e2d4b['limit']==='undefined';var _0x19cf2c=_0x448912[_0x29d3('0x23')];var _0x345296=_0x3564a7?0x0:_0x8e2d4b[_0x29d3('0x21')];var _0x3c4090=_0x3564a7?_0x448912[_0x29d3('0x23')]:_0x8e2d4b[_0x29d3('0x21')]+_0x8e2d4b[_0x29d3('0x24')];var _0x325287;if(_0x3c4090>=_0x19cf2c){_0x3c4090=_0x19cf2c;_0x325287=0xc8;}else{_0x325287=0xce;}_0x32aa16['status'](_0x325287);return _0x32aa16[_0x29d3('0x25')](_0x29d3('0x26'),_0x345296+'-'+_0x3c4090+'/'+_0x19cf2c)[_0x29d3('0x20')](_0x448912);}return null;};}function patchUpdates(_0x2b4c60){return function(_0x8c56aa){try{jsonpatch[_0x29d3('0x27')](_0x8c56aa,_0x2b4c60,!![]);}catch(_0x31d4c4){return BPromise[_0x29d3('0x28')](_0x31d4c4);}return _0x8c56aa[_0x29d3('0x29')]();};}function saveUpdates(_0x3a60c0,_0xd1e9dd){return function(_0xaf86bc){if(_0xaf86bc){return _0xaf86bc['update'](_0x3a60c0)[_0x29d3('0x2a')](function(_0x190214){return _0x190214;});}return null;};}function removeEntity(_0x1b0541,_0x5eb7c6){return function(_0x4ae44d){if(_0x4ae44d){return _0x4ae44d[_0x29d3('0x2b')]()[_0x29d3('0x2a')](function(){_0x1b0541[_0x29d3('0x1e')](0xcc)[_0x29d3('0x1f')]();});}};}function handleEntityNotFound(_0x507cdf,_0x463a76){return function(_0x5ee4e8){if(!_0x5ee4e8){_0x507cdf[_0x29d3('0x1d')](0x194);}return _0x5ee4e8;};}function handleError(_0x58df45,_0x1b5833){_0x1b5833=_0x1b5833||0x1f4;return function(_0x43c658){logger[_0x29d3('0x2c')](_0x43c658['stack']);if(_0x43c658[_0x29d3('0x2d')]){delete _0x43c658[_0x29d3('0x2d')];}_0x58df45[_0x29d3('0x1e')](_0x1b5833)['send'](_0x43c658);};}exports[_0x29d3('0x2e')]=function(_0x3b61c9,_0x55fbf0){var _0x1bb61a={},_0x321928={},_0x35970c={'count':0x0,'rows':[]};var _0x4f0b4f=_[_0x29d3('0x2f')](db['ChatInternalMessage'][_0x29d3('0x30')],function(_0x1c0430){return{'name':_0x1c0430[_0x29d3('0x31')],'type':_0x1c0430[_0x29d3('0x32')][_0x29d3('0x33')]};});_0x321928[_0x29d3('0x34')]=_['map'](_0x4f0b4f,'name');_0x321928[_0x29d3('0x35')]=_[_0x29d3('0x36')](_0x3b61c9[_0x29d3('0x35')]);_0x321928[_0x29d3('0x37')]=_[_0x29d3('0x38')](_0x321928[_0x29d3('0x34')],_0x321928[_0x29d3('0x35')]);_0x1bb61a['attributes']=_[_0x29d3('0x38')](_0x321928[_0x29d3('0x34')],qs[_0x29d3('0x39')](_0x3b61c9['query'][_0x29d3('0x39')]));_0x1bb61a[_0x29d3('0x3a')]=_0x1bb61a['attributes'][_0x29d3('0x3b')]?_0x1bb61a[_0x29d3('0x3a')]:_0x321928[_0x29d3('0x34')];if(!_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x3c')](_0x29d3('0x3d'))){_0x1bb61a[_0x29d3('0x24')]=qs[_0x29d3('0x24')](_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x24')]);_0x1bb61a['offset']=qs[_0x29d3('0x21')](_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x21')]);}_0x1bb61a['order']=qs[_0x29d3('0x3e')](_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x3e')]);_0x1bb61a[_0x29d3('0x3f')]=qs[_0x29d3('0x37')](_[_0x29d3('0x40')](_0x3b61c9[_0x29d3('0x35')],_0x321928[_0x29d3('0x37')]),_0x4f0b4f);if(_0x3b61c9[_0x29d3('0x35')]['filter']){_0x1bb61a['where']=_[_0x29d3('0x41')](_0x1bb61a[_0x29d3('0x3f')],{'$or':_['map'](_0x4f0b4f,function(_0x438afb){if(_0x438afb[_0x29d3('0x32')]!==_0x29d3('0x42')){var _0x295708={};_0x295708[_0x438afb[_0x29d3('0x2d')]]={'$like':'%'+_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x43')]+'%'};return _0x295708;}})});}_0x1bb61a=_[_0x29d3('0x41')]({},_0x1bb61a,_0x3b61c9['options']);var _0x4bb49a={'where':_0x1bb61a[_0x29d3('0x3f')]};return db[_0x29d3('0x44')]['count'](_0x4bb49a)[_0x29d3('0x2a')](function(_0x30a637){_0x35970c[_0x29d3('0x23')]=_0x30a637;if(_0x3b61c9[_0x29d3('0x35')][_0x29d3('0x45')]){_0x1bb61a[_0x29d3('0x46')]=[{'all':!![]}];}return db[_0x29d3('0x44')]['findAll'](_0x1bb61a);})[_0x29d3('0x2a')](function(_0x5c9025){_0x35970c[_0x29d3('0x47')]=_0x5c9025;return _0x35970c;})[_0x29d3('0x2a')](respondWithFilteredResult(_0x55fbf0,_0x1bb61a))[_0x29d3('0x48')](handleError(_0x55fbf0,null));};exports['show']=function(_0x491a3d,_0x2a1cdc){var _0x112f9e={'raw':!![],'where':{'id':_0x491a3d[_0x29d3('0x49')]['id']}},_0x5d9b0c={};_0x5d9b0c[_0x29d3('0x34')]=_[_0x29d3('0x36')](db[_0x29d3('0x44')][_0x29d3('0x30')]);_0x5d9b0c['query']=_['keys'](_0x491a3d['query']);_0x5d9b0c[_0x29d3('0x37')]=_[_0x29d3('0x38')](_0x5d9b0c[_0x29d3('0x34')],_0x5d9b0c[_0x29d3('0x35')]);_0x112f9e[_0x29d3('0x3a')]=_[_0x29d3('0x38')](_0x5d9b0c[_0x29d3('0x34')],qs[_0x29d3('0x39')](_0x491a3d['query']['fields']));_0x112f9e[_0x29d3('0x3a')]=_0x112f9e[_0x29d3('0x3a')][_0x29d3('0x3b')]?_0x112f9e[_0x29d3('0x3a')]:_0x5d9b0c[_0x29d3('0x34')];if(_0x491a3d['query'][_0x29d3('0x45')]){_0x112f9e['include']=[{'all':!![]}];}_0x112f9e=_[_0x29d3('0x41')]({},_0x112f9e,_0x491a3d[_0x29d3('0x4a')]);return db[_0x29d3('0x44')]['find'](_0x112f9e)[_0x29d3('0x2a')](handleEntityNotFound(_0x2a1cdc,null))[_0x29d3('0x2a')](respondWithResult(_0x2a1cdc,null))['catch'](handleError(_0x2a1cdc,null));};exports['create']=function(_0x18331e,_0x2bcb31){return db[_0x29d3('0x44')][_0x29d3('0x4b')](_0x18331e[_0x29d3('0x4c')],{})[_0x29d3('0x2a')](respondWithResult(_0x2bcb31,0xc9))[_0x29d3('0x48')](handleError(_0x2bcb31,null));};exports[_0x29d3('0x4d')]=function(_0x4b2423,_0x1abb7a){if(_0x4b2423[_0x29d3('0x4c')]['id']){delete _0x4b2423[_0x29d3('0x4c')]['id'];}return db[_0x29d3('0x44')][_0x29d3('0x4e')]({'where':{'id':_0x4b2423[_0x29d3('0x49')]['id']}})[_0x29d3('0x2a')](handleEntityNotFound(_0x1abb7a,null))[_0x29d3('0x2a')](saveUpdates(_0x4b2423[_0x29d3('0x4c')],null))[_0x29d3('0x2a')](respondWithResult(_0x1abb7a,null))[_0x29d3('0x48')](handleError(_0x1abb7a,null));};exports['destroy']=function(_0x3ecd70,_0x249ade){return db[_0x29d3('0x44')][_0x29d3('0x4e')]({'where':{'id':_0x3ecd70[_0x29d3('0x49')]['id']}})['then'](handleEntityNotFound(_0x249ade,null))[_0x29d3('0x2a')](removeEntity(_0x249ade,null))[_0x29d3('0x48')](handleError(_0x249ade,null));};exports[_0x29d3('0x4f')]=function(_0xdc8d4,_0x4fea19){return db[_0x29d3('0x44')][_0x29d3('0x4f')]()[_0x29d3('0x2a')](respondWithResult(_0x4fea19,null))[_0x29d3('0x48')](handleError(_0x4fea19,null));};function wrapUser(_0x38e909){return function(_0x1c297d){var _0x3048c7=_0x38e909[_0x29d3('0x50')]({'plain':!![]});_0x3048c7[_0x29d3('0x51')]=[];if(_0x1c297d){_0x3048c7[_0x29d3('0x52')]=_0x1c297d[_0x29d3('0x53')];_0x3048c7['lastMessage']=_0x1c297d;}else{_0x3048c7[_0x29d3('0x52')]=moment(0x0)[_0x29d3('0x54')](_0x29d3('0x55'));_0x3048c7[_0x29d3('0x56')]={};}return _0x3048c7;};}exports[_0x29d3('0x57')]=function(_0x83be9e,_0x5ba7e9,_0x288757){var _0x316a33=[];return db[_0x29d3('0x58')]['findAll']({'where':{'role':[_0x29d3('0x59'),_0x29d3('0x5a'),'user']},'attributes':['id',_0x29d3('0x5b'),'name',_0x29d3('0x5c'),_0x29d3('0x5d'),_0x29d3('0x5e'),_0x29d3('0x5f'),_0x29d3('0x60'),_0x29d3('0x61'),_0x29d3('0x62')],'order':qs[_0x29d3('0x3e')](_0x29d3('0x63')),'include':[{'model':db[_0x29d3('0x64')],'as':'VoiceQueues','attributes':['id',_0x29d3('0x2d'),_0x29d3('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x2ee61c){if(_0x2ee61c){var _0x12e6ba=_0x83be9e[_0x29d3('0x65')][_0x29d3('0x50')]({'plain':!![]});if(!_0x12e6ba)throw new Error(_0x29d3('0x66'));if(_0x12e6ba[_0x29d3('0x5c')]==='user'){return db[_0x29d3('0x67')]['find']({'where':{'name':_0x29d3('0x68'),'userProfileId':_0x12e6ba[_0x29d3('0x69')]},'raw':!![]})[_0x29d3('0x2a')](function(_0x154ce9){if(_0x154ce9){if(_0x154ce9[_0x29d3('0x6a')]===0x0){return db['UserProfileResource'][_0x29d3('0x6b')]({'where':{'sectionId':_0x154ce9['id']},'raw':!![]})[_0x29d3('0x2a')](function(_0x438e4b){var _0x2afdb4=[];if(_[_0x29d3('0x6c')](_0x438e4b)){_0x2afdb4=_[_0x29d3('0x43')](_0x2ee61c,function(_0x27b87e){if(_0x27b87e[_0x29d3('0x5c')]!==_0x29d3('0x59')){return _0x27b87e;}});return _0x2afdb4;}else{for(var _0x257ddb=0x0;_0x257ddb<_0x2ee61c[_0x29d3('0x3b')];_0x257ddb++){var _0x3a8a70=_0x2ee61c[_0x257ddb];if(_0x3a8a70[_0x29d3('0x5c')]===_0x29d3('0x59')){var _0x5074c7=_[_0x29d3('0x4e')](_0x438e4b,function(_0x1c27de){return _0x1c27de[_0x29d3('0x6d')]===_0x3a8a70['id'];});if(_0x5074c7)_0x2afdb4[_0x29d3('0x6e')](_0x3a8a70);}else{_0x2afdb4[_0x29d3('0x6e')](_0x3a8a70);}}return _0x2afdb4;}});}else{return _0x2ee61c;}}else{var _0x513600=_['filter'](_0x2ee61c,function(_0x3d03e8){if(_0x3d03e8[_0x29d3('0x5c')]!=='agent'){return _0x3d03e8;}});return _0x513600;}});}else{return _0x2ee61c;}}})[_0x29d3('0x2a')](function(_0x5a0984){var _0x548d01=[];if(_0x5a0984){_0x316a33=_0x5a0984;for(var _0x37801e=0x0;_0x37801e<_0x5a0984[_0x29d3('0x3b')];_0x37801e+=0x1){_0x316a33[_0x37801e]['messages']=[];_0x548d01['push'](db[_0x29d3('0x44')]['find']({'where':{'FromId':[_0x83be9e[_0x29d3('0x65')]['id'],_0x5a0984[_0x37801e]['id']],'ToId':[_0x83be9e[_0x29d3('0x65')]['id'],_0x5a0984[_0x37801e]['id']],'ChatGroupId':null},'attributes':['id',_0x29d3('0x53'),'FromId',_0x29d3('0x6f'),_0x29d3('0x70'),_0x29d3('0x4c')],'order':qs[_0x29d3('0x3e')](_0x29d3('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5a0984[_0x37801e])));}return BPromise[_0x29d3('0x72')](_0x548d01);}return[];})[_0x29d3('0x2a')](function(_0x38f6e3){return{'rows':_0x38f6e3,'count':_0x38f6e3['length']};})[_0x29d3('0x2a')](respondWithResult(_0x5ba7e9,null))[_0x29d3('0x48')](handleError(_0x5ba7e9,null));};
\ No newline at end of file
+var _0x571c=['include','ChatInternalMessage','catch','params','intersection','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','Agents','userProfileId','UserProfileResource','length','push','messages','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x3bc15e,_0x872aff){var _0x49087c=function(_0x3dbf7a){while(--_0x3dbf7a){_0x3bc15e['push'](_0x3bc15e['shift']());}};_0x49087c(++_0x872aff);}(_0x571c,0x106));var _0xc571=function(_0x3088ac,_0x1647f2){_0x3088ac=_0x3088ac-0x0;var _0x19d89d=_0x571c[_0x3088ac];return _0x19d89d;};'use strict';var emlformat=require(_0xc571('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc571('0x1'));var jsonpatch=require(_0xc571('0x2'));var rp=require('request-promise');var moment=require(_0xc571('0x3'));var BPromise=require(_0xc571('0x4'));var Mustache=require(_0xc571('0x5'));var util=require(_0xc571('0x6'));var path=require(_0xc571('0x7'));var sox=require(_0xc571('0x8'));var csv=require('to-csv');var ejs=require(_0xc571('0x9'));var fs=require('fs');var fs_extra=require(_0xc571('0xa'));var _=require(_0xc571('0xb'));var squel=require(_0xc571('0xc'));var crypto=require('crypto');var jsforce=require(_0xc571('0xd'));var deskjs=require(_0xc571('0xe'));var toCsv=require(_0xc571('0xf'));var querystring=require(_0xc571('0x10'));var Papa=require(_0xc571('0x11'));var Redis=require(_0xc571('0x12'));var authService=require(_0xc571('0x13'));var qs=require(_0xc571('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc571('0x15'))(_0xc571('0x16'));var utils=require('../../config/utils');var config=require(_0xc571('0x17'));var licenseUtil=require(_0xc571('0x18'));var db=require(_0xc571('0x19'))['db'];config[_0xc571('0x1a')]=_[_0xc571('0x1b')](config['redis'],{'host':_0xc571('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc571('0x1a')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x3b219b,_0x11ec97){_0x11ec97=_0x11ec97||0xcc;return function(_0x1198b2){if(_0x1198b2){return _0x3b219b[_0xc571('0x1d')](_0x11ec97);}return _0x3b219b[_0xc571('0x1e')](_0x11ec97)[_0xc571('0x1f')]();};}function respondWithResult(_0x1e559d,_0x4a8c92){_0x4a8c92=_0x4a8c92||0xc8;return function(_0x264967){if(_0x264967){return _0x1e559d['status'](_0x4a8c92)['json'](_0x264967);}};}function respondWithFilteredResult(_0x233ceb,_0x200cdd){return function(_0xc9c95e){if(_0xc9c95e){var _0x405c28=typeof _0x200cdd[_0xc571('0x20')]===_0xc571('0x21')&&typeof _0x200cdd[_0xc571('0x22')]===_0xc571('0x21');var _0x43987f=_0xc9c95e[_0xc571('0x23')];var _0x4f42d2=_0x405c28?0x0:_0x200cdd[_0xc571('0x20')];var _0x1ca9de=_0x405c28?_0xc9c95e[_0xc571('0x23')]:_0x200cdd[_0xc571('0x20')]+_0x200cdd[_0xc571('0x22')];var _0x14c735;if(_0x1ca9de>=_0x43987f){_0x1ca9de=_0x43987f;_0x14c735=0xc8;}else{_0x14c735=0xce;}_0x233ceb['status'](_0x14c735);return _0x233ceb[_0xc571('0x24')](_0xc571('0x25'),_0x4f42d2+'-'+_0x1ca9de+'/'+_0x43987f)[_0xc571('0x26')](_0xc9c95e);}return null;};}function patchUpdates(_0x107448){return function(_0x1d864e){try{jsonpatch[_0xc571('0x27')](_0x1d864e,_0x107448,!![]);}catch(_0x5a0142){return BPromise[_0xc571('0x28')](_0x5a0142);}return _0x1d864e[_0xc571('0x29')]();};}function saveUpdates(_0x2bffde,_0x465f64){return function(_0x29591f){if(_0x29591f){return _0x29591f[_0xc571('0x2a')](_0x2bffde)[_0xc571('0x2b')](function(_0xb70b03){return _0xb70b03;});}return null;};}function removeEntity(_0x46eab2,_0x2ebb7f){return function(_0x109921){if(_0x109921){return _0x109921[_0xc571('0x2c')]()[_0xc571('0x2b')](function(){_0x46eab2[_0xc571('0x1e')](0xcc)[_0xc571('0x1f')]();});}};}function handleEntityNotFound(_0xf122f2,_0x1c4662){return function(_0x2afc79){if(!_0x2afc79){_0xf122f2[_0xc571('0x1d')](0x194);}return _0x2afc79;};}function handleError(_0xd5718b,_0x43a93e){_0x43a93e=_0x43a93e||0x1f4;return function(_0xbca8e3){logger[_0xc571('0x2d')](_0xbca8e3[_0xc571('0x2e')]);if(_0xbca8e3['name']){delete _0xbca8e3['name'];}_0xd5718b[_0xc571('0x1e')](_0x43a93e)[_0xc571('0x2f')](_0xbca8e3);};}exports['index']=function(_0x59bda7,_0x103d94){var _0x45b862={},_0x3f5b2f={},_0x4bcdf7={'count':0x0,'rows':[]};var _0x5ea250=_[_0xc571('0x30')](db['ChatInternalMessage'][_0xc571('0x31')],function(_0x194a27){return{'name':_0x194a27[_0xc571('0x32')],'type':_0x194a27[_0xc571('0x33')][_0xc571('0x34')]};});_0x3f5b2f[_0xc571('0x35')]=_[_0xc571('0x30')](_0x5ea250,_0xc571('0x36'));_0x3f5b2f[_0xc571('0x37')]=_[_0xc571('0x38')](_0x59bda7[_0xc571('0x37')]);_0x3f5b2f[_0xc571('0x39')]=_['intersection'](_0x3f5b2f['model'],_0x3f5b2f[_0xc571('0x37')]);_0x45b862[_0xc571('0x3a')]=_['intersection'](_0x3f5b2f[_0xc571('0x35')],qs[_0xc571('0x3b')](_0x59bda7[_0xc571('0x37')]['fields']));_0x45b862['attributes']=_0x45b862[_0xc571('0x3a')]['length']?_0x45b862[_0xc571('0x3a')]:_0x3f5b2f['model'];if(!_0x59bda7[_0xc571('0x37')][_0xc571('0x3c')](_0xc571('0x3d'))){_0x45b862[_0xc571('0x22')]=qs[_0xc571('0x22')](_0x59bda7[_0xc571('0x37')][_0xc571('0x22')]);_0x45b862['offset']=qs[_0xc571('0x20')](_0x59bda7[_0xc571('0x37')]['offset']);}_0x45b862[_0xc571('0x3e')]=qs[_0xc571('0x3f')](_0x59bda7['query'][_0xc571('0x3f')]);_0x45b862['where']=qs['filters'](_[_0xc571('0x40')](_0x59bda7[_0xc571('0x37')],_0x3f5b2f[_0xc571('0x39')]),_0x5ea250);if(_0x59bda7[_0xc571('0x37')][_0xc571('0x41')]){_0x45b862[_0xc571('0x42')]=_[_0xc571('0x43')](_0x45b862[_0xc571('0x42')],{'$or':_[_0xc571('0x30')](_0x5ea250,function(_0x42a3ea){if(_0x42a3ea[_0xc571('0x33')]!==_0xc571('0x44')){var _0x59a621={};_0x59a621[_0x42a3ea['name']]={'$like':'%'+_0x59bda7[_0xc571('0x37')][_0xc571('0x41')]+'%'};return _0x59a621;}})});}_0x45b862=_[_0xc571('0x43')]({},_0x45b862,_0x59bda7[_0xc571('0x45')]);var _0x123fa9={'where':_0x45b862[_0xc571('0x42')]};return db['ChatInternalMessage'][_0xc571('0x23')](_0x123fa9)[_0xc571('0x2b')](function(_0x2788ba){_0x4bcdf7['count']=_0x2788ba;if(_0x59bda7['query'][_0xc571('0x46')]){_0x45b862[_0xc571('0x47')]=[{'all':!![]}];}return db[_0xc571('0x48')]['findAll'](_0x45b862);})['then'](function(_0x11f5ea){_0x4bcdf7['rows']=_0x11f5ea;return _0x4bcdf7;})[_0xc571('0x2b')](respondWithFilteredResult(_0x103d94,_0x45b862))[_0xc571('0x49')](handleError(_0x103d94,null));};exports['show']=function(_0x4d7af9,_0x272485){var _0x2decd7={'raw':!![],'where':{'id':_0x4d7af9[_0xc571('0x4a')]['id']}},_0x4ae188={};_0x4ae188[_0xc571('0x35')]=_[_0xc571('0x38')](db['ChatInternalMessage'][_0xc571('0x31')]);_0x4ae188['query']=_[_0xc571('0x38')](_0x4d7af9['query']);_0x4ae188[_0xc571('0x39')]=_[_0xc571('0x4b')](_0x4ae188[_0xc571('0x35')],_0x4ae188[_0xc571('0x37')]);_0x2decd7[_0xc571('0x3a')]=_['intersection'](_0x4ae188[_0xc571('0x35')],qs[_0xc571('0x3b')](_0x4d7af9['query'][_0xc571('0x3b')]));_0x2decd7['attributes']=_0x2decd7[_0xc571('0x3a')]['length']?_0x2decd7[_0xc571('0x3a')]:_0x4ae188[_0xc571('0x35')];if(_0x4d7af9['query']['includeAll']){_0x2decd7[_0xc571('0x47')]=[{'all':!![]}];}_0x2decd7=_['merge']({},_0x2decd7,_0x4d7af9[_0xc571('0x45')]);return db[_0xc571('0x48')]['find'](_0x2decd7)[_0xc571('0x2b')](handleEntityNotFound(_0x272485,null))['then'](respondWithResult(_0x272485,null))[_0xc571('0x49')](handleError(_0x272485,null));};exports[_0xc571('0x4c')]=function(_0x6298f1,_0x10b33b){return db['ChatInternalMessage']['create'](_0x6298f1[_0xc571('0x4d')],{})[_0xc571('0x2b')](respondWithResult(_0x10b33b,0xc9))[_0xc571('0x49')](handleError(_0x10b33b,null));};exports[_0xc571('0x2a')]=function(_0xfeb373,_0xad4b35){if(_0xfeb373[_0xc571('0x4d')]['id']){delete _0xfeb373[_0xc571('0x4d')]['id'];}return db[_0xc571('0x48')]['find']({'where':{'id':_0xfeb373[_0xc571('0x4a')]['id']}})[_0xc571('0x2b')](handleEntityNotFound(_0xad4b35,null))['then'](saveUpdates(_0xfeb373[_0xc571('0x4d')],null))[_0xc571('0x2b')](respondWithResult(_0xad4b35,null))['catch'](handleError(_0xad4b35,null));};exports[_0xc571('0x2c')]=function(_0x10b861,_0x43c2fa){return db[_0xc571('0x48')]['find']({'where':{'id':_0x10b861[_0xc571('0x4a')]['id']}})[_0xc571('0x2b')](handleEntityNotFound(_0x43c2fa,null))[_0xc571('0x2b')](removeEntity(_0x43c2fa,null))['catch'](handleError(_0x43c2fa,null));};exports[_0xc571('0x4e')]=function(_0x43e72a,_0x244801){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x244801,null))[_0xc571('0x49')](handleError(_0x244801,null));};function wrapUser(_0x428661){return function(_0x12b6cf){var _0x2cf7b9=_0x428661[_0xc571('0x4f')]({'plain':!![]});_0x2cf7b9['messages']=[];if(_0x12b6cf){_0x2cf7b9[_0xc571('0x50')]=_0x12b6cf[_0xc571('0x51')];_0x2cf7b9[_0xc571('0x52')]=_0x12b6cf;}else{_0x2cf7b9['lastMessageAt']=moment(0x0)[_0xc571('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cf7b9[_0xc571('0x52')]={};}return _0x2cf7b9;};}exports[_0xc571('0x54')]=function(_0xff5a14,_0x2d18b3,_0x689bdb){var _0xeb1d91=[];return db[_0xc571('0x55')][_0xc571('0x56')]({'where':{'role':[_0xc571('0x57'),_0xc571('0x58'),_0xc571('0x59')]},'attributes':['id',_0xc571('0x5a'),'name',_0xc571('0x5b'),_0xc571('0x5c'),_0xc571('0x5d'),'online',_0xc571('0x5e'),_0xc571('0x5f'),_0xc571('0x60')],'order':qs[_0xc571('0x3f')]('-online'),'include':[{'model':db[_0xc571('0x61')],'as':_0xc571('0x62'),'attributes':['id',_0xc571('0x36'),_0xc571('0x33')],'through':{'attributes':[]}}]})[_0xc571('0x2b')](function(_0x5ac25e){if(_0x5ac25e){var _0x3ee3ae=_0xff5a14['user'][_0xc571('0x4f')]({'plain':!![]});if(!_0x3ee3ae)throw new Error(_0xc571('0x63'));if(_0x3ee3ae[_0xc571('0x5b')]==='user'){return db['UserProfileSection'][_0xc571('0x64')]({'where':{'name':_0xc571('0x65'),'userProfileId':_0x3ee3ae[_0xc571('0x66')]},'raw':!![]})[_0xc571('0x2b')](function(_0x559c61){if(_0x559c61){if(_0x559c61['autoAssociation']===0x0){return db[_0xc571('0x67')]['findAll']({'where':{'sectionId':_0x559c61['id']},'raw':!![]})['then'](function(_0x5097e1){var _0x4de96f=[];if(_['isEmpty'](_0x5097e1)){_0x4de96f=_[_0xc571('0x41')](_0x5ac25e,function(_0x487e08){if(_0x487e08[_0xc571('0x5b')]!=='agent'){return _0x487e08;}});return _0x4de96f;}else{for(var _0x64d9c8=0x0;_0x64d9c8<_0x5ac25e[_0xc571('0x68')];_0x64d9c8++){var _0x3fac51=_0x5ac25e[_0x64d9c8];if(_0x3fac51[_0xc571('0x5b')]===_0xc571('0x57')){var _0x218df0=_[_0xc571('0x64')](_0x5097e1,function(_0x4eb52b){return _0x4eb52b['resourceId']===_0x3fac51['id'];});if(_0x218df0)_0x4de96f[_0xc571('0x69')](_0x3fac51);}else{_0x4de96f[_0xc571('0x69')](_0x3fac51);}}return _0x4de96f;}});}else{return _0x5ac25e;}}else{var _0x1c0861=_[_0xc571('0x41')](_0x5ac25e,function(_0x231080){if(_0x231080['role']!==_0xc571('0x57')){return _0x231080;}});return _0x1c0861;}});}else{return _0x5ac25e;}}})[_0xc571('0x2b')](function(_0x5675bd){var _0x599e0a=[];if(_0x5675bd){_0xeb1d91=_0x5675bd;for(var _0x44ed5a=0x0;_0x44ed5a<_0x5675bd[_0xc571('0x68')];_0x44ed5a+=0x1){_0xeb1d91[_0x44ed5a][_0xc571('0x6a')]=[];_0x599e0a[_0xc571('0x69')](db[_0xc571('0x48')][_0xc571('0x64')]({'where':{'FromId':[_0xff5a14[_0xc571('0x59')]['id'],_0x5675bd[_0x44ed5a]['id']],'ToId':[_0xff5a14[_0xc571('0x59')]['id'],_0x5675bd[_0x44ed5a]['id']],'ChatGroupId':null},'attributes':['id',_0xc571('0x51'),'FromId',_0xc571('0x6b'),_0xc571('0x6c'),_0xc571('0x4d')],'order':qs[_0xc571('0x3f')](_0xc571('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc571('0x2b')](wrapUser(_0x5675bd[_0x44ed5a])));}return BPromise[_0xc571('0x6e')](_0x599e0a);}return[];})[_0xc571('0x2b')](function(_0x511dd8){return{'rows':_0x511dd8,'count':_0x511dd8[_0xc571('0x68')]};})[_0xc571('0x2b')](respondWithResult(_0x2d18b3,null))['catch'](handleError(_0x2d18b3,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 1d6f46a..0ba9996 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 _0xef2b=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x166b39,_0x2c7292){var _0x196a87=function(_0x99af69){while(--_0x99af69){_0x166b39['push'](_0x166b39['shift']());}};_0x196a87(++_0x2c7292);}(_0xef2b,0x164));var _0xbef2=function(_0x5e3f0f,_0x16c6c7){_0x5e3f0f=_0x5e3f0f-0x0;var _0xbd8d66=_0xef2b[_0x5e3f0f];return _0xbd8d66;};'use strict';var EventEmitter=require(_0xbef2('0x0'));var ChatInternalMessage=require(_0xbef2('0x1'))['db'][_0xbef2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbef2('0x3')](0x0);var events={'afterCreate':_0xbef2('0x4'),'afterUpdate':'update','afterDestroy':_0xbef2('0x5')};function emitEvent(_0x56e61a){return function(_0x29619f,_0x114f0e,_0x159f26){ChatInternalMessageEvents[_0xbef2('0x6')](_0x56e61a+':'+_0x29619f['id'],_0x29619f);ChatInternalMessageEvents['emit'](_0x56e61a,_0x29619f);_0x159f26(null);};}for(var e in events){if(events[_0xbef2('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xbef2('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xd98c=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x49aed9,_0x4a7b44){var _0x5c913e=function(_0x454bf7){while(--_0x454bf7){_0x49aed9['push'](_0x49aed9['shift']());}};_0x5c913e(++_0x4a7b44);}(_0xd98c,0xe3));var _0xcd98=function(_0x1f68e1,_0x206dc8){_0x1f68e1=_0x1f68e1-0x0;var _0x35d201=_0xd98c[_0x1f68e1];return _0x35d201;};'use strict';var EventEmitter=require(_0xcd98('0x0'));var ChatInternalMessage=require(_0xcd98('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcd98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd98('0x3'),'afterDestroy':_0xcd98('0x4')};function emitEvent(_0x2c4b4b){return function(_0x526bc9,_0x5c245c,_0x2c69b5){ChatInternalMessageEvents[_0xcd98('0x5')](_0x2c4b4b+':'+_0x526bc9['id'],_0x526bc9);ChatInternalMessageEvents['emit'](_0x2c4b4b,_0x526bc9);_0x2c69b5(null);};}for(var e in events){if(events[_0xcd98('0x6')](e)){var event=events[e];ChatInternalMessage[_0xcd98('0x7')](e,emitEvent(event));}}module[_0xcd98('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 3bc9e41..3e8408e 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 _0xa5d6=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa5d6,0x7c));var _0x6a5d=function(_0x3f71a4,_0x30c6fe){_0x3f71a4=_0x3f71a4-0x0;var _0x11f064=_0xa5d6[_0x3f71a4];return _0x11f064;};'use strict';var _=require(_0x6a5d('0x0'));var util=require(_0x6a5d('0x1'));var logger=require(_0x6a5d('0x2'))(_0x6a5d('0x3'));var moment=require('moment');var BPromise=require(_0x6a5d('0x4'));var rp=require(_0x6a5d('0x5'));var fs=require('fs');var path=require(_0x6a5d('0x6'));var rimraf=require(_0x6a5d('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a5d('0x8'));module[_0x6a5d('0x9')]=function(_0x481847,_0x30d703){return _0x481847[_0x6a5d('0xa')](_0x6a5d('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a5d('0xc'),'collate':_0x6a5d('0xd')});};
\ No newline at end of file
+var _0x3ccf=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define'];(function(_0x68b457,_0x525e03){var _0x994162=function(_0x5224f7){while(--_0x5224f7){_0x68b457['push'](_0x68b457['shift']());}};_0x994162(++_0x525e03);}(_0x3ccf,0xd6));var _0xf3cc=function(_0x3fe929,_0x1f90e5){_0x3fe929=_0x3fe929-0x0;var _0x1f46a3=_0x3ccf[_0x3fe929];return _0x1f46a3;};'use strict';var _=require(_0xf3cc('0x0'));var util=require(_0xf3cc('0x1'));var logger=require(_0xf3cc('0x2'))(_0xf3cc('0x3'));var moment=require(_0xf3cc('0x4'));var BPromise=require(_0xf3cc('0x5'));var rp=require(_0xf3cc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf3cc('0x7'));var config=require('../../config/environment');var attributes=require(_0xf3cc('0x8'));module[_0xf3cc('0x9')]=function(_0x50f8e6,_0x5a6dda){return _0x50f8e6[_0xf3cc('0xa')](_0xf3cc('0xb'),attributes,{'tableName':_0xf3cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf3cc('0xd'),'collate':_0xf3cc('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 826b603..1d8ee5e 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 _0x0e7a=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x4b1ea1,_0xff5112){var _0x1cf493=function(_0x4ceec6){while(--_0x4ceec6){_0x4b1ea1['push'](_0x4b1ea1['shift']());}};_0x1cf493(++_0xff5112);}(_0x0e7a,0x71));var _0xa0e7=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0x0e7a[_0x214266];return _0x568f75;};'use strict';var _=require(_0xa0e7('0x0'));var util=require(_0xa0e7('0x1'));var moment=require(_0xa0e7('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0e7('0x3'));var fs=require('fs');var Redis=require(_0xa0e7('0x4'));var db=require(_0xa0e7('0x5'))['db'];var utils=require(_0xa0e7('0x6'));var logger=require('../../config/logger')(_0xa0e7('0x7'));var config=require(_0xa0e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa0e7('0x9')][_0xa0e7('0xa')]({'port':0x232a});config[_0xa0e7('0xb')]=_[_0xa0e7('0xc')](config['redis'],{'host':_0xa0e7('0xd'),'port':0x18eb});var socket=require(_0xa0e7('0xe'))(new Redis(config[_0xa0e7('0xb')]));require('./chatInternalMessage.socket')[_0xa0e7('0xf')](socket);function respondWithRpcPromise(_0x992df1,_0xc4dc84,_0x24cc32){return new BPromise(function(_0x44f3ec,_0x4cd892){return client['request'](_0x992df1,_0x24cc32)[_0xa0e7('0x10')](function(_0x293867){logger['info'](_0xa0e7('0x11'),_0xc4dc84,_0xa0e7('0x12'));logger['debug'](_0xa0e7('0x13'),_0xc4dc84,'request\x20sent',JSON[_0xa0e7('0x14')](_0x293867));if(_0x293867[_0xa0e7('0x15')]){if(_0x293867[_0xa0e7('0x15')][_0xa0e7('0x16')]===0x1f4){logger[_0xa0e7('0x15')](_0xa0e7('0x11'),_0xc4dc84,_0x293867['error'][_0xa0e7('0x17')]);return _0x4cd892(_0x293867[_0xa0e7('0x15')][_0xa0e7('0x17')]);}logger[_0xa0e7('0x15')](_0xa0e7('0x11'),_0xc4dc84,_0x293867[_0xa0e7('0x15')]['message']);return _0x44f3ec(_0x293867[_0xa0e7('0x15')][_0xa0e7('0x17')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xc4dc84,_0xa0e7('0x12'));_0x44f3ec(_0x293867[_0xa0e7('0x18')][_0xa0e7('0x17')]);}})[_0xa0e7('0x19')](function(_0x49d432){logger[_0xa0e7('0x15')](_0xa0e7('0x11'),_0xc4dc84,_0x49d432);_0x4cd892(_0x49d432);});});}
\ No newline at end of file
+var _0x636d=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','moment'];(function(_0x38d3bd,_0x49f837){var _0x19022c=function(_0x30341f){while(--_0x30341f){_0x38d3bd['push'](_0x38d3bd['shift']());}};_0x19022c(++_0x49f837);}(_0x636d,0xf0));var _0xd636=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x636d[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0xd636('0x0'));var util=require(_0xd636('0x1'));var moment=require(_0xd636('0x2'));var BPromise=require(_0xd636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd636('0x4'))['db'];var utils=require(_0xd636('0x5'));var logger=require(_0xd636('0x6'))(_0xd636('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd636('0x8')][_0xd636('0x9')]({'port':0x232a});config['redis']=_[_0xd636('0xa')](config['redis'],{'host':_0xd636('0xb'),'port':0x18eb});var socket=require(_0xd636('0xc'))(new Redis(config[_0xd636('0xd')]));require(_0xd636('0xe'))[_0xd636('0xf')](socket);function respondWithRpcPromise(_0x4b02db,_0x587d55,_0x526e0f){return new BPromise(function(_0x3863db,_0x36099d){return client[_0xd636('0x10')](_0x4b02db,_0x526e0f)[_0xd636('0x11')](function(_0x41784c){logger['info'](_0xd636('0x12'),_0x587d55,_0xd636('0x13'));logger['debug'](_0xd636('0x14'),_0x587d55,_0xd636('0x13'),JSON[_0xd636('0x15')](_0x41784c));if(_0x41784c['error']){if(_0x41784c['error'][_0xd636('0x16')]===0x1f4){logger[_0xd636('0x17')](_0xd636('0x12'),_0x587d55,_0x41784c[_0xd636('0x17')][_0xd636('0x18')]);return _0x36099d(_0x41784c['error']['message']);}logger[_0xd636('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x587d55,_0x41784c['error'][_0xd636('0x18')]);return _0x3863db(_0x41784c[_0xd636('0x17')][_0xd636('0x18')]);}else{logger[_0xd636('0x19')](_0xd636('0x12'),_0x587d55,_0xd636('0x13'));_0x3863db(_0x41784c[_0xd636('0x1a')]['message']);}})['catch'](function(_0x56a6a5){logger[_0xd636('0x17')](_0xd636('0x12'),_0x587d55,_0x56a6a5);_0x36099d(_0x56a6a5);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4764813..2ce5abe 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 _0x3d45=['save','remove','update','removeListener','register','chatInternalMessage:'];(function(_0x48b55f,_0x2a17e7){var _0x524a3c=function(_0x4d834a){while(--_0x4d834a){_0x48b55f['push'](_0x48b55f['shift']());}};_0x524a3c(++_0x2a17e7);}(_0x3d45,0x66));var _0x53d4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d45[_0x3b380d];return _0x54502b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x53d4('0x0'),_0x53d4('0x1'),_0x53d4('0x2')];function createListener(_0x2ef7cf,_0x3c660f){return function(_0x203329){_0x3c660f['emit'](_0x2ef7cf,_0x203329);};}function removeListener(_0x3ff2fe,_0x1a31fa){return function(){ChatInternalMessageEvents[_0x53d4('0x3')](_0x3ff2fe,_0x1a31fa);};}exports[_0x53d4('0x4')]=function(_0x571070){for(var _0x2f8160=0x0,_0xce6568=events['length'];_0x2f8160<_0xce6568;_0x2f8160++){var _0x57bd0d=events[_0x2f8160];var _0x59e469=createListener(_0x53d4('0x5')+_0x57bd0d,_0x571070);ChatInternalMessageEvents['on'](_0x57bd0d,_0x59e469);}};
\ No newline at end of file
+var _0x674f=['emit','removeListener','register','length','./chatInternalMessage.events','save','remove','update'];(function(_0x75c2cc,_0x3ada99){var _0x340fe4=function(_0x3b2401){while(--_0x3b2401){_0x75c2cc['push'](_0x75c2cc['shift']());}};_0x340fe4(++_0x3ada99);}(_0x674f,0x1c4));var _0xf674=function(_0x34af24,_0x14918f){_0x34af24=_0x34af24-0x0;var _0x33fd87=_0x674f[_0x34af24];return _0x33fd87;};'use strict';var ChatInternalMessageEvents=require(_0xf674('0x0'));var events=[_0xf674('0x1'),_0xf674('0x2'),_0xf674('0x3')];function createListener(_0x44b6fa,_0x5b0df8){return function(_0x3daefd){_0x5b0df8[_0xf674('0x4')](_0x44b6fa,_0x3daefd);};}function removeListener(_0x3fe02a,_0x19f66f){return function(){ChatInternalMessageEvents[_0xf674('0x5')](_0x3fe02a,_0x19f66f);};}exports[_0xf674('0x6')]=function(_0xba55e4){for(var _0x271696=0x0,_0x525450=events[_0xf674('0x7')];_0x271696<_0x525450;_0x271696++){var _0x747ed6=events[_0x271696];var _0x4c2d54=createListener('chatInternalMessage:'+_0x747ed6,_0xba55e4);ChatInternalMessageEvents['on'](_0x747ed6,_0x4c2d54);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7ee3758..479ff91 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 _0x9ad3=['fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','put','update','destroy','util','path','connect-timeout','express'];(function(_0x2b0686,_0xff7aca){var _0xe364a0=function(_0x317360){while(--_0x317360){_0x2b0686['push'](_0x2b0686['shift']());}};_0xe364a0(++_0xff7aca);}(_0x9ad3,0x161));var _0x39ad=function(_0x348088,_0xfdc11d){_0x348088=_0x348088-0x0;var _0x4d43a7=_0x9ad3[_0x348088];return _0x4d43a7;};'use strict';var multer=require('multer');var util=require(_0x39ad('0x0'));var path=require(_0x39ad('0x1'));var timeout=require(_0x39ad('0x2'));var express=require(_0x39ad('0x3'));var router=express['Router']();var fs_extra=require(_0x39ad('0x4'));var auth=require(_0x39ad('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x39ad('0x6'));var controller=require(_0x39ad('0x7'));router[_0x39ad('0x8')]('/',auth['isAuthenticated'](),controller[_0x39ad('0x9')]);router['get'](_0x39ad('0xa'),auth[_0x39ad('0xb')](),controller[_0x39ad('0xc')]);router['get'](_0x39ad('0xd'),auth[_0x39ad('0xb')](),controller[_0x39ad('0xe')]);router['get'](_0x39ad('0xf'),auth[_0x39ad('0xb')](),controller[_0x39ad('0x10')]);router[_0x39ad('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x39ad('0x12')]('/:id',controller[_0x39ad('0x13')]);router['delete'](_0x39ad('0xf'),auth[_0x39ad('0xb')](),controller[_0x39ad('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1402=['/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers'];(function(_0x5ca644,_0x3d2165){var _0x5c87a2=function(_0x3dc7d9){while(--_0x3dc7d9){_0x5ca644['push'](_0x5ca644['shift']());}};_0x5c87a2(++_0x3d2165);}(_0x1402,0x1eb));var _0x2140=function(_0x1170e5,_0xc0e250){_0x1170e5=_0x1170e5-0x0;var _0x3ec902=_0x1402[_0x1170e5];return _0x3ec902;};'use strict';var multer=require(_0x2140('0x0'));var util=require(_0x2140('0x1'));var path=require('path');var timeout=require(_0x2140('0x2'));var express=require(_0x2140('0x3'));var router=express['Router']();var fs_extra=require(_0x2140('0x4'));var auth=require(_0x2140('0x5'));var interaction=require(_0x2140('0x6'));var config=require(_0x2140('0x7'));var controller=require(_0x2140('0x8'));router[_0x2140('0x9')]('/',auth[_0x2140('0xa')](),controller['index']);router['get'](_0x2140('0xb'),auth[_0x2140('0xa')](),controller[_0x2140('0xc')]);router[_0x2140('0x9')](_0x2140('0xd'),auth[_0x2140('0xa')](),controller[_0x2140('0xe')]);router[_0x2140('0x9')](_0x2140('0xf'),auth[_0x2140('0xa')](),controller[_0x2140('0x10')]);router['post']('/',auth[_0x2140('0xa')](),controller[_0x2140('0x11')]);router[_0x2140('0x12')]('/:id',controller[_0x2140('0x13')]);router[_0x2140('0x14')](_0x2140('0xf'),auth[_0x2140('0xa')](),controller[_0x2140('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 8225655..96d3e2e 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 _0x1bc6=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x1bc6,0x94));var _0x61bc=function(_0x1a841e,_0x5d813e){_0x1a841e=_0x1a841e-0x0;var _0x32d59e=_0x1bc6[_0x1a841e];return _0x32d59e;};'use strict';var Sequelize=require(_0x61bc('0x0'));module[_0x61bc('0x1')]={'body':{'type':Sequelize[_0x61bc('0x2')](_0x61bc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x61bc('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x61bc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x61bc('0x5')]('in','out'),'defaultValue':_0x61bc('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x61bc('0x7')]},'providerName':{'type':Sequelize[_0x61bc('0x8')]},'providerResponse':{'type':Sequelize[_0x61bc('0x2')]}};
\ No newline at end of file
+var _0x1219=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x1219,0x17c));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9121('0x0'));module[_0x9121('0x1')]={'body':{'type':Sequelize[_0x9121('0x2')](_0x9121('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9121('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9121('0x5')]('in','out'),'defaultValue':_0x9121('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9121('0x7')]},'providerName':{'type':Sequelize[_0x9121('0x8')]},'providerResponse':{'type':Sequelize[_0x9121('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index bb62a65..2429d84 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 _0xe8f3=['role','null','RejectMessage','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','format','channel','motionChannel','event','EventManager','rejectmessage','parse','interaction','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','client','http','chat-interactions','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','undefined','limit','count','offset','set','Content-Range','json','update','then','end','sendStatus','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','ChatMessage','findAll','rows','length','find','create','body','params','describe','accept','chat','reject','UserId','user','agent','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x218d84,_0x2f43d2){var _0xdbeedf=function(_0x16db2a){while(--_0x16db2a){_0x218d84['push'](_0x218d84['shift']());}};_0xdbeedf(++_0x2f43d2);}(_0xe8f3,0x77));var _0x3e8f=function(_0x3018eb,_0x570c63){_0x3018eb=_0x3018eb-0x0;var _0x23131f=_0xe8f3[_0x3018eb];return _0x23131f;};'use strict';var util=require(_0x3e8f('0x0'));var _=require(_0x3e8f('0x1'));var Redis=require(_0x3e8f('0x2'));var interactionService=require(_0x3e8f('0x3'));var qs=require(_0x3e8f('0x4'));var logger=require(_0x3e8f('0x5'))('api');var config=require(_0x3e8f('0x6'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3e8f('0x7')](config[_0x3e8f('0x8')],{'host':_0x3e8f('0x9'),'port':0x18eb});var socket=require(_0x3e8f('0xa'))(new Redis(config[_0x3e8f('0x8')]));require(_0x3e8f('0xb'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3e8f('0xc')][_0x3e8f('0xd')]({'port':0x232c});var client9002=jayson[_0x3e8f('0xc')][_0x3e8f('0xd')]({'port':0x232a});var interaction_log=require('../../config/logger')(_0x3e8f('0xe'));function respondWithRpcPromise(_0x1c7949,_0x244066,_0x4931f6,_0x4ab24f){return new Promise(function(_0x2054e6,_0x1b5f57){var _0x5bf946=_0x4ab24f||client;return _0x5bf946[_0x3e8f('0xf')](_0x1c7949,_0x4931f6)['then'](function(_0x255f60){logger[_0x3e8f('0x10')](_0x3e8f('0x11'),_0x244066,_0x3e8f('0x12'));logger[_0x3e8f('0x13')](_0x3e8f('0x14'),_0x244066,'request\x20sent',JSON[_0x3e8f('0x15')](_0x255f60));if(_0x255f60[_0x3e8f('0x16')]){if(_0x255f60[_0x3e8f('0x16')]['code']===0x1f4){logger['error'](_0x3e8f('0x11'),_0x244066,_0x255f60[_0x3e8f('0x16')]['message']);return _0x1b5f57(_0x255f60[_0x3e8f('0x16')][_0x3e8f('0x17')]);}logger[_0x3e8f('0x16')](_0x3e8f('0x11'),_0x244066,_0x255f60[_0x3e8f('0x16')][_0x3e8f('0x17')]);return _0x2054e6(_0x255f60[_0x3e8f('0x16')]['message']);}else{logger[_0x3e8f('0x10')](_0x3e8f('0x11'),_0x244066,_0x3e8f('0x12'));_0x2054e6(_0x255f60[_0x3e8f('0x18')][_0x3e8f('0x17')]);}})[_0x3e8f('0x19')](function(_0x348a3c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x244066,_0x348a3c);_0x1b5f57(_0x348a3c);});});}function respondWithResult(_0x5acff4,_0x1cc394){_0x1cc394=_0x1cc394||0xc8;return function(_0x18c487){if(_0x18c487){return _0x5acff4[_0x3e8f('0x1a')](_0x1cc394)['json'](_0x18c487);}};}function respondWithFilteredResult(_0x523a77,_0x585ea9){return function(_0x1c995d){if(_0x1c995d){var _0x55071b=typeof _0x585ea9['offset']===_0x3e8f('0x1b')&&typeof _0x585ea9[_0x3e8f('0x1c')]===_0x3e8f('0x1b');var _0x555b60=_0x1c995d[_0x3e8f('0x1d')];var _0x530c34=_0x55071b?0x0:_0x585ea9[_0x3e8f('0x1e')];var _0x3a8511=_0x55071b?_0x1c995d[_0x3e8f('0x1d')]:_0x585ea9['offset']+_0x585ea9[_0x3e8f('0x1c')];var _0x5f5412;if(_0x3a8511>=_0x555b60){_0x3a8511=_0x555b60;_0x5f5412=0xc8;}else{_0x5f5412=0xce;}_0x523a77[_0x3e8f('0x1a')](_0x5f5412);return _0x523a77[_0x3e8f('0x1f')](_0x3e8f('0x20'),_0x530c34+'-'+_0x3a8511+'/'+_0x555b60)[_0x3e8f('0x21')](_0x1c995d);}return null;};}function saveUpdates(_0x2f884c){return function(_0x2aed88){if(_0x2aed88){return _0x2aed88[_0x3e8f('0x22')](_0x2f884c)[_0x3e8f('0x23')](function(_0x4e1694){return _0x4e1694;});}return null;};}function removeEntity(_0x2b17cc){return function(_0x3cba8f){if(_0x3cba8f){return _0x3cba8f['destroy']()[_0x3e8f('0x23')](function(){_0x2b17cc[_0x3e8f('0x1a')](0xcc)[_0x3e8f('0x24')]();});}};}function handleEntityNotFound(_0x36b126){return function(_0x4dd400){if(!_0x4dd400){_0x36b126[_0x3e8f('0x25')](0x194);}return _0x4dd400;};}function handleError(_0x280d9b,_0x50fa7f){_0x50fa7f=_0x50fa7f||0x1f4;return function(_0x182390){logger['error'](_0x182390[_0x3e8f('0x26')]);if(_0x182390[_0x3e8f('0x27')]){delete _0x182390[_0x3e8f('0x27')];}_0x280d9b[_0x3e8f('0x1a')](_0x50fa7f)['send'](_0x182390);};}exports[_0x3e8f('0x28')]=function(_0x4e0c77,_0x353180){var _0x556eab={},_0x58220e={},_0x316923={'count':0x0,'rows':[]};var _0x4c37d8=_['map'](db['ChatMessage'][_0x3e8f('0x29')],function(_0x59e5c3){return{'name':_0x59e5c3[_0x3e8f('0x2a')],'type':_0x59e5c3['type'][_0x3e8f('0x2b')]};});_0x58220e[_0x3e8f('0x2c')]=_[_0x3e8f('0x2d')](_0x4c37d8,'name');_0x58220e[_0x3e8f('0x2e')]=_[_0x3e8f('0x2f')](_0x4e0c77[_0x3e8f('0x2e')]);_0x58220e[_0x3e8f('0x30')]=_[_0x3e8f('0x31')](_0x58220e[_0x3e8f('0x2c')],_0x58220e[_0x3e8f('0x2e')]);_0x556eab[_0x3e8f('0x32')]=_[_0x3e8f('0x31')](_0x58220e[_0x3e8f('0x2c')],qs[_0x3e8f('0x33')](_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x33')]));_0x556eab[_0x3e8f('0x32')]=_0x556eab[_0x3e8f('0x32')]['length']?_0x556eab['attributes']:_0x58220e[_0x3e8f('0x2c')];if(!_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x34')](_0x3e8f('0x35'))){_0x556eab[_0x3e8f('0x1c')]=qs[_0x3e8f('0x1c')](_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x1c')]);_0x556eab['offset']=qs[_0x3e8f('0x1e')](_0x4e0c77['query'][_0x3e8f('0x1e')]);}_0x556eab[_0x3e8f('0x36')]=qs[_0x3e8f('0x37')](_0x4e0c77[_0x3e8f('0x2e')]['sort']);_0x556eab[_0x3e8f('0x38')]=qs['filters'](_[_0x3e8f('0x39')](_0x4e0c77[_0x3e8f('0x2e')],_0x58220e[_0x3e8f('0x30')]),_0x4c37d8);if(_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x3a')]){_0x556eab[_0x3e8f('0x38')]=_['merge'](_0x556eab[_0x3e8f('0x38')],{'$or':_['map'](_0x4c37d8,function(_0x55b628){if(_0x55b628['type']!=='VIRTUAL'){var _0x10755e={};_0x10755e[_0x55b628[_0x3e8f('0x27')]]={'$like':'%'+_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x3a')]+'%'};return _0x10755e;}})});}_0x556eab=_[_0x3e8f('0x3b')]({},_0x556eab,_0x4e0c77[_0x3e8f('0x3c')]);var _0x1b11a3={'where':_0x556eab[_0x3e8f('0x38')]};return db['ChatMessage']['count'](_0x1b11a3)[_0x3e8f('0x23')](function(_0x2422ed){_0x316923[_0x3e8f('0x1d')]=_0x2422ed;if(_0x4e0c77[_0x3e8f('0x2e')][_0x3e8f('0x3d')]){_0x556eab[_0x3e8f('0x3e')]=[{'all':!![]}];}return db[_0x3e8f('0x3f')][_0x3e8f('0x40')](_0x556eab);})['then'](function(_0x29bd09){_0x316923[_0x3e8f('0x41')]=_0x29bd09;return _0x316923;})[_0x3e8f('0x23')](respondWithFilteredResult(_0x353180,_0x556eab))[_0x3e8f('0x19')](handleError(_0x353180,null));};exports['show']=function(_0x4d2f36,_0x5dfa49){var _0x35c2e5={'raw':!![],'where':{'id':_0x4d2f36['params']['id']}},_0x10dd46={};_0x10dd46[_0x3e8f('0x2c')]=_[_0x3e8f('0x2f')](db['ChatMessage'][_0x3e8f('0x29')]);_0x10dd46[_0x3e8f('0x2e')]=_['keys'](_0x4d2f36['query']);_0x10dd46[_0x3e8f('0x30')]=_[_0x3e8f('0x31')](_0x10dd46[_0x3e8f('0x2c')],_0x10dd46[_0x3e8f('0x2e')]);_0x35c2e5[_0x3e8f('0x32')]=_['intersection'](_0x10dd46[_0x3e8f('0x2c')],qs[_0x3e8f('0x33')](_0x4d2f36['query'][_0x3e8f('0x33')]));_0x35c2e5[_0x3e8f('0x32')]=_0x35c2e5[_0x3e8f('0x32')][_0x3e8f('0x42')]?_0x35c2e5[_0x3e8f('0x32')]:_0x10dd46[_0x3e8f('0x2c')];if(_0x4d2f36['query'][_0x3e8f('0x3d')]){_0x35c2e5['include']=[{'all':!![]}];}_0x35c2e5=_[_0x3e8f('0x3b')]({},_0x35c2e5,_0x4d2f36[_0x3e8f('0x3c')]);return db[_0x3e8f('0x3f')][_0x3e8f('0x43')](_0x35c2e5)['then'](handleEntityNotFound(_0x5dfa49,null))['then'](respondWithResult(_0x5dfa49,null))[_0x3e8f('0x19')](handleError(_0x5dfa49,null));};exports['create']=function(_0x19a6cc,_0x4a8f2a){return db[_0x3e8f('0x3f')][_0x3e8f('0x44')](_0x19a6cc['body'],{})[_0x3e8f('0x23')](respondWithResult(_0x4a8f2a,0xc9))[_0x3e8f('0x19')](handleError(_0x4a8f2a,null));};exports[_0x3e8f('0x22')]=function(_0x350ef6,_0x5348ff){if(_0x350ef6[_0x3e8f('0x45')]['id']){delete _0x350ef6['body']['id'];}return db['ChatMessage'][_0x3e8f('0x43')]({'where':{'id':_0x350ef6[_0x3e8f('0x46')]['id']}})[_0x3e8f('0x23')](handleEntityNotFound(_0x5348ff,null))['then'](saveUpdates(_0x350ef6[_0x3e8f('0x45')],null))[_0x3e8f('0x23')](respondWithResult(_0x5348ff,null))[_0x3e8f('0x19')](handleError(_0x5348ff,null));};exports['destroy']=function(_0x541d99,_0x4ce51b){return db[_0x3e8f('0x3f')][_0x3e8f('0x43')]({'where':{'id':_0x541d99[_0x3e8f('0x46')]['id']}})[_0x3e8f('0x23')](handleEntityNotFound(_0x4ce51b,null))['then'](removeEntity(_0x4ce51b,null))[_0x3e8f('0x19')](handleError(_0x4ce51b,null));};exports['describe']=function(_0x46f1a,_0xe52e19){return db[_0x3e8f('0x3f')][_0x3e8f('0x47')]()[_0x3e8f('0x23')](respondWithResult(_0xe52e19,null))[_0x3e8f('0x19')](handleError(_0xe52e19,null));};exports[_0x3e8f('0x48')]=function(_0x59692c,_0x466c94){var _0x5d1a8f=_0x3e8f('0x49');return interactionService['acceptMessage'](_0x59692c,_0x5d1a8f)['then'](respondWithResult(_0x466c94,null))[_0x3e8f('0x19')](handleError(_0x466c94,null));};exports[_0x3e8f('0x4a')]=function(_0x56a342,_0x5caa7a){var _0x1748fa={'agent':{},'channel':_0x3e8f('0x49')};if(_0x56a342['body']['id']){delete _0x56a342[_0x3e8f('0x45')]['id'];}_0x56a342[_0x3e8f('0x45')][_0x3e8f('0x4b')]=_0x56a342[_0x3e8f('0x45')][_0x3e8f('0x4b')]||_0x56a342[_0x3e8f('0x4c')]['id'];_0x1748fa[_0x3e8f('0x4d')]['id']=_0x56a342['body']['UserId'];return db[_0x3e8f('0x3f')]['find']({'where':{'id':_0x56a342[_0x3e8f('0x46')]['id'],'UserId':null}})[_0x3e8f('0x23')](handleEntityNotFound(_0x5caa7a,null))[_0x3e8f('0x23')](function(_0x3845db){if(_0x3845db){_0x1748fa[_0x3e8f('0x17')]=_0x3845db[_0x3e8f('0x4e')]({'plain':!![]});return db['ChatInteraction'][_0x3e8f('0x43')]({'where':{'id':_0x3845db[_0x3e8f('0x4f')]}});}return null;})[_0x3e8f('0x23')](handleEntityNotFound(_0x5caa7a,null))[_0x3e8f('0x23')](function(_0x5cbad9){if(_0x5cbad9){_0x1748fa['interaction']=_0x5cbad9[_0x3e8f('0x4e')]({'plain':!![]});interaction_log[_0x3e8f('0x10')](_0x3e8f('0x50'),_0x56a342['user']['id'],_0x56a342[_0x3e8f('0x4c')]['name'],_0x56a342[_0x3e8f('0x4c')][_0x3e8f('0x51')],_0x1748fa['interaction']['id'],_0x56a342[_0x3e8f('0x45')]?JSON['stringify'](_0x56a342[_0x3e8f('0x45')]):_0x3e8f('0x52'));return respondWithRpcPromise(_0x3e8f('0x53'),'rejectMessage',_0x1748fa);}return null;})[_0x3e8f('0x23')](function(_0x54156e){var _0x6c3b6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54156e['message'][_0x3e8f('0x54')];return db['sequelize'][_0x3e8f('0x2e')](_0x6c3b6,{'type':db[_0x3e8f('0x55')][_0x3e8f('0x56')]['SELECT'],'raw':!![]})['then'](function(_0x3bc1d4){return _0x3bc1d4;});})[_0x3e8f('0x23')](function(_0x565fef){if(_0x565fef){_0x1748fa[_0x3e8f('0x17')][_0x3e8f('0x57')]=_0x565fef[0x0];if(!_0x56a342[_0x3e8f('0x45')][_0x3e8f('0x4b')])return;return db[_0x3e8f('0x58')]['find']({'where':{'id':_0x56a342[_0x3e8f('0x45')]['UserId'],'role':_0x3e8f('0x4d')},'attributes':['id',_0x3e8f('0x27'),_0x3e8f('0x59'),_0x3e8f('0x5a'),_0x3e8f('0x5b')],'raw':!![]});}return null;})['then'](function(_0x458fe9){if(!_0x458fe9)return null;_0x1748fa['message'][_0x3e8f('0x4d')]=_0x458fe9;return _0x1748fa;})[_0x3e8f('0x23')](function(_0x2949df){if(_0x2949df){_0x2949df[_0x3e8f('0x17')]['interface']=util[_0x3e8f('0x5c')]('SIP/%s',_0x56a342[_0x3e8f('0x4c')]['name']);_0x2949df[_0x3e8f('0x17')][_0x3e8f('0x5d')]=_0x1748fa[_0x3e8f('0x5d')];_0x2949df[_0x3e8f('0x17')][_0x3e8f('0x5e')]=_0x1748fa[_0x3e8f('0x5d')];_0x2949df[_0x3e8f('0x17')][_0x3e8f('0x5f')]=_0x3e8f('0x4a');respondWithRpcPromise(_0x3e8f('0x60'),_0x3e8f('0x60'),{'event':_0x3e8f('0x61'),'message':_[_0x3e8f('0x3b')](_0x1748fa[_0x3e8f('0x17')],JSON[_0x3e8f('0x62')](_0x1748fa[_0x3e8f('0x63')]['formData']))},client9002);return _0x1748fa;}return null;})[_0x3e8f('0x23')](respondWithResult(_0x5caa7a,null))['catch'](handleError(_0x5caa7a,null));};
\ No newline at end of file
+var _0x51b8=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','../../config/logger','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','json','offset','undefined','limit','count','set','update','destroy','end','sendStatus','stack','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','name','options','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','accept','chat','UserId','user','agent','get','ChatInteraction','interaction','role','null','rejectMessage','ContactId','Sequelize','QueryTypes','contact','User','email','SIP/%s','channel','motionChannel','event','reject','EventManager','rejectmessage','parse','formData','util','ioredis','../../components/interaction/service','api'];(function(_0x1ea7d4,_0x2257bd){var _0x55e995=function(_0x34937a){while(--_0x34937a){_0x1ea7d4['push'](_0x1ea7d4['shift']());}};_0x55e995(++_0x2257bd);}(_0x51b8,0x190));var _0x851b=function(_0x43d4f7,_0x2aba64){_0x43d4f7=_0x43d4f7-0x0;var _0x2ad52e=_0x51b8[_0x43d4f7];return _0x2ad52e;};'use strict';var util=require(_0x851b('0x0'));var _=require('lodash');var Redis=require(_0x851b('0x1'));var interactionService=require(_0x851b('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x851b('0x3'));var config=require(_0x851b('0x4'));var db=require(_0x851b('0x5'))['db'];config[_0x851b('0x6')]=_[_0x851b('0x7')](config['redis'],{'host':_0x851b('0x8'),'port':0x18eb});var socket=require(_0x851b('0x9'))(new Redis(config[_0x851b('0x6')]));require(_0x851b('0xa'))[_0x851b('0xb')](socket);var jayson=require(_0x851b('0xc'));var client=jayson['client'][_0x851b('0xd')]({'port':0x232c});var client9002=jayson[_0x851b('0xe')]['http']({'port':0x232a});var interaction_log=require(_0x851b('0xf'))('chat-interactions');function respondWithRpcPromise(_0x1f7cb3,_0x12ff9a,_0x1076eb,_0x32a3fe){return new Promise(function(_0x294e73,_0x12c168){var _0x40ec72=_0x32a3fe||client;return _0x40ec72[_0x851b('0x10')](_0x1f7cb3,_0x1076eb)[_0x851b('0x11')](function(_0xf4b5d){logger[_0x851b('0x12')](_0x851b('0x13'),_0x12ff9a,_0x851b('0x14'));logger[_0x851b('0x15')](_0x851b('0x16'),_0x12ff9a,'request\x20sent',JSON['stringify'](_0xf4b5d));if(_0xf4b5d[_0x851b('0x17')]){if(_0xf4b5d[_0x851b('0x17')][_0x851b('0x18')]===0x1f4){logger['error'](_0x851b('0x13'),_0x12ff9a,_0xf4b5d[_0x851b('0x17')]['message']);return _0x12c168(_0xf4b5d[_0x851b('0x17')][_0x851b('0x19')]);}logger[_0x851b('0x17')]('ChatMessage,\x20%s,\x20%s',_0x12ff9a,_0xf4b5d[_0x851b('0x17')][_0x851b('0x19')]);return _0x294e73(_0xf4b5d[_0x851b('0x17')][_0x851b('0x19')]);}else{logger['info'](_0x851b('0x13'),_0x12ff9a,'request\x20sent');_0x294e73(_0xf4b5d[_0x851b('0x1a')][_0x851b('0x19')]);}})['catch'](function(_0x179687){logger[_0x851b('0x17')]('ChatMessage,\x20%s,\x20%s',_0x12ff9a,_0x179687);_0x12c168(_0x179687);});});}function respondWithResult(_0x4e1361,_0x701f07){_0x701f07=_0x701f07||0xc8;return function(_0x19bd98){if(_0x19bd98){return _0x4e1361[_0x851b('0x1b')](_0x701f07)[_0x851b('0x1c')](_0x19bd98);}};}function respondWithFilteredResult(_0x32f804,_0x33f352){return function(_0x27d4df){if(_0x27d4df){var _0x2ce246=typeof _0x33f352[_0x851b('0x1d')]===_0x851b('0x1e')&&typeof _0x33f352[_0x851b('0x1f')]===_0x851b('0x1e');var _0x326753=_0x27d4df[_0x851b('0x20')];var _0x249a78=_0x2ce246?0x0:_0x33f352[_0x851b('0x1d')];var _0x3528f5=_0x2ce246?_0x27d4df[_0x851b('0x20')]:_0x33f352[_0x851b('0x1d')]+_0x33f352[_0x851b('0x1f')];var _0x4a9ad1;if(_0x3528f5>=_0x326753){_0x3528f5=_0x326753;_0x4a9ad1=0xc8;}else{_0x4a9ad1=0xce;}_0x32f804['status'](_0x4a9ad1);return _0x32f804[_0x851b('0x21')]('Content-Range',_0x249a78+'-'+_0x3528f5+'/'+_0x326753)[_0x851b('0x1c')](_0x27d4df);}return null;};}function saveUpdates(_0x417e01){return function(_0x38b2d9){if(_0x38b2d9){return _0x38b2d9[_0x851b('0x22')](_0x417e01)[_0x851b('0x11')](function(_0x2c3f4d){return _0x2c3f4d;});}return null;};}function removeEntity(_0x27851a){return function(_0xff943b){if(_0xff943b){return _0xff943b[_0x851b('0x23')]()['then'](function(){_0x27851a[_0x851b('0x1b')](0xcc)[_0x851b('0x24')]();});}};}function handleEntityNotFound(_0x53a6ee){return function(_0x24b79d){if(!_0x24b79d){_0x53a6ee[_0x851b('0x25')](0x194);}return _0x24b79d;};}function handleError(_0x3e9ad2,_0x175491){_0x175491=_0x175491||0x1f4;return function(_0x2d902b){logger['error'](_0x2d902b[_0x851b('0x26')]);if(_0x2d902b['name']){delete _0x2d902b['name'];}_0x3e9ad2[_0x851b('0x1b')](_0x175491)[_0x851b('0x27')](_0x2d902b);};}exports[_0x851b('0x28')]=function(_0x416c6c,_0x5563d4){var _0x2f297d={},_0x1c1fe6={},_0x404a11={'count':0x0,'rows':[]};var _0x1c7d4d=_[_0x851b('0x29')](db[_0x851b('0x2a')][_0x851b('0x2b')],function(_0x51d358){return{'name':_0x51d358[_0x851b('0x2c')],'type':_0x51d358[_0x851b('0x2d')][_0x851b('0x2e')]};});_0x1c1fe6[_0x851b('0x2f')]=_[_0x851b('0x29')](_0x1c7d4d,'name');_0x1c1fe6[_0x851b('0x30')]=_[_0x851b('0x31')](_0x416c6c['query']);_0x1c1fe6['filters']=_[_0x851b('0x32')](_0x1c1fe6['model'],_0x1c1fe6[_0x851b('0x30')]);_0x2f297d[_0x851b('0x33')]=_[_0x851b('0x32')](_0x1c1fe6['model'],qs[_0x851b('0x34')](_0x416c6c['query'][_0x851b('0x34')]));_0x2f297d[_0x851b('0x33')]=_0x2f297d[_0x851b('0x33')][_0x851b('0x35')]?_0x2f297d['attributes']:_0x1c1fe6['model'];if(!_0x416c6c['query'][_0x851b('0x36')]('nolimit')){_0x2f297d[_0x851b('0x1f')]=qs[_0x851b('0x1f')](_0x416c6c[_0x851b('0x30')][_0x851b('0x1f')]);_0x2f297d[_0x851b('0x1d')]=qs[_0x851b('0x1d')](_0x416c6c['query']['offset']);}_0x2f297d[_0x851b('0x37')]=qs[_0x851b('0x38')](_0x416c6c[_0x851b('0x30')][_0x851b('0x38')]);_0x2f297d[_0x851b('0x39')]=qs[_0x851b('0x3a')](_[_0x851b('0x3b')](_0x416c6c[_0x851b('0x30')],_0x1c1fe6[_0x851b('0x3a')]),_0x1c7d4d);if(_0x416c6c[_0x851b('0x30')][_0x851b('0x3c')]){_0x2f297d[_0x851b('0x39')]=_[_0x851b('0x3d')](_0x2f297d['where'],{'$or':_[_0x851b('0x29')](_0x1c7d4d,function(_0x345f97){if(_0x345f97['type']!=='VIRTUAL'){var _0x2b3237={};_0x2b3237[_0x345f97[_0x851b('0x3e')]]={'$like':'%'+_0x416c6c[_0x851b('0x30')][_0x851b('0x3c')]+'%'};return _0x2b3237;}})});}_0x2f297d=_[_0x851b('0x3d')]({},_0x2f297d,_0x416c6c[_0x851b('0x3f')]);var _0x577dcc={'where':_0x2f297d[_0x851b('0x39')]};return db[_0x851b('0x2a')][_0x851b('0x20')](_0x577dcc)[_0x851b('0x11')](function(_0x54b668){_0x404a11['count']=_0x54b668;if(_0x416c6c['query'][_0x851b('0x40')]){_0x2f297d['include']=[{'all':!![]}];}return db[_0x851b('0x2a')][_0x851b('0x41')](_0x2f297d);})[_0x851b('0x11')](function(_0x454939){_0x404a11[_0x851b('0x42')]=_0x454939;return _0x404a11;})[_0x851b('0x11')](respondWithFilteredResult(_0x5563d4,_0x2f297d))['catch'](handleError(_0x5563d4,null));};exports[_0x851b('0x43')]=function(_0x40ee53,_0x2a821d){var _0x1c7b45={'raw':!![],'where':{'id':_0x40ee53[_0x851b('0x44')]['id']}},_0x13fa3a={};_0x13fa3a['model']=_[_0x851b('0x31')](db[_0x851b('0x2a')][_0x851b('0x2b')]);_0x13fa3a[_0x851b('0x30')]=_[_0x851b('0x31')](_0x40ee53['query']);_0x13fa3a['filters']=_[_0x851b('0x32')](_0x13fa3a[_0x851b('0x2f')],_0x13fa3a[_0x851b('0x30')]);_0x1c7b45[_0x851b('0x33')]=_['intersection'](_0x13fa3a[_0x851b('0x2f')],qs['fields'](_0x40ee53[_0x851b('0x30')]['fields']));_0x1c7b45[_0x851b('0x33')]=_0x1c7b45[_0x851b('0x33')]['length']?_0x1c7b45[_0x851b('0x33')]:_0x13fa3a[_0x851b('0x2f')];if(_0x40ee53[_0x851b('0x30')][_0x851b('0x40')]){_0x1c7b45[_0x851b('0x45')]=[{'all':!![]}];}_0x1c7b45=_[_0x851b('0x3d')]({},_0x1c7b45,_0x40ee53[_0x851b('0x3f')]);return db[_0x851b('0x2a')]['find'](_0x1c7b45)[_0x851b('0x11')](handleEntityNotFound(_0x2a821d,null))[_0x851b('0x11')](respondWithResult(_0x2a821d,null))[_0x851b('0x46')](handleError(_0x2a821d,null));};exports[_0x851b('0x47')]=function(_0x42a48b,_0x379b1){return db[_0x851b('0x2a')][_0x851b('0x47')](_0x42a48b['body'],{})[_0x851b('0x11')](respondWithResult(_0x379b1,0xc9))[_0x851b('0x46')](handleError(_0x379b1,null));};exports[_0x851b('0x22')]=function(_0x189529,_0x3cc46c){if(_0x189529[_0x851b('0x48')]['id']){delete _0x189529[_0x851b('0x48')]['id'];}return db[_0x851b('0x2a')][_0x851b('0x49')]({'where':{'id':_0x189529[_0x851b('0x44')]['id']}})[_0x851b('0x11')](handleEntityNotFound(_0x3cc46c,null))[_0x851b('0x11')](saveUpdates(_0x189529[_0x851b('0x48')],null))[_0x851b('0x11')](respondWithResult(_0x3cc46c,null))['catch'](handleError(_0x3cc46c,null));};exports[_0x851b('0x23')]=function(_0x107c0a,_0x3cb7e5){return db['ChatMessage']['find']({'where':{'id':_0x107c0a[_0x851b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3cb7e5,null))[_0x851b('0x11')](removeEntity(_0x3cb7e5,null))[_0x851b('0x46')](handleError(_0x3cb7e5,null));};exports[_0x851b('0x4a')]=function(_0xe1413c,_0x5297f7){return db[_0x851b('0x2a')][_0x851b('0x4a')]()['then'](respondWithResult(_0x5297f7,null))['catch'](handleError(_0x5297f7,null));};exports[_0x851b('0x4b')]=function(_0x1d9de4,_0x33b1ae){var _0x4a7c36=_0x851b('0x4c');return interactionService['acceptMessage'](_0x1d9de4,_0x4a7c36)[_0x851b('0x11')](respondWithResult(_0x33b1ae,null))[_0x851b('0x46')](handleError(_0x33b1ae,null));};exports['reject']=function(_0x1fb3a2,_0x9702e1){var _0x1b6386={'agent':{},'channel':_0x851b('0x4c')};if(_0x1fb3a2['body']['id']){delete _0x1fb3a2['body']['id'];}_0x1fb3a2[_0x851b('0x48')][_0x851b('0x4d')]=_0x1fb3a2['body'][_0x851b('0x4d')]||_0x1fb3a2[_0x851b('0x4e')]['id'];_0x1b6386[_0x851b('0x4f')]['id']=_0x1fb3a2[_0x851b('0x48')][_0x851b('0x4d')];return db[_0x851b('0x2a')][_0x851b('0x49')]({'where':{'id':_0x1fb3a2[_0x851b('0x44')]['id'],'UserId':null}})[_0x851b('0x11')](handleEntityNotFound(_0x9702e1,null))['then'](function(_0x4ad686){if(_0x4ad686){_0x1b6386[_0x851b('0x19')]=_0x4ad686[_0x851b('0x50')]({'plain':!![]});return db[_0x851b('0x51')][_0x851b('0x49')]({'where':{'id':_0x4ad686['ChatInteractionId']}});}return null;})[_0x851b('0x11')](handleEntityNotFound(_0x9702e1,null))[_0x851b('0x11')](function(_0x3b62f2){if(_0x3b62f2){_0x1b6386[_0x851b('0x52')]=_0x3b62f2[_0x851b('0x50')]({'plain':!![]});interaction_log[_0x851b('0x12')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1fb3a2[_0x851b('0x4e')]['id'],_0x1fb3a2[_0x851b('0x4e')]['name'],_0x1fb3a2[_0x851b('0x4e')][_0x851b('0x53')],_0x1b6386[_0x851b('0x52')]['id'],_0x1fb3a2[_0x851b('0x48')]?JSON['stringify'](_0x1fb3a2['body']):_0x851b('0x54'));return respondWithRpcPromise('RejectMessage',_0x851b('0x55'),_0x1b6386);}return null;})[_0x851b('0x11')](function(_0x5a9ff0){var _0x3852d2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a9ff0[_0x851b('0x19')][_0x851b('0x56')];return db['sequelize']['query'](_0x3852d2,{'type':db[_0x851b('0x57')][_0x851b('0x58')]['SELECT'],'raw':!![]})['then'](function(_0x51e0da){return _0x51e0da;});})[_0x851b('0x11')](function(_0x2f1e7a){if(_0x2f1e7a){_0x1b6386[_0x851b('0x19')][_0x851b('0x59')]=_0x2f1e7a[0x0];if(!_0x1fb3a2[_0x851b('0x48')]['UserId'])return;return db[_0x851b('0x5a')][_0x851b('0x49')]({'where':{'id':_0x1fb3a2[_0x851b('0x48')][_0x851b('0x4d')],'role':'agent'},'attributes':['id',_0x851b('0x3e'),'fullname',_0x851b('0x5b'),'internal'],'raw':!![]});}return null;})[_0x851b('0x11')](function(_0x27ea2f){if(!_0x27ea2f)return null;_0x1b6386[_0x851b('0x19')][_0x851b('0x4f')]=_0x27ea2f;return _0x1b6386;})[_0x851b('0x11')](function(_0x2f084c){if(_0x2f084c){_0x2f084c['message']['interface']=util['format'](_0x851b('0x5c'),_0x1fb3a2[_0x851b('0x4e')][_0x851b('0x3e')]);_0x2f084c[_0x851b('0x19')]['channel']=_0x1b6386[_0x851b('0x5d')];_0x2f084c[_0x851b('0x19')][_0x851b('0x5e')]=_0x1b6386[_0x851b('0x5d')];_0x2f084c[_0x851b('0x19')][_0x851b('0x5f')]=_0x851b('0x60');respondWithRpcPromise(_0x851b('0x61'),'EventManager',{'event':_0x851b('0x62'),'message':_[_0x851b('0x3d')](_0x1b6386[_0x851b('0x19')],JSON[_0x851b('0x63')](_0x1b6386['interaction'][_0x851b('0x64')]))},client9002);return _0x1b6386;}return null;})[_0x851b('0x11')](respondWithResult(_0x9702e1,null))[_0x851b('0x46')](handleError(_0x9702e1,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a07716d..7fbf39d 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 _0x56e3=['update','emit','hook','events','../../mysqldb','ChatMessage','save'];(function(_0x318f2,_0x3bc7b3){var _0x3bcab8=function(_0x19bc02){while(--_0x19bc02){_0x318f2['push'](_0x318f2['shift']());}};_0x3bcab8(++_0x3bc7b3);}(_0x56e3,0x17d));var _0x356e=function(_0x536da7,_0x5686ee){_0x536da7=_0x536da7-0x0;var _0x744edf=_0x56e3[_0x536da7];return _0x744edf;};'use strict';var EventEmitter=require(_0x356e('0x0'));var ChatMessage=require(_0x356e('0x1'))['db'][_0x356e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x356e('0x3'),'afterUpdate':_0x356e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x561596){return function(_0x5c66c9,_0x253610,_0x40a2ba){ChatMessageEvents[_0x356e('0x5')](_0x561596+':'+_0x5c66c9['id'],_0x5c66c9);ChatMessageEvents[_0x356e('0x5')](_0x561596,_0x5c66c9);_0x40a2ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x356e('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x13b9=['remove','hasOwnProperty','exports','ChatMessage'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x13b9,0x117));var _0x913b=function(_0x66b39c,_0xad7354){_0x66b39c=_0x66b39c-0x0;var _0x451fe4=_0x13b9[_0x66b39c];return _0x451fe4;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x913b('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x913b('0x1')};function emitEvent(_0x160366){return function(_0x3a1ae1,_0x422c3e,_0xe52964){ChatMessageEvents['emit'](_0x160366+':'+_0x3a1ae1['id'],_0x3a1ae1);ChatMessageEvents['emit'](_0x160366,_0x3a1ae1);_0xe52964(null);};}for(var e in events){if(events[_0x913b('0x2')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x913b('0x3')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 8fe9294..166e9ef 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 _0x2395=['request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x49ad45,_0x175d1d){var _0xf043c=function(_0x5b93a2){while(--_0x5b93a2){_0x49ad45['push'](_0x49ad45['shift']());}};_0xf043c(++_0x175d1d);}(_0x2395,0x114));var _0x5239=function(_0x886007,_0x55cca6){_0x886007=_0x886007-0x0;var _0x866e9f=_0x2395[_0x886007];return _0x866e9f;};'use strict';var _=require('lodash');var util=require(_0x5239('0x0'));var logger=require(_0x5239('0x1'))(_0x5239('0x2'));var moment=require('moment');var BPromise=require(_0x5239('0x3'));var rp=require(_0x5239('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5239('0x5'));var config=require(_0x5239('0x6'));var attributes=require(_0x5239('0x7'));module['exports']=function(_0x5c4428,_0x30e7b5){return _0x5c4428[_0x5239('0x8')]('ChatMessage',attributes,{'tableName':_0x5239('0x9'),'paranoid':![],'indexes':[{'name':_0x5239('0xa'),'fields':[_0x5239('0xb')],'type':_0x5239('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12e8ef,_0x3674a9,_0x5c5e6e){var _0xd2988c=_0x5c4428['models'];var _0x373c90=_0x12e8ef[_0x5239('0xd')]({'plain':!![]});if(_0x373c90[_0x5239('0xe')][_0x5239('0xf')]()==='in'||_0x373c90[_0x5239('0xe')][_0x5239('0xf')]()===_0x5239('0x10')&&!_0x373c90[_0x5239('0x11')]&&!_[_0x5239('0x12')](_0x373c90[_0x5239('0x13')])){_0xd2988c[_0x5239('0x14')]['findOne']({'where':{'id':_0x373c90[_0x5239('0x15')]}})[_0x5239('0x16')](function(_0x25c541){if(_0x25c541){_0x25c541[_0x5239('0x17')]({'lastMsgAt':_0x373c90[_0x5239('0x18')],'lastMsgDirection':_0x373c90[_0x5239('0xe')][_0x5239('0xf')]()});}})[_0x5239('0x19')](function(_0x40d9fb){console[_0x5239('0x1a')](_0x40d9fb);});}_0x5c5e6e();}},'charset':'utf8mb4','collate':_0x5239('0x1b')});};
\ No newline at end of file
+var _0xe797=['moment','bluebird','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x15664f,_0x3c74c5){var _0x1747f1=function(_0x3ca956){while(--_0x3ca956){_0x15664f['push'](_0x15664f['shift']());}};_0x1747f1(++_0x3c74c5);}(_0xe797,0x1da));var _0x7e79=function(_0x409c62,_0x52c0f5){_0x409c62=_0x409c62-0x0;var _0x15c3b6=_0xe797[_0x409c62];return _0x15c3b6;};'use strict';var _=require('lodash');var util=require(_0x7e79('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7e79('0x1'));var BPromise=require(_0x7e79('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7e79('0x3'));var config=require(_0x7e79('0x4'));var attributes=require(_0x7e79('0x5'));module['exports']=function(_0x3ee086,_0x531453){return _0x3ee086[_0x7e79('0x6')](_0x7e79('0x7'),attributes,{'tableName':_0x7e79('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x7e79('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cdaba,_0xc4d48,_0x4b202f){var _0x388dca=_0x3ee086[_0x7e79('0xa')];var _0x52a7d3=_0x1cdaba[_0x7e79('0xb')]({'plain':!![]});if(_0x52a7d3[_0x7e79('0xc')][_0x7e79('0xd')]()==='in'||_0x52a7d3[_0x7e79('0xc')][_0x7e79('0xd')]()==='out'&&!_0x52a7d3[_0x7e79('0xe')]&&!_[_0x7e79('0xf')](_0x52a7d3[_0x7e79('0x10')])){_0x388dca[_0x7e79('0x11')][_0x7e79('0x12')]({'where':{'id':_0x52a7d3[_0x7e79('0x13')]}})[_0x7e79('0x14')](function(_0x118236){if(_0x118236){_0x118236['update']({'lastMsgAt':_0x52a7d3[_0x7e79('0x15')],'lastMsgDirection':_0x52a7d3[_0x7e79('0xc')]['toLowerCase']()});}})[_0x7e79('0x16')](function(_0x3fc7e4){console['error'](_0x3fc7e4);});}_0x4b202f();}},'charset':_0x7e79('0x17'),'collate':_0x7e79('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 2a72f16..1742f73 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 _0x1a9a=['client','defaults','redis','localhost','socket.io-emitter','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','options','raw','debug','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52ce8e,_0x4dacf5){var _0x489cf9=function(_0x374ab2){while(--_0x374ab2){_0x52ce8e['push'](_0x52ce8e['shift']());}};_0x489cf9(++_0x4dacf5);}(_0x1a9a,0x19b));var _0xa1a9=function(_0x3d0a2c,_0x18e9b8){_0x3d0a2c=_0x3d0a2c-0x0;var _0x2265ab=_0x1a9a[_0x3d0a2c];return _0x2265ab;};'use strict';var _=require(_0xa1a9('0x0'));var util=require(_0xa1a9('0x1'));var moment=require(_0xa1a9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1a9('0x3'))['db'];var utils=require(_0xa1a9('0x4'));var logger=require(_0xa1a9('0x5'))(_0xa1a9('0x6'));var config=require(_0xa1a9('0x7'));var jayson=require(_0xa1a9('0x8'));var client=jayson[_0xa1a9('0x9')]['http']({'port':0x232a});config['redis']=_[_0xa1a9('0xa')](config[_0xa1a9('0xb')],{'host':_0xa1a9('0xc'),'port':0x18eb});var socket=require(_0xa1a9('0xd'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a61bb,_0x56ac7f,_0x2550a7){return new BPromise(function(_0x3744cf,_0x4001e0){return client['request'](_0x2a61bb,_0x2550a7)[_0xa1a9('0xe')](function(_0x510b9e){logger['info'](_0xa1a9('0xf'),_0x56ac7f,_0xa1a9('0x10'));logger['debug'](_0xa1a9('0x11'),_0x56ac7f,'request\x20sent',JSON['stringify'](_0x510b9e));if(_0x510b9e[_0xa1a9('0x12')]){if(_0x510b9e['error'][_0xa1a9('0x13')]===0x1f4){logger['error'](_0xa1a9('0xf'),_0x56ac7f,_0x510b9e[_0xa1a9('0x12')][_0xa1a9('0x14')]);return _0x4001e0(_0x510b9e[_0xa1a9('0x12')][_0xa1a9('0x14')]);}logger[_0xa1a9('0x12')](_0xa1a9('0xf'),_0x56ac7f,_0x510b9e[_0xa1a9('0x12')][_0xa1a9('0x14')]);return _0x3744cf(_0x510b9e[_0xa1a9('0x12')]['message']);}else{logger[_0xa1a9('0x15')](_0xa1a9('0xf'),_0x56ac7f,_0xa1a9('0x10'));_0x3744cf(_0x510b9e[_0xa1a9('0x16')]['message']);}})[_0xa1a9('0x17')](function(_0x422d5b){logger['error'](_0xa1a9('0xf'),_0x56ac7f,_0x422d5b);_0x4001e0(_0x422d5b);});});}exports[_0xa1a9('0x18')]=function(_0x537d74){var _0x86d348=this;return new Promise(function(_0x278136,_0x3f8e5f){return db[_0xa1a9('0x19')][_0xa1a9('0x1a')](_0x537d74['body'],{'raw':_0x537d74[_0xa1a9('0x1b')]?_0x537d74[_0xa1a9('0x1b')][_0xa1a9('0x1c')]===undefined?!![]:![]:!![]})[_0xa1a9('0xe')](function(_0x4b8f7e){logger[_0xa1a9('0x15')](_0xa1a9('0x18'),_0x537d74);logger[_0xa1a9('0x1d')](_0xa1a9('0x18'),_0x537d74,JSON['stringify'](_0x4b8f7e));_0x278136(_0x4b8f7e);})[_0xa1a9('0x17')](function(_0x5aa0e0){logger[_0xa1a9('0x12')](_0xa1a9('0x18'),_0x5aa0e0['message'],_0x537d74);_0x3f8e5f(_0x86d348['error'](0x1f4,_0x5aa0e0[_0xa1a9('0x14')]));});});};
\ No newline at end of file
+var _0x7c24=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','options','raw','then','debug','CreateChatMessage','lodash','util','moment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x7c24,0xf9));var _0x47c2=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7c24[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x47c2('0x0'));var util=require(_0x47c2('0x1'));var moment=require(_0x47c2('0x2'));var BPromise=require(_0x47c2('0x3'));var rs=require(_0x47c2('0x4'));var fs=require('fs');var Redis=require(_0x47c2('0x5'));var db=require(_0x47c2('0x6'))['db'];var utils=require(_0x47c2('0x7'));var logger=require(_0x47c2('0x8'))(_0x47c2('0x9'));var config=require(_0x47c2('0xa'));var jayson=require(_0x47c2('0xb'));var client=jayson[_0x47c2('0xc')][_0x47c2('0xd')]({'port':0x232a});config['redis']=_[_0x47c2('0xe')](config['redis'],{'host':_0x47c2('0xf'),'port':0x18eb});var socket=require(_0x47c2('0x10'))(new Redis(config[_0x47c2('0x11')]));require(_0x47c2('0x12'))[_0x47c2('0x13')](socket);function respondWithRpcPromise(_0x40c88a,_0x398bc8,_0xd84fcc){return new BPromise(function(_0x1dd2d9,_0x5554f2){return client['request'](_0x40c88a,_0xd84fcc)['then'](function(_0x27749e){logger['info'](_0x47c2('0x14'),_0x398bc8,_0x47c2('0x15'));logger['debug'](_0x47c2('0x16'),_0x398bc8,_0x47c2('0x15'),JSON[_0x47c2('0x17')](_0x27749e));if(_0x27749e[_0x47c2('0x18')]){if(_0x27749e[_0x47c2('0x18')][_0x47c2('0x19')]===0x1f4){logger[_0x47c2('0x18')]('ChatMessage,\x20%s,\x20%s',_0x398bc8,_0x27749e[_0x47c2('0x18')][_0x47c2('0x1a')]);return _0x5554f2(_0x27749e['error'][_0x47c2('0x1a')]);}logger[_0x47c2('0x18')](_0x47c2('0x14'),_0x398bc8,_0x27749e[_0x47c2('0x18')][_0x47c2('0x1a')]);return _0x1dd2d9(_0x27749e[_0x47c2('0x18')][_0x47c2('0x1a')]);}else{logger[_0x47c2('0x1b')](_0x47c2('0x14'),_0x398bc8,_0x47c2('0x15'));_0x1dd2d9(_0x27749e[_0x47c2('0x1c')][_0x47c2('0x1a')]);}})[_0x47c2('0x1d')](function(_0x4799b5){logger[_0x47c2('0x18')](_0x47c2('0x14'),_0x398bc8,_0x4799b5);_0x5554f2(_0x4799b5);});});}exports['CreateChatMessage']=function(_0x4fb528){var _0x2c2bf2=this;return new Promise(function(_0x2a8fed,_0x2eaf3e){return db['ChatMessage'][_0x47c2('0x1e')](_0x4fb528['body'],{'raw':_0x4fb528['options']?_0x4fb528[_0x47c2('0x1f')][_0x47c2('0x20')]===undefined?!![]:![]:!![]})[_0x47c2('0x21')](function(_0x242890){logger[_0x47c2('0x1b')]('CreateChatMessage',_0x4fb528);logger[_0x47c2('0x22')](_0x47c2('0x23'),_0x4fb528,JSON[_0x47c2('0x17')](_0x242890));_0x2a8fed(_0x242890);})['catch'](function(_0x5870ff){logger[_0x47c2('0x18')](_0x47c2('0x23'),_0x5870ff[_0x47c2('0x1a')],_0x4fb528);_0x2eaf3e(_0x2c2bf2[_0x47c2('0x18')](0x1f4,_0x5870ff[_0x47c2('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 37ff7ce..cba1248 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 _0x0e85=['update','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4fe1e3,_0x587148){var _0x474845=function(_0x2c8876){while(--_0x2c8876){_0x4fe1e3['push'](_0x4fe1e3['shift']());}};_0x474845(++_0x587148);}(_0x0e85,0x7c));var _0x50e8=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x0e85[_0x369151];return _0x4292d5;};'use strict';var ChatMessageEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatMessageEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatMessageEvents['on'](_0x108edc,_0x42665e);}};
\ No newline at end of file
+var _0x3eea=['removeListener','register','length','./chatMessage.events','remove','update','emit'];(function(_0x266945,_0x5c5e8c){var _0x4477d5=function(_0x18c0b2){while(--_0x18c0b2){_0x266945['push'](_0x266945['shift']());}};_0x4477d5(++_0x5c5e8c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x5a15a2,_0x5873d3){_0x5a15a2=_0x5a15a2-0x0;var _0x2ab56c=_0x3eea[_0x5a15a2];return _0x2ab56c;};'use strict';var ChatMessageEvents=require(_0xa3ee('0x0'));var events=['save',_0xa3ee('0x1'),_0xa3ee('0x2')];function createListener(_0x16512c,_0x1c6a49){return function(_0x46acfa){_0x1c6a49[_0xa3ee('0x3')](_0x16512c,_0x46acfa);};}function removeListener(_0x104913,_0x35ed7d){return function(){ChatMessageEvents[_0xa3ee('0x4')](_0x104913,_0x35ed7d);};}exports[_0xa3ee('0x5')]=function(_0xb93cdb){for(var _0x5776bb=0x0,_0x538bf9=events[_0xa3ee('0x6')];_0x5776bb<_0x538bf9;_0x5776bb++){var _0x4e4588=events[_0x5776bb];var _0x37a3f0=createListener('chatMessage:'+_0x4e4588,_0xb93cdb);ChatMessageEvents['on'](_0x4e4588,_0x37a3f0);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index cbf0549..f3d37ab 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 _0x4596=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f5dad,_0x4313ad){var _0x38e02d=function(_0x44833a){while(--_0x44833a){_0x2f5dad['push'](_0x2f5dad['shift']());}};_0x38e02d(++_0x4313ad);}(_0x4596,0xe3));var _0x6459=function(_0x498b2e,_0x34a4ed){_0x498b2e=_0x498b2e-0x0;var _0x10ff45=_0x4596[_0x498b2e];return _0x10ff45;};'use strict';var multer=require(_0x6459('0x0'));var util=require(_0x6459('0x1'));var path=require('path');var timeout=require(_0x6459('0x2'));var express=require(_0x6459('0x3'));var router=express[_0x6459('0x4')]();var fs_extra=require(_0x6459('0x5'));var auth=require(_0x6459('0x6'));var interaction=require(_0x6459('0x7'));var config=require(_0x6459('0x8'));var controller=require(_0x6459('0x9'));router[_0x6459('0xa')]('/',auth[_0x6459('0xb')](),controller[_0x6459('0xc')]);router[_0x6459('0xa')]('/describe',auth[_0x6459('0xb')](),controller[_0x6459('0xd')]);router['get'](_0x6459('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x6459('0xf')]('/',auth[_0x6459('0xb')](),interaction['tracked'](_0x6459('0x10'),_0x6459('0x11')),controller[_0x6459('0x12')]);router[_0x6459('0x13')]('/:id',controller[_0x6459('0x14')]);router['put'](_0x6459('0x15'),auth[_0x6459('0xb')](),controller[_0x6459('0x16')]);router[_0x6459('0x13')]('/:id/reject',auth[_0x6459('0xb')](),controller[_0x6459('0x17')]);router['delete'](_0x6459('0xe'),auth[_0x6459('0xb')](),controller[_0x6459('0x18')]);module[_0x6459('0x19')]=router;
\ No newline at end of file
+var _0x4a86=['delete','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','update','/:id/accept','/:id/reject','reject'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4a86,0x1a5));var _0x64a8=function(_0x1da2b3,_0xc2e7cf){_0x1da2b3=_0x1da2b3-0x0;var _0x2c1ac6=_0x4a86[_0x1da2b3];return _0x2c1ac6;};'use strict';var multer=require('multer');var util=require(_0x64a8('0x0'));var path=require(_0x64a8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x64a8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x64a8('0x3'));var interaction=require(_0x64a8('0x4'));var config=require('../../config/environment');var controller=require(_0x64a8('0x5'));router[_0x64a8('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x64a8('0x7'),auth[_0x64a8('0x8')](),controller[_0x64a8('0x9')]);router[_0x64a8('0x6')](_0x64a8('0xa'),auth[_0x64a8('0x8')](),controller[_0x64a8('0xb')]);router[_0x64a8('0xc')]('/',auth[_0x64a8('0x8')](),interaction[_0x64a8('0xd')](_0x64a8('0xe'),_0x64a8('0xf')),controller['create']);router['put'](_0x64a8('0xa'),controller[_0x64a8('0x10')]);router['put'](_0x64a8('0x11'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x64a8('0x12'),auth[_0x64a8('0x8')](),controller[_0x64a8('0x13')]);router[_0x64a8('0x14')](_0x64a8('0xa'),auth[_0x64a8('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8b588dc..334c383 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(_0x3411f8,_0x1681d1){var _0x2a7fd2=function(_0x2cda1a){while(--_0x2cda1a){_0x3411f8['push'](_0x3411f8['shift']());}};_0x2a7fd2(++_0x1681d1);}(_0x2032,0xd9));var _0x2203=function(_0x429633,_0x44ea98){_0x429633=_0x429633-0x0;var _0x60087b=_0x2032[_0x429633];return _0x60087b;};'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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x464e93,_0x39e4b9){var _0x591865=function(_0x3c60e1){while(--_0x3c60e1){_0x464e93['push'](_0x464e93['shift']());}};_0x591865(++_0x39e4b9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xb10b[_0x3fe042];return _0x7d4a1f;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 9c03507..e499903 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1cf6df,_0x1ce352){var _0x1fd96a=function(_0x3400d2){while(--_0x3400d2){_0x1cf6df['push'](_0x1cf6df['shift']());}};_0x1fd96a(++_0x1ce352);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _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(_0x30a1d6,_0x57eedc){var _0x5afa8e=function(_0x445377){while(--_0x445377){_0x30a1d6['push'](_0x30a1d6['shift']());}};_0x5afa8e(++_0x57eedc);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 0021db4..0269ef9 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 _0xd7ea=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0xeb5f8d,_0x2549bf){var _0x4b3727=function(_0x337bbd){while(--_0x337bbd){_0xeb5f8d['push'](_0xeb5f8d['shift']());}};_0x4b3727(++_0x2549bf);}(_0xd7ea,0xeb));var _0xad7e=function(_0x180f0f,_0x1d2dc2){_0x180f0f=_0x180f0f-0x0;var _0xfd4e6c=_0xd7ea[_0x180f0f];return _0xfd4e6c;};'use strict';var EventEmitter=require(_0xad7e('0x0'));var ChatOfflineMessage=require(_0xad7e('0x1'))['db'][_0xad7e('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xad7e('0x3')](0x0);var events={'afterCreate':_0xad7e('0x4'),'afterUpdate':'update','afterDestroy':_0xad7e('0x5')};function emitEvent(_0x2c987b){return function(_0x532f0d,_0x33aeb1,_0x4972a9){ChatOfflineMessageEvents['emit'](_0x2c987b+':'+_0x532f0d['id'],_0x532f0d);ChatOfflineMessageEvents[_0xad7e('0x6')](_0x2c987b,_0x532f0d);_0x4972a9(null);};}for(var e in events){if(events[_0xad7e('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xad7e('0x8')](e,emitEvent(event));}}module[_0xad7e('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4607=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x24dac7,_0x2ffbaa){var _0x32c81f=function(_0x5e6475){while(--_0x5e6475){_0x24dac7['push'](_0x24dac7['shift']());}};_0x32c81f(++_0x2ffbaa);}(_0x4607,0x121));var _0x7460=function(_0x1a7987,_0x2b7aa2){_0x1a7987=_0x1a7987-0x0;var _0x4c89c4=_0x4607[_0x1a7987];return _0x4c89c4;};'use strict';var EventEmitter=require(_0x7460('0x0'));var ChatOfflineMessage=require(_0x7460('0x1'))['db'][_0x7460('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7460('0x3')](0x0);var events={'afterCreate':_0x7460('0x4'),'afterUpdate':_0x7460('0x5'),'afterDestroy':_0x7460('0x6')};function emitEvent(_0x2de7f8){return function(_0x353411,_0x53ebd1,_0x117045){ChatOfflineMessageEvents[_0x7460('0x7')](_0x2de7f8+':'+_0x353411['id'],_0x353411);ChatOfflineMessageEvents[_0x7460('0x7')](_0x2de7f8,_0x353411);_0x117045(null);};}for(var e in events){if(events[_0x7460('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x7460('0x9')](e,emitEvent(event));}}module[_0x7460('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index e86be47..2fb7fa1 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 _0x6b78=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x4c3344,_0x4c9e10){var _0x358bde=function(_0x1a1acc){while(--_0x1a1acc){_0x4c3344['push'](_0x4c3344['shift']());}};_0x358bde(++_0x4c9e10);}(_0x6b78,0x1b7));var _0x86b7=function(_0x5b3a85,_0x41f90c){_0x5b3a85=_0x5b3a85-0x0;var _0x1a580b=_0x6b78[_0x5b3a85];return _0x1a580b;};'use strict';var attributes=require(_0x86b7('0x0'));module[_0x86b7('0x1')]=function(_0x3d62f6){return _0x3d62f6[_0x86b7('0x2')](_0x86b7('0x3'),attributes,{'tableName':_0x86b7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x86b7('0x5'),'collate':_0x86b7('0x6')});};
\ No newline at end of file
+var _0xc216=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x148bad,_0x1ac85a){var _0x52aec4=function(_0x4a9faf){while(--_0x4a9faf){_0x148bad['push'](_0x148bad['shift']());}};_0x52aec4(++_0x1ac85a);}(_0xc216,0x9b));var _0x6c21=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0xc216[_0x26f1b2];return _0x1624a4;};'use strict';var attributes=require(_0x6c21('0x0'));module['exports']=function(_0x4000ff){return _0x4000ff[_0x6c21('0x1')](_0x6c21('0x2'),attributes,{'tableName':_0x6c21('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c21('0x4'),'collate':_0x6c21('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index e333c13..0c713d0 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 _0x68c6=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x34e48b,_0x43ee22){var _0x26ff12=function(_0x1890b4){while(--_0x1890b4){_0x34e48b['push'](_0x34e48b['shift']());}};_0x26ff12(++_0x43ee22);}(_0x68c6,0x137));var _0x668c=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x68c6[_0x545bed];return _0x16c79c;};'use strict';var _=require('lodash');var util=require(_0x668c('0x0'));var moment=require(_0x668c('0x1'));var BPromise=require(_0x668c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x668c('0x3'));var logger=require(_0x668c('0x4'))(_0x668c('0x5'));var config=require(_0x668c('0x6'));var jayson=require(_0x668c('0x7'));var client=jayson['client'][_0x668c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3420d5,_0x3c4f87,_0x44b279){return new BPromise(function(_0x483ef6,_0x29758b){return client['request'](_0x3420d5,_0x44b279)[_0x668c('0x9')](function(_0x5ba1b8){logger[_0x668c('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3c4f87,_0x668c('0xb'));logger[_0x668c('0xc')](_0x668c('0xd'),_0x3c4f87,_0x668c('0xb'),JSON[_0x668c('0xe')](_0x5ba1b8));if(_0x5ba1b8[_0x668c('0xf')]){if(_0x5ba1b8[_0x668c('0xf')][_0x668c('0x10')]===0x1f4){logger['error'](_0x668c('0x11'),_0x3c4f87,_0x5ba1b8[_0x668c('0xf')][_0x668c('0x12')]);return _0x29758b(_0x5ba1b8['error'][_0x668c('0x12')]);}logger[_0x668c('0xf')](_0x668c('0x11'),_0x3c4f87,_0x5ba1b8['error']['message']);return _0x483ef6(_0x5ba1b8[_0x668c('0xf')][_0x668c('0x12')]);}else{logger[_0x668c('0xa')](_0x668c('0x11'),_0x3c4f87,_0x668c('0xb'));_0x483ef6(_0x5ba1b8['result'][_0x668c('0x12')]);}})[_0x668c('0x13')](function(_0x1cdb1d){logger[_0x668c('0xf')](_0x668c('0x11'),_0x3c4f87,_0x1cdb1d);_0x29758b(_0x1cdb1d);});});}
\ No newline at end of file
+var _0x8966=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8966,0x184));var _0x6896=function(_0x3edccf,_0xe16b3){_0x3edccf=_0x3edccf-0x0;var _0x2295b5=_0x8966[_0x3edccf];return _0x2295b5;};'use strict';var _=require('lodash');var util=require(_0x6896('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6896('0x1'));var fs=require('fs');var Redis=require(_0x6896('0x2'));var db=require(_0x6896('0x3'))['db'];var utils=require(_0x6896('0x4'));var logger=require('../../config/logger')(_0x6896('0x5'));var config=require('../../config/environment');var jayson=require(_0x6896('0x6'));var client=jayson['client'][_0x6896('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5655f0,_0x53dddc,_0x232300){return new BPromise(function(_0x595a00,_0xa35530){return client['request'](_0x5655f0,_0x232300)['then'](function(_0x54ac4a){logger[_0x6896('0x8')](_0x6896('0x9'),_0x53dddc,_0x6896('0xa'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x53dddc,_0x6896('0xa'),JSON['stringify'](_0x54ac4a));if(_0x54ac4a[_0x6896('0xb')]){if(_0x54ac4a[_0x6896('0xb')][_0x6896('0xc')]===0x1f4){logger[_0x6896('0xb')](_0x6896('0x9'),_0x53dddc,_0x54ac4a[_0x6896('0xb')][_0x6896('0xd')]);return _0xa35530(_0x54ac4a[_0x6896('0xb')][_0x6896('0xd')]);}logger[_0x6896('0xb')](_0x6896('0x9'),_0x53dddc,_0x54ac4a[_0x6896('0xb')][_0x6896('0xd')]);return _0x595a00(_0x54ac4a[_0x6896('0xb')]['message']);}else{logger[_0x6896('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x53dddc,_0x6896('0xa'));_0x595a00(_0x54ac4a[_0x6896('0xe')][_0x6896('0xd')]);}})['catch'](function(_0xe6da5e){logger[_0x6896('0xb')](_0x6896('0x9'),_0x53dddc,_0xe6da5e);_0xa35530(_0xe6da5e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6e9b502..beda700 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 _0x915c=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x1d4297,_0x3cf1f9){var _0x3ba0c9=function(_0x23685d){while(--_0x23685d){_0x1d4297['push'](_0x1d4297['shift']());}};_0x3ba0c9(++_0x3cf1f9);}(_0x915c,0xea));var _0xc915=function(_0x1a98af,_0x377906){_0x1a98af=_0x1a98af-0x0;var _0x23023c=_0x915c[_0x1a98af];return _0x23023c;};'use strict';var multer=require(_0xc915('0x0'));var util=require('util');var path=require(_0xc915('0x1'));var timeout=require(_0xc915('0x2'));var express=require(_0xc915('0x3'));var router=express[_0xc915('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc915('0x5'));var interaction=require(_0xc915('0x6'));var config=require(_0xc915('0x7'));var controller=require(_0xc915('0x8'));router[_0xc915('0x9')]('/',auth[_0xc915('0xa')](),controller[_0xc915('0xb')]);router[_0xc915('0x9')]('/describe',auth[_0xc915('0xa')](),controller[_0xc915('0xc')]);router[_0xc915('0x9')](_0xc915('0xd'),auth[_0xc915('0xa')](),controller[_0xc915('0xe')]);router[_0xc915('0xf')]('/',auth[_0xc915('0xa')](),controller[_0xc915('0x10')]);router[_0xc915('0x11')](_0xc915('0xd'),auth[_0xc915('0xa')](),controller[_0xc915('0x12')]);router['delete'](_0xc915('0xd'),auth[_0xc915('0xa')](),controller[_0xc915('0x13')]);module[_0xc915('0x14')]=router;
\ No newline at end of file
+var _0xde5b=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','update','delete','exports','multer','path','express','Router'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0xde5b,0x13f));var _0xbde5=function(_0x27cbb6,_0x3e5142){_0x27cbb6=_0x27cbb6-0x0;var _0x219d8e=_0xde5b[_0x27cbb6];return _0x219d8e;};'use strict';var multer=require(_0xbde5('0x0'));var util=require('util');var path=require(_0xbde5('0x1'));var timeout=require('connect-timeout');var express=require(_0xbde5('0x2'));var router=express[_0xbde5('0x3')]();var fs_extra=require(_0xbde5('0x4'));var auth=require(_0xbde5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbde5('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xbde5('0x7')]('/',auth[_0xbde5('0x8')](),controller[_0xbde5('0x9')]);router['get']('/describe',auth[_0xbde5('0x8')](),controller[_0xbde5('0xa')]);router[_0xbde5('0x7')](_0xbde5('0xb'),auth[_0xbde5('0x8')](),controller[_0xbde5('0xc')]);router['post']('/',auth[_0xbde5('0x8')](),controller['create']);router[_0xbde5('0xd')]('/:id',auth[_0xbde5('0x8')](),controller[_0xbde5('0xe')]);router[_0xbde5('0xf')](_0xbde5('0xb'),auth[_0xbde5('0x8')](),controller['destroy']);module[_0xbde5('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index cb1e12f..3acdd6c 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 _0xdadb=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xdadb,0x15a));var _0xbdad=function(_0x34584e,_0x6616f4){_0x34584e=_0x34584e-0x0;var _0x570a60=_0xdadb[_0x34584e];return _0x570a60;};'use strict';var Sequelize=require(_0xbdad('0x0'));module[_0xbdad('0x1')]={'name':{'type':Sequelize[_0xbdad('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbdad('0x3')](_0xbdad('0x4'),'timeout'),'defaultValue':_0xbdad('0x4')},'selector':{'type':Sequelize[_0xbdad('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc20c=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0xc20c,0x19e));var _0xcc20=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0xc20c[_0x1ccbcc];return _0x1e873f;};'use strict';var Sequelize=require(_0xcc20('0x0'));module[_0xcc20('0x1')]={'name':{'type':Sequelize[_0xcc20('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcc20('0x3')](_0xcc20('0x4'),_0xcc20('0x5')),'defaultValue':_0xcc20('0x4')},'selector':{'type':Sequelize[_0xcc20('0x2')]},'timeout':{'type':Sequelize[_0xcc20('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 76fdba7..645e5bf 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 _0x74f3=['moment','bluebird','mustache','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','options','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74f3,0x164));var _0x374f=function(_0x4f61a1,_0x35820b){_0x4f61a1=_0x4f61a1-0x0;var _0xae8b64=_0x74f3[_0x4f61a1];return _0xae8b64;};'use strict';var emlformat=require(_0x374f('0x0'));var rimraf=require(_0x374f('0x1'));var zipdir=require(_0x374f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x374f('0x3'));var moment=require(_0x374f('0x4'));var BPromise=require(_0x374f('0x5'));var Mustache=require(_0x374f('0x6'));var util=require('util');var path=require(_0x374f('0x7'));var sox=require(_0x374f('0x8'));var csv=require('to-csv');var ejs=require(_0x374f('0x9'));var fs=require('fs');var fs_extra=require(_0x374f('0xa'));var _=require(_0x374f('0xb'));var squel=require(_0x374f('0xc'));var crypto=require(_0x374f('0xd'));var jsforce=require(_0x374f('0xe'));var deskjs=require(_0x374f('0xf'));var toCsv=require(_0x374f('0x10'));var querystring=require('querystring');var Papa=require(_0x374f('0x11'));var Redis=require(_0x374f('0x12'));var authService=require(_0x374f('0x13'));var qs=require(_0x374f('0x14'));var as=require(_0x374f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x374f('0x16'))(_0x374f('0x17'));var utils=require('../../config/utils');var config=require(_0x374f('0x18'));var licenseUtil=require(_0x374f('0x19'));var db=require(_0x374f('0x1a'))['db'];function respondWithStatusCode(_0x5ac724,_0x46c396){_0x46c396=_0x46c396||0xcc;return function(_0x3abcdb){if(_0x3abcdb){return _0x5ac724['sendStatus'](_0x46c396);}return _0x5ac724[_0x374f('0x1b')](_0x46c396)[_0x374f('0x1c')]();};}function respondWithResult(_0x5eca08,_0xcfcc04){_0xcfcc04=_0xcfcc04||0xc8;return function(_0x504dc8){if(_0x504dc8){return _0x5eca08[_0x374f('0x1b')](_0xcfcc04)[_0x374f('0x1d')](_0x504dc8);}};}function respondWithFilteredResult(_0x1060c4,_0x3ae58d){return function(_0x1215d5){if(_0x1215d5){var _0x21db8c=typeof _0x3ae58d[_0x374f('0x1e')]===_0x374f('0x1f')&&typeof _0x3ae58d[_0x374f('0x20')]===_0x374f('0x1f');var _0x729572=_0x1215d5[_0x374f('0x21')];var _0x13c210=_0x21db8c?0x0:_0x3ae58d['offset'];var _0x55eb4f=_0x21db8c?_0x1215d5[_0x374f('0x21')]:_0x3ae58d['offset']+_0x3ae58d[_0x374f('0x20')];var _0x39532b;if(_0x55eb4f>=_0x729572){_0x55eb4f=_0x729572;_0x39532b=0xc8;}else{_0x39532b=0xce;}_0x1060c4[_0x374f('0x1b')](_0x39532b);return _0x1060c4['set'](_0x374f('0x22'),_0x13c210+'-'+_0x55eb4f+'/'+_0x729572)['json'](_0x1215d5);}return null;};}function patchUpdates(_0xbcc48f){return function(_0x3bcd1e){try{jsonpatch[_0x374f('0x23')](_0x3bcd1e,_0xbcc48f,!![]);}catch(_0x4df021){return BPromise[_0x374f('0x24')](_0x4df021);}return _0x3bcd1e['save']();};}function saveUpdates(_0x42dff9,_0x27b9ae){return function(_0x2de93d){if(_0x2de93d){return _0x2de93d[_0x374f('0x25')](_0x42dff9)[_0x374f('0x26')](function(_0x188db8){return _0x188db8;});}return null;};}function removeEntity(_0x56f727,_0x4d7ccf){return function(_0x1146a3){if(_0x1146a3){return _0x1146a3[_0x374f('0x27')]()[_0x374f('0x26')](function(){_0x56f727['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d13e4,_0x5a6ddd){return function(_0x5418cd){if(!_0x5418cd){_0x2d13e4['sendStatus'](0x194);}return _0x5418cd;};}function handleError(_0x5ada90,_0x29d2b2){_0x29d2b2=_0x29d2b2||0x1f4;return function(_0x253239){logger['error'](_0x253239[_0x374f('0x28')]);if(_0x253239[_0x374f('0x29')]){delete _0x253239[_0x374f('0x29')];}_0x5ada90[_0x374f('0x1b')](_0x29d2b2)['send'](_0x253239);};}exports[_0x374f('0x2a')]=function(_0x4900b9,_0x2b6664){var _0x3d42f0={'raw':!![],'where':{'id':_0x4900b9[_0x374f('0x2b')]['id']}},_0x2a21d6={};_0x2a21d6[_0x374f('0x2c')]=_[_0x374f('0x2d')](db[_0x374f('0x2e')][_0x374f('0x2f')]);_0x2a21d6[_0x374f('0x30')]=_[_0x374f('0x2d')](_0x4900b9['query']);_0x2a21d6[_0x374f('0x31')]=_[_0x374f('0x32')](_0x2a21d6['model'],_0x2a21d6[_0x374f('0x30')]);_0x3d42f0['attributes']=_[_0x374f('0x32')](_0x2a21d6[_0x374f('0x2c')],qs['fields'](_0x4900b9[_0x374f('0x30')]['fields']));_0x3d42f0[_0x374f('0x33')]=_0x3d42f0[_0x374f('0x33')][_0x374f('0x34')]?_0x3d42f0['attributes']:_0x2a21d6[_0x374f('0x2c')];if(_0x4900b9[_0x374f('0x30')][_0x374f('0x35')]){_0x3d42f0[_0x374f('0x36')]=[{'all':!![]}];}_0x3d42f0=_['merge']({},_0x3d42f0,_0x4900b9[_0x374f('0x37')]);return db[_0x374f('0x2e')]['find'](_0x3d42f0)[_0x374f('0x26')](handleEntityNotFound(_0x2b6664,null))['then'](respondWithResult(_0x2b6664,null))['catch'](handleError(_0x2b6664,null));};exports['create']=function(_0x1b84ac,_0x34bdec){return db[_0x374f('0x2e')][_0x374f('0x38')](_0x1b84ac[_0x374f('0x39')],{})[_0x374f('0x26')](respondWithResult(_0x34bdec,0xc9))['catch'](handleError(_0x34bdec,null));};exports[_0x374f('0x25')]=function(_0x50c898,_0x59ff69){if(_0x50c898[_0x374f('0x39')]['id']){delete _0x50c898['body']['id'];}return db[_0x374f('0x2e')]['find']({'where':{'id':_0x50c898['params']['id']}})[_0x374f('0x26')](handleEntityNotFound(_0x59ff69,null))[_0x374f('0x26')](saveUpdates(_0x50c898[_0x374f('0x39')],null))[_0x374f('0x26')](respondWithResult(_0x59ff69,null))[_0x374f('0x3a')](handleError(_0x59ff69,null));};exports[_0x374f('0x27')]=function(_0x134fb1,_0x4138b9){return db['ChatProactiveAction'][_0x374f('0x3b')]({'where':{'id':_0x134fb1['params']['id']}})[_0x374f('0x26')](handleEntityNotFound(_0x4138b9,null))[_0x374f('0x26')](removeEntity(_0x4138b9,null))['catch'](handleError(_0x4138b9,null));};
\ No newline at end of file
+var _0x78b7=['rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','then','destroy','error','stack','name','send','params','keys','ChatProactiveAction'];(function(_0x3bd78d,_0x381dbf){var _0x1c5bad=function(_0x1dc0b7){while(--_0x1dc0b7){_0x3bd78d['push'](_0x3bd78d['shift']());}};_0x1c5bad(++_0x381dbf);}(_0x78b7,0x194));var _0x778b=function(_0x4c117d,_0xf11d85){_0x4c117d=_0x4c117d-0x0;var _0x1d1319=_0x78b7[_0x4c117d];return _0x1d1319;};'use strict';var emlformat=require(_0x778b('0x0'));var rimraf=require(_0x778b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x778b('0x2'));var rp=require(_0x778b('0x3'));var moment=require(_0x778b('0x4'));var BPromise=require(_0x778b('0x5'));var Mustache=require(_0x778b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x778b('0x7'));var csv=require(_0x778b('0x8'));var ejs=require(_0x778b('0x9'));var fs=require('fs');var fs_extra=require(_0x778b('0xa'));var _=require(_0x778b('0xb'));var squel=require(_0x778b('0xc'));var crypto=require('crypto');var jsforce=require(_0x778b('0xd'));var deskjs=require(_0x778b('0xe'));var toCsv=require(_0x778b('0x8'));var querystring=require(_0x778b('0xf'));var Papa=require(_0x778b('0x10'));var Redis=require('ioredis');var authService=require(_0x778b('0x11'));var qs=require(_0x778b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x778b('0x13'));var logger=require(_0x778b('0x14'))(_0x778b('0x15'));var utils=require(_0x778b('0x16'));var config=require(_0x778b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7ca7,_0x8ae3a9){_0x8ae3a9=_0x8ae3a9||0xcc;return function(_0x39584a){if(_0x39584a){return _0x2f7ca7[_0x778b('0x18')](_0x8ae3a9);}return _0x2f7ca7[_0x778b('0x19')](_0x8ae3a9)[_0x778b('0x1a')]();};}function respondWithResult(_0x47026b,_0x5c09c9){_0x5c09c9=_0x5c09c9||0xc8;return function(_0x1a7672){if(_0x1a7672){return _0x47026b[_0x778b('0x19')](_0x5c09c9)[_0x778b('0x1b')](_0x1a7672);}};}function respondWithFilteredResult(_0x389d63,_0x7aa12){return function(_0x52be17){if(_0x52be17){var _0x1bf480=typeof _0x7aa12['offset']===_0x778b('0x1c')&&typeof _0x7aa12[_0x778b('0x1d')]==='undefined';var _0x23069d=_0x52be17['count'];var _0x2d2732=_0x1bf480?0x0:_0x7aa12[_0x778b('0x1e')];var _0x5d9376=_0x1bf480?_0x52be17[_0x778b('0x1f')]:_0x7aa12[_0x778b('0x1e')]+_0x7aa12[_0x778b('0x1d')];var _0x5d4c05;if(_0x5d9376>=_0x23069d){_0x5d9376=_0x23069d;_0x5d4c05=0xc8;}else{_0x5d4c05=0xce;}_0x389d63[_0x778b('0x19')](_0x5d4c05);return _0x389d63[_0x778b('0x20')](_0x778b('0x21'),_0x2d2732+'-'+_0x5d9376+'/'+_0x23069d)[_0x778b('0x1b')](_0x52be17);}return null;};}function patchUpdates(_0x128388){return function(_0xa9c869){try{jsonpatch['apply'](_0xa9c869,_0x128388,!![]);}catch(_0x3f7282){return BPromise[_0x778b('0x22')](_0x3f7282);}return _0xa9c869['save']();};}function saveUpdates(_0x4083c2,_0x4a9564){return function(_0x3736f1){if(_0x3736f1){return _0x3736f1['update'](_0x4083c2)[_0x778b('0x23')](function(_0x4efc37){return _0x4efc37;});}return null;};}function removeEntity(_0x5bf9bb,_0xcef5c){return function(_0x578252){if(_0x578252){return _0x578252[_0x778b('0x24')]()[_0x778b('0x23')](function(){_0x5bf9bb[_0x778b('0x19')](0xcc)[_0x778b('0x1a')]();});}};}function handleEntityNotFound(_0x2095af,_0x4f1b03){return function(_0xa9083a){if(!_0xa9083a){_0x2095af[_0x778b('0x18')](0x194);}return _0xa9083a;};}function handleError(_0x1bc22f,_0x4ce74d){_0x4ce74d=_0x4ce74d||0x1f4;return function(_0x554c67){logger[_0x778b('0x25')](_0x554c67[_0x778b('0x26')]);if(_0x554c67[_0x778b('0x27')]){delete _0x554c67[_0x778b('0x27')];}_0x1bc22f[_0x778b('0x19')](_0x4ce74d)[_0x778b('0x28')](_0x554c67);};}exports['show']=function(_0x527051,_0x480714){var _0x17721e={'raw':!![],'where':{'id':_0x527051[_0x778b('0x29')]['id']}},_0xccca67={};_0xccca67['model']=_[_0x778b('0x2a')](db[_0x778b('0x2b')][_0x778b('0x2c')]);_0xccca67[_0x778b('0x2d')]=_[_0x778b('0x2a')](_0x527051['query']);_0xccca67[_0x778b('0x2e')]=_[_0x778b('0x2f')](_0xccca67['model'],_0xccca67['query']);_0x17721e[_0x778b('0x30')]=_[_0x778b('0x2f')](_0xccca67['model'],qs[_0x778b('0x31')](_0x527051[_0x778b('0x2d')][_0x778b('0x31')]));_0x17721e[_0x778b('0x30')]=_0x17721e[_0x778b('0x30')][_0x778b('0x32')]?_0x17721e['attributes']:_0xccca67['model'];if(_0x527051[_0x778b('0x2d')][_0x778b('0x33')]){_0x17721e['include']=[{'all':!![]}];}_0x17721e=_['merge']({},_0x17721e,_0x527051['options']);return db[_0x778b('0x2b')]['find'](_0x17721e)[_0x778b('0x23')](handleEntityNotFound(_0x480714,null))['then'](respondWithResult(_0x480714,null))[_0x778b('0x34')](handleError(_0x480714,null));};exports[_0x778b('0x35')]=function(_0x51b580,_0x179e51){return db['ChatProactiveAction'][_0x778b('0x35')](_0x51b580[_0x778b('0x36')],{})[_0x778b('0x23')](respondWithResult(_0x179e51,0xc9))[_0x778b('0x34')](handleError(_0x179e51,null));};exports['update']=function(_0x4d49e9,_0x2feb02){if(_0x4d49e9['body']['id']){delete _0x4d49e9[_0x778b('0x36')]['id'];}return db[_0x778b('0x2b')][_0x778b('0x37')]({'where':{'id':_0x4d49e9[_0x778b('0x29')]['id']}})[_0x778b('0x23')](handleEntityNotFound(_0x2feb02,null))[_0x778b('0x23')](saveUpdates(_0x4d49e9['body'],null))['then'](respondWithResult(_0x2feb02,null))[_0x778b('0x34')](handleError(_0x2feb02,null));};exports[_0x778b('0x24')]=function(_0x57aaac,_0x1b3da5){return db[_0x778b('0x2b')][_0x778b('0x37')]({'where':{'id':_0x57aaac[_0x778b('0x29')]['id']}})[_0x778b('0x23')](handleEntityNotFound(_0x1b3da5,null))[_0x778b('0x23')](removeEntity(_0x1b3da5,null))[_0x778b('0x34')](handleError(_0x1b3da5,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 5e64145..9510a9f 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 _0xdbaf=['rimraf','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','bluebird'];(function(_0x284000,_0x3d5360){var _0x45d224=function(_0x4c4385){while(--_0x4c4385){_0x284000['push'](_0x284000['shift']());}};_0x45d224(++_0x3d5360);}(_0xdbaf,0x125));var _0xfdba=function(_0x13eda3,_0x3c908b){_0x13eda3=_0x13eda3-0x0;var _0x419f73=_0xdbaf[_0x13eda3];return _0x419f73;};'use strict';var _=require(_0xfdba('0x0'));var util=require('util');var logger=require(_0xfdba('0x1'))(_0xfdba('0x2'));var moment=require('moment');var BPromise=require(_0xfdba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfdba('0x4'));var config=require('../../config/environment');var attributes=require(_0xfdba('0x5'));module[_0xfdba('0x6')]=function(_0x264ff1,_0x5dead8){return _0x264ff1['define'](_0xfdba('0x7'),attributes,{'tableName':_0xfdba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64ac=['moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','../../config/logger'];(function(_0x47985e,_0x350685){var _0x23e631=function(_0x10838e){while(--_0x10838e){_0x47985e['push'](_0x47985e['shift']());}};_0x23e631(++_0x350685);}(_0x64ac,0x6c));var _0xc64a=function(_0x5c44c9,_0x3350d4){_0x5c44c9=_0x5c44c9-0x0;var _0x31a957=_0x64ac[_0x5c44c9];return _0x31a957;};'use strict';var _=require('lodash');var util=require(_0xc64a('0x0'));var logger=require(_0xc64a('0x1'))('api');var moment=require(_0xc64a('0x2'));var BPromise=require(_0xc64a('0x3'));var rp=require(_0xc64a('0x4'));var fs=require('fs');var path=require(_0xc64a('0x5'));var rimraf=require('rimraf');var config=require(_0xc64a('0x6'));var attributes=require(_0xc64a('0x7'));module[_0xc64a('0x8')]=function(_0x2215fa,_0x224e72){return _0x2215fa[_0xc64a('0x9')](_0xc64a('0xa'),attributes,{'tableName':'chat_proactive_actions','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 790a492..768e8c1 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 _0x469c=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3f0bfc,_0x104792){var _0x52b0c3=function(_0x573330){while(--_0x573330){_0x3f0bfc['push'](_0x3f0bfc['shift']());}};_0x52b0c3(++_0x104792);}(_0x469c,0xff));var _0xc469=function(_0x19a90e,_0xe14b0b){_0x19a90e=_0x19a90e-0x0;var _0xa49b11=_0x469c[_0x19a90e];return _0xa49b11;};'use strict';var _=require(_0xc469('0x0'));var util=require(_0xc469('0x1'));var moment=require(_0xc469('0x2'));var BPromise=require(_0xc469('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc469('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc469('0x5'));var logger=require(_0xc469('0x6'))(_0xc469('0x7'));var config=require('../../config/environment');var jayson=require(_0xc469('0x8'));var client=jayson[_0xc469('0x9')][_0xc469('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x476bec,_0x3b7480,_0x22e0c6){return new BPromise(function(_0x427227,_0x44daac){return client['request'](_0x476bec,_0x22e0c6)[_0xc469('0xb')](function(_0x3b27e8){logger[_0xc469('0xc')](_0xc469('0xd'),_0x3b7480,_0xc469('0xe'));logger[_0xc469('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3b7480,_0xc469('0xe'),JSON[_0xc469('0x10')](_0x3b27e8));if(_0x3b27e8['error']){if(_0x3b27e8['error']['code']===0x1f4){logger[_0xc469('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3b7480,_0x3b27e8['error'][_0xc469('0x12')]);return _0x44daac(_0x3b27e8[_0xc469('0x11')]['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3b7480,_0x3b27e8[_0xc469('0x11')][_0xc469('0x12')]);return _0x427227(_0x3b27e8[_0xc469('0x11')][_0xc469('0x12')]);}else{logger['info'](_0xc469('0xd'),_0x3b7480,_0xc469('0xe'));_0x427227(_0x3b27e8[_0xc469('0x13')]['message']);}})[_0xc469('0x14')](function(_0x12aaf3){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3b7480,_0x12aaf3);_0x44daac(_0x12aaf3);});});}
\ No newline at end of file
+var _0x75d5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x15e8fe,_0x14d43e){var _0x28bd91=function(_0x5bfc87){while(--_0x5bfc87){_0x15e8fe['push'](_0x15e8fe['shift']());}};_0x28bd91(++_0x14d43e);}(_0x75d5,0x1c7));var _0x575d=function(_0x1ad47e,_0x5bc8eb){_0x1ad47e=_0x1ad47e-0x0;var _0x175aa2=_0x75d5[_0x1ad47e];return _0x175aa2;};'use strict';var _=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var moment=require(_0x575d('0x2'));var BPromise=require(_0x575d('0x3'));var rs=require(_0x575d('0x4'));var fs=require('fs');var Redis=require(_0x575d('0x5'));var db=require(_0x575d('0x6'))['db'];var utils=require(_0x575d('0x7'));var logger=require(_0x575d('0x8'))(_0x575d('0x9'));var config=require('../../config/environment');var jayson=require(_0x575d('0xa'));var client=jayson[_0x575d('0xb')][_0x575d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5366ea,_0x2ff9fe,_0x3bc7d5){return new BPromise(function(_0x4b3cb0,_0x478d97){return client[_0x575d('0xd')](_0x5366ea,_0x3bc7d5)[_0x575d('0xe')](function(_0x51c8ed){logger[_0x575d('0xf')](_0x575d('0x10'),_0x2ff9fe,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2ff9fe,_0x575d('0x11'),JSON[_0x575d('0x12')](_0x51c8ed));if(_0x51c8ed['error']){if(_0x51c8ed['error'][_0x575d('0x13')]===0x1f4){logger[_0x575d('0x14')](_0x575d('0x10'),_0x2ff9fe,_0x51c8ed[_0x575d('0x14')]['message']);return _0x478d97(_0x51c8ed[_0x575d('0x14')]['message']);}logger[_0x575d('0x14')](_0x575d('0x10'),_0x2ff9fe,_0x51c8ed['error'][_0x575d('0x15')]);return _0x4b3cb0(_0x51c8ed[_0x575d('0x14')][_0x575d('0x15')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2ff9fe,'request\x20sent');_0x4b3cb0(_0x51c8ed['result'][_0x575d('0x15')]);}})[_0x575d('0x16')](function(_0x4c7307){logger[_0x575d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x2ff9fe,_0x4c7307);_0x478d97(_0x4c7307);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index ee6740c..8d80512 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 _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x12546e,_0x49a072){var _0x5173d9=function(_0x4b860a){while(--_0x4b860a){_0x12546e['push'](_0x12546e['shift']());}};_0x5173d9(++_0x49a072);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x39ab21,_0x265ac4){_0x39ab21=_0x39ab21-0x0;var _0x403d45=_0x3eea[_0x39ab21];return _0x403d45;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2eb2,0x19f));var _0x22eb=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x2eb2[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 6742a2f..54d2c8b 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 _0x0982=['beepall','roundrobin','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x585e84,_0x1d8489){var _0x39f3c4=function(_0x1855a3){while(--_0x1855a3){_0x585e84['push'](_0x585e84['shift']());}};_0x39f3c4(++_0x1d8489);}(_0x0982,0x14b));var _0x2098=function(_0x3c1e73,_0x4b5325){_0x3c1e73=_0x3c1e73-0x0;var _0x4229a3=_0x0982[_0x3c1e73];return _0x4229a3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2098('0x0')],'unique':_0x2098('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2098('0x0')]},'timeout':{'type':Sequelize[_0x2098('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2098('0x3')](_0x2098('0x4'),_0x2098('0x5'),_0x2098('0x6'))}};
\ No newline at end of file
+var _0x6579=['beepall','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6579,0x10f));var _0x9657=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6579[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9657('0x0'));module['exports']={'name':{'type':Sequelize[_0x9657('0x1')],'unique':_0x9657('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9657('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9657('0x3')](_0x9657('0x4'),_0x9657('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 02caf9e..043c1be 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 _0xe49d=['each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','tq.TeamId','from','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','addAgents','isArray','userChatQueue:remove','getAgents','bluebird','util','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','undefined','limit','count','set','update','then','destroy','ChatQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','ChatQueue','rawAttributes','type','getOptions','where','include','query','rows','show','params','model','keys','filters','attributes','intersection','fields','options','find','catch','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','findOne','length','hasOwnProperty','order','sort','pick','ChatQueueId','filter','merge','findAndCountAll','agent','chatPause','createdAt','updatedAt','getTeams','nolimit','addTeams','ids','Team','findAll','online','interface','Agents','sequelize','transaction'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0xe49d,0x1ee));var _0xde49=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe49d[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0xde49('0x0'));var util=require(_0xde49('0x1'));var _=require('lodash');var squel=require(_0xde49('0x2'));var Redis=require(_0xde49('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xde49('0x4'))(_0xde49('0x5'));var config=require(_0xde49('0x6'));var db=require(_0xde49('0x7'))['db'];config[_0xde49('0x8')]=_[_0xde49('0x9')](config['redis'],{'host':_0xde49('0xa'),'port':0x18eb});var socket=require(_0xde49('0xb'))(new Redis(config[_0xde49('0x8')]));require(_0xde49('0xc'))[_0xde49('0xd')](socket);function respondWithStatusCode(_0x406d47,_0x2e4cd3){_0x2e4cd3=_0x2e4cd3||0xcc;return function(_0x1efdb7){if(_0x1efdb7){return _0x406d47['sendStatus'](_0x2e4cd3);}return _0x406d47[_0xde49('0xe')](_0x2e4cd3)[_0xde49('0xf')]();};}function respondWithResult(_0x5715a0,_0x4fcd11){_0x4fcd11=_0x4fcd11||0xc8;return function(_0x36baae){if(_0x36baae){return _0x5715a0[_0xde49('0xe')](_0x4fcd11)[_0xde49('0x10')](_0x36baae);}};}function respondWithFilteredResult(_0x364b6d,_0x8dfb87){return function(_0x589485){if(_0x589485){var _0x11187b=typeof _0x8dfb87[_0xde49('0x11')]===_0xde49('0x12')&&typeof _0x8dfb87[_0xde49('0x13')]===_0xde49('0x12');var _0x28d452=_0x589485[_0xde49('0x14')];var _0x30c3de=_0x11187b?0x0:_0x8dfb87[_0xde49('0x11')];var _0x1bef97=_0x11187b?_0x589485[_0xde49('0x14')]:_0x8dfb87['offset']+_0x8dfb87[_0xde49('0x13')];var _0x100dbd;if(_0x1bef97>=_0x28d452){_0x1bef97=_0x28d452;_0x100dbd=0xc8;}else{_0x100dbd=0xce;}_0x364b6d[_0xde49('0xe')](_0x100dbd);return _0x364b6d[_0xde49('0x15')]('Content-Range',_0x30c3de+'-'+_0x1bef97+'/'+_0x28d452)['json'](_0x589485);}return null;};}function saveUpdates(_0x3b4b7b){return function(_0x200f30){if(_0x200f30){return _0x200f30[_0xde49('0x16')](_0x3b4b7b)[_0xde49('0x17')](function(_0x6e5376){return _0x6e5376;});}return null;};}function removeEntity(_0x34bd53){return function(_0x388093){if(_0x388093){return _0x388093[_0xde49('0x18')]()[_0xde49('0x17')](function(){var _0x14515d=_0x388093['get']({'plain':!![]});var _0x21a2f7=_0xde49('0x19');return db[_0xde49('0x1a')][_0xde49('0x18')]({'where':{'type':_0x21a2f7,'resourceId':_0x14515d['id']}})[_0xde49('0x17')](function(){return _0x388093;});})[_0xde49('0x17')](function(){_0x34bd53[_0xde49('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x113b40){return function(_0x6c6a8){if(!_0x6c6a8){_0x113b40[_0xde49('0x1b')](0x194);}return _0x6c6a8;};}function handleError(_0x25725a,_0x2c593d){_0x2c593d=_0x2c593d||0x1f4;return function(_0x870ff3){logger[_0xde49('0x1c')](_0x870ff3[_0xde49('0x1d')]);if(_0x870ff3[_0xde49('0x1e')]){delete _0x870ff3['name'];}_0x25725a[_0xde49('0xe')](_0x2c593d)[_0xde49('0x1f')](_0x870ff3);};}exports[_0xde49('0x20')]=function(_0x107af0,_0xfd9682){var _0x1547e9={};var _0x3bd9b4={'count':0x0,'rows':[]};var _0x72cdad=_[_0xde49('0x21')](db[_0xde49('0x22')][_0xde49('0x23')],function(_0x1f9422){return{'name':_0x1f9422['fieldName'],'type':_0x1f9422[_0xde49('0x24')]['key']};});_0x1547e9=qs[_0xde49('0x25')](_0x72cdad,_0x107af0);var _0x4fd45a={'where':_0x1547e9[_0xde49('0x26')]};return db[_0xde49('0x22')][_0xde49('0x14')](_0x4fd45a)[_0xde49('0x17')](function(_0x281830){_0x3bd9b4[_0xde49('0x14')]=_0x281830;_0x1547e9[_0xde49('0x27')]=qs[_0xde49('0x27')](_0x107af0[_0xde49('0x28')]);return db[_0xde49('0x22')]['findAll'](_0x1547e9);})[_0xde49('0x17')](function(_0x2a0542){_0x3bd9b4[_0xde49('0x29')]=_0x2a0542;return _0x3bd9b4;})[_0xde49('0x17')](respondWithFilteredResult(_0xfd9682,_0x1547e9))['catch'](handleError(_0xfd9682,null));};exports[_0xde49('0x2a')]=function(_0x427262,_0x366f3b){var _0x5cf36d={'raw':!![],'where':{'id':_0x427262[_0xde49('0x2b')]['id']}},_0x5c3c82={};_0x5c3c82[_0xde49('0x2c')]=_['keys'](db[_0xde49('0x22')]['rawAttributes']);_0x5c3c82['query']=_[_0xde49('0x2d')](_0x427262['query']);_0x5c3c82[_0xde49('0x2e')]=_['intersection'](_0x5c3c82[_0xde49('0x2c')],_0x5c3c82[_0xde49('0x28')]);_0x5cf36d[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x5c3c82[_0xde49('0x2c')],qs[_0xde49('0x31')](_0x427262[_0xde49('0x28')][_0xde49('0x31')]));_0x5cf36d[_0xde49('0x2f')]=_0x5cf36d[_0xde49('0x2f')]['length']?_0x5cf36d[_0xde49('0x2f')]:_0x5c3c82['model'];if(_0x427262[_0xde49('0x28')]['includeAll']){_0x5cf36d[_0xde49('0x27')]=[{'all':!![]}];}_0x5cf36d=_['merge']({},_0x5cf36d,_0x427262[_0xde49('0x32')]);return db[_0xde49('0x22')][_0xde49('0x33')](_0x5cf36d)['then'](handleEntityNotFound(_0x366f3b,null))['then'](respondWithResult(_0x366f3b,null))[_0xde49('0x34')](handleError(_0x366f3b,null));};exports[_0xde49('0x35')]=function(_0x1aa804,_0x5d85fe){return db['ChatQueue'][_0xde49('0x35')](_0x1aa804[_0xde49('0x36')],{})[_0xde49('0x17')](function(_0x30e8d1){var _0x41281f=_0x1aa804['user'][_0xde49('0x37')]({'plain':!![]});if(!_0x41281f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41281f[_0xde49('0x38')]===_0xde49('0x39')){var _0x136998=_0x30e8d1[_0xde49('0x37')]({'plain':!![]});var _0x15928c=_0xde49('0x19');return db[_0xde49('0x3a')][_0xde49('0x33')]({'where':{'name':_0x15928c,'userProfileId':_0x41281f[_0xde49('0x3b')]},'raw':!![]})[_0xde49('0x17')](function(_0x2d669f){if(_0x2d669f&&_0x2d669f[_0xde49('0x3c')]===0x0){return db[_0xde49('0x1a')]['create']({'name':_0x136998[_0xde49('0x1e')],'resourceId':_0x136998['id'],'type':_0x2d669f[_0xde49('0x1e')],'sectionId':_0x2d669f['id']},{})[_0xde49('0x17')](function(){return _0x30e8d1;});}else{return _0x30e8d1;}})[_0xde49('0x34')](function(_0x1006ec){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1006ec);throw _0x1006ec;});}return _0x30e8d1;})['then'](respondWithResult(_0x5d85fe,0xc9))[_0xde49('0x34')](handleError(_0x5d85fe,null));};exports['update']=function(_0x56503b,_0x10502c){if(_0x56503b[_0xde49('0x36')]['id']){delete _0x56503b[_0xde49('0x36')]['id'];}return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0x56503b[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x10502c,null))[_0xde49('0x17')](saveUpdates(_0x56503b['body'],null))[_0xde49('0x17')](respondWithResult(_0x10502c,null))[_0xde49('0x34')](handleError(_0x10502c,null));};exports[_0xde49('0x18')]=function(_0x53e772,_0x44a246){return db['ChatQueue'][_0xde49('0x33')]({'where':{'id':_0x53e772[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x44a246,null))[_0xde49('0x17')](removeEntity(_0x44a246,null))[_0xde49('0x34')](handleError(_0x44a246,null));};exports['describe']=function(_0x1e56a2,_0x91fc48){return db[_0xde49('0x22')]['describe']()[_0xde49('0x17')](respondWithResult(_0x91fc48,null))[_0xde49('0x34')](handleError(_0x91fc48,null));};exports['getMembers']=function(_0xa11662,_0x12ecd5){var _0x25b15d={'raw':!![],'where':{}},_0x535d76={},_0x1317f4;return db[_0xde49('0x22')][_0xde49('0x3d')]({'where':{'id':_0xa11662[_0xde49('0x2b')]['id']}})['then'](handleEntityNotFound(_0x12ecd5,null))[_0xde49('0x17')](function(_0x5f016f){if(_0x5f016f){_0x1317f4=_0x5f016f[_0xde49('0x37')]({'plain':!![]});_0x535d76[_0xde49('0x2c')]=_[_0xde49('0x2d')](db['UserChatQueue']['rawAttributes']);_0x535d76[_0xde49('0x28')]=_[_0xde49('0x2d')](_0xa11662[_0xde49('0x28')]);_0x535d76[_0xde49('0x2e')]=_[_0xde49('0x30')](_0x535d76[_0xde49('0x2c')],_0x535d76[_0xde49('0x28')]);_0x25b15d[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x535d76['model'],qs[_0xde49('0x31')](_0xa11662['query']['fields']));_0x25b15d['attributes']=_0x25b15d['attributes'][_0xde49('0x3e')]?_0x25b15d['attributes']:_0x535d76[_0xde49('0x2c')];if(!_0xa11662[_0xde49('0x28')][_0xde49('0x3f')]('nolimit')){_0x25b15d[_0xde49('0x13')]=qs['limit'](_0xa11662[_0xde49('0x28')]['limit']);_0x25b15d[_0xde49('0x11')]=qs['offset'](_0xa11662[_0xde49('0x28')][_0xde49('0x11')]);}_0x25b15d[_0xde49('0x40')]=qs[_0xde49('0x41')](_0xa11662[_0xde49('0x28')][_0xde49('0x41')]);_0x25b15d[_0xde49('0x26')]=qs['filters'](_[_0xde49('0x42')](_0xa11662[_0xde49('0x28')],_0x535d76[_0xde49('0x2e')]));_0x25b15d['where'][_0xde49('0x43')]=_0x5f016f['id'];if(_0xa11662[_0xde49('0x28')][_0xde49('0x44')]){_0x25b15d[_0xde49('0x26')]=_[_0xde49('0x45')](_0x25b15d[_0xde49('0x26')],{'$or':_[_0xde49('0x21')](_0x25b15d[_0xde49('0x2f')],function(_0x5da66a){var _0x1a8436={};_0x1a8436[_0x5da66a]={'$like':'%'+_0xa11662[_0xde49('0x28')][_0xde49('0x44')]+'%'};return _0x1a8436;})});}_0x25b15d=_['merge']({},_0x25b15d,_0xa11662[_0xde49('0x32')]);return db['UserChatQueue']['findAll'](_0x25b15d);}})[_0xde49('0x17')](function(_0x3f8472){if(_0x3f8472){return db['User'][_0xde49('0x46')]({'where':{'id':_[_0xde49('0x21')](_0x3f8472,'UserId'),'role':_0xde49('0x47')},'attributes':['id','name',_0xde49('0x48'),'updatedAt',_0xde49('0x49')]});}})[_0xde49('0x17')](function(_0x11004c){if(_0x11004c){return{'count':_0x11004c[_0xde49('0x14')],'rows':_[_0xde49('0x21')](_0x11004c[_0xde49('0x29')],function(_0x3d2f36){return{'membername':_0x3d2f36[_0xde49('0x1e')],'UserId':_0x3d2f36['id'],'queue_name':_0x1317f4[_0xde49('0x1e')],'ChatQueueId':_0x1317f4['id'],'interface':util['format']('%s/%s','SIP',_0x3d2f36[_0xde49('0x1e')]),'penalty':0x0,'paused':_0x3d2f36[_0xde49('0x48')],'createdAt':_0x3d2f36[_0xde49('0x49')],'updatedAt':_0x3d2f36[_0xde49('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xde49('0x17')](respondWithFilteredResult(_0x12ecd5,_0x25b15d))[_0xde49('0x34')](handleError(_0x12ecd5,null));};exports[_0xde49('0x4b')]=function(_0x4f35f2,_0x1bde6f){var _0x292455={};var _0x383c2f={};var _0xe576f5;var _0x17282f;return db['ChatQueue'][_0xde49('0x3d')]({'where':{'id':_0x4f35f2[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x1bde6f,null))['then'](function(_0x3004de){if(_0x3004de){_0xe576f5=_0x3004de;_0x383c2f['model']=_[_0xde49('0x2d')](db['Team'][_0xde49('0x23')]);_0x383c2f[_0xde49('0x28')]=_['keys'](_0x4f35f2['query']);_0x383c2f[_0xde49('0x2e')]=_[_0xde49('0x30')](_0x383c2f[_0xde49('0x2c')],_0x383c2f[_0xde49('0x28')]);_0x292455[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x383c2f[_0xde49('0x2c')],qs['fields'](_0x4f35f2['query'][_0xde49('0x31')]));_0x292455[_0xde49('0x2f')]=_0x292455[_0xde49('0x2f')][_0xde49('0x3e')]?_0x292455[_0xde49('0x2f')]:_0x383c2f['model'];_0x292455['order']=qs[_0xde49('0x41')](_0x4f35f2[_0xde49('0x28')][_0xde49('0x41')]);_0x292455['where']=qs['filters'](_[_0xde49('0x42')](_0x4f35f2[_0xde49('0x28')],_0x383c2f[_0xde49('0x2e')]));if(_0x4f35f2[_0xde49('0x28')][_0xde49('0x44')]){_0x292455[_0xde49('0x26')]=_[_0xde49('0x45')](_0x292455[_0xde49('0x26')],{'$or':_['map'](_0x292455[_0xde49('0x2f')],function(_0x1131da){var _0x451f0b={};_0x451f0b[_0x1131da]={'$like':'%'+_0x4f35f2['query']['filter']+'%'};return _0x451f0b;})});}_0x292455=_['merge']({},_0x292455,_0x4f35f2[_0xde49('0x32')]);return _0xe576f5['getTeams'](_0x292455);}})[_0xde49('0x17')](function(_0x41cddc){if(_0x41cddc){_0x17282f=_0x41cddc[_0xde49('0x3e')];if(!_0x4f35f2[_0xde49('0x28')][_0xde49('0x3f')](_0xde49('0x4c'))){_0x292455['limit']=qs['limit'](_0x4f35f2[_0xde49('0x28')][_0xde49('0x13')]);_0x292455['offset']=qs['offset'](_0x4f35f2[_0xde49('0x28')][_0xde49('0x11')]);}return _0xe576f5[_0xde49('0x4b')](_0x292455);}})[_0xde49('0x17')](function(_0x4290f1){if(_0x4290f1){return _0x4290f1?{'count':_0x17282f,'rows':_0x4290f1}:null;}})[_0xde49('0x17')](respondWithResult(_0x1bde6f,null))['catch'](handleError(_0x1bde6f,null));};exports[_0xde49('0x4d')]=function(_0x358e75,_0x4d25ff){var _0x2f2f41=_0x358e75[_0xde49('0x36')][_0xde49('0x4e')];return db[_0xde49('0x4f')][_0xde49('0x50')]({'where':{'id':_0x2f2f41},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xde49('0x51'),'voicePause',_0xde49('0x52')],'raw':!![]}]})[_0xde49('0x17')](function(_0x5d5ac2){if(_0x5d5ac2){var _0x3506aa=_['flatMap'](_0x5d5ac2,function(_0x11bfe4){var _0x53750e=_0x11bfe4['get']({'plain':!![]});return _0x53750e[_0xde49('0x53')];});return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0x358e75[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](function(_0x3b41ee){return db[_0xde49('0x54')][_0xde49('0x55')](function(_0x3bf59a){return _0x3b41ee[_0xde49('0x4d')](_0x2f2f41,{'transaction':_0x3bf59a})[_0xde49('0x17')](function(){return BPromise[_0xde49('0x56')](_0x3506aa,function(_0x27fff2){return db[_0xde49('0x57')][_0xde49('0x58')]({'where':{'UserId':_0x27fff2['id'],'ChatQueueId':_0x358e75[_0xde49('0x2b')]['id']},'transaction':_0x3bf59a});});})[_0xde49('0x17')](function(){_0x3506aa[_0xde49('0x59')](function(_0x246957){socket[_0xde49('0x5a')](_0xde49('0x5b'),{'UserId':_0x246957['id'],'ChatQueueId':_0x3b41ee['id']});});});});});}})[_0xde49('0x17')](respondWithStatusCode(_0x4d25ff,null))[_0xde49('0x34')](handleError(_0x4d25ff,null));};exports[_0xde49('0x5c')]=function(_0x92c259,_0x4ee992){return db['Team'][_0xde49('0x50')]({'where':{'id':_0x92c259['query'][_0xde49('0x4e')]},'attributes':['id'],'include':[{'model':db[_0xde49('0x5d')],'as':_0xde49('0x53'),'attributes':['id'],'raw':!![]}]})[_0xde49('0x17')](handleEntityNotFound(_0x4ee992,null))[_0xde49('0x17')](function(_0x189805){var _0x8af480=_['map'](_0x189805,'id');var _0x1314b5=[];var _0x49d4f2=[];var _0x1128e3=squel[_0xde49('0x5e')]();_0x1128e3['field'](_0xde49('0x5f'))[_0xde49('0x60')]('team_has_chat_queues','tq')[_0xde49('0x61')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xde49('0x26')](_0xde49('0x62'),_0x92c259['params']['id']);for(var _0x4c27cf=0x0;_0x4c27cf<_0x189805['length'];_0x4c27cf+=0x1){let _0x38d1ce=_0x189805[_0x4c27cf];for(var _0x302f64=0x0;_0x302f64<_0x38d1ce[_0xde49('0x53')][_0xde49('0x3e')];_0x302f64+=0x1){let _0x488ae1=_0x38d1ce[_0xde49('0x53')][_0x302f64];var _0x3cb7be=_0x1128e3[_0xde49('0x63')]();_0x3cb7be[_0xde49('0x26')](_0xde49('0x64'),_0x488ae1['id']);_0x49d4f2[_0xde49('0x65')](db[_0xde49('0x54')][_0xde49('0x28')](_0x3cb7be[_0xde49('0x66')](),{'type':db['sequelize']['QueryTypes'][_0xde49('0x67')]})[_0xde49('0x17')](function(_0x56ae21){if(_0x56ae21['length']===0x1){return _0x488ae1['id'];}else{var _0x2edb49=_[_0xde49('0x68')](_[_0xde49('0x21')](_0x56ae21,_0xde49('0x69')),function(_0xb7d482){return _[_0xde49('0x6a')](_0x8af480,_0xb7d482);});if(_0x2edb49){return _0x488ae1['id'];}}}));}}return BPromise[_0xde49('0x6b')](_0x49d4f2)[_0xde49('0x17')](function(_0x7c7c0d){_0x1314b5=_(_0x1314b5)['union'](_0x7c7c0d)[_0xde49('0x6c')]()[_0xde49('0x6d')]();return db['ChatQueue']['find']({'where':{'id':_0x92c259[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](function(_0x320255){return db[_0xde49('0x54')][_0xde49('0x55')](function(_0x1b2418){return _0x320255[_0xde49('0x5c')](_0x92c259['query'][_0xde49('0x4e')],{'transaction':_0x1b2418})[_0xde49('0x17')](function(){if(!_[_0xde49('0x6e')](_0x1314b5)){return _0x320255[_0xde49('0x6f')](_0x1314b5,{'transaction':_0x1b2418});}})[_0xde49('0x17')](function(){_0x1314b5[_0xde49('0x59')](function(_0x1c3b45){socket[_0xde49('0x5a')]('userChatQueue:remove',{'UserId':_0x1c3b45,'ChatQueueId':_0x320255['id']});});});});});});})[_0xde49('0x17')](respondWithStatusCode(_0x4ee992,null))[_0xde49('0x34')](handleError(_0x4ee992,null));};exports[_0xde49('0x70')]=function(_0xdc582d,_0x1058a7){return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0xdc582d[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x1058a7,null))[_0xde49('0x17')](function(_0x22e078){if(_0x22e078){return _0x22e078[_0xde49('0x70')](_0xdc582d[_0xde49('0x36')][_0xde49('0x4e')],_['omit'](_0xdc582d[_0xde49('0x36')],[_0xde49('0x4e'),'id'])||{})['spread'](function(_0x4d73f4){for(var _0x8b06b5=0x0;_0x8b06b5<_0xdc582d[_0xde49('0x36')][_0xde49('0x4e')][_0xde49('0x3e')];_0x8b06b5+=0x1){socket[_0xde49('0x5a')](_0xde49('0x5b'),{'UserId':Number(_0xdc582d[_0xde49('0x36')][_0xde49('0x4e')][_0x8b06b5]),'ChatQueueId':Number(_0xdc582d['params']['id'])});}return _0x4d73f4;});}})[_0xde49('0x17')](respondWithResult(_0x1058a7,null))['catch'](handleError(_0x1058a7,null));};exports['removeAgents']=function(_0x186805,_0x55e91a){return db[_0xde49('0x22')][_0xde49('0x33')]({'where':{'id':_0x186805[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x55e91a,null))[_0xde49('0x17')](function(_0x584ed7){if(_0x584ed7){return _0x584ed7[_0xde49('0x6f')](_0x186805['query'][_0xde49('0x4e')])[_0xde49('0x17')](function(){if(_[_0xde49('0x71')](_0x186805[_0xde49('0x28')][_0xde49('0x4e')])){for(var _0x3c3a36=0x0;_0x3c3a36<_0x186805[_0xde49('0x28')][_0xde49('0x4e')][_0xde49('0x3e')];_0x3c3a36+=0x1){socket[_0xde49('0x5a')](_0xde49('0x72'),{'UserId':Number(_0x186805['query'][_0xde49('0x4e')][_0x3c3a36]),'ChatQueueId':Number(_0x186805[_0xde49('0x2b')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x186805['query'][_0xde49('0x4e')]),'ChatQueueId':Number(_0x186805['params']['id'])});}});}})[_0xde49('0x17')](respondWithStatusCode(_0x55e91a,null))[_0xde49('0x34')](handleError(_0x55e91a,null));};exports['getAgents']=function(_0x2d66e4,_0x351ed8){var _0x395c67={};var _0x505a93={};var _0x38d1a4;var _0x198ec8;return db[_0xde49('0x22')]['findOne']({'where':{'id':_0x2d66e4[_0xde49('0x2b')]['id']}})[_0xde49('0x17')](handleEntityNotFound(_0x351ed8,null))[_0xde49('0x17')](function(_0x4eedbc){if(_0x4eedbc){_0x38d1a4=_0x4eedbc;_0x505a93[_0xde49('0x2c')]=_['keys'](db[_0xde49('0x5d')][_0xde49('0x23')]);_0x505a93['query']=_[_0xde49('0x2d')](_0x2d66e4['query']);_0x505a93[_0xde49('0x2e')]=_[_0xde49('0x30')](_0x505a93['model'],_0x505a93[_0xde49('0x28')]);_0x395c67[_0xde49('0x2f')]=_[_0xde49('0x30')](_0x505a93[_0xde49('0x2c')],qs[_0xde49('0x31')](_0x2d66e4[_0xde49('0x28')][_0xde49('0x31')]));_0x395c67[_0xde49('0x2f')]=_0x395c67[_0xde49('0x2f')][_0xde49('0x3e')]?_0x395c67['attributes']:_0x505a93['model'];_0x395c67['order']=qs[_0xde49('0x41')](_0x2d66e4[_0xde49('0x28')][_0xde49('0x41')]);_0x395c67[_0xde49('0x26')]=qs[_0xde49('0x2e')](_[_0xde49('0x42')](_0x2d66e4['query'],_0x505a93[_0xde49('0x2e')]));if(_0x2d66e4['query']['filter']){_0x395c67[_0xde49('0x26')]=_[_0xde49('0x45')](_0x395c67['where'],{'$or':_[_0xde49('0x21')](_0x395c67[_0xde49('0x2f')],function(_0x30b1c7){var _0x1a1964={};_0x1a1964[_0x30b1c7]={'$like':'%'+_0x2d66e4['query'][_0xde49('0x44')]+'%'};return _0x1a1964;})});}_0x395c67=_[_0xde49('0x45')]({},_0x395c67,_0x2d66e4['options']);return _0x38d1a4[_0xde49('0x73')](_0x395c67);}})[_0xde49('0x17')](function(_0x30fc76){if(_0x30fc76){_0x198ec8=_0x30fc76[_0xde49('0x3e')];if(!_0x2d66e4[_0xde49('0x28')][_0xde49('0x3f')]('nolimit')){_0x395c67[_0xde49('0x13')]=qs[_0xde49('0x13')](_0x2d66e4['query'][_0xde49('0x13')]);_0x395c67[_0xde49('0x11')]=qs['offset'](_0x2d66e4[_0xde49('0x28')][_0xde49('0x11')]);}return _0x38d1a4['getAgents'](_0x395c67);}})[_0xde49('0x17')](function(_0x255f2c){if(_0x255f2c){return _0x255f2c?{'count':_0x198ec8,'rows':_0x255f2c}:null;}})[_0xde49('0x17')](respondWithResult(_0x351ed8,null))[_0xde49('0x34')](handleError(_0x351ed8,null));};
\ No newline at end of file
+var _0xceea=['count','set','then','destroy','UserProfileResource','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','autoAssociation','update','describe','getMembers','findOne','get','UserChatQueue','hasOwnProperty','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','nolimit','addTeams','Agents','online','flatMap','transaction','each','findOrCreate','forEach','emit','ids','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','bluebird','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','limit','undefined'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xceea,0xe7));var _0xacee=function(_0x49b1ca,_0x32f161){_0x49b1ca=_0x49b1ca-0x0;var _0x5650bb=_0xceea[_0x49b1ca];return _0x5650bb;};'use strict';var BPromise=require(_0xacee('0x0'));var util=require('util');var _=require(_0xacee('0x1'));var squel=require(_0xacee('0x2'));var Redis=require('ioredis');var qs=require(_0xacee('0x3'));var logger=require(_0xacee('0x4'))(_0xacee('0x5'));var config=require('../../config/environment');var db=require(_0xacee('0x6'))['db'];config['redis']=_[_0xacee('0x7')](config[_0xacee('0x8')],{'host':_0xacee('0x9'),'port':0x18eb});var socket=require(_0xacee('0xa'))(new Redis(config[_0xacee('0x8')]));require(_0xacee('0xb'))[_0xacee('0xc')](socket);function respondWithStatusCode(_0x9575f3,_0x133999){_0x133999=_0x133999||0xcc;return function(_0x179935){if(_0x179935){return _0x9575f3['sendStatus'](_0x133999);}return _0x9575f3[_0xacee('0xd')](_0x133999)[_0xacee('0xe')]();};}function respondWithResult(_0x55ea18,_0x593b1f){_0x593b1f=_0x593b1f||0xc8;return function(_0x4ec6d9){if(_0x4ec6d9){return _0x55ea18[_0xacee('0xd')](_0x593b1f)[_0xacee('0xf')](_0x4ec6d9);}};}function respondWithFilteredResult(_0x46ce65,_0x2cb230){return function(_0x557c68){if(_0x557c68){var _0x4d0489=typeof _0x2cb230[_0xacee('0x10')]==='undefined'&&typeof _0x2cb230[_0xacee('0x11')]===_0xacee('0x12');var _0x181d9e=_0x557c68[_0xacee('0x13')];var _0x38073a=_0x4d0489?0x0:_0x2cb230['offset'];var _0x328784=_0x4d0489?_0x557c68['count']:_0x2cb230[_0xacee('0x10')]+_0x2cb230[_0xacee('0x11')];var _0x57f589;if(_0x328784>=_0x181d9e){_0x328784=_0x181d9e;_0x57f589=0xc8;}else{_0x57f589=0xce;}_0x46ce65['status'](_0x57f589);return _0x46ce65[_0xacee('0x14')]('Content-Range',_0x38073a+'-'+_0x328784+'/'+_0x181d9e)[_0xacee('0xf')](_0x557c68);}return null;};}function saveUpdates(_0x22bd6e){return function(_0x749fa4){if(_0x749fa4){return _0x749fa4['update'](_0x22bd6e)[_0xacee('0x15')](function(_0x1885ce){return _0x1885ce;});}return null;};}function removeEntity(_0x49fed2){return function(_0x2b4457){if(_0x2b4457){return _0x2b4457[_0xacee('0x16')]()['then'](function(){var _0x2d1101=_0x2b4457['get']({'plain':!![]});var _0x23d3ed='ChatQueues';return db[_0xacee('0x17')]['destroy']({'where':{'type':_0x23d3ed,'resourceId':_0x2d1101['id']}})[_0xacee('0x15')](function(){return _0x2b4457;});})[_0xacee('0x15')](function(){_0x49fed2[_0xacee('0xd')](0xcc)[_0xacee('0xe')]();});}};}function handleEntityNotFound(_0x315908){return function(_0x2d3742){if(!_0x2d3742){_0x315908['sendStatus'](0x194);}return _0x2d3742;};}function handleError(_0x4509c6,_0x5021ea){_0x5021ea=_0x5021ea||0x1f4;return function(_0x436f30){logger[_0xacee('0x18')](_0x436f30['stack']);if(_0x436f30[_0xacee('0x19')]){delete _0x436f30[_0xacee('0x19')];}_0x4509c6[_0xacee('0xd')](_0x5021ea)[_0xacee('0x1a')](_0x436f30);};}exports[_0xacee('0x1b')]=function(_0xfb9adb,_0x2c07a8){var _0x4e69a2={};var _0x57e87e={'count':0x0,'rows':[]};var _0x3036f2=_[_0xacee('0x1c')](db[_0xacee('0x1d')][_0xacee('0x1e')],function(_0x44514c){return{'name':_0x44514c[_0xacee('0x1f')],'type':_0x44514c[_0xacee('0x20')][_0xacee('0x21')]};});_0x4e69a2=qs[_0xacee('0x22')](_0x3036f2,_0xfb9adb);var _0x37e3a7={'where':_0x4e69a2[_0xacee('0x23')]};return db[_0xacee('0x1d')][_0xacee('0x13')](_0x37e3a7)['then'](function(_0x403315){_0x57e87e['count']=_0x403315;_0x4e69a2[_0xacee('0x24')]=qs[_0xacee('0x24')](_0xfb9adb[_0xacee('0x25')]);return db[_0xacee('0x1d')][_0xacee('0x26')](_0x4e69a2);})[_0xacee('0x15')](function(_0x26da1c){_0x57e87e[_0xacee('0x27')]=_0x26da1c;return _0x57e87e;})[_0xacee('0x15')](respondWithFilteredResult(_0x2c07a8,_0x4e69a2))[_0xacee('0x28')](handleError(_0x2c07a8,null));};exports[_0xacee('0x29')]=function(_0x308df7,_0x443634){var _0x21d9d6={'raw':!![],'where':{'id':_0x308df7[_0xacee('0x2a')]['id']}},_0x12fdd4={};_0x12fdd4[_0xacee('0x2b')]=_[_0xacee('0x2c')](db['ChatQueue'][_0xacee('0x1e')]);_0x12fdd4['query']=_[_0xacee('0x2c')](_0x308df7[_0xacee('0x25')]);_0x12fdd4[_0xacee('0x2d')]=_[_0xacee('0x2e')](_0x12fdd4['model'],_0x12fdd4[_0xacee('0x25')]);_0x21d9d6[_0xacee('0x2f')]=_[_0xacee('0x2e')](_0x12fdd4[_0xacee('0x2b')],qs[_0xacee('0x30')](_0x308df7[_0xacee('0x25')][_0xacee('0x30')]));_0x21d9d6[_0xacee('0x2f')]=_0x21d9d6['attributes'][_0xacee('0x31')]?_0x21d9d6[_0xacee('0x2f')]:_0x12fdd4[_0xacee('0x2b')];if(_0x308df7['query'][_0xacee('0x32')]){_0x21d9d6[_0xacee('0x24')]=[{'all':!![]}];}_0x21d9d6=_[_0xacee('0x33')]({},_0x21d9d6,_0x308df7[_0xacee('0x34')]);return db[_0xacee('0x1d')][_0xacee('0x35')](_0x21d9d6)[_0xacee('0x15')](handleEntityNotFound(_0x443634,null))[_0xacee('0x15')](respondWithResult(_0x443634,null))[_0xacee('0x28')](handleError(_0x443634,null));};exports[_0xacee('0x36')]=function(_0x4bd734,_0x56dba5){return db[_0xacee('0x1d')]['create'](_0x4bd734[_0xacee('0x37')],{})['then'](function(_0x30b0ca){var _0x435ea1=_0x4bd734['user']['get']({'plain':!![]});if(!_0x435ea1)throw new Error(_0xacee('0x38'));if(_0x435ea1['role']==='user'){var _0x444f1f=_0x30b0ca['get']({'plain':!![]});var _0x117b31=_0xacee('0x39');return db[_0xacee('0x3a')]['find']({'where':{'name':_0x117b31,'userProfileId':_0x435ea1['userProfileId']},'raw':!![]})['then'](function(_0x28f677){if(_0x28f677&&_0x28f677[_0xacee('0x3b')]===0x0){return db[_0xacee('0x17')][_0xacee('0x36')]({'name':_0x444f1f[_0xacee('0x19')],'resourceId':_0x444f1f['id'],'type':_0x28f677['name'],'sectionId':_0x28f677['id']},{})[_0xacee('0x15')](function(){return _0x30b0ca;});}else{return _0x30b0ca;}})[_0xacee('0x28')](function(_0x1f6d54){logger[_0xacee('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f6d54);throw _0x1f6d54;});}return _0x30b0ca;})[_0xacee('0x15')](respondWithResult(_0x56dba5,0xc9))[_0xacee('0x28')](handleError(_0x56dba5,null));};exports[_0xacee('0x3c')]=function(_0x5306b3,_0x17602f){if(_0x5306b3[_0xacee('0x37')]['id']){delete _0x5306b3[_0xacee('0x37')]['id'];}return db[_0xacee('0x1d')]['find']({'where':{'id':_0x5306b3[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x17602f,null))[_0xacee('0x15')](saveUpdates(_0x5306b3[_0xacee('0x37')],null))['then'](respondWithResult(_0x17602f,null))['catch'](handleError(_0x17602f,null));};exports[_0xacee('0x16')]=function(_0x1e3a60,_0x46f2bb){return db[_0xacee('0x1d')]['find']({'where':{'id':_0x1e3a60[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x46f2bb,null))[_0xacee('0x15')](removeEntity(_0x46f2bb,null))[_0xacee('0x28')](handleError(_0x46f2bb,null));};exports[_0xacee('0x3d')]=function(_0x2e8520,_0x5e77ab){return db[_0xacee('0x1d')][_0xacee('0x3d')]()[_0xacee('0x15')](respondWithResult(_0x5e77ab,null))[_0xacee('0x28')](handleError(_0x5e77ab,null));};exports[_0xacee('0x3e')]=function(_0xf5785f,_0x326871){var _0x4e0e4a={'raw':!![],'where':{}},_0xd93c1a={},_0x3237de;return db['ChatQueue'][_0xacee('0x3f')]({'where':{'id':_0xf5785f[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x326871,null))[_0xacee('0x15')](function(_0xad2411){if(_0xad2411){_0x3237de=_0xad2411[_0xacee('0x40')]({'plain':!![]});_0xd93c1a[_0xacee('0x2b')]=_['keys'](db[_0xacee('0x41')][_0xacee('0x1e')]);_0xd93c1a[_0xacee('0x25')]=_[_0xacee('0x2c')](_0xf5785f[_0xacee('0x25')]);_0xd93c1a[_0xacee('0x2d')]=_[_0xacee('0x2e')](_0xd93c1a[_0xacee('0x2b')],_0xd93c1a[_0xacee('0x25')]);_0x4e0e4a['attributes']=_[_0xacee('0x2e')](_0xd93c1a[_0xacee('0x2b')],qs[_0xacee('0x30')](_0xf5785f[_0xacee('0x25')][_0xacee('0x30')]));_0x4e0e4a[_0xacee('0x2f')]=_0x4e0e4a['attributes']['length']?_0x4e0e4a['attributes']:_0xd93c1a['model'];if(!_0xf5785f[_0xacee('0x25')][_0xacee('0x42')]('nolimit')){_0x4e0e4a[_0xacee('0x11')]=qs[_0xacee('0x11')](_0xf5785f[_0xacee('0x25')]['limit']);_0x4e0e4a[_0xacee('0x10')]=qs[_0xacee('0x10')](_0xf5785f[_0xacee('0x25')]['offset']);}_0x4e0e4a['order']=qs[_0xacee('0x43')](_0xf5785f[_0xacee('0x25')]['sort']);_0x4e0e4a['where']=qs['filters'](_[_0xacee('0x44')](_0xf5785f[_0xacee('0x25')],_0xd93c1a['filters']));_0x4e0e4a[_0xacee('0x23')][_0xacee('0x45')]=_0xad2411['id'];if(_0xf5785f[_0xacee('0x25')][_0xacee('0x46')]){_0x4e0e4a[_0xacee('0x23')]=_['merge'](_0x4e0e4a[_0xacee('0x23')],{'$or':_[_0xacee('0x1c')](_0x4e0e4a['attributes'],function(_0x518ae6){var _0x3b6e52={};_0x3b6e52[_0x518ae6]={'$like':'%'+_0xf5785f['query'][_0xacee('0x46')]+'%'};return _0x3b6e52;})});}_0x4e0e4a=_[_0xacee('0x33')]({},_0x4e0e4a,_0xf5785f['options']);return db[_0xacee('0x41')][_0xacee('0x26')](_0x4e0e4a);}})['then'](function(_0x34e863){if(_0x34e863){return db[_0xacee('0x47')][_0xacee('0x48')]({'where':{'id':_['map'](_0x34e863,_0xacee('0x49')),'role':_0xacee('0x4a')},'attributes':['id',_0xacee('0x19'),_0xacee('0x4b'),_0xacee('0x4c'),_0xacee('0x4d')]});}})[_0xacee('0x15')](function(_0xe2d289){if(_0xe2d289){return{'count':_0xe2d289[_0xacee('0x13')],'rows':_['map'](_0xe2d289[_0xacee('0x27')],function(_0x5851d5){return{'membername':_0x5851d5[_0xacee('0x19')],'UserId':_0x5851d5['id'],'queue_name':_0x3237de[_0xacee('0x19')],'ChatQueueId':_0x3237de['id'],'interface':util[_0xacee('0x4e')](_0xacee('0x4f'),_0xacee('0x50'),_0x5851d5[_0xacee('0x19')]),'penalty':0x0,'paused':_0x5851d5[_0xacee('0x4b')],'createdAt':_0x5851d5[_0xacee('0x4d')],'updatedAt':_0x5851d5[_0xacee('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x326871,_0x4e0e4a))['catch'](handleError(_0x326871,null));};exports[_0xacee('0x51')]=function(_0x38067a,_0x291278){var _0x3ab7dc={};var _0xa7363f={};var _0x59adb0;var _0x5f491d;return db[_0xacee('0x1d')]['findOne']({'where':{'id':_0x38067a[_0xacee('0x2a')]['id']}})['then'](handleEntityNotFound(_0x291278,null))[_0xacee('0x15')](function(_0x1d5c76){if(_0x1d5c76){_0x59adb0=_0x1d5c76;_0xa7363f['model']=_[_0xacee('0x2c')](db[_0xacee('0x52')][_0xacee('0x1e')]);_0xa7363f[_0xacee('0x25')]=_[_0xacee('0x2c')](_0x38067a[_0xacee('0x25')]);_0xa7363f['filters']=_[_0xacee('0x2e')](_0xa7363f[_0xacee('0x2b')],_0xa7363f['query']);_0x3ab7dc['attributes']=_[_0xacee('0x2e')](_0xa7363f[_0xacee('0x2b')],qs['fields'](_0x38067a[_0xacee('0x25')]['fields']));_0x3ab7dc[_0xacee('0x2f')]=_0x3ab7dc[_0xacee('0x2f')][_0xacee('0x31')]?_0x3ab7dc[_0xacee('0x2f')]:_0xa7363f[_0xacee('0x2b')];_0x3ab7dc[_0xacee('0x53')]=qs[_0xacee('0x43')](_0x38067a[_0xacee('0x25')][_0xacee('0x43')]);_0x3ab7dc[_0xacee('0x23')]=qs[_0xacee('0x2d')](_[_0xacee('0x44')](_0x38067a[_0xacee('0x25')],_0xa7363f[_0xacee('0x2d')]));if(_0x38067a[_0xacee('0x25')][_0xacee('0x46')]){_0x3ab7dc[_0xacee('0x23')]=_[_0xacee('0x33')](_0x3ab7dc[_0xacee('0x23')],{'$or':_[_0xacee('0x1c')](_0x3ab7dc[_0xacee('0x2f')],function(_0x580ea1){var _0x161dca={};_0x161dca[_0x580ea1]={'$like':'%'+_0x38067a[_0xacee('0x25')][_0xacee('0x46')]+'%'};return _0x161dca;})});}_0x3ab7dc=_[_0xacee('0x33')]({},_0x3ab7dc,_0x38067a[_0xacee('0x34')]);return _0x59adb0[_0xacee('0x51')](_0x3ab7dc);}})[_0xacee('0x15')](function(_0x2e5c38){if(_0x2e5c38){_0x5f491d=_0x2e5c38['length'];if(!_0x38067a['query'][_0xacee('0x42')](_0xacee('0x54'))){_0x3ab7dc['limit']=qs['limit'](_0x38067a['query'][_0xacee('0x11')]);_0x3ab7dc[_0xacee('0x10')]=qs[_0xacee('0x10')](_0x38067a[_0xacee('0x25')][_0xacee('0x10')]);}return _0x59adb0['getTeams'](_0x3ab7dc);}})[_0xacee('0x15')](function(_0x1c9507){if(_0x1c9507){return _0x1c9507?{'count':_0x5f491d,'rows':_0x1c9507}:null;}})[_0xacee('0x15')](respondWithResult(_0x291278,null))['catch'](handleError(_0x291278,null));};exports[_0xacee('0x55')]=function(_0x1935b9,_0x512f9d){var _0x5df4dd=_0x1935b9[_0xacee('0x37')]['ids'];return db['Team'][_0xacee('0x26')]({'where':{'id':_0x5df4dd},'attributes':['id'],'include':[{'model':db['User'],'as':_0xacee('0x56'),'attributes':['id',_0xacee('0x19'),_0xacee('0x57'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1bef58){if(_0x1bef58){var _0x28cb9a=_[_0xacee('0x58')](_0x1bef58,function(_0x48393d){var _0x26aa49=_0x48393d[_0xacee('0x40')]({'plain':!![]});return _0x26aa49['Agents'];});return db[_0xacee('0x1d')]['find']({'where':{'id':_0x1935b9['params']['id']}})[_0xacee('0x15')](function(_0x40e632){return db['sequelize'][_0xacee('0x59')](function(_0x41a6b9){return _0x40e632['addTeams'](_0x5df4dd,{'transaction':_0x41a6b9})[_0xacee('0x15')](function(){return BPromise[_0xacee('0x5a')](_0x28cb9a,function(_0x1c97dc){return db[_0xacee('0x41')][_0xacee('0x5b')]({'where':{'UserId':_0x1c97dc['id'],'ChatQueueId':_0x1935b9[_0xacee('0x2a')]['id']},'transaction':_0x41a6b9});});})[_0xacee('0x15')](function(){_0x28cb9a[_0xacee('0x5c')](function(_0x238c52){socket[_0xacee('0x5d')]('userChatQueue:save',{'UserId':_0x238c52['id'],'ChatQueueId':_0x40e632['id']});});});});});}})[_0xacee('0x15')](respondWithStatusCode(_0x512f9d,null))[_0xacee('0x28')](handleError(_0x512f9d,null));};exports['removeTeams']=function(_0x339285,_0x1f15bd){return db[_0xacee('0x52')][_0xacee('0x26')]({'where':{'id':_0x339285['query'][_0xacee('0x5e')]},'attributes':['id'],'include':[{'model':db[_0xacee('0x47')],'as':_0xacee('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1f15bd,null))[_0xacee('0x15')](function(_0x4a8998){var _0x2b9973=_[_0xacee('0x1c')](_0x4a8998,'id');var _0x34dfa2=[];var _0x2f39b3=[];var _0x7189cc=squel[_0xacee('0x5f')]();_0x7189cc['field'](_0xacee('0x60'))[_0xacee('0x61')](_0xacee('0x62'),'tq')[_0xacee('0x63')](_0xacee('0x64'),'ut',_0xacee('0x65'))[_0xacee('0x23')](_0xacee('0x66'),_0x339285[_0xacee('0x2a')]['id']);for(var _0x1fafcc=0x0;_0x1fafcc<_0x4a8998['length'];_0x1fafcc+=0x1){let _0x1f880c=_0x4a8998[_0x1fafcc];for(var _0x12872a=0x0;_0x12872a<_0x1f880c['Agents'][_0xacee('0x31')];_0x12872a+=0x1){let _0x221682=_0x1f880c['Agents'][_0x12872a];var _0x1c5f85=_0x7189cc[_0xacee('0x67')]();_0x1c5f85['where'](_0xacee('0x68'),_0x221682['id']);_0x2f39b3[_0xacee('0x69')](db[_0xacee('0x6a')]['query'](_0x1c5f85[_0xacee('0x6b')](),{'type':db[_0xacee('0x6a')][_0xacee('0x6c')]['SELECT']})[_0xacee('0x15')](function(_0x2fe41d){if(_0x2fe41d[_0xacee('0x31')]===0x1){return _0x221682['id'];}else{var _0x969d70=_[_0xacee('0x6d')](_['map'](_0x2fe41d,_0xacee('0x6e')),function(_0x242598){return _[_0xacee('0x6f')](_0x2b9973,_0x242598);});if(_0x969d70){return _0x221682['id'];}}}));}}return BPromise[_0xacee('0x70')](_0x2f39b3)[_0xacee('0x15')](function(_0x2a9d6d){_0x34dfa2=_(_0x34dfa2)[_0xacee('0x71')](_0x2a9d6d)[_0xacee('0x72')]()[_0xacee('0x73')]();return db[_0xacee('0x1d')][_0xacee('0x35')]({'where':{'id':_0x339285['params']['id']}})[_0xacee('0x15')](function(_0x1c15eb){return db[_0xacee('0x6a')][_0xacee('0x59')](function(_0x5ab2ce){return _0x1c15eb[_0xacee('0x74')](_0x339285[_0xacee('0x25')][_0xacee('0x5e')],{'transaction':_0x5ab2ce})['then'](function(){if(!_['isEmpty'](_0x34dfa2)){return _0x1c15eb[_0xacee('0x75')](_0x34dfa2,{'transaction':_0x5ab2ce});}})['then'](function(){_0x34dfa2[_0xacee('0x5c')](function(_0x124a55){socket[_0xacee('0x5d')](_0xacee('0x76'),{'UserId':_0x124a55,'ChatQueueId':_0x1c15eb['id']});});});});});});})['then'](respondWithStatusCode(_0x1f15bd,null))[_0xacee('0x28')](handleError(_0x1f15bd,null));};exports[_0xacee('0x77')]=function(_0x289596,_0x42bd5a){return db[_0xacee('0x1d')][_0xacee('0x35')]({'where':{'id':_0x289596['params']['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x42bd5a,null))['then'](function(_0x30a68c){if(_0x30a68c){return _0x30a68c[_0xacee('0x77')](_0x289596['body']['ids'],_[_0xacee('0x78')](_0x289596[_0xacee('0x37')],[_0xacee('0x5e'),'id'])||{})[_0xacee('0x79')](function(_0x44913e){for(var _0x1e62b6=0x0;_0x1e62b6<_0x289596[_0xacee('0x37')][_0xacee('0x5e')]['length'];_0x1e62b6+=0x1){socket[_0xacee('0x5d')](_0xacee('0x7a'),{'UserId':Number(_0x289596[_0xacee('0x37')][_0xacee('0x5e')][_0x1e62b6]),'ChatQueueId':Number(_0x289596[_0xacee('0x2a')]['id'])});}return _0x44913e;});}})[_0xacee('0x15')](respondWithResult(_0x42bd5a,null))[_0xacee('0x28')](handleError(_0x42bd5a,null));};exports[_0xacee('0x75')]=function(_0x56aac0,_0xd90440){return db['ChatQueue']['find']({'where':{'id':_0x56aac0['params']['id']}})['then'](handleEntityNotFound(_0xd90440,null))[_0xacee('0x15')](function(_0x1c9194){if(_0x1c9194){return _0x1c9194['removeAgents'](_0x56aac0['query'][_0xacee('0x5e')])[_0xacee('0x15')](function(){if(_[_0xacee('0x7b')](_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')])){for(var _0x1b59b8=0x0;_0x1b59b8<_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')][_0xacee('0x31')];_0x1b59b8+=0x1){socket[_0xacee('0x5d')](_0xacee('0x76'),{'UserId':Number(_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')][_0x1b59b8]),'ChatQueueId':Number(_0x56aac0[_0xacee('0x2a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x56aac0[_0xacee('0x25')][_0xacee('0x5e')]),'ChatQueueId':Number(_0x56aac0[_0xacee('0x2a')]['id'])});}});}})[_0xacee('0x15')](respondWithStatusCode(_0xd90440,null))['catch'](handleError(_0xd90440,null));};exports[_0xacee('0x7c')]=function(_0x36e4c7,_0x5bc0b6){var _0x2f2997={};var _0x5c25f9={};var _0x172538;var _0x3ff528;return db[_0xacee('0x1d')][_0xacee('0x3f')]({'where':{'id':_0x36e4c7[_0xacee('0x2a')]['id']}})[_0xacee('0x15')](handleEntityNotFound(_0x5bc0b6,null))[_0xacee('0x15')](function(_0x26b5c4){if(_0x26b5c4){_0x172538=_0x26b5c4;_0x5c25f9[_0xacee('0x2b')]=_[_0xacee('0x2c')](db[_0xacee('0x47')][_0xacee('0x1e')]);_0x5c25f9[_0xacee('0x25')]=_['keys'](_0x36e4c7[_0xacee('0x25')]);_0x5c25f9['filters']=_[_0xacee('0x2e')](_0x5c25f9[_0xacee('0x2b')],_0x5c25f9[_0xacee('0x25')]);_0x2f2997[_0xacee('0x2f')]=_[_0xacee('0x2e')](_0x5c25f9[_0xacee('0x2b')],qs['fields'](_0x36e4c7['query'][_0xacee('0x30')]));_0x2f2997['attributes']=_0x2f2997[_0xacee('0x2f')][_0xacee('0x31')]?_0x2f2997[_0xacee('0x2f')]:_0x5c25f9[_0xacee('0x2b')];_0x2f2997[_0xacee('0x53')]=qs[_0xacee('0x43')](_0x36e4c7[_0xacee('0x25')][_0xacee('0x43')]);_0x2f2997[_0xacee('0x23')]=qs[_0xacee('0x2d')](_[_0xacee('0x44')](_0x36e4c7['query'],_0x5c25f9[_0xacee('0x2d')]));if(_0x36e4c7['query']['filter']){_0x2f2997[_0xacee('0x23')]=_[_0xacee('0x33')](_0x2f2997[_0xacee('0x23')],{'$or':_[_0xacee('0x1c')](_0x2f2997[_0xacee('0x2f')],function(_0x4619dd){var _0x3f545f={};_0x3f545f[_0x4619dd]={'$like':'%'+_0x36e4c7[_0xacee('0x25')]['filter']+'%'};return _0x3f545f;})});}_0x2f2997=_[_0xacee('0x33')]({},_0x2f2997,_0x36e4c7['options']);return _0x172538[_0xacee('0x7c')](_0x2f2997);}})[_0xacee('0x15')](function(_0x1bf0cc){if(_0x1bf0cc){_0x3ff528=_0x1bf0cc[_0xacee('0x31')];if(!_0x36e4c7[_0xacee('0x25')][_0xacee('0x42')](_0xacee('0x54'))){_0x2f2997[_0xacee('0x11')]=qs[_0xacee('0x11')](_0x36e4c7[_0xacee('0x25')][_0xacee('0x11')]);_0x2f2997['offset']=qs[_0xacee('0x10')](_0x36e4c7[_0xacee('0x25')]['offset']);}return _0x172538[_0xacee('0x7c')](_0x2f2997);}})[_0xacee('0x15')](function(_0x14b81e){if(_0x14b81e){return _0x14b81e?{'count':_0x3ff528,'rows':_0x14b81e}:null;}})['then'](respondWithResult(_0x5bc0b6,null))['catch'](handleError(_0x5bc0b6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index eb229d4..d9fad18 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 _0x3f5c=['events','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x159924,_0x39a170){var _0x7aa9b0=function(_0x4cd6ae){while(--_0x4cd6ae){_0x159924['push'](_0x159924['shift']());}};_0x7aa9b0(++_0x39a170);}(_0x3f5c,0x129));var _0xc3f5=function(_0x3a88c4,_0x11773b){_0x3a88c4=_0x3a88c4-0x0;var _0x411580=_0x3f5c[_0x3a88c4];return _0x411580;};'use strict';var EventEmitter=require(_0xc3f5('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xc3f5('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc3f5('0x2')](0x0);var events={'afterCreate':_0xc3f5('0x3'),'afterUpdate':'update','afterDestroy':_0xc3f5('0x4')};function emitEvent(_0x49be7c){return function(_0x5ccfe2,_0x238645,_0x57a172){ChatQueueEvents[_0xc3f5('0x5')](_0x49be7c+':'+_0x5ccfe2['id'],_0x5ccfe2);ChatQueueEvents[_0xc3f5('0x5')](_0x49be7c,_0x5ccfe2);_0x57a172(null);};}for(var e in events){if(events[_0xc3f5('0x6')](e)){var event=events[e];ChatQueue[_0xc3f5('0x7')](e,emitEvent(event));}}module[_0xc3f5('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x79e3=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0x79e3,0x77));var _0x379e=function(_0x1fa3d4,_0x39e1a5){_0x1fa3d4=_0x1fa3d4-0x0;var _0x1bf27c=_0x79e3[_0x1fa3d4];return _0x1bf27c;};'use strict';var EventEmitter=require(_0x379e('0x0'));var ChatQueue=require(_0x379e('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x379e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x379e('0x3'),'afterDestroy':_0x379e('0x4')};function emitEvent(_0x2e6d6b){return function(_0x234aa2,_0x2d61cd,_0x5bd2c6){ChatQueueEvents[_0x379e('0x5')](_0x2e6d6b+':'+_0x234aa2['id'],_0x234aa2);ChatQueueEvents[_0x379e('0x5')](_0x2e6d6b,_0x234aa2);_0x5bd2c6(null);};}for(var e in events){if(events[_0x379e('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index aa7983a..e1a89a3 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 _0x50e5=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x5267cd,_0x30cf7b){var _0x3419ce=function(_0x3a1dfb){while(--_0x3a1dfb){_0x5267cd['push'](_0x5267cd['shift']());}};_0x3419ce(++_0x30cf7b);}(_0x50e5,0xef));var _0x550e=function(_0x1cc666,_0x272d12){_0x1cc666=_0x1cc666-0x0;var _0x3c3764=_0x50e5[_0x1cc666];return _0x3c3764;};'use strict';var _=require(_0x550e('0x0'));var util=require('util');var logger=require(_0x550e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x550e('0x2'));var rp=require(_0x550e('0x3'));var fs=require('fs');var path=require(_0x550e('0x4'));var rimraf=require(_0x550e('0x5'));var config=require(_0x550e('0x6'));var attributes=require(_0x550e('0x7'));module[_0x550e('0x8')]=function(_0x202fca,_0x1303d5){return _0x202fca[_0x550e('0x9')](_0x550e('0xa'),attributes,{'tableName':_0x550e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5457=['request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','api','bluebird'];(function(_0x408110,_0x29c63a){var _0x272714=function(_0x2637ae){while(--_0x2637ae){_0x408110['push'](_0x408110['shift']());}};_0x272714(++_0x29c63a);}(_0x5457,0xb2));var _0x7545=function(_0x5c01d3,_0x1cc626){_0x5c01d3=_0x5c01d3-0x0;var _0x546b80=_0x5457[_0x5c01d3];return _0x546b80;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7545('0x0'));var moment=require('moment');var BPromise=require(_0x7545('0x1'));var rp=require(_0x7545('0x2'));var fs=require('fs');var path=require(_0x7545('0x3'));var rimraf=require(_0x7545('0x4'));var config=require(_0x7545('0x5'));var attributes=require('./chatQueue.attributes');module[_0x7545('0x6')]=function(_0x57f623,_0x5e3e8c){return _0x57f623[_0x7545('0x7')](_0x7545('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 882a507..e29176f 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(_0x7ec7b4,_0x1c8b0e){var _0x307680=function(_0x100a2c){while(--_0x100a2c){_0x7ec7b4['push'](_0x7ec7b4['shift']());}};_0x307680(++_0x1c8b0e);}(_0x2cf5,0x19f));var _0x52cf=function(_0x170b9c,_0x532a97){_0x170b9c=_0x170b9c-0x0;var _0x4d111d=_0x2cf5[_0x170b9c];return _0x4d111d;};'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 _0x3c8b=['socket.io-emitter','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','where','limit','include','map','model','attributes','debug','ShowChatQueue','find','raw','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x5a408b,_0x242bea){_0x5a408b=_0x5a408b-0x0;var _0x2d9caf=_0x3c8b[_0x5a408b];return _0x2d9caf;};'use strict';var _=require('lodash');var util=require(_0xb3c8('0x0'));var moment=require('moment');var BPromise=require(_0xb3c8('0x1'));var rs=require(_0xb3c8('0x2'));var fs=require('fs');var Redis=require(_0xb3c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c8('0x4'));var logger=require(_0xb3c8('0x5'))(_0xb3c8('0x6'));var config=require(_0xb3c8('0x7'));var jayson=require(_0xb3c8('0x8'));var client=jayson[_0xb3c8('0x9')][_0xb3c8('0xa')]({'port':0x232a});config[_0xb3c8('0xb')]=_['defaults'](config[_0xb3c8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3c8('0xc'))(new Redis(config[_0xb3c8('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4790d0,_0x3cea69,_0x363230){return new BPromise(function(_0xdf4041,_0x508b1f){return client[_0xb3c8('0xd')](_0x4790d0,_0x363230)[_0xb3c8('0xe')](function(_0x21eac8){logger[_0xb3c8('0xf')]('ChatQueue,\x20%s,\x20%s',_0x3cea69,_0xb3c8('0x10'));logger['debug'](_0xb3c8('0x11'),_0x3cea69,'request\x20sent',JSON[_0xb3c8('0x12')](_0x21eac8));if(_0x21eac8[_0xb3c8('0x13')]){if(_0x21eac8[_0xb3c8('0x13')]['code']===0x1f4){logger['error'](_0xb3c8('0x14'),_0x3cea69,_0x21eac8[_0xb3c8('0x13')][_0xb3c8('0x15')]);return _0x508b1f(_0x21eac8['error']['message']);}logger[_0xb3c8('0x13')](_0xb3c8('0x14'),_0x3cea69,_0x21eac8[_0xb3c8('0x13')]['message']);return _0xdf4041(_0x21eac8[_0xb3c8('0x13')][_0xb3c8('0x15')]);}else{logger[_0xb3c8('0xf')](_0xb3c8('0x14'),_0x3cea69,_0xb3c8('0x10'));_0xdf4041(_0x21eac8[_0xb3c8('0x16')][_0xb3c8('0x15')]);}})[_0xb3c8('0x17')](function(_0x168555){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3cea69,_0x168555);_0x508b1f(_0x168555);});});}exports[_0xb3c8('0x18')]=function(_0x5390cc){var _0x4d4bda=this;return new Promise(function(_0x433549,_0x4df53e){return db[_0xb3c8('0x19')]['findAll']({'raw':_0x5390cc['options']?_0x5390cc[_0xb3c8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5390cc[_0xb3c8('0x1a')]?_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1b')]||null:null,'attributes':_0x5390cc['options']?_0x5390cc[_0xb3c8('0x1a')]['attributes']||null:null,'limit':_0x5390cc[_0xb3c8('0x1a')]?_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1c')]||null:null,'include':_0x5390cc[_0xb3c8('0x1a')]?_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x5390cc[_0xb3c8('0x1a')][_0xb3c8('0x1d')],function(_0x557be7){return{'model':db[_0x557be7[_0xb3c8('0x1f')]],'as':_0x557be7['as'],'attributes':_0x557be7['attributes'],'include':_0x557be7[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x557be7[_0xb3c8('0x1d')],function(_0x1d0b73){return{'model':db[_0x1d0b73['model']],'as':_0x1d0b73['as'],'attributes':_0x1d0b73[_0xb3c8('0x20')],'include':_0x1d0b73[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x1d0b73[_0xb3c8('0x1d')],function(_0x275312){return{'model':db[_0x275312[_0xb3c8('0x1f')]],'as':_0x275312['as'],'attributes':_0x275312[_0xb3c8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35bd6d){logger[_0xb3c8('0xf')]('GetChatQueue',_0x5390cc);logger[_0xb3c8('0x21')](_0xb3c8('0x18'),_0x5390cc,JSON[_0xb3c8('0x12')](_0x35bd6d));_0x433549(_0x35bd6d);})[_0xb3c8('0x17')](function(_0x27e928){logger[_0xb3c8('0x13')](_0xb3c8('0x18'),_0x27e928['message'],_0x5390cc);_0x4df53e(_0x4d4bda[_0xb3c8('0x13')](0x1f4,_0x27e928[_0xb3c8('0x15')]));});});};exports[_0xb3c8('0x22')]=function(_0x320e3f){var _0x4511cf=this;return new Promise(function(_0x557745,_0x2369e5){return db[_0xb3c8('0x19')][_0xb3c8('0x23')]({'raw':_0x320e3f[_0xb3c8('0x1a')]?_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x24')]===undefined?!![]:![]:!![],'where':_0x320e3f[_0xb3c8('0x1a')]?_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x1b')]||null:null,'attributes':_0x320e3f['options']?_0x320e3f[_0xb3c8('0x1a')]['attributes']||null:null,'include':_0x320e3f[_0xb3c8('0x1a')]?_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x320e3f[_0xb3c8('0x1a')][_0xb3c8('0x1d')],function(_0x550ab8){return{'model':db[_0x550ab8[_0xb3c8('0x1f')]],'as':_0x550ab8['as'],'attributes':_0x550ab8['attributes'],'include':_0x550ab8[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0x550ab8[_0xb3c8('0x1d')],function(_0xc6554d){return{'model':db[_0xc6554d['model']],'as':_0xc6554d['as'],'attributes':_0xc6554d[_0xb3c8('0x20')],'include':_0xc6554d[_0xb3c8('0x1d')]?_[_0xb3c8('0x1e')](_0xc6554d[_0xb3c8('0x1d')],function(_0x3ee715){return{'model':db[_0x3ee715[_0xb3c8('0x1f')]],'as':_0x3ee715['as'],'attributes':_0x3ee715['attributes']};}):[]};}):[]};}):[]:[]})[_0xb3c8('0xe')](function(_0x287521){logger[_0xb3c8('0xf')](_0xb3c8('0x22'),_0x320e3f);logger[_0xb3c8('0x21')]('ShowChatQueue',_0x320e3f,JSON['stringify'](_0x287521));_0x557745(_0x287521);})[_0xb3c8('0x17')](function(_0x1ecefb){logger[_0xb3c8('0x13')]('ShowChatQueue',_0x1ecefb[_0xb3c8('0x15')],_0x320e3f);_0x2369e5(_0x4511cf['error'](0x1f4,_0x1ecefb[_0xb3c8('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f89fc33..8c2c9bd 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 _0xfd28=['emit','removeListener','register','chatQueue:','save','remove'];(function(_0x7f3a0f,_0x163bbf){var _0x4ff4e9=function(_0x27c49f){while(--_0x27c49f){_0x7f3a0f['push'](_0x7f3a0f['shift']());}};_0x4ff4e9(++_0x163bbf);}(_0xfd28,0x148));var _0x8fd2=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xfd28[_0x9c2427];return _0x51984f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8fd2('0x0'),_0x8fd2('0x1'),'update'];function createListener(_0x56f4d0,_0x4e5c5e){return function(_0x37baf5){_0x4e5c5e[_0x8fd2('0x2')](_0x56f4d0,_0x37baf5);};}function removeListener(_0x4e2108,_0x4b22ae){return function(){ChatQueueEvents[_0x8fd2('0x3')](_0x4e2108,_0x4b22ae);};}exports[_0x8fd2('0x4')]=function(_0x2ee87e){for(var _0x36178a=0x0,_0x2f0afc=events['length'];_0x36178a<_0x2f0afc;_0x36178a++){var _0x53d938=events[_0x36178a];var _0x10fccf=createListener(_0x8fd2('0x5')+_0x53d938,_0x2ee87e);ChatQueueEvents['on'](_0x53d938,_0x10fccf);}};
\ No newline at end of file
+var _0x9f62=['save','update','removeListener','register','length'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x9f62,0x154));var _0x29f6=function(_0x2c49cf,_0x55329f){_0x2c49cf=_0x2c49cf-0x0;var _0x1928f4=_0x9f62[_0x2c49cf];return _0x1928f4;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x29f6('0x0'),'remove',_0x29f6('0x1')];function createListener(_0x254ab3,_0x548050){return function(_0x5618b7){_0x548050['emit'](_0x254ab3,_0x5618b7);};}function removeListener(_0x258ddd,_0x2f0420){return function(){ChatQueueEvents[_0x29f6('0x2')](_0x258ddd,_0x2f0420);};}exports[_0x29f6('0x3')]=function(_0x595034){for(var _0xf66137=0x0,_0x272876=events[_0x29f6('0x4')];_0xf66137<_0x272876;_0xf66137++){var _0x2ba602=events[_0xf66137];var _0x416c6c=createListener('chatQueue:'+_0x2ba602,_0x595034);ChatQueueEvents['on'](_0x2ba602,_0x416c6c);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c2f9c2d..e589084 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5c3505,_0x3770ce){var _0x5eec90=function(_0x34157c){while(--_0x34157c){_0x5c3505['push'](_0x5c3505['shift']());}};_0x5eec90(++_0x3770ce);}(_0xe14b,0x93));var _0xbe14=function(_0x2c588c,_0x1f0d55){_0x2c588c=_0x2c588c-0x0;var _0x25f6a6=_0xe14b[_0x2c588c];return _0x25f6a6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x3c4515,_0x52f867){_0x3c4515=_0x3c4515-0x0;var _0x3ef194=_0x3e74[_0x3c4515];return _0x3ef194;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 549b180..e91c4a5 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 _0xf2f5=['DATE','sequelize','STRING'];(function(_0x146b09,_0x345cd3){var _0x4e9e36=function(_0x1d9749){while(--_0x1d9749){_0x146b09['push'](_0x146b09['shift']());}};_0x4e9e36(++_0x345cd3);}(_0xf2f5,0x8e));var _0x5f2f=function(_0x3112ac,_0x4d5efd){_0x3112ac=_0x3112ac-0x0;var _0x343812=_0xf2f5[_0x3112ac];return _0x343812;};'use strict';var moment=require('moment');var Sequelize=require(_0x5f2f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5f2f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5f2f('0x1')]},'joinAt':{'type':Sequelize[_0x5f2f('0x2')]},'leaveAt':{'type':Sequelize[_0x5f2f('0x2')]},'acceptAt':{'type':Sequelize[_0x5f2f('0x2')]},'exitAt':{'type':Sequelize[_0x5f2f('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x71f8=['moment','sequelize','exports','STRING','DATE'];(function(_0xe8e040,_0x278f92){var _0x6be7b8=function(_0x3dabd0){while(--_0x3dabd0){_0xe8e040['push'](_0xe8e040['shift']());}};_0x6be7b8(++_0x278f92);}(_0x71f8,0x1ae));var _0x871f=function(_0x4ea2f7,_0x11c547){_0x4ea2f7=_0x4ea2f7-0x0;var _0x532c3c=_0x71f8[_0x4ea2f7];return _0x532c3c;};'use strict';var moment=require(_0x871f('0x0'));var Sequelize=require(_0x871f('0x1'));module[_0x871f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x871f('0x3')]},'joinAt':{'type':Sequelize[_0x871f('0x4')]},'leaveAt':{'type':Sequelize[_0x871f('0x4')]},'acceptAt':{'type':Sequelize[_0x871f('0x4')]},'exitAt':{'type':Sequelize[_0x871f('0x4')]},'reason':{'type':Sequelize[_0x871f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index a30ef59..ae037ca 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 _0xb3d8=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','ChatQueueReport','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2402ce,_0xa8ef8f){var _0x3434ef=function(_0x1028f2){while(--_0x1028f2){_0x2402ce['push'](_0x2402ce['shift']());}};_0x3434ef(++_0xa8ef8f);}(_0xb3d8,0xdc));var _0x8b3d=function(_0xb75c06,_0x344d72){_0xb75c06=_0xb75c06-0x0;var _0x5a84ba=_0xb3d8[_0xb75c06];return _0x5a84ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b3d('0x0'));var zipdir=require(_0x8b3d('0x1'));var jsonpatch=require(_0x8b3d('0x2'));var rp=require(_0x8b3d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8b3d('0x4'));var util=require(_0x8b3d('0x5'));var path=require(_0x8b3d('0x6'));var sox=require(_0x8b3d('0x7'));var csv=require(_0x8b3d('0x8'));var ejs=require(_0x8b3d('0x9'));var fs=require('fs');var fs_extra=require(_0x8b3d('0xa'));var _=require(_0x8b3d('0xb'));var squel=require(_0x8b3d('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b3d('0xd'));var deskjs=require(_0x8b3d('0xe'));var toCsv=require(_0x8b3d('0x8'));var querystring=require(_0x8b3d('0xf'));var Papa=require(_0x8b3d('0x10'));var Redis=require(_0x8b3d('0x11'));var authService=require(_0x8b3d('0x12'));var qs=require(_0x8b3d('0x13'));var as=require(_0x8b3d('0x14'));var hardwareService=require(_0x8b3d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x8b3d('0x16'));var config=require(_0x8b3d('0x17'));var licenseUtil=require(_0x8b3d('0x18'));var db=require(_0x8b3d('0x19'))['db'];function respondWithStatusCode(_0x16e1fb,_0x1fa985){_0x1fa985=_0x1fa985||0xcc;return function(_0x63293){if(_0x63293){return _0x16e1fb[_0x8b3d('0x1a')](_0x1fa985);}return _0x16e1fb[_0x8b3d('0x1b')](_0x1fa985)[_0x8b3d('0x1c')]();};}function respondWithResult(_0x984b9a,_0x3f03ee){_0x3f03ee=_0x3f03ee||0xc8;return function(_0xb0a303){if(_0xb0a303){return _0x984b9a[_0x8b3d('0x1b')](_0x3f03ee)[_0x8b3d('0x1d')](_0xb0a303);}};}function respondWithFilteredResult(_0x14611e,_0x4fc552){return function(_0x2c624d){if(_0x2c624d){var _0x381c0d=typeof _0x4fc552['offset']===_0x8b3d('0x1e')&&typeof _0x4fc552[_0x8b3d('0x1f')]==='undefined';var _0xb493ac=_0x2c624d[_0x8b3d('0x20')];var _0xcc9b46=_0x381c0d?0x0:_0x4fc552[_0x8b3d('0x21')];var _0x1d96ae=_0x381c0d?_0x2c624d['count']:_0x4fc552['offset']+_0x4fc552[_0x8b3d('0x1f')];var _0x4f1b21;if(_0x1d96ae>=_0xb493ac){_0x1d96ae=_0xb493ac;_0x4f1b21=0xc8;}else{_0x4f1b21=0xce;}_0x14611e['status'](_0x4f1b21);return _0x14611e['set'](_0x8b3d('0x22'),_0xcc9b46+'-'+_0x1d96ae+'/'+_0xb493ac)[_0x8b3d('0x1d')](_0x2c624d);}return null;};}function patchUpdates(_0x4867e4){return function(_0x45c245){try{jsonpatch[_0x8b3d('0x23')](_0x45c245,_0x4867e4,!![]);}catch(_0xff346c){return BPromise[_0x8b3d('0x24')](_0xff346c);}return _0x45c245[_0x8b3d('0x25')]();};}function saveUpdates(_0x43a68,_0x3510f4){return function(_0x116ea4){if(_0x116ea4){return _0x116ea4[_0x8b3d('0x26')](_0x43a68)[_0x8b3d('0x27')](function(_0x338f6b){return _0x338f6b;});}return null;};}function removeEntity(_0x5462c6,_0x37c98e){return function(_0x584a71){if(_0x584a71){return _0x584a71[_0x8b3d('0x28')]()[_0x8b3d('0x27')](function(){_0x5462c6[_0x8b3d('0x1b')](0xcc)[_0x8b3d('0x1c')]();});}};}function handleEntityNotFound(_0x57fe10,_0x219ecb){return function(_0x4fc627){if(!_0x4fc627){_0x57fe10['sendStatus'](0x194);}return _0x4fc627;};}function handleError(_0x39a4bf,_0x513bb1){_0x513bb1=_0x513bb1||0x1f4;return function(_0x4eefbf){logger[_0x8b3d('0x29')](_0x4eefbf[_0x8b3d('0x2a')]);if(_0x4eefbf['name']){delete _0x4eefbf['name'];}_0x39a4bf[_0x8b3d('0x1b')](_0x513bb1)[_0x8b3d('0x2b')](_0x4eefbf);};}exports[_0x8b3d('0x2c')]=function(_0x1cab3a,_0x36f329){var _0x591a4c={},_0x261070={},_0x747446={'count':0x0,'rows':[]};var _0x1125dc=_[_0x8b3d('0x2d')](db[_0x8b3d('0x2e')]['rawAttributes'],function(_0x520a69){return{'name':_0x520a69[_0x8b3d('0x2f')],'type':_0x520a69[_0x8b3d('0x30')][_0x8b3d('0x31')]};});_0x261070['model']=_[_0x8b3d('0x2d')](_0x1125dc,_0x8b3d('0x32'));_0x261070[_0x8b3d('0x33')]=_['keys'](_0x1cab3a[_0x8b3d('0x33')]);_0x261070[_0x8b3d('0x34')]=_[_0x8b3d('0x35')](_0x261070['model'],_0x261070['query']);_0x591a4c[_0x8b3d('0x36')]=_[_0x8b3d('0x35')](_0x261070[_0x8b3d('0x37')],qs[_0x8b3d('0x38')](_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x38')]));_0x591a4c[_0x8b3d('0x36')]=_0x591a4c['attributes'][_0x8b3d('0x39')]?_0x591a4c[_0x8b3d('0x36')]:_0x261070[_0x8b3d('0x37')];if(!_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x3a')](_0x8b3d('0x3b'))){_0x591a4c[_0x8b3d('0x1f')]=qs[_0x8b3d('0x1f')](_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x1f')]);_0x591a4c[_0x8b3d('0x21')]=qs[_0x8b3d('0x21')](_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x21')]);}_0x591a4c[_0x8b3d('0x3c')]=qs[_0x8b3d('0x3d')](_0x1cab3a[_0x8b3d('0x33')]['sort']);_0x591a4c['where']=qs[_0x8b3d('0x34')](_['pick'](_0x1cab3a[_0x8b3d('0x33')],_0x261070[_0x8b3d('0x34')]),_0x1125dc);if(_0x1cab3a[_0x8b3d('0x33')]['filter']){_0x591a4c['where']=_[_0x8b3d('0x3e')](_0x591a4c[_0x8b3d('0x3f')],{'$or':_[_0x8b3d('0x2d')](_0x1125dc,function(_0x4b8fef){if(_0x4b8fef['type']!=='VIRTUAL'){var _0xbb0ca9={};_0xbb0ca9[_0x4b8fef[_0x8b3d('0x32')]]={'$like':'%'+_0x1cab3a['query']['filter']+'%'};return _0xbb0ca9;}})});}_0x591a4c=_['merge']({},_0x591a4c,_0x1cab3a[_0x8b3d('0x40')]);var _0x56a690={'where':_0x591a4c[_0x8b3d('0x3f')]};return db[_0x8b3d('0x2e')][_0x8b3d('0x20')](_0x56a690)[_0x8b3d('0x27')](function(_0x328b0c){_0x747446[_0x8b3d('0x20')]=_0x328b0c;if(_0x1cab3a[_0x8b3d('0x33')][_0x8b3d('0x41')]){_0x591a4c[_0x8b3d('0x42')]=[{'all':!![]}];}return db[_0x8b3d('0x2e')][_0x8b3d('0x43')](_0x591a4c);})[_0x8b3d('0x27')](function(_0x42790b){_0x747446[_0x8b3d('0x44')]=_0x42790b;return _0x747446;})[_0x8b3d('0x27')](respondWithFilteredResult(_0x36f329,_0x591a4c))[_0x8b3d('0x45')](handleError(_0x36f329,null));};exports[_0x8b3d('0x46')]=function(_0x26d01a,_0x45c73e){var _0x4b5ac6={'raw':!![],'where':{'id':_0x26d01a['params']['id']}},_0x2d2c5e={};_0x2d2c5e[_0x8b3d('0x37')]=_['keys'](db[_0x8b3d('0x2e')]['rawAttributes']);_0x2d2c5e[_0x8b3d('0x33')]=_[_0x8b3d('0x47')](_0x26d01a[_0x8b3d('0x33')]);_0x2d2c5e[_0x8b3d('0x34')]=_[_0x8b3d('0x35')](_0x2d2c5e[_0x8b3d('0x37')],_0x2d2c5e[_0x8b3d('0x33')]);_0x4b5ac6[_0x8b3d('0x36')]=_['intersection'](_0x2d2c5e[_0x8b3d('0x37')],qs[_0x8b3d('0x38')](_0x26d01a['query'][_0x8b3d('0x38')]));_0x4b5ac6[_0x8b3d('0x36')]=_0x4b5ac6[_0x8b3d('0x36')][_0x8b3d('0x39')]?_0x4b5ac6[_0x8b3d('0x36')]:_0x2d2c5e[_0x8b3d('0x37')];if(_0x26d01a[_0x8b3d('0x33')][_0x8b3d('0x41')]){_0x4b5ac6[_0x8b3d('0x42')]=[{'all':!![]}];}_0x4b5ac6=_[_0x8b3d('0x3e')]({},_0x4b5ac6,_0x26d01a['options']);return db[_0x8b3d('0x2e')]['find'](_0x4b5ac6)[_0x8b3d('0x27')](handleEntityNotFound(_0x45c73e,null))[_0x8b3d('0x27')](respondWithResult(_0x45c73e,null))[_0x8b3d('0x45')](handleError(_0x45c73e,null));};exports[_0x8b3d('0x48')]=function(_0x33507f,_0x52ecc6){return db[_0x8b3d('0x2e')][_0x8b3d('0x48')](_0x33507f[_0x8b3d('0x49')],{})[_0x8b3d('0x27')](respondWithResult(_0x52ecc6,0xc9))['catch'](handleError(_0x52ecc6,null));};exports[_0x8b3d('0x26')]=function(_0x4a49d6,_0x5d94e7){if(_0x4a49d6[_0x8b3d('0x49')]['id']){delete _0x4a49d6[_0x8b3d('0x49')]['id'];}return db[_0x8b3d('0x2e')][_0x8b3d('0x4a')]({'where':{'id':_0x4a49d6['params']['id']}})[_0x8b3d('0x27')](handleEntityNotFound(_0x5d94e7,null))[_0x8b3d('0x27')](saveUpdates(_0x4a49d6['body'],null))[_0x8b3d('0x27')](respondWithResult(_0x5d94e7,null))[_0x8b3d('0x45')](handleError(_0x5d94e7,null));};exports[_0x8b3d('0x28')]=function(_0x455623,_0x2bb19a){return db[_0x8b3d('0x2e')][_0x8b3d('0x4a')]({'where':{'id':_0x455623[_0x8b3d('0x4b')]['id']}})[_0x8b3d('0x27')](handleEntityNotFound(_0x2bb19a,null))[_0x8b3d('0x27')](removeEntity(_0x2bb19a,null))['catch'](handleError(_0x2bb19a,null));};exports[_0x8b3d('0x4c')]=function(_0x5e1353,_0x262e5d){return db['ChatQueueReport'][_0x8b3d('0x4c')]()[_0x8b3d('0x27')](respondWithResult(_0x262e5d,null))[_0x8b3d('0x45')](handleError(_0x262e5d,null));};
\ No newline at end of file
+var _0x9120=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x9120,0x1b3));var _0x0912=function(_0x23d2c0,_0x271f90){_0x23d2c0=_0x23d2c0-0x0;var _0x34b324=_0x9120[_0x23d2c0];return _0x34b324;};'use strict';var emlformat=require(_0x0912('0x0'));var rimraf=require(_0x0912('0x1'));var zipdir=require(_0x0912('0x2'));var jsonpatch=require(_0x0912('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0912('0x4'));var Mustache=require(_0x0912('0x5'));var util=require(_0x0912('0x6'));var path=require(_0x0912('0x7'));var sox=require(_0x0912('0x8'));var csv=require(_0x0912('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0912('0xa'));var _=require(_0x0912('0xb'));var squel=require(_0x0912('0xc'));var crypto=require('crypto');var jsforce=require(_0x0912('0xd'));var deskjs=require(_0x0912('0xe'));var toCsv=require(_0x0912('0x9'));var querystring=require(_0x0912('0xf'));var Papa=require(_0x0912('0x10'));var Redis=require('ioredis');var authService=require(_0x0912('0x11'));var qs=require(_0x0912('0x12'));var as=require(_0x0912('0x13'));var hardwareService=require(_0x0912('0x14'));var logger=require('../../config/logger')(_0x0912('0x15'));var utils=require('../../config/utils');var config=require(_0x0912('0x16'));var licenseUtil=require(_0x0912('0x17'));var db=require(_0x0912('0x18'))['db'];function respondWithStatusCode(_0xc7af62,_0x22752b){_0x22752b=_0x22752b||0xcc;return function(_0x10faac){if(_0x10faac){return _0xc7af62[_0x0912('0x19')](_0x22752b);}return _0xc7af62[_0x0912('0x1a')](_0x22752b)[_0x0912('0x1b')]();};}function respondWithResult(_0x102468,_0x17f22d){_0x17f22d=_0x17f22d||0xc8;return function(_0x350d6b){if(_0x350d6b){return _0x102468[_0x0912('0x1a')](_0x17f22d)[_0x0912('0x1c')](_0x350d6b);}};}function respondWithFilteredResult(_0x247612,_0x5eb1c9){return function(_0x4d00fd){if(_0x4d00fd){var _0x1ed3e8=typeof _0x5eb1c9['offset']===_0x0912('0x1d')&&typeof _0x5eb1c9['limit']===_0x0912('0x1d');var _0x49b581=_0x4d00fd[_0x0912('0x1e')];var _0x5eace1=_0x1ed3e8?0x0:_0x5eb1c9[_0x0912('0x1f')];var _0x5357db=_0x1ed3e8?_0x4d00fd[_0x0912('0x1e')]:_0x5eb1c9['offset']+_0x5eb1c9['limit'];var _0x3377af;if(_0x5357db>=_0x49b581){_0x5357db=_0x49b581;_0x3377af=0xc8;}else{_0x3377af=0xce;}_0x247612['status'](_0x3377af);return _0x247612[_0x0912('0x20')](_0x0912('0x21'),_0x5eace1+'-'+_0x5357db+'/'+_0x49b581)['json'](_0x4d00fd);}return null;};}function patchUpdates(_0x106008){return function(_0xb1af32){try{jsonpatch[_0x0912('0x22')](_0xb1af32,_0x106008,!![]);}catch(_0x5927d2){return BPromise['reject'](_0x5927d2);}return _0xb1af32[_0x0912('0x23')]();};}function saveUpdates(_0x626428,_0x1f04a1){return function(_0x30b7cc){if(_0x30b7cc){return _0x30b7cc[_0x0912('0x24')](_0x626428)[_0x0912('0x25')](function(_0x6c4902){return _0x6c4902;});}return null;};}function removeEntity(_0x2a3e70,_0xca7f8b){return function(_0x572d12){if(_0x572d12){return _0x572d12[_0x0912('0x26')]()[_0x0912('0x25')](function(){_0x2a3e70[_0x0912('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a938e,_0x21d65b){return function(_0x53d673){if(!_0x53d673){_0x4a938e['sendStatus'](0x194);}return _0x53d673;};}function handleError(_0x39462e,_0x39e96b){_0x39e96b=_0x39e96b||0x1f4;return function(_0x4d45d2){logger[_0x0912('0x27')](_0x4d45d2[_0x0912('0x28')]);if(_0x4d45d2[_0x0912('0x29')]){delete _0x4d45d2[_0x0912('0x29')];}_0x39462e[_0x0912('0x1a')](_0x39e96b)['send'](_0x4d45d2);};}exports[_0x0912('0x2a')]=function(_0x1d6c87,_0x4ac024){var _0x2b1653={},_0x3428a9={},_0x2ce714={'count':0x0,'rows':[]};var _0x5b3956=_[_0x0912('0x2b')](db[_0x0912('0x2c')][_0x0912('0x2d')],function(_0x176529){return{'name':_0x176529['fieldName'],'type':_0x176529[_0x0912('0x2e')][_0x0912('0x2f')]};});_0x3428a9[_0x0912('0x30')]=_[_0x0912('0x2b')](_0x5b3956,_0x0912('0x29'));_0x3428a9[_0x0912('0x31')]=_['keys'](_0x1d6c87['query']);_0x3428a9[_0x0912('0x32')]=_[_0x0912('0x33')](_0x3428a9['model'],_0x3428a9['query']);_0x2b1653[_0x0912('0x34')]=_[_0x0912('0x33')](_0x3428a9[_0x0912('0x30')],qs[_0x0912('0x35')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x35')]));_0x2b1653[_0x0912('0x34')]=_0x2b1653[_0x0912('0x34')]['length']?_0x2b1653['attributes']:_0x3428a9[_0x0912('0x30')];if(!_0x1d6c87[_0x0912('0x31')]['hasOwnProperty'](_0x0912('0x36'))){_0x2b1653[_0x0912('0x37')]=qs[_0x0912('0x37')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x37')]);_0x2b1653[_0x0912('0x1f')]=qs[_0x0912('0x1f')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x1f')]);}_0x2b1653['order']=qs[_0x0912('0x38')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x38')]);_0x2b1653[_0x0912('0x39')]=qs[_0x0912('0x32')](_[_0x0912('0x3a')](_0x1d6c87[_0x0912('0x31')],_0x3428a9['filters']),_0x5b3956);if(_0x1d6c87[_0x0912('0x31')]['filter']){_0x2b1653['where']=_['merge'](_0x2b1653[_0x0912('0x39')],{'$or':_[_0x0912('0x2b')](_0x5b3956,function(_0x5db5f9){if(_0x5db5f9[_0x0912('0x2e')]!==_0x0912('0x3b')){var _0xfdf81c={};_0xfdf81c[_0x5db5f9['name']]={'$like':'%'+_0x1d6c87[_0x0912('0x31')][_0x0912('0x3c')]+'%'};return _0xfdf81c;}})});}_0x2b1653=_['merge']({},_0x2b1653,_0x1d6c87[_0x0912('0x3d')]);var _0x40de57={'where':_0x2b1653[_0x0912('0x39')]};return db[_0x0912('0x2c')][_0x0912('0x1e')](_0x40de57)[_0x0912('0x25')](function(_0x4eb359){_0x2ce714[_0x0912('0x1e')]=_0x4eb359;if(_0x1d6c87[_0x0912('0x31')][_0x0912('0x3e')]){_0x2b1653[_0x0912('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0912('0x40')](_0x2b1653);})[_0x0912('0x25')](function(_0x10040b){_0x2ce714['rows']=_0x10040b;return _0x2ce714;})[_0x0912('0x25')](respondWithFilteredResult(_0x4ac024,_0x2b1653))[_0x0912('0x41')](handleError(_0x4ac024,null));};exports[_0x0912('0x42')]=function(_0x19839e,_0x1c5158){var _0x320f98={'raw':!![],'where':{'id':_0x19839e[_0x0912('0x43')]['id']}},_0x15e23b={};_0x15e23b['model']=_[_0x0912('0x44')](db['ChatQueueReport'][_0x0912('0x2d')]);_0x15e23b[_0x0912('0x31')]=_[_0x0912('0x44')](_0x19839e[_0x0912('0x31')]);_0x15e23b[_0x0912('0x32')]=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],_0x15e23b[_0x0912('0x31')]);_0x320f98['attributes']=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],qs[_0x0912('0x35')](_0x19839e['query'][_0x0912('0x35')]));_0x320f98[_0x0912('0x34')]=_0x320f98[_0x0912('0x34')][_0x0912('0x45')]?_0x320f98[_0x0912('0x34')]:_0x15e23b[_0x0912('0x30')];if(_0x19839e[_0x0912('0x31')][_0x0912('0x3e')]){_0x320f98[_0x0912('0x3f')]=[{'all':!![]}];}_0x320f98=_[_0x0912('0x46')]({},_0x320f98,_0x19839e[_0x0912('0x3d')]);return db[_0x0912('0x2c')][_0x0912('0x47')](_0x320f98)[_0x0912('0x25')](handleEntityNotFound(_0x1c5158,null))[_0x0912('0x25')](respondWithResult(_0x1c5158,null))[_0x0912('0x41')](handleError(_0x1c5158,null));};exports[_0x0912('0x48')]=function(_0x255ee5,_0x3b0548){return db[_0x0912('0x2c')][_0x0912('0x48')](_0x255ee5[_0x0912('0x49')],{})[_0x0912('0x25')](respondWithResult(_0x3b0548,0xc9))['catch'](handleError(_0x3b0548,null));};exports[_0x0912('0x24')]=function(_0x3b94cc,_0x591c83){if(_0x3b94cc[_0x0912('0x49')]['id']){delete _0x3b94cc[_0x0912('0x49')]['id'];}return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x3b94cc[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x591c83,null))['then'](saveUpdates(_0x3b94cc[_0x0912('0x49')],null))[_0x0912('0x25')](respondWithResult(_0x591c83,null))[_0x0912('0x41')](handleError(_0x591c83,null));};exports['destroy']=function(_0x11364e,_0x3ce4bf){return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x11364e[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x3ce4bf,null))[_0x0912('0x25')](removeEntity(_0x3ce4bf,null))[_0x0912('0x41')](handleError(_0x3ce4bf,null));};exports['describe']=function(_0x91bb1a,_0x360313){return db[_0x0912('0x2c')][_0x0912('0x4a')]()[_0x0912('0x25')](respondWithResult(_0x360313,null))['catch'](handleError(_0x360313,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 0057bbc..10657e3 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x3e775f,_0x3b55d1){var _0x5f3b28=function(_0x51a351){while(--_0x51a351){_0x3e775f['push'](_0x3e775f['shift']());}};_0x5f3b28(++_0x3b55d1);}(_0x757a,0xde));var _0xa757=function(_0x42e243,_0x132f93){_0x42e243=_0x42e243-0x0;var _0x18261b=_0x757a[_0x42e243];return _0x18261b;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x229742,_0x5c682d){var _0x536bbf=function(_0x142918){while(--_0x142918){_0x229742['push'](_0x229742['shift']());}};_0x536bbf(++_0x5c682d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'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 7426160..9a7233b 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 _0x0ae2=['http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatQueueReport','create','body','raw','debug','stringify','ChatQueueReport','update','options','where','attributes','limit','UpdateChatQueueReport','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x0ae2,0xa5));var _0x20ae=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x0ae2[_0x13cab0];return _0x38804f;};'use strict';var _=require(_0x20ae('0x0'));var util=require('util');var moment=require(_0x20ae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20ae('0x2'));var db=require(_0x20ae('0x3'))['db'];var utils=require(_0x20ae('0x4'));var logger=require(_0x20ae('0x5'))(_0x20ae('0x6'));var config=require(_0x20ae('0x7'));var jayson=require(_0x20ae('0x8'));var client=jayson[_0x20ae('0x9')][_0x20ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c9e7,_0x2ea7c4,_0x38696e){return new BPromise(function(_0x361b55,_0x13dd09){return client[_0x20ae('0xb')](_0x56c9e7,_0x38696e)[_0x20ae('0xc')](function(_0x463563){logger['info'](_0x20ae('0xd'),_0x2ea7c4,_0x20ae('0xe'));logger['debug'](_0x20ae('0xf'),_0x2ea7c4,'request\x20sent',JSON['stringify'](_0x463563));if(_0x463563[_0x20ae('0x10')]){if(_0x463563[_0x20ae('0x10')][_0x20ae('0x11')]===0x1f4){logger[_0x20ae('0x10')](_0x20ae('0xd'),_0x2ea7c4,_0x463563[_0x20ae('0x10')][_0x20ae('0x12')]);return _0x13dd09(_0x463563[_0x20ae('0x10')][_0x20ae('0x12')]);}logger[_0x20ae('0x10')](_0x20ae('0xd'),_0x2ea7c4,_0x463563[_0x20ae('0x10')]['message']);return _0x361b55(_0x463563['error'][_0x20ae('0x12')]);}else{logger[_0x20ae('0x13')](_0x20ae('0xd'),_0x2ea7c4,'request\x20sent');_0x361b55(_0x463563[_0x20ae('0x14')]['message']);}})[_0x20ae('0x15')](function(_0x156488){logger[_0x20ae('0x10')](_0x20ae('0xd'),_0x2ea7c4,_0x156488);_0x13dd09(_0x156488);});});}exports[_0x20ae('0x16')]=function(_0x2e9b47){var _0x2682ca=this;return new Promise(function(_0x4adcb9,_0x2acfb6){return db['ChatQueueReport'][_0x20ae('0x17')](_0x2e9b47[_0x20ae('0x18')],{'raw':_0x2e9b47['options']?_0x2e9b47['options'][_0x20ae('0x19')]===undefined?!![]:![]:!![]})[_0x20ae('0xc')](function(_0x1ef2d0){logger[_0x20ae('0x13')](_0x20ae('0x16'),_0x2e9b47);logger[_0x20ae('0x1a')]('CreateChatQueueReport',_0x2e9b47,JSON[_0x20ae('0x1b')](_0x1ef2d0));_0x4adcb9(_0x1ef2d0);})[_0x20ae('0x15')](function(_0x38df75){logger['error']('CreateChatQueueReport',_0x38df75[_0x20ae('0x12')],_0x2e9b47);_0x2acfb6(_0x2682ca['error'](0x1f4,_0x38df75[_0x20ae('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x5f19bc){var _0x4e4bbe=this;return new Promise(function(_0x525972,_0x14458b){return db[_0x20ae('0x1c')][_0x20ae('0x1d')](_0x5f19bc[_0x20ae('0x18')],{'raw':_0x5f19bc['options']?_0x5f19bc[_0x20ae('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f19bc[_0x20ae('0x1e')]?_0x5f19bc['options'][_0x20ae('0x1f')]||null:null,'attributes':_0x5f19bc[_0x20ae('0x1e')]?_0x5f19bc[_0x20ae('0x1e')][_0x20ae('0x20')]||null:null,'limit':_0x5f19bc[_0x20ae('0x1e')]?_0x5f19bc[_0x20ae('0x1e')][_0x20ae('0x21')]||null:null})[_0x20ae('0xc')](function(_0x87af23){logger[_0x20ae('0x13')](_0x20ae('0x22'),_0x5f19bc);logger[_0x20ae('0x1a')]('UpdateChatQueueReport',_0x5f19bc,JSON[_0x20ae('0x1b')](_0x87af23));_0x525972(_0x87af23);})['catch'](function(_0x2bdf2b){logger[_0x20ae('0x10')]('UpdateChatQueueReport',_0x2bdf2b[_0x20ae('0x12')],_0x5f19bc);_0x14458b(_0x4e4bbe[_0x20ae('0x10')](0x1f4,_0x2bdf2b[_0x20ae('0x12')]));});});};
\ No newline at end of file
+var _0x3fc4=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x518ee7,_0x18f4a4){var _0x59b1d7=function(_0x238778){while(--_0x238778){_0x518ee7['push'](_0x518ee7['shift']());}};_0x59b1d7(++_0x18f4a4);}(_0x3fc4,0x179));var _0x43fc=function(_0x22ec7e,_0x24fde9){_0x22ec7e=_0x22ec7e-0x0;var _0x2bd9d2=_0x3fc4[_0x22ec7e];return _0x2bd9d2;};'use strict';var _=require('lodash');var util=require(_0x43fc('0x0'));var moment=require(_0x43fc('0x1'));var BPromise=require(_0x43fc('0x2'));var rs=require(_0x43fc('0x3'));var fs=require('fs');var Redis=require(_0x43fc('0x4'));var db=require(_0x43fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x43fc('0x6'))('rpc');var config=require(_0x43fc('0x7'));var jayson=require(_0x43fc('0x8'));var client=jayson[_0x43fc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a8d6c,_0x509e56,_0x2b17a5){return new BPromise(function(_0x38e8ba,_0x56116a){return client['request'](_0x2a8d6c,_0x2b17a5)[_0x43fc('0xa')](function(_0x2cc50c){logger['info'](_0x43fc('0xb'),_0x509e56,_0x43fc('0xc'));logger[_0x43fc('0xd')](_0x43fc('0xe'),_0x509e56,_0x43fc('0xc'),JSON[_0x43fc('0xf')](_0x2cc50c));if(_0x2cc50c[_0x43fc('0x10')]){if(_0x2cc50c[_0x43fc('0x10')]['code']===0x1f4){logger['error'](_0x43fc('0xb'),_0x509e56,_0x2cc50c[_0x43fc('0x10')][_0x43fc('0x11')]);return _0x56116a(_0x2cc50c[_0x43fc('0x10')][_0x43fc('0x11')]);}logger[_0x43fc('0x10')](_0x43fc('0xb'),_0x509e56,_0x2cc50c[_0x43fc('0x10')][_0x43fc('0x11')]);return _0x38e8ba(_0x2cc50c[_0x43fc('0x10')]['message']);}else{logger[_0x43fc('0x12')](_0x43fc('0xb'),_0x509e56,_0x43fc('0xc'));_0x38e8ba(_0x2cc50c[_0x43fc('0x13')][_0x43fc('0x11')]);}})[_0x43fc('0x14')](function(_0x54f01b){logger[_0x43fc('0x10')](_0x43fc('0xb'),_0x509e56,_0x54f01b);_0x56116a(_0x54f01b);});});}exports[_0x43fc('0x15')]=function(_0x10fbcf){var _0x4763ea=this;return new Promise(function(_0x2a68e6,_0x45ac0a){return db[_0x43fc('0x16')]['create'](_0x10fbcf[_0x43fc('0x17')],{'raw':_0x10fbcf[_0x43fc('0x18')]?_0x10fbcf[_0x43fc('0x18')][_0x43fc('0x19')]===undefined?!![]:![]:!![]})[_0x43fc('0xa')](function(_0x5c133a){logger[_0x43fc('0x12')](_0x43fc('0x15'),_0x10fbcf);logger['debug'](_0x43fc('0x15'),_0x10fbcf,JSON[_0x43fc('0xf')](_0x5c133a));_0x2a68e6(_0x5c133a);})[_0x43fc('0x14')](function(_0x2bda3b){logger['error'](_0x43fc('0x15'),_0x2bda3b[_0x43fc('0x11')],_0x10fbcf);_0x45ac0a(_0x4763ea[_0x43fc('0x10')](0x1f4,_0x2bda3b[_0x43fc('0x11')]));});});};exports[_0x43fc('0x1a')]=function(_0x3cbc4e){var _0x113069=this;return new Promise(function(_0x5c7cc2,_0x25f9a9){return db[_0x43fc('0x16')][_0x43fc('0x1b')](_0x3cbc4e['body'],{'raw':_0x3cbc4e['options']?_0x3cbc4e['options'][_0x43fc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cbc4e[_0x43fc('0x18')]?_0x3cbc4e[_0x43fc('0x18')]['where']||null:null,'attributes':_0x3cbc4e[_0x43fc('0x18')]?_0x3cbc4e[_0x43fc('0x18')][_0x43fc('0x1c')]||null:null,'limit':_0x3cbc4e['options']?_0x3cbc4e[_0x43fc('0x18')][_0x43fc('0x1d')]||null:null})['then'](function(_0x1836e1){logger[_0x43fc('0x12')]('UpdateChatQueueReport',_0x3cbc4e);logger[_0x43fc('0xd')]('UpdateChatQueueReport',_0x3cbc4e,JSON[_0x43fc('0xf')](_0x1836e1));_0x5c7cc2(_0x1836e1);})[_0x43fc('0x14')](function(_0x3ff3d2){logger[_0x43fc('0x10')](_0x43fc('0x1a'),_0x3ff3d2['message'],_0x3cbc4e);_0x25f9a9(_0x113069[_0x43fc('0x10')](0x1f4,_0x3ff3d2[_0x43fc('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a417248..e86ca0a 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 _0x3005=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete','exports','path','express','Router','fs-extra'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x3005,0x183));var _0x5300=function(_0x21d951,_0x511bd9){_0x21d951=_0x21d951-0x0;var _0x149d77=_0x3005[_0x21d951];return _0x149d77;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5300('0x0'));var timeout=require('connect-timeout');var express=require(_0x5300('0x1'));var router=express[_0x5300('0x2')]();var fs_extra=require(_0x5300('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5300('0x4'));var config=require(_0x5300('0x5'));var controller=require('./chatQueueReport.controller');router[_0x5300('0x6')]('/',auth['isAuthenticated'](),controller[_0x5300('0x7')]);router[_0x5300('0x6')](_0x5300('0x8'),auth[_0x5300('0x9')](),controller['describe']);router[_0x5300('0x6')](_0x5300('0xa'),auth[_0x5300('0x9')](),controller[_0x5300('0xb')]);router[_0x5300('0xc')]('/',auth[_0x5300('0x9')](),controller[_0x5300('0xd')]);router[_0x5300('0xe')](_0x5300('0xa'),auth[_0x5300('0x9')](),controller['update']);router[_0x5300('0xf')](_0x5300('0xa'),auth[_0x5300('0x9')](),controller['destroy']);module[_0x5300('0x10')]=router;
\ No newline at end of file
+var _0x11de=['connect-timeout','express','Router','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path'];(function(_0xc3a71f,_0x54fe71){var _0x46a474=function(_0x47e601){while(--_0x47e601){_0xc3a71f['push'](_0xc3a71f['shift']());}};_0x46a474(++_0x54fe71);}(_0x11de,0x8a));var _0xe11d=function(_0x468431,_0x4a46d0){_0x468431=_0x468431-0x0;var _0x2a9dd4=_0x11de[_0x468431];return _0x2a9dd4;};'use strict';var multer=require(_0xe11d('0x0'));var util=require('util');var path=require(_0xe11d('0x1'));var timeout=require(_0xe11d('0x2'));var express=require(_0xe11d('0x3'));var router=express[_0xe11d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe11d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe11d('0x6'));router[_0xe11d('0x7')]('/',auth[_0xe11d('0x8')](),controller[_0xe11d('0x9')]);router[_0xe11d('0x7')](_0xe11d('0xa'),auth[_0xe11d('0x8')](),controller[_0xe11d('0xb')]);router['get'](_0xe11d('0xc'),auth[_0xe11d('0x8')](),controller[_0xe11d('0xd')]);router['post']('/',auth[_0xe11d('0x8')](),controller[_0xe11d('0xe')]);router[_0xe11d('0xf')]('/:id',auth[_0xe11d('0x8')](),controller[_0xe11d('0x10')]);router[_0xe11d('0x11')](_0xe11d('0xc'),auth[_0xe11d('0x8')](),controller[_0xe11d('0x12')]);module[_0xe11d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f785f3f..b536586 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4d8cf0,_0x1a581f){_0x4d8cf0=_0x4d8cf0-0x0;var _0x251e52=_0xb43b[_0x4d8cf0];return _0x251e52;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x25be3b,_0x55e82b){var _0x3dbf80=function(_0x4928a2){while(--_0x4928a2){_0x25be3b['push'](_0x25be3b['shift']());}};_0x3dbf80(++_0x55e82b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 3cbb711..4dad233 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 _0xcc09=['query','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','map','type','keys'];(function(_0x57c1f7,_0x257f29){var _0xc7013c=function(_0x24031e){while(--_0x24031e){_0x57c1f7['push'](_0x57c1f7['shift']());}};_0xc7013c(++_0x257f29);}(_0xcc09,0x1e1));var _0x9cc0=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcc09[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x9cc0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9cc0('0x1'));var rp=require(_0x9cc0('0x2'));var moment=require(_0x9cc0('0x3'));var BPromise=require(_0x9cc0('0x4'));var Mustache=require('mustache');var util=require(_0x9cc0('0x5'));var path=require(_0x9cc0('0x6'));var sox=require(_0x9cc0('0x7'));var csv=require(_0x9cc0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cc0('0x9'));var _=require(_0x9cc0('0xa'));var squel=require('squel');var crypto=require(_0x9cc0('0xb'));var jsforce=require(_0x9cc0('0xc'));var deskjs=require(_0x9cc0('0xd'));var toCsv=require(_0x9cc0('0x8'));var querystring=require(_0x9cc0('0xe'));var Papa=require(_0x9cc0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9cc0('0x10'));var utils=require(_0x9cc0('0x11'));var config=require(_0x9cc0('0x12'));var licenseUtil=require(_0x9cc0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d3f5b,_0x35aef7){_0x35aef7=_0x35aef7||0xcc;return function(_0x561314){if(_0x561314){return _0x1d3f5b[_0x9cc0('0x14')](_0x35aef7);}return _0x1d3f5b[_0x9cc0('0x15')](_0x35aef7)[_0x9cc0('0x16')]();};}function respondWithResult(_0x1f30fa,_0x3057b8){_0x3057b8=_0x3057b8||0xc8;return function(_0x1c42f9){if(_0x1c42f9){return _0x1f30fa[_0x9cc0('0x15')](_0x3057b8)['json'](_0x1c42f9);}};}function respondWithFilteredResult(_0x1a523f,_0x2f7df9){return function(_0xdd1763){if(_0xdd1763){var _0x54d0aa=typeof _0x2f7df9[_0x9cc0('0x17')]===_0x9cc0('0x18')&&typeof _0x2f7df9[_0x9cc0('0x19')]===_0x9cc0('0x18');var _0x38291d=_0xdd1763[_0x9cc0('0x1a')];var _0x39bbc2=_0x54d0aa?0x0:_0x2f7df9[_0x9cc0('0x17')];var _0x52b020=_0x54d0aa?_0xdd1763['count']:_0x2f7df9[_0x9cc0('0x17')]+_0x2f7df9[_0x9cc0('0x19')];var _0xfd0fd0;if(_0x52b020>=_0x38291d){_0x52b020=_0x38291d;_0xfd0fd0=0xc8;}else{_0xfd0fd0=0xce;}_0x1a523f[_0x9cc0('0x15')](_0xfd0fd0);return _0x1a523f['set']('Content-Range',_0x39bbc2+'-'+_0x52b020+'/'+_0x38291d)['json'](_0xdd1763);}return null;};}function patchUpdates(_0x2ce382){return function(_0x1afa11){try{jsonpatch[_0x9cc0('0x1b')](_0x1afa11,_0x2ce382,!![]);}catch(_0x4e5b03){return BPromise[_0x9cc0('0x1c')](_0x4e5b03);}return _0x1afa11[_0x9cc0('0x1d')]();};}function saveUpdates(_0x21aae9,_0x3f8ff2){return function(_0x48e610){if(_0x48e610){return _0x48e610[_0x9cc0('0x1e')](_0x21aae9)[_0x9cc0('0x1f')](function(_0x41bc21){return _0x41bc21;});}return null;};}function removeEntity(_0x3da676,_0x5cd7a1){return function(_0x2ddc11){if(_0x2ddc11){return _0x2ddc11[_0x9cc0('0x20')]()[_0x9cc0('0x1f')](function(){_0x3da676['status'](0xcc)[_0x9cc0('0x16')]();});}};}function handleEntityNotFound(_0x5bf0c3,_0xb6b7b3){return function(_0x4a5fc4){if(!_0x4a5fc4){_0x5bf0c3[_0x9cc0('0x14')](0x194);}return _0x4a5fc4;};}function handleError(_0x54a581,_0x332ef5){_0x332ef5=_0x332ef5||0x1f4;return function(_0x4cff79){logger['error'](_0x4cff79[_0x9cc0('0x21')]);if(_0x4cff79[_0x9cc0('0x22')]){delete _0x4cff79[_0x9cc0('0x22')];}_0x54a581[_0x9cc0('0x15')](_0x332ef5)[_0x9cc0('0x23')](_0x4cff79);};}exports['index']=function(_0x11ecad,_0x216ea5){var _0x2e947d={},_0x225a64={},_0x4c0471={'count':0x0,'rows':[]};var _0x2ea35b=_[_0x9cc0('0x24')](db['ChatTransferReport']['rawAttributes'],function(_0x30ee8){return{'name':_0x30ee8['fieldName'],'type':_0x30ee8[_0x9cc0('0x25')]['key']};});_0x225a64['model']=_[_0x9cc0('0x24')](_0x2ea35b,_0x9cc0('0x22'));_0x225a64['query']=_[_0x9cc0('0x26')](_0x11ecad[_0x9cc0('0x27')]);_0x225a64['filters']=_['intersection'](_0x225a64[_0x9cc0('0x28')],_0x225a64[_0x9cc0('0x27')]);_0x2e947d[_0x9cc0('0x29')]=_['intersection'](_0x225a64['model'],qs[_0x9cc0('0x2a')](_0x11ecad[_0x9cc0('0x27')]['fields']));_0x2e947d[_0x9cc0('0x29')]=_0x2e947d[_0x9cc0('0x29')][_0x9cc0('0x2b')]?_0x2e947d[_0x9cc0('0x29')]:_0x225a64[_0x9cc0('0x28')];if(!_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x2c')]('nolimit')){_0x2e947d[_0x9cc0('0x19')]=qs[_0x9cc0('0x19')](_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x19')]);_0x2e947d[_0x9cc0('0x17')]=qs[_0x9cc0('0x17')](_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x17')]);}_0x2e947d['order']=qs[_0x9cc0('0x2d')](_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x2d')]);_0x2e947d[_0x9cc0('0x2e')]=qs['filters'](_[_0x9cc0('0x2f')](_0x11ecad[_0x9cc0('0x27')],_0x225a64['filters']),_0x2ea35b);if(_0x11ecad['query'][_0x9cc0('0x30')]){_0x2e947d['where']=_[_0x9cc0('0x31')](_0x2e947d[_0x9cc0('0x2e')],{'$or':_[_0x9cc0('0x24')](_0x2ea35b,function(_0x302049){if(_0x302049[_0x9cc0('0x25')]!=='VIRTUAL'){var _0x5868ad={};_0x5868ad[_0x302049[_0x9cc0('0x22')]]={'$like':'%'+_0x11ecad['query'][_0x9cc0('0x30')]+'%'};return _0x5868ad;}})});}_0x2e947d=_[_0x9cc0('0x31')]({},_0x2e947d,_0x11ecad['options']);var _0x4e39bc={'where':_0x2e947d[_0x9cc0('0x2e')]};return db[_0x9cc0('0x32')][_0x9cc0('0x1a')](_0x4e39bc)[_0x9cc0('0x1f')](function(_0x1a8938){_0x4c0471[_0x9cc0('0x1a')]=_0x1a8938;if(_0x11ecad[_0x9cc0('0x27')][_0x9cc0('0x33')]){_0x2e947d[_0x9cc0('0x34')]=[{'all':!![]}];}return db[_0x9cc0('0x32')][_0x9cc0('0x35')](_0x2e947d);})[_0x9cc0('0x1f')](function(_0x4599d1){_0x4c0471[_0x9cc0('0x36')]=_0x4599d1;return _0x4c0471;})[_0x9cc0('0x1f')](respondWithFilteredResult(_0x216ea5,_0x2e947d))[_0x9cc0('0x37')](handleError(_0x216ea5,null));};exports[_0x9cc0('0x38')]=function(_0x554adb,_0x356b74){var _0x1285c7={'raw':!![],'where':{'id':_0x554adb[_0x9cc0('0x39')]['id']}},_0x41fadd={};_0x41fadd[_0x9cc0('0x28')]=_[_0x9cc0('0x26')](db[_0x9cc0('0x32')][_0x9cc0('0x3a')]);_0x41fadd[_0x9cc0('0x27')]=_[_0x9cc0('0x26')](_0x554adb[_0x9cc0('0x27')]);_0x41fadd['filters']=_[_0x9cc0('0x3b')](_0x41fadd['model'],_0x41fadd['query']);_0x1285c7['attributes']=_[_0x9cc0('0x3b')](_0x41fadd[_0x9cc0('0x28')],qs[_0x9cc0('0x2a')](_0x554adb[_0x9cc0('0x27')][_0x9cc0('0x2a')]));_0x1285c7[_0x9cc0('0x29')]=_0x1285c7[_0x9cc0('0x29')][_0x9cc0('0x2b')]?_0x1285c7[_0x9cc0('0x29')]:_0x41fadd['model'];if(_0x554adb[_0x9cc0('0x27')]['includeAll']){_0x1285c7[_0x9cc0('0x34')]=[{'all':!![]}];}_0x1285c7=_['merge']({},_0x1285c7,_0x554adb[_0x9cc0('0x3c')]);return db[_0x9cc0('0x32')][_0x9cc0('0x3d')](_0x1285c7)['then'](handleEntityNotFound(_0x356b74,null))['then'](respondWithResult(_0x356b74,null))['catch'](handleError(_0x356b74,null));};exports[_0x9cc0('0x3e')]=function(_0x3dfe3b,_0x56749b){return db[_0x9cc0('0x32')][_0x9cc0('0x3e')](_0x3dfe3b[_0x9cc0('0x3f')],{})[_0x9cc0('0x1f')](respondWithResult(_0x56749b,0xc9))[_0x9cc0('0x37')](handleError(_0x56749b,null));};exports[_0x9cc0('0x1e')]=function(_0x51bfab,_0x28a578){if(_0x51bfab[_0x9cc0('0x3f')]['id']){delete _0x51bfab[_0x9cc0('0x3f')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x51bfab[_0x9cc0('0x39')]['id']}})[_0x9cc0('0x1f')](handleEntityNotFound(_0x28a578,null))[_0x9cc0('0x1f')](saveUpdates(_0x51bfab[_0x9cc0('0x3f')],null))[_0x9cc0('0x1f')](respondWithResult(_0x28a578,null))[_0x9cc0('0x37')](handleError(_0x28a578,null));};exports[_0x9cc0('0x20')]=function(_0x3c86cf,_0x1b146c){return db[_0x9cc0('0x32')][_0x9cc0('0x3d')]({'where':{'id':_0x3c86cf[_0x9cc0('0x39')]['id']}})['then'](handleEntityNotFound(_0x1b146c,null))['then'](removeEntity(_0x1b146c,null))[_0x9cc0('0x37')](handleError(_0x1b146c,null));};exports[_0x9cc0('0x40')]=function(_0x2ae93a,_0x1d5401){return db[_0x9cc0('0x32')]['describe']()[_0x9cc0('0x1f')](respondWithResult(_0x1d5401,null))[_0x9cc0('0x37')](handleError(_0x1d5401,null));};
\ No newline at end of file
+var _0x025b=['rows','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll'];(function(_0x1840c7,_0xb8b170){var _0x225acb=function(_0x425118){while(--_0x425118){_0x1840c7['push'](_0x1840c7['shift']());}};_0x225acb(++_0xb8b170);}(_0x025b,0x1c5));var _0xb025=function(_0x320e21,_0x1f9905){_0x320e21=_0x320e21-0x0;var _0x3d174a=_0x025b[_0x320e21];return _0x3d174a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb025('0x0'));var zipdir=require(_0xb025('0x1'));var jsonpatch=require(_0xb025('0x2'));var rp=require(_0xb025('0x3'));var moment=require(_0xb025('0x4'));var BPromise=require(_0xb025('0x5'));var Mustache=require(_0xb025('0x6'));var util=require(_0xb025('0x7'));var path=require(_0xb025('0x8'));var sox=require('sox');var csv=require(_0xb025('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb025('0xa'));var _=require(_0xb025('0xb'));var squel=require('squel');var crypto=require(_0xb025('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb025('0xd'));var toCsv=require(_0xb025('0x9'));var querystring=require(_0xb025('0xe'));var Papa=require('papaparse');var Redis=require(_0xb025('0xf'));var authService=require(_0xb025('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb025('0x11'));var hardwareService=require(_0xb025('0x12'));var logger=require(_0xb025('0x13'))(_0xb025('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb025('0x15'))['db'];function respondWithStatusCode(_0x69ccf5,_0x3ef3be){_0x3ef3be=_0x3ef3be||0xcc;return function(_0x23a764){if(_0x23a764){return _0x69ccf5[_0xb025('0x16')](_0x3ef3be);}return _0x69ccf5[_0xb025('0x17')](_0x3ef3be)[_0xb025('0x18')]();};}function respondWithResult(_0x74d0d,_0x36f978){_0x36f978=_0x36f978||0xc8;return function(_0x475f1f){if(_0x475f1f){return _0x74d0d[_0xb025('0x17')](_0x36f978)['json'](_0x475f1f);}};}function respondWithFilteredResult(_0x593f44,_0x8c1b51){return function(_0x90cf0b){if(_0x90cf0b){var _0x22a3eb=typeof _0x8c1b51[_0xb025('0x19')]===_0xb025('0x1a')&&typeof _0x8c1b51[_0xb025('0x1b')]===_0xb025('0x1a');var _0xa826e0=_0x90cf0b[_0xb025('0x1c')];var _0x3251a8=_0x22a3eb?0x0:_0x8c1b51[_0xb025('0x19')];var _0x1a4b94=_0x22a3eb?_0x90cf0b[_0xb025('0x1c')]:_0x8c1b51[_0xb025('0x19')]+_0x8c1b51[_0xb025('0x1b')];var _0x4dbc87;if(_0x1a4b94>=_0xa826e0){_0x1a4b94=_0xa826e0;_0x4dbc87=0xc8;}else{_0x4dbc87=0xce;}_0x593f44[_0xb025('0x17')](_0x4dbc87);return _0x593f44['set'](_0xb025('0x1d'),_0x3251a8+'-'+_0x1a4b94+'/'+_0xa826e0)['json'](_0x90cf0b);}return null;};}function patchUpdates(_0x407fa0){return function(_0x2f124d){try{jsonpatch[_0xb025('0x1e')](_0x2f124d,_0x407fa0,!![]);}catch(_0x5bfd89){return BPromise[_0xb025('0x1f')](_0x5bfd89);}return _0x2f124d[_0xb025('0x20')]();};}function saveUpdates(_0x1f3b18,_0x4743d){return function(_0x567358){if(_0x567358){return _0x567358[_0xb025('0x21')](_0x1f3b18)['then'](function(_0x335e49){return _0x335e49;});}return null;};}function removeEntity(_0x569e35,_0x14b21e){return function(_0x3076cd){if(_0x3076cd){return _0x3076cd['destroy']()[_0xb025('0x22')](function(){_0x569e35['status'](0xcc)[_0xb025('0x18')]();});}};}function handleEntityNotFound(_0x136233,_0x5b1547){return function(_0x20913f){if(!_0x20913f){_0x136233[_0xb025('0x16')](0x194);}return _0x20913f;};}function handleError(_0x59195d,_0x255ca7){_0x255ca7=_0x255ca7||0x1f4;return function(_0x423b5a){logger[_0xb025('0x23')](_0x423b5a[_0xb025('0x24')]);if(_0x423b5a[_0xb025('0x25')]){delete _0x423b5a[_0xb025('0x25')];}_0x59195d[_0xb025('0x17')](_0x255ca7)[_0xb025('0x26')](_0x423b5a);};}exports[_0xb025('0x27')]=function(_0x2201cb,_0x40e280){var _0x555aa3={},_0x4e2930={},_0x2593e1={'count':0x0,'rows':[]};var _0x8dc14a=_[_0xb025('0x28')](db[_0xb025('0x29')][_0xb025('0x2a')],function(_0x58677c){return{'name':_0x58677c[_0xb025('0x2b')],'type':_0x58677c['type'][_0xb025('0x2c')]};});_0x4e2930[_0xb025('0x2d')]=_[_0xb025('0x28')](_0x8dc14a,_0xb025('0x25'));_0x4e2930[_0xb025('0x2e')]=_[_0xb025('0x2f')](_0x2201cb[_0xb025('0x2e')]);_0x4e2930[_0xb025('0x30')]=_[_0xb025('0x31')](_0x4e2930['model'],_0x4e2930[_0xb025('0x2e')]);_0x555aa3[_0xb025('0x32')]=_[_0xb025('0x31')](_0x4e2930[_0xb025('0x2d')],qs[_0xb025('0x33')](_0x2201cb['query'][_0xb025('0x33')]));_0x555aa3['attributes']=_0x555aa3[_0xb025('0x32')][_0xb025('0x34')]?_0x555aa3['attributes']:_0x4e2930['model'];if(!_0x2201cb[_0xb025('0x2e')][_0xb025('0x35')](_0xb025('0x36'))){_0x555aa3[_0xb025('0x1b')]=qs['limit'](_0x2201cb[_0xb025('0x2e')]['limit']);_0x555aa3[_0xb025('0x19')]=qs[_0xb025('0x19')](_0x2201cb[_0xb025('0x2e')][_0xb025('0x19')]);}_0x555aa3['order']=qs[_0xb025('0x37')](_0x2201cb['query']['sort']);_0x555aa3[_0xb025('0x38')]=qs[_0xb025('0x30')](_[_0xb025('0x39')](_0x2201cb[_0xb025('0x2e')],_0x4e2930[_0xb025('0x30')]),_0x8dc14a);if(_0x2201cb[_0xb025('0x2e')][_0xb025('0x3a')]){_0x555aa3[_0xb025('0x38')]=_[_0xb025('0x3b')](_0x555aa3['where'],{'$or':_['map'](_0x8dc14a,function(_0x951edb){if(_0x951edb[_0xb025('0x3c')]!=='VIRTUAL'){var _0x32fc22={};_0x32fc22[_0x951edb[_0xb025('0x25')]]={'$like':'%'+_0x2201cb[_0xb025('0x2e')][_0xb025('0x3a')]+'%'};return _0x32fc22;}})});}_0x555aa3=_[_0xb025('0x3b')]({},_0x555aa3,_0x2201cb[_0xb025('0x3d')]);var _0xec3e46={'where':_0x555aa3['where']};return db[_0xb025('0x29')][_0xb025('0x1c')](_0xec3e46)['then'](function(_0x4a5d9a){_0x2593e1[_0xb025('0x1c')]=_0x4a5d9a;if(_0x2201cb[_0xb025('0x2e')][_0xb025('0x3e')]){_0x555aa3[_0xb025('0x3f')]=[{'all':!![]}];}return db[_0xb025('0x29')][_0xb025('0x40')](_0x555aa3);})['then'](function(_0x27f695){_0x2593e1[_0xb025('0x41')]=_0x27f695;return _0x2593e1;})['then'](respondWithFilteredResult(_0x40e280,_0x555aa3))[_0xb025('0x42')](handleError(_0x40e280,null));};exports[_0xb025('0x43')]=function(_0x2ae6e3,_0x2d02a0){var _0x3280db={'raw':!![],'where':{'id':_0x2ae6e3[_0xb025('0x44')]['id']}},_0x549884={};_0x549884[_0xb025('0x2d')]=_[_0xb025('0x2f')](db[_0xb025('0x29')][_0xb025('0x2a')]);_0x549884[_0xb025('0x2e')]=_['keys'](_0x2ae6e3[_0xb025('0x2e')]);_0x549884[_0xb025('0x30')]=_[_0xb025('0x31')](_0x549884['model'],_0x549884[_0xb025('0x2e')]);_0x3280db['attributes']=_['intersection'](_0x549884[_0xb025('0x2d')],qs['fields'](_0x2ae6e3[_0xb025('0x2e')][_0xb025('0x33')]));_0x3280db['attributes']=_0x3280db[_0xb025('0x32')][_0xb025('0x34')]?_0x3280db[_0xb025('0x32')]:_0x549884[_0xb025('0x2d')];if(_0x2ae6e3[_0xb025('0x2e')][_0xb025('0x3e')]){_0x3280db[_0xb025('0x3f')]=[{'all':!![]}];}_0x3280db=_[_0xb025('0x3b')]({},_0x3280db,_0x2ae6e3['options']);return db[_0xb025('0x29')][_0xb025('0x45')](_0x3280db)[_0xb025('0x22')](handleEntityNotFound(_0x2d02a0,null))[_0xb025('0x22')](respondWithResult(_0x2d02a0,null))[_0xb025('0x42')](handleError(_0x2d02a0,null));};exports[_0xb025('0x46')]=function(_0xddad1e,_0x2a17a3){return db[_0xb025('0x29')]['create'](_0xddad1e[_0xb025('0x47')],{})[_0xb025('0x22')](respondWithResult(_0x2a17a3,0xc9))['catch'](handleError(_0x2a17a3,null));};exports[_0xb025('0x21')]=function(_0x5c3846,_0x4fa1d4){if(_0x5c3846[_0xb025('0x47')]['id']){delete _0x5c3846['body']['id'];}return db[_0xb025('0x29')][_0xb025('0x45')]({'where':{'id':_0x5c3846[_0xb025('0x44')]['id']}})[_0xb025('0x22')](handleEntityNotFound(_0x4fa1d4,null))['then'](saveUpdates(_0x5c3846[_0xb025('0x47')],null))[_0xb025('0x22')](respondWithResult(_0x4fa1d4,null))[_0xb025('0x42')](handleError(_0x4fa1d4,null));};exports[_0xb025('0x48')]=function(_0x596e57,_0xd846aa){return db['ChatTransferReport'][_0xb025('0x45')]({'where':{'id':_0x596e57[_0xb025('0x44')]['id']}})[_0xb025('0x22')](handleEntityNotFound(_0xd846aa,null))[_0xb025('0x22')](removeEntity(_0xd846aa,null))[_0xb025('0x42')](handleError(_0xd846aa,null));};exports[_0xb025('0x49')]=function(_0x3267b8,_0x37c7a7){return db[_0xb025('0x29')][_0xb025('0x49')]()[_0xb025('0x22')](respondWithResult(_0x37c7a7,null))[_0xb025('0x42')](handleError(_0x37c7a7,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 54b26d0..7d8223c 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 _0x5a82=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x56d5f8,_0x26b8f7){var _0x1afb43=function(_0x217553){while(--_0x217553){_0x56d5f8['push'](_0x56d5f8['shift']());}};_0x1afb43(++_0x26b8f7);}(_0x5a82,0x197));var _0x25a8=function(_0x434660,_0x33aa96){_0x434660=_0x434660-0x0;var _0x26f786=_0x5a82[_0x434660];return _0x26f786;};'use strict';var _=require('lodash');var util=require(_0x25a8('0x0'));var logger=require(_0x25a8('0x1'))(_0x25a8('0x2'));var moment=require(_0x25a8('0x3'));var BPromise=require(_0x25a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x25a8('0x5'));var config=require(_0x25a8('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x25a8('0x7')]=function(_0x3cec3e,_0x25c5d4){return _0x3cec3e['define'](_0x25a8('0x8'),attributes,{'tableName':_0x25a8('0x9'),'paranoid':![],'indexes':[{'name':_0x25a8('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2180=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer'];(function(_0x109294,_0x62001){var _0x80a6fa=function(_0x2b3726){while(--_0x2b3726){_0x109294['push'](_0x109294['shift']());}};_0x80a6fa(++_0x62001);}(_0x2180,0xa9));var _0x0218=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x2180[_0x954b3a];return _0x3a313e;};'use strict';var _=require(_0x0218('0x0'));var util=require(_0x0218('0x1'));var logger=require(_0x0218('0x2'))(_0x0218('0x3'));var moment=require(_0x0218('0x4'));var BPromise=require(_0x0218('0x5'));var rp=require(_0x0218('0x6'));var fs=require('fs');var path=require(_0x0218('0x7'));var rimraf=require('rimraf');var config=require(_0x0218('0x8'));var attributes=require(_0x0218('0x9'));module[_0x0218('0xa')]=function(_0x1a51e9,_0x5604f2){return _0x1a51e9[_0x0218('0xb')]('ChatTransferReport',attributes,{'tableName':_0x0218('0xc'),'paranoid':![],'indexes':[{'name':_0x0218('0xd'),'fields':[_0x0218('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 9be0dfe..cef520b 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 _0x3622=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x41640b,_0x112967){var _0x59a6c2=function(_0xdfe556){while(--_0xdfe556){_0x41640b['push'](_0x41640b['shift']());}};_0x59a6c2(++_0x112967);}(_0x3622,0x1a5));var _0x2362=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3622[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var util=require(_0x2362('0x0'));var moment=require(_0x2362('0x1'));var BPromise=require(_0x2362('0x2'));var rs=require(_0x2362('0x3'));var fs=require('fs');var Redis=require(_0x2362('0x4'));var db=require(_0x2362('0x5'))['db'];var utils=require(_0x2362('0x6'));var logger=require(_0x2362('0x7'))('rpc');var config=require(_0x2362('0x8'));var jayson=require(_0x2362('0x9'));var client=jayson[_0x2362('0xa')][_0x2362('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c8aef,_0x59acc4,_0x1381bc){return new BPromise(function(_0x3b11e2,_0x4ada03){return client[_0x2362('0xc')](_0x2c8aef,_0x1381bc)[_0x2362('0xd')](function(_0x4c35d4){logger['info'](_0x2362('0xe'),_0x59acc4,_0x2362('0xf'));logger[_0x2362('0x10')](_0x2362('0x11'),_0x59acc4,'request\x20sent',JSON[_0x2362('0x12')](_0x4c35d4));if(_0x4c35d4[_0x2362('0x13')]){if(_0x4c35d4[_0x2362('0x13')]['code']===0x1f4){logger[_0x2362('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x59acc4,_0x4c35d4['error'][_0x2362('0x14')]);return _0x4ada03(_0x4c35d4['error'][_0x2362('0x14')]);}logger[_0x2362('0x13')](_0x2362('0xe'),_0x59acc4,_0x4c35d4[_0x2362('0x13')]['message']);return _0x3b11e2(_0x4c35d4[_0x2362('0x13')][_0x2362('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x59acc4,_0x2362('0xf'));_0x3b11e2(_0x4c35d4[_0x2362('0x15')][_0x2362('0x14')]);}})[_0x2362('0x16')](function(_0x3a092e){logger['error'](_0x2362('0xe'),_0x59acc4,_0x3a092e);_0x4ada03(_0x3a092e);});});}
\ No newline at end of file
+var _0x1bc3=['code','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x452ab2,_0x6da72b){var _0x5e9940=function(_0x45c3d4){while(--_0x45c3d4){_0x452ab2['push'](_0x452ab2['shift']());}};_0x5e9940(++_0x6da72b);}(_0x1bc3,0x144));var _0x31bc=function(_0x521f4e,_0x1114c2){_0x521f4e=_0x521f4e-0x0;var _0x407fda=_0x1bc3[_0x521f4e];return _0x407fda;};'use strict';var _=require(_0x31bc('0x0'));var util=require('util');var moment=require(_0x31bc('0x1'));var BPromise=require(_0x31bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31bc('0x3'));var db=require(_0x31bc('0x4'))['db'];var utils=require(_0x31bc('0x5'));var logger=require(_0x31bc('0x6'))(_0x31bc('0x7'));var config=require(_0x31bc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x31bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d0112,_0x5b54a3,_0x16db44){return new BPromise(function(_0x1a6040,_0x1c4dde){return client['request'](_0x5d0112,_0x16db44)[_0x31bc('0xa')](function(_0x282049){logger['info'](_0x31bc('0xb'),_0x5b54a3,'request\x20sent');logger[_0x31bc('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5b54a3,_0x31bc('0xd'),JSON[_0x31bc('0xe')](_0x282049));if(_0x282049[_0x31bc('0xf')]){if(_0x282049[_0x31bc('0xf')][_0x31bc('0x10')]===0x1f4){logger[_0x31bc('0xf')](_0x31bc('0xb'),_0x5b54a3,_0x282049[_0x31bc('0xf')][_0x31bc('0x11')]);return _0x1c4dde(_0x282049['error'][_0x31bc('0x11')]);}logger[_0x31bc('0xf')](_0x31bc('0xb'),_0x5b54a3,_0x282049['error'][_0x31bc('0x11')]);return _0x1a6040(_0x282049[_0x31bc('0xf')][_0x31bc('0x11')]);}else{logger[_0x31bc('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5b54a3,_0x31bc('0xd'));_0x1a6040(_0x282049[_0x31bc('0x13')]['message']);}})['catch'](function(_0x2d4d1d){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5b54a3,_0x2d4d1d);_0x1c4dde(_0x2d4d1d);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 250fc82..c08bf26 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 _0x7c1f=['express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x541d74,_0x4d8ac1){var _0x1bd9c4=function(_0x34ecf6){while(--_0x34ecf6){_0x541d74['push'](_0x541d74['shift']());}};_0x1bd9c4(++_0x4d8ac1);}(_0x7c1f,0x1b6));var _0xf7c1=function(_0xbdeccb,_0x1716aa){_0xbdeccb=_0xbdeccb-0x0;var _0x1e8ddf=_0x7c1f[_0xbdeccb];return _0x1e8ddf;};'use strict';var multer=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf7c1('0x2'));var router=express['Router']();var fs_extra=require(_0xf7c1('0x3'));var auth=require(_0xf7c1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf7c1('0x5'));var controller=require(_0xf7c1('0x6'));router['get']('/',auth[_0xf7c1('0x7')](),controller[_0xf7c1('0x8')]);router['get'](_0xf7c1('0x9'),auth[_0xf7c1('0x7')](),controller['describe']);router[_0xf7c1('0xa')](_0xf7c1('0xb'),auth[_0xf7c1('0x7')](),controller[_0xf7c1('0xc')]);router[_0xf7c1('0xd')]('/',auth[_0xf7c1('0x7')](),controller[_0xf7c1('0xe')]);router[_0xf7c1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf7c1('0x10')]);router[_0xf7c1('0x11')](_0xf7c1('0xb'),auth[_0xf7c1('0x7')](),controller[_0xf7c1('0x12')]);module[_0xf7c1('0x13')]=router;
\ No newline at end of file
+var _0x9748=['express','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','/describe','describe','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x9748,0x1d1));var _0x8974=function(_0x5d2c0e,_0x864cca){_0x5d2c0e=_0x5d2c0e-0x0;var _0x3ac730=_0x9748[_0x5d2c0e];return _0x3ac730;};'use strict';var multer=require(_0x8974('0x0'));var util=require('util');var path=require(_0x8974('0x1'));var timeout=require(_0x8974('0x2'));var express=require(_0x8974('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8974('0x4'));var interaction=require(_0x8974('0x5'));var config=require('../../config/environment');var controller=require(_0x8974('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8974('0x7')](_0x8974('0x8'),auth['isAuthenticated'](),controller[_0x8974('0x9')]);router[_0x8974('0x7')](_0x8974('0xa'),auth['isAuthenticated'](),controller[_0x8974('0xb')]);router['post']('/',auth[_0x8974('0xc')](),controller['create']);router[_0x8974('0xd')](_0x8974('0xa'),auth[_0x8974('0xc')](),controller[_0x8974('0xe')]);router[_0x8974('0xf')](_0x8974('0xa'),auth[_0x8974('0xc')](),controller[_0x8974('0x10')]);module[_0x8974('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 6a03917..4b518dd 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 _0xe76d=['textarea','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:','CHAT','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','parse','getDataValue','setDataValue','onlineForm','stringify'];(function(_0x5b959e,_0x2f221a){var _0x4c3e9c=function(_0xb799f1){while(--_0xb799f1){_0x5b959e['push'](_0x5b959e['shift']());}};_0x4c3e9c(++_0x2f221a);}(_0xe76d,0x13a));var _0xde76=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xe76d[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xde76('0x0'));var rs=require(_0xde76('0x1'));module[_0xde76('0x2')]={'name':{'type':Sequelize[_0xde76('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde76('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x5')},'mapKeyOffline':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x5')},'key':{'type':Sequelize[_0xde76('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x6')},'customerAlias':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':_0xde76('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':_0xde76('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xde76('0x3')]},'animation':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xde76('0xa')](_0xde76('0xb'),_0xde76('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xd')},'start_chat_button':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xe')},'offline_chat_button':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xf')},'header_offline':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x10')},'download_transcript':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xde76('0x11')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x12')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xde76('0x13')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x14')},'formSubmitSuccessMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x15')},'formSubmitFailureMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x16')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x17')},'placeholderMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0x18')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xde76('0xf')},'skipMessageButton':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x19')},'conditionAgreement':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x1a')},'ratingType':{'type':Sequelize[_0xde76('0xa')](_0xde76('0x1b'),_0xde76('0x1c')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xde76('0x11')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xde76('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xde76('0x1d'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xde76('0x1e'),'helpText':''}},{'type':_0xde76('0x1d'),'props':{'title':_0xde76('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xde76('0x5'),'type':_0xde76('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xde76('0x1f')](this[_0xde76('0x20')]('onlineForm')):{};},'set':function(_0x58540b){return this[_0xde76('0x21')](_0xde76('0x22'),JSON[_0xde76('0x23')](_0x58540b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xde76('0x23')]({'items':[{'type':_0xde76('0x1d'),'props':{'title':_0xde76('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xde76('0x5'),'type':_0xde76('0x5')},'variable':null},{'type':_0xde76('0x24'),'config':{'placeholder':_0xde76('0x25')},'props':{'title':_0xde76('0x25'),'helpText':_0xde76('0x26')}}],'fromKey':0x0});},'get':function(){return this[_0xde76('0x20')](_0xde76('0x27'))?JSON[_0xde76('0x1f')](this[_0xde76('0x20')](_0xde76('0x27'))):{};},'set':function(_0x544029){return this[_0xde76('0x21')](_0xde76('0x27'),JSON['stringify'](_0x544029));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xde76('0x28')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xde76('0x3')]},'forwardOffline':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xde76('0x3')]},'waitingTitle':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x29')},'waitingMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2a')},'offlineMessageSubject':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2b')},'offlineMessageBody':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2c')},'enableUnmanagedNote':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x19')},'sendUnmanaged':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xde76('0x3')]},'notificationTemplate':{'type':Sequelize[_0xde76('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xde76('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2d')},'messagesAlignment':{'type':Sequelize[_0xde76('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde76('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xde76('0x3')],'defaultValue':_0xde76('0x2e')},'systemAvatar':{'type':Sequelize[_0xde76('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde76('0x11')],'comment':_0xde76('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x105651){if(!_0x105651)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xde76('0x21')](_0xde76('0x30'),_0x105651);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xde76('0x3')]},'vidaooTopic':{'type':Sequelize[_0xde76('0x3')],'allowNull':![],'defaultValue':_0xde76('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xde76('0x13')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xde76('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x447f=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','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:','Your\x20request\x20has\x20not\x20been\x20processed.'];(function(_0x754f0,_0x4b0d70){var _0x486710=function(_0x24105c){while(--_0x24105c){_0x754f0['push'](_0x754f0['shift']());}};_0x486710(++_0x4b0d70);}(_0x447f,0x156));var _0xf447=function(_0x546c3b,_0x248e63){_0x546c3b=_0x546c3b-0x0;var _0x7b2f47=_0x447f[_0x546c3b];return _0x7b2f47;};'use strict';var Sequelize=require(_0xf447('0x0'));var rs=require(_0xf447('0x1'));module[_0xf447('0x2')]={'name':{'type':Sequelize[_0xf447('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'unique':_0xf447('0x4')},'description':{'type':Sequelize[_0xf447('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x5')},'mapKeyOffline':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x5')},'key':{'type':Sequelize[_0xf447('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x6')},'customerAlias':{'type':Sequelize[_0xf447('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':_0xf447('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':_0xf447('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf447('0x3')]},'animation':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf447('0xb')](_0xf447('0xc'),_0xf447('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0xf')},'header_offline':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x10')},'download_transcript':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf447('0x11')]},'closingQuestion':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x15')},'placeholderMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0xf')},'skipMessageButton':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x17')},'conditionAgreement':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x18')},'ratingType':{'type':Sequelize[_0xf447('0xb')](_0xf447('0x19'),_0xf447('0x1a')),'defaultValue':_0xf447('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf447('0x1b')]({'items':[{'type':_0xf447('0x1c'),'variable':null,'config':{'placeholder':'name','type':_0xf447('0x1d'),'required':!![]},'props':{'title':_0xf447('0x1e'),'helpText':''}},{'type':_0xf447('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf447('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf447('0x1f')](_0xf447('0x20'))?JSON[_0xf447('0x21')](this[_0xf447('0x1f')](_0xf447('0x20'))):{};},'set':function(_0x3edcde){return this['setDataValue'](_0xf447('0x20'),JSON[_0xf447('0x1b')](_0x3edcde));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf447('0x1c'),'props':{'title':_0xf447('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf447('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xf447('0x22'),'helpText':_0xf447('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf447('0x24'))?JSON[_0xf447('0x21')](this[_0xf447('0x1f')](_0xf447('0x24'))):{};},'set':function(_0x58af63){return this['setDataValue'](_0xf447('0x24'),JSON[_0xf447('0x1b')](_0x58af63));}},'token':{'type':Sequelize[_0xf447('0x3')],'defaultValue':function(){return rs[_0xf447('0x25')]();}},'autoclose':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf447('0x3')]},'forwardOffline':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf447('0x3')]},'waitingTitle':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x26')},'waitingMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x28')},'offlineMessageBody':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf447('0x11')],'defaultValue':function(){return _0xf447('0x2b');}},'notificationSound':{'type':Sequelize[_0xf447('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf447('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf447('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xf447('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xf447('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf447('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':_0xf447('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf447('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf447('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf447('0x3')],'defaultValue':_0xf447('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf447('0x9')],'comment':_0xf447('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![],'comment':_0xf447('0x32'),'set':function(_0xa0a312){if(!_0xa0a312)this['setDataValue'](_0xf447('0x33'),null);this[_0xf447('0x34')](_0xf447('0x35'),_0xa0a312);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf447('0x3')]},'vidaooTopic':{'type':Sequelize[_0xf447('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf447('0x36');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf447('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf447('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 3652936..20ab415 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 _0x44e8=['includeAll','include','rows','rawAttributes','length','find','body','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','testWildcardValidity','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','order','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','timezone','ifTime','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','List','Contacts','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','interaction','firstName','messageId','autoclose','push','close','ChatMessage','UserId','User','*,*,*,*','forcedOwnership','queueId','ChatQueue','unshift','queue','Start','startRouting','EventManager','notify','Sequelize','difference','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','getSnippet','interval','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','origin','testWebsiteWithWildcard','address','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','color','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APIOutOfIntervalError','handleError','APIConflictError','url','URL','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','client','http','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','ChatWebsites','destroy','end','stack','name','send','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','first','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options'];(function(_0x8cc7c,_0x591379){var _0x404b40=function(_0x3d1de1){while(--_0x3d1de1){_0x8cc7c['push'](_0x8cc7c['shift']());}};_0x404b40(++_0x591379);}(_0x44e8,0xd7));var _0x844e=function(_0x57ebbb,_0x4e6823){_0x57ebbb=_0x57ebbb-0x0;var _0x4f9f78=_0x44e8[_0x57ebbb];return _0x4f9f78;};'use strict';var Mustache=require(_0x844e('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x844e('0x1'));var fs=require('fs');var fs_extra=require(_0x844e('0x2'));var _=require(_0x844e('0x3'));var querystring=require(_0x844e('0x4'));var htmlToText=require('html-to-text');var Redis=require(_0x844e('0x5'));var jayson=require(_0x844e('0x6'));var qs=require(_0x844e('0x7'));var logger=require(_0x844e('0x8'))('api');var config=require(_0x844e('0x9'));var APIBadRequestError=require(_0x844e('0xa'))[_0x844e('0xb')];var APINotFoundError=require(_0x844e('0xa'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x844e('0xa'))[_0x844e('0xc')];var APIHandleError=require(_0x844e('0xa'))[_0x844e('0xd')];var APIConflictError=require(_0x844e('0xa'))[_0x844e('0xe')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x844e('0xf'))[_0x844e('0x10')];var db=require(_0x844e('0x11'))['db'];config[_0x844e('0x12')]=_[_0x844e('0x13')](config[_0x844e('0x12')],{'host':_0x844e('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x844e('0x12')]));require(_0x844e('0x15'))['register'](socket);var client=jayson[_0x844e('0x16')][_0x844e('0x17')]({'port':0x232c});var client9002=jayson['client'][_0x844e('0x17')]({'port':0x232a});var client9003=jayson[_0x844e('0x16')][_0x844e('0x17')]({'port':0x232b});var client9001=jayson['client'][_0x844e('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x465e49,_0x380eb4,_0x935134,_0x2588a3){return new Promise(function(_0x353be9,_0x2227c6){var _0x5506ef=_0x2588a3||client;return _0x5506ef['request'](_0x465e49,_0x935134)[_0x844e('0x18')](function(_0x56791b){logger[_0x844e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x380eb4,_0x844e('0x1a'));logger['debug'](_0x844e('0x1b'),_0x380eb4,_0x844e('0x1a'),JSON[_0x844e('0x1c')](_0x56791b));if(_0x56791b[_0x844e('0x1d')]){if(_0x56791b[_0x844e('0x1d')][_0x844e('0x1e')]===0x1f4){logger[_0x844e('0x1d')](_0x844e('0x1f'),_0x380eb4,_0x56791b['error'][_0x844e('0x20')]);return _0x2227c6(_0x56791b['error']['message']);}logger[_0x844e('0x1d')](_0x844e('0x1f'),_0x380eb4,_0x56791b[_0x844e('0x1d')][_0x844e('0x20')]);return _0x353be9(_0x56791b['error'][_0x844e('0x20')]);}else{logger[_0x844e('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x380eb4,_0x844e('0x1a'));_0x353be9(_0x56791b[_0x844e('0x21')][_0x844e('0x20')]);}})[_0x844e('0x22')](function(_0x35236b){logger[_0x844e('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x380eb4,_0x35236b);_0x2227c6(_0x35236b);});});}function respondWithStatusCode(_0x399a81,_0xadf0d8){_0xadf0d8=_0xadf0d8||0xcc;return function(_0x11859a){if(_0x11859a){return _0x399a81[_0x844e('0x23')](_0xadf0d8);}return _0x399a81[_0x844e('0x24')](_0xadf0d8)['end']();};}function respondWithResult(_0x3725b2,_0x5080c1){_0x5080c1=_0x5080c1||0xc8;return function(_0x57b2ef){if(_0x57b2ef){return _0x3725b2[_0x844e('0x24')](_0x5080c1)[_0x844e('0x25')](_0x57b2ef);}};}function respondWithFilteredResult(_0x355456,_0x587613){return function(_0x489349){if(_0x489349){var _0x2d4acd=typeof _0x587613[_0x844e('0x26')]==='undefined'&&typeof _0x587613[_0x844e('0x27')]===_0x844e('0x28');var _0x2f1697=_0x489349[_0x844e('0x29')];var _0x454b68=_0x2d4acd?0x0:_0x587613[_0x844e('0x26')];var _0x30d0a2=_0x2d4acd?_0x489349[_0x844e('0x29')]:_0x587613[_0x844e('0x26')]+_0x587613[_0x844e('0x27')];var _0x550240;if(_0x30d0a2>=_0x2f1697){_0x30d0a2=_0x2f1697;_0x550240=0xc8;}else{_0x550240=0xce;}_0x355456[_0x844e('0x24')](_0x550240);return _0x355456[_0x844e('0x2a')](_0x844e('0x2b'),_0x454b68+'-'+_0x30d0a2+'/'+_0x2f1697)[_0x844e('0x25')](_0x489349);}return null;};}function saveUpdates(_0x43ae36){return function(_0x31754e){if(_0x31754e){return _0x31754e[_0x844e('0x2c')](_0x43ae36)['then'](function(_0x26d6f2){return _0x26d6f2;});}return null;};}function removeEntity(_0x34ea8b){return function(_0x294dea){if(_0x294dea){return _0x294dea['destroy']()[_0x844e('0x18')](function(){var _0x1592fb=_0x294dea['get']({'plain':!![]});var _0x1fdba9=_0x844e('0x2d');return db['UserProfileResource'][_0x844e('0x2e')]({'where':{'type':_0x1fdba9,'resourceId':_0x1592fb['id']}})[_0x844e('0x18')](function(){return _0x294dea;});})[_0x844e('0x18')](function(){_0x34ea8b[_0x844e('0x24')](0xcc)[_0x844e('0x2f')]();});}};}function handleEntityNotFound(_0x3aa8ba){return function(_0xd61d0c){if(!_0xd61d0c){_0x3aa8ba['sendStatus'](0x194);}return _0xd61d0c;};}function handleError(_0x31d896,_0x387723){_0x387723=_0x387723||0x1f4;return function(_0x29637e){logger[_0x844e('0x1d')](_0x29637e[_0x844e('0x30')]);if(_0x29637e[_0x844e('0x31')]){delete _0x29637e[_0x844e('0x31')];}_0x31d896[_0x844e('0x24')](_0x387723)[_0x844e('0x32')](_0x29637e);};}function createInteractionObject(_0x4155ad,_0x13614e,_0x5d9544,_0x5701d5){var _0x3ad6d5=require(_0x844e('0x33'));var _0xe3d034=new _0x3ad6d5();var _0xc1c669=_0xe3d034[_0x844e('0x34')](_0x5d9544[_0x844e('0x35')])[_0x844e('0x36')]();var _0x23032f=_0x13614e[_0x844e('0x37')];if(_0x5d9544['cf-connecting-ip']){_0x23032f=_0x5d9544[_0x844e('0x38')];}else if(_0x5d9544['x-forwarded-for']){_0x23032f=_[_0x844e('0x39')](_0x5d9544['x-forwarded-for'][_0x844e('0x3a')](','));}return{'ContactId':_0x5701d5['id'],'ChatWebsiteId':_0x4155ad,'from':(_0x5701d5['firstName']||'')+'\x20'+(_0x5701d5[_0x844e('0x3b')]||''),'customerIp':_0x23032f,'customerPort':_0x5d9544[_0x844e('0x3c')]?_0x5d9544[_0x844e('0x3c')]:null,'referer':_0x13614e[_0x844e('0x3d')],'browserName':_0xc1c669[_0x844e('0x3e')][_0x844e('0x31')]&&_0xc1c669[_0x844e('0x3e')][_0x844e('0x3f')]?util[_0x844e('0x40')](_0x844e('0x41'),_0xc1c669[_0x844e('0x3e')]['name'],_0xc1c669[_0x844e('0x3e')][_0x844e('0x3f')]):_0x844e('0x42'),'browserVersion':_0xc1c669['browser']['version']||_0x844e('0x42'),'osName':util[_0x844e('0x40')](_0x844e('0x41'),_0xc1c669['os']['name'],_0xc1c669['os']['version']),'osVersion':_0xc1c669['os']['version'],'deviceModel':_0xc1c669['device'][_0x844e('0x43')]&&_0xc1c669[_0x844e('0x44')][_0x844e('0x45')]?util[_0x844e('0x40')](_0x844e('0x46'),_0xc1c669['device'][_0x844e('0x43')],_0xc1c669['device']['vendor'],_0xc1c669[_0x844e('0x44')][_0x844e('0x47')]):null,'deviceVendor':_0xc1c669[_0x844e('0x44')][_0x844e('0x45')],'deviceType':_0xc1c669['device'][_0x844e('0x47')],'formData':JSON[_0x844e('0x1c')](_0x13614e)};}exports[_0x844e('0x48')]=function(_0x5ee193,_0x36ef59){var _0x1bcbda={'include':[{'model':db[_0x844e('0x49')],'as':_0x844e('0x4a')}]},_0x558f21={},_0x3c6502={'count':0x0,'rows':[]};var _0x443c7a=_[_0x844e('0x4b')](db[_0x844e('0x4c')]['rawAttributes'],function(_0x200932){return{'name':_0x200932[_0x844e('0x4d')],'type':_0x200932[_0x844e('0x47')][_0x844e('0x4e')]};});_0x558f21[_0x844e('0x43')]=_[_0x844e('0x4b')](_0x443c7a,_0x844e('0x31'));_0x558f21[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x5ee193[_0x844e('0x4f')]);_0x558f21['filters']=_[_0x844e('0x51')](_0x558f21[_0x844e('0x43')],_0x558f21[_0x844e('0x4f')]);_0x1bcbda['attributes']=_[_0x844e('0x51')](_0x558f21[_0x844e('0x43')],qs[_0x844e('0x52')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x52')]));_0x1bcbda[_0x844e('0x53')]=_0x1bcbda[_0x844e('0x53')]['length']?_0x1bcbda[_0x844e('0x53')]:_0x558f21[_0x844e('0x43')];if(!_0x5ee193[_0x844e('0x4f')][_0x844e('0x54')](_0x844e('0x55'))){_0x1bcbda[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x27')]);_0x1bcbda[_0x844e('0x26')]=qs[_0x844e('0x26')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x26')]);}_0x1bcbda['order']=qs[_0x844e('0x56')](_0x5ee193[_0x844e('0x4f')][_0x844e('0x56')]);_0x1bcbda[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x5ee193['query'],_0x558f21[_0x844e('0x58')]),_0x443c7a);if(_0x5ee193[_0x844e('0x4f')]['filter']){_0x1bcbda[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x1bcbda[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x443c7a,function(_0x26eec5){if(_0x26eec5[_0x844e('0x47')]!==_0x844e('0x5b')){var _0x10e5ac={};_0x10e5ac[_0x26eec5[_0x844e('0x31')]]={'$like':'%'+_0x5ee193[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x10e5ac;}})});}_0x1bcbda=_[_0x844e('0x5a')]({},_0x1bcbda,_0x5ee193[_0x844e('0x5d')]);var _0x3de2c0={'where':_0x1bcbda['where']};return db[_0x844e('0x4c')][_0x844e('0x29')](_0x3de2c0)['then'](function(_0x1aa783){_0x3c6502['count']=_0x1aa783;if(_0x5ee193[_0x844e('0x4f')][_0x844e('0x5e')]){_0x1bcbda[_0x844e('0x5f')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1bcbda);})[_0x844e('0x18')](function(_0x4f7e9b){_0x3c6502[_0x844e('0x60')]=_0x4f7e9b;return _0x3c6502;})[_0x844e('0x18')](respondWithFilteredResult(_0x36ef59,_0x1bcbda))[_0x844e('0x22')](handleError(_0x36ef59,null));};exports['show']=function(_0x13ebe8,_0x3d66e4){var _0x4656ab={'raw':![],'where':{'id':_0x13ebe8['params']['id']},'include':[{'model':db[_0x844e('0x49')],'as':_0x844e('0x4a')}]},_0x192457={};_0x192457[_0x844e('0x43')]=_['keys'](db['ChatWebsite'][_0x844e('0x61')]);_0x192457[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x13ebe8['query']);_0x192457['filters']=_[_0x844e('0x51')](_0x192457[_0x844e('0x43')],_0x192457[_0x844e('0x4f')]);_0x4656ab['attributes']=_[_0x844e('0x51')](_0x192457[_0x844e('0x43')],qs[_0x844e('0x52')](_0x13ebe8['query'][_0x844e('0x52')]));_0x4656ab[_0x844e('0x53')]=_0x4656ab[_0x844e('0x53')][_0x844e('0x62')]?_0x4656ab['attributes']:_0x192457[_0x844e('0x43')];if(_0x13ebe8[_0x844e('0x4f')][_0x844e('0x5e')]){_0x4656ab[_0x844e('0x5f')]=[{'all':!![]}];}_0x4656ab=_[_0x844e('0x5a')]({},_0x4656ab,_0x13ebe8[_0x844e('0x5d')]);return db[_0x844e('0x4c')][_0x844e('0x63')](_0x4656ab)['then'](handleEntityNotFound(_0x3d66e4,null))['then'](respondWithResult(_0x3d66e4,null))[_0x844e('0x22')](handleError(_0x3d66e4,null));};exports['create']=function(_0x252ff9,_0x3bde32){var _0x3753cd=null;_0x252ff9[_0x844e('0x64')]['address']['split'](',')['forEach'](_0x4e4ece=>{if(_0x4e4ece['trim']()!==''&&!wildcardUtils['testWildcardValidity'](_0x4e4ece[_0x844e('0x65')]())){_0x3753cd=new APIBadRequestError('\x22'+_0x4e4ece[_0x844e('0x65')]()+_0x844e('0x66'));}});if(_0x3753cd){return handleError(_0x3bde32,null)(_0x3753cd);}return db['ChatWebsite'][_0x844e('0x67')](_0x252ff9[_0x844e('0x64')],{})['then'](function(_0x19af4e){var _0x5ec1e9=_0x252ff9[_0x844e('0x68')][_0x844e('0x69')]({'plain':!![]});if(!_0x5ec1e9)throw new Error(_0x844e('0x6a'));if(_0x5ec1e9[_0x844e('0x6b')]==='user'){var _0x5554e2=_0x19af4e['get']({'plain':!![]});var _0x314586=_0x844e('0x2d');return db[_0x844e('0x6c')][_0x844e('0x63')]({'where':{'name':_0x314586,'userProfileId':_0x5ec1e9[_0x844e('0x6d')]},'raw':!![]})['then'](function(_0x566718){if(_0x566718&&_0x566718[_0x844e('0x6e')]===0x0){return db[_0x844e('0x6f')][_0x844e('0x67')]({'name':_0x5554e2[_0x844e('0x31')],'resourceId':_0x5554e2['id'],'type':_0x566718[_0x844e('0x31')],'sectionId':_0x566718['id']},{})[_0x844e('0x18')](function(){return _0x19af4e;});}else{return _0x19af4e;}})['catch'](function(_0x97d37c){logger[_0x844e('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x97d37c);throw _0x97d37c;});}return _0x19af4e;})[_0x844e('0x18')](respondWithResult(_0x3bde32,0xc9))[_0x844e('0x22')](handleError(_0x3bde32,null));};exports['update']=function(_0x5839e3,_0x240572){var _0x20cac2=null;_0x5839e3[_0x844e('0x64')]['address']['split'](',')['forEach'](_0x452073=>{if(_0x452073['trim']()!==''&&!wildcardUtils[_0x844e('0x70')](_0x452073[_0x844e('0x65')]())){_0x20cac2=new APIBadRequestError('\x22'+_0x452073[_0x844e('0x65')]()+_0x844e('0x66'));}});if(_0x20cac2){return handleError(_0x240572,null)(_0x20cac2);}if(_0x5839e3[_0x844e('0x64')]['id']){delete _0x5839e3[_0x844e('0x64')]['id'];}return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x5839e3[_0x844e('0x71')]['id']},'include':[{'model':db['Pause'],'as':_0x844e('0x4a')}]})[_0x844e('0x18')](handleEntityNotFound(_0x240572,null))[_0x844e('0x18')](saveUpdates(_0x5839e3[_0x844e('0x64')],null))[_0x844e('0x18')](respondWithResult(_0x240572,null))['catch'](handleError(_0x240572,null));};exports['destroy']=function(_0x304e7b,_0x14b226){return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x304e7b[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x14b226,null))[_0x844e('0x18')](removeEntity(_0x14b226,null))['catch'](handleError(_0x14b226,null));};exports[_0x844e('0x72')]=function(_0x7c1b20,_0x484833){return db[_0x844e('0x4c')][_0x844e('0x72')]()[_0x844e('0x18')](respondWithResult(_0x484833,null))['catch'](handleError(_0x484833,null));};exports['addDisposition']=function(_0x2123e4,_0x277087){if(_0x2123e4['body']['id']){delete _0x2123e4[_0x844e('0x64')]['id'];}return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x2123e4[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x277087,null))[_0x844e('0x18')](function(_0x35d7f3){if(_0x35d7f3){_0x2123e4['body'][_0x844e('0x73')]=_0x35d7f3['id'];return db['Disposition'][_0x844e('0x67')](_0x2123e4['body']);}})[_0x844e('0x18')](respondWithResult(_0x277087,null))['catch'](handleError(_0x277087,null));};exports[_0x844e('0x74')]=function(_0x23c91b,_0x52b49a){var _0x37748e={'raw':![],'where':{}};var _0x3faf7d={};var _0xaae76d={'count':0x0,'rows':[]};return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x23c91b['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x52b49a,null))[_0x844e('0x18')](function(_0x2a87e6){if(_0x2a87e6){_0x3faf7d[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0x76')][_0x844e('0x61')]);_0x3faf7d[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x23c91b[_0x844e('0x4f')]);_0x3faf7d['filters']=_[_0x844e('0x51')](_0x3faf7d[_0x844e('0x43')],_0x3faf7d[_0x844e('0x4f')]);_0x37748e[_0x844e('0x53')]=_[_0x844e('0x51')](_0x3faf7d[_0x844e('0x43')],qs[_0x844e('0x52')](_0x23c91b[_0x844e('0x4f')][_0x844e('0x52')]));_0x37748e[_0x844e('0x53')]=_0x37748e[_0x844e('0x53')][_0x844e('0x62')]?_0x37748e[_0x844e('0x53')]:_0x3faf7d[_0x844e('0x43')];if(!_0x23c91b[_0x844e('0x4f')]['hasOwnProperty'](_0x844e('0x55'))){_0x37748e['limit']=qs[_0x844e('0x27')](_0x23c91b[_0x844e('0x4f')][_0x844e('0x27')]);_0x37748e[_0x844e('0x26')]=qs[_0x844e('0x26')](_0x23c91b['query'][_0x844e('0x26')]);}_0x37748e[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x23c91b['query']['sort']);_0x37748e[_0x844e('0x57')]=qs[_0x844e('0x58')](_['pick'](_0x23c91b[_0x844e('0x4f')],_0x3faf7d[_0x844e('0x58')]));_0x37748e[_0x844e('0x57')][_0x844e('0x73')]=_0x2a87e6['id'];if(_0x23c91b[_0x844e('0x4f')][_0x844e('0x5c')]){_0x37748e[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x37748e[_0x844e('0x57')],{'$or':_['map'](_0x37748e[_0x844e('0x53')],function(_0x47d5e9){var _0x3c8f7b={};_0x3c8f7b[_0x47d5e9]={'$like':'%'+_0x23c91b[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x3c8f7b;})});}_0x37748e=_[_0x844e('0x5a')]({},_0x37748e,_0x23c91b[_0x844e('0x5d')]);return db['Disposition'][_0x844e('0x29')]({'where':_0x37748e[_0x844e('0x57')]})['then'](function(_0x1c1f04){_0xaae76d[_0x844e('0x29')]=_0x1c1f04;if(_0x23c91b[_0x844e('0x4f')][_0x844e('0x5e')]){_0x37748e[_0x844e('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0x844e('0x78')](_0x37748e);})[_0x844e('0x18')](function(_0x510811){_0xaae76d['rows']=_0x510811;return _0xaae76d;});}})['then'](respondWithFilteredResult(_0x52b49a,_0x37748e))[_0x844e('0x22')](handleError(_0x52b49a,null));};exports[_0x844e('0x79')]=function(_0x569d9b,_0x24733b){return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x569d9b[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x24733b,null))['then'](function(_0x537ace){if(_0x537ace){return _0x537ace['removeDispositions'](_0x569d9b[_0x844e('0x4f')][_0x844e('0x7a')]);}})[_0x844e('0x18')](respondWithStatusCode(_0x24733b,null))[_0x844e('0x22')](handleError(_0x24733b,null));};exports['addAnswer']=function(_0x5d01e2,_0x475295){if(_0x5d01e2[_0x844e('0x64')]['id']){delete _0x5d01e2[_0x844e('0x64')]['id'];}return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x5d01e2['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x475295,null))[_0x844e('0x18')](function(_0x5c807b){if(_0x5c807b){_0x5d01e2[_0x844e('0x64')]['ChatWebsiteId']=_0x5c807b['id'];return db[_0x844e('0x7b')][_0x844e('0x67')](_0x5d01e2[_0x844e('0x64')]);}})[_0x844e('0x18')](respondWithResult(_0x475295,null))[_0x844e('0x22')](handleError(_0x475295,null));};exports[_0x844e('0x7c')]=function(_0x2029fc,_0x7ca8d1){var _0x5abd61={'raw':![],'where':{}};var _0xad6ae6={};var _0x406886={'count':0x0,'rows':[]};return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x2029fc[_0x844e('0x71')]['id']}})['then'](handleEntityNotFound(_0x7ca8d1,null))[_0x844e('0x18')](function(_0x44d08f){if(_0x44d08f){_0xad6ae6[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0x7b')][_0x844e('0x61')]);_0xad6ae6[_0x844e('0x4f')]=_['keys'](_0x2029fc['query']);_0xad6ae6[_0x844e('0x58')]=_[_0x844e('0x51')](_0xad6ae6[_0x844e('0x43')],_0xad6ae6['query']);_0x5abd61[_0x844e('0x53')]=_[_0x844e('0x51')](_0xad6ae6[_0x844e('0x43')],qs[_0x844e('0x52')](_0x2029fc['query'][_0x844e('0x52')]));_0x5abd61[_0x844e('0x53')]=_0x5abd61[_0x844e('0x53')]['length']?_0x5abd61[_0x844e('0x53')]:_0xad6ae6[_0x844e('0x43')];if(!_0x2029fc['query'][_0x844e('0x54')](_0x844e('0x55'))){_0x5abd61[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x2029fc[_0x844e('0x4f')][_0x844e('0x27')]);_0x5abd61['offset']=qs[_0x844e('0x26')](_0x2029fc[_0x844e('0x4f')][_0x844e('0x26')]);}_0x5abd61[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x2029fc[_0x844e('0x4f')]['sort']);_0x5abd61[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x2029fc[_0x844e('0x4f')],_0xad6ae6[_0x844e('0x58')]));_0x5abd61[_0x844e('0x57')][_0x844e('0x73')]=_0x44d08f['id'];if(_0x2029fc['query']['filter']){_0x5abd61['where']=_[_0x844e('0x5a')](_0x5abd61[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x5abd61[_0x844e('0x53')],function(_0x3205d8){var _0x1072f5={};_0x1072f5[_0x3205d8]={'$like':'%'+_0x2029fc[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x1072f5;})});}_0x5abd61=_[_0x844e('0x5a')]({},_0x5abd61,_0x2029fc['options']);return db['CannedAnswer'][_0x844e('0x29')]({'where':_0x5abd61['where']})[_0x844e('0x18')](function(_0x4a8ce1){_0x406886[_0x844e('0x29')]=_0x4a8ce1;if(_0x2029fc[_0x844e('0x4f')][_0x844e('0x5e')]){_0x5abd61[_0x844e('0x5f')]=[{'all':!![]}];}return db[_0x844e('0x7b')][_0x844e('0x78')](_0x5abd61);})['then'](function(_0x4ae58a){_0x406886['rows']=_0x4ae58a;return _0x406886;});}})[_0x844e('0x18')](respondWithFilteredResult(_0x7ca8d1,_0x5abd61))[_0x844e('0x22')](handleError(_0x7ca8d1,null));};exports[_0x844e('0x7d')]=function(_0x3bd5a8,_0x50890f){return db['ChatWebsite']['find']({'where':{'id':_0x3bd5a8[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x50890f,null))[_0x844e('0x18')](function(_0x34776d){if(_0x34776d){return _0x34776d[_0x844e('0x7d')](_0x3bd5a8[_0x844e('0x4f')][_0x844e('0x7a')]);}})['then'](respondWithStatusCode(_0x50890f,null))[_0x844e('0x22')](handleError(_0x50890f,null));};exports[_0x844e('0x7e')]=function(_0x85d5d6,_0x4dacb6){_0x85d5d6[_0x844e('0x64')][_0x844e('0x7f')]=_0x85d5d6[_0x844e('0x80')]['filename'];return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x85d5d6['params']['id']}})['then'](handleEntityNotFound(_0x4dacb6,null))[_0x844e('0x18')](saveUpdates(_0x85d5d6[_0x844e('0x64')],null))['then'](respondWithResult(_0x4dacb6,null))[_0x844e('0x22')](handleError(_0x4dacb6,null));};exports[_0x844e('0x81')]=function(_0x25f26e,_0x5055c5){_0x25f26e[_0x844e('0x64')][_0x844e('0x82')]=_0x25f26e[_0x844e('0x80')][_0x844e('0x83')];return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x25f26e[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x5055c5,null))[_0x844e('0x18')](saveUpdates(_0x25f26e['body'],null))[_0x844e('0x18')](respondWithResult(_0x5055c5,null))[_0x844e('0x22')](handleError(_0x5055c5,null));};exports['addCustomerAvatar']=function(_0x53d2fd,_0x35f43b){_0x53d2fd[_0x844e('0x64')][_0x844e('0x84')]=_0x53d2fd['file'][_0x844e('0x83')];return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x53d2fd['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x35f43b,null))[_0x844e('0x18')](saveUpdates(_0x53d2fd['body'],null))[_0x844e('0x18')](respondWithResult(_0x35f43b,null))[_0x844e('0x22')](handleError(_0x35f43b,null));};exports[_0x844e('0x85')]=function(_0x52af21,_0x3bb589){_0x52af21[_0x844e('0x64')]['systemAvatar']=_0x52af21[_0x844e('0x80')][_0x844e('0x83')];return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x52af21['params']['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x3bb589,null))['then'](saveUpdates(_0x52af21[_0x844e('0x64')],null))[_0x844e('0x18')](respondWithResult(_0x3bb589,null))[_0x844e('0x22')](handleError(_0x3bb589,null));};exports['getLogo']=function(_0x43a9a7,_0x4c0140){var _0x22cc4b=path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/images/logos/default_logo.svg');var _0x1f5b23={'where':{'id':_0x43a9a7[_0x844e('0x71')]['id']},'attributes':['id',_0x844e('0x7f')],'raw':!![]};var _0x17a815=![];return require(_0x844e('0x88'))[_0x844e('0x89')]()[_0x844e('0x18')](function(_0x8fc499){if(_0x8fc499){_0x17a815=_0x8fc499[_0x844e('0x8a')];}})[_0x844e('0x18')](function(){return db[_0x844e('0x4c')][_0x844e('0x63')](_0x1f5b23);})[_0x844e('0x18')](handleEntityNotFound(_0x4c0140,null))[_0x844e('0x18')](function(_0x1e89e4){if(_0x1e89e4){if(!_[_0x844e('0x8b')](_0x1e89e4['sitepic'])){if(fs[_0x844e('0x8c')](path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/images/logos/',_0x1e89e4['sitepic']))&&_0x17a815){_0x22cc4b=path[_0x844e('0x86')](config[_0x844e('0x87')],_0x844e('0x8d'),_0x1e89e4[_0x844e('0x7f')]);}}return _0x4c0140[_0x844e('0x8e')](_0x22cc4b);}})['catch'](handleError(_0x4c0140,null));};exports[_0x844e('0x8f')]=function(_0xcfe967,_0x3fa9f7){var _0x5a77ac=path['join'](config[_0x844e('0x87')],_0x844e('0x90'));var _0x4939a9={'where':{'id':_0xcfe967['params']['id']},'attributes':['id',_0x844e('0x82')],'raw':!![]};return db[_0x844e('0x4c')][_0x844e('0x63')](_0x4939a9)['then'](handleEntityNotFound(_0x3fa9f7,null))[_0x844e('0x18')](function(_0x2259fa){if(_0x2259fa){if(!_['isNil'](_0x2259fa['agentAvatar'])){if(fs['existsSync'](path['join'](config['root'],_0x844e('0x91'),_0x2259fa[_0x844e('0x82')]))){_0x5a77ac=path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/images/avatars/',_0x2259fa['agentAvatar']);}}return _0x3fa9f7[_0x844e('0x8e')](_0x5a77ac);}})['catch'](handleError(_0x3fa9f7,null));};exports[_0x844e('0x92')]=function(_0x324938,_0xa0fdd1){var _0x2f31c1=path['join'](config['root'],_0x844e('0x93'));var _0x4a1ffc={'where':{'id':_0x324938[_0x844e('0x71')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x844e('0x4c')][_0x844e('0x63')](_0x4a1ffc)['then'](handleEntityNotFound(_0xa0fdd1,null))[_0x844e('0x18')](function(_0x548b0b){if(_0x548b0b){if(!_[_0x844e('0x8b')](_0x548b0b[_0x844e('0x84')])){if(fs[_0x844e('0x8c')](path[_0x844e('0x86')](config['root'],_0x844e('0x91'),_0x548b0b[_0x844e('0x84')]))&&_0x548b0b[_0x844e('0x94')]){_0x2f31c1=path['join'](config['root'],_0x844e('0x91'),_0x548b0b[_0x844e('0x84')]);}}return _0xa0fdd1[_0x844e('0x8e')](_0x2f31c1);}})[_0x844e('0x22')](handleError(_0xa0fdd1,null));};exports[_0x844e('0x95')]=function(_0x2bf367,_0xf4a1e1){var _0x2af775=path[_0x844e('0x86')](config['root'],_0x844e('0x96'));var _0x5715ed={'where':{'id':_0x2bf367[_0x844e('0x71')]['id']},'attributes':['id',_0x844e('0x97')],'raw':!![]};return db['ChatWebsite'][_0x844e('0x63')](_0x5715ed)[_0x844e('0x18')](handleEntityNotFound(_0xf4a1e1,null))[_0x844e('0x18')](function(_0x2dc1db){if(_0x2dc1db){if(!_['isNil'](_0x2dc1db['systemAvatar'])){if(fs[_0x844e('0x8c')](path[_0x844e('0x86')](config['root'],_0x844e('0x91'),_0x2dc1db[_0x844e('0x97')]))){_0x2af775=path['join'](config[_0x844e('0x87')],_0x844e('0x91'),_0x2dc1db['systemAvatar']);}}return _0xf4a1e1['download'](_0x2af775);}})[_0x844e('0x22')](handleError(_0xf4a1e1,null));};function checkWebsiteInterval(_0x1ccd80){var _0x109d7b=_0x1ccd80[_0x844e('0x98')];if(!_0x109d7b){return Promise['resolve'](_0x1ccd80);}var _0x402e17=_0x1ccd80[_0x844e('0x99')]||undefined;return _0x109d7b[_0x844e('0x9a')](_0x402e17)[_0x844e('0x18')](function(_0xe930df){if(!_0xe930df){throw new APIOutOfIntervalError();}return _0x1ccd80;});}exports['notify']=function(_0x5a3db3,_0x4f00cb){var _0x2354a4={'body':_0x5a3db3[_0x844e('0x64')],'channel':'chat'};var _0x3ce7eb=[];var _0x149434=[];var _0x4f6862={};var _0x5117fd=![];if(_0x5a3db3[_0x844e('0x64')]['id']){delete _0x5a3db3[_0x844e('0x64')]['id'];}if(_[_0x844e('0x8b')](_0x5a3db3[_0x844e('0x64')][_0x844e('0x9b')])){throw new APIBadRequestError(_0x844e('0x9c'));}if(_['isNil'](_0x5a3db3[_0x844e('0x64')][_0x844e('0x9d')])){throw new APIBadRequestError(_0x844e('0x9e'));}if(_[_0x844e('0x9f')](_0x5a3db3[_0x844e('0x64')][_0x844e('0x64')])){throw new APIBadRequestError(_0x844e('0xa0'));}var _0x18ddb5=_0x5a3db3[_0x844e('0x64')][_0x844e('0x37')]&&_0x5a3db3[_0x844e('0x64')][_0x844e('0x3d')];return db[_0x844e('0xa1')][_0x844e('0x72')]()['then'](function(_0x1203c6){if(!_0x1203c6){throw new Error(_0x844e('0xa2'));}_0x3ce7eb=Object[_0x844e('0x50')](_0x1203c6)[_0x844e('0x5c')](function(_0x5692ff){return![_0x844e('0xa3'),_0x844e('0xa4')][_0x844e('0xa5')](_0x5692ff);});_0x149434=Object[_0x844e('0x50')](_0x1203c6)[_0x844e('0x5c')](function(_0x5d9730){return![_0x844e('0xa3'),'updatedAt',_0x844e('0xa6'),_0x844e('0xa7')][_0x844e('0xa5')](_0x5d9730);});if(!_[_0x844e('0xa5')](_0x149434,_0x5a3db3[_0x844e('0x64')][_0x844e('0x9d')])){throw new APIBadRequestError(_0x844e('0xa8')+_0x149434[_0x844e('0x86')](',\x20'));}_0x4f6862[_0x5a3db3[_0x844e('0x64')][_0x844e('0x9d')]]=_0x5a3db3['body'][_0x844e('0x9b')];})['then'](function(){return db['ChatWebsite'][_0x844e('0x63')]({'where':{'id':_0x5a3db3['params']['id']},'include':[{'model':db[_0x844e('0xa9')],'as':'List','include':[{'model':db[_0x844e('0xa1')],'as':'Contacts','where':_0x4f6862,'limit':0x1,'order':[[_0x844e('0xa4'),'DESC']]}]},{'model':db[_0x844e('0xaa')],'as':_0x844e('0xab')},{'model':db['Interval'],'as':_0x844e('0x98'),'include':[{'model':db[_0x844e('0x98')],'as':_0x844e('0xac'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x844e('0x18')](function(_0x30caf3){if(!_0x30caf3){throw new APINotFoundError(util[_0x844e('0x40')](_0x844e('0xad'),_0x5a3db3[_0x844e('0x71')]['id']));}if(_0x18ddb5){return checkWebsiteInterval(_0x30caf3);}return _0x30caf3;})['then'](function(_0x5b4355){_0x2354a4[_0x844e('0xae')]=_0x5b4355;_0x2354a4[_0x844e('0xaf')]=_[_0x844e('0xb0')](_0x5b4355[_0x844e('0xab')],[_0x844e('0xb1')],[_0x844e('0xb2')]);if(_0x2354a4[_0x844e('0xae')][_0x844e('0xab')]){delete _0x2354a4[_0x844e('0xae')][_0x844e('0xab')];}_0x2354a4[_0x844e('0xb3')]=_0x5b4355[_0x844e('0xb4')]||{'id':_0x5b4355[_0x844e('0xa7')]};if(_0x2354a4['list']&&_0x2354a4['list'][_0x844e('0xb5')]['length']){return _0x2354a4[_0x844e('0xb3')]['Contacts'][0x0];}var _0x1d29a2=_['defaults'](_0x5a3db3[_0x844e('0x64')],{'firstName':_0x5a3db3[_0x844e('0x64')][_0x844e('0x9b')],'ListId':_0x5b4355[_0x844e('0xa7')]});_0x1d29a2[_0x5a3db3['body'][_0x844e('0x9d')]]=_0x5a3db3[_0x844e('0x64')][_0x844e('0x9b')];return db[_0x844e('0xa1')][_0x844e('0x67')](_0x1d29a2,{'fields':_0x3ce7eb,'raw':!![]});})[_0x844e('0x18')](function(_0x19a451){_0x2354a4[_0x844e('0xb6')]=_0x19a451;var _0x35bf98=createInteractionObject(_0x5a3db3[_0x844e('0x71')]['id'],_0x5a3db3[_0x844e('0x64')],_0x5a3db3[_0x844e('0xb7')],_0x19a451);var _0x184654={'ChatWebsiteId':_0x5a3db3[_0x844e('0x71')]['id']};if(_0x5a3db3[_0x844e('0x64')]['threadId']){_0x184654[_0x844e('0xb8')]=_0x5a3db3[_0x844e('0x64')][_0x844e('0xb8')];_0x184654[_0x844e('0xb9')]=![];return db[_0x844e('0xba')][_0x844e('0x63')]({'where':_0x184654})[_0x844e('0x18')](function(_0x51fd3a){var _0x11933d=_0x5a3db3[_0x844e('0x64')][_0x844e('0x37')]&&_0x5a3db3['body'][_0x844e('0x3d')];if(_0x51fd3a){_0x5117fd=!![];return _0x51fd3a;}else if(!_0x11933d&&_0x51fd3a&&_0x51fd3a[_0x844e('0xb9')]){throw new APIConflictError(_0x844e('0xbb'));}_0x35bf98[_0x844e('0xb8')]=_0x5a3db3['body'][_0x844e('0xb8')];_0x35bf98[_0x844e('0xbc')]=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbc')];return db['ChatInteraction'][_0x844e('0x67')](_0x35bf98);});}_0x184654['ContactId']=_0x19a451['id'];if(_0x5a3db3[_0x844e('0x64')][_0x844e('0xbd')]&&_0x5a3db3['body'][_0x844e('0xbd')]['id']){_0x184654['id']=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbd')]['id'];return db['ChatInteraction'][_0x844e('0x63')]({'where':_0x184654})[_0x844e('0x18')](function(_0x51b0a8){var _0x11e415=_0x5a3db3[_0x844e('0x64')][_0x844e('0x37')]&&_0x5a3db3[_0x844e('0x64')][_0x844e('0x3d')];if(!_0x11e415&&_0x51b0a8&&_0x51b0a8[_0x844e('0xb9')]){throw new APIConflictError(_0x844e('0xbb'));}else if(_0x51b0a8){_0x5117fd=!![];return _0x51b0a8;}else{return db['ChatInteraction'][_0x844e('0x67')](_0x35bf98);}});}return db[_0x844e('0xba')][_0x844e('0x67')](_0x35bf98);})[_0x844e('0x18')](function(_0x3a04b6){if(!_0x5117fd){return _0x3a04b6;}var _0x18c156={'from':(_0x2354a4['contact'][_0x844e('0xbe')]||'')+'\x20'+(_0x2354a4[_0x844e('0xb6')][_0x844e('0x3b')]||'')};if(_0x5a3db3[_0x844e('0x64')][_0x844e('0xb8')]&&_0x5a3db3[_0x844e('0x64')]['messageId']&&_0x5a3db3['body']['threadId']!=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbf')]){_0x18c156[_0x844e('0xb8')]=_0x5a3db3[_0x844e('0x64')][_0x844e('0xbf')];}return _0x3a04b6[_0x844e('0x2c')](_0x18c156);})[_0x844e('0x18')](function(_0x346f18){_0x2354a4[_0x844e('0xbd')]=_0x346f18[_0x844e('0x69')]({'plain':!![]});_0x2354a4[_0x844e('0xbd')]['created']=!_0x5117fd;if(_0x2354a4['interaction']['created']){if(_0x2354a4[_0x844e('0xae')][_0x844e('0xc0')]){_0x2354a4['applications'][_0x844e('0xc1')]({'id':0x0,'priority':_0x2354a4['applications'][_0x844e('0x62')]+0x1,'app':_0x844e('0xc2'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x844e('0xc3')][_0x844e('0x67')]({'body':_0x5a3db3[_0x844e('0x64')]['body'],'ChatWebsiteId':_0x5a3db3[_0x844e('0x71')]['id'],'ChatInteractionId':_0x346f18['id'],'direction':'in','ContactId':_0x2354a4[_0x844e('0xb6')]['id'],'AttachmentId':_0x5a3db3[_0x844e('0x64')]['AttachmentId']});})[_0x844e('0x18')](function(_0x38eeb7){_0x2354a4['message']=_0x38eeb7;if(!_0x2354a4['interaction'][_0x844e('0xc4')]){return;}return db[_0x844e('0xc5')]['find']({'attributes':['id',_0x844e('0x31')],'where':{'id':_0x2354a4[_0x844e('0xbd')]['UserId']}});})[_0x844e('0x18')](function(_0x4a66f9){if(_0x4a66f9){_0x2354a4['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4a66f9['name']+','+(_0x2354a4['account']['waitForTheAssignedAgent']||0xa),'interval':_0x844e('0xc6')});_0x2354a4[_0x844e('0xc7')]=!![];}if(!_0x2354a4[_0x844e('0xbd')][_0x844e('0xc8')]){return;}return db[_0x844e('0xc9')][_0x844e('0x63')]({'attributes':['id',_0x844e('0x31')],'where':{'id':_0x2354a4[_0x844e('0xbd')][_0x844e('0xc8')]}});})[_0x844e('0x18')](function(_0x1d7463){if(_0x1d7463){_0x2354a4['applications'][_0x844e('0xca')]({'id':0x0,'priority':0x1,'app':_0x844e('0xcb'),'appdata':_0x1d7463[_0x844e('0x31')]+','+(_0x2354a4['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x844e('0xc6')});}return respondWithRpcPromise(_0x844e('0xcc'),_0x844e('0xcd'),_0x2354a4);})['then'](function(_0x539f14){respondWithRpcPromise(_0x844e('0xce'),_0x844e('0xce'),{'event':_0x844e('0xcf'),'message':_0x539f14},client9002);return _0x539f14;})[_0x844e('0x18')](respondWithResult(_0x4f00cb,null))[_0x844e('0x22')](APIHandleError(_0x4f00cb));};exports['offline']=function(_0x1775e8,_0x419a89){var _0x9bfa01,_0x134a28,_0x8a753b;var _0x40f5e4=[];var _0x39edd0={};var _0xee01a6=_0x1775e8['files']||[];var _0x374113=[];var _0x1dc407;return db[_0x844e('0xa1')][_0x844e('0x72')]()['then'](function(_0x680da6){if(!_0x680da6){throw new db[(_0x844e('0xd0'))]['ValidationError']('no\x20available\x20attributes');}_0x40f5e4=_[_0x844e('0xd1')](_[_0x844e('0x50')](_0x680da6),[_0x844e('0xa3'),_0x844e('0xa4'),_0x844e('0xa6'),_0x844e('0xa7')]);if(_0x1775e8[_0x844e('0x64')]['id']){delete _0x1775e8['body']['id'];}if(_[_0x844e('0x8b')](_0x1775e8[_0x844e('0x64')][_0x844e('0x9b')])){throw _0x419a89[_0x844e('0x24')](0x1f4)[_0x844e('0x32')](new db[(_0x844e('0xd0'))][(_0x844e('0xd2'))](_0x844e('0xd3')));}if(_[_0x844e('0x8b')](_0x1775e8['body'][_0x844e('0x64')])||_0x1775e8[_0x844e('0x64')][_0x844e('0x64')]===''){throw _0x419a89[_0x844e('0x24')](0x1f4)[_0x844e('0x32')](new db[(_0x844e('0xd0'))][(_0x844e('0xd2'))](_0x844e('0xd4')));}if(_[_0x844e('0x8b')](_0x1775e8['body']['mapKeyOffline'])){throw _0x419a89['status'](0x1f4)[_0x844e('0x32')](new db[(_0x844e('0xd0'))][(_0x844e('0xd2'))](_0x844e('0xd5')+_0x40f5e4));}if(!_['includes'](_0x40f5e4,_0x1775e8[_0x844e('0x64')][_0x844e('0xd6')])){throw _0x419a89[_0x844e('0x24')](0x1f4)[_0x844e('0x32')](new db['Sequelize'][(_0x844e('0xd2'))](_0x844e('0xd7')+_0x40f5e4));}_0x39edd0[_0x1775e8[_0x844e('0x64')][_0x844e('0xd6')]]=_0x1775e8[_0x844e('0x64')][_0x844e('0x9b')];})[_0x844e('0x18')](function(){return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x1775e8['params']['id']},'include':[{'model':db[_0x844e('0xa9')],'as':_0x844e('0xb4')},{'model':db[_0x844e('0xd8')],'as':_0x844e('0xd8')}]});})[_0x844e('0x18')](handleEntityNotFound(_0x419a89,null))[_0x844e('0x18')](function(_0x5a65b2){if(_0x5a65b2&&_0x5a65b2[_0x844e('0xb4')]){_0x134a28=_0x5a65b2;var _0x19c6fd=_[_0x844e('0x13')](_0x1775e8[_0x844e('0x64')],{'firstName':_0x1775e8[_0x844e('0x64')]['from'],'phone':_0x1775e8[_0x844e('0x64')][_0x844e('0x9b')],'ListId':_0x5a65b2[_0x844e('0xa7')]});_0x19c6fd[_0x1775e8[_0x844e('0x64')][_0x844e('0xd6')]]=_0x1775e8[_0x844e('0x64')]['from'];return db['CmContact']['findOrCreate']({'where':_0x39edd0,'defaults':_0x19c6fd});}})[_0x844e('0xd9')](function(_0x2e7e15){if(_0x2e7e15){_0x8a753b=_0x2e7e15;var _0x54fc71=fs[_0x844e('0xda')](path[_0x844e('0x86')](config[_0x844e('0x87')],'server/files/templates/chatOfflineMessage.ejs'),_0x844e('0xdb'));var _0x5f2970=ejs[_0x844e('0xdc')](_0x54fc71,{'body':_[_0x844e('0xdd')](_0x1775e8[_0x844e('0x64')]['body']),'bodyTitle':_0x134a28[_0x844e('0xde')]});return db[_0x844e('0xdf')]['create']({'body':_0x5f2970,'plainBody':htmlToText[_0x844e('0xe0')](_0x5f2970),'ContactId':_0x2e7e15['id'],'ChatWebsiteId':_0x134a28['id']});}})[_0x844e('0x18')](function(_0x582cf0){_0x1dc407=_0x582cf0;if(_0xee01a6[_0x844e('0x62')]){var _0x24c326=_0xee01a6['map'](function(_0x23b6ef){return{'name':_0x23b6ef[_0x844e('0xe1')],'basename':_0x23b6ef[_0x844e('0x83')],'type':_0x23b6ef[_0x844e('0xe2')],'ChatOfflineMessageId':_0x582cf0['id']};});_0x374113=_0x24c326[_0x844e('0x4b')](_0x1b9da7=>{var _0x283ec2={'filename':_0x1b9da7[_0x844e('0x31')],'path':path[_0x844e('0x86')](config[_0x844e('0x87')],_0x844e('0xe3'),_0x844e('0xe4'),_0x844e('0xe5'),_0x844e('0xe6'),_0x1b9da7['basename'])};return _0x283ec2;});if(!_0x134a28[_0x844e('0xe7')]){return db[_0x844e('0xe8')]['transaction'](function(_0x21b2e0){return db[_0x844e('0xe9')][_0x844e('0xea')](_0x24c326,{'transaction':_0x21b2e0});});}}})[_0x844e('0x18')](function(){if(_0x1dc407){_0x9bfa01=_0x1dc407;return db[_0x844e('0xd8')][_0x844e('0x75')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x844e('0xeb'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x844e('0xec'),'raw':!![]}]}]});}})[_0x844e('0x18')](function(_0x252760){if(_0x252760&&_0x252760[_0x844e('0xeb')]&&_0x134a28[_0x844e('0xed')]&&_0x134a28[_0x844e('0xee')]){var _0x28cdae=_0x252760['getSmtpOptions']();return respondWithRpcPromise(_0x844e('0xef'),'sendMail',{'account':_0x28cdae,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x252760[_0x844e('0x31')],_0x252760[_0x844e('0xf0')]||_0x252760[_0x844e('0xeb')]['user']),'to':_0x134a28[_0x844e('0xee')],'subject':_0x134a28[_0x844e('0xf1')],'html':_0x9bfa01[_0x844e('0x64')],'attachments':_0x374113}},client9003)[_0x844e('0x18')](function(){return _0x9bfa01;})[_0x844e('0x22')](function(_0x641902){logger[_0x844e('0x1d')](_0x641902);});}})['then'](function(){if(_0x134a28&&_0x134a28['openNewInteraction']&&_0x134a28[_0x844e('0xf2')]){var _0x5262d4=[];if(_0xee01a6[_0x844e('0x62')]){_0x5262d4=_0xee01a6[_0x844e('0x4b')](function(_0x4245e2){return{'name':_0x4245e2[_0x844e('0xe1')],'basename':_0x4245e2['filename'],'type':_0x4245e2[_0x844e('0xe2')],'ChatOfflineMessageId':_0x1dc407['id']};});}var _0x2204a1;if(!_[_0x844e('0x8b')](_0x134a28[_0x844e('0xf3')])){var _0x2b9a03=_[_0x844e('0x4b')](_0x1775e8['body'],function(_0x58d81c){return _0x58d81c;});var _0x21870b=_['toPairsIn'](_0x2b9a03)[0x0];var _0x112955=_['mapValues'](_0x21870b,function(_0x34873b){return _0x34873b;});_0x2204a1=_0x112955[0x1][_0x134a28[_0x844e('0xf3')]];}var _0x51cd1a={'from':_0x8a753b[_0x844e('0xf0')],'firstName':_0x8a753b[_0x844e('0xbe')],'lastName':_0x8a753b[_0x844e('0x3b')],'mapKey':_0x844e('0xf0'),'message':{'from':_0x8a753b[_0x844e('0xf0')],'to':_0x134a28[_0x844e('0xd8')]['email'],'cc':'','subject':_['isNil'](_0x2204a1)?_0x134a28['offlineMessageSubject']:_0x2204a1,'messageId':'','sentAt':new Date(),'attach':_0x5262d4['length'],'attachments':_0x5262d4,'originChannel':_0x844e('0xf4'),'ChatWebsiteId':_0x134a28['id'],'ChatOfflineMessageId':_0x9bfa01['id'],'originTo':_0x134a28[_0x844e('0xd8')][_0x844e('0xf0')]},'body':_0x9bfa01['body']};var _0x3606d4={'account':{'id':_0x134a28[_0x844e('0xf2')]},'body':_0x51cd1a,'log':_0x844e('0xf5')};return respondWithRpcPromise(_0x844e('0xf5'),'notifyMail',_0x3606d4,client9001)[_0x844e('0x18')](function(){return _0x9bfa01;})[_0x844e('0x22')](function(_0x5383ac){logger[_0x844e('0x1d')](_0x5383ac);});}return;})[_0x844e('0x18')](function(){if(_0x9bfa01){return _0x9bfa01;}})[_0x844e('0x18')](respondWithResult(_0x419a89,null))['catch'](function(){for(var _0x476be2 of _0xee01a6){var _0x14f9f5=path[_0x844e('0x86')](config['root'],_0x844e('0xe3'),'files',_0x844e('0xe5'),_0x844e('0xe6'),_0x476be2[_0x844e('0x83')]);fs_extra[_0x844e('0xf6')](_0x14f9f5)[_0x844e('0x22')](function(_0x31e571){logger[_0x844e('0x1d')](_0x844e('0xf7'),_0x14f9f5,_0x31e571);});}});};exports[_0x844e('0xf8')]=function(_0xf21b7c,_0x22c85e){return db[_0x844e('0xba')]['find']({'where':{'id':_0xf21b7c[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x22c85e,null))['then'](function(_0x1ff9b5){if(_0x1ff9b5){return _0x1ff9b5[_0x844e('0xf8')](_0xf21b7c[_0x844e('0x64')][_0x844e('0x7a')],_[_0x844e('0xf9')](_0xf21b7c[_0x844e('0x64')],[_0x844e('0x7a'),'id'])||{});}})[_0x844e('0x18')](respondWithResult(_0x22c85e,null))['catch'](handleError(_0x22c85e,null));};exports[_0x844e('0xfa')]=function(_0x55b540,_0x44157e){var _0x11cb2f={'raw':![],'where':{}};var _0x17518a={};var _0xe328bd={'count':0x0,'rows':[]};return db[_0x844e('0x4c')]['findOne']({'where':{'id':_0x55b540[_0x844e('0x71')]['id']}})['then'](handleEntityNotFound(_0x44157e,null))[_0x844e('0x18')](function(_0x1d51e1){if(_0x1d51e1){_0x17518a[_0x844e('0x43')]=_['keys'](db[_0x844e('0xba')][_0x844e('0x61')]);_0x17518a[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x55b540[_0x844e('0x4f')]);_0x17518a['filters']=_['intersection'](_0x17518a[_0x844e('0x43')],_0x17518a[_0x844e('0x4f')]);_0x11cb2f[_0x844e('0x53')]=_[_0x844e('0x51')](_0x17518a[_0x844e('0x43')],qs[_0x844e('0x52')](_0x55b540[_0x844e('0x4f')][_0x844e('0x52')]));_0x11cb2f[_0x844e('0x53')]=_0x11cb2f['attributes'][_0x844e('0x62')]?_0x11cb2f['attributes']:_0x17518a[_0x844e('0x43')];if(!_0x55b540[_0x844e('0x4f')]['hasOwnProperty'](_0x844e('0x55'))){_0x11cb2f[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x55b540[_0x844e('0x4f')][_0x844e('0x27')]);_0x11cb2f['offset']=qs[_0x844e('0x26')](_0x55b540['query'][_0x844e('0x26')]);}_0x11cb2f[_0x844e('0x77')]=qs['sort'](_0x55b540['query'][_0x844e('0x56')]);_0x11cb2f[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x55b540['query'],_0x17518a[_0x844e('0x58')]));_0x11cb2f[_0x844e('0x57')][_0x844e('0x73')]=_0x1d51e1['id'];if(_0x55b540[_0x844e('0x4f')][_0x844e('0x5c')]){_0x11cb2f['where']=_[_0x844e('0x5a')](_0x11cb2f[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x11cb2f['attributes'],function(_0x2ea280){var _0x5f225d={};_0x5f225d[_0x2ea280]={'$like':'%'+_0x55b540[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x5f225d;})});}_0x11cb2f=_[_0x844e('0x5a')]({},_0x11cb2f,_0x55b540[_0x844e('0x5d')]);return db['ChatInteraction'][_0x844e('0x29')]({'where':_0x11cb2f[_0x844e('0x57')]})[_0x844e('0x18')](function(_0x19edb8){_0xe328bd[_0x844e('0x29')]=_0x19edb8;if(_0x55b540[_0x844e('0x4f')]['includeAll']){_0x11cb2f[_0x844e('0x5f')]=[{'model':db['CmContact'],'as':_0x844e('0xfb'),'required':![]},{'model':db['User'],'as':_0x844e('0xfc'),'attributes':[_0x844e('0x31'),_0x844e('0xfd'),_0x844e('0xfe')],'required':![]},{'model':db[_0x844e('0xff')],'as':_0x844e('0x100'),'attributes':['id',_0x844e('0x31'),'color'],'where':_0x55b540[_0x844e('0x4f')]['tag']?{'id':_0x55b540[_0x844e('0x4f')]['tag']}:undefined,'required':_0x55b540[_0x844e('0x4f')][_0x844e('0x101')]?!![]:![]}];}return db[_0x844e('0xba')][_0x844e('0x78')](_0x11cb2f);})[_0x844e('0x18')](function(_0x4ccac6){_0xe328bd['rows']=_0x4ccac6;return _0xe328bd;});}})[_0x844e('0x18')](respondWithFilteredResult(_0x44157e,_0x11cb2f))['catch'](handleError(_0x44157e,null));};exports[_0x844e('0x102')]=function(_0x48d973,_0x1d6abb){var _0x454b5d=0x0;var _0x358b3e=0x0;var _0x53be53=![];var _0x2e48e3;var _0x4ec13f;return db[_0x844e('0x4c')][_0x844e('0x63')]({'where':{'id':_0x48d973[_0x844e('0x71')]['id']},'include':[{'model':db[_0x844e('0x98')],'as':_0x844e('0x98'),'include':[{'model':db[_0x844e('0x98')],'as':_0x844e('0xac'),'attributes':['id',_0x844e('0x103')]}]}]})[_0x844e('0x18')](handleEntityNotFound(_0x1d6abb,null))[_0x844e('0x18')](function(_0x418bd1){if(_0x418bd1){_0x2e48e3=_0x418bd1;return _0x418bd1['getProactiveActions']({'raw':!![]});}})[_0x844e('0x18')](function(_0x5132d8){if(_0x2e48e3){if(_0x5132d8){_0x4ec13f=_0x5132d8;}}return require(_0x844e('0x88'))['getLicense']();})[_0x844e('0x18')](function(_0x6fb171){if(_0x6fb171){_0x358b3e=_0x6fb171[_0x844e('0x104')];_0x53be53=_0x6fb171[_0x844e('0x8a')];}})[_0x844e('0x18')](function(){return db[_0x844e('0xba')][_0x844e('0x29')]({'where':{'closed':![]}});})['then'](function(_0x1f545e){_0x454b5d=_0x1f545e;if(_0x358b3e&&_0x1f545e>_0x358b3e){return db[_0x844e('0x105')][_0x844e('0x75')]({'where':{'id':0x1}})[_0x844e('0x18')](function(_0x1b75b8){if(_0x1b75b8){_0x1b75b8[_0x844e('0x106')](_0x844e('0x107'));}});}})[_0x844e('0x18')](function(){var _0x5222da=_0x2e48e3[_0x844e('0x98')];var _0x64f058=_0x2e48e3['timezone']||undefined;return _0x5222da?_0x5222da[_0x844e('0x9a')](_0x64f058):!![];})[_0x844e('0x18')](function(_0x3c8f88){var _0x103475=fs[_0x844e('0xda')](path['join'](config[_0x844e('0x87')],_0x844e('0x108')),_0x844e('0xdb'));var _0x1597ba=_0x844e('0x109');var _0x3a8782=![];var _0xb0d533,_0x5cb72d;if(_0x48d973[_0x844e('0xb7')][_0x844e('0x3d')]){_0xb0d533=new URL(_0x48d973['headers']['referer'])[_0x844e('0x10a')];}else if(_0x48d973['headers'][_0x844e('0x10a')]){_0xb0d533=new URL(_0x48d973['headers'][_0x844e('0x10a')])[_0x844e('0x10a')];}else{_0xb0d533='http://localhost:9000';}_0x5cb72d=typeof _0x2e48e3['address']['split'](',')[_0x844e('0x63')](function(_0x1df711){return wildcardUtils[_0x844e('0x10b')](_0x1df711,_0xb0d533);})!==_0x844e('0x28');var _0x1ea83d={'chatVersion':_0x1597ba,'chatWebsiteAddressOrigin':_0x5cb72d?_0xb0d533:_0x2e48e3[_0x844e('0x10c')],'remote':_0x2e48e3[_0x844e('0x10d')],'query':querystring[_0x844e('0x1c')](_[_0x844e('0x5a')](_0x2e48e3[_0x844e('0x69')]({'plain':!![]}),{'customerIp':_0x48d973['headers'][_0x844e('0x10e')]||_0x48d973[_0x844e('0xb7')][_0x844e('0x10f')]||_0x48d973[_0x844e('0x110')][_0x844e('0x111')]||_0x48d973['ip'],'referer':_0x48d973['headers'][_0x844e('0x3d')],'openedInteractions':_0x454b5d,'maxInteractions':_0x358b3e,'virtual':_0x53be53[_0x844e('0x104')],'online':_0x3c8f88,'custom':_0x53be53,'address':_0x5cb72d?_0xb0d533:null}))[_0x844e('0x112')](/'/g,'\x5c\x27')};_0x1d6abb[_0x844e('0x32')](ejs[_0x844e('0xdc')](Mustache[_0x844e('0xdc')](_0x103475,_0x1ea83d),{'proactiveActions':_0x4ec13f,'alignment':_0x2e48e3[_0x844e('0x113')],'verticalAlignment':_0x2e48e3[_0x844e('0x114')],'div_color':_0x2e48e3[_0x844e('0x115')],'labelText':_0x2e48e3['labelText'],'text_color':_0x2e48e3[_0x844e('0x116')],'text_button_color':_0x2e48e3[_0x844e('0x117')],'button_color':_0x2e48e3[_0x844e('0x118')],'background_color':_0x2e48e3[_0x844e('0x119')],'hideWhenOffline':_0x2e48e3[_0x844e('0x11a')],'intervalId':_0x2e48e3['IntervalId'],'isDevelopment':_0x3a8782,'chatVersion':_0x1597ba}));})['catch'](handleError(_0x1d6abb,null));};exports[_0x844e('0x11b')]=function(_0x430aa0,_0x322107){var _0x4c81e3=_0x430aa0[_0x844e('0x71')]['id'];var _0x3764ff=_0x430aa0['body'];var _0x1aeb99=0xc8;var _0x125934=null;return db[_0x844e('0xe8')][_0x844e('0x11c')]({'isolationLevel':db[_0x844e('0xe8')][_0x844e('0x11d')][_0x844e('0x11e')][_0x844e('0x11f')]},function(_0x399cbe){return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x4c81e3},'transaction':_0x399cbe})[_0x844e('0x18')](function(_0x379e7f){if(_0x379e7f){return db[_0x844e('0xaa')][_0x844e('0x2e')]({'where':{'ChatWebsiteId':_0x4c81e3},'transaction':_0x399cbe})['then'](function(){var _0x2bd40c=_[_0x844e('0x4b')](_0x3764ff,function(_0x3bb23a){_0x3bb23a[_0x844e('0x73')]=_0x4c81e3;return _0x3bb23a;});return db[_0x844e('0xaa')][_0x844e('0xea')](_0x2bd40c,{'transaction':_0x399cbe});});}else{_0x1aeb99=0x194;_0x125934=[];}});})[_0x844e('0x18')](function(){if(_0x1aeb99!==0x194){return db[_0x844e('0xaa')][_0x844e('0x120')]({'where':{'ChatWebsiteId':_0x4c81e3},'order':_0x844e('0xb1')})['then'](function(_0x43d971){_0x125934=_0x43d971;});}})[_0x844e('0x22')](function(_0x49f92a){_0x1aeb99=0x1f4;logger['error'](_0x49f92a[_0x844e('0x30')]);if(_0x49f92a[_0x844e('0x31')]){delete _0x49f92a['name'];}_0x125934=_0x49f92a;})[_0x844e('0x121')](function(){if(_0x125934===null){_0x322107[_0x844e('0x23')](_0x1aeb99);}else{if(_0x1aeb99===0x1f4){_0x322107[_0x844e('0x24')](_0x1aeb99)[_0x844e('0x32')](_0x125934);}else{_0x322107['status'](_0x1aeb99)[_0x844e('0x25')](_0x125934);}}});};exports[_0x844e('0x122')]=function(_0x365207,_0x5e5288){var _0xeae328={};var _0x1cda40={};var _0x3f5d8a;var _0x3d674e;return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x365207[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x5e5288,null))['then'](function(_0x5744ae){if(_0x5744ae){_0x3f5d8a=_0x5744ae;_0x1cda40[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0xaa')][_0x844e('0x61')]);_0x1cda40['query']=_[_0x844e('0x50')](_0x365207[_0x844e('0x4f')]);_0x1cda40[_0x844e('0x58')]=_[_0x844e('0x51')](_0x1cda40['model'],_0x1cda40[_0x844e('0x4f')]);_0xeae328[_0x844e('0x53')]=_['intersection'](_0x1cda40[_0x844e('0x43')],qs['fields'](_0x365207['query']['fields']));_0xeae328[_0x844e('0x53')]=_0xeae328['attributes'][_0x844e('0x62')]?_0xeae328[_0x844e('0x53')]:_0x1cda40[_0x844e('0x43')];_0xeae328[_0x844e('0x77')]=qs['sort'](_0x365207['query'][_0x844e('0x56')]);_0xeae328[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x365207[_0x844e('0x4f')],_0x1cda40['filters']));if(_0x365207[_0x844e('0x4f')][_0x844e('0x5c')]){_0xeae328[_0x844e('0x57')]=_[_0x844e('0x5a')](_0xeae328[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0xeae328[_0x844e('0x53')],function(_0x5d9434){var _0x424401={};_0x424401[_0x5d9434]={'$like':'%'+_0x365207[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x424401;})});}_0xeae328=_[_0x844e('0x5a')]({},_0xeae328,_0x365207[_0x844e('0x5d')]);return _0x3f5d8a[_0x844e('0x122')](_0xeae328);}})[_0x844e('0x18')](function(_0x3e4e2d){if(_0x3e4e2d){_0x3d674e=_0x3e4e2d[_0x844e('0x62')];if(!_0x365207['query'][_0x844e('0x54')]('nolimit')){_0xeae328['limit']=qs[_0x844e('0x27')](_0x365207[_0x844e('0x4f')][_0x844e('0x27')]);_0xeae328[_0x844e('0x26')]=qs['offset'](_0x365207[_0x844e('0x4f')][_0x844e('0x26')]);}return _0x3f5d8a[_0x844e('0x122')](_0xeae328);}})['then'](function(_0x4f8c2f){if(_0x4f8c2f){return _0x4f8c2f?{'count':_0x3d674e,'rows':_0x4f8c2f}:null;}})['then'](respondWithResult(_0x5e5288,null))[_0x844e('0x22')](handleError(_0x5e5288,null));};exports[_0x844e('0x123')]=function(_0x276b5f,_0x150283){return db[_0x844e('0x124')]['find']({'where':{'id':_0x276b5f[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x150283,null))[_0x844e('0x18')](function(_0x215591){if(_0x215591){return _0x215591[_0x844e('0x123')](_0x276b5f[_0x844e('0x64')][_0x844e('0x7a')],_[_0x844e('0xf9')](_0x276b5f['body'],[_0x844e('0x7a'),'id'])||{});}})[_0x844e('0x18')](respondWithResult(_0x150283,null))[_0x844e('0x22')](handleError(_0x150283,null));};exports[_0x844e('0x125')]=function(_0x170007,_0x37ab57){var _0x4ab1c2={};var _0x395f9a={};var _0x1a8bc8;var _0x44a70d;return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x170007[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x37ab57,null))['then'](function(_0x34f187){if(_0x34f187){_0x1a8bc8=_0x34f187;_0x395f9a[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0x126')][_0x844e('0x61')]);_0x395f9a[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x170007[_0x844e('0x4f')]);_0x395f9a[_0x844e('0x58')]=_[_0x844e('0x51')](_0x395f9a[_0x844e('0x43')],_0x395f9a[_0x844e('0x4f')]);_0x4ab1c2[_0x844e('0x53')]=_[_0x844e('0x51')](_0x395f9a[_0x844e('0x43')],qs['fields'](_0x170007[_0x844e('0x4f')][_0x844e('0x52')]));_0x4ab1c2[_0x844e('0x53')]=_0x4ab1c2[_0x844e('0x53')][_0x844e('0x62')]?_0x4ab1c2['attributes']:_0x395f9a['model'];_0x4ab1c2[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x170007[_0x844e('0x4f')]['sort']);_0x4ab1c2[_0x844e('0x57')]=qs[_0x844e('0x58')](_['pick'](_0x170007[_0x844e('0x4f')],_0x395f9a[_0x844e('0x58')]));if(_0x170007[_0x844e('0x4f')][_0x844e('0x5c')]){_0x4ab1c2[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x4ab1c2[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x4ab1c2[_0x844e('0x53')],function(_0x404095){var _0x145b21={};_0x145b21[_0x404095]={'$like':'%'+_0x170007['query']['filter']+'%'};return _0x145b21;})});}_0x4ab1c2=_[_0x844e('0x5a')]({},_0x4ab1c2,_0x170007[_0x844e('0x5d')]);return _0x1a8bc8['getProactiveActions'](_0x4ab1c2);}})[_0x844e('0x18')](function(_0x417f5f){if(_0x417f5f){_0x44a70d=_0x417f5f[_0x844e('0x62')];if(!_0x170007['query'][_0x844e('0x54')]('nolimit')){_0x4ab1c2[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x170007[_0x844e('0x4f')][_0x844e('0x27')]);_0x4ab1c2['offset']=qs[_0x844e('0x26')](_0x170007['query']['offset']);}return _0x1a8bc8[_0x844e('0x125')](_0x4ab1c2);}})[_0x844e('0x18')](function(_0x1d02fb){if(_0x1d02fb){return _0x1d02fb?{'count':_0x44a70d,'rows':_0x1d02fb}:null;}})[_0x844e('0x18')](respondWithResult(_0x37ab57,null))['catch'](handleError(_0x37ab57,null));};exports[_0x844e('0x127')]=function(_0x1bf2bb,_0x508207){var _0x426bb8=_0x1bf2bb[_0x844e('0x4f')]['online']==='false'?_0x844e('0x128'):_0x844e('0x129');return db[_0x844e('0x4c')][_0x844e('0x63')]({'attributes':['id',_0x426bb8],'where':{'id':_0x1bf2bb[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x508207,null))[_0x844e('0x18')](function(_0x582c0d){if(_0x582c0d){var _0x44a22b=_0x582c0d[_0x426bb8];var _0x55eec1=_0x44a22b&&_0x44a22b[_0x844e('0x12a')]?_0x44a22b['items']:[];_0x508207[_0x844e('0x32')]({'fromKey':_['isNil'](_0x44a22b[_0x844e('0x12b')])?undefined:_0x44a22b[_0x844e('0x12b')],'count':_0x55eec1['length'],'rows':_0x55eec1});}})[_0x844e('0x22')](handleError(_0x508207,null));};exports[_0x844e('0x12c')]=function(_0x737f9f,_0x2a5a1b){var _0x3d0557={'raw':![],'where':{}};var _0x2d4040={};var _0x165544={'count':0x0,'rows':[]};return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x737f9f[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x2a5a1b,null))[_0x844e('0x18')](function(_0xe324e0){if(_0xe324e0){_0x2d4040[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0xdf')][_0x844e('0x61')]);_0x2d4040['query']=_[_0x844e('0x50')](_0x737f9f[_0x844e('0x4f')]);_0x2d4040['filters']=_[_0x844e('0x51')](_0x2d4040[_0x844e('0x43')],_0x2d4040['query']);_0x3d0557['attributes']=_[_0x844e('0x51')](_0x2d4040[_0x844e('0x43')],qs[_0x844e('0x52')](_0x737f9f[_0x844e('0x4f')][_0x844e('0x52')]));_0x3d0557['attributes']=_0x3d0557[_0x844e('0x53')][_0x844e('0x62')]?_0x3d0557['attributes']:_0x2d4040[_0x844e('0x43')];if(!_0x737f9f[_0x844e('0x4f')][_0x844e('0x54')]('nolimit')){_0x3d0557[_0x844e('0x27')]=qs[_0x844e('0x27')](_0x737f9f[_0x844e('0x4f')][_0x844e('0x27')]);_0x3d0557[_0x844e('0x26')]=qs['offset'](_0x737f9f[_0x844e('0x4f')]['offset']);}_0x3d0557[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x737f9f[_0x844e('0x4f')][_0x844e('0x56')]);_0x3d0557['where']=qs['filters'](_[_0x844e('0x59')](_0x737f9f['query'],_0x2d4040[_0x844e('0x58')]));_0x3d0557[_0x844e('0x57')][_0x844e('0x73')]=_0xe324e0['id'];if(_0x737f9f[_0x844e('0x4f')][_0x844e('0x5c')]){_0x3d0557[_0x844e('0x57')]=_['merge'](_0x3d0557[_0x844e('0x57')],{'$or':_[_0x844e('0x4b')](_0x3d0557[_0x844e('0x53')],function(_0x1d6167){var _0x376b4c={};_0x376b4c[_0x1d6167]={'$like':'%'+_0x737f9f['query'][_0x844e('0x5c')]+'%'};return _0x376b4c;})});}_0x3d0557=_[_0x844e('0x5a')]({},_0x3d0557,_0x737f9f[_0x844e('0x5d')]);return db[_0x844e('0xdf')]['count']({'where':_0x3d0557['where']})[_0x844e('0x18')](function(_0x3a47af){_0x165544[_0x844e('0x29')]=_0x3a47af;if(_0x737f9f['query']['includeAll']){_0x3d0557[_0x844e('0x5f')]=[{'all':!![]}];}else{_0x3d0557[_0x844e('0x5f')]=[{'model':db[_0x844e('0xa1')],'as':_0x844e('0xfb'),'required':![]},{'model':db[_0x844e('0xe9')],'as':_0x844e('0x12d'),'required':![]}];}return db[_0x844e('0xdf')]['findAll'](_0x3d0557);})[_0x844e('0x18')](function(_0x5cc157){_0x165544[_0x844e('0x60')]=_0x5cc157;return _0x165544;});}})[_0x844e('0x18')](respondWithFilteredResult(_0x2a5a1b,_0x3d0557))[_0x844e('0x22')](handleError(_0x2a5a1b,null));};exports[_0x844e('0x12e')]=function(_0x44ac12,_0x13b300){return db[_0x844e('0x4c')]['find']({'where':{'id':_0x44ac12[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x13b300,null))['then'](function(_0x2aed50){if(_0x2aed50){return _0x2aed50[_0x844e('0x12e')](_0x44ac12[_0x844e('0x64')][_0x844e('0x7a')],_[_0x844e('0xf9')](_0x44ac12[_0x844e('0x64')],[_0x844e('0x7a'),'id'])||{})[_0x844e('0xd9')](function(_0x381fb2){for(var _0x4ef040=0x0;_0x4ef040<_0x44ac12[_0x844e('0x64')][_0x844e('0x7a')]['length'];_0x4ef040+=0x1){socket['emit'](_0x844e('0x12f'),{'UserId':Number(_0x44ac12[_0x844e('0x64')]['ids'][_0x4ef040]),'ChatWebsiteId':Number(_0x44ac12['params']['id'])});}return _0x381fb2;});}})[_0x844e('0x18')](respondWithResult(_0x13b300,null))[_0x844e('0x22')](handleError(_0x13b300,null));};exports['removeAgents']=function(_0x1c01c9,_0xe72f44){return db['ChatWebsite']['find']({'where':{'id':_0x1c01c9['params']['id']}})['then'](handleEntityNotFound(_0xe72f44,null))['then'](function(_0x1f6512){if(_0x1f6512){return _0x1f6512[_0x844e('0x130')](_0x1c01c9[_0x844e('0x4f')]['ids'])[_0x844e('0x18')](function(){if(_[_0x844e('0x131')](_0x1c01c9[_0x844e('0x4f')]['ids'])){for(var _0x479b82=0x0;_0x479b82<_0x1c01c9[_0x844e('0x4f')][_0x844e('0x7a')][_0x844e('0x62')];_0x479b82+=0x1){socket[_0x844e('0x132')](_0x844e('0x133'),{'UserId':Number(_0x1c01c9[_0x844e('0x4f')][_0x844e('0x7a')][_0x479b82]),'ChatWebsiteId':Number(_0x1c01c9['params']['id'])});}}else{socket[_0x844e('0x132')](_0x844e('0x133'),{'UserId':Number(_0x1c01c9[_0x844e('0x4f')][_0x844e('0x7a')]),'ChatWebsiteId':Number(_0x1c01c9['params']['id'])});}});}})[_0x844e('0x18')](respondWithStatusCode(_0xe72f44,null))[_0x844e('0x22')](handleError(_0xe72f44,null));};exports[_0x844e('0x134')]=function(_0x1a60b0,_0x155a7a){var _0x3e2b88={};var _0x1415e6={};var _0x92f231;var _0x3601c0;return db[_0x844e('0x4c')][_0x844e('0x75')]({'where':{'id':_0x1a60b0[_0x844e('0x71')]['id']}})[_0x844e('0x18')](handleEntityNotFound(_0x155a7a,null))['then'](function(_0x486ed0){if(_0x486ed0){_0x92f231=_0x486ed0;_0x1415e6[_0x844e('0x43')]=_[_0x844e('0x50')](db[_0x844e('0xc5')][_0x844e('0x61')]);_0x1415e6[_0x844e('0x4f')]=_[_0x844e('0x50')](_0x1a60b0[_0x844e('0x4f')]);_0x1415e6['filters']=_[_0x844e('0x51')](_0x1415e6['model'],_0x1415e6[_0x844e('0x4f')]);_0x3e2b88['attributes']=_[_0x844e('0x51')](_0x1415e6[_0x844e('0x43')],qs[_0x844e('0x52')](_0x1a60b0['query'][_0x844e('0x52')]));_0x3e2b88['attributes']=_0x3e2b88['attributes'][_0x844e('0x62')]?_0x3e2b88['attributes']:_0x1415e6[_0x844e('0x43')];_0x3e2b88[_0x844e('0x77')]=qs[_0x844e('0x56')](_0x1a60b0[_0x844e('0x4f')][_0x844e('0x56')]);_0x3e2b88[_0x844e('0x57')]=qs[_0x844e('0x58')](_[_0x844e('0x59')](_0x1a60b0[_0x844e('0x4f')],_0x1415e6[_0x844e('0x58')]));if(_0x1a60b0['query'][_0x844e('0x5c')]){_0x3e2b88[_0x844e('0x57')]=_[_0x844e('0x5a')](_0x3e2b88[_0x844e('0x57')],{'$or':_['map'](_0x3e2b88['attributes'],function(_0x4b406a){var _0x5c2675={};_0x5c2675[_0x4b406a]={'$like':'%'+_0x1a60b0[_0x844e('0x4f')][_0x844e('0x5c')]+'%'};return _0x5c2675;})});}_0x3e2b88=_[_0x844e('0x5a')]({},_0x3e2b88,_0x1a60b0[_0x844e('0x5d')]);return _0x92f231[_0x844e('0x134')](_0x3e2b88);}})['then'](function(_0x133d31){if(_0x133d31){_0x3601c0=_0x133d31[_0x844e('0x62')];if(!_0x1a60b0['query'][_0x844e('0x54')](_0x844e('0x55'))){_0x3e2b88['limit']=qs[_0x844e('0x27')](_0x1a60b0[_0x844e('0x4f')][_0x844e('0x27')]);_0x3e2b88['offset']=qs[_0x844e('0x26')](_0x1a60b0[_0x844e('0x4f')][_0x844e('0x26')]);}return _0x92f231[_0x844e('0x134')](_0x3e2b88);}})[_0x844e('0x18')](function(_0x23fec3){if(_0x23fec3){return _0x23fec3?{'count':_0x3601c0,'rows':_0x23fec3}:null;}})[_0x844e('0x18')](respondWithResult(_0x155a7a,null))[_0x844e('0x22')](handleError(_0x155a7a,null));};
\ No newline at end of file
+var _0xa8a8=['device','model','vendor','%s\x20%s\x20%s','type','stringify','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','length','find','create','body','address','forEach','trim','testWildcardValidity','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','describe','addDisposition','ChatWebsiteId','Disposition','order','sort','include','removeDispositions','ids','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','download','root','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','DESC','Applications','Intervals','format','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','priority','asc','list','List','Contacts','contact','headers','threadId','ChatInteraction','customerIp','closed','externalUrl','interaction','lastName','messageId','created','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','internal','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.13.0','origin','http://localhost:9000','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','addApplications','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','./helpers/wildcard-expressions','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','undefined','limit','count','offset','Content-Range','update','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','user-agent-parser','setUA','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown'];(function(_0x4baebc,_0x41de8c){var _0x31b89c=function(_0x368217){while(--_0x368217){_0x4baebc['push'](_0x4baebc['shift']());}};_0x31b89c(++_0x41de8c);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4888a4,_0x46a30){_0x4888a4=_0x4888a4-0x0;var _0x1f2445=_0xa8a8[_0x4888a4];return _0x1f2445;};'use strict';var Mustache=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var ejs=require(_0x8a8a('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a8a('0x4'));var querystring=require(_0x8a8a('0x5'));var htmlToText=require(_0x8a8a('0x6'));var Redis=require(_0x8a8a('0x7'));var jayson=require(_0x8a8a('0x8'));var qs=require(_0x8a8a('0x9'));var logger=require(_0x8a8a('0xa'))(_0x8a8a('0xb'));var config=require(_0x8a8a('0xc'));var APIBadRequestError=require(_0x8a8a('0xd'))[_0x8a8a('0xe')];var APINotFoundError=require(_0x8a8a('0xd'))[_0x8a8a('0xf')];var APIOutOfIntervalError=require(_0x8a8a('0xd'))[_0x8a8a('0x10')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0x8a8a('0xd'))['APIConflictError'];var wildcardUtils=require(_0x8a8a('0x11'));var URL=require(_0x8a8a('0x12'))['URL'];var db=require(_0x8a8a('0x13'))['db'];config[_0x8a8a('0x14')]=_[_0x8a8a('0x15')](config['redis'],{'host':_0x8a8a('0x16'),'port':0x18eb});var socket=require(_0x8a8a('0x17'))(new Redis(config[_0x8a8a('0x14')]));require(_0x8a8a('0x18'))['register'](socket);var client=jayson[_0x8a8a('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x8a8a('0x19')][_0x8a8a('0x1a')]({'port':0x232a});var client9003=jayson[_0x8a8a('0x19')][_0x8a8a('0x1a')]({'port':0x232b});var client9001=jayson[_0x8a8a('0x19')][_0x8a8a('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x16d38d,_0x51ce75,_0x1ed3be,_0x568b83){return new Promise(function(_0x1f36b6,_0x3046ae){var _0x46a4f4=_0x568b83||client;return _0x46a4f4[_0x8a8a('0x1b')](_0x16d38d,_0x1ed3be)[_0x8a8a('0x1c')](function(_0x5dd616){logger[_0x8a8a('0x1d')](_0x8a8a('0x1e'),_0x51ce75,_0x8a8a('0x1f'));logger[_0x8a8a('0x20')](_0x8a8a('0x21'),_0x51ce75,_0x8a8a('0x1f'),JSON['stringify'](_0x5dd616));if(_0x5dd616['error']){if(_0x5dd616['error']['code']===0x1f4){logger['error'](_0x8a8a('0x1e'),_0x51ce75,_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);return _0x3046ae(_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);}logger[_0x8a8a('0x22')](_0x8a8a('0x1e'),_0x51ce75,_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);return _0x1f36b6(_0x5dd616[_0x8a8a('0x22')][_0x8a8a('0x23')]);}else{logger[_0x8a8a('0x1d')](_0x8a8a('0x1e'),_0x51ce75,_0x8a8a('0x1f'));_0x1f36b6(_0x5dd616[_0x8a8a('0x24')]['message']);}})[_0x8a8a('0x25')](function(_0x16c55b){logger[_0x8a8a('0x22')](_0x8a8a('0x1e'),_0x51ce75,_0x16c55b);_0x3046ae(_0x16c55b);});});}function respondWithStatusCode(_0x36e6d4,_0x251315){_0x251315=_0x251315||0xcc;return function(_0x3aa46d){if(_0x3aa46d){return _0x36e6d4['sendStatus'](_0x251315);}return _0x36e6d4[_0x8a8a('0x26')](_0x251315)[_0x8a8a('0x27')]();};}function respondWithResult(_0x2e217a,_0x54ff7e){_0x54ff7e=_0x54ff7e||0xc8;return function(_0x58f42b){if(_0x58f42b){return _0x2e217a[_0x8a8a('0x26')](_0x54ff7e)[_0x8a8a('0x28')](_0x58f42b);}};}function respondWithFilteredResult(_0x5c70bd,_0x4d8760){return function(_0x4b3bc5){if(_0x4b3bc5){var _0x78fd48=typeof _0x4d8760['offset']===_0x8a8a('0x29')&&typeof _0x4d8760[_0x8a8a('0x2a')]==='undefined';var _0x36c7f8=_0x4b3bc5[_0x8a8a('0x2b')];var _0x250852=_0x78fd48?0x0:_0x4d8760[_0x8a8a('0x2c')];var _0x41802e=_0x78fd48?_0x4b3bc5[_0x8a8a('0x2b')]:_0x4d8760[_0x8a8a('0x2c')]+_0x4d8760[_0x8a8a('0x2a')];var _0x5768a6;if(_0x41802e>=_0x36c7f8){_0x41802e=_0x36c7f8;_0x5768a6=0xc8;}else{_0x5768a6=0xce;}_0x5c70bd['status'](_0x5768a6);return _0x5c70bd['set'](_0x8a8a('0x2d'),_0x250852+'-'+_0x41802e+'/'+_0x36c7f8)[_0x8a8a('0x28')](_0x4b3bc5);}return null;};}function saveUpdates(_0x5f301e){return function(_0x2b5dc9){if(_0x2b5dc9){return _0x2b5dc9[_0x8a8a('0x2e')](_0x5f301e)['then'](function(_0x3abab2){return _0x3abab2;});}return null;};}function removeEntity(_0x431b3a){return function(_0x63b9be){if(_0x63b9be){return _0x63b9be['destroy']()['then'](function(){var _0x8457a0=_0x63b9be['get']({'plain':!![]});var _0x2a3198=_0x8a8a('0x2f');return db[_0x8a8a('0x30')][_0x8a8a('0x31')]({'where':{'type':_0x2a3198,'resourceId':_0x8457a0['id']}})[_0x8a8a('0x1c')](function(){return _0x63b9be;});})[_0x8a8a('0x1c')](function(){_0x431b3a[_0x8a8a('0x26')](0xcc)[_0x8a8a('0x27')]();});}};}function handleEntityNotFound(_0x320398){return function(_0xf7d4d7){if(!_0xf7d4d7){_0x320398[_0x8a8a('0x32')](0x194);}return _0xf7d4d7;};}function handleError(_0x45ddb4,_0x17a36c){_0x17a36c=_0x17a36c||0x1f4;return function(_0x37e644){logger[_0x8a8a('0x22')](_0x37e644[_0x8a8a('0x33')]);if(_0x37e644[_0x8a8a('0x34')]){delete _0x37e644[_0x8a8a('0x34')];}_0x45ddb4['status'](_0x17a36c)['send'](_0x37e644);};}function createInteractionObject(_0x53da01,_0x34db33,_0x9e0128,_0x376de3){var _0x117a5c=require(_0x8a8a('0x35'));var _0x508e67=new _0x117a5c();var _0x4ee92e=_0x508e67[_0x8a8a('0x36')](_0x9e0128['user-agent'])[_0x8a8a('0x37')]();var _0x5c210e=_0x34db33['customerIp'];if(_0x9e0128[_0x8a8a('0x38')]){_0x5c210e=_0x9e0128[_0x8a8a('0x38')];}else if(_0x9e0128[_0x8a8a('0x39')]){_0x5c210e=_[_0x8a8a('0x3a')](_0x9e0128[_0x8a8a('0x39')][_0x8a8a('0x3b')](','));}return{'ContactId':_0x376de3['id'],'ChatWebsiteId':_0x53da01,'from':(_0x376de3[_0x8a8a('0x3c')]||'')+'\x20'+(_0x376de3['lastName']||''),'customerIp':_0x5c210e,'customerPort':_0x9e0128[_0x8a8a('0x3d')]?_0x9e0128[_0x8a8a('0x3d')]:null,'referer':_0x34db33[_0x8a8a('0x3e')],'browserName':_0x4ee92e['browser'][_0x8a8a('0x34')]&&_0x4ee92e[_0x8a8a('0x3f')][_0x8a8a('0x40')]?util['format'](_0x8a8a('0x41'),_0x4ee92e[_0x8a8a('0x3f')][_0x8a8a('0x34')],_0x4ee92e[_0x8a8a('0x3f')][_0x8a8a('0x40')]):_0x8a8a('0x42'),'browserVersion':_0x4ee92e['browser']['version']||_0x8a8a('0x42'),'osName':util['format'](_0x8a8a('0x41'),_0x4ee92e['os'][_0x8a8a('0x34')],_0x4ee92e['os']['version']),'osVersion':_0x4ee92e['os']['version'],'deviceModel':_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x44')]&&_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x45')]?util['format'](_0x8a8a('0x46'),_0x4ee92e['device'][_0x8a8a('0x44')],_0x4ee92e[_0x8a8a('0x43')]['vendor'],_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x47')]):null,'deviceVendor':_0x4ee92e[_0x8a8a('0x43')]['vendor'],'deviceType':_0x4ee92e[_0x8a8a('0x43')][_0x8a8a('0x47')],'formData':JSON[_0x8a8a('0x48')](_0x34db33)};}exports['index']=function(_0x5466d4,_0x44aed3){var _0x1eb8bf={'include':[{'model':db[_0x8a8a('0x49')],'as':_0x8a8a('0x4a')}]},_0x1b842a={},_0x5c6c98={'count':0x0,'rows':[]};var _0x86588c=_[_0x8a8a('0x4b')](db[_0x8a8a('0x4c')][_0x8a8a('0x4d')],function(_0x13c233){return{'name':_0x13c233[_0x8a8a('0x4e')],'type':_0x13c233[_0x8a8a('0x47')][_0x8a8a('0x4f')]};});_0x1b842a[_0x8a8a('0x44')]=_['map'](_0x86588c,_0x8a8a('0x34'));_0x1b842a[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x5466d4[_0x8a8a('0x50')]);_0x1b842a[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x1b842a['model'],_0x1b842a[_0x8a8a('0x50')]);_0x1eb8bf[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x1b842a[_0x8a8a('0x44')],qs['fields'](_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x1eb8bf[_0x8a8a('0x54')]=_0x1eb8bf['attributes']['length']?_0x1eb8bf[_0x8a8a('0x54')]:_0x1b842a[_0x8a8a('0x44')];if(!_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x56')](_0x8a8a('0x57'))){_0x1eb8bf[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x1eb8bf['offset']=qs['offset'](_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}_0x1eb8bf['order']=qs['sort'](_0x5466d4[_0x8a8a('0x50')]['sort']);_0x1eb8bf[_0x8a8a('0x58')]=qs['filters'](_[_0x8a8a('0x59')](_0x5466d4[_0x8a8a('0x50')],_0x1b842a[_0x8a8a('0x52')]),_0x86588c);if(_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x5a')]){_0x1eb8bf[_0x8a8a('0x58')]=_[_0x8a8a('0x5b')](_0x1eb8bf[_0x8a8a('0x58')],{'$or':_[_0x8a8a('0x4b')](_0x86588c,function(_0x2c771e){if(_0x2c771e['type']!==_0x8a8a('0x5c')){var _0x133bae={};_0x133bae[_0x2c771e[_0x8a8a('0x34')]]={'$like':'%'+_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x5a')]+'%'};return _0x133bae;}})});}_0x1eb8bf=_['merge']({},_0x1eb8bf,_0x5466d4[_0x8a8a('0x5d')]);var _0x140673={'where':_0x1eb8bf['where']};return db['ChatWebsite'][_0x8a8a('0x2b')](_0x140673)[_0x8a8a('0x1c')](function(_0x322b4c){_0x5c6c98[_0x8a8a('0x2b')]=_0x322b4c;if(_0x5466d4[_0x8a8a('0x50')][_0x8a8a('0x5e')]){_0x1eb8bf['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1eb8bf);})[_0x8a8a('0x1c')](function(_0x54d848){_0x5c6c98[_0x8a8a('0x5f')]=_0x54d848;return _0x5c6c98;})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x44aed3,_0x1eb8bf))['catch'](handleError(_0x44aed3,null));};exports[_0x8a8a('0x60')]=function(_0x38ba9f,_0x183f88){var _0x119fb5={'raw':![],'where':{'id':_0x38ba9f[_0x8a8a('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0x8a8a('0x4a')}]},_0x4cf6ae={};_0x4cf6ae[_0x8a8a('0x44')]=_['keys'](db[_0x8a8a('0x4c')][_0x8a8a('0x4d')]);_0x4cf6ae[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x38ba9f['query']);_0x4cf6ae[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x4cf6ae[_0x8a8a('0x44')],_0x4cf6ae['query']);_0x119fb5['attributes']=_[_0x8a8a('0x53')](_0x4cf6ae['model'],qs['fields'](_0x38ba9f['query'][_0x8a8a('0x55')]));_0x119fb5[_0x8a8a('0x54')]=_0x119fb5['attributes'][_0x8a8a('0x62')]?_0x119fb5['attributes']:_0x4cf6ae['model'];if(_0x38ba9f[_0x8a8a('0x50')][_0x8a8a('0x5e')]){_0x119fb5['include']=[{'all':!![]}];}_0x119fb5=_[_0x8a8a('0x5b')]({},_0x119fb5,_0x38ba9f[_0x8a8a('0x5d')]);return db[_0x8a8a('0x4c')][_0x8a8a('0x63')](_0x119fb5)[_0x8a8a('0x1c')](handleEntityNotFound(_0x183f88,null))[_0x8a8a('0x1c')](respondWithResult(_0x183f88,null))['catch'](handleError(_0x183f88,null));};exports[_0x8a8a('0x64')]=function(_0x402b5f,_0x587ea8){var _0x2ce579=null;_0x402b5f[_0x8a8a('0x65')][_0x8a8a('0x66')][_0x8a8a('0x3b')](',')[_0x8a8a('0x67')](_0x450afc=>{if(_0x450afc[_0x8a8a('0x68')]()!==''&&!wildcardUtils[_0x8a8a('0x69')](_0x450afc[_0x8a8a('0x68')]())){_0x2ce579=new APIBadRequestError('\x22'+_0x450afc[_0x8a8a('0x68')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x2ce579){return handleError(_0x587ea8,null)(_0x2ce579);}return db[_0x8a8a('0x4c')][_0x8a8a('0x64')](_0x402b5f['body'],{})[_0x8a8a('0x1c')](function(_0x1f90af){var _0x2640e3=_0x402b5f[_0x8a8a('0x6a')][_0x8a8a('0x6b')]({'plain':!![]});if(!_0x2640e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2640e3[_0x8a8a('0x6c')]===_0x8a8a('0x6a')){var _0x3edc54=_0x1f90af[_0x8a8a('0x6b')]({'plain':!![]});var _0x3fc483=_0x8a8a('0x2f');return db[_0x8a8a('0x6d')]['find']({'where':{'name':_0x3fc483,'userProfileId':_0x2640e3[_0x8a8a('0x6e')]},'raw':!![]})[_0x8a8a('0x1c')](function(_0x35ed30){if(_0x35ed30&&_0x35ed30['autoAssociation']===0x0){return db[_0x8a8a('0x30')]['create']({'name':_0x3edc54[_0x8a8a('0x34')],'resourceId':_0x3edc54['id'],'type':_0x35ed30[_0x8a8a('0x34')],'sectionId':_0x35ed30['id']},{})['then'](function(){return _0x1f90af;});}else{return _0x1f90af;}})[_0x8a8a('0x25')](function(_0x42891b){logger[_0x8a8a('0x22')](_0x8a8a('0x6f'),_0x42891b);throw _0x42891b;});}return _0x1f90af;})[_0x8a8a('0x1c')](respondWithResult(_0x587ea8,0xc9))[_0x8a8a('0x25')](handleError(_0x587ea8,null));};exports[_0x8a8a('0x2e')]=function(_0x25b684,_0x31c0dc){var _0x218e5b=null;_0x25b684[_0x8a8a('0x65')][_0x8a8a('0x66')][_0x8a8a('0x3b')](',')[_0x8a8a('0x67')](_0x8a0a49=>{if(_0x8a0a49[_0x8a8a('0x68')]()!==''&&!wildcardUtils[_0x8a8a('0x69')](_0x8a0a49[_0x8a8a('0x68')]())){_0x218e5b=new APIBadRequestError('\x22'+_0x8a0a49['trim']()+_0x8a8a('0x70'));}});if(_0x218e5b){return handleError(_0x31c0dc,null)(_0x218e5b);}if(_0x25b684['body']['id']){delete _0x25b684[_0x8a8a('0x65')]['id'];}return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x25b684['params']['id']},'include':[{'model':db['Pause'],'as':_0x8a8a('0x4a')}]})[_0x8a8a('0x1c')](handleEntityNotFound(_0x31c0dc,null))[_0x8a8a('0x1c')](saveUpdates(_0x25b684['body'],null))['then'](respondWithResult(_0x31c0dc,null))[_0x8a8a('0x25')](handleError(_0x31c0dc,null));};exports[_0x8a8a('0x31')]=function(_0x46a556,_0x155cc4){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x46a556[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x155cc4,null))['then'](removeEntity(_0x155cc4,null))[_0x8a8a('0x25')](handleError(_0x155cc4,null));};exports[_0x8a8a('0x71')]=function(_0x4a906c,_0x3158f2){return db[_0x8a8a('0x4c')][_0x8a8a('0x71')]()[_0x8a8a('0x1c')](respondWithResult(_0x3158f2,null))[_0x8a8a('0x25')](handleError(_0x3158f2,null));};exports[_0x8a8a('0x72')]=function(_0x4a886f,_0x2924a4){if(_0x4a886f[_0x8a8a('0x65')]['id']){delete _0x4a886f[_0x8a8a('0x65')]['id'];}return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x4a886f['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x2924a4,null))[_0x8a8a('0x1c')](function(_0x34d140){if(_0x34d140){_0x4a886f[_0x8a8a('0x65')][_0x8a8a('0x73')]=_0x34d140['id'];return db[_0x8a8a('0x74')][_0x8a8a('0x64')](_0x4a886f[_0x8a8a('0x65')]);}})[_0x8a8a('0x1c')](respondWithResult(_0x2924a4,null))[_0x8a8a('0x25')](handleError(_0x2924a4,null));};exports['getDispositions']=function(_0x306a50,_0x20b40e){var _0x3bb8d7={'raw':![],'where':{}};var _0x3391b5={};var _0xb74976={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x306a50[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x20b40e,null))[_0x8a8a('0x1c')](function(_0x50b105){if(_0x50b105){_0x3391b5[_0x8a8a('0x44')]=_[_0x8a8a('0x51')](db[_0x8a8a('0x74')][_0x8a8a('0x4d')]);_0x3391b5['query']=_[_0x8a8a('0x51')](_0x306a50[_0x8a8a('0x50')]);_0x3391b5[_0x8a8a('0x52')]=_['intersection'](_0x3391b5['model'],_0x3391b5['query']);_0x3bb8d7[_0x8a8a('0x54')]=_['intersection'](_0x3391b5[_0x8a8a('0x44')],qs['fields'](_0x306a50['query'][_0x8a8a('0x55')]));_0x3bb8d7['attributes']=_0x3bb8d7['attributes']['length']?_0x3bb8d7[_0x8a8a('0x54')]:_0x3391b5['model'];if(!_0x306a50['query'][_0x8a8a('0x56')]('nolimit')){_0x3bb8d7[_0x8a8a('0x2a')]=qs['limit'](_0x306a50[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x3bb8d7[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x306a50['query'][_0x8a8a('0x2c')]);}_0x3bb8d7[_0x8a8a('0x75')]=qs['sort'](_0x306a50[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x3bb8d7[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_['pick'](_0x306a50['query'],_0x3391b5[_0x8a8a('0x52')]));_0x3bb8d7[_0x8a8a('0x58')][_0x8a8a('0x73')]=_0x50b105['id'];if(_0x306a50['query'][_0x8a8a('0x5a')]){_0x3bb8d7[_0x8a8a('0x58')]=_[_0x8a8a('0x5b')](_0x3bb8d7['where'],{'$or':_[_0x8a8a('0x4b')](_0x3bb8d7[_0x8a8a('0x54')],function(_0x1e60a6){var _0x3a7e46={};_0x3a7e46[_0x1e60a6]={'$like':'%'+_0x306a50[_0x8a8a('0x50')]['filter']+'%'};return _0x3a7e46;})});}_0x3bb8d7=_[_0x8a8a('0x5b')]({},_0x3bb8d7,_0x306a50[_0x8a8a('0x5d')]);return db[_0x8a8a('0x74')][_0x8a8a('0x2b')]({'where':_0x3bb8d7[_0x8a8a('0x58')]})[_0x8a8a('0x1c')](function(_0x276126){_0xb74976['count']=_0x276126;if(_0x306a50['query'][_0x8a8a('0x5e')]){_0x3bb8d7[_0x8a8a('0x77')]=[{'all':!![]}];}return db[_0x8a8a('0x74')]['findAll'](_0x3bb8d7);})[_0x8a8a('0x1c')](function(_0xd53cec){_0xb74976[_0x8a8a('0x5f')]=_0xd53cec;return _0xb74976;});}})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x20b40e,_0x3bb8d7))[_0x8a8a('0x25')](handleError(_0x20b40e,null));};exports[_0x8a8a('0x78')]=function(_0x3a0e27,_0x26d57f){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x3a0e27['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x26d57f,null))[_0x8a8a('0x1c')](function(_0x311c6c){if(_0x311c6c){return _0x311c6c['removeDispositions'](_0x3a0e27[_0x8a8a('0x50')][_0x8a8a('0x79')]);}})[_0x8a8a('0x1c')](respondWithStatusCode(_0x26d57f,null))['catch'](handleError(_0x26d57f,null));};exports['addAnswer']=function(_0x1f409b,_0x450b1a){if(_0x1f409b[_0x8a8a('0x65')]['id']){delete _0x1f409b[_0x8a8a('0x65')]['id'];}return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x1f409b[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x450b1a,null))[_0x8a8a('0x1c')](function(_0x5df060){if(_0x5df060){_0x1f409b['body'][_0x8a8a('0x73')]=_0x5df060['id'];return db[_0x8a8a('0x7a')][_0x8a8a('0x64')](_0x1f409b['body']);}})[_0x8a8a('0x1c')](respondWithResult(_0x450b1a,null))[_0x8a8a('0x25')](handleError(_0x450b1a,null));};exports[_0x8a8a('0x7b')]=function(_0x198083,_0x31f2e6){var _0x5ac7b7={'raw':![],'where':{}};var _0x5ac592={};var _0x5d727e={'count':0x0,'rows':[]};return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x198083[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x31f2e6,null))[_0x8a8a('0x1c')](function(_0x34502e){if(_0x34502e){_0x5ac592['model']=_[_0x8a8a('0x51')](db[_0x8a8a('0x7a')]['rawAttributes']);_0x5ac592['query']=_[_0x8a8a('0x51')](_0x198083[_0x8a8a('0x50')]);_0x5ac592['filters']=_[_0x8a8a('0x53')](_0x5ac592['model'],_0x5ac592['query']);_0x5ac7b7[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x5ac592[_0x8a8a('0x44')],qs['fields'](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x5ac7b7[_0x8a8a('0x54')]=_0x5ac7b7[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x5ac7b7[_0x8a8a('0x54')]:_0x5ac592['model'];if(!_0x198083['query']['hasOwnProperty'](_0x8a8a('0x57'))){_0x5ac7b7[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x5ac7b7[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}_0x5ac7b7['order']=qs[_0x8a8a('0x76')](_0x198083[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x5ac7b7[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_[_0x8a8a('0x59')](_0x198083['query'],_0x5ac592['filters']));_0x5ac7b7['where'][_0x8a8a('0x73')]=_0x34502e['id'];if(_0x198083['query'][_0x8a8a('0x5a')]){_0x5ac7b7['where']=_[_0x8a8a('0x5b')](_0x5ac7b7['where'],{'$or':_[_0x8a8a('0x4b')](_0x5ac7b7[_0x8a8a('0x54')],function(_0x5e8094){var _0x12110e={};_0x12110e[_0x5e8094]={'$like':'%'+_0x198083['query']['filter']+'%'};return _0x12110e;})});}_0x5ac7b7=_[_0x8a8a('0x5b')]({},_0x5ac7b7,_0x198083['options']);return db[_0x8a8a('0x7a')]['count']({'where':_0x5ac7b7[_0x8a8a('0x58')]})['then'](function(_0x34aa82){_0x5d727e[_0x8a8a('0x2b')]=_0x34aa82;if(_0x198083[_0x8a8a('0x50')][_0x8a8a('0x5e')]){_0x5ac7b7['include']=[{'all':!![]}];}return db[_0x8a8a('0x7a')][_0x8a8a('0x7d')](_0x5ac7b7);})[_0x8a8a('0x1c')](function(_0x33ac80){_0x5d727e['rows']=_0x33ac80;return _0x5d727e;});}})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x31f2e6,_0x5ac7b7))[_0x8a8a('0x25')](handleError(_0x31f2e6,null));};exports[_0x8a8a('0x7e')]=function(_0x4e4983,_0xd5f3cf){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x4e4983[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0xd5f3cf,null))['then'](function(_0x5b5087){if(_0x5b5087){return _0x5b5087[_0x8a8a('0x7e')](_0x4e4983[_0x8a8a('0x50')][_0x8a8a('0x79')]);}})['then'](respondWithStatusCode(_0xd5f3cf,null))[_0x8a8a('0x25')](handleError(_0xd5f3cf,null));};exports[_0x8a8a('0x7f')]=function(_0x559f13,_0x568cb2){_0x559f13[_0x8a8a('0x65')][_0x8a8a('0x80')]=_0x559f13[_0x8a8a('0x81')]['filename'];return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x559f13['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x568cb2,null))[_0x8a8a('0x1c')](saveUpdates(_0x559f13['body'],null))[_0x8a8a('0x1c')](respondWithResult(_0x568cb2,null))['catch'](handleError(_0x568cb2,null));};exports[_0x8a8a('0x82')]=function(_0x16a4a8,_0x575f64){_0x16a4a8[_0x8a8a('0x65')][_0x8a8a('0x83')]=_0x16a4a8['file'][_0x8a8a('0x84')];return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x16a4a8[_0x8a8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x575f64,null))[_0x8a8a('0x1c')](saveUpdates(_0x16a4a8[_0x8a8a('0x65')],null))[_0x8a8a('0x1c')](respondWithResult(_0x575f64,null))['catch'](handleError(_0x575f64,null));};exports[_0x8a8a('0x85')]=function(_0x4d1fc0,_0x269d17){_0x4d1fc0[_0x8a8a('0x65')][_0x8a8a('0x86')]=_0x4d1fc0[_0x8a8a('0x81')][_0x8a8a('0x84')];return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x4d1fc0[_0x8a8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x269d17,null))[_0x8a8a('0x1c')](saveUpdates(_0x4d1fc0[_0x8a8a('0x65')],null))[_0x8a8a('0x1c')](respondWithResult(_0x269d17,null))['catch'](handleError(_0x269d17,null));};exports['addSystemAvatar']=function(_0x35d9e2,_0x1cb3aa){_0x35d9e2[_0x8a8a('0x65')][_0x8a8a('0x87')]=_0x35d9e2[_0x8a8a('0x81')][_0x8a8a('0x84')];return db[_0x8a8a('0x4c')]['find']({'where':{'id':_0x35d9e2['params']['id']}})['then'](handleEntityNotFound(_0x1cb3aa,null))[_0x8a8a('0x1c')](saveUpdates(_0x35d9e2[_0x8a8a('0x65')],null))[_0x8a8a('0x1c')](respondWithResult(_0x1cb3aa,null))['catch'](handleError(_0x1cb3aa,null));};exports[_0x8a8a('0x88')]=function(_0xe6030b,_0x39d705){var _0x19c264=path[_0x8a8a('0x89')](config['root'],_0x8a8a('0x8a'));var _0xde7f73={'where':{'id':_0xe6030b[_0x8a8a('0x61')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x913a2f=![];return require(_0x8a8a('0x8b'))[_0x8a8a('0x8c')]()['then'](function(_0x4a2af9){if(_0x4a2af9){_0x913a2f=_0x4a2af9[_0x8a8a('0x8d')];}})[_0x8a8a('0x1c')](function(){return db[_0x8a8a('0x4c')]['find'](_0xde7f73);})[_0x8a8a('0x1c')](handleEntityNotFound(_0x39d705,null))[_0x8a8a('0x1c')](function(_0x5b555e){if(_0x5b555e){if(!_[_0x8a8a('0x8e')](_0x5b555e[_0x8a8a('0x80')])){if(fs['existsSync'](path[_0x8a8a('0x89')](config['root'],'server/files/images/logos/',_0x5b555e[_0x8a8a('0x80')]))&&_0x913a2f){_0x19c264=path[_0x8a8a('0x89')](config['root'],'server/files/images/logos/',_0x5b555e['sitepic']);}}return _0x39d705[_0x8a8a('0x8f')](_0x19c264);}})['catch'](handleError(_0x39d705,null));};exports['getAvatar']=function(_0xc0fb22,_0x69e16){var _0x58ac24=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x91'));var _0x43ab4d={'where':{'id':_0xc0fb22[_0x8a8a('0x61')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x8a8a('0x4c')]['find'](_0x43ab4d)[_0x8a8a('0x1c')](handleEntityNotFound(_0x69e16,null))[_0x8a8a('0x1c')](function(_0x9bd75e){if(_0x9bd75e){if(!_[_0x8a8a('0x8e')](_0x9bd75e['agentAvatar'])){if(fs['existsSync'](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],'server/files/images/avatars/',_0x9bd75e[_0x8a8a('0x83')]))){_0x58ac24=path[_0x8a8a('0x89')](config['root'],_0x8a8a('0x92'),_0x9bd75e[_0x8a8a('0x83')]);}}return _0x69e16[_0x8a8a('0x8f')](_0x58ac24);}})['catch'](handleError(_0x69e16,null));};exports['getCustomerAvatar']=function(_0x83f17d,_0x4d9d70){var _0x46aff7=path['join'](config[_0x8a8a('0x90')],'server/files/images/avatars/customer_avatar.png');var _0x4caec3={'where':{'id':_0x83f17d['params']['id']},'attributes':['id','customerAvatar',_0x8a8a('0x93')],'raw':!![]};return db[_0x8a8a('0x4c')][_0x8a8a('0x63')](_0x4caec3)['then'](handleEntityNotFound(_0x4d9d70,null))[_0x8a8a('0x1c')](function(_0x16b941){if(_0x16b941){if(!_[_0x8a8a('0x8e')](_0x16b941[_0x8a8a('0x86')])){if(fs[_0x8a8a('0x94')](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],'server/files/images/avatars/',_0x16b941['customerAvatar']))&&_0x16b941[_0x8a8a('0x93')]){_0x46aff7=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],'server/files/images/avatars/',_0x16b941[_0x8a8a('0x86')]);}}return _0x4d9d70[_0x8a8a('0x8f')](_0x46aff7);}})[_0x8a8a('0x25')](handleError(_0x4d9d70,null));};exports[_0x8a8a('0x95')]=function(_0x5130d3,_0x5023d7){var _0x45647=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x96'));var _0x3a30c6={'where':{'id':_0x5130d3[_0x8a8a('0x61')]['id']},'attributes':['id',_0x8a8a('0x87')],'raw':!![]};return db[_0x8a8a('0x4c')][_0x8a8a('0x63')](_0x3a30c6)[_0x8a8a('0x1c')](handleEntityNotFound(_0x5023d7,null))[_0x8a8a('0x1c')](function(_0x5376b6){if(_0x5376b6){if(!_[_0x8a8a('0x8e')](_0x5376b6[_0x8a8a('0x87')])){if(fs[_0x8a8a('0x94')](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x92'),_0x5376b6[_0x8a8a('0x87')]))){_0x45647=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x92'),_0x5376b6[_0x8a8a('0x87')]);}}return _0x5023d7['download'](_0x45647);}})[_0x8a8a('0x25')](handleError(_0x5023d7,null));};function checkWebsiteInterval(_0x211dfc){var _0x2d7ed6=_0x211dfc[_0x8a8a('0x97')];if(!_0x2d7ed6){return Promise['resolve'](_0x211dfc);}var _0x44561a=_0x211dfc[_0x8a8a('0x98')]||undefined;return _0x2d7ed6[_0x8a8a('0x99')](_0x44561a)[_0x8a8a('0x1c')](function(_0x474e27){if(!_0x474e27){throw new APIOutOfIntervalError();}return _0x211dfc;});}exports[_0x8a8a('0x9a')]=function(_0x59ed64,_0x33667d){var _0x3c2e96={'body':_0x59ed64[_0x8a8a('0x65')],'channel':_0x8a8a('0x9b')};var _0x35bb17=[];var _0x17e607=[];var _0x184310={};var _0xfa3640=![];if(_0x59ed64['body']['id']){delete _0x59ed64[_0x8a8a('0x65')]['id'];}if(_[_0x8a8a('0x8e')](_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9c')])){throw new APIBadRequestError(_0x8a8a('0x9d'));}if(_[_0x8a8a('0x8e')](_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9e')])){throw new APIBadRequestError(_0x8a8a('0x9f'));}if(_['isEmpty'](_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x65')])){throw new APIBadRequestError(_0x8a8a('0xa0'));}var _0x1f54d4=_0x59ed64[_0x8a8a('0x65')]['customerIp']&&_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x3e')];return db[_0x8a8a('0xa1')][_0x8a8a('0x71')]()[_0x8a8a('0x1c')](function(_0x55e474){if(!_0x55e474){throw new Error('No\x20available\x20attributes');}_0x35bb17=Object['keys'](_0x55e474)[_0x8a8a('0x5a')](function(_0x3074a2){return![_0x8a8a('0xa2'),_0x8a8a('0xa3')][_0x8a8a('0xa4')](_0x3074a2);});_0x17e607=Object[_0x8a8a('0x51')](_0x55e474)['filter'](function(_0x1c7c8a){return![_0x8a8a('0xa2'),_0x8a8a('0xa3'),'CompanyId',_0x8a8a('0xa5')][_0x8a8a('0xa4')](_0x1c7c8a);});if(!_[_0x8a8a('0xa4')](_0x17e607,_0x59ed64['body'][_0x8a8a('0x9e')])){throw new APIBadRequestError(_0x8a8a('0xa6')+_0x17e607['join'](',\x20'));}_0x184310[_0x59ed64['body'][_0x8a8a('0x9e')]]=_0x59ed64['body']['from'];})['then'](function(){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x59ed64[_0x8a8a('0x61')]['id']},'include':[{'model':db[_0x8a8a('0xa7')],'as':'List','include':[{'model':db[_0x8a8a('0xa1')],'as':'Contacts','where':_0x184310,'limit':0x1,'order':[[_0x8a8a('0xa3'),_0x8a8a('0xa8')]]}]},{'model':db['ChatApplication'],'as':_0x8a8a('0xa9')},{'model':db[_0x8a8a('0x97')],'as':'Interval','include':[{'model':db[_0x8a8a('0x97')],'as':_0x8a8a('0xaa'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x8a8a('0x1c')](function(_0x1dc93c){if(!_0x1dc93c){throw new APINotFoundError(util[_0x8a8a('0xab')](_0x8a8a('0xac'),_0x59ed64[_0x8a8a('0x61')]['id']));}if(_0x1f54d4){return checkWebsiteInterval(_0x1dc93c);}return _0x1dc93c;})['then'](function(_0x5ab5e1){_0x3c2e96[_0x8a8a('0xad')]=_0x5ab5e1;_0x3c2e96[_0x8a8a('0xae')]=_['orderBy'](_0x5ab5e1[_0x8a8a('0xa9')],[_0x8a8a('0xaf')],[_0x8a8a('0xb0')]);if(_0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xa9')]){delete _0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xa9')];}_0x3c2e96[_0x8a8a('0xb1')]=_0x5ab5e1[_0x8a8a('0xb2')]||{'id':_0x5ab5e1[_0x8a8a('0xa5')]};if(_0x3c2e96[_0x8a8a('0xb1')]&&_0x3c2e96[_0x8a8a('0xb1')][_0x8a8a('0xb3')]['length']){return _0x3c2e96[_0x8a8a('0xb1')][_0x8a8a('0xb3')][0x0];}var _0x3d4dee=_['defaults'](_0x59ed64[_0x8a8a('0x65')],{'firstName':_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9c')],'ListId':_0x5ab5e1[_0x8a8a('0xa5')]});_0x3d4dee[_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9e')]]=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x9c')];return db[_0x8a8a('0xa1')][_0x8a8a('0x64')](_0x3d4dee,{'fields':_0x35bb17,'raw':!![]});})[_0x8a8a('0x1c')](function(_0x5c9358){_0x3c2e96[_0x8a8a('0xb4')]=_0x5c9358;var _0x35d518=createInteractionObject(_0x59ed64[_0x8a8a('0x61')]['id'],_0x59ed64[_0x8a8a('0x65')],_0x59ed64[_0x8a8a('0xb5')],_0x5c9358);var _0x3f0724={'ChatWebsiteId':_0x59ed64[_0x8a8a('0x61')]['id']};if(_0x59ed64['body'][_0x8a8a('0xb6')]){_0x3f0724[_0x8a8a('0xb6')]=_0x59ed64['body'][_0x8a8a('0xb6')];_0x3f0724['closed']=![];return db[_0x8a8a('0xb7')][_0x8a8a('0x63')]({'where':_0x3f0724})['then'](function(_0x2d8647){var _0x32ba47=_0x59ed64['body'][_0x8a8a('0xb8')]&&_0x59ed64[_0x8a8a('0x65')]['referer'];if(_0x2d8647){_0xfa3640=!![];return _0x2d8647;}else if(!_0x32ba47&&_0x2d8647&&_0x2d8647[_0x8a8a('0xb9')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x35d518[_0x8a8a('0xb6')]=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xb6')];_0x35d518['externalUrl']=_0x59ed64['body'][_0x8a8a('0xba')];return db['ChatInteraction'][_0x8a8a('0x64')](_0x35d518);});}_0x3f0724['ContactId']=_0x5c9358['id'];if(_0x59ed64['body'][_0x8a8a('0xbb')]&&_0x59ed64['body']['interaction']['id']){_0x3f0724['id']=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xbb')]['id'];return db[_0x8a8a('0xb7')][_0x8a8a('0x63')]({'where':_0x3f0724})[_0x8a8a('0x1c')](function(_0x4cb1da){var _0x3d757a=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xb8')]&&_0x59ed64['body'][_0x8a8a('0x3e')];if(!_0x3d757a&&_0x4cb1da&&_0x4cb1da['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x4cb1da){_0xfa3640=!![];return _0x4cb1da;}else{return db['ChatInteraction'][_0x8a8a('0x64')](_0x35d518);}});}return db['ChatInteraction']['create'](_0x35d518);})['then'](function(_0x203b2d){if(!_0xfa3640){return _0x203b2d;}var _0x159c37={'from':(_0x3c2e96[_0x8a8a('0xb4')][_0x8a8a('0x3c')]||'')+'\x20'+(_0x3c2e96['contact'][_0x8a8a('0xbc')]||'')};if(_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xb6')]&&_0x59ed64['body'][_0x8a8a('0xbd')]&&_0x59ed64['body']['threadId']!=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xbd')]){_0x159c37[_0x8a8a('0xb6')]=_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xbd')];}return _0x203b2d['update'](_0x159c37);})[_0x8a8a('0x1c')](function(_0x33e008){_0x3c2e96[_0x8a8a('0xbb')]=_0x33e008[_0x8a8a('0x6b')]({'plain':!![]});_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xbe')]=!_0xfa3640;if(_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xbe')]){if(_0x3c2e96[_0x8a8a('0xad')]['autoclose']){_0x3c2e96[_0x8a8a('0xae')]['push']({'id':0x0,'priority':_0x3c2e96[_0x8a8a('0xae')][_0x8a8a('0x62')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x8a8a('0xbf')});}}return db[_0x8a8a('0xc0')][_0x8a8a('0x64')]({'body':_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0x65')],'ChatWebsiteId':_0x59ed64[_0x8a8a('0x61')]['id'],'ChatInteractionId':_0x33e008['id'],'direction':'in','ContactId':_0x3c2e96[_0x8a8a('0xb4')]['id'],'AttachmentId':_0x59ed64[_0x8a8a('0x65')][_0x8a8a('0xc1')]});})[_0x8a8a('0x1c')](function(_0x3e4b43){_0x3c2e96[_0x8a8a('0x23')]=_0x3e4b43;if(!_0x3c2e96[_0x8a8a('0xbb')]['UserId']){return;}return db[_0x8a8a('0xc2')][_0x8a8a('0x63')]({'attributes':['id',_0x8a8a('0x34')],'where':{'id':_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xc3')]}});})[_0x8a8a('0x1c')](function(_0x5a7fcd){if(_0x5a7fcd){_0x3c2e96[_0x8a8a('0xae')][_0x8a8a('0xc4')]({'id':0x0,'priority':0x0,'app':_0x8a8a('0xc5'),'appdata':_0x5a7fcd[_0x8a8a('0x34')]+','+(_0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xc6')]||0xa),'interval':_0x8a8a('0xbf')});_0x3c2e96[_0x8a8a('0xc7')]=!![];}if(!_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xc8')]){return;}return db[_0x8a8a('0xc9')][_0x8a8a('0x63')]({'attributes':['id',_0x8a8a('0x34')],'where':{'id':_0x3c2e96[_0x8a8a('0xbb')][_0x8a8a('0xc8')]}});})[_0x8a8a('0x1c')](function(_0x433051){if(_0x433051){_0x3c2e96[_0x8a8a('0xae')][_0x8a8a('0xc4')]({'id':0x0,'priority':0x1,'app':_0x8a8a('0xca'),'appdata':_0x433051[_0x8a8a('0x34')]+','+(_0x3c2e96[_0x8a8a('0xad')][_0x8a8a('0xcb')]||0x12c),'interval':_0x8a8a('0xbf')});}return respondWithRpcPromise('Start','startRouting',_0x3c2e96);})[_0x8a8a('0x1c')](function(_0x55d97e){respondWithRpcPromise(_0x8a8a('0xcc'),_0x8a8a('0xcc'),{'event':_0x8a8a('0x9a'),'message':_0x55d97e},client9002);return _0x55d97e;})[_0x8a8a('0x1c')](respondWithResult(_0x33667d,null))['catch'](APIHandleError(_0x33667d));};exports[_0x8a8a('0xcd')]=function(_0x1cad71,_0x2ae822){var _0xb988c3,_0x36e8c6,_0x204dde;var _0x155a64=[];var _0x21504d={};var _0x123c98=_0x1cad71[_0x8a8a('0xce')]||[];var _0x2c82d4=[];var _0x4bf38e;return db[_0x8a8a('0xa1')][_0x8a8a('0x71')]()[_0x8a8a('0x1c')](function(_0xb2fc5b){if(!_0xb2fc5b){throw new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd1'));}_0x155a64=_[_0x8a8a('0xd2')](_[_0x8a8a('0x51')](_0xb2fc5b),[_0x8a8a('0xa2'),_0x8a8a('0xa3'),'CompanyId',_0x8a8a('0xa5')]);if(_0x1cad71[_0x8a8a('0x65')]['id']){delete _0x1cad71[_0x8a8a('0x65')]['id'];}if(_[_0x8a8a('0x8e')](_0x1cad71[_0x8a8a('0x65')]['from'])){throw _0x2ae822['status'](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd4')));}if(_[_0x8a8a('0x8e')](_0x1cad71['body'][_0x8a8a('0x65')])||_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x65')]===''){throw _0x2ae822[_0x8a8a('0x26')](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8a8a('0x8e')](_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0xd5')])){throw _0x2ae822[_0x8a8a('0x26')](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd6')+_0x155a64));}if(!_[_0x8a8a('0xa4')](_0x155a64,_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0xd5')])){throw _0x2ae822['status'](0x1f4)[_0x8a8a('0xd3')](new db[(_0x8a8a('0xcf'))][(_0x8a8a('0xd0'))](_0x8a8a('0xd7')+_0x155a64));}_0x21504d[_0x1cad71[_0x8a8a('0x65')]['mapKeyOffline']]=_0x1cad71['body'][_0x8a8a('0x9c')];})[_0x8a8a('0x1c')](function(){return db['ChatWebsite'][_0x8a8a('0x63')]({'where':{'id':_0x1cad71[_0x8a8a('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0x8a8a('0xb2')},{'model':db[_0x8a8a('0xd8')],'as':_0x8a8a('0xd8')}]});})[_0x8a8a('0x1c')](handleEntityNotFound(_0x2ae822,null))['then'](function(_0x2f68b3){if(_0x2f68b3&&_0x2f68b3[_0x8a8a('0xb2')]){_0x36e8c6=_0x2f68b3;var _0x2e583f=_[_0x8a8a('0x15')](_0x1cad71['body'],{'firstName':_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x9c')],'phone':_0x1cad71['body'][_0x8a8a('0x9c')],'ListId':_0x2f68b3[_0x8a8a('0xa5')]});_0x2e583f[_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0xd5')]]=_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x9c')];return db[_0x8a8a('0xa1')][_0x8a8a('0xd9')]({'where':_0x21504d,'defaults':_0x2e583f});}})[_0x8a8a('0xda')](function(_0x30ee47){if(_0x30ee47){_0x204dde=_0x30ee47;var _0xd1803f=fs[_0x8a8a('0xdb')](path['join'](config[_0x8a8a('0x90')],'server/files/templates/chatOfflineMessage.ejs'),_0x8a8a('0xdc'));var _0x4b334b=ejs[_0x8a8a('0xdd')](_0xd1803f,{'body':_[_0x8a8a('0xde')](_0x1cad71[_0x8a8a('0x65')][_0x8a8a('0x65')]),'bodyTitle':_0x36e8c6['offlineMessageBody']});return db[_0x8a8a('0xdf')]['create']({'body':_0x4b334b,'plainBody':htmlToText[_0x8a8a('0xe0')](_0x4b334b),'ContactId':_0x30ee47['id'],'ChatWebsiteId':_0x36e8c6['id']});}})[_0x8a8a('0x1c')](function(_0x3c292a){_0x4bf38e=_0x3c292a;if(_0x123c98[_0x8a8a('0x62')]){var _0x327020=_0x123c98[_0x8a8a('0x4b')](function(_0x1edb12){return{'name':_0x1edb12[_0x8a8a('0xe1')],'basename':_0x1edb12['filename'],'type':_0x1edb12['mimetype'],'ChatOfflineMessageId':_0x3c292a['id']};});_0x2c82d4=_0x327020[_0x8a8a('0x4b')](_0x268a78=>{var _0xb02292={'filename':_0x268a78[_0x8a8a('0x34')],'path':path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0xe2'),_0x8a8a('0xce'),_0x8a8a('0xe3'),_0x8a8a('0xe4'),_0x268a78['basename'])};return _0xb02292;});if(!_0x36e8c6['openNewInteraction']){return db[_0x8a8a('0xe5')][_0x8a8a('0xe6')](function(_0x4bffba){return db[_0x8a8a('0xe7')][_0x8a8a('0xe8')](_0x327020,{'transaction':_0x4bffba});});}}})[_0x8a8a('0x1c')](function(){if(_0x4bf38e){_0xb988c3=_0x4bf38e;return db['MailAccount'][_0x8a8a('0x7c')]({'where':{'service':!![]},'include':[{'model':db[_0x8a8a('0xe9')],'as':_0x8a8a('0xea'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})[_0x8a8a('0x1c')](function(_0x25d338){if(_0x25d338&&_0x25d338[_0x8a8a('0xea')]&&_0x36e8c6[_0x8a8a('0xeb')]&&_0x36e8c6[_0x8a8a('0xec')]){var _0x327f00=_0x25d338[_0x8a8a('0xed')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x327f00,'message':{'from':util[_0x8a8a('0xab')](_0x8a8a('0xee'),_0x25d338['name'],_0x25d338[_0x8a8a('0xef')]||_0x25d338['Smtp']['user']),'to':_0x36e8c6['forwardOfflineAddress'],'subject':_0x36e8c6[_0x8a8a('0xf0')],'html':_0xb988c3[_0x8a8a('0x65')],'attachments':_0x2c82d4}},client9003)[_0x8a8a('0x1c')](function(){return _0xb988c3;})[_0x8a8a('0x25')](function(_0xcfd82f){logger[_0x8a8a('0x22')](_0xcfd82f);});}})['then'](function(){if(_0x36e8c6&&_0x36e8c6['openNewInteraction']&&_0x36e8c6['MailAccountId']){var _0x192040=[];if(_0x123c98[_0x8a8a('0x62')]){_0x192040=_0x123c98[_0x8a8a('0x4b')](function(_0x5843c8){return{'name':_0x5843c8['originalname'],'basename':_0x5843c8['filename'],'type':_0x5843c8[_0x8a8a('0xf1')],'ChatOfflineMessageId':_0x4bf38e['id']};});}var _0x5168b5;if(!_[_0x8a8a('0x8e')](_0x36e8c6[_0x8a8a('0xf2')])){var _0x51c6f8=_[_0x8a8a('0x4b')](_0x1cad71['body'],function(_0x51744a){return _0x51744a;});var _0x19c612=_[_0x8a8a('0xf3')](_0x51c6f8)[0x0];var _0x220434=_['mapValues'](_0x19c612,function(_0x29e6d0){return _0x29e6d0;});_0x5168b5=_0x220434[0x1][_0x36e8c6[_0x8a8a('0xf2')]];}var _0x517c95={'from':_0x204dde[_0x8a8a('0xef')],'firstName':_0x204dde[_0x8a8a('0x3c')],'lastName':_0x204dde[_0x8a8a('0xbc')],'mapKey':_0x8a8a('0xef'),'message':{'from':_0x204dde[_0x8a8a('0xef')],'to':_0x36e8c6[_0x8a8a('0xd8')]['email'],'cc':'','subject':_[_0x8a8a('0x8e')](_0x5168b5)?_0x36e8c6[_0x8a8a('0xf0')]:_0x5168b5,'messageId':'','sentAt':new Date(),'attach':_0x192040[_0x8a8a('0x62')],'attachments':_0x192040,'originChannel':_0x8a8a('0xf4'),'ChatWebsiteId':_0x36e8c6['id'],'ChatOfflineMessageId':_0xb988c3['id'],'originTo':_0x36e8c6[_0x8a8a('0xd8')]['email']},'body':_0xb988c3[_0x8a8a('0x65')]};var _0x55737e={'account':{'id':_0x36e8c6[_0x8a8a('0xf5')]},'body':_0x517c95,'log':_0x8a8a('0xf6')};return respondWithRpcPromise(_0x8a8a('0xf6'),_0x8a8a('0xf7'),_0x55737e,client9001)[_0x8a8a('0x1c')](function(){return _0xb988c3;})[_0x8a8a('0x25')](function(_0x540e6e){logger['error'](_0x540e6e);});}return;})[_0x8a8a('0x1c')](function(){if(_0xb988c3){return _0xb988c3;}})[_0x8a8a('0x1c')](respondWithResult(_0x2ae822,null))[_0x8a8a('0x25')](function(){for(var _0x20f945 of _0x123c98){var _0x1baed2=path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0xe2'),_0x8a8a('0xce'),_0x8a8a('0xe3'),_0x8a8a('0xe4'),_0x20f945[_0x8a8a('0x84')]);fs_extra['remove'](_0x1baed2)[_0x8a8a('0x25')](function(_0x4f31a2){logger[_0x8a8a('0x22')](_0x8a8a('0xf8'),_0x1baed2,_0x4f31a2);});}});};exports[_0x8a8a('0xf9')]=function(_0x203707,_0x3cdc0a){return db[_0x8a8a('0xb7')][_0x8a8a('0x63')]({'where':{'id':_0x203707['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3cdc0a,null))['then'](function(_0x1e3017){if(_0x1e3017){return _0x1e3017['addInteraction'](_0x203707[_0x8a8a('0x65')][_0x8a8a('0x79')],_[_0x8a8a('0xfa')](_0x203707[_0x8a8a('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x3cdc0a,null))[_0x8a8a('0x25')](handleError(_0x3cdc0a,null));};exports[_0x8a8a('0xfb')]=function(_0x4dd128,_0x15b30c){var _0x59022b={'raw':![],'where':{}};var _0x577662={};var _0x24f65a={'count':0x0,'rows':[]};return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x4dd128['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x15b30c,null))[_0x8a8a('0x1c')](function(_0x2e34e6){if(_0x2e34e6){_0x577662['model']=_[_0x8a8a('0x51')](db[_0x8a8a('0xb7')]['rawAttributes']);_0x577662['query']=_[_0x8a8a('0x51')](_0x4dd128[_0x8a8a('0x50')]);_0x577662[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x577662[_0x8a8a('0x44')],_0x577662['query']);_0x59022b[_0x8a8a('0x54')]=_['intersection'](_0x577662['model'],qs[_0x8a8a('0x55')](_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x59022b[_0x8a8a('0x54')]=_0x59022b[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x59022b['attributes']:_0x577662[_0x8a8a('0x44')];if(!_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0x56')](_0x8a8a('0x57'))){_0x59022b[_0x8a8a('0x2a')]=qs['limit'](_0x4dd128[_0x8a8a('0x50')]['limit']);_0x59022b[_0x8a8a('0x2c')]=qs['offset'](_0x4dd128['query'][_0x8a8a('0x2c')]);}_0x59022b[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x4dd128['query'][_0x8a8a('0x76')]);_0x59022b['where']=qs[_0x8a8a('0x52')](_[_0x8a8a('0x59')](_0x4dd128[_0x8a8a('0x50')],_0x577662[_0x8a8a('0x52')]));_0x59022b[_0x8a8a('0x58')][_0x8a8a('0x73')]=_0x2e34e6['id'];if(_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0x5a')]){_0x59022b[_0x8a8a('0x58')]=_[_0x8a8a('0x5b')](_0x59022b[_0x8a8a('0x58')],{'$or':_['map'](_0x59022b['attributes'],function(_0x2d23ae){var _0x1d3559={};_0x1d3559[_0x2d23ae]={'$like':'%'+_0x4dd128[_0x8a8a('0x50')]['filter']+'%'};return _0x1d3559;})});}_0x59022b=_['merge']({},_0x59022b,_0x4dd128[_0x8a8a('0x5d')]);return db[_0x8a8a('0xb7')]['count']({'where':_0x59022b['where']})[_0x8a8a('0x1c')](function(_0xb08e40){_0x24f65a['count']=_0xb08e40;if(_0x4dd128['query'][_0x8a8a('0x5e')]){_0x59022b['include']=[{'model':db[_0x8a8a('0xa1')],'as':'Contact','required':![]},{'model':db[_0x8a8a('0xc2')],'as':'Owner','attributes':['name','fullname',_0x8a8a('0xfc')],'required':![]},{'model':db['Tag'],'as':_0x8a8a('0xfd'),'attributes':['id',_0x8a8a('0x34'),_0x8a8a('0xfe')],'where':_0x4dd128['query']['tag']?{'id':_0x4dd128[_0x8a8a('0x50')][_0x8a8a('0xff')]}:undefined,'required':_0x4dd128[_0x8a8a('0x50')]['tag']?!![]:![]}];}return db[_0x8a8a('0xb7')][_0x8a8a('0x7d')](_0x59022b);})[_0x8a8a('0x1c')](function(_0x5e4abc){_0x24f65a['rows']=_0x5e4abc;return _0x24f65a;});}})['then'](respondWithFilteredResult(_0x15b30c,_0x59022b))['catch'](handleError(_0x15b30c,null));};exports[_0x8a8a('0x100')]=function(_0x3488b4,_0x3fd5b2){var _0x6120b4=0x0;var _0x255a29=0x0;var _0x3723d9=![];var _0x82197;var _0x5e11da;return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x3488b4[_0x8a8a('0x61')]['id']},'include':[{'model':db['Interval'],'as':_0x8a8a('0x97'),'include':[{'model':db[_0x8a8a('0x97')],'as':_0x8a8a('0xaa'),'attributes':['id','interval']}]}]})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3fd5b2,null))[_0x8a8a('0x1c')](function(_0x10e059){if(_0x10e059){_0x82197=_0x10e059;return _0x10e059[_0x8a8a('0x101')]({'raw':!![]});}})[_0x8a8a('0x1c')](function(_0x142a8c){if(_0x82197){if(_0x142a8c){_0x5e11da=_0x142a8c;}}return require('../../config/license/util')[_0x8a8a('0x8c')]();})[_0x8a8a('0x1c')](function(_0x3a0fd0){if(_0x3a0fd0){_0x255a29=_0x3a0fd0[_0x8a8a('0x102')];_0x3723d9=_0x3a0fd0[_0x8a8a('0x8d')];}})[_0x8a8a('0x1c')](function(){return db[_0x8a8a('0xb7')][_0x8a8a('0x2b')]({'where':{'closed':![]}});})[_0x8a8a('0x1c')](function(_0x234485){_0x6120b4=_0x234485;if(_0x255a29&&_0x234485>_0x255a29){return db[_0x8a8a('0x103')][_0x8a8a('0x7c')]({'where':{'id':0x1}})[_0x8a8a('0x1c')](function(_0x874574){if(_0x874574){_0x874574[_0x8a8a('0x104')](_0x8a8a('0x105'));}});}})[_0x8a8a('0x1c')](function(){var _0x1f882e=_0x82197[_0x8a8a('0x97')];var _0x270117=_0x82197[_0x8a8a('0x98')]||undefined;return _0x1f882e?_0x1f882e[_0x8a8a('0x99')](_0x270117):!![];})[_0x8a8a('0x1c')](function(_0x25d8ea){var _0x5ce17f=fs['readFileSync'](path[_0x8a8a('0x89')](config[_0x8a8a('0x90')],_0x8a8a('0x106')),_0x8a8a('0xdc'));var _0x4da155=_0x8a8a('0x107');var _0x3265d7=![];var _0x546652,_0x332c4c;if(_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x3e')]){_0x546652=new URL(_0x3488b4[_0x8a8a('0xb5')]['referer'])[_0x8a8a('0x108')];}else if(_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x108')]){_0x546652=new URL(_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x108')])[_0x8a8a('0x108')];}else{_0x546652=_0x8a8a('0x109');}_0x332c4c=typeof _0x82197[_0x8a8a('0x66')][_0x8a8a('0x3b')](',')[_0x8a8a('0x63')](function(_0x268030){return wildcardUtils['testWebsiteWithWildcard'](_0x268030,_0x546652);})!==_0x8a8a('0x29');var _0x3c07fa={'chatVersion':_0x4da155,'chatWebsiteAddressOrigin':_0x332c4c?_0x546652:_0x82197[_0x8a8a('0x66')],'remote':_0x82197['remote'],'query':querystring[_0x8a8a('0x48')](_[_0x8a8a('0x5b')](_0x82197[_0x8a8a('0x6b')]({'plain':!![]}),{'customerIp':_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x39')]||_0x3488b4['headers'][_0x8a8a('0x10a')]||_0x3488b4['connection'][_0x8a8a('0x10b')]||_0x3488b4['ip'],'referer':_0x3488b4[_0x8a8a('0xb5')][_0x8a8a('0x3e')],'openedInteractions':_0x6120b4,'maxInteractions':_0x255a29,'virtual':_0x3723d9[_0x8a8a('0x102')],'online':_0x25d8ea,'custom':_0x3723d9,'address':_0x332c4c?_0x546652:null}))[_0x8a8a('0x10c')](/'/g,'\x5c\x27')};_0x3fd5b2[_0x8a8a('0xd3')](ejs[_0x8a8a('0xdd')](Mustache[_0x8a8a('0xdd')](_0x5ce17f,_0x3c07fa),{'proactiveActions':_0x5e11da,'alignment':_0x82197[_0x8a8a('0x10d')],'verticalAlignment':_0x82197[_0x8a8a('0x10e')],'div_color':_0x82197[_0x8a8a('0xfe')],'labelText':_0x82197[_0x8a8a('0x10f')],'text_color':_0x82197[_0x8a8a('0x110')],'text_button_color':_0x82197['textButtonColor'],'button_color':_0x82197[_0x8a8a('0x111')],'background_color':_0x82197[_0x8a8a('0x112')],'hideWhenOffline':_0x82197[_0x8a8a('0x113')],'intervalId':_0x82197['IntervalId'],'isDevelopment':_0x3265d7,'chatVersion':_0x4da155}));})[_0x8a8a('0x25')](handleError(_0x3fd5b2,null));};exports[_0x8a8a('0x114')]=function(_0x3c3829,_0x38f151){var _0x500151=_0x3c3829['params']['id'];var _0x13e934=_0x3c3829[_0x8a8a('0x65')];var _0x578863=0xc8;var _0x321588=null;return db[_0x8a8a('0xe5')][_0x8a8a('0xe6')]({'isolationLevel':db[_0x8a8a('0xe5')]['Transaction'][_0x8a8a('0x115')][_0x8a8a('0x116')]},function(_0x377fb){return db['ChatWebsite'][_0x8a8a('0x7c')]({'where':{'id':_0x500151},'transaction':_0x377fb})['then'](function(_0x3415f2){if(_0x3415f2){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x500151},'transaction':_0x377fb})[_0x8a8a('0x1c')](function(){var _0x487ac2=_[_0x8a8a('0x4b')](_0x13e934,function(_0x300627){_0x300627[_0x8a8a('0x73')]=_0x500151;return _0x300627;});return db[_0x8a8a('0x117')][_0x8a8a('0xe8')](_0x487ac2,{'transaction':_0x377fb});});}else{_0x578863=0x194;_0x321588=[];}});})['then'](function(){if(_0x578863!==0x194){return db[_0x8a8a('0x117')][_0x8a8a('0x118')]({'where':{'ChatWebsiteId':_0x500151},'order':_0x8a8a('0xaf')})[_0x8a8a('0x1c')](function(_0x2b3f58){_0x321588=_0x2b3f58;});}})[_0x8a8a('0x25')](function(_0x5bcf5e){_0x578863=0x1f4;logger[_0x8a8a('0x22')](_0x5bcf5e[_0x8a8a('0x33')]);if(_0x5bcf5e[_0x8a8a('0x34')]){delete _0x5bcf5e[_0x8a8a('0x34')];}_0x321588=_0x5bcf5e;})[_0x8a8a('0x119')](function(){if(_0x321588===null){_0x38f151[_0x8a8a('0x32')](_0x578863);}else{if(_0x578863===0x1f4){_0x38f151[_0x8a8a('0x26')](_0x578863)[_0x8a8a('0xd3')](_0x321588);}else{_0x38f151[_0x8a8a('0x26')](_0x578863)[_0x8a8a('0x28')](_0x321588);}}});};exports[_0x8a8a('0x11a')]=function(_0x515e99,_0x49f317){var _0x4e4a02={};var _0x2cb19e={};var _0x2e97f5;var _0x1c0953;return db['ChatWebsite']['findOne']({'where':{'id':_0x515e99[_0x8a8a('0x61')]['id']}})['then'](handleEntityNotFound(_0x49f317,null))['then'](function(_0x4f6f49){if(_0x4f6f49){_0x2e97f5=_0x4f6f49;_0x2cb19e[_0x8a8a('0x44')]=_['keys'](db[_0x8a8a('0x117')][_0x8a8a('0x4d')]);_0x2cb19e[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x515e99['query']);_0x2cb19e[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x2cb19e['model'],_0x2cb19e['query']);_0x4e4a02[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x2cb19e[_0x8a8a('0x44')],qs['fields'](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x4e4a02[_0x8a8a('0x54')]=_0x4e4a02[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x4e4a02[_0x8a8a('0x54')]:_0x2cb19e[_0x8a8a('0x44')];_0x4e4a02[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x4e4a02['where']=qs[_0x8a8a('0x52')](_['pick'](_0x515e99[_0x8a8a('0x50')],_0x2cb19e['filters']));if(_0x515e99['query'][_0x8a8a('0x5a')]){_0x4e4a02['where']=_['merge'](_0x4e4a02['where'],{'$or':_['map'](_0x4e4a02[_0x8a8a('0x54')],function(_0x3a1604){var _0x3e87d3={};_0x3e87d3[_0x3a1604]={'$like':'%'+_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x5a')]+'%'};return _0x3e87d3;})});}_0x4e4a02=_[_0x8a8a('0x5b')]({},_0x4e4a02,_0x515e99[_0x8a8a('0x5d')]);return _0x2e97f5[_0x8a8a('0x11a')](_0x4e4a02);}})[_0x8a8a('0x1c')](function(_0x9f342e){if(_0x9f342e){_0x1c0953=_0x9f342e[_0x8a8a('0x62')];if(!_0x515e99['query'][_0x8a8a('0x56')]('nolimit')){_0x4e4a02[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x2a')]);_0x4e4a02[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x515e99[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}return _0x2e97f5[_0x8a8a('0x11a')](_0x4e4a02);}})[_0x8a8a('0x1c')](function(_0x13fb20){if(_0x13fb20){return _0x13fb20?{'count':_0x1c0953,'rows':_0x13fb20}:null;}})['then'](respondWithResult(_0x49f317,null))['catch'](handleError(_0x49f317,null));};exports['addProactiveActions']=function(_0xda869f,_0x55931b){return db[_0x8a8a('0x11b')][_0x8a8a('0x63')]({'where':{'id':_0xda869f[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x55931b,null))[_0x8a8a('0x1c')](function(_0x591976){if(_0x591976){return _0x591976[_0x8a8a('0x11c')](_0xda869f['body'][_0x8a8a('0x79')],_['omit'](_0xda869f[_0x8a8a('0x65')],[_0x8a8a('0x79'),'id'])||{});}})[_0x8a8a('0x1c')](respondWithResult(_0x55931b,null))[_0x8a8a('0x25')](handleError(_0x55931b,null));};exports[_0x8a8a('0x101')]=function(_0x43bfeb,_0x2406f1){var _0x511fac={};var _0x3bef44={};var _0x5b4ca0;var _0x4cff06;return db['ChatWebsite']['findOne']({'where':{'id':_0x43bfeb['params']['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x2406f1,null))[_0x8a8a('0x1c')](function(_0x374b3f){if(_0x374b3f){_0x5b4ca0=_0x374b3f;_0x3bef44[_0x8a8a('0x44')]=_[_0x8a8a('0x51')](db[_0x8a8a('0x11d')][_0x8a8a('0x4d')]);_0x3bef44['query']=_['keys'](_0x43bfeb['query']);_0x3bef44[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x3bef44[_0x8a8a('0x44')],_0x3bef44[_0x8a8a('0x50')]);_0x511fac[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x3bef44['model'],qs[_0x8a8a('0x55')](_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x55')]));_0x511fac['attributes']=_0x511fac[_0x8a8a('0x54')][_0x8a8a('0x62')]?_0x511fac[_0x8a8a('0x54')]:_0x3bef44['model'];_0x511fac[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x511fac[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_[_0x8a8a('0x59')](_0x43bfeb[_0x8a8a('0x50')],_0x3bef44['filters']));if(_0x43bfeb['query'][_0x8a8a('0x5a')]){_0x511fac['where']=_['merge'](_0x511fac['where'],{'$or':_['map'](_0x511fac['attributes'],function(_0x5d28bb){var _0x55b0c2={};_0x55b0c2[_0x5d28bb]={'$like':'%'+_0x43bfeb[_0x8a8a('0x50')]['filter']+'%'};return _0x55b0c2;})});}_0x511fac=_[_0x8a8a('0x5b')]({},_0x511fac,_0x43bfeb[_0x8a8a('0x5d')]);return _0x5b4ca0[_0x8a8a('0x101')](_0x511fac);}})['then'](function(_0x433bd5){if(_0x433bd5){_0x4cff06=_0x433bd5[_0x8a8a('0x62')];if(!_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x56')]('nolimit')){_0x511fac['limit']=qs[_0x8a8a('0x2a')](_0x43bfeb[_0x8a8a('0x50')]['limit']);_0x511fac[_0x8a8a('0x2c')]=qs['offset'](_0x43bfeb[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}return _0x5b4ca0['getProactiveActions'](_0x511fac);}})[_0x8a8a('0x1c')](function(_0x51c902){if(_0x51c902){return _0x51c902?{'count':_0x4cff06,'rows':_0x51c902}:null;}})[_0x8a8a('0x1c')](respondWithResult(_0x2406f1,null))[_0x8a8a('0x25')](handleError(_0x2406f1,null));};exports[_0x8a8a('0x11e')]=function(_0x269483,_0x3f9d81){var _0x565d4f=_0x269483[_0x8a8a('0x50')][_0x8a8a('0x11f')]===_0x8a8a('0x120')?_0x8a8a('0x121'):_0x8a8a('0x122');return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'attributes':['id',_0x565d4f],'where':{'id':_0x269483[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3f9d81,null))['then'](function(_0x2810fc){if(_0x2810fc){var _0x3e8ddf=_0x2810fc[_0x565d4f];var _0x2eddb9=_0x3e8ddf&&_0x3e8ddf[_0x8a8a('0x123')]?_0x3e8ddf[_0x8a8a('0x123')]:[];_0x3f9d81[_0x8a8a('0xd3')]({'fromKey':_['isNil'](_0x3e8ddf[_0x8a8a('0x124')])?undefined:_0x3e8ddf[_0x8a8a('0x124')],'count':_0x2eddb9['length'],'rows':_0x2eddb9});}})[_0x8a8a('0x25')](handleError(_0x3f9d81,null));};exports[_0x8a8a('0x125')]=function(_0x2f5102,_0x51dc09){var _0x48676a={'raw':![],'where':{}};var _0x586205={};var _0x462121={'count':0x0,'rows':[]};return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x2f5102['params']['id']}})['then'](handleEntityNotFound(_0x51dc09,null))[_0x8a8a('0x1c')](function(_0x1b021a){if(_0x1b021a){_0x586205['model']=_[_0x8a8a('0x51')](db[_0x8a8a('0xdf')][_0x8a8a('0x4d')]);_0x586205[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x2f5102['query']);_0x586205['filters']=_['intersection'](_0x586205[_0x8a8a('0x44')],_0x586205['query']);_0x48676a[_0x8a8a('0x54')]=_[_0x8a8a('0x53')](_0x586205[_0x8a8a('0x44')],qs[_0x8a8a('0x55')](_0x2f5102[_0x8a8a('0x50')]['fields']));_0x48676a[_0x8a8a('0x54')]=_0x48676a[_0x8a8a('0x54')]['length']?_0x48676a[_0x8a8a('0x54')]:_0x586205[_0x8a8a('0x44')];if(!_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x56')](_0x8a8a('0x57'))){_0x48676a[_0x8a8a('0x2a')]=qs['limit'](_0x2f5102['query'][_0x8a8a('0x2a')]);_0x48676a[_0x8a8a('0x2c')]=qs['offset'](_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x2c')]);}_0x48676a[_0x8a8a('0x75')]=qs[_0x8a8a('0x76')](_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x76')]);_0x48676a[_0x8a8a('0x58')]=qs[_0x8a8a('0x52')](_['pick'](_0x2f5102['query'],_0x586205['filters']));_0x48676a[_0x8a8a('0x58')][_0x8a8a('0x73')]=_0x1b021a['id'];if(_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x5a')]){_0x48676a[_0x8a8a('0x58')]=_['merge'](_0x48676a[_0x8a8a('0x58')],{'$or':_[_0x8a8a('0x4b')](_0x48676a['attributes'],function(_0x43af89){var _0xc8998e={};_0xc8998e[_0x43af89]={'$like':'%'+_0x2f5102[_0x8a8a('0x50')][_0x8a8a('0x5a')]+'%'};return _0xc8998e;})});}_0x48676a=_[_0x8a8a('0x5b')]({},_0x48676a,_0x2f5102['options']);return db[_0x8a8a('0xdf')][_0x8a8a('0x2b')]({'where':_0x48676a[_0x8a8a('0x58')]})[_0x8a8a('0x1c')](function(_0x48901b){_0x462121[_0x8a8a('0x2b')]=_0x48901b;if(_0x2f5102['query'][_0x8a8a('0x5e')]){_0x48676a[_0x8a8a('0x77')]=[{'all':!![]}];}else{_0x48676a[_0x8a8a('0x77')]=[{'model':db[_0x8a8a('0xa1')],'as':_0x8a8a('0x126'),'required':![]},{'model':db['Attachment'],'as':_0x8a8a('0x127'),'required':![]}];}return db['ChatOfflineMessage'][_0x8a8a('0x7d')](_0x48676a);})['then'](function(_0x4b44b9){_0x462121[_0x8a8a('0x5f')]=_0x4b44b9;return _0x462121;});}})[_0x8a8a('0x1c')](respondWithFilteredResult(_0x51dc09,_0x48676a))[_0x8a8a('0x25')](handleError(_0x51dc09,null));};exports[_0x8a8a('0x128')]=function(_0x2d99d3,_0x1dff03){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x2d99d3[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x1dff03,null))[_0x8a8a('0x1c')](function(_0x4125a3){if(_0x4125a3){return _0x4125a3[_0x8a8a('0x128')](_0x2d99d3[_0x8a8a('0x65')][_0x8a8a('0x79')],_[_0x8a8a('0xfa')](_0x2d99d3[_0x8a8a('0x65')],[_0x8a8a('0x79'),'id'])||{})[_0x8a8a('0xda')](function(_0x4447dc){for(var _0x2d3f1c=0x0;_0x2d3f1c<_0x2d99d3[_0x8a8a('0x65')]['ids']['length'];_0x2d3f1c+=0x1){socket[_0x8a8a('0x129')](_0x8a8a('0x12a'),{'UserId':Number(_0x2d99d3[_0x8a8a('0x65')][_0x8a8a('0x79')][_0x2d3f1c]),'ChatWebsiteId':Number(_0x2d99d3['params']['id'])});}return _0x4447dc;});}})[_0x8a8a('0x1c')](respondWithResult(_0x1dff03,null))['catch'](handleError(_0x1dff03,null));};exports[_0x8a8a('0x12b')]=function(_0x3991e8,_0x1d221f){return db[_0x8a8a('0x4c')][_0x8a8a('0x63')]({'where':{'id':_0x3991e8[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x1d221f,null))[_0x8a8a('0x1c')](function(_0x11ae8d){if(_0x11ae8d){return _0x11ae8d[_0x8a8a('0x12b')](_0x3991e8[_0x8a8a('0x50')]['ids'])[_0x8a8a('0x1c')](function(){if(_[_0x8a8a('0x12c')](_0x3991e8['query'][_0x8a8a('0x79')])){for(var _0x4676bb=0x0;_0x4676bb<_0x3991e8['query'][_0x8a8a('0x79')][_0x8a8a('0x62')];_0x4676bb+=0x1){socket['emit'](_0x8a8a('0x12d'),{'UserId':Number(_0x3991e8[_0x8a8a('0x50')][_0x8a8a('0x79')][_0x4676bb]),'ChatWebsiteId':Number(_0x3991e8['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3991e8['query'][_0x8a8a('0x79')]),'ChatWebsiteId':Number(_0x3991e8[_0x8a8a('0x61')]['id'])});}});}})[_0x8a8a('0x1c')](respondWithStatusCode(_0x1d221f,null))[_0x8a8a('0x25')](handleError(_0x1d221f,null));};exports['getAgents']=function(_0x3fb3c0,_0x3b0476){var _0x37a540={};var _0x2cee68={};var _0x206127;var _0x21cd36;return db[_0x8a8a('0x4c')][_0x8a8a('0x7c')]({'where':{'id':_0x3fb3c0[_0x8a8a('0x61')]['id']}})[_0x8a8a('0x1c')](handleEntityNotFound(_0x3b0476,null))[_0x8a8a('0x1c')](function(_0xac535c){if(_0xac535c){_0x206127=_0xac535c;_0x2cee68[_0x8a8a('0x44')]=_[_0x8a8a('0x51')](db['User'][_0x8a8a('0x4d')]);_0x2cee68[_0x8a8a('0x50')]=_[_0x8a8a('0x51')](_0x3fb3c0[_0x8a8a('0x50')]);_0x2cee68[_0x8a8a('0x52')]=_[_0x8a8a('0x53')](_0x2cee68[_0x8a8a('0x44')],_0x2cee68[_0x8a8a('0x50')]);_0x37a540['attributes']=_[_0x8a8a('0x53')](_0x2cee68[_0x8a8a('0x44')],qs['fields'](_0x3fb3c0['query']['fields']));_0x37a540['attributes']=_0x37a540[_0x8a8a('0x54')]['length']?_0x37a540[_0x8a8a('0x54')]:_0x2cee68[_0x8a8a('0x44')];_0x37a540[_0x8a8a('0x75')]=qs['sort'](_0x3fb3c0[_0x8a8a('0x50')]['sort']);_0x37a540['where']=qs[_0x8a8a('0x52')](_['pick'](_0x3fb3c0[_0x8a8a('0x50')],_0x2cee68[_0x8a8a('0x52')]));if(_0x3fb3c0[_0x8a8a('0x50')]['filter']){_0x37a540['where']=_[_0x8a8a('0x5b')](_0x37a540[_0x8a8a('0x58')],{'$or':_['map'](_0x37a540[_0x8a8a('0x54')],function(_0x5c0bd5){var _0x33ca5d={};_0x33ca5d[_0x5c0bd5]={'$like':'%'+_0x3fb3c0[_0x8a8a('0x50')]['filter']+'%'};return _0x33ca5d;})});}_0x37a540=_['merge']({},_0x37a540,_0x3fb3c0[_0x8a8a('0x5d')]);return _0x206127[_0x8a8a('0x12e')](_0x37a540);}})[_0x8a8a('0x1c')](function(_0x2ee77d){if(_0x2ee77d){_0x21cd36=_0x2ee77d[_0x8a8a('0x62')];if(!_0x3fb3c0[_0x8a8a('0x50')][_0x8a8a('0x56')]('nolimit')){_0x37a540[_0x8a8a('0x2a')]=qs[_0x8a8a('0x2a')](_0x3fb3c0['query']['limit']);_0x37a540[_0x8a8a('0x2c')]=qs[_0x8a8a('0x2c')](_0x3fb3c0['query'][_0x8a8a('0x2c')]);}return _0x206127[_0x8a8a('0x12e')](_0x37a540);}})['then'](function(_0x1bd6a8){if(_0x1bd6a8){return _0x1bd6a8?{'count':_0x21cd36,'rows':_0x1bd6a8}:null;}})['then'](respondWithResult(_0x3b0476,null))[_0x8a8a('0x25')](handleError(_0x3b0476,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index c3ba9c5..b3305c7 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 _0xc252=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x4eacbb,_0x1bc3d1){var _0x549393=function(_0x1ebfc0){while(--_0x1ebfc0){_0x4eacbb['push'](_0x4eacbb['shift']());}};_0x549393(++_0x1bc3d1);}(_0xc252,0x118));var _0x2c25=function(_0x42ef26,_0x21a04b){_0x42ef26=_0x42ef26-0x0;var _0x4f61c2=_0xc252[_0x42ef26];return _0x4f61c2;};'use strict';var EventEmitter=require(_0x2c25('0x0'));var ChatWebsite=require(_0x2c25('0x1'))['db'][_0x2c25('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2c25('0x3')](0x0);var events={'afterCreate':_0x2c25('0x4'),'afterUpdate':_0x2c25('0x5'),'afterDestroy':_0x2c25('0x6')};function emitEvent(_0xd6718e){return function(_0x5815ad,_0x5e2a2a,_0x244f8c){ChatWebsiteEvents['emit'](_0xd6718e+':'+_0x5815ad['id'],_0x5815ad);ChatWebsiteEvents[_0x2c25('0x7')](_0xd6718e,_0x5815ad);_0x244f8c(null);};}for(var e in events){if(events[_0x2c25('0x8')](e)){var event=events[e];ChatWebsite[_0x2c25('0x9')](e,emitEvent(event));}}module[_0x2c25('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc43c=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3b545c,_0x491912){var _0xc9eb90=function(_0x35aeec){while(--_0x35aeec){_0x3b545c['push'](_0x3b545c['shift']());}};_0xc9eb90(++_0x491912);}(_0xc43c,0x152));var _0xcc43=function(_0x44d357,_0x5d25fa){_0x44d357=_0x44d357-0x0;var _0x564514=_0xc43c[_0x44d357];return _0x564514;};'use strict';var EventEmitter=require(_0xcc43('0x0'));var ChatWebsite=require(_0xcc43('0x1'))['db'][_0xcc43('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcc43('0x3')](0x0);var events={'afterCreate':_0xcc43('0x4'),'afterUpdate':_0xcc43('0x5'),'afterDestroy':'remove'};function emitEvent(_0x162a11){return function(_0x258c7e,_0x5c21a3,_0x1b589f){ChatWebsiteEvents[_0xcc43('0x6')](_0x162a11+':'+_0x258c7e['id'],_0x258c7e);ChatWebsiteEvents[_0xcc43('0x6')](_0x162a11,_0x258c7e);_0x1b589f(null);};}for(var e in events){if(events[_0xcc43('0x7')](e)){var event=events[e];ChatWebsite[_0xcc43('0x8')](e,emitEvent(event));}}module[_0xcc43('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index bb4cd64..3961379 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 _0x459e=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x459e,0x18c));var _0xe459=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x459e[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xe459('0x0'));var util=require(_0xe459('0x1'));var logger=require('../../config/logger')(_0xe459('0x2'));var moment=require(_0xe459('0x3'));var BPromise=require('bluebird');var rp=require(_0xe459('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe459('0x5'));var config=require(_0xe459('0x6'));var attributes=require(_0xe459('0x7'));module[_0xe459('0x8')]=function(_0x21bc20,_0x9a1631){return _0x21bc20[_0xe459('0x9')](_0xe459('0xa'),attributes,{'tableName':_0xe459('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85fb=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x112db5,_0x38a06d){var _0x1d7d06=function(_0x44571e){while(--_0x44571e){_0x112db5['push'](_0x112db5['shift']());}};_0x1d7d06(++_0x38a06d);}(_0x85fb,0x6a));var _0xb85f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x85fb[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xb85f('0x0'));var util=require(_0xb85f('0x1'));var logger=require(_0xb85f('0x2'))(_0xb85f('0x3'));var moment=require(_0xb85f('0x4'));var BPromise=require('bluebird');var rp=require(_0xb85f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb85f('0x6'));var config=require(_0xb85f('0x7'));var attributes=require(_0xb85f('0x8'));module['exports']=function(_0x447109,_0x2f2e6f){return _0x447109[_0xb85f('0x9')](_0xb85f('0xa'),attributes,{'tableName':_0xb85f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 5480788..c40f1d1 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 _0xe6a1=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x144b2b,_0x2a0b0f){var _0x599c5a=function(_0x1da07a){while(--_0x1da07a){_0x144b2b['push'](_0x144b2b['shift']());}};_0x599c5a(++_0x2a0b0f);}(_0xe6a1,0x153));var _0x1e6a=function(_0x16171c,_0x223d97){_0x16171c=_0x16171c-0x0;var _0x3d37c0=_0xe6a1[_0x16171c];return _0x3d37c0;};'use strict';var _=require(_0x1e6a('0x0'));var util=require(_0x1e6a('0x1'));var moment=require('moment');var BPromise=require(_0x1e6a('0x2'));var rs=require(_0x1e6a('0x3'));var fs=require('fs');var Redis=require(_0x1e6a('0x4'));var db=require(_0x1e6a('0x5'))['db'];var utils=require(_0x1e6a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1e6a('0x7'));var jayson=require(_0x1e6a('0x8'));var client=jayson[_0x1e6a('0x9')][_0x1e6a('0xa')]({'port':0x232a});config[_0x1e6a('0xb')]=_[_0x1e6a('0xc')](config[_0x1e6a('0xb')],{'host':_0x1e6a('0xd'),'port':0x18eb});var socket=require(_0x1e6a('0xe'))(new Redis(config[_0x1e6a('0xb')]));require(_0x1e6a('0xf'))['register'](socket);function respondWithRpcPromise(_0x3780d2,_0x486d3f,_0x31bb19){return new BPromise(function(_0x1084ec,_0x2bc7c7){return client['request'](_0x3780d2,_0x31bb19)[_0x1e6a('0x10')](function(_0x976310){logger[_0x1e6a('0x11')](_0x1e6a('0x12'),_0x486d3f,_0x1e6a('0x13'));logger[_0x1e6a('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x486d3f,_0x1e6a('0x13'),JSON[_0x1e6a('0x15')](_0x976310));if(_0x976310[_0x1e6a('0x16')]){if(_0x976310[_0x1e6a('0x16')][_0x1e6a('0x17')]===0x1f4){logger[_0x1e6a('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x486d3f,_0x976310[_0x1e6a('0x16')][_0x1e6a('0x18')]);return _0x2bc7c7(_0x976310[_0x1e6a('0x16')][_0x1e6a('0x18')]);}logger[_0x1e6a('0x16')](_0x1e6a('0x12'),_0x486d3f,_0x976310[_0x1e6a('0x16')][_0x1e6a('0x18')]);return _0x1084ec(_0x976310['error'][_0x1e6a('0x18')]);}else{logger['info'](_0x1e6a('0x12'),_0x486d3f,'request\x20sent');_0x1084ec(_0x976310[_0x1e6a('0x19')][_0x1e6a('0x18')]);}})['catch'](function(_0x42b96a){logger[_0x1e6a('0x16')](_0x1e6a('0x12'),_0x486d3f,_0x42b96a);_0x2bc7c7(_0x42b96a);});});}
\ No newline at end of file
+var _0x9791=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','localhost','redis','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9791,0x1ac));var _0x1979=function(_0x3c687b,_0x83ea4){_0x3c687b=_0x3c687b-0x0;var _0x20dfa5=_0x9791[_0x3c687b];return _0x20dfa5;};'use strict';var _=require(_0x1979('0x0'));var util=require(_0x1979('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1979('0x2'));var fs=require('fs');var Redis=require(_0x1979('0x3'));var db=require(_0x1979('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1979('0x5'))(_0x1979('0x6'));var config=require('../../config/environment');var jayson=require(_0x1979('0x7'));var client=jayson[_0x1979('0x8')]['http']({'port':0x232a});config['redis']=_[_0x1979('0x9')](config['redis'],{'host':_0x1979('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1979('0xb')]));require(_0x1979('0xc'))[_0x1979('0xd')](socket);function respondWithRpcPromise(_0x5885f8,_0x37d8c9,_0x16789d){return new BPromise(function(_0xc944c2,_0x495a39){return client[_0x1979('0xe')](_0x5885f8,_0x16789d)[_0x1979('0xf')](function(_0x4af758){logger[_0x1979('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x37d8c9,_0x1979('0x11'));logger[_0x1979('0x12')](_0x1979('0x13'),_0x37d8c9,_0x1979('0x11'),JSON[_0x1979('0x14')](_0x4af758));if(_0x4af758[_0x1979('0x15')]){if(_0x4af758[_0x1979('0x15')][_0x1979('0x16')]===0x1f4){logger['error'](_0x1979('0x17'),_0x37d8c9,_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);return _0x495a39(_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);}logger[_0x1979('0x15')](_0x1979('0x17'),_0x37d8c9,_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);return _0xc944c2(_0x4af758[_0x1979('0x15')][_0x1979('0x18')]);}else{logger[_0x1979('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x37d8c9,'request\x20sent');_0xc944c2(_0x4af758[_0x1979('0x19')]['message']);}})[_0x1979('0x1a')](function(_0x20eac8){logger[_0x1979('0x15')](_0x1979('0x17'),_0x37d8c9,_0x20eac8);_0x495a39(_0x20eac8);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index eccf3ad..5021535 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 _0x1c8c=['./chatWebsite.events','save','update','emit','removeListener','chatWebsite:'];(function(_0x46a509,_0x44fa7d){var _0x23832f=function(_0x45d7b3){while(--_0x45d7b3){_0x46a509['push'](_0x46a509['shift']());}};_0x23832f(++_0x44fa7d);}(_0x1c8c,0x180));var _0xc1c8=function(_0x2f1ab5,_0x2966be){_0x2f1ab5=_0x2f1ab5-0x0;var _0x5c7e72=_0x1c8c[_0x2f1ab5];return _0x5c7e72;};'use strict';var ChatWebsiteEvents=require(_0xc1c8('0x0'));var events=[_0xc1c8('0x1'),'remove',_0xc1c8('0x2')];function createListener(_0xcdd249,_0x2f84ce){return function(_0x4eb446){_0x2f84ce[_0xc1c8('0x3')](_0xcdd249,_0x4eb446);};}function removeListener(_0x2820b1,_0x3bdb13){return function(){ChatWebsiteEvents[_0xc1c8('0x4')](_0x2820b1,_0x3bdb13);};}exports['register']=function(_0xb8c6d3){for(var _0x7d174d=0x0,_0xb13b89=events['length'];_0x7d174d<_0xb13b89;_0x7d174d++){var _0x2ec599=events[_0x7d174d];var _0x4d21a9=createListener(_0xc1c8('0x5')+_0x2ec599,_0xb8c6d3);ChatWebsiteEvents['on'](_0x2ec599,_0x4d21a9);}};
\ No newline at end of file
+var _0x3ea2=['length','./chatWebsite.events','update','emit','removeListener','register'];(function(_0x5c5953,_0x44bf4a){var _0x13a1a4=function(_0x593948){while(--_0x593948){_0x5c5953['push'](_0x5c5953['shift']());}};_0x13a1a4(++_0x44bf4a);}(_0x3ea2,0x121));var _0x23ea=function(_0x2035ef,_0x3f7d39){_0x2035ef=_0x2035ef-0x0;var _0x86c909=_0x3ea2[_0x2035ef];return _0x86c909;};'use strict';var ChatWebsiteEvents=require(_0x23ea('0x0'));var events=['save','remove',_0x23ea('0x1')];function createListener(_0x4f5c40,_0x4a7a67){return function(_0x53082c){_0x4a7a67[_0x23ea('0x2')](_0x4f5c40,_0x53082c);};}function removeListener(_0x2dee7d,_0x378570){return function(){ChatWebsiteEvents[_0x23ea('0x3')](_0x2dee7d,_0x378570);};}exports[_0x23ea('0x4')]=function(_0x24d6f4){for(var _0x298590=0x0,_0xab2159=events[_0x23ea('0x5')];_0x298590<_0xab2159;_0x298590++){var _0x5babfb=events[_0x298590];var _0x4a2a80=createListener('chatWebsite:'+_0x5babfb,_0x24d6f4);ChatWebsiteEvents['on'](_0x5babfb,_0x4a2a80);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index f8eb6c8..51b6742 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x110f=['../../../utils/misc','escapeRegExp','localhost','test','replace','([\x5cw]+)'];(function(_0x293978,_0x5868cb){var _0x45b1e5=function(_0x5b6cdf){while(--_0x5b6cdf){_0x293978['push'](_0x293978['shift']());}};_0x45b1e5(++_0x5868cb);}(_0x110f,0x1e6));var _0xf110=function(_0x129bd0,_0x1f026d){_0x129bd0=_0x129bd0-0x0;var _0x5d6fcb=_0x110f[_0x129bd0];return _0x5d6fcb;};var escapeRegExp=require(_0xf110('0x0'))[_0xf110('0x1')];var URL=require('url')['URL'];function testWildcardValidity(_0x51c98c){var _0x41dd25=!![];try{new URL(_0x51c98c['replace']('*',_0xf110('0x2')));}catch(_0x3f60d0){_0x41dd25=![];}return _0x41dd25&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xf110('0x3')](_0x51c98c);}function testWebsiteWithWildcard(_0x593f50,_0x2f4a0f){var _0x3147fd;var _0xc27675=escapeRegExp(_0x593f50['trim']()[_0xf110('0x4')](/\/$/,''))[_0xf110('0x4')]('\x5c*',_0xf110('0x5'));try{new URL(_0x593f50['replace']('\x5c*',_0xf110('0x2')));_0x3147fd=new RegExp(_0xc27675)[_0xf110('0x3')](_0x2f4a0f);}catch(_0x11c28f){_0x3147fd=![];}return _0x3147fd;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0x0650=['localhost','test','replace','([\x5cw]+)','exports','../../../utils/misc','url','URL'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x0650,0xed));var _0x0065=function(_0x4f3e5a,_0x1ee150){_0x4f3e5a=_0x4f3e5a-0x0;var _0x452880=_0x0650[_0x4f3e5a];return _0x452880;};var escapeRegExp=require(_0x0065('0x0'))['escapeRegExp'];var URL=require(_0x0065('0x1'))[_0x0065('0x2')];function testWildcardValidity(_0x5e6e6c){var _0x16f9eb=!![];try{new URL(_0x5e6e6c['replace']('*',_0x0065('0x3')));}catch(_0x8260ba){_0x16f9eb=![];}return _0x16f9eb&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x0065('0x4')](_0x5e6e6c);}function testWebsiteWithWildcard(_0x4b15b1,_0xdf9084){var _0x507ed3;var _0x5cf16e=escapeRegExp(_0x4b15b1['trim']()[_0x0065('0x5')](/\/$/,''))[_0x0065('0x5')]('\x5c*',_0x0065('0x6'));try{new URL(_0x4b15b1[_0x0065('0x5')]('\x5c*',_0x0065('0x3')));_0x507ed3=new RegExp(_0x5cf16e)[_0x0065('0x4')](_0xdf9084);}catch(_0x8974f){_0x507ed3=![];}return _0x507ed3;}module[_0x0065('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 5d1a50e..690c999 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 _0x0e2b=['create','/:id/dispositions','addDisposition','post','addAnswer','diskStorage','join','root','format','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents'];(function(_0x665846,_0x5503d8){var _0x16c349=function(_0x2b34a9){while(--_0x2b34a9){_0x665846['push'](_0x665846['shift']());}};_0x16c349(++_0x5503d8);}(_0x0e2b,0xc4));var _0xb0e2=function(_0x201b69,_0x4a9b92){_0x201b69=_0x201b69-0x0;var _0x5a0c53=_0x0e2b[_0x201b69];return _0x5a0c53;};'use strict';var multer=require(_0xb0e2('0x0'));var util=require('util');var path=require(_0xb0e2('0x1'));var timeout=require(_0xb0e2('0x2'));var express=require(_0xb0e2('0x3'));var router=express[_0xb0e2('0x4')]();var fs_extra=require(_0xb0e2('0x5'));var auth=require(_0xb0e2('0x6'));var interaction=require(_0xb0e2('0x7'));var config=require('../../config/environment');var controller=require(_0xb0e2('0x8'));router[_0xb0e2('0x9')]('/',auth[_0xb0e2('0xa')](),controller[_0xb0e2('0xb')]);router['get'](_0xb0e2('0xc'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0xd')]);router[_0xb0e2('0x9')](_0xb0e2('0xe'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0xf')]);router[_0xb0e2('0x9')]('/:id/dispositions',auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x10')]);router[_0xb0e2('0x9')](_0xb0e2('0x11'),auth[_0xb0e2('0xa')](),controller['getAnswers']);router[_0xb0e2('0x9')](_0xb0e2('0x12'),controller[_0xb0e2('0x13')]);router[_0xb0e2('0x9')](_0xb0e2('0x14'),controller[_0xb0e2('0x15')]);router[_0xb0e2('0x9')](_0xb0e2('0x16'),controller[_0xb0e2('0x17')]);router[_0xb0e2('0x9')](_0xb0e2('0x18'),controller[_0xb0e2('0x19')]);router[_0xb0e2('0x9')](_0xb0e2('0x1a'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xb0e2('0x9')](_0xb0e2('0x1b'),controller[_0xb0e2('0x1c')]);router[_0xb0e2('0x9')]('/:id/applications',auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x1d')]);router[_0xb0e2('0x9')](_0xb0e2('0x1e'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x1f')]);router[_0xb0e2('0x9')](_0xb0e2('0x20'),controller[_0xb0e2('0x21')]);router['get'](_0xb0e2('0x22'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x23')]);router[_0xb0e2('0x9')](_0xb0e2('0x24'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x25')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0e2('0x26')]);router['post'](_0xb0e2('0x27'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x28')]);router[_0xb0e2('0x29')](_0xb0e2('0x11'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x2a')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0x38e4c5,_0x5a68c1,_0x1dc759){_0x1dc759(null,path[_0xb0e2('0x2c')](config[_0xb0e2('0x2d')],'server/files/images/logos/'));},'filename':function(_0x4b565c,_0x23b24f,_0x30c307){_0x30c307(null,util[_0xb0e2('0x2e')]('%s-%s',Date['now'](),_0x23b24f[_0xb0e2('0x2f')]));}})});router[_0xb0e2('0x29')](_0xb0e2('0x12'),upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x32')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0x4db140,_0x5a941a,_0x2bc536){_0x2bc536(null,path[_0xb0e2('0x2c')](config[_0xb0e2('0x2d')],_0xb0e2('0x33')));},'filename':function(_0x43ee2e,_0x3f415a,_0x93df85){_0x93df85(null,util[_0xb0e2('0x2e')](_0xb0e2('0x34'),Date['now'](),_0x3f415a['originalname']));}})});router[_0xb0e2('0x29')](_0xb0e2('0x14'),upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x35')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0x4d0ac1,_0x4a9699,_0x4b7b2c){_0x4b7b2c(null,path[_0xb0e2('0x2c')](config['root'],_0xb0e2('0x33')));},'filename':function(_0x8c1b31,_0x4469e4,_0x1db9d8){_0x1db9d8(null,util[_0xb0e2('0x2e')](_0xb0e2('0x34'),Date[_0xb0e2('0x36')](),_0x4469e4[_0xb0e2('0x2f')]));}})});router['post']('/:id/customer_avatar',upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x37')]);var upload=multer({'storage':multer[_0xb0e2('0x2b')]({'destination':function(_0xe485e0,_0x175618,_0x4b1634){_0x4b1634(null,path[_0xb0e2('0x2c')](config[_0xb0e2('0x2d')],_0xb0e2('0x33')));},'filename':function(_0xf113d9,_0x3c1c66,_0x754298){_0x754298(null,util[_0xb0e2('0x2e')](_0xb0e2('0x34'),Date[_0xb0e2('0x36')](),_0x3c1c66[_0xb0e2('0x2f')]));}})});router['post'](_0xb0e2('0x18'),upload[_0xb0e2('0x30')](_0xb0e2('0x31')),controller[_0xb0e2('0x38')]);router['post'](_0xb0e2('0x39'),controller[_0xb0e2('0x3a')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x572e7e,_0x47a873,_0x2987d1){const _0x59f58c=path['join'](config['root'],_0xb0e2('0x3b'),_0xb0e2('0x3c'),_0xb0e2('0x3d'));fs_extra['ensureDir'](_0x59f58c,function(){_0x2987d1(null,_0x59f58c);});},'filename':function(_0x3ccd07,_0xd8b1d7,_0x269e47){const _0x1d4511=_0xd8b1d7['originalname'][_0xb0e2('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xdcb853=path[_0xb0e2('0x3f')](_0x1d4511);const _0x264111=Date['now']()+'-'+_0x1d4511[_0xb0e2('0x3e')](_0xdcb853,'')+_0xdcb853;_0x269e47(null,_0x264111);}})});router[_0xb0e2('0x29')](_0xb0e2('0x40'),offlineUploadMulter[_0xb0e2('0x41')](),controller[_0xb0e2('0x42')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0xb0e2('0x43')]);router[_0xb0e2('0x29')](_0xb0e2('0x44'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x45')]);router[_0xb0e2('0x29')](_0xb0e2('0x1e'),auth['isAuthenticated'](),controller[_0xb0e2('0x46')]);router[_0xb0e2('0x29')](_0xb0e2('0x24'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x47')]);router[_0xb0e2('0x48')](_0xb0e2('0xe'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x49')]);router[_0xb0e2('0x4a')](_0xb0e2('0xe'),auth['isAuthenticated'](),controller[_0xb0e2('0x4b')]);router[_0xb0e2('0x4a')](_0xb0e2('0x27'),auth['isAuthenticated'](),controller[_0xb0e2('0x4c')]);router[_0xb0e2('0x4a')](_0xb0e2('0x11'),auth[_0xb0e2('0xa')](),controller[_0xb0e2('0x4d')]);router['delete'](_0xb0e2('0x24'),auth[_0xb0e2('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x19db=['/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','post','addDisposition','addAnswer','root','server/files/images/logos/','format','%s-%s','now','originalname','file','diskStorage','join','server/files/images/avatars/','single','/:id/customer_avatar','/:id/notify','attachments','ensureDir','extname','replace','/:id/offline','addInteraction','addProactiveActions'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x19db,0x196));var _0xb19d=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x19db[_0x2fb87c];return _0x43038b;};'use strict';var multer=require(_0xb19d('0x0'));var util=require(_0xb19d('0x1'));var path=require(_0xb19d('0x2'));var timeout=require(_0xb19d('0x3'));var express=require(_0xb19d('0x4'));var router=express['Router']();var fs_extra=require(_0xb19d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb19d('0x6'));var controller=require(_0xb19d('0x7'));router[_0xb19d('0x8')]('/',auth[_0xb19d('0x9')](),controller[_0xb19d('0xa')]);router[_0xb19d('0x8')]('/describe',auth[_0xb19d('0x9')](),controller[_0xb19d('0xb')]);router[_0xb19d('0x8')](_0xb19d('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb19d('0xd'),auth[_0xb19d('0x9')](),controller[_0xb19d('0xe')]);router[_0xb19d('0x8')](_0xb19d('0xf'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x10')]);router[_0xb19d('0x8')](_0xb19d('0x11'),controller[_0xb19d('0x12')]);router[_0xb19d('0x8')](_0xb19d('0x13'),controller['getAvatar']);router[_0xb19d('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xb19d('0x8')](_0xb19d('0x14'),controller[_0xb19d('0x15')]);router[_0xb19d('0x8')](_0xb19d('0x16'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x17')]);router[_0xb19d('0x8')]('/:id/snippet',controller['getSnippet']);router['get'](_0xb19d('0x18'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x19')]);router[_0xb19d('0x8')](_0xb19d('0x1a'),auth['isAuthenticated'](),controller[_0xb19d('0x1b')]);router[_0xb19d('0x8')]('/:id/fields',controller[_0xb19d('0x1c')]);router[_0xb19d('0x8')](_0xb19d('0x1d'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x1e')]);router[_0xb19d('0x8')]('/:id/users',auth[_0xb19d('0x9')](),controller[_0xb19d('0x1f')]);router['post']('/',auth[_0xb19d('0x9')](),controller[_0xb19d('0x20')]);router[_0xb19d('0x21')]('/:id/dispositions',auth[_0xb19d('0x9')](),controller[_0xb19d('0x22')]);router[_0xb19d('0x21')]('/:id/canned_answers',auth[_0xb19d('0x9')](),controller[_0xb19d('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37415e,_0x5a7765,_0x3aa77d){_0x3aa77d(null,path['join'](config[_0xb19d('0x24')],_0xb19d('0x25')));},'filename':function(_0x48e33f,_0x254671,_0x4a25e4){_0x4a25e4(null,util[_0xb19d('0x26')](_0xb19d('0x27'),Date[_0xb19d('0x28')](),_0x254671[_0xb19d('0x29')]));}})});router['post'](_0xb19d('0x11'),upload['single'](_0xb19d('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0xb19d('0x2b')]({'destination':function(_0x39b118,_0x2a79f6,_0x59010a){_0x59010a(null,path[_0xb19d('0x2c')](config['root'],_0xb19d('0x2d')));},'filename':function(_0x312e9a,_0x4a1ad4,_0x82bfa7){_0x82bfa7(null,util[_0xb19d('0x26')]('%s-%s',Date[_0xb19d('0x28')](),_0x4a1ad4[_0xb19d('0x29')]));}})});router[_0xb19d('0x21')]('/:id/avatar',upload[_0xb19d('0x2e')](_0xb19d('0x2a')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28d32a,_0x298238,_0x21fe16){_0x21fe16(null,path[_0xb19d('0x2c')](config[_0xb19d('0x24')],_0xb19d('0x2d')));},'filename':function(_0x51c400,_0x4b3ee6,_0x204ba9){_0x204ba9(null,util[_0xb19d('0x26')](_0xb19d('0x27'),Date['now'](),_0x4b3ee6[_0xb19d('0x29')]));}})});router[_0xb19d('0x21')](_0xb19d('0x2f'),upload[_0xb19d('0x2e')](_0xb19d('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xb19d('0x2b')]({'destination':function(_0x458279,_0xb611b7,_0x357c5c){_0x357c5c(null,path['join'](config[_0xb19d('0x24')],_0xb19d('0x2d')));},'filename':function(_0x1eb73e,_0x36e221,_0x4dbbde){_0x4dbbde(null,util[_0xb19d('0x26')](_0xb19d('0x27'),Date[_0xb19d('0x28')](),_0x36e221[_0xb19d('0x29')]));}})});router[_0xb19d('0x21')](_0xb19d('0x14'),upload[_0xb19d('0x2e')]('file'),controller['addSystemAvatar']);router['post'](_0xb19d('0x30'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x13f727,_0x38eb02,_0xb95950){const _0x1fe7c2=path[_0xb19d('0x2c')](config[_0xb19d('0x24')],'server/files',_0xb19d('0x31'),'offline-chat');fs_extra[_0xb19d('0x32')](_0x1fe7c2,function(){_0xb95950(null,_0x1fe7c2);});},'filename':function(_0x3b26ba,_0x25d374,_0x54de63){const _0xb647e1=_0x25d374['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15ca2c=path[_0xb19d('0x33')](_0xb647e1);const _0x153bc4=Date['now']()+'-'+_0xb647e1[_0xb19d('0x34')](_0x15ca2c,'')+_0x15ca2c;_0x54de63(null,_0x153bc4);}})});router['post'](_0xb19d('0x35'),offlineUploadMulter['any'](),controller['offline']);router[_0xb19d('0x21')](_0xb19d('0x16'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x36')]);router['post']('/:id/applications',auth[_0xb19d('0x9')](),controller['addApplications']);router[_0xb19d('0x21')](_0xb19d('0x1a'),auth['isAuthenticated'](),controller[_0xb19d('0x37')]);router[_0xb19d('0x21')](_0xb19d('0x38'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x39')]);router[_0xb19d('0x3a')]('/:id',auth[_0xb19d('0x9')](),controller[_0xb19d('0x3b')]);router[_0xb19d('0x3c')](_0xb19d('0xc'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x3d')]);router['delete'](_0xb19d('0xd'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x3e')]);router[_0xb19d('0x3c')](_0xb19d('0xf'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x3f')]);router[_0xb19d('0x3c')](_0xb19d('0x38'),auth[_0xb19d('0x9')](),controller[_0xb19d('0x40')]);module[_0xb19d('0x41')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index a51f0c2..7429f13 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 _0x8a0a=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','get'];(function(_0xee99a8,_0x1312c0){var _0x374681=function(_0x35a7c9){while(--_0x35a7c9){_0xee99a8['push'](_0xee99a8['shift']());}};_0x374681(++_0x1312c0);}(_0x8a0a,0xb3));var _0xa8a0=function(_0x27fca1,_0x40af1d){_0x27fca1=_0x27fca1-0x0;var _0x2f6dfa=_0x8a0a[_0x27fca1];return _0x2f6dfa;};var beaverLogger=require(_0xa8a0('0x0'));var express=require(_0xa8a0('0x1'));var auth=require(_0xa8a0('0x2'));var config=require(_0xa8a0('0x3'));var router=express['Router']();var isProduction=config[_0xa8a0('0x4')]===_0xa8a0('0x5')||![];function clientSideLogs(_0x12045b,_0x56a71f,_0x4e9f0e){var _0x4d3f67=_0x12045b[_0xa8a0('0x6')][_0xa8a0('0x7')]('client-side-logger');if(!_0x4d3f67){throw new Error(_0xa8a0('0x8'));}return beaverLogger[_0xa8a0('0x9')]({'uri':_0xa8a0('0xa'),'logger':_0x4d3f67,'enableCors':!isProduction})(_0x12045b,_0x56a71f,_0x4e9f0e);}router['use'](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x203d=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','Router','env','app','get'];(function(_0x23e314,_0x2ba525){var _0x3c1bf4=function(_0x7ec1b4){while(--_0x7ec1b4){_0x23e314['push'](_0x23e314['shift']());}};_0x3c1bf4(++_0x2ba525);}(_0x203d,0x66));var _0xd203=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x203d[_0xdea41a];return _0x15d0d8;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd203('0x0'));var auth=require(_0xd203('0x1'));var config=require('../config/environment');var router=express[_0xd203('0x2')]();var isProduction=config[_0xd203('0x3')]==='production'||![];function clientSideLogs(_0x1b0785,_0x3766ac,_0x264de3){var _0x532383=_0x1b0785[_0xd203('0x4')][_0xd203('0x5')]('client-side-logger');if(!_0x532383){throw new Error(_0xd203('0x6'));}return beaverLogger[_0xd203('0x7')]({'uri':_0xd203('0x8'),'logger':_0x532383,'enableCors':!isProduction})(_0x1b0785,_0x3766ac,_0x264de3);}router[_0xd203('0x9')](auth[_0xd203('0xa')](),clientSideLogs);module[_0xd203('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 9e7ef79..1eaf327 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 _0xd1ba=['ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure'];(function(_0x4e204d,_0x7d3f57){var _0x206e69=function(_0x10056c){while(--_0x10056c){_0x4e204d['push'](_0x4e204d['shift']());}};_0x206e69(++_0x7d3f57);}(_0xd1ba,0x12f));var _0xad1b=function(_0x482c10,_0x16ea3c){_0x482c10=_0x482c10-0x0;var _0x313969=_0xd1ba[_0x482c10];return _0x313969;};'use strict';var Sequelize=require(_0xad1b('0x0'));module[_0xad1b('0x1')]={'name':{'type':Sequelize[_0xad1b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0xad1b('0x3'),_0xad1b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad1b('0x5')](_0xad1b('0x6'),_0xad1b('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0xad1b('0x8')},'data3':{'type':Sequelize[_0xad1b('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xad1b('0x2')],'comment':_0xad1b('0x9')},'data5':{'type':Sequelize[_0xad1b('0xa')],'comment':_0xad1b('0xb')},'data6':{'type':Sequelize[_0xad1b('0xa')],'comment':_0xad1b('0xc')},'data7':{'type':Sequelize[_0xad1b('0xa')],'comment':_0xad1b('0xd')}};
\ No newline at end of file
+var _0x7554=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x34d8a1,_0x4e9d8f){var _0x11b1ce=function(_0x4ac29e){while(--_0x4ac29e){_0x34d8a1['push'](_0x34d8a1['shift']());}};_0x11b1ce(++_0x4e9d8f);}(_0x7554,0x1a5));var _0x4755=function(_0x1cd762,_0x223478){_0x1cd762=_0x1cd762-0x0;var _0x45128a=_0x7554[_0x1cd762];return _0x45128a;};'use strict';var Sequelize=require(_0x4755('0x0'));module[_0x4755('0x1')]={'name':{'type':Sequelize[_0x4755('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4755('0x3')]('AmazonAWS','Google',_0x4755('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4755('0x3')](_0x4755('0x5'),_0x4755('0x6'))},'data1':{'type':Sequelize[_0x4755('0x2')],'comment':_0x4755('0x7')},'data2':{'type':Sequelize[_0x4755('0x2')],'comment':_0x4755('0x8')},'data3':{'type':Sequelize[_0x4755('0x2')],'comment':_0x4755('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x4755('0xa')},'data5':{'type':Sequelize[_0x4755('0xb')],'comment':_0x4755('0xc')},'data6':{'type':Sequelize[_0x4755('0xb')],'comment':_0x4755('0xd')},'data7':{'type':Sequelize[_0x4755('0xb')],'comment':_0x4755('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e9cb126..660f1c9 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 _0x4d59=['offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','intersection','includeAll','include','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','find','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','defaults','socket.io-emitter','redis','sendStatus','status','end','json'];(function(_0x244138,_0x54d0c6){var _0x58b2a4=function(_0x3ca521){while(--_0x3ca521){_0x244138['push'](_0x244138['shift']());}};_0x58b2a4(++_0x54d0c6);}(_0x4d59,0x115));var _0x94d5=function(_0x2f991f,_0x10ec62){_0x2f991f=_0x2f991f-0x0;var _0xa0a9cc=_0x4d59[_0x2f991f];return _0xa0a9cc;};'use strict';var _=require(_0x94d5('0x0'));var Redis=require(_0x94d5('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x94d5('0x2'));var config=require(_0x94d5('0x3'));var logger=require(_0x94d5('0x4'))(_0x94d5('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x94d5('0x6'));config['redis']=_[_0x94d5('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x94d5('0x8'))(new Redis(config[_0x94d5('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4b2520,_0x3f7f84){_0x3f7f84=_0x3f7f84||0xcc;return function(_0x32a544){if(_0x32a544){return _0x4b2520[_0x94d5('0xa')](_0x3f7f84);}return _0x4b2520[_0x94d5('0xb')](_0x3f7f84)[_0x94d5('0xc')]();};}function respondWithResult(_0x2675c3,_0x3c1799){_0x3c1799=_0x3c1799||0xc8;return function(_0x467a54){if(_0x467a54){return _0x2675c3[_0x94d5('0xb')](_0x3c1799)[_0x94d5('0xd')](_0x467a54);}};}function respondWithFilteredResult(_0x585aae,_0x4eca64){return function(_0x3d974a){if(_0x3d974a){var _0x31a42d=typeof _0x4eca64[_0x94d5('0xe')]===_0x94d5('0xf')&&typeof _0x4eca64[_0x94d5('0x10')]===_0x94d5('0xf');var _0x445750=_0x3d974a[_0x94d5('0x11')];var _0x2f5389=_0x31a42d?0x0:_0x4eca64[_0x94d5('0xe')];var _0x277b9b=_0x31a42d?_0x3d974a[_0x94d5('0x11')]:_0x4eca64['offset']+_0x4eca64[_0x94d5('0x10')];var _0xf1a9bd;if(_0x277b9b>=_0x445750){_0x277b9b=_0x445750;_0xf1a9bd=0xc8;}else{_0xf1a9bd=0xce;}_0x585aae[_0x94d5('0xb')](_0xf1a9bd);return _0x585aae[_0x94d5('0x12')](_0x94d5('0x13'),_0x2f5389+'-'+_0x277b9b+'/'+_0x445750)[_0x94d5('0xd')](_0x3d974a);}return null;};}function saveUpdates(_0x538868){return function(_0x1313b0){if(_0x1313b0){return _0x1313b0[_0x94d5('0x14')](_0x538868)[_0x94d5('0x15')](function(_0x3e6b91){return _0x3e6b91;});}return null;};}function removeEntity(_0x402865){return function(_0x59f1a2){if(_0x59f1a2){return _0x59f1a2[_0x94d5('0x16')]()[_0x94d5('0x15')](function(){_0x402865['status'](0xcc)[_0x94d5('0xc')]();});}};}function handleEntityNotFound(_0x349c4d){return function(_0x16fe7b){if(!_0x16fe7b){_0x349c4d[_0x94d5('0xa')](0x194);}return _0x16fe7b;};}function handleError(_0x3be241,_0x422a06){_0x422a06=_0x422a06||0x1f4;return function(_0xec2397){logger[_0x94d5('0x17')](_0xec2397[_0x94d5('0x18')]);if(_0xec2397['name']){delete _0xec2397[_0x94d5('0x19')];}_0x3be241['status'](_0x422a06)['send'](_0xec2397);};}function maskClientSecret(_0x1cc869){return _[_0x94d5('0x1a')](_0x1cc869[_0x94d5('0x1b')](0x0,0x3),0x14,'*');}exports[_0x94d5('0x1c')]=function(_0x44f730,_0x1b6302){var _0x3443d5={},_0x15dc15={},_0x4586b9={'count':0x0,'rows':[]};var _0x19a1fd=_['map'](db[_0x94d5('0x1d')][_0x94d5('0x1e')],function(_0x5ee426){return{'name':_0x5ee426[_0x94d5('0x1f')],'type':_0x5ee426['type'][_0x94d5('0x20')]};});_0x15dc15[_0x94d5('0x21')]=_[_0x94d5('0x22')](_0x19a1fd,_0x94d5('0x19'));_0x15dc15['query']=_[_0x94d5('0x23')](_0x44f730[_0x94d5('0x24')]);_0x15dc15[_0x94d5('0x25')]=_['intersection'](_0x15dc15[_0x94d5('0x21')],_0x15dc15[_0x94d5('0x24')]);_0x3443d5[_0x94d5('0x26')]=_['intersection'](_0x15dc15[_0x94d5('0x21')],qs['fields'](_0x44f730[_0x94d5('0x24')][_0x94d5('0x27')]));_0x3443d5[_0x94d5('0x26')]=_0x3443d5['attributes'][_0x94d5('0x28')]?_0x3443d5[_0x94d5('0x26')]:_0x15dc15[_0x94d5('0x21')];if(!_0x44f730['query'][_0x94d5('0x29')](_0x94d5('0x2a'))){_0x3443d5[_0x94d5('0x10')]=qs[_0x94d5('0x10')](_0x44f730[_0x94d5('0x24')]['limit']);_0x3443d5['offset']=qs[_0x94d5('0xe')](_0x44f730['query'][_0x94d5('0xe')]);}_0x3443d5[_0x94d5('0x2b')]=qs[_0x94d5('0x2c')](_0x44f730[_0x94d5('0x24')][_0x94d5('0x2c')]);_0x3443d5[_0x94d5('0x2d')]=qs[_0x94d5('0x25')](_['pick'](_0x44f730['query'],_0x15dc15[_0x94d5('0x25')]),_0x19a1fd);if(_0x44f730[_0x94d5('0x24')][_0x94d5('0x2e')]){_0x3443d5[_0x94d5('0x2d')]=_[_0x94d5('0x2f')](_0x3443d5[_0x94d5('0x2d')],{'$or':_['map'](_0x19a1fd,function(_0x4098ee){if(_0x4098ee[_0x94d5('0x30')]!==_0x94d5('0x31')){var _0x22bbdd={};_0x22bbdd[_0x4098ee[_0x94d5('0x19')]]={'$like':'%'+_0x44f730[_0x94d5('0x24')]['filter']+'%'};return _0x22bbdd;}})});}_0x3443d5=_[_0x94d5('0x2f')]({},_0x3443d5,_0x44f730[_0x94d5('0x32')]);var _0x1f064d={'where':_0x3443d5[_0x94d5('0x2d')]};return db['CloudProvider'][_0x94d5('0x11')](_0x1f064d)[_0x94d5('0x15')](function(_0x24e029){_0x4586b9[_0x94d5('0x11')]=_0x24e029;if(_0x44f730[_0x94d5('0x24')]['includeAll']){_0x3443d5['include']=[{'all':!![]}];}return db[_0x94d5('0x1d')][_0x94d5('0x33')](_0x3443d5);})['then'](function(_0x5d8853){_0x4586b9[_0x94d5('0x34')]=_[_0x94d5('0x22')](_0x5d8853,function(_0x135ef4){if(_0x135ef4[_0x94d5('0x35')]===_0x94d5('0x36')){var _0x3f58f8=encryptor[_0x94d5('0x37')](_0x135ef4[_0x94d5('0x38')]);_0x135ef4[_0x94d5('0x38')]=maskClientSecret(_0x3f58f8);}return _0x135ef4;});return _0x4586b9;})[_0x94d5('0x15')](respondWithFilteredResult(_0x1b6302,_0x3443d5))[_0x94d5('0x39')](handleError(_0x1b6302,null));};exports[_0x94d5('0x3a')]=function(_0x3718e7,_0x38afe3){var _0x465f1d={'raw':!![],'where':{'id':_0x3718e7['params']['id']}},_0x2a7882={};_0x2a7882['model']=_[_0x94d5('0x23')](db[_0x94d5('0x1d')][_0x94d5('0x1e')]);_0x2a7882[_0x94d5('0x24')]=_['keys'](_0x3718e7[_0x94d5('0x24')]);_0x2a7882[_0x94d5('0x25')]=_[_0x94d5('0x3b')](_0x2a7882[_0x94d5('0x21')],_0x2a7882[_0x94d5('0x24')]);_0x465f1d[_0x94d5('0x26')]=_[_0x94d5('0x3b')](_0x2a7882[_0x94d5('0x21')],qs['fields'](_0x3718e7[_0x94d5('0x24')][_0x94d5('0x27')]));_0x465f1d[_0x94d5('0x26')]=_0x465f1d['attributes'][_0x94d5('0x28')]?_0x465f1d['attributes']:_0x2a7882[_0x94d5('0x21')];if(_0x3718e7[_0x94d5('0x24')][_0x94d5('0x3c')]){_0x465f1d[_0x94d5('0x3d')]=[{'all':!![]}];}_0x465f1d=_[_0x94d5('0x2f')]({},_0x465f1d,_0x3718e7[_0x94d5('0x32')]);return db[_0x94d5('0x1d')]['find'](_0x465f1d)['then'](handleEntityNotFound(_0x38afe3,null))['then'](function(_0x353d9f){if(_0x353d9f[_0x94d5('0x35')]===_0x94d5('0x36')){var _0x23f73e=encryptor[_0x94d5('0x37')](_0x353d9f[_0x94d5('0x38')]);_0x353d9f['data3']=maskClientSecret(_0x23f73e);}return _0x353d9f;})['then'](respondWithResult(_0x38afe3,null))['catch'](handleError(_0x38afe3,null));};exports[_0x94d5('0x3e')]=function(_0x594c1d,_0x53f1c8){if(!_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x19')])throw new Error(_0x94d5('0x40'));if(!_0x594c1d['body'][_0x94d5('0x35')])throw new Error(_0x94d5('0x41'));var _0x2347fe=db[_0x94d5('0x1d')][_0x94d5('0x1e')][_0x94d5('0x35')]['values'];if(!_0x2347fe['includes'](_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x35')]))throw new Error(_0x94d5('0x42')+_0x2347fe[_0x94d5('0x43')](',\x20'));if(_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x35')]==='MicrosoftAzure'&&_0x594c1d['body'][_0x94d5('0x38')]){_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x38')]=encryptor[_0x94d5('0x44')](_0x594c1d[_0x94d5('0x3f')][_0x94d5('0x38')]);}return db[_0x94d5('0x1d')][_0x94d5('0x3e')](_0x594c1d['body'],{})[_0x94d5('0x15')](respondWithResult(_0x53f1c8,0xc9))[_0x94d5('0x39')](handleError(_0x53f1c8,null));};exports[_0x94d5('0x14')]=function(_0x196461,_0x3b45fb){if(_0x196461[_0x94d5('0x3f')]['id']){delete _0x196461[_0x94d5('0x3f')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x196461[_0x94d5('0x45')]['id']}})[_0x94d5('0x15')](handleEntityNotFound(_0x3b45fb,null))[_0x94d5('0x15')](function(_0x2f0ab1){if(_0x2f0ab1[_0x94d5('0x35')]===_0x94d5('0x36')&&_0x196461[_0x94d5('0x3f')]['data3']){_0x196461[_0x94d5('0x3f')][_0x94d5('0x38')]=encryptor['encryptString'](_0x196461[_0x94d5('0x3f')][_0x94d5('0x38')]);}return _0x2f0ab1;})[_0x94d5('0x15')](saveUpdates(_0x196461[_0x94d5('0x3f')],null))[_0x94d5('0x15')](respondWithResult(_0x3b45fb,null))[_0x94d5('0x39')](handleError(_0x3b45fb,null));};exports[_0x94d5('0x16')]=function(_0x42d33d,_0x775711){return db[_0x94d5('0x1d')][_0x94d5('0x46')]({'where':{'id':_0x42d33d[_0x94d5('0x45')]['id']}})[_0x94d5('0x15')](handleEntityNotFound(_0x775711,null))[_0x94d5('0x15')](removeEntity(_0x775711,null))['catch'](handleError(_0x775711,null));};exports[_0x94d5('0x47')]=function(_0x3b2af3,_0xe2160e){return db[_0x94d5('0x1d')]['findOne']({'where':{'id':_0x3b2af3[_0x94d5('0x45')]['id']},'raw':!![]})[_0x94d5('0x15')](function(_0x11c13f){if(!_0x11c13f)return _0xe2160e['sendStatus'](0x194);return{'url':oauth[_0x94d5('0x48')](_0x11c13f,_0x3b2af3[_0x94d5('0x49')]['id'])};})[_0x94d5('0x15')](respondWithResult(_0xe2160e,null))[_0x94d5('0x39')](handleError(_0xe2160e,null));};exports['oauth2MicrosoftCallback']=function(_0x6f7d60,_0x17f8d0){var _0x5b76c2=_0x6f7d60[_0x94d5('0x3f')];var _0x42317f;var _0x5280b3;if(_0x5b76c2[_0x94d5('0x17')])throw _0x5b76c2;redis[_0x94d5('0x4a')](_0x5b76c2[_0x94d5('0x4b')])['then'](function(_0x120d37){if(!_0x120d37)throw new Error(_0x94d5('0x4c'));_0x42317f=JSON[_0x94d5('0x4d')](_0x120d37);var _0x5645d3=Buffer[_0x94d5('0x4e')](_0x5b76c2[_0x94d5('0x4b')],'base64')[_0x94d5('0x4f')](_0x94d5('0x50'));_0x5280b3=JSON[_0x94d5('0x4d')](_0x5645d3);if(!oauth[_0x94d5('0x51')](_0x5b76c2[_0x94d5('0x52')],_0x42317f[_0x94d5('0x53')]))throw new Error(_0x94d5('0x54'));redis['del'](_0x5b76c2[_0x94d5('0x4b')]);return oauth[_0x94d5('0x55')](_0x5b76c2[_0x94d5('0x56')],_0x42317f);})[_0x94d5('0x15')](function(_0x573ac7){_0x42317f[_0x94d5('0x57')]=_0x573ac7['access_token'];_0x42317f[_0x94d5('0x58')]=_0x573ac7[_0x94d5('0x59')];return db[_0x94d5('0x1d')][_0x94d5('0x14')]({'data5':_0x42317f[_0x94d5('0x57')],'data6':_0x42317f[_0x94d5('0x58')]},{'where':{'id':_0x42317f['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x42317f);socket[_0x94d5('0x5a')](_0x94d5('0x5b'),{'id':_0x5280b3['id']});return;})[_0x94d5('0x15')](respondWithStatusCode(_0x17f8d0,null))[_0x94d5('0x39')](function(_0x4478ea){if(_0x5280b3){socket['emit'](_0x94d5('0x5c'),{'id':_0x5280b3['id']});}if(!_0x42317f){logger[_0x94d5('0x17')](_0x94d5('0x5d'),_0x4478ea);return _0x17f8d0[_0x94d5('0xb')](0x1f4)[_0x94d5('0x5e')](_0x4478ea[_0x94d5('0x5f')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x42317f['id'],JSON[_0x94d5('0x60')](_0x4478ea));});};
\ No newline at end of file
+var _0x9c59=['../../components/encryptor','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','update','then','end','error','stack','name','send','padEnd','index','CloudProvider','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','service','MicrosoftAzure','data3','catch','show','params','rawAttributes','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','stringify','lodash','../../components/parsers/qs'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x9c59,0x115));var _0x99c5=function(_0xe3e56a,_0xd3462d){_0xe3e56a=_0xe3e56a-0x0;var _0x5617f2=_0x9c59[_0xe3e56a];return _0x5617f2;};'use strict';var _=require(_0x99c5('0x0'));var Redis=require('ioredis');var qs=require(_0x99c5('0x1'));var encryptor=require(_0x99c5('0x2'));var config=require('../../config/environment');var logger=require(_0x99c5('0x3'))(_0x99c5('0x4'));var db=require(_0x99c5('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x99c5('0x6')]=_['defaults'](config[_0x99c5('0x6')],{'host':_0x99c5('0x7'),'port':0x18eb});var socket=require(_0x99c5('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x99c5('0x6')]);function respondWithStatusCode(_0x14358e,_0xd44207){_0xd44207=_0xd44207||0xcc;return function(_0x42c247){if(_0x42c247){return _0x14358e[_0x99c5('0x9')](_0xd44207);}return _0x14358e[_0x99c5('0xa')](_0xd44207)['end']();};}function respondWithResult(_0x28b684,_0x562839){_0x562839=_0x562839||0xc8;return function(_0x240210){if(_0x240210){return _0x28b684['status'](_0x562839)[_0x99c5('0xb')](_0x240210);}};}function respondWithFilteredResult(_0x54ae0a,_0x5f1861){return function(_0xa2ddb){if(_0xa2ddb){var _0x17eae1=typeof _0x5f1861[_0x99c5('0xc')]===_0x99c5('0xd')&&typeof _0x5f1861[_0x99c5('0xe')]==='undefined';var _0x48bad0=_0xa2ddb[_0x99c5('0xf')];var _0x52510b=_0x17eae1?0x0:_0x5f1861[_0x99c5('0xc')];var _0x41b68c=_0x17eae1?_0xa2ddb[_0x99c5('0xf')]:_0x5f1861['offset']+_0x5f1861[_0x99c5('0xe')];var _0x308d0a;if(_0x41b68c>=_0x48bad0){_0x41b68c=_0x48bad0;_0x308d0a=0xc8;}else{_0x308d0a=0xce;}_0x54ae0a[_0x99c5('0xa')](_0x308d0a);return _0x54ae0a[_0x99c5('0x10')]('Content-Range',_0x52510b+'-'+_0x41b68c+'/'+_0x48bad0)['json'](_0xa2ddb);}return null;};}function saveUpdates(_0x39bac1){return function(_0x51726f){if(_0x51726f){return _0x51726f[_0x99c5('0x11')](_0x39bac1)[_0x99c5('0x12')](function(_0x5e4f4f){return _0x5e4f4f;});}return null;};}function removeEntity(_0x4ea965){return function(_0x891141){if(_0x891141){return _0x891141['destroy']()[_0x99c5('0x12')](function(){_0x4ea965[_0x99c5('0xa')](0xcc)[_0x99c5('0x13')]();});}};}function handleEntityNotFound(_0x178bee){return function(_0x49ad00){if(!_0x49ad00){_0x178bee['sendStatus'](0x194);}return _0x49ad00;};}function handleError(_0x42098a,_0x39326b){_0x39326b=_0x39326b||0x1f4;return function(_0x24156a){logger[_0x99c5('0x14')](_0x24156a[_0x99c5('0x15')]);if(_0x24156a[_0x99c5('0x16')]){delete _0x24156a[_0x99c5('0x16')];}_0x42098a[_0x99c5('0xa')](_0x39326b)[_0x99c5('0x17')](_0x24156a);};}function maskClientSecret(_0x4794f9){return _[_0x99c5('0x18')](_0x4794f9['slice'](0x0,0x3),0x14,'*');}exports[_0x99c5('0x19')]=function(_0x206032,_0x1396e2){var _0x597b4a={},_0x4346c4={},_0x1ee82d={'count':0x0,'rows':[]};var _0x15d7a0=_['map'](db[_0x99c5('0x1a')]['rawAttributes'],function(_0x235483){return{'name':_0x235483[_0x99c5('0x1b')],'type':_0x235483[_0x99c5('0x1c')]['key']};});_0x4346c4[_0x99c5('0x1d')]=_[_0x99c5('0x1e')](_0x15d7a0,_0x99c5('0x16'));_0x4346c4['query']=_[_0x99c5('0x1f')](_0x206032[_0x99c5('0x20')]);_0x4346c4[_0x99c5('0x21')]=_[_0x99c5('0x22')](_0x4346c4[_0x99c5('0x1d')],_0x4346c4[_0x99c5('0x20')]);_0x597b4a[_0x99c5('0x23')]=_[_0x99c5('0x22')](_0x4346c4[_0x99c5('0x1d')],qs['fields'](_0x206032[_0x99c5('0x20')][_0x99c5('0x24')]));_0x597b4a[_0x99c5('0x23')]=_0x597b4a[_0x99c5('0x23')][_0x99c5('0x25')]?_0x597b4a[_0x99c5('0x23')]:_0x4346c4['model'];if(!_0x206032[_0x99c5('0x20')][_0x99c5('0x26')](_0x99c5('0x27'))){_0x597b4a['limit']=qs[_0x99c5('0xe')](_0x206032['query']['limit']);_0x597b4a['offset']=qs['offset'](_0x206032[_0x99c5('0x20')][_0x99c5('0xc')]);}_0x597b4a[_0x99c5('0x28')]=qs[_0x99c5('0x29')](_0x206032[_0x99c5('0x20')][_0x99c5('0x29')]);_0x597b4a[_0x99c5('0x2a')]=qs['filters'](_[_0x99c5('0x2b')](_0x206032[_0x99c5('0x20')],_0x4346c4['filters']),_0x15d7a0);if(_0x206032[_0x99c5('0x20')][_0x99c5('0x2c')]){_0x597b4a[_0x99c5('0x2a')]=_[_0x99c5('0x2d')](_0x597b4a['where'],{'$or':_[_0x99c5('0x1e')](_0x15d7a0,function(_0x3d1251){if(_0x3d1251['type']!==_0x99c5('0x2e')){var _0x490089={};_0x490089[_0x3d1251[_0x99c5('0x16')]]={'$like':'%'+_0x206032[_0x99c5('0x20')][_0x99c5('0x2c')]+'%'};return _0x490089;}})});}_0x597b4a=_[_0x99c5('0x2d')]({},_0x597b4a,_0x206032[_0x99c5('0x2f')]);var _0x3405a7={'where':_0x597b4a[_0x99c5('0x2a')]};return db[_0x99c5('0x1a')][_0x99c5('0xf')](_0x3405a7)['then'](function(_0x5e11fb){_0x1ee82d['count']=_0x5e11fb;if(_0x206032['query'][_0x99c5('0x30')]){_0x597b4a[_0x99c5('0x31')]=[{'all':!![]}];}return db[_0x99c5('0x1a')][_0x99c5('0x32')](_0x597b4a);})[_0x99c5('0x12')](function(_0x2fb05f){_0x1ee82d['rows']=_[_0x99c5('0x1e')](_0x2fb05f,function(_0x13f50e){if(_0x13f50e[_0x99c5('0x33')]===_0x99c5('0x34')){var _0x2be319=encryptor['decryptString'](_0x13f50e[_0x99c5('0x35')]);_0x13f50e['data3']=maskClientSecret(_0x2be319);}return _0x13f50e;});return _0x1ee82d;})[_0x99c5('0x12')](respondWithFilteredResult(_0x1396e2,_0x597b4a))[_0x99c5('0x36')](handleError(_0x1396e2,null));};exports[_0x99c5('0x37')]=function(_0x371e21,_0x16c02b){var _0x348f9a={'raw':!![],'where':{'id':_0x371e21[_0x99c5('0x38')]['id']}},_0x549ac7={};_0x549ac7['model']=_[_0x99c5('0x1f')](db['CloudProvider'][_0x99c5('0x39')]);_0x549ac7[_0x99c5('0x20')]=_[_0x99c5('0x1f')](_0x371e21[_0x99c5('0x20')]);_0x549ac7[_0x99c5('0x21')]=_[_0x99c5('0x22')](_0x549ac7[_0x99c5('0x1d')],_0x549ac7[_0x99c5('0x20')]);_0x348f9a[_0x99c5('0x23')]=_['intersection'](_0x549ac7[_0x99c5('0x1d')],qs[_0x99c5('0x24')](_0x371e21[_0x99c5('0x20')][_0x99c5('0x24')]));_0x348f9a['attributes']=_0x348f9a['attributes'][_0x99c5('0x25')]?_0x348f9a[_0x99c5('0x23')]:_0x549ac7[_0x99c5('0x1d')];if(_0x371e21[_0x99c5('0x20')][_0x99c5('0x30')]){_0x348f9a['include']=[{'all':!![]}];}_0x348f9a=_['merge']({},_0x348f9a,_0x371e21[_0x99c5('0x2f')]);return db[_0x99c5('0x1a')][_0x99c5('0x3a')](_0x348f9a)[_0x99c5('0x12')](handleEntityNotFound(_0x16c02b,null))['then'](function(_0x13b83c){if(_0x13b83c[_0x99c5('0x33')]===_0x99c5('0x34')){var _0xd9978a=encryptor[_0x99c5('0x3b')](_0x13b83c[_0x99c5('0x35')]);_0x13b83c[_0x99c5('0x35')]=maskClientSecret(_0xd9978a);}return _0x13b83c;})[_0x99c5('0x12')](respondWithResult(_0x16c02b,null))[_0x99c5('0x36')](handleError(_0x16c02b,null));};exports[_0x99c5('0x3c')]=function(_0x28d21a,_0x18edaf){if(!_0x28d21a[_0x99c5('0x3d')]['name'])throw new Error(_0x99c5('0x3e'));if(!_0x28d21a['body'][_0x99c5('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5761de=db['CloudProvider'][_0x99c5('0x39')][_0x99c5('0x33')][_0x99c5('0x3f')];if(!_0x5761de[_0x99c5('0x40')](_0x28d21a[_0x99c5('0x3d')]['service']))throw new Error(_0x99c5('0x41')+_0x5761de[_0x99c5('0x42')](',\x20'));if(_0x28d21a[_0x99c5('0x3d')]['service']===_0x99c5('0x34')&&_0x28d21a[_0x99c5('0x3d')][_0x99c5('0x35')]){_0x28d21a['body']['data3']=encryptor[_0x99c5('0x43')](_0x28d21a['body'][_0x99c5('0x35')]);}return db[_0x99c5('0x1a')][_0x99c5('0x3c')](_0x28d21a[_0x99c5('0x3d')],{})[_0x99c5('0x12')](respondWithResult(_0x18edaf,0xc9))[_0x99c5('0x36')](handleError(_0x18edaf,null));};exports[_0x99c5('0x11')]=function(_0x2d2e3b,_0x5367e5){if(_0x2d2e3b[_0x99c5('0x3d')]['id']){delete _0x2d2e3b[_0x99c5('0x3d')]['id'];}return db[_0x99c5('0x1a')]['find']({'where':{'id':_0x2d2e3b[_0x99c5('0x38')]['id']}})[_0x99c5('0x12')](handleEntityNotFound(_0x5367e5,null))['then'](function(_0x35aece){if(_0x35aece[_0x99c5('0x33')]==='MicrosoftAzure'&&_0x2d2e3b['body']['data3']){_0x2d2e3b[_0x99c5('0x3d')][_0x99c5('0x35')]=encryptor['encryptString'](_0x2d2e3b[_0x99c5('0x3d')][_0x99c5('0x35')]);}return _0x35aece;})[_0x99c5('0x12')](saveUpdates(_0x2d2e3b[_0x99c5('0x3d')],null))[_0x99c5('0x12')](respondWithResult(_0x5367e5,null))['catch'](handleError(_0x5367e5,null));};exports['destroy']=function(_0x3877ba,_0xb657d4){return db[_0x99c5('0x1a')][_0x99c5('0x3a')]({'where':{'id':_0x3877ba[_0x99c5('0x38')]['id']}})[_0x99c5('0x12')](handleEntityNotFound(_0xb657d4,null))[_0x99c5('0x12')](removeEntity(_0xb657d4,null))[_0x99c5('0x36')](handleError(_0xb657d4,null));};exports[_0x99c5('0x44')]=function(_0x2d3621,_0xc73eff){return db[_0x99c5('0x1a')][_0x99c5('0x45')]({'where':{'id':_0x2d3621[_0x99c5('0x38')]['id']},'raw':!![]})[_0x99c5('0x12')](function(_0x3310c0){if(!_0x3310c0)return _0xc73eff['sendStatus'](0x194);return{'url':oauth[_0x99c5('0x46')](_0x3310c0,_0x2d3621[_0x99c5('0x47')]['id'])};})[_0x99c5('0x12')](respondWithResult(_0xc73eff,null))[_0x99c5('0x36')](handleError(_0xc73eff,null));};exports[_0x99c5('0x48')]=function(_0x2e4c0e,_0xe4c8f9){var _0x5dd88a=_0x2e4c0e[_0x99c5('0x3d')];var _0x9069b3;var _0x3f5e14;if(_0x5dd88a[_0x99c5('0x14')])throw _0x5dd88a;redis[_0x99c5('0x49')](_0x5dd88a[_0x99c5('0x4a')])['then'](function(_0x190561){if(!_0x190561)throw new Error(_0x99c5('0x4b'));_0x9069b3=JSON[_0x99c5('0x4c')](_0x190561);var _0x281e14=Buffer['from'](_0x5dd88a[_0x99c5('0x4a')],'base64')[_0x99c5('0x4d')]('ascii');_0x3f5e14=JSON[_0x99c5('0x4c')](_0x281e14);if(!oauth[_0x99c5('0x4e')](_0x5dd88a[_0x99c5('0x4f')],_0x9069b3['oauth2Claims']))throw new Error(_0x99c5('0x50'));redis[_0x99c5('0x51')](_0x5dd88a[_0x99c5('0x4a')]);return oauth['getOauth2MicrosoftAccessToken'](_0x5dd88a[_0x99c5('0x52')],_0x9069b3);})[_0x99c5('0x12')](function(_0x5d2df4){_0x9069b3[_0x99c5('0x53')]=_0x5d2df4[_0x99c5('0x54')];_0x9069b3[_0x99c5('0x55')]=_0x5d2df4[_0x99c5('0x56')];return db[_0x99c5('0x1a')][_0x99c5('0x11')]({'data5':_0x9069b3[_0x99c5('0x53')],'data6':_0x9069b3[_0x99c5('0x55')]},{'where':{'id':_0x9069b3['id']}});})['then'](function(){oauth[_0x99c5('0x57')](_0x9069b3);socket[_0x99c5('0x58')](_0x99c5('0x59'),{'id':_0x3f5e14['id']});return;})[_0x99c5('0x12')](respondWithStatusCode(_0xe4c8f9,null))[_0x99c5('0x36')](function(_0xfaa083){if(_0x3f5e14){socket[_0x99c5('0x58')](_0x99c5('0x5a'),{'id':_0x3f5e14['id']});}if(!_0x9069b3){logger[_0x99c5('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0xfaa083);return _0xe4c8f9[_0x99c5('0xa')](0x1f4)[_0x99c5('0x17')](_0xfaa083[_0x99c5('0x5b')]);}logger[_0x99c5('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x9069b3['id'],JSON[_0x99c5('0x5c')](_0xfaa083));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 6ab89df..0f29706 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 _0x7903=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7903,0x13b));var _0x3790=function(_0x445002,_0x25bce8){_0x445002=_0x445002-0x0;var _0x4a256f=_0x7903[_0x445002];return _0x4a256f;};'use strict';var _=require(_0x3790('0x0'));var util=require(_0x3790('0x1'));var logger=require(_0x3790('0x2'))(_0x3790('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3790('0x4'));var fs=require('fs');var path=require(_0x3790('0x5'));var rimraf=require(_0x3790('0x6'));var config=require(_0x3790('0x7'));var attributes=require(_0x3790('0x8'));module[_0x3790('0x9')]=function(_0x45c5c4,_0x906b2a){return _0x45c5c4['define']('CloudProvider',attributes,{'tableName':_0x3790('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ac2=['../../config/logger','api','moment','request-promise','path','../../config/environment','CloudProvider'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0x0ac2,0x15e));var _0x20ac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0ac2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x20ac('0x0'))(_0x20ac('0x1'));var moment=require(_0x20ac('0x2'));var BPromise=require('bluebird');var rp=require(_0x20ac('0x3'));var fs=require('fs');var path=require(_0x20ac('0x4'));var rimraf=require('rimraf');var config=require(_0x20ac('0x5'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x75ed64,_0x294ca6){return _0x75ed64['define'](_0x20ac('0x6'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index d6df790..7d778c6 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 _0xf6f8=['https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','Dynamics365','push','data7','join','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','value','oauth2Claims','set','stringify','decode','payload','iss','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All'];(function(_0xa7242e,_0x22572b){var _0x55dbc4=function(_0x54d6f6){while(--_0x54d6f6){_0xa7242e['push'](_0xa7242e['shift']());}};_0x55dbc4(++_0x22572b);}(_0xf6f8,0xe6));var _0x8f6f=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xf6f8[_0x49d41c];return _0xb64c5f;};'use strict';var _=require('lodash');var crypto=require(_0x8f6f('0x0'));var jwt=require(_0x8f6f('0x1'));var moment=require(_0x8f6f('0x2'));var Redis=require(_0x8f6f('0x3'));var rp=require(_0x8f6f('0x4'));var util=require(_0x8f6f('0x5'));var encryptor=require(_0x8f6f('0x6'));var config=require(_0x8f6f('0x7'));var logger=require('../../config/logger')(_0x8f6f('0x8'));var schedule=require(_0x8f6f('0x9'));var db=require(_0x8f6f('0xa'))['db'];config[_0x8f6f('0xb')]=_[_0x8f6f('0xc')](config[_0x8f6f('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x8f6f('0xb')]);var MICROSOFT_AUTH_URL=_0x8f6f('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x8f6f('0xe'),_0x8f6f('0xf'),_0x8f6f('0x10'),_0x8f6f('0x11'),_0x8f6f('0x12'),_0x8f6f('0x13')],'Dynamics365':[_0x8f6f('0x14'),_0x8f6f('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x8f6f('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x8f6f('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x41e4e5){var _0xf0b71d=_[_0x8f6f('0x17')](AZURE_AUTH_SCOPES[_0x41e4e5[_0x8f6f('0x18')]]);if(_0x41e4e5['type']===_0x8f6f('0x19'))_0xf0b71d[_0x8f6f('0x1a')](_0x41e4e5[_0x8f6f('0x1b')]+'/.default');return _0xf0b71d[_0x8f6f('0x1c')]('\x20');}function getAccessTokenScope(_0x475f08){if(_0x475f08['type']==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x475f08[_0x8f6f('0x18')]===_0x8f6f('0x19'))return _0x475f08[_0x8f6f('0x1b')]+_0x8f6f('0x1d');}function generateMicrosoftAuthorizationUrl(_0x119f3e,_0x4ef92c){var _0x191af7=MICROSOFT_AUTH_URL[_0x8f6f('0x1e')](_0x8f6f('0x1f'),_0x119f3e[_0x8f6f('0x20')]);var _0xb1f8aa=[_0x8f6f('0x21'),_0x8f6f('0x22')];var _0x32ec7c=Buffer[_0x8f6f('0x23')](JSON['stringify']({'id':_0x4ef92c}))[_0x8f6f('0x24')](_0x8f6f('0x25'));var _0x5bd2e1=crypto['randomBytes'](0x10)['toString'](_0x8f6f('0x26'));var _0x7713c1=getAuthorizationScopes(_0x119f3e);var _0x3ab13f=[{'key':_0x8f6f('0x27'),'value':_0x119f3e[_0x8f6f('0x28')]},{'key':_0x8f6f('0x29'),'value':encodeURIComponent(_0xb1f8aa[_0x8f6f('0x1c')]('\x20'))},{'key':_0x8f6f('0x2a'),'value':_0x119f3e[_0x8f6f('0x2b')]},{'key':_0x8f6f('0x2c'),'value':_0x8f6f('0x2d')},{'key':_0x8f6f('0x2e'),'value':encodeURIComponent(_0x7713c1)},{'key':_0x8f6f('0x2f'),'value':_0x32ec7c},{'key':_0x8f6f('0x30'),'value':_0x5bd2e1},{'key':_0x8f6f('0x31'),'value':'login'}];var _0x2d3f17=_0x191af7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8f6f('0x17')](_0x3ab13f,function(_0x144072){return _0x144072['key']+'='+_0x144072[_0x8f6f('0x32')];})[_0x8f6f('0x1c')]('&');_0x119f3e[_0x8f6f('0x33')]={'issuer':_0x191af7[_0x8f6f('0x1e')]('oauth2/',''),'audience':_0x119f3e[_0x8f6f('0x28')],'state':_0x32ec7c,'nonce':_0x5bd2e1};redis[_0x8f6f('0x34')](_0x32ec7c,JSON[_0x8f6f('0x35')](_0x119f3e));return _0x2d3f17;}function isValidIdToken(_0x12468c,_0x3449cd){try{var _0x150803=jwt[_0x8f6f('0x36')](_0x12468c,{'complete':!![]});var _0x4de9b1=_0x150803[_0x8f6f('0x37')];if(_0x4de9b1[_0x8f6f('0x38')]!==_0x3449cd['issuer'])return![];if(_0x4de9b1[_0x8f6f('0x39')]!==_0x3449cd[_0x8f6f('0x3a')])return![];if(_0x4de9b1[_0x8f6f('0x30')]!==_0x3449cd[_0x8f6f('0x30')])return![];if(moment()[_0x8f6f('0x3b')](moment[_0x8f6f('0x3c')](_0x4de9b1['exp'])))return![];return!![];}catch(_0x50d835){throw _0x50d835;}}function refreshOauth2MicrosoftAccessToken(_0x5b3e51){return Promise[_0x8f6f('0x3d')]()[_0x8f6f('0x3e')](function(){if(_0x5b3e51[_0x8f6f('0x3f')])return _0x5b3e51;return db[_0x8f6f('0x40')][_0x8f6f('0x41')]({'where':{'id':_0x5b3e51['id']},'raw':!![]});})[_0x8f6f('0x3e')](function(_0x5f489a){var _0x1ef78c={'grant_type':_0x8f6f('0x42'),'refresh_token':_0x5f489a[_0x8f6f('0x43')],'scope':getAccessTokenScope(_0x5f489a),'redirect_uri':_0x5f489a[_0x8f6f('0x2b')],'client_id':_0x5f489a['data1'],'client_secret':encryptor[_0x8f6f('0x44')](_0x5f489a[_0x8f6f('0x3f')])};var _0x36ba6e={'method':_0x8f6f('0x45'),'uri':MICROSOFT_AUTH_URL[_0x8f6f('0x1e')](_0x8f6f('0x1f'),_0x5f489a[_0x8f6f('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1ef78c,'json':!![]};return rp(_0x36ba6e);})[_0x8f6f('0x3e')](function(_0x531eea){_0x5b3e51[_0x8f6f('0x46')]=_0x531eea[_0x8f6f('0x47')];_0x5b3e51[_0x8f6f('0x43')]=_0x531eea[_0x8f6f('0x42')];return db['CloudProvider'][_0x8f6f('0x48')]({'data5':_0x5b3e51[_0x8f6f('0x46')],'data6':_0x5b3e51[_0x8f6f('0x43')]},{'where':{'id':_0x5b3e51['id']}});})[_0x8f6f('0x3e')](function(){return _0x5b3e51;})['catch'](function(_0xfa09f1){logger['error'](_0x8f6f('0x49'),_0x5b3e51['id'],_0xfa09f1);});}function getOauth2MicrosoftAccessToken(_0x3d01f4,_0x4b2aaa){var _0x2a7a79={'grant_type':_0x8f6f('0x4a'),'code':_0x3d01f4,'scope':getAccessTokenScope(_0x4b2aaa),'redirect_uri':_0x4b2aaa[_0x8f6f('0x2b')],'client_id':_0x4b2aaa[_0x8f6f('0x28')],'client_secret':encryptor[_0x8f6f('0x44')](_0x4b2aaa[_0x8f6f('0x3f')])};var _0x49c3ef={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x8f6f('0x1e')](_0x8f6f('0x1f'),_0x4b2aaa[_0x8f6f('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2a7a79,'json':!![]};return rp(_0x49c3ef);}function startRefreshInterval(_0x6db01d){var _0x4b6de1=schedule[_0x8f6f('0x4b')];if(_0x4b6de1[_0x6db01d['id']])clearInterval(_0x4b6de1[_0x6db01d['id']]);_0x4b6de1[_0x6db01d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8f6f('0x4c')](this,{'id':_0x6db01d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4b6de1;}function startAllRefreshIntervals(){return db[_0x8f6f('0x40')][_0x8f6f('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8f6f('0x3e')](function(_0x18e788){var _0x598053=_0x18e788['map'](function(_0x4bf3c4){return refreshOauth2MicrosoftAccessToken(_0x4bf3c4)[_0x8f6f('0x3e')](function(_0x3e5981){startRefreshInterval(_0x3e5981);});});return Promise[_0x8f6f('0x4e')](_0x598053);})['catch'](function(_0x1de5a2){var _0x36e40d=_0x1de5a2?util[_0x8f6f('0x4f')](_0x1de5a2,{'showHidden':![],'depth':null}):'';logger[_0x8f6f('0x50')](_0x8f6f('0x51'),_0x36e40d);});}module[_0x8f6f('0x52')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xa26d=['findOne','refresh_token','data6','data4','decryptString','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','push','/.default','join','Outlook365','Dynamics365','data7','replace','{TENANT_ID}','data2','code','from','base64','randomBytes','toString','hex','client_id','data1','redirect_uri','form_post','state','nonce','prompt','map','key','value','oauth2Claims','oauth2/','set','stringify','payload','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider'];(function(_0x9cdbe2,_0x5d2fa2){var _0x4e0f87=function(_0x224cc4){while(--_0x224cc4){_0x9cdbe2['push'](_0x9cdbe2['shift']());}};_0x4e0f87(++_0x5d2fa2);}(_0xa26d,0x108));var _0xda26=function(_0x5ef2b7,_0xfec6f9){_0x5ef2b7=_0x5ef2b7-0x0;var _0x1c5ef4=_0xa26d[_0x5ef2b7];return _0x1c5ef4;};'use strict';var _=require('lodash');var crypto=require(_0xda26('0x0'));var jwt=require(_0xda26('0x1'));var moment=require(_0xda26('0x2'));var Redis=require(_0xda26('0x3'));var rp=require(_0xda26('0x4'));var util=require(_0xda26('0x5'));var encryptor=require(_0xda26('0x6'));var config=require(_0xda26('0x7'));var logger=require(_0xda26('0x8'))(_0xda26('0x9'));var schedule=require(_0xda26('0xa'));var db=require(_0xda26('0xb'))['db'];config[_0xda26('0xc')]=_['defaults'](config[_0xda26('0xc')],{'host':_0xda26('0xd'),'port':0x18eb});var redis=new Redis(config[_0xda26('0xc')]);var MICROSOFT_AUTH_URL=_0xda26('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xda26('0xf'),_0xda26('0x10'),_0xda26('0x11'),'offline_access',_0xda26('0x12'),_0xda26('0x13'),_0xda26('0x14')],'Dynamics365':[_0xda26('0xf'),_0xda26('0x15')]};var MICROSOFT_AUTH_ENDPOINT=_0xda26('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0xda26('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xf832b2){var _0x3fb91f=_['map'](AZURE_AUTH_SCOPES[_0xf832b2[_0xda26('0x18')]]);if(_0xf832b2[_0xda26('0x18')]==='Dynamics365')_0x3fb91f[_0xda26('0x19')](_0xf832b2['data7']+_0xda26('0x1a'));return _0x3fb91f[_0xda26('0x1b')]('\x20');}function getAccessTokenScope(_0xe60e1){if(_0xe60e1['type']===_0xda26('0x1c'))return _0xda26('0x12');if(_0xe60e1[_0xda26('0x18')]===_0xda26('0x1d'))return _0xe60e1[_0xda26('0x1e')]+_0xda26('0x1a');}function generateMicrosoftAuthorizationUrl(_0x3d6434,_0x94274d){var _0x439410=MICROSOFT_AUTH_URL[_0xda26('0x1f')](_0xda26('0x20'),_0x3d6434[_0xda26('0x21')]);var _0x2ca64c=[_0xda26('0x22'),'id_token'];var _0xc6f7d8=Buffer[_0xda26('0x23')](JSON['stringify']({'id':_0x94274d}))['toString'](_0xda26('0x24'));var _0x282383=crypto[_0xda26('0x25')](0x10)[_0xda26('0x26')](_0xda26('0x27'));var _0x41bb92=getAuthorizationScopes(_0x3d6434);var _0x1f4a00=[{'key':_0xda26('0x28'),'value':_0x3d6434[_0xda26('0x29')]},{'key':'response_type','value':encodeURIComponent(_0x2ca64c[_0xda26('0x1b')]('\x20'))},{'key':_0xda26('0x2a'),'value':_0x3d6434['data4']},{'key':'response_mode','value':_0xda26('0x2b')},{'key':'scope','value':encodeURIComponent(_0x41bb92)},{'key':_0xda26('0x2c'),'value':_0xc6f7d8},{'key':_0xda26('0x2d'),'value':_0x282383},{'key':_0xda26('0x2e'),'value':'login'}];var _0x88e17d=_0x439410+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xda26('0x2f')](_0x1f4a00,function(_0x2e2add){return _0x2e2add[_0xda26('0x30')]+'='+_0x2e2add[_0xda26('0x31')];})[_0xda26('0x1b')]('&');_0x3d6434[_0xda26('0x32')]={'issuer':_0x439410[_0xda26('0x1f')](_0xda26('0x33'),''),'audience':_0x3d6434[_0xda26('0x29')],'state':_0xc6f7d8,'nonce':_0x282383};redis[_0xda26('0x34')](_0xc6f7d8,JSON[_0xda26('0x35')](_0x3d6434));return _0x88e17d;}function isValidIdToken(_0x4c6972,_0x46ef95){try{var _0x422a7b=jwt['decode'](_0x4c6972,{'complete':!![]});var _0x2949d3=_0x422a7b[_0xda26('0x36')];if(_0x2949d3['iss']!==_0x46ef95['issuer'])return![];if(_0x2949d3[_0xda26('0x37')]!==_0x46ef95[_0xda26('0x38')])return![];if(_0x2949d3[_0xda26('0x2d')]!==_0x46ef95[_0xda26('0x2d')])return![];if(moment()[_0xda26('0x39')](moment[_0xda26('0x3a')](_0x2949d3[_0xda26('0x3b')])))return![];return!![];}catch(_0x404abe){throw _0x404abe;}}function refreshOauth2MicrosoftAccessToken(_0x4b1d89){return Promise[_0xda26('0x3c')]()[_0xda26('0x3d')](function(){if(_0x4b1d89[_0xda26('0x3e')])return _0x4b1d89;return db[_0xda26('0x3f')][_0xda26('0x40')]({'where':{'id':_0x4b1d89['id']},'raw':!![]});})[_0xda26('0x3d')](function(_0x4969b0){var _0x23cc98={'grant_type':_0xda26('0x41'),'refresh_token':_0x4969b0[_0xda26('0x42')],'scope':getAccessTokenScope(_0x4969b0),'redirect_uri':_0x4969b0[_0xda26('0x43')],'client_id':_0x4969b0[_0xda26('0x29')],'client_secret':encryptor[_0xda26('0x44')](_0x4969b0[_0xda26('0x3e')])};var _0x51ed92={'method':_0xda26('0x45'),'uri':MICROSOFT_AUTH_URL[_0xda26('0x1f')]('{TENANT_ID}',_0x4969b0[_0xda26('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x23cc98,'json':!![]};return rp(_0x51ed92);})['then'](function(_0x2f7eca){_0x4b1d89[_0xda26('0x46')]=_0x2f7eca[_0xda26('0x47')];_0x4b1d89[_0xda26('0x42')]=_0x2f7eca['refresh_token'];return db['CloudProvider'][_0xda26('0x48')]({'data5':_0x4b1d89[_0xda26('0x46')],'data6':_0x4b1d89[_0xda26('0x42')]},{'where':{'id':_0x4b1d89['id']}});})['then'](function(){return _0x4b1d89;})[_0xda26('0x49')](function(_0x15d0fb){logger['error'](_0xda26('0x4a'),_0x4b1d89['id'],_0x15d0fb);});}function getOauth2MicrosoftAccessToken(_0x50bb53,_0x2cc2c1){var _0x28273a={'grant_type':'authorization_code','code':_0x50bb53,'scope':getAccessTokenScope(_0x2cc2c1),'redirect_uri':_0x2cc2c1[_0xda26('0x43')],'client_id':_0x2cc2c1[_0xda26('0x29')],'client_secret':encryptor[_0xda26('0x44')](_0x2cc2c1['data3'])};var _0x557048={'method':_0xda26('0x45'),'uri':MICROSOFT_AUTH_URL[_0xda26('0x1f')]('{TENANT_ID}',_0x2cc2c1['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x28273a,'json':!![]};return rp(_0x557048);}function startRefreshInterval(_0x5726de){var _0x2f49dd=schedule[_0xda26('0x4b')];if(_0x2f49dd[_0x5726de['id']])clearInterval(_0x2f49dd[_0x5726de['id']]);_0x2f49dd[_0x5726de['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xda26('0x4c')](this,{'id':_0x5726de['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xda26('0x4b')]=_0x2f49dd;}function startAllRefreshIntervals(){return db[_0xda26('0x3f')][_0xda26('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x45090f){var _0x52094f=_0x45090f[_0xda26('0x2f')](function(_0x24e86a){return refreshOauth2MicrosoftAccessToken(_0x24e86a)[_0xda26('0x3d')](function(_0x2797d5){startRefreshInterval(_0x2797d5);});});return Promise[_0xda26('0x4e')](_0x52094f);})[_0xda26('0x49')](function(_0x23d2a9){var _0x1b21b9=_0x23d2a9?util['inspect'](_0x23d2a9,{'showHidden':![],'depth':null}):'';logger[_0xda26('0x4f')](_0xda26('0x50'),_0x1b21b9);});}module[_0xda26('0x51')]={'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 187348c..a7fdb94 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 _0x01a6=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message'];(function(_0xa1a10,_0x336001){var _0x3274c1=function(_0x4beb40){while(--_0x4beb40){_0xa1a10['push'](_0xa1a10['shift']());}};_0x3274c1(++_0x336001);}(_0x01a6,0x162));var _0x601a=function(_0x1d5c3f,_0x2b5faa){_0x1d5c3f=_0x1d5c3f-0x0;var _0x2ebc3e=_0x01a6[_0x1d5c3f];return _0x2ebc3e;};'use strict';var _=require(_0x601a('0x0'));var util=require('util');var moment=require(_0x601a('0x1'));var BPromise=require(_0x601a('0x2'));var rs=require(_0x601a('0x3'));var fs=require('fs');var Redis=require(_0x601a('0x4'));var db=require(_0x601a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x601a('0x6'))('rpc');var config=require(_0x601a('0x7'));var jayson=require(_0x601a('0x8'));var client=jayson[_0x601a('0x9')][_0x601a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x272297,_0x5d94b5,_0x4ec3fe){return new BPromise(function(_0x208472,_0x1b6bf7){return client[_0x601a('0xb')](_0x272297,_0x4ec3fe)['then'](function(_0x6c5aab){logger[_0x601a('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));logger[_0x601a('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'),JSON[_0x601a('0xf')](_0x6c5aab));if(_0x6c5aab[_0x601a('0x10')]){if(_0x6c5aab[_0x601a('0x10')][_0x601a('0x11')]===0x1f4){logger[_0x601a('0x10')](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x1b6bf7(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}logger['error'](_0x601a('0x12'),_0x5d94b5,_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);return _0x208472(_0x6c5aab[_0x601a('0x10')][_0x601a('0x13')]);}else{logger[_0x601a('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5d94b5,_0x601a('0xd'));_0x208472(_0x6c5aab[_0x601a('0x14')][_0x601a('0x13')]);}})[_0x601a('0x15')](function(_0x4e1ebf){logger[_0x601a('0x10')]('CloudProvider,\x20%s,\x20%s',_0x5d94b5,_0x4e1ebf);_0x1b6bf7(_0x4e1ebf);});});}
\ No newline at end of file
+var _0xba5a=['error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x4c0de6,_0x4f95d0){var _0x47795b=function(_0x27a7fb){while(--_0x27a7fb){_0x4c0de6['push'](_0x4c0de6['shift']());}};_0x47795b(++_0x4f95d0);}(_0xba5a,0x1d0));var _0xaba5=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0xba5a[_0x4a9beb];return _0x2d4c58;};'use strict';var _=require('lodash');var util=require(_0xaba5('0x0'));var moment=require(_0xaba5('0x1'));var BPromise=require(_0xaba5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaba5('0x3'))['db'];var utils=require(_0xaba5('0x4'));var logger=require(_0xaba5('0x5'))(_0xaba5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaba5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e6b46,_0x2ef868,_0x1dba58){return new BPromise(function(_0x3772a2,_0x45f5ea){return client[_0xaba5('0x8')](_0x5e6b46,_0x1dba58)['then'](function(_0x3be776){logger[_0xaba5('0x9')](_0xaba5('0xa'),_0x2ef868,_0xaba5('0xb'));logger[_0xaba5('0xc')](_0xaba5('0xd'),_0x2ef868,_0xaba5('0xb'),JSON[_0xaba5('0xe')](_0x3be776));if(_0x3be776['error']){if(_0x3be776['error'][_0xaba5('0xf')]===0x1f4){logger['error'](_0xaba5('0xa'),_0x2ef868,_0x3be776['error']['message']);return _0x45f5ea(_0x3be776[_0xaba5('0x10')][_0xaba5('0x11')]);}logger[_0xaba5('0x10')](_0xaba5('0xa'),_0x2ef868,_0x3be776[_0xaba5('0x10')][_0xaba5('0x11')]);return _0x3772a2(_0x3be776[_0xaba5('0x10')]['message']);}else{logger['info'](_0xaba5('0xa'),_0x2ef868,_0xaba5('0xb'));_0x3772a2(_0x3be776[_0xaba5('0x12')][_0xaba5('0x11')]);}})[_0xaba5('0x13')](function(_0x53ec3c){logger[_0xaba5('0x10')]('CloudProvider,\x20%s,\x20%s',_0x2ef868,_0x53ec3c);_0x45f5ea(_0x53ec3c);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 114803d..f07556e 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(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x1261,0x144));var _0x1126=function(_0x3d8240,_0x2663d4){_0x3d8240=_0x3d8240-0x0;var _0x3d0372=_0x1261[_0x3d8240];return _0x3d0372;};'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(_0x3c9ca5,_0x25cbbf){var _0x515ebe=function(_0x2e3b18){while(--_0x2e3b18){_0x3c9ca5['push'](_0x3c9ca5['shift']());}};_0x515ebe(++_0x25cbbf);}(_0xadb5,0xad));var _0x5adb=function(_0x493c72,_0x2018d6){_0x493c72=_0x493c72-0x0;var _0x1924aa=_0xadb5[_0x493c72];return _0x1924aa;};'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 78fe6c1..7240263 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 _0x3151=['sequelize','exports','STRING','name'];(function(_0x1c1683,_0x1e0d74){var _0xc2c5d2=function(_0x8443c7){while(--_0x8443c7){_0x1c1683['push'](_0x1c1683['shift']());}};_0xc2c5d2(++_0x1e0d74);}(_0x3151,0x1c0));var _0x1315=function(_0x22890a,_0x5d3a7a){_0x22890a=_0x22890a-0x0;var _0x3290ae=_0x3151[_0x22890a];return _0x3290ae;};'use strict';var Sequelize=require(_0x1315('0x0'));module[_0x1315('0x1')]={'name':{'type':Sequelize[_0x1315('0x2')],'unique':_0x1315('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1315('0x2')]},'companyId':{'type':Sequelize[_0x1315('0x2')]},'website':{'type':Sequelize[_0x1315('0x2')]},'phone':{'type':Sequelize[_0x1315('0x2')]},'fax':{'type':Sequelize[_0x1315('0x2')]},'type':{'type':Sequelize[_0x1315('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1315('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1315('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1315('0x2')]},'sStreet':{'type':Sequelize[_0x1315('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1315('0x2')]},'sCountry':{'type':Sequelize[_0x1315('0x2')]},'description':{'type':Sequelize[_0x1315('0x2')]}};
\ No newline at end of file
+var _0xba4d=['STRING','name','sequelize'];(function(_0x1012a0,_0x52bc09){var _0xf439d1=function(_0x33c572){while(--_0x33c572){_0x1012a0['push'](_0x1012a0['shift']());}};_0xf439d1(++_0x52bc09);}(_0xba4d,0x15b));var _0xdba4=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0xba4d[_0x555b2f];return _0x81c0a6;};'use strict';var Sequelize=require(_0xdba4('0x0'));module['exports']={'name':{'type':Sequelize[_0xdba4('0x1')],'unique':_0xdba4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xdba4('0x1')]},'website':{'type':Sequelize[_0xdba4('0x1')]},'phone':{'type':Sequelize[_0xdba4('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xdba4('0x1')]},'postalCode':{'type':Sequelize[_0xdba4('0x1')]},'city':{'type':Sequelize[_0xdba4('0x1')]},'country':{'type':Sequelize[_0xdba4('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xdba4('0x1')]},'sCity':{'type':Sequelize[_0xdba4('0x1')]},'sCountry':{'type':Sequelize[_0xdba4('0x1')]},'description':{'type':Sequelize[_0xdba4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index c1a5a03..1925dd6 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 _0xc67d=['offset','set','Content-Range','apply','reject','update','destroy','then','get','Companies','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','addContacts','CmContact','ids','omit','findOne','getContacts','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xc67d,0x8a));var _0xdc67=function(_0x166fa7,_0x2dcd6d){_0x166fa7=_0x166fa7-0x0;var _0x4e7936=_0xc67d[_0x166fa7];return _0x4e7936;};'use strict';var emlformat=require(_0xdc67('0x0'));var rimraf=require(_0xdc67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdc67('0x2'));var moment=require(_0xdc67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdc67('0x4'));var util=require(_0xdc67('0x5'));var path=require(_0xdc67('0x6'));var sox=require(_0xdc67('0x7'));var csv=require('to-csv');var ejs=require(_0xdc67('0x8'));var fs=require('fs');var fs_extra=require(_0xdc67('0x9'));var _=require(_0xdc67('0xa'));var squel=require(_0xdc67('0xb'));var crypto=require(_0xdc67('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdc67('0xd'));var Papa=require(_0xdc67('0xe'));var Redis=require('ioredis');var authService=require(_0xdc67('0xf'));var qs=require(_0xdc67('0x10'));var as=require(_0xdc67('0x11'));var hardwareService=require(_0xdc67('0x12'));var logger=require(_0xdc67('0x13'))(_0xdc67('0x14'));var utils=require(_0xdc67('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdc67('0x16'));var db=require(_0xdc67('0x17'))['db'];function respondWithStatusCode(_0x2ed298,_0x5758b9){_0x5758b9=_0x5758b9||0xcc;return function(_0x18909b){if(_0x18909b){return _0x2ed298['sendStatus'](_0x5758b9);}return _0x2ed298['status'](_0x5758b9)[_0xdc67('0x18')]();};}function respondWithResult(_0x4d3a40,_0x529b09){_0x529b09=_0x529b09||0xc8;return function(_0x215412){if(_0x215412){return _0x4d3a40[_0xdc67('0x19')](_0x529b09)[_0xdc67('0x1a')](_0x215412);}};}function respondWithFilteredResult(_0x587581,_0x50e070){return function(_0x4a42fe){if(_0x4a42fe){var _0x17007f=typeof _0x50e070['offset']==='undefined'&&typeof _0x50e070[_0xdc67('0x1b')]===_0xdc67('0x1c');var _0x45896d=_0x4a42fe[_0xdc67('0x1d')];var _0x2e49cf=_0x17007f?0x0:_0x50e070[_0xdc67('0x1e')];var _0x5829fe=_0x17007f?_0x4a42fe[_0xdc67('0x1d')]:_0x50e070[_0xdc67('0x1e')]+_0x50e070['limit'];var _0x126905;if(_0x5829fe>=_0x45896d){_0x5829fe=_0x45896d;_0x126905=0xc8;}else{_0x126905=0xce;}_0x587581[_0xdc67('0x19')](_0x126905);return _0x587581[_0xdc67('0x1f')](_0xdc67('0x20'),_0x2e49cf+'-'+_0x5829fe+'/'+_0x45896d)['json'](_0x4a42fe);}return null;};}function patchUpdates(_0x278f40){return function(_0x1301a4){try{jsonpatch[_0xdc67('0x21')](_0x1301a4,_0x278f40,!![]);}catch(_0x10d632){return BPromise[_0xdc67('0x22')](_0x10d632);}return _0x1301a4['save']();};}function saveUpdates(_0x1f4265,_0xef164d){return function(_0x604358){if(_0x604358){return _0x604358[_0xdc67('0x23')](_0x1f4265)['then'](function(_0x1d60c4){return _0x1d60c4;});}return null;};}function removeEntity(_0x2e9841,_0x46cf15){return function(_0x1037e6){if(_0x1037e6){return _0x1037e6[_0xdc67('0x24')]()[_0xdc67('0x25')](function(){var _0x26432a=_0x1037e6[_0xdc67('0x26')]({'plain':!![]});var _0x3012cf=_0xdc67('0x27');return db['UserProfileResource'][_0xdc67('0x24')]({'where':{'type':_0x3012cf,'resourceId':_0x26432a['id']}})['then'](function(){return _0x1037e6;});})[_0xdc67('0x25')](function(){_0x2e9841[_0xdc67('0x19')](0xcc)[_0xdc67('0x18')]();});}};}function handleEntityNotFound(_0x15caab,_0x3b66d8){return function(_0x254509){if(!_0x254509){_0x15caab['sendStatus'](0x194);}return _0x254509;};}function handleError(_0x345635,_0x1441a4){_0x1441a4=_0x1441a4||0x1f4;return function(_0x2b306c){logger['error'](_0x2b306c[_0xdc67('0x28')]);if(_0x2b306c[_0xdc67('0x29')]){delete _0x2b306c['name'];}_0x345635[_0xdc67('0x19')](_0x1441a4)[_0xdc67('0x2a')](_0x2b306c);};}exports[_0xdc67('0x2b')]=function(_0x177d64,_0x4254c7){var _0x549631={},_0x4173d7={},_0x45ad92={'count':0x0,'rows':[]};return db[_0xdc67('0x2c')][_0xdc67('0x2d')]()[_0xdc67('0x25')](function(_0x5946a9){_0x4173d7[_0xdc67('0x2e')]=_[_0xdc67('0x2f')](_0x5946a9);_0x4173d7['query']=_[_0xdc67('0x2f')](_0x177d64[_0xdc67('0x30')]);_0x4173d7[_0xdc67('0x31')]=_[_0xdc67('0x32')](_0x4173d7[_0xdc67('0x2e')],_0x4173d7[_0xdc67('0x30')]);_0x549631[_0xdc67('0x33')]=_[_0xdc67('0x32')](_0x4173d7[_0xdc67('0x2e')],qs['fields'](_0x177d64[_0xdc67('0x30')][_0xdc67('0x34')]));_0x549631[_0xdc67('0x33')]=_0x549631[_0xdc67('0x33')]['length']?_0x549631[_0xdc67('0x33')]:_0x4173d7[_0xdc67('0x2e')];if(!_0x177d64[_0xdc67('0x30')][_0xdc67('0x35')](_0xdc67('0x36'))){_0x549631['limit']=qs[_0xdc67('0x1b')](_0x177d64['query'][_0xdc67('0x1b')]);_0x549631[_0xdc67('0x1e')]=qs['offset'](_0x177d64[_0xdc67('0x30')][_0xdc67('0x1e')]);}_0x549631[_0xdc67('0x37')]=qs['sort'](_0x177d64[_0xdc67('0x30')][_0xdc67('0x38')]);_0x549631['where']=qs[_0xdc67('0x31')](_[_0xdc67('0x39')](_0x177d64[_0xdc67('0x30')],_0x4173d7['filters']),_0x5946a9);if(_0x177d64[_0xdc67('0x30')][_0xdc67('0x3a')]){_0x549631[_0xdc67('0x3b')]=_[_0xdc67('0x3c')](_0x549631[_0xdc67('0x3b')],{'$or':_['map'](_0x549631['attributes'],function(_0x3f1b8d){var _0x1daf00={};_0x1daf00[_0x3f1b8d]={'$like':'%'+_0x177d64[_0xdc67('0x30')]['filter']+'%'};return _0x1daf00;})});}_0x549631=_[_0xdc67('0x3c')]({},_0x549631,_0x177d64['options']);var _0x3b00dd={'where':_0x549631[_0xdc67('0x3b')]};return db[_0xdc67('0x2c')][_0xdc67('0x1d')](_0x3b00dd)[_0xdc67('0x25')](function(_0x5829b7){_0x45ad92['count']=_0x5829b7;if(_0x177d64[_0xdc67('0x30')][_0xdc67('0x3d')]){_0x549631[_0xdc67('0x3e')]=[{'all':!![]}];}return db['CmCompany'][_0xdc67('0x3f')](_0x549631);})[_0xdc67('0x25')](function(_0x505f1d){_0x45ad92[_0xdc67('0x40')]=_0x505f1d;return _0x45ad92;})[_0xdc67('0x25')](respondWithFilteredResult(_0x4254c7,_0x549631))[_0xdc67('0x41')](handleError(_0x4254c7,null));})[_0xdc67('0x41')](handleError(_0x4254c7,null));};exports[_0xdc67('0x42')]=function(_0x5968d3,_0x4617ea){var _0x19aa8b={'raw':![],'where':{'id':_0x5968d3[_0xdc67('0x43')]['id']}},_0x455615={};_0x455615[_0xdc67('0x2e')]=_[_0xdc67('0x2f')](db[_0xdc67('0x2c')]['rawAttributes']);_0x455615[_0xdc67('0x30')]=_[_0xdc67('0x2f')](_0x5968d3['query']);_0x455615['filters']=_[_0xdc67('0x32')](_0x455615[_0xdc67('0x2e')],_0x455615[_0xdc67('0x30')]);_0x19aa8b[_0xdc67('0x33')]=_[_0xdc67('0x32')](_0x455615[_0xdc67('0x2e')],qs['fields'](_0x5968d3[_0xdc67('0x30')][_0xdc67('0x34')]));_0x19aa8b[_0xdc67('0x33')]=_0x19aa8b['attributes'][_0xdc67('0x44')]?_0x19aa8b[_0xdc67('0x33')]:_0x455615[_0xdc67('0x2e')];if(_0x5968d3[_0xdc67('0x30')]['includeAll']){_0x19aa8b['include']=[{'all':!![]}];}_0x19aa8b=_[_0xdc67('0x3c')]({},_0x19aa8b,_0x5968d3[_0xdc67('0x45')]);return db[_0xdc67('0x2c')][_0xdc67('0x46')](_0x19aa8b)[_0xdc67('0x25')](handleEntityNotFound(_0x4617ea,null))[_0xdc67('0x25')](respondWithResult(_0x4617ea,null))['catch'](handleError(_0x4617ea,null));};exports[_0xdc67('0x47')]=function(_0x44d104,_0x4f9a41){return db[_0xdc67('0x2c')]['create'](_0x44d104[_0xdc67('0x48')],{})[_0xdc67('0x25')](function(_0x37cf12){var _0x48e9bd=_0x44d104['user'][_0xdc67('0x26')]({'plain':!![]});if(!_0x48e9bd)throw new Error(_0xdc67('0x49'));if(_0x48e9bd[_0xdc67('0x4a')]==='user'){var _0x29cdd3=_0x37cf12[_0xdc67('0x26')]({'plain':!![]});var _0x30131c=_0xdc67('0x27');return db['UserProfileSection'][_0xdc67('0x46')]({'where':{'name':_0x30131c,'userProfileId':_0x48e9bd[_0xdc67('0x4b')]},'raw':!![]})[_0xdc67('0x25')](function(_0x2362b0){if(_0x2362b0&&_0x2362b0[_0xdc67('0x4c')]===0x0){return db[_0xdc67('0x4d')][_0xdc67('0x47')]({'name':_0x29cdd3[_0xdc67('0x29')],'resourceId':_0x29cdd3['id'],'type':_0x2362b0[_0xdc67('0x29')],'sectionId':_0x2362b0['id']},{})[_0xdc67('0x25')](function(){return _0x37cf12;});}else{return _0x37cf12;}})[_0xdc67('0x41')](function(_0x3b37cf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b37cf);throw _0x3b37cf;});}return _0x37cf12;})[_0xdc67('0x25')](respondWithResult(_0x4f9a41,0xc9))[_0xdc67('0x41')](handleError(_0x4f9a41,null));};exports[_0xdc67('0x23')]=function(_0x1a5b56,_0x1eeac4){if(_0x1a5b56['body']['id']){delete _0x1a5b56['body']['id'];}return db['CmCompany'][_0xdc67('0x46')]({'where':{'id':_0x1a5b56[_0xdc67('0x43')]['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x1eeac4,null))['then'](saveUpdates(_0x1a5b56['body'],null))[_0xdc67('0x25')](respondWithResult(_0x1eeac4,null))[_0xdc67('0x41')](handleError(_0x1eeac4,null));};exports[_0xdc67('0x24')]=function(_0x368a13,_0x4fed80){return db[_0xdc67('0x2c')][_0xdc67('0x46')]({'where':{'id':_0x368a13['params']['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x4fed80,null))[_0xdc67('0x25')](removeEntity(_0x4fed80,null))[_0xdc67('0x41')](handleError(_0x4fed80,null));};exports['describe']=function(_0x1b1ca2,_0x3e41a6){return db[_0xdc67('0x2c')]['describe']()[_0xdc67('0x25')](respondWithResult(_0x3e41a6,null))[_0xdc67('0x41')](handleError(_0x3e41a6,null));};exports[_0xdc67('0x4e')]=function(_0x100fc9,_0x41eff4,_0x384863){return db[_0xdc67('0x4f')][_0xdc67('0x46')]({'where':{'id':_0x100fc9[_0xdc67('0x43')]['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x41eff4,null))['then'](function(_0x1007e3){if(_0x1007e3){return _0x1007e3[_0xdc67('0x4e')](_0x100fc9[_0xdc67('0x48')][_0xdc67('0x50')],_[_0xdc67('0x51')](_0x100fc9['body'],[_0xdc67('0x50'),'id'])||{});}})[_0xdc67('0x25')](respondWithResult(_0x41eff4,null))[_0xdc67('0x41')](handleError(_0x41eff4,null));};exports['getContacts']=function(_0x3dd744,_0x1f7cca,_0x23c046){var _0x551722={};var _0x56d078={};var _0x54f949;var _0x437066;return db[_0xdc67('0x2c')][_0xdc67('0x52')]({'where':{'id':_0x3dd744[_0xdc67('0x43')]['id']}})[_0xdc67('0x25')](handleEntityNotFound(_0x1f7cca,null))[_0xdc67('0x25')](function(_0x269866){if(_0x269866){_0x54f949=_0x269866;_0x56d078[_0xdc67('0x2e')]=_['keys'](db[_0xdc67('0x4f')]['rawAttributes']);_0x56d078[_0xdc67('0x30')]=_[_0xdc67('0x2f')](_0x3dd744['query']);_0x56d078[_0xdc67('0x31')]=_[_0xdc67('0x32')](_0x56d078[_0xdc67('0x2e')],_0x56d078[_0xdc67('0x30')]);_0x551722[_0xdc67('0x33')]=_['intersection'](_0x56d078[_0xdc67('0x2e')],qs[_0xdc67('0x34')](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x34')]));_0x551722[_0xdc67('0x33')]=_0x551722['attributes'][_0xdc67('0x44')]?_0x551722[_0xdc67('0x33')]:_0x56d078[_0xdc67('0x2e')];_0x551722[_0xdc67('0x37')]=qs[_0xdc67('0x38')](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x38')]);_0x551722[_0xdc67('0x3b')]=qs[_0xdc67('0x31')](_[_0xdc67('0x39')](_0x3dd744['query'],_0x56d078[_0xdc67('0x31')]));if(_0x3dd744[_0xdc67('0x30')][_0xdc67('0x3a')]){_0x551722[_0xdc67('0x3b')]=_[_0xdc67('0x3c')](_0x551722[_0xdc67('0x3b')],{'$or':_['map'](_0x551722[_0xdc67('0x33')],function(_0x4d0cfa){var _0xf29d79={};_0xf29d79[_0x4d0cfa]={'$like':'%'+_0x3dd744[_0xdc67('0x30')][_0xdc67('0x3a')]+'%'};return _0xf29d79;})});}_0x551722=_[_0xdc67('0x3c')]({},_0x551722,_0x3dd744['options']);return _0x54f949[_0xdc67('0x53')](_0x551722);}})[_0xdc67('0x25')](function(_0x1ff1ee){if(_0x1ff1ee){_0x437066=_0x1ff1ee[_0xdc67('0x44')];if(!_0x3dd744[_0xdc67('0x30')]['hasOwnProperty'](_0xdc67('0x36'))){_0x551722[_0xdc67('0x1b')]=qs['limit'](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x1b')]);_0x551722['offset']=qs[_0xdc67('0x1e')](_0x3dd744[_0xdc67('0x30')][_0xdc67('0x1e')]);}return _0x54f949[_0xdc67('0x53')](_0x551722);}})[_0xdc67('0x25')](function(_0x569b12){if(_0x569b12){return _0x569b12?{'count':_0x437066,'rows':_0x569b12}:null;}})[_0xdc67('0x25')](respondWithResult(_0x1f7cca,null))['catch'](handleError(_0x1f7cca,null));};
\ No newline at end of file
+var _0x1ccb=['stack','name','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','merge','where','map','filter','options','count','rows','catch','params','rawAttributes','length','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','omit','ids','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','then','destroy','Companies','UserProfileResource','error'];(function(_0x4548ca,_0x4b9074){var _0x45f913=function(_0x16dd4d){while(--_0x16dd4d){_0x4548ca['push'](_0x4548ca['shift']());}};_0x45f913(++_0x4b9074);}(_0x1ccb,0x178));var _0xb1cc=function(_0xf8408d,_0x2c374c){_0xf8408d=_0xf8408d-0x0;var _0x4d0fa2=_0x1ccb[_0xf8408d];return _0x4d0fa2;};'use strict';var emlformat=require(_0xb1cc('0x0'));var rimraf=require(_0xb1cc('0x1'));var zipdir=require(_0xb1cc('0x2'));var jsonpatch=require(_0xb1cc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb1cc('0x4'));var util=require(_0xb1cc('0x5'));var path=require('path');var sox=require(_0xb1cc('0x6'));var csv=require(_0xb1cc('0x7'));var ejs=require(_0xb1cc('0x8'));var fs=require('fs');var fs_extra=require(_0xb1cc('0x9'));var _=require(_0xb1cc('0xa'));var squel=require(_0xb1cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb1cc('0xc'));var deskjs=require(_0xb1cc('0xd'));var toCsv=require(_0xb1cc('0x7'));var querystring=require(_0xb1cc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb1cc('0xf'));var as=require(_0xb1cc('0x10'));var hardwareService=require(_0xb1cc('0x11'));var logger=require(_0xb1cc('0x12'))(_0xb1cc('0x13'));var utils=require(_0xb1cc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb1cc('0x15'));var db=require(_0xb1cc('0x16'))['db'];function respondWithStatusCode(_0x4e3dde,_0x304b65){_0x304b65=_0x304b65||0xcc;return function(_0x946516){if(_0x946516){return _0x4e3dde[_0xb1cc('0x17')](_0x304b65);}return _0x4e3dde[_0xb1cc('0x18')](_0x304b65)[_0xb1cc('0x19')]();};}function respondWithResult(_0x16eaf9,_0x206e98){_0x206e98=_0x206e98||0xc8;return function(_0x3b4aa9){if(_0x3b4aa9){return _0x16eaf9[_0xb1cc('0x18')](_0x206e98)['json'](_0x3b4aa9);}};}function respondWithFilteredResult(_0x4aab54,_0x15e5d8){return function(_0x25e89e){if(_0x25e89e){var _0x30bac9=typeof _0x15e5d8['offset']===_0xb1cc('0x1a')&&typeof _0x15e5d8[_0xb1cc('0x1b')]==='undefined';var _0x11011d=_0x25e89e['count'];var _0x5e39a4=_0x30bac9?0x0:_0x15e5d8[_0xb1cc('0x1c')];var _0xfd21fc=_0x30bac9?_0x25e89e['count']:_0x15e5d8[_0xb1cc('0x1c')]+_0x15e5d8[_0xb1cc('0x1b')];var _0x1a3f12;if(_0xfd21fc>=_0x11011d){_0xfd21fc=_0x11011d;_0x1a3f12=0xc8;}else{_0x1a3f12=0xce;}_0x4aab54[_0xb1cc('0x18')](_0x1a3f12);return _0x4aab54[_0xb1cc('0x1d')](_0xb1cc('0x1e'),_0x5e39a4+'-'+_0xfd21fc+'/'+_0x11011d)[_0xb1cc('0x1f')](_0x25e89e);}return null;};}function patchUpdates(_0x215f0b){return function(_0x3aa055){try{jsonpatch[_0xb1cc('0x20')](_0x3aa055,_0x215f0b,!![]);}catch(_0x421bdd){return BPromise[_0xb1cc('0x21')](_0x421bdd);}return _0x3aa055['save']();};}function saveUpdates(_0x30a2b7,_0x50d1f2){return function(_0x472bda){if(_0x472bda){return _0x472bda['update'](_0x30a2b7)[_0xb1cc('0x22')](function(_0x2f43e0){return _0x2f43e0;});}return null;};}function removeEntity(_0x4a3e38,_0x57e970){return function(_0x1c25f1){if(_0x1c25f1){return _0x1c25f1[_0xb1cc('0x23')]()[_0xb1cc('0x22')](function(){var _0xae0760=_0x1c25f1['get']({'plain':!![]});var _0x3ea486=_0xb1cc('0x24');return db[_0xb1cc('0x25')][_0xb1cc('0x23')]({'where':{'type':_0x3ea486,'resourceId':_0xae0760['id']}})[_0xb1cc('0x22')](function(){return _0x1c25f1;});})[_0xb1cc('0x22')](function(){_0x4a3e38[_0xb1cc('0x18')](0xcc)[_0xb1cc('0x19')]();});}};}function handleEntityNotFound(_0x4c78a4,_0x396fc2){return function(_0x248411){if(!_0x248411){_0x4c78a4[_0xb1cc('0x17')](0x194);}return _0x248411;};}function handleError(_0x54caf2,_0x1d54ed){_0x1d54ed=_0x1d54ed||0x1f4;return function(_0x811083){logger[_0xb1cc('0x26')](_0x811083[_0xb1cc('0x27')]);if(_0x811083['name']){delete _0x811083[_0xb1cc('0x28')];}_0x54caf2[_0xb1cc('0x18')](_0x1d54ed)['send'](_0x811083);};}exports[_0xb1cc('0x29')]=function(_0x3feb1c,_0x5c9b06){var _0x176655={},_0x3f095f={},_0x1c4bb7={'count':0x0,'rows':[]};return db[_0xb1cc('0x2a')][_0xb1cc('0x2b')]()[_0xb1cc('0x22')](function(_0x5079d8){_0x3f095f[_0xb1cc('0x2c')]=_[_0xb1cc('0x2d')](_0x5079d8);_0x3f095f[_0xb1cc('0x2e')]=_[_0xb1cc('0x2d')](_0x3feb1c['query']);_0x3f095f[_0xb1cc('0x2f')]=_['intersection'](_0x3f095f[_0xb1cc('0x2c')],_0x3f095f[_0xb1cc('0x2e')]);_0x176655[_0xb1cc('0x30')]=_[_0xb1cc('0x31')](_0x3f095f[_0xb1cc('0x2c')],qs[_0xb1cc('0x32')](_0x3feb1c[_0xb1cc('0x2e')][_0xb1cc('0x32')]));_0x176655[_0xb1cc('0x30')]=_0x176655['attributes']['length']?_0x176655[_0xb1cc('0x30')]:_0x3f095f[_0xb1cc('0x2c')];if(!_0x3feb1c[_0xb1cc('0x2e')][_0xb1cc('0x33')](_0xb1cc('0x34'))){_0x176655[_0xb1cc('0x1b')]=qs['limit'](_0x3feb1c['query'][_0xb1cc('0x1b')]);_0x176655[_0xb1cc('0x1c')]=qs[_0xb1cc('0x1c')](_0x3feb1c[_0xb1cc('0x2e')]['offset']);}_0x176655[_0xb1cc('0x35')]=qs[_0xb1cc('0x36')](_0x3feb1c['query'][_0xb1cc('0x36')]);_0x176655['where']=qs[_0xb1cc('0x2f')](_['pick'](_0x3feb1c[_0xb1cc('0x2e')],_0x3f095f[_0xb1cc('0x2f')]),_0x5079d8);if(_0x3feb1c[_0xb1cc('0x2e')]['filter']){_0x176655['where']=_[_0xb1cc('0x37')](_0x176655[_0xb1cc('0x38')],{'$or':_[_0xb1cc('0x39')](_0x176655[_0xb1cc('0x30')],function(_0x420a6b){var _0x377def={};_0x377def[_0x420a6b]={'$like':'%'+_0x3feb1c[_0xb1cc('0x2e')][_0xb1cc('0x3a')]+'%'};return _0x377def;})});}_0x176655=_['merge']({},_0x176655,_0x3feb1c[_0xb1cc('0x3b')]);var _0x4f8157={'where':_0x176655['where']};return db[_0xb1cc('0x2a')]['count'](_0x4f8157)['then'](function(_0x157f14){_0x1c4bb7[_0xb1cc('0x3c')]=_0x157f14;if(_0x3feb1c[_0xb1cc('0x2e')]['includeAll']){_0x176655['include']=[{'all':!![]}];}return db[_0xb1cc('0x2a')]['findAll'](_0x176655);})[_0xb1cc('0x22')](function(_0x1807eb){_0x1c4bb7[_0xb1cc('0x3d')]=_0x1807eb;return _0x1c4bb7;})['then'](respondWithFilteredResult(_0x5c9b06,_0x176655))[_0xb1cc('0x3e')](handleError(_0x5c9b06,null));})[_0xb1cc('0x3e')](handleError(_0x5c9b06,null));};exports['show']=function(_0x14f938,_0x254f3c){var _0x1b87f6={'raw':![],'where':{'id':_0x14f938[_0xb1cc('0x3f')]['id']}},_0x29783e={};_0x29783e[_0xb1cc('0x2c')]=_['keys'](db[_0xb1cc('0x2a')][_0xb1cc('0x40')]);_0x29783e[_0xb1cc('0x2e')]=_['keys'](_0x14f938[_0xb1cc('0x2e')]);_0x29783e[_0xb1cc('0x2f')]=_[_0xb1cc('0x31')](_0x29783e[_0xb1cc('0x2c')],_0x29783e['query']);_0x1b87f6[_0xb1cc('0x30')]=_['intersection'](_0x29783e['model'],qs[_0xb1cc('0x32')](_0x14f938['query'][_0xb1cc('0x32')]));_0x1b87f6[_0xb1cc('0x30')]=_0x1b87f6[_0xb1cc('0x30')][_0xb1cc('0x41')]?_0x1b87f6['attributes']:_0x29783e[_0xb1cc('0x2c')];if(_0x14f938[_0xb1cc('0x2e')][_0xb1cc('0x42')]){_0x1b87f6[_0xb1cc('0x43')]=[{'all':!![]}];}_0x1b87f6=_[_0xb1cc('0x37')]({},_0x1b87f6,_0x14f938[_0xb1cc('0x3b')]);return db[_0xb1cc('0x2a')][_0xb1cc('0x44')](_0x1b87f6)[_0xb1cc('0x22')](handleEntityNotFound(_0x254f3c,null))['then'](respondWithResult(_0x254f3c,null))[_0xb1cc('0x3e')](handleError(_0x254f3c,null));};exports[_0xb1cc('0x45')]=function(_0x2ace43,_0x5d8a66){return db['CmCompany'][_0xb1cc('0x45')](_0x2ace43[_0xb1cc('0x46')],{})[_0xb1cc('0x22')](function(_0x2faa1e){var _0x2d4c84=_0x2ace43[_0xb1cc('0x47')][_0xb1cc('0x48')]({'plain':!![]});if(!_0x2d4c84)throw new Error(_0xb1cc('0x49'));if(_0x2d4c84['role']===_0xb1cc('0x47')){var _0x223243=_0x2faa1e[_0xb1cc('0x48')]({'plain':!![]});var _0x4b65b8='Companies';return db['UserProfileSection']['find']({'where':{'name':_0x4b65b8,'userProfileId':_0x2d4c84[_0xb1cc('0x4a')]},'raw':!![]})[_0xb1cc('0x22')](function(_0x52482c){if(_0x52482c&&_0x52482c[_0xb1cc('0x4b')]===0x0){return db[_0xb1cc('0x25')][_0xb1cc('0x45')]({'name':_0x223243[_0xb1cc('0x28')],'resourceId':_0x223243['id'],'type':_0x52482c[_0xb1cc('0x28')],'sectionId':_0x52482c['id']},{})[_0xb1cc('0x22')](function(){return _0x2faa1e;});}else{return _0x2faa1e;}})[_0xb1cc('0x3e')](function(_0x367564){logger[_0xb1cc('0x26')](_0xb1cc('0x4c'),_0x367564);throw _0x367564;});}return _0x2faa1e;})[_0xb1cc('0x22')](respondWithResult(_0x5d8a66,0xc9))[_0xb1cc('0x3e')](handleError(_0x5d8a66,null));};exports[_0xb1cc('0x4d')]=function(_0x278f3e,_0x1631a3){if(_0x278f3e[_0xb1cc('0x46')]['id']){delete _0x278f3e[_0xb1cc('0x46')]['id'];}return db[_0xb1cc('0x2a')][_0xb1cc('0x44')]({'where':{'id':_0x278f3e['params']['id']}})[_0xb1cc('0x22')](handleEntityNotFound(_0x1631a3,null))[_0xb1cc('0x22')](saveUpdates(_0x278f3e[_0xb1cc('0x46')],null))[_0xb1cc('0x22')](respondWithResult(_0x1631a3,null))[_0xb1cc('0x3e')](handleError(_0x1631a3,null));};exports['destroy']=function(_0x1bce8d,_0x1e90a3){return db[_0xb1cc('0x2a')][_0xb1cc('0x44')]({'where':{'id':_0x1bce8d['params']['id']}})[_0xb1cc('0x22')](handleEntityNotFound(_0x1e90a3,null))[_0xb1cc('0x22')](removeEntity(_0x1e90a3,null))[_0xb1cc('0x3e')](handleError(_0x1e90a3,null));};exports[_0xb1cc('0x2b')]=function(_0x3f10e0,_0x23b31a){return db[_0xb1cc('0x2a')][_0xb1cc('0x2b')]()[_0xb1cc('0x22')](respondWithResult(_0x23b31a,null))[_0xb1cc('0x3e')](handleError(_0x23b31a,null));};exports[_0xb1cc('0x4e')]=function(_0x16f994,_0x5d59b,_0x5ba40){return db[_0xb1cc('0x4f')]['find']({'where':{'id':_0x16f994['params']['id']}})['then'](handleEntityNotFound(_0x5d59b,null))[_0xb1cc('0x22')](function(_0x379eb1){if(_0x379eb1){return _0x379eb1[_0xb1cc('0x4e')](_0x16f994[_0xb1cc('0x46')]['ids'],_[_0xb1cc('0x50')](_0x16f994[_0xb1cc('0x46')],[_0xb1cc('0x51'),'id'])||{});}})['then'](respondWithResult(_0x5d59b,null))[_0xb1cc('0x3e')](handleError(_0x5d59b,null));};exports[_0xb1cc('0x52')]=function(_0x13ea9d,_0x5a648f,_0x4f7d4b){var _0x2b986a={};var _0x377104={};var _0x5c5271;var _0x3305c1;return db[_0xb1cc('0x2a')]['findOne']({'where':{'id':_0x13ea9d['params']['id']}})[_0xb1cc('0x22')](handleEntityNotFound(_0x5a648f,null))[_0xb1cc('0x22')](function(_0x325ca2){if(_0x325ca2){_0x5c5271=_0x325ca2;_0x377104['model']=_[_0xb1cc('0x2d')](db[_0xb1cc('0x4f')][_0xb1cc('0x40')]);_0x377104[_0xb1cc('0x2e')]=_[_0xb1cc('0x2d')](_0x13ea9d[_0xb1cc('0x2e')]);_0x377104['filters']=_[_0xb1cc('0x31')](_0x377104[_0xb1cc('0x2c')],_0x377104['query']);_0x2b986a[_0xb1cc('0x30')]=_[_0xb1cc('0x31')](_0x377104[_0xb1cc('0x2c')],qs[_0xb1cc('0x32')](_0x13ea9d[_0xb1cc('0x2e')][_0xb1cc('0x32')]));_0x2b986a[_0xb1cc('0x30')]=_0x2b986a['attributes'][_0xb1cc('0x41')]?_0x2b986a[_0xb1cc('0x30')]:_0x377104[_0xb1cc('0x2c')];_0x2b986a[_0xb1cc('0x35')]=qs[_0xb1cc('0x36')](_0x13ea9d['query'][_0xb1cc('0x36')]);_0x2b986a['where']=qs[_0xb1cc('0x2f')](_['pick'](_0x13ea9d[_0xb1cc('0x2e')],_0x377104[_0xb1cc('0x2f')]));if(_0x13ea9d['query'][_0xb1cc('0x3a')]){_0x2b986a['where']=_[_0xb1cc('0x37')](_0x2b986a['where'],{'$or':_[_0xb1cc('0x39')](_0x2b986a[_0xb1cc('0x30')],function(_0x34f797){var _0xab4d88={};_0xab4d88[_0x34f797]={'$like':'%'+_0x13ea9d['query'][_0xb1cc('0x3a')]+'%'};return _0xab4d88;})});}_0x2b986a=_[_0xb1cc('0x37')]({},_0x2b986a,_0x13ea9d['options']);return _0x5c5271[_0xb1cc('0x52')](_0x2b986a);}})['then'](function(_0x5bd85d){if(_0x5bd85d){_0x3305c1=_0x5bd85d[_0xb1cc('0x41')];if(!_0x13ea9d[_0xb1cc('0x2e')][_0xb1cc('0x33')](_0xb1cc('0x34'))){_0x2b986a[_0xb1cc('0x1b')]=qs[_0xb1cc('0x1b')](_0x13ea9d[_0xb1cc('0x2e')][_0xb1cc('0x1b')]);_0x2b986a[_0xb1cc('0x1c')]=qs['offset'](_0x13ea9d['query'][_0xb1cc('0x1c')]);}return _0x5c5271['getContacts'](_0x2b986a);}})['then'](function(_0x42cef8){if(_0x42cef8){return _0x42cef8?{'count':_0x3305c1,'rows':_0x42cef8}:null;}})[_0xb1cc('0x22')](respondWithResult(_0x5a648f,null))[_0xb1cc('0x3e')](handleError(_0x5a648f,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 8ed9081..85d968c 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 _0xcd8b=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes','exports','define','cm_companies'];(function(_0x56ceab,_0x3943c0){var _0x2d54af=function(_0x2b6bdb){while(--_0x2b6bdb){_0x56ceab['push'](_0x56ceab['shift']());}};_0x2d54af(++_0x3943c0);}(_0xcd8b,0x1c8));var _0xbcd8=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xcd8b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xbcd8('0x0'));var util=require(_0xbcd8('0x1'));var logger=require(_0xbcd8('0x2'))(_0xbcd8('0x3'));var moment=require(_0xbcd8('0x4'));var BPromise=require('bluebird');var rp=require(_0xbcd8('0x5'));var fs=require('fs');var path=require(_0xbcd8('0x6'));var rimraf=require(_0xbcd8('0x7'));var config=require('../../config/environment');var attributes=require(_0xbcd8('0x8'));module[_0xbcd8('0x9')]=function(_0x5523e2,_0x57628f){return _0x5523e2[_0xbcd8('0xa')]('CmCompany',attributes,{'tableName':_0xbcd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ae0=['CmCompany','cm_companies','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x1ae0,0x147));var _0x01ae=function(_0x49c5af,_0x29c031){_0x49c5af=_0x49c5af-0x0;var _0x2111e6=_0x1ae0[_0x49c5af];return _0x2111e6;};'use strict';var _=require(_0x01ae('0x0'));var util=require(_0x01ae('0x1'));var logger=require('../../config/logger')(_0x01ae('0x2'));var moment=require('moment');var BPromise=require(_0x01ae('0x3'));var rp=require(_0x01ae('0x4'));var fs=require('fs');var path=require(_0x01ae('0x5'));var rimraf=require(_0x01ae('0x6'));var config=require(_0x01ae('0x7'));var attributes=require(_0x01ae('0x8'));module[_0x01ae('0x9')]=function(_0x221cbe,_0xfce1ea){return _0x221cbe[_0x01ae('0xa')](_0x01ae('0xb'),attributes,{'tableName':_0x01ae('0xc'),'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 6bc5db1..1608be1 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 _0xa678=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x222909,_0xff8168){var _0x39496c=function(_0x5cc3ee){while(--_0x5cc3ee){_0x222909['push'](_0x222909['shift']());}};_0x39496c(++_0xff8168);}(_0xa678,0x70));var _0x8a67=function(_0x5ccdd5,_0x29f34c){_0x5ccdd5=_0x5ccdd5-0x0;var _0x4eaeaf=_0xa678[_0x5ccdd5];return _0x4eaeaf;};'use strict';var _=require(_0x8a67('0x0'));var util=require(_0x8a67('0x1'));var moment=require(_0x8a67('0x2'));var BPromise=require(_0x8a67('0x3'));var rs=require(_0x8a67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a67('0x5'))['db'];var utils=require(_0x8a67('0x6'));var logger=require(_0x8a67('0x7'))('rpc');var config=require(_0x8a67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8a67('0x9')][_0x8a67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a8f6e,_0x529509,_0x1d8c7b){return new BPromise(function(_0x48ac49,_0x2c2f7d){return client[_0x8a67('0xb')](_0x5a8f6e,_0x1d8c7b)['then'](function(_0x289fa1){logger[_0x8a67('0xc')](_0x8a67('0xd'),_0x529509,'request\x20sent');logger[_0x8a67('0xe')](_0x8a67('0xf'),_0x529509,_0x8a67('0x10'),JSON[_0x8a67('0x11')](_0x289fa1));if(_0x289fa1[_0x8a67('0x12')]){if(_0x289fa1[_0x8a67('0x12')][_0x8a67('0x13')]===0x1f4){logger['error'](_0x8a67('0xd'),_0x529509,_0x289fa1[_0x8a67('0x12')][_0x8a67('0x14')]);return _0x2c2f7d(_0x289fa1['error'][_0x8a67('0x14')]);}logger[_0x8a67('0x12')]('CmCompany,\x20%s,\x20%s',_0x529509,_0x289fa1[_0x8a67('0x12')]['message']);return _0x48ac49(_0x289fa1[_0x8a67('0x12')][_0x8a67('0x14')]);}else{logger[_0x8a67('0xc')](_0x8a67('0xd'),_0x529509,_0x8a67('0x10'));_0x48ac49(_0x289fa1['result']['message']);}})[_0x8a67('0x15')](function(_0x40fc2b){logger[_0x8a67('0x12')](_0x8a67('0xd'),_0x529509,_0x40fc2b);_0x2c2f7d(_0x40fc2b);});});}
\ No newline at end of file
+var _0xce3e=['request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xce3e,0x129));var _0xece3=function(_0x3e29e5,_0x1cd087){_0x3e29e5=_0x3e29e5-0x0;var _0x37f88a=_0xce3e[_0x3e29e5];return _0x37f88a;};'use strict';var _=require('lodash');var util=require(_0xece3('0x0'));var moment=require(_0xece3('0x1'));var BPromise=require(_0xece3('0x2'));var rs=require(_0xece3('0x3'));var fs=require('fs');var Redis=require(_0xece3('0x4'));var db=require(_0xece3('0x5'))['db'];var utils=require(_0xece3('0x6'));var logger=require(_0xece3('0x7'))(_0xece3('0x8'));var config=require(_0xece3('0x9'));var jayson=require(_0xece3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cb3a,_0x4668bc,_0x185d2c){return new BPromise(function(_0x51bcf7,_0x2d2111){return client[_0xece3('0xb')](_0x20cb3a,_0x185d2c)[_0xece3('0xc')](function(_0x792283){logger[_0xece3('0xd')](_0xece3('0xe'),_0x4668bc,'request\x20sent');logger['debug'](_0xece3('0xf'),_0x4668bc,'request\x20sent',JSON[_0xece3('0x10')](_0x792283));if(_0x792283['error']){if(_0x792283[_0xece3('0x11')][_0xece3('0x12')]===0x1f4){logger[_0xece3('0x11')](_0xece3('0xe'),_0x4668bc,_0x792283['error'][_0xece3('0x13')]);return _0x2d2111(_0x792283[_0xece3('0x11')][_0xece3('0x13')]);}logger[_0xece3('0x11')](_0xece3('0xe'),_0x4668bc,_0x792283[_0xece3('0x11')][_0xece3('0x13')]);return _0x51bcf7(_0x792283[_0xece3('0x11')][_0xece3('0x13')]);}else{logger[_0xece3('0xd')](_0xece3('0xe'),_0x4668bc,_0xece3('0x14'));_0x51bcf7(_0x792283['result'][_0xece3('0x13')]);}})[_0xece3('0x15')](function(_0x238aa0){logger[_0xece3('0x11')](_0xece3('0xe'),_0x4668bc,_0x238aa0);_0x2d2111(_0x238aa0);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 1ba243e..664a813 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 _0x5f32=['describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5f32,0x12d));var _0x25f3=function(_0x401701,_0x149dce){_0x401701=_0x401701-0x0;var _0x3da178=_0x5f32[_0x401701];return _0x3da178;};'use strict';var multer=require('multer');var util=require(_0x25f3('0x0'));var path=require(_0x25f3('0x1'));var timeout=require(_0x25f3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25f3('0x3'));var auth=require(_0x25f3('0x4'));var interaction=require(_0x25f3('0x5'));var config=require(_0x25f3('0x6'));var controller=require(_0x25f3('0x7'));router[_0x25f3('0x8')]('/',auth[_0x25f3('0x9')](),controller[_0x25f3('0xa')]);router[_0x25f3('0x8')]('/describe',auth[_0x25f3('0x9')](),controller[_0x25f3('0xb')]);router[_0x25f3('0x8')](_0x25f3('0xc'),auth[_0x25f3('0x9')](),controller[_0x25f3('0xd')]);router[_0x25f3('0x8')](_0x25f3('0xe'),auth['isAuthenticated'](),controller[_0x25f3('0xf')]);router[_0x25f3('0x10')]('/',auth[_0x25f3('0x9')](),controller[_0x25f3('0x11')]);router[_0x25f3('0x10')]('/:id/contacts',auth[_0x25f3('0x9')](),controller[_0x25f3('0x12')]);router[_0x25f3('0x13')](_0x25f3('0xc'),auth[_0x25f3('0x9')](),controller[_0x25f3('0x14')]);router[_0x25f3('0x15')](_0x25f3('0xc'),auth[_0x25f3('0x9')](),controller[_0x25f3('0x16')]);module[_0x25f3('0x17')]=router;
\ No newline at end of file
+var _0xbf13=['addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','create'];(function(_0x2d652f,_0x58c104){var _0x670d67=function(_0x455be5){while(--_0x455be5){_0x2d652f['push'](_0x2d652f['shift']());}};_0x670d67(++_0x58c104);}(_0xbf13,0xe2));var _0x3bf1=function(_0x144a67,_0x52c58b){_0x144a67=_0x144a67-0x0;var _0x67d893=_0xbf13[_0x144a67];return _0x67d893;};'use strict';var multer=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var path=require(_0x3bf1('0x2'));var timeout=require(_0x3bf1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3bf1('0x4'));var auth=require(_0x3bf1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3bf1('0x6'));var controller=require(_0x3bf1('0x7'));router[_0x3bf1('0x8')]('/',auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xa')]);router['get']('/describe',auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xb')]);router['get'](_0x3bf1('0xc'),auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xd')]);router[_0x3bf1('0x8')](_0x3bf1('0xe'),auth[_0x3bf1('0x9')](),controller['getContacts']);router['post']('/',auth[_0x3bf1('0x9')](),controller[_0x3bf1('0xf')]);router['post'](_0x3bf1('0xe'),auth['isAuthenticated'](),controller[_0x3bf1('0x10')]);router[_0x3bf1('0x11')](_0x3bf1('0xc'),auth[_0x3bf1('0x9')](),controller[_0x3bf1('0x12')]);router[_0x3bf1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3bf1('0x14')]);module[_0x3bf1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 7cf2fa4..6cedac0 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 _0x8de0=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x2ee20d,_0x354e70){var _0xade530=function(_0x1db7cc){while(--_0x1db7cc){_0x2ee20d['push'](_0x2ee20d['shift']());}};_0xade530(++_0x354e70);}(_0x8de0,0xcd));var _0x08de=function(_0x5603ac,_0x30ad93){_0x5603ac=_0x5603ac-0x0;var _0xe30eb8=_0x8de0[_0x5603ac];return _0xe30eb8;};'use strict';var _=require(_0x08de('0x0'));var Sequelize=require(_0x08de('0x1'));module[_0x08de('0x2')]={'firstName':{'type':Sequelize[_0x08de('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x08de('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x08de('0x3')]},'city':{'type':Sequelize[_0x08de('0x3')]},'country':{'type':Sequelize[_0x08de('0x3')]},'dateOfBirth':{'type':Sequelize[_0x08de('0x3')]},'description':{'type':Sequelize[_0x08de('0x4')]},'phone':{'type':Sequelize[_0x08de('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x08de('0x3')]},'email':{'type':Sequelize[_0x08de('0x3')]},'url':{'type':Sequelize[_0x08de('0x3')]},'facebook':{'type':Sequelize[_0x08de('0x3')]},'fb_data':{'type':Sequelize[_0x08de('0x3')]},'twitter':{'type':Sequelize[_0x08de('0x3')]},'skype':{'type':Sequelize[_0x08de('0x3')]},'teams':{'type':Sequelize[_0x08de('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x08de('0x3')]},'wechat':{'type':Sequelize[_0x08de('0x3')]},'telegram':{'type':Sequelize[_0x08de('0x3')]},'UserId':{'type':Sequelize[_0x08de('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x08de('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x08de('0x7')],'defaultValue':Sequelize[_0x08de('0x8')]},'dialTimezone':{'type':Sequelize[_0x08de('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x6bf1=['INTEGER','DATE','NOW','exports','STRING','TEXT'];(function(_0x2a0c6c,_0x42f63d){var _0x2300a4=function(_0x47a1b7){while(--_0x47a1b7){_0x2a0c6c['push'](_0x2a0c6c['shift']());}};_0x2300a4(++_0x42f63d);}(_0x6bf1,0x9f));var _0x16bf=function(_0x2bc081,_0x15f9de){_0x2bc081=_0x2bc081-0x0;var _0x8b3bdf=_0x6bf1[_0x2bc081];return _0x8b3bdf;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x16bf('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x16bf('0x1')]},'street':{'type':Sequelize[_0x16bf('0x1')]},'postalCode':{'type':Sequelize[_0x16bf('0x1')]},'city':{'type':Sequelize[_0x16bf('0x1')]},'country':{'type':Sequelize[_0x16bf('0x1')]},'dateOfBirth':{'type':Sequelize[_0x16bf('0x1')]},'description':{'type':Sequelize[_0x16bf('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x16bf('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x16bf('0x1')]},'url':{'type':Sequelize[_0x16bf('0x1')]},'facebook':{'type':Sequelize[_0x16bf('0x1')]},'fb_data':{'type':Sequelize[_0x16bf('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x16bf('0x1')]},'teams':{'type':Sequelize[_0x16bf('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x16bf('0x1')]},'wechat':{'type':Sequelize[_0x16bf('0x1')]},'telegram':{'type':Sequelize[_0x16bf('0x1')]},'UserId':{'type':Sequelize[_0x16bf('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x16bf('0x1')]},'priority':{'type':Sequelize[_0x16bf('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x16bf('0x4')],'defaultValue':Sequelize[_0x16bf('0x5')]},'dialTimezone':{'type':Sequelize[_0x16bf('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 64a70ed..0f68e16 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 _0x3a87=['filters','intersection','fields','attributes','order','sort','filter','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','count','include','rows','CmHopperHistory','pick','ContactId','includeAll','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','createReadStream','parse','meta','import','User','agent','binding','firstName','No\x20firstName\x20column\x20specified','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','exit','getJourney','mail','chat','sms','fax','resolve','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','destination','starttime','endtime','duration','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','DESC','startCase','Website','Account','closedAt','secondDisposition','thirdDisposition','key','Owner','Tags','browserName','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','findAndCountAll','flatten','reverse','value','slice','moment','util','path','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','defaults','redis','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','limit','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','describe','findAll','query','user','catch','destroy','find','params','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','alias','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','CmContact','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','push','all','Tag','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','format','map','isEmpty','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','rawAttributes'];(function(_0x4be687,_0xe630cc){var _0x42156f=function(_0x5ae44b){while(--_0x5ae44b){_0x4be687['push'](_0x4be687['shift']());}};_0x42156f(++_0xe630cc);}(_0x3a87,0x16c));var _0x73a8=function(_0x34b5ca,_0x594010){_0x34b5ca=_0x34b5ca-0x0;var _0x2d72c0=_0x3a87[_0x34b5ca];return _0x2d72c0;};'use strict';var moment=require(_0x73a8('0x0'));var BPromise=require('bluebird');var util=require(_0x73a8('0x1'));var path=require(_0x73a8('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x73a8('0x3'));var Papa=require('papaparse');var Redis=require(_0x73a8('0x4'));var contacts=require(_0x73a8('0x5'));var qs=require(_0x73a8('0x6'));var logger=require(_0x73a8('0x7'))(_0x73a8('0x8'));var config=require(_0x73a8('0x9'));var shared=require(_0x73a8('0xa'));var db=require(_0x73a8('0xb'))['db'];config['redis']=_[_0x73a8('0xc')](config[_0x73a8('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x73a8('0xe'))(new Redis(config[_0x73a8('0xd')]));require(_0x73a8('0xf'))['register'](socket);function respondWithResult(_0x87cf7a,_0x2a3daf){_0x2a3daf=_0x2a3daf||0xc8;return function(_0x4c66bd){if(_0x4c66bd){return _0x87cf7a[_0x73a8('0x10')](_0x2a3daf)[_0x73a8('0x11')](_0x4c66bd);}};}function respondWithFilteredResult(_0x22fde5,_0xff4dc7){return function(_0x166d29){if(_0x166d29){var _0x173241=typeof _0xff4dc7[_0x73a8('0x12')]===_0x73a8('0x13')&&typeof _0xff4dc7[_0x73a8('0x14')]===_0x73a8('0x13');var _0x4e43a7=_0x166d29['count'];var _0xd7852a=_0x173241?0x0:_0xff4dc7['offset'];var _0x7e7258=_0x173241?_0x166d29['count']:_0xff4dc7[_0x73a8('0x12')]+_0xff4dc7['limit'];var _0x41674b;if(_0x7e7258>=_0x4e43a7){_0x7e7258=_0x4e43a7;_0x41674b=0xc8;}else{_0x41674b=0xce;}_0x22fde5['status'](_0x41674b);return _0x22fde5[_0x73a8('0x15')](_0x73a8('0x16'),_0xd7852a+'-'+_0x7e7258+'/'+_0x4e43a7)[_0x73a8('0x11')](_0x166d29);}return null;};}function saveUpdates(_0x3a9608){return function(_0x3b59d0){if(_0x3b59d0){return _0x3b59d0[_0x73a8('0x17')](_0x3a9608)[_0x73a8('0x18')](function(_0x5e4715){return _0x5e4715;});}return null;};}function removeEntity(_0x1685c7){return function(_0x4ef770){if(_0x4ef770){return _0x4ef770['destroy']()[_0x73a8('0x18')](function(){_0x1685c7[_0x73a8('0x10')](0xcc)[_0x73a8('0x19')]();});}};}function handleEntityNotFound(_0x1e491e){return function(_0x2f0e83){if(!_0x2f0e83){_0x1e491e[_0x73a8('0x1a')](0x194);}return _0x2f0e83;};}function handleError(_0x30ba87,_0xb17f8b){_0xb17f8b=_0xb17f8b||0x1f4;return function(_0x5289d7){logger[_0x73a8('0x1b')](_0x5289d7[_0x73a8('0x1c')]);if(_0x5289d7[_0x73a8('0x1d')]){delete _0x5289d7[_0x73a8('0x1d')];}_0x30ba87['status'](_0xb17f8b)[_0x73a8('0x1e')](_0x5289d7);};}exports['index']=function(_0x43abc5,_0x27322d){var _0x57988f={};return contacts[_0x73a8('0x1f')]()[_0x73a8('0x18')](function(_0xee4442){_0x57988f=qs['getOptions'](_0xee4442,_0x43abc5);return contacts[_0x73a8('0x20')](_0x43abc5[_0x73a8('0x21')],_0x43abc5[_0x73a8('0x22')],_0x57988f,_0xee4442);})[_0x73a8('0x18')](respondWithFilteredResult(_0x27322d,_0x57988f))[_0x73a8('0x23')](handleError(_0x27322d,null));};exports[_0x73a8('0x24')]=function(_0x2b6dc5,_0x458162){return db['CmContact'][_0x73a8('0x25')]({'where':{'id':_0x2b6dc5[_0x73a8('0x26')]['id']}})['then'](handleEntityNotFound(_0x458162,null))[_0x73a8('0x18')](removeEntity(_0x458162,null))['catch'](handleError(_0x458162,null));};exports['describe']=function(_0x32139e,_0x25c674){return db['CmContact'][_0x73a8('0x1f')]()[_0x73a8('0x18')](function(_0x4f0654){delete _0x4f0654[_0x73a8('0x27')];for(var _0x54192e=0x0;_0x54192e
','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','email','head','address','@xcally.com','name','substring','split','length','join','Anonymous','value','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c0b,0xff));var _0xb8c0=function(_0x2b2858,_0x3f0832){_0x2b2858=_0x2b2858-0x0;var _0x12a1d8=_0x8c0b[_0x2b2858];return _0x12a1d8;};'use strict';var _=require('lodash');var moment=require(_0xb8c0('0x0'));var random=require(_0xb8c0('0x1'));var fs=require('fs');var path=require(_0xb8c0('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xb8c0('0x3'));var config=require('../../../config/environment');function getAddress(_0x4da1e1){var _0x43d0c0=_[_0xb8c0('0x4')](_0x4da1e1['value']);return _0x43d0c0&&_0x43d0c0[_0xb8c0('0x5')]?_0x43d0c0[_0xb8c0('0x5')]:'anonymous'+random['generate'](0x6)+_0xb8c0('0x6');}function getFirstName(_0x4c6c99){var _0x16dec9=_[_0xb8c0('0x4')](_0x4c6c99['value']);if(_0x16dec9&&_0x16dec9['name']){if(_0x16dec9[_0xb8c0('0x7')]==_0x16dec9['address']){return _0x16dec9[_0xb8c0('0x7')][_0xb8c0('0x8')](0x0,_0x16dec9[_0xb8c0('0x7')]['indexOf']('@'));}var _0x1677aa=_0x16dec9[_0xb8c0('0x7')][_0xb8c0('0x9')](/\s+/);return _0x1677aa[_0xb8c0('0xa')]>0x1?_0x1677aa['slice'](0x0,-0x1)[_0xb8c0('0xb')]('\x20'):_0x16dec9[_0xb8c0('0x7')];}return _0xb8c0('0xc');}function getLastName(_0xce78ca){var _0x92febb=_[_0xb8c0('0x4')](_0xce78ca[_0xb8c0('0xd')]);if(_0x92febb&&_0x92febb[_0xb8c0('0x7')]){var _0x228408=_0x92febb[_0xb8c0('0x7')][_0xb8c0('0x9')](/\s+/);return _0x228408[_0xb8c0('0xa')]>0x1?_0x228408[_0xb8c0('0xe')]():'';}return'';}function getMails(_0x5f36d0,_0x385e43){var _0x33305d='';for(var _0x1e1f8a=0x0;_0x1e1f8a<_0x385e43['value'][_0xb8c0('0xa')];_0x1e1f8a+=0x1){if(_0x385e43[_0xb8c0('0xd')][_0x1e1f8a][_0xb8c0('0x5')]!==_0x5f36d0){if(!_[_0xb8c0('0xf')](_0x33305d)){_0x33305d+=',';}_0x33305d+=_0x385e43['value'][_0x1e1f8a][_0xb8c0('0x7')]||_0x385e43[_0xb8c0('0xd')][_0x1e1f8a][_0xb8c0('0x5')]||'';_0x33305d+='\x20<';_0x33305d+=_0x385e43['value'][_0x1e1f8a][_0xb8c0('0x5')]?_0x385e43[_0xb8c0('0xd')][_0x1e1f8a][_0xb8c0('0x5')]:'anonymous'+random['generate'](0x6)+_0xb8c0('0x6');_0x33305d+='>';}}return _0x33305d;}function parseEmail(_0x162309,_0x550095,_0x1d729f){if(_0x550095[_0xb8c0('0x10')]){var _0x36ec39=/