From: support
Date: Wed, 14 Sep 2022 10:04:26 +0000 (+0000)
Subject: Built motion from commit 7b0fe325.|2.6.15
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=d51a0250047c2cf3c46d26643ae8cb7d188a8017;p=motion2.git
Built motion from commit 7b0fe325.|2.6.15
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c1065e1..143afd6 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-09-13T15:41:49.318Z",
+ "time": "2022-09-14T09:56:19.074Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 2978dc0..44f3444 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-09-13T15:41:49.318Z",
+ "time": "2022-09-14T09:56:19.074Z",
"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 377d8c2..300900a 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 _0x2be9=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x2be9,0x1c6));var _0x92be=function(_0x4d270e,_0x409796){_0x4d270e=_0x4d270e-0x0;var _0x377f75=_0x2be9[_0x4d270e];return _0x377f75;};'use strict';var Sequelize=require(_0x92be('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ecd65){return this[_0x92be('0x1')]('action');}},'action':{'type':Sequelize[_0x92be('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x92be('0x3'),_0x92be('0x4'),_0x92be('0x5'),_0x92be('0x6'),_0x92be('0x7'),_0x92be('0x8'),_0x92be('0x9'),_0x92be('0xa')]],'msg':_0x92be('0xb')}},'comment':_0x92be('0xb')},'data1':{'type':Sequelize[_0x92be('0x2')](0x1000),'comment':_0x92be('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x92be('0x2')](0x1000),'comment':_0x92be('0xd')},'data4':{'type':Sequelize[_0x92be('0x2')](0x1000),'comments':_0x92be('0xe')},'data5':{'type':Sequelize[_0x92be('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x92be('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xed8e=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','browser'];(function(_0x2e7702,_0x4cabfd){var _0x350ce7=function(_0x8ee440){while(--_0x8ee440){_0x2e7702['push'](_0x2e7702['shift']());}};_0x350ce7(++_0x4cabfd);}(_0xed8e,0x14d));var _0xeed8=function(_0x1781e3,_0x187097){_0x1781e3=_0x1781e3-0x0;var _0x33acb8=_0xed8e[_0x1781e3];return _0x33acb8;};'use strict';var Sequelize=require(_0xeed8('0x0'));module[_0xeed8('0x1')]={'name':{'type':Sequelize[_0xeed8('0x2')],'get':function(_0x16a979){return this[_0xeed8('0x3')](_0xeed8('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xeed8('0x5'),_0xeed8('0x6'),'motionbar',_0xeed8('0x7'),'urlForward',_0xeed8('0x8'),_0xeed8('0x9'),_0xeed8('0xa')]],'msg':_0xeed8('0xb')}},'comment':_0xeed8('0xb')},'data1':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xd')},'data2':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xe')},'data3':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xf')},'data4':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comments':_0xeed8('0x10')},'data5':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xeed8('0xc')],'comments':_0xeed8('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 1d66df1..cd538c8 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 _0x9971=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','body','Action','find','params','then','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x9971,0x84));var _0x1997=function(_0x478abd,_0x353a4a){_0x478abd=_0x478abd-0x0;var _0x23e2b7=_0x9971[_0x478abd];return _0x23e2b7;};'use strict';var emlformat=require(_0x1997('0x0'));var rimraf=require(_0x1997('0x1'));var zipdir=require(_0x1997('0x2'));var jsonpatch=require(_0x1997('0x3'));var rp=require(_0x1997('0x4'));var moment=require(_0x1997('0x5'));var BPromise=require(_0x1997('0x6'));var Mustache=require(_0x1997('0x7'));var util=require(_0x1997('0x8'));var path=require(_0x1997('0x9'));var sox=require(_0x1997('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1997('0xb'));var _=require('lodash');var squel=require(_0x1997('0xc'));var crypto=require(_0x1997('0xd'));var jsforce=require(_0x1997('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1997('0xf'));var Redis=require('ioredis');var authService=require(_0x1997('0x10'));var qs=require(_0x1997('0x11'));var as=require(_0x1997('0x12'));var hardwareService=require(_0x1997('0x13'));var logger=require(_0x1997('0x14'))(_0x1997('0x15'));var utils=require(_0x1997('0x16'));var config=require(_0x1997('0x17'));var licenseUtil=require(_0x1997('0x18'));var db=require(_0x1997('0x19'))['db'];function respondWithStatusCode(_0x3d97f0,_0x151a18){_0x151a18=_0x151a18||0xcc;return function(_0x3e48fe){if(_0x3e48fe){return _0x3d97f0[_0x1997('0x1a')](_0x151a18);}return _0x3d97f0['status'](_0x151a18)[_0x1997('0x1b')]();};}function respondWithResult(_0x4ff512,_0x3da72a){_0x3da72a=_0x3da72a||0xc8;return function(_0x5cdbfd){if(_0x5cdbfd){return _0x4ff512[_0x1997('0x1c')](_0x3da72a)[_0x1997('0x1d')](_0x5cdbfd);}};}function respondWithFilteredResult(_0x2353c7,_0x40ff1b){return function(_0x2e9b88){if(_0x2e9b88){var _0x26c257=typeof _0x40ff1b[_0x1997('0x1e')]===_0x1997('0x1f')&&typeof _0x40ff1b[_0x1997('0x20')]===_0x1997('0x1f');var _0x2add5a=_0x2e9b88[_0x1997('0x21')];var _0x4253e0=_0x26c257?0x0:_0x40ff1b[_0x1997('0x1e')];var _0x39562e=_0x26c257?_0x2e9b88[_0x1997('0x21')]:_0x40ff1b[_0x1997('0x1e')]+_0x40ff1b[_0x1997('0x20')];var _0x2f2271;if(_0x39562e>=_0x2add5a){_0x39562e=_0x2add5a;_0x2f2271=0xc8;}else{_0x2f2271=0xce;}_0x2353c7[_0x1997('0x1c')](_0x2f2271);return _0x2353c7[_0x1997('0x22')](_0x1997('0x23'),_0x4253e0+'-'+_0x39562e+'/'+_0x2add5a)[_0x1997('0x1d')](_0x2e9b88);}return null;};}function patchUpdates(_0xcbe1f2){return function(_0x300e43){try{jsonpatch['apply'](_0x300e43,_0xcbe1f2,!![]);}catch(_0x5844db){return BPromise[_0x1997('0x24')](_0x5844db);}return _0x300e43[_0x1997('0x25')]();};}function saveUpdates(_0x267db7,_0x530baa){return function(_0x33528a){if(_0x33528a){return _0x33528a[_0x1997('0x26')](_0x267db7)['then'](function(_0x5d9529){return _0x5d9529;});}return null;};}function removeEntity(_0x57a3f5,_0x47698d){return function(_0x4df6ea){if(_0x4df6ea){return _0x4df6ea[_0x1997('0x27')]()['then'](function(){_0x57a3f5[_0x1997('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f404,_0x54a340){return function(_0x20a206){if(!_0x20a206){_0x17f404[_0x1997('0x1a')](0x194);}return _0x20a206;};}function handleError(_0x4bcc1f,_0x43ba47){_0x43ba47=_0x43ba47||0x1f4;return function(_0x585eaa){logger[_0x1997('0x28')](_0x585eaa[_0x1997('0x29')]);if(_0x585eaa[_0x1997('0x2a')]){delete _0x585eaa['name'];}_0x4bcc1f['status'](_0x43ba47)[_0x1997('0x2b')](_0x585eaa);};}exports[_0x1997('0x26')]=function(_0x48cb99,_0x2d8954){if(_0x48cb99[_0x1997('0x2c')]['id']){delete _0x48cb99['body']['id'];}return db[_0x1997('0x2d')][_0x1997('0x2e')]({'where':{'id':_0x48cb99[_0x1997('0x2f')]['id']}})[_0x1997('0x30')](handleEntityNotFound(_0x2d8954,null))[_0x1997('0x30')](saveUpdates(_0x48cb99[_0x1997('0x2c')],null))['then'](respondWithResult(_0x2d8954,null))[_0x1997('0x31')](handleError(_0x2d8954,null));};exports[_0x1997('0x27')]=function(_0x5d4f06,_0x36f2da){return db[_0x1997('0x2d')]['find']({'where':{'id':_0x5d4f06[_0x1997('0x2f')]['id']}})[_0x1997('0x30')](handleEntityNotFound(_0x36f2da,null))[_0x1997('0x30')](removeEntity(_0x36f2da,null))[_0x1997('0x31')](handleError(_0x36f2da,null));};
\ No newline at end of file
+var _0xc1e5=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','sendStatus','error','stack','name','send','update','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x37dd78,_0x6e31b7){var _0x39cd1b=function(_0x3c9171){while(--_0x3c9171){_0x37dd78['push'](_0x37dd78['shift']());}};_0x39cd1b(++_0x6e31b7);}(_0xc1e5,0x85));var _0x5c1e=function(_0x3390de,_0x4fecd1){_0x3390de=_0x3390de-0x0;var _0x4abd4b=_0xc1e5[_0x3390de];return _0x4abd4b;};'use strict';var emlformat=require(_0x5c1e('0x0'));var rimraf=require(_0x5c1e('0x1'));var zipdir=require(_0x5c1e('0x2'));var jsonpatch=require(_0x5c1e('0x3'));var rp=require(_0x5c1e('0x4'));var moment=require(_0x5c1e('0x5'));var BPromise=require(_0x5c1e('0x6'));var Mustache=require('mustache');var util=require(_0x5c1e('0x7'));var path=require(_0x5c1e('0x8'));var sox=require('sox');var csv=require(_0x5c1e('0x9'));var ejs=require(_0x5c1e('0xa'));var fs=require('fs');var fs_extra=require(_0x5c1e('0xb'));var _=require(_0x5c1e('0xc'));var squel=require(_0x5c1e('0xd'));var crypto=require(_0x5c1e('0xe'));var jsforce=require(_0x5c1e('0xf'));var deskjs=require(_0x5c1e('0x10'));var toCsv=require(_0x5c1e('0x9'));var querystring=require('querystring');var Papa=require(_0x5c1e('0x11'));var Redis=require(_0x5c1e('0x12'));var authService=require(_0x5c1e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5c1e('0x14'));var hardwareService=require(_0x5c1e('0x15'));var logger=require(_0x5c1e('0x16'))('api');var utils=require(_0x5c1e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5c1e('0x18'));var db=require(_0x5c1e('0x19'))['db'];function respondWithStatusCode(_0x56a677,_0x166be4){_0x166be4=_0x166be4||0xcc;return function(_0x2d761a){if(_0x2d761a){return _0x56a677['sendStatus'](_0x166be4);}return _0x56a677[_0x5c1e('0x1a')](_0x166be4)[_0x5c1e('0x1b')]();};}function respondWithResult(_0x51073b,_0x154650){_0x154650=_0x154650||0xc8;return function(_0x51a76f){if(_0x51a76f){return _0x51073b[_0x5c1e('0x1a')](_0x154650)['json'](_0x51a76f);}};}function respondWithFilteredResult(_0x307f72,_0x251ba1){return function(_0x2b6b66){if(_0x2b6b66){var _0x55923f=typeof _0x251ba1[_0x5c1e('0x1c')]===_0x5c1e('0x1d')&&typeof _0x251ba1[_0x5c1e('0x1e')]===_0x5c1e('0x1d');var _0x251d0c=_0x2b6b66['count'];var _0x46d39f=_0x55923f?0x0:_0x251ba1[_0x5c1e('0x1c')];var _0x5729f6=_0x55923f?_0x2b6b66[_0x5c1e('0x1f')]:_0x251ba1['offset']+_0x251ba1['limit'];var _0x58d27e;if(_0x5729f6>=_0x251d0c){_0x5729f6=_0x251d0c;_0x58d27e=0xc8;}else{_0x58d27e=0xce;}_0x307f72[_0x5c1e('0x1a')](_0x58d27e);return _0x307f72[_0x5c1e('0x20')](_0x5c1e('0x21'),_0x46d39f+'-'+_0x5729f6+'/'+_0x251d0c)[_0x5c1e('0x22')](_0x2b6b66);}return null;};}function patchUpdates(_0x168200){return function(_0x3097c0){try{jsonpatch[_0x5c1e('0x23')](_0x3097c0,_0x168200,!![]);}catch(_0xd51208){return BPromise['reject'](_0xd51208);}return _0x3097c0['save']();};}function saveUpdates(_0x3ad3d8,_0x62eeca){return function(_0x5073ce){if(_0x5073ce){return _0x5073ce['update'](_0x3ad3d8)[_0x5c1e('0x24')](function(_0x49d8f6){return _0x49d8f6;});}return null;};}function removeEntity(_0x1efc34,_0xc4a4e){return function(_0x4afd0c){if(_0x4afd0c){return _0x4afd0c[_0x5c1e('0x25')]()[_0x5c1e('0x24')](function(){_0x1efc34[_0x5c1e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4ed7,_0x4d4d62){return function(_0x77c36){if(!_0x77c36){_0x5e4ed7[_0x5c1e('0x26')](0x194);}return _0x77c36;};}function handleError(_0xc41ace,_0x4facab){_0x4facab=_0x4facab||0x1f4;return function(_0x3dab81){logger[_0x5c1e('0x27')](_0x3dab81[_0x5c1e('0x28')]);if(_0x3dab81[_0x5c1e('0x29')]){delete _0x3dab81['name'];}_0xc41ace['status'](_0x4facab)[_0x5c1e('0x2a')](_0x3dab81);};}exports[_0x5c1e('0x2b')]=function(_0x194458,_0x3c8d4e){if(_0x194458[_0x5c1e('0x2c')]['id']){delete _0x194458[_0x5c1e('0x2c')]['id'];}return db['Action'][_0x5c1e('0x2d')]({'where':{'id':_0x194458[_0x5c1e('0x2e')]['id']}})[_0x5c1e('0x24')](handleEntityNotFound(_0x3c8d4e,null))[_0x5c1e('0x24')](saveUpdates(_0x194458['body'],null))['then'](respondWithResult(_0x3c8d4e,null))[_0x5c1e('0x2f')](handleError(_0x3c8d4e,null));};exports[_0x5c1e('0x25')]=function(_0x4f7b9,_0x338fb9){return db[_0x5c1e('0x30')][_0x5c1e('0x2d')]({'where':{'id':_0x4f7b9['params']['id']}})[_0x5c1e('0x24')](handleEntityNotFound(_0x338fb9,null))[_0x5c1e('0x24')](removeEntity(_0x338fb9,null))[_0x5c1e('0x2f')](handleError(_0x338fb9,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 8e6720b..3286417 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 _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','tools_actions','../../config/logger','api'];(function(_0xb15182,_0x48d8fb){var _0x4a8749=function(_0x28684d){while(--_0x28684d){_0xb15182['push'](_0xb15182['shift']());}};_0x4a8749(++_0x48d8fb);}(_0x1339,0x1ed));var _0x9133=function(_0x4c534c,_0x253245){_0x4c534c=_0x4c534c-0x0;var _0x4a075f=_0x1339[_0x4c534c];return _0x4a075f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./action.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x489a=['bluebird','request-promise','path','rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','moment'];(function(_0x256360,_0x5127b){var _0x1175f1=function(_0x7cfbbf){while(--_0x7cfbbf){_0x256360['push'](_0x256360['shift']());}};_0x1175f1(++_0x5127b);}(_0x489a,0x1c4));var _0xa489=function(_0x23d7c5,_0x2a7547){_0x23d7c5=_0x23d7c5-0x0;var _0x350950=_0x489a[_0x23d7c5];return _0x350950;};'use strict';var _=require(_0xa489('0x0'));var util=require(_0xa489('0x1'));var logger=require(_0xa489('0x2'))('api');var moment=require(_0xa489('0x3'));var BPromise=require(_0xa489('0x4'));var rp=require(_0xa489('0x5'));var fs=require('fs');var path=require(_0xa489('0x6'));var rimraf=require(_0xa489('0x7'));var config=require('../../config/environment');var attributes=require(_0xa489('0x8'));module['exports']=function(_0x5666fc,_0x3bb04a){return _0x5666fc[_0xa489('0x9')](_0xa489('0xa'),attributes,{'tableName':_0xa489('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index b59db26..55c5f8a 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3ae42b,_0x3f0d1b){_0x3ae42b=_0x3ae42b-0x0;var _0x22e828=_0x1cb9[_0x3ae42b];return _0x22e828;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4eb841,_0x5c3f51){_0x4eb841=_0x4eb841-0x0;var _0x52557f=_0x1cb9[_0x4eb841];return _0x52557f;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 9256e2b..feaaf7d 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 _0xaea0=['delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update'];(function(_0x17b17a,_0x7ddf03){var _0x3c0e44=function(_0x4a86a1){while(--_0x4a86a1){_0x17b17a['push'](_0x17b17a['shift']());}};_0x3c0e44(++_0x7ddf03);}(_0xaea0,0xc3));var _0x0aea=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xaea0[_0x903228];return _0xcec81d;};'use strict';var multer=require('multer');var util=require(_0x0aea('0x0'));var path=require(_0x0aea('0x1'));var timeout=require(_0x0aea('0x2'));var express=require(_0x0aea('0x3'));var router=express[_0x0aea('0x4')]();var fs_extra=require(_0x0aea('0x5'));var auth=require(_0x0aea('0x6'));var interaction=require(_0x0aea('0x7'));var config=require(_0x0aea('0x8'));var controller=require(_0x0aea('0x9'));router[_0x0aea('0xa')]('/:id',auth[_0x0aea('0xb')](),controller[_0x0aea('0xc')]);router[_0x0aea('0xd')](_0x0aea('0xe'),auth[_0x0aea('0xb')](),controller['destroy']);module[_0x0aea('0xf')]=router;
\ No newline at end of file
+var _0x59e9=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','isAuthenticated','delete'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x59e9,0x173));var _0x959e=function(_0x3a7d3a,_0x3e14a8){_0x3a7d3a=_0x3a7d3a-0x0;var _0x5a0252=_0x59e9[_0x3a7d3a];return _0x5a0252;};'use strict';var multer=require(_0x959e('0x0'));var util=require(_0x959e('0x1'));var path=require(_0x959e('0x2'));var timeout=require(_0x959e('0x3'));var express=require(_0x959e('0x4'));var router=express[_0x959e('0x5')]();var fs_extra=require(_0x959e('0x6'));var auth=require(_0x959e('0x7'));var interaction=require(_0x959e('0x8'));var config=require('../../config/environment');var controller=require(_0x959e('0x9'));router[_0x959e('0xa')]('/:id',auth[_0x959e('0xb')](),controller['update']);router[_0x959e('0xc')](_0x959e('0xd'),auth['isAuthenticated'](),controller[_0x959e('0xe')]);module[_0x959e('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 81916f4..c78550a 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0xdc97,0x13b));var _0x7dc9=function(_0x345c51,_0x2545c5){_0x345c51=_0x345c51-0x0;var _0x57bedf=_0xdc97[_0x345c51];return _0x57bedf;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0x31f0=['sequelize','STRING','TEXT'];(function(_0x58d8bd,_0x2ffe00){var _0x5c06f5=function(_0x3ca641){while(--_0x3ca641){_0x58d8bd['push'](_0x58d8bd['shift']());}};_0x5c06f5(++_0x2ffe00);}(_0x31f0,0xb7));var _0x031f=function(_0x1f0486,_0x3bbb5d){_0x1f0486=_0x1f0486-0x0;var _0xc3e1c4=_0x31f0[_0x1f0486];return _0xc3e1c4;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 571ba8e..2c95d1d 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 _0x4af2=['limit','undefined','count','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','IS\x20NOT\x20NULL','IS\x20EMPTY','getFields','Sequelize','AnalyticMetric','keyBy','metric','DESC','clone','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','COUNT(*)','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset'];(function(_0x460cac,_0x246028){var _0x26f3ab=function(_0x5ef8ab){while(--_0x5ef8ab){_0x460cac['push'](_0x460cac['shift']());}};_0x26f3ab(++_0x246028);}(_0x4af2,0x1d7));var _0x24af=function(_0x4697bd,_0x7863ef){_0x4697bd=_0x4697bd-0x0;var _0x104247=_0x4af2[_0x4697bd];return _0x104247;};'use strict';var emlformat=require(_0x24af('0x0'));var rimraf=require(_0x24af('0x1'));var zipdir=require(_0x24af('0x2'));var jsonpatch=require(_0x24af('0x3'));var rp=require(_0x24af('0x4'));var moment=require('moment');var BPromise=require(_0x24af('0x5'));var Mustache=require(_0x24af('0x6'));var util=require(_0x24af('0x7'));var path=require(_0x24af('0x8'));var sox=require(_0x24af('0x9'));var csv=require(_0x24af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24af('0xb'));var squel=require(_0x24af('0xc'));var crypto=require('crypto');var jsforce=require(_0x24af('0xd'));var deskjs=require(_0x24af('0xe'));var toCsv=require('to-csv');var querystring=require(_0x24af('0xf'));var Papa=require('papaparse');var Redis=require(_0x24af('0x10'));var authService=require(_0x24af('0x11'));var qs=require(_0x24af('0x12'));var as=require(_0x24af('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24af('0x14'))(_0x24af('0x15'));var utils=require(_0x24af('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x24af('0x17'))[_0x24af('0x18')];function respondWithStatusCode(_0x5b2b3e,_0x48ea05){_0x48ea05=_0x48ea05||0xcc;return function(_0x1964a1){if(_0x1964a1){return _0x5b2b3e[_0x24af('0x19')](_0x48ea05);}return _0x5b2b3e[_0x24af('0x1a')](_0x48ea05)[_0x24af('0x1b')]();};}function respondWithResult(_0xf6a39f,_0x1ccd6d){_0x1ccd6d=_0x1ccd6d||0xc8;return function(_0x2a1ddc){if(_0x2a1ddc){return _0xf6a39f[_0x24af('0x1a')](_0x1ccd6d)[_0x24af('0x1c')](_0x2a1ddc);}};}function respondWithFilteredResult(_0xd3c5a,_0x47e62a){return function(_0x5ab676){if(_0x5ab676){var _0xaf8693=typeof _0x47e62a[_0x24af('0x1d')]==='undefined'&&typeof _0x47e62a[_0x24af('0x1e')]===_0x24af('0x1f');var _0x5c8758=_0x5ab676[_0x24af('0x20')];var _0x386d7f=_0xaf8693?0x0:_0x47e62a[_0x24af('0x1d')];var _0x516bfe=_0xaf8693?_0x5ab676[_0x24af('0x20')]:_0x47e62a[_0x24af('0x1d')]+_0x47e62a[_0x24af('0x1e')];var _0x36b254;if(_0x516bfe>=_0x5c8758){_0x516bfe=_0x5c8758;_0x36b254=0xc8;}else{_0x36b254=0xce;}_0xd3c5a[_0x24af('0x1a')](_0x36b254);return _0xd3c5a['set'](_0x24af('0x21'),_0x386d7f+'-'+_0x516bfe+'/'+_0x5c8758)[_0x24af('0x1c')](_0x5ab676);}return null;};}function patchUpdates(_0xcaea02){return function(_0x330b38){try{jsonpatch[_0x24af('0x22')](_0x330b38,_0xcaea02,!![]);}catch(_0x2676b0){return BPromise[_0x24af('0x23')](_0x2676b0);}return _0x330b38['save']();};}function saveUpdates(_0xf01400,_0xfab509){return function(_0x31150b){if(_0x31150b){return _0x31150b[_0x24af('0x24')](_0xf01400)[_0x24af('0x25')](function(_0x50c6dc){return _0x50c6dc;});}return null;};}function removeEntity(_0x4d2a5e,_0x39a574){return function(_0x5d8aef){if(_0x5d8aef){return _0x5d8aef[_0x24af('0x26')]()[_0x24af('0x25')](function(){var _0x24639a=_0x5d8aef[_0x24af('0x27')]({'plain':!![]});var _0x5022e8=_0x24af('0x28');return db[_0x24af('0x29')]['destroy']({'where':{'type':_0x5022e8,'resourceId':_0x24639a['id']}})['then'](function(){return _0x5d8aef;});})[_0x24af('0x25')](function(){_0x4d2a5e[_0x24af('0x1a')](0xcc)[_0x24af('0x1b')]();});}};}function handleEntityNotFound(_0x20e3c3,_0x1d4440){return function(_0x2ee5cd){if(!_0x2ee5cd){_0x20e3c3[_0x24af('0x19')](0x194);}return _0x2ee5cd;};}function handleError(_0x51e58b,_0x3024b2){_0x3024b2=_0x3024b2||0x1f4;return function(_0x156a08){logger[_0x24af('0x2a')](_0x156a08[_0x24af('0x2b')]);if(_0x156a08['name']){delete _0x156a08['name'];}_0x51e58b[_0x24af('0x1a')](_0x3024b2)['send'](_0x156a08);};}exports[_0x24af('0x2c')]=function(_0x420368,_0x41950d){var _0x27a598={},_0x5271ca={},_0x214a79={'count':0x0,'rows':[]};var _0x76066f=_[_0x24af('0x2d')](db[_0x24af('0x2e')][_0x24af('0x2f')],function(_0x5de550){return{'name':_0x5de550[_0x24af('0x30')],'type':_0x5de550[_0x24af('0x31')][_0x24af('0x32')]};});_0x5271ca[_0x24af('0x33')]=_[_0x24af('0x2d')](_0x76066f,_0x24af('0x34'));_0x5271ca[_0x24af('0x35')]=_[_0x24af('0x36')](_0x420368[_0x24af('0x35')]);_0x5271ca[_0x24af('0x37')]=_[_0x24af('0x38')](_0x5271ca[_0x24af('0x33')],_0x5271ca[_0x24af('0x35')]);_0x27a598[_0x24af('0x39')]=_[_0x24af('0x38')](_0x5271ca[_0x24af('0x33')],qs[_0x24af('0x3a')](_0x420368[_0x24af('0x35')][_0x24af('0x3a')]));_0x27a598[_0x24af('0x39')]=_0x27a598['attributes'][_0x24af('0x3b')]?_0x27a598['attributes']:_0x5271ca[_0x24af('0x33')];if(!_0x420368[_0x24af('0x35')][_0x24af('0x3c')](_0x24af('0x3d'))){_0x27a598[_0x24af('0x1e')]=qs['limit'](_0x420368[_0x24af('0x35')][_0x24af('0x1e')]);_0x27a598[_0x24af('0x1d')]=qs[_0x24af('0x1d')](_0x420368[_0x24af('0x35')][_0x24af('0x1d')]);}_0x27a598[_0x24af('0x3e')]=qs[_0x24af('0x3f')](_0x420368[_0x24af('0x35')][_0x24af('0x3f')]);_0x27a598[_0x24af('0x40')]=qs[_0x24af('0x37')](_[_0x24af('0x41')](_0x420368[_0x24af('0x35')],_0x5271ca[_0x24af('0x37')]),_0x76066f);if(_0x420368['query']['filter']){_0x27a598[_0x24af('0x40')]=_[_0x24af('0x42')](_0x27a598[_0x24af('0x40')],{'$or':_[_0x24af('0x2d')](_0x76066f,function(_0x2bb34e){if(_0x2bb34e[_0x24af('0x31')]!==_0x24af('0x43')){var _0x3e71a3={};_0x3e71a3[_0x2bb34e[_0x24af('0x34')]]={'$like':'%'+_0x420368['query'][_0x24af('0x44')]+'%'};return _0x3e71a3;}})});}_0x27a598=_[_0x24af('0x42')]({},_0x27a598,_0x420368[_0x24af('0x45')]);var _0x576c1f={'where':_0x27a598['where']};return db[_0x24af('0x2e')][_0x24af('0x20')](_0x576c1f)[_0x24af('0x25')](function(_0x41fa91){_0x214a79[_0x24af('0x20')]=_0x41fa91;if(_0x420368[_0x24af('0x35')][_0x24af('0x46')]){_0x27a598[_0x24af('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x24af('0x48')](_0x27a598);})[_0x24af('0x25')](function(_0x7eb1a6){_0x214a79[_0x24af('0x49')]=_0x7eb1a6;return _0x214a79;})[_0x24af('0x25')](respondWithFilteredResult(_0x41950d,_0x27a598))[_0x24af('0x4a')](handleError(_0x41950d,null));};exports['show']=function(_0x19ea3d,_0x36f38c){var _0x537e36={'raw':![],'where':{'id':_0x19ea3d[_0x24af('0x4b')]['id']}},_0x147779={};_0x147779[_0x24af('0x33')]=_[_0x24af('0x36')](db[_0x24af('0x2e')][_0x24af('0x2f')]);_0x147779[_0x24af('0x35')]=_[_0x24af('0x36')](_0x19ea3d[_0x24af('0x35')]);_0x147779['filters']=_[_0x24af('0x38')](_0x147779[_0x24af('0x33')],_0x147779['query']);_0x537e36[_0x24af('0x39')]=_['intersection'](_0x147779[_0x24af('0x33')],qs[_0x24af('0x3a')](_0x19ea3d[_0x24af('0x35')][_0x24af('0x3a')]));_0x537e36[_0x24af('0x39')]=_0x537e36[_0x24af('0x39')][_0x24af('0x3b')]?_0x537e36[_0x24af('0x39')]:_0x147779[_0x24af('0x33')];if(_0x19ea3d[_0x24af('0x35')][_0x24af('0x46')]){_0x537e36[_0x24af('0x47')]=[{'all':!![]}];}_0x537e36=_[_0x24af('0x42')]({},_0x537e36,_0x19ea3d[_0x24af('0x45')]);return db[_0x24af('0x2e')][_0x24af('0x4c')](_0x537e36)[_0x24af('0x25')](handleEntityNotFound(_0x36f38c,null))['then'](respondWithResult(_0x36f38c,null))[_0x24af('0x4a')](handleError(_0x36f38c,null));};exports[_0x24af('0x4d')]=function(_0x142520,_0x92cd6e){return db[_0x24af('0x2e')][_0x24af('0x4d')](_0x142520[_0x24af('0x4e')],{})[_0x24af('0x25')](function(_0x5bfe92){var _0x574309=_0x142520['user'][_0x24af('0x27')]({'plain':!![]});if(!_0x574309)throw new Error(_0x24af('0x4f'));if(_0x574309['role']===_0x24af('0x50')){var _0x4d857f=_0x5bfe92['get']({'plain':!![]});var _0xfa3e7a=_0x24af('0x51');return db[_0x24af('0x52')][_0x24af('0x4c')]({'where':{'name':_0xfa3e7a,'userProfileId':_0x574309[_0x24af('0x53')]},'raw':!![]})[_0x24af('0x25')](function(_0xbe797f){if(_0xbe797f&&_0xbe797f[_0x24af('0x54')]===0x0){return db[_0x24af('0x29')]['create']({'name':_0x4d857f[_0x24af('0x34')],'resourceId':_0x4d857f['id'],'type':_0x24af('0x28'),'sectionId':_0xbe797f['id']},{})[_0x24af('0x25')](function(){return _0x5bfe92;});}else{return _0x5bfe92;}})['catch'](function(_0x5e3165){logger['error'](_0x24af('0x55'),_0x5e3165);throw _0x5e3165;});}return _0x5bfe92;})[_0x24af('0x25')](respondWithResult(_0x92cd6e,0xc9))[_0x24af('0x4a')](handleError(_0x92cd6e,null));};exports[_0x24af('0x24')]=function(_0x37b7c0,_0x44bafa){if(_0x37b7c0[_0x24af('0x4e')]['id']){delete _0x37b7c0[_0x24af('0x4e')]['id'];}return db[_0x24af('0x2e')]['find']({'where':{'id':_0x37b7c0[_0x24af('0x4b')]['id']}})[_0x24af('0x25')](handleEntityNotFound(_0x44bafa,null))[_0x24af('0x25')](saveUpdates(_0x37b7c0[_0x24af('0x4e')],null))['then'](respondWithResult(_0x44bafa,null))[_0x24af('0x4a')](handleError(_0x44bafa,null));};exports[_0x24af('0x26')]=function(_0x4bf9a0,_0x41e6a1){return db[_0x24af('0x2e')][_0x24af('0x4c')]({'where':{'id':_0x4bf9a0['params']['id']}})['then'](handleEntityNotFound(_0x41e6a1,null))[_0x24af('0x25')](removeEntity(_0x41e6a1,null))[_0x24af('0x4a')](handleError(_0x41e6a1,null));};exports['preview']=function(_0x29bae1,_0x49dbe3){var _0x3d92dd=0xa;var _0x5be1d0=[_0x24af('0x56'),'left_join',_0x24af('0x57'),_0x24af('0x58')];var _0x2cfa66={'SUM':_0x24af('0x59'),'COUNT':_0x24af('0x5a'),'COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':_0x24af('0x5d'),'AVG':_0x24af('0x5e'),'GROUP_CONCAT':_0x24af('0x5f'),'GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':_0x24af('0x61')};var _0x3522d1={'SEC_TO_TIME':_0x24af('0x62'),'DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x36d2d8=function(_0x471bdd){return!_[_0x24af('0x67')]([_0x24af('0x68'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x24af('0x69')],_0x471bdd);};var _0x21b9ca=function(_0x4b3a24){if(!_0x4b3a24||!_0x4b3a24[_0x24af('0x6a')][_0x24af('0x3b')]){return'';}for(var _0x28fa48='(',_0x3dfc92=0x0;_0x3dfc92<_0x4b3a24[_0x24af('0x6a')]['length'];_0x3dfc92+=0x1){_0x3dfc92>0x0&&(_0x28fa48+='\x20'+_0x4b3a24[_0x24af('0x6b')]+'\x20');_0x28fa48+=_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6c')]?_0x21b9ca(_0x4b3a24['rules'][_0x3dfc92]['group']):_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6d')]+'\x20'+_0x4b3a24['rules'][_0x3dfc92][_0x24af('0x6e')]+(_0x36d2d8(_0x4b3a24[_0x24af('0x6a')][_0x3dfc92]['condition'])?'\x20'+_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6f')]:'');}return _0x28fa48+')';};var _0x1b52a7={'where':{'id':_0x29bae1['params']['id']}},_0x3a00ab,_0xfe7388,_0x1bfafe,_0x51a24f,_0x1792cf;_0x1b52a7=_['merge']({},_0x1b52a7,_0x29bae1[_0x24af('0x45')]);return db[_0x24af('0x2e')][_0x24af('0x4c')](_0x1b52a7)['then'](function(_0x304d60){if(_0x304d60){_0x3a00ab=_0x304d60;return _0x304d60['getFields']();}return null;})[_0x24af('0x25')](function(_0x5c52ff){if(_0x5c52ff){if(!_0x5c52ff[_0x24af('0x3b')]){throw new db['Sequelize'][(_0x24af('0x70'))](_0x24af('0x71'),0x193);}_0xfe7388=_0x5c52ff;return db['AnalyticMetric'][_0x24af('0x48')]({'raw':!![]});}return null;})[_0x24af('0x25')](function(_0x5b78e1){if(_0x5b78e1){_0x1bfafe=_['keyBy'](_0x5b78e1,'id');var _0x4e75db;var _0x2ad921=squel[_0x24af('0x72')]();_0x2ad921[_0x24af('0x73')](_0x3a00ab['table']);for(var _0xaba8bf=0x0;_0xaba8bf<_0xfe7388[_0x24af('0x3b')];_0xaba8bf+=0x1){_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x74')]?_0x1bfafe[_0xfe7388[_0xaba8bf][_0x24af('0x74')]]['metric']:_0xfe7388[_0xaba8bf][_0x24af('0x6d')];_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x75')]?_[_0x24af('0x76')](_0x2cfa66[_0xfe7388[_0xaba8bf][_0x24af('0x75')]],'%s',_0x4e75db):_0x4e75db;_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x77')]?_['replace'](_0x3522d1[_0xfe7388[_0xaba8bf][_0x24af('0x77')]],'%s',_0x4e75db):_0x4e75db;if(_0xfe7388[_0xaba8bf][_0x24af('0x78')]){_0x2ad921[_0x24af('0x6c')](_0x4e75db);}_0xfe7388[_0xaba8bf][_0x24af('0x79')]&&_0x2ad921[_0x24af('0x3e')](_0x4e75db,_0xfe7388[_0xaba8bf][_0x24af('0x79')]==='DESC'?![]:!![]);_0x2ad921[_0x24af('0x6d')](_0x4e75db,_0xfe7388[_0xaba8bf][_0x24af('0x7a')]||_0x4e75db);}if(_0x3a00ab[_0x24af('0x7b')]){_0x3a00ab['joins']=JSON['parse'](_0x3a00ab['joins']);for(var _0x37a036=0x0;_0x37a036<_0x3a00ab[_0x24af('0x7b')][_0x24af('0x3b')];_0x37a036+=0x1){if(_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')]&&_[_0x24af('0x67')](_0x5be1d0,_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')])&&_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7c')]&&_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')]&&_0x3a00ab[_0x24af('0x7b')][_0x37a036]['foreignKey']){_0x2ad921[_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')]](_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')],null,util[_0x24af('0x77')](_0x24af('0x7e'),_0x3a00ab[_0x24af('0x7f')],_0x3a00ab[_0x24af('0x7b')][_0x37a036]['parentKey'],_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')],_0x3a00ab['joins'][_0x37a036][_0x24af('0x80')]));}}}if(_0x3a00ab[_0x24af('0x81')]){_0x3a00ab[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x3a00ab[_0x24af('0x81')]);_0x2ad921[_0x24af('0x40')](_0x21b9ca(_0x3a00ab['conditions']['group']));}_0x1792cf=_0x2ad921['clone']();_0x2ad921[_0x24af('0x1e')](_0x3d92dd);_0x2ad921[_0x24af('0x1d')](0x0);logger[_0x24af('0x83')](_0x24af('0x84'),_0x2ad921[_0x24af('0x85')]());return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x2ad921[_0x24af('0x85')](),{'type':dbH['sequelize'][_0x24af('0x87')][_0x24af('0x88')]});}})[_0x24af('0x25')](respondWithResult(_0x49dbe3,null))[_0x24af('0x4a')](handleError(_0x49dbe3,null));};function runReport(_0x5a394d,_0xd2b632,_0x6889c3){var _0x361bcb=_0xd2b632['name'];var _0x1ec66b=0xa;var _0xc49d4b=[_0x24af('0x56'),_0x24af('0x89'),_0x24af('0x57'),'cross_join'];var _0x50f95e={'SUM':_0x24af('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x24af('0x5f'),'GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5558bb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x4292d8=function(_0x3f5cb4){return!_[_0x24af('0x67')]([_0x24af('0x68'),_0x24af('0x8a'),_0x24af('0x8b'),_0x24af('0x69')],_0x3f5cb4);};var _0xb8ba3b=function(_0x5c09cd){if(!_0x5c09cd||!_0x5c09cd['rules'][_0x24af('0x3b')]){return'';}for(var _0x4f1ac3='(',_0xfe62e4=0x0;_0xfe62e4<_0x5c09cd[_0x24af('0x6a')][_0x24af('0x3b')];_0xfe62e4+=0x1){_0xfe62e4>0x0&&(_0x4f1ac3+='\x20'+_0x5c09cd[_0x24af('0x6b')]+'\x20');_0x4f1ac3+=_0x5c09cd[_0x24af('0x6a')][_0xfe62e4]['group']?_0xb8ba3b(_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6c')]):_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6d')]+'\x20'+_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6e')]+(_0x4292d8(_0x5c09cd[_0x24af('0x6a')][_0xfe62e4]['condition'])?'\x20'+_0x5c09cd['rules'][_0xfe62e4][_0x24af('0x6f')]:'');}return _0x4f1ac3+')';};var _0x3560b3={'where':{'id':_0x5a394d['id']}},_0x2d73af,_0x2057d1,_0x5a6104,_0x689746,_0x4d1606;_0x3560b3=_[_0x24af('0x42')]({},_0x3560b3,_0x6889c3);return db['AnalyticCustomReport']['find'](_0x3560b3)[_0x24af('0x25')](function(_0x37c4f){if(_0x37c4f){_0x2d73af=_0x37c4f;return _0x37c4f[_0x24af('0x8c')]();}return null;})[_0x24af('0x25')](function(_0x1111d1){if(_0x1111d1){if(!_0x1111d1['length']){throw new db[(_0x24af('0x8d'))][(_0x24af('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2057d1=_0x1111d1;return db[_0x24af('0x8e')][_0x24af('0x48')]({'raw':!![]});}return null;})[_0x24af('0x25')](function(_0x5a0d62){if(_0x5a0d62){_0x5a6104=_[_0x24af('0x8f')](_0x5a0d62,'id');var _0x36e49a;var _0xd3984d=squel[_0x24af('0x72')]();_0xd3984d[_0x24af('0x73')](_0x2d73af['table']);for(var _0x267531=0x0;_0x267531<_0x2057d1[_0x24af('0x3b')];_0x267531+=0x1){_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x74')]?_0x5a6104[_0x2057d1[_0x267531]['MetricId']][_0x24af('0x90')]:_0x2057d1[_0x267531][_0x24af('0x6d')];_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x75')]?_[_0x24af('0x76')](_0x50f95e[_0x2057d1[_0x267531]['function']],'%s',_0x36e49a):_0x36e49a;_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x77')]?_['replace'](_0x5558bb[_0x2057d1[_0x267531]['format']],'%s',_0x36e49a):_0x36e49a;if(_0x2057d1[_0x267531]['groupBy']){_0xd3984d[_0x24af('0x6c')](_0x36e49a);}_0x2057d1[_0x267531][_0x24af('0x79')]&&_0xd3984d[_0x24af('0x3e')](_0x36e49a,_0x2057d1[_0x267531][_0x24af('0x79')]===_0x24af('0x91')?![]:!![]);_0xd3984d[_0x24af('0x6d')](_0x36e49a,_0x2057d1[_0x267531]['alias']||_0x36e49a);}if(_0x2d73af[_0x24af('0x7b')]){_0x2d73af['joins']=JSON[_0x24af('0x82')](_0x2d73af[_0x24af('0x7b')]);for(var _0x5773c9=0x0;_0x5773c9<_0x2d73af['joins'][_0x24af('0x3b')];_0x5773c9+=0x1){if(_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')]&&_[_0x24af('0x67')](_0xc49d4b,_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')])&&_0x2d73af['joins'][_0x5773c9]['parentKey']&&_0x2d73af[_0x24af('0x7b')][_0x5773c9]['foreignTable']&&_0x2d73af['joins'][_0x5773c9][_0x24af('0x80')]){_0xd3984d[_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')]](_0x2d73af[_0x24af('0x7b')][_0x5773c9]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2d73af[_0x24af('0x7f')],_0x2d73af['joins'][_0x5773c9][_0x24af('0x7c')],_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x7d')],_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x80')]));}}}if(_0x2d73af[_0x24af('0x81')]){_0x2d73af[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x2d73af[_0x24af('0x81')]);_0xd3984d[_0x24af('0x40')](_0xb8ba3b(_0x2d73af['conditions']['group']));}_0x4d1606=_0xd3984d[_0x24af('0x92')]();_0xd3984d[_0x24af('0x1e')](_0x1ec66b);_0xd3984d[_0x24af('0x1d')](0x0);return;}})['then'](function(){if(_0xd2b632[_0x24af('0x93')]===_0x24af('0x94')){return null;}var _0x379bcf=_[_0x24af('0x42')](_0xd2b632,{'name':_0xd2b632[_0x24af('0x95')]||_0xd2b632[_0x24af('0x34')]||_0x2d73af[_0x24af('0x34')],'basename':_0x361bcb,'savename':util['format'](_0x24af('0x96'),_0xd2b632['name']||_0x2d73af[_0x24af('0x34')],require('randomstring')[_0x24af('0x97')](0x4),_0xd2b632[_0x24af('0x93')]||_0x24af('0x98')),'reportId':_0x2d73af['id'],'reportType':_0x24af('0x99')});return db[_0x24af('0x9a')]['create'](_0x379bcf,{'raw':!![]});})[_0x24af('0x25')](function(_0x22ae6f){if(_0x2d73af[_0x24af('0x7f')]===_0x24af('0x9b')){_0x4d1606[_0x24af('0x40')](_0x2d73af[_0x24af('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xd2b632[_0x24af('0x9c')],_0xd2b632[_0x24af('0x9d')]);}else{_0x4d1606[_0x24af('0x40')](_0x2d73af[_0x24af('0x7f')]+_0x24af('0x9e'),_0xd2b632[_0x24af('0x9c')],_0xd2b632['endDate']);}if(_0x22ae6f){logger[_0x24af('0x9f')]('Run\x20Query:',_0x4d1606[_0x24af('0x85')]());require(_0x24af('0xa0'))[_0x24af('0xa1')](path[_0x24af('0x56')](__dirname,'../../components/export/',_0x22ae6f[_0x24af('0x93')]),[_0x22ae6f['id'],_0x4d1606[_0x24af('0x85')](),path[_0x24af('0x56')](__dirname,_0x24af('0xa2'),_0x22ae6f['savename']),_0x361bcb]);return _0x22ae6f;}else{var _0x18082b=squel[_0x24af('0x72')]();_0x18082b['from']('('+_0x4d1606[_0x24af('0x85')]()+')',_0x24af('0xa3'));_0x18082b[_0x24af('0x6d')](_0x24af('0xa4'),'count');_0x4d1606['limit'](_0xd2b632[_0x24af('0x1e')]||_0x1ec66b);_0x4d1606[_0x24af('0x1d')](_0xd2b632['offset']||0x0);return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x18082b[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')][_0x24af('0x87')][_0x24af('0x88')]})[_0x24af('0x25')](function(_0x115400){if(!_0x115400[_0x24af('0x3b')]){_0x689746=0x0;}else{_0x689746=_0x115400[0x0][_0x24af('0x20')]||0x0;}return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x4d1606[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')][_0x24af('0x87')][_0x24af('0x88')]});})['then'](function(_0x3c3339){return{'rows':_0x3c3339||[],'count':_0x689746};});}});}exports[_0x24af('0xa5')]=function(_0x902c42,_0x22a04d){return runReport(_0x902c42['params'],_0x902c42[_0x24af('0x35')],_0x902c42[_0x24af('0x45')])[_0x24af('0x25')](respondWithResult(_0x22a04d,null))[_0x24af('0x4a')](handleError(_0x22a04d,null));};exports[_0x24af('0xa6')]=runReport;exports[_0x24af('0x35')]=function(_0x37836e,_0x2f083b){var _0x456b3b=0xa;var _0x1c69a1=['join',_0x24af('0x89'),'right_join',_0x24af('0x58')];var _0x5635d9={'SUM':_0x24af('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':_0x24af('0x5d'),'AVG':_0x24af('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':_0x24af('0x61')};var _0x41a722={'SEC_TO_TIME':_0x24af('0x62'),'DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x30d5bc=function(_0x423b76){return!_['includes']([_0x24af('0x68'),_0x24af('0x8a'),'IS\x20EMPTY',_0x24af('0x69')],_0x423b76);};var _0x317e29=function(_0x41320f){if(!_0x41320f||!_0x41320f[_0x24af('0x6a')][_0x24af('0x3b')]){return'';}for(var _0x2f13a9='(',_0x21f0fd=0x0;_0x21f0fd<_0x41320f['rules'][_0x24af('0x3b')];_0x21f0fd+=0x1){_0x21f0fd>0x0&&(_0x2f13a9+='\x20'+_0x41320f[_0x24af('0x6b')]+'\x20');_0x2f13a9+=_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6c')]?_0x317e29(_0x41320f[_0x24af('0x6a')][_0x21f0fd]['group']):_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6d')]+'\x20'+_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6e')]+(_0x30d5bc(_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6e')])?'\x20'+_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6f')]:'');}return _0x2f13a9+')';};var _0x59d87d={'where':{'id':_0x37836e[_0x24af('0x4b')]['id']}},_0x4886ca,_0x308f91,_0x184575,_0x4cff40,_0x49f38f;_0x59d87d=_[_0x24af('0x42')]({},_0x59d87d,_0x37836e[_0x24af('0x45')]);return db['AnalyticCustomReport'][_0x24af('0x4c')](_0x59d87d)['then'](function(_0x16c2b8){if(_0x16c2b8){_0x4886ca=_0x16c2b8;return _0x16c2b8[_0x24af('0x8c')]();}return null;})[_0x24af('0x25')](function(_0x505d0c){if(_0x505d0c){if(!_0x505d0c[_0x24af('0x3b')]){throw new db[(_0x24af('0x8d'))][(_0x24af('0x70'))](_0x24af('0x71'),0x193);}_0x308f91=_0x505d0c;return db[_0x24af('0x8e')][_0x24af('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1737a4){if(_0x1737a4){_0x184575=_[_0x24af('0x8f')](_0x1737a4,'id');var _0x2f722b;var _0x395998=squel[_0x24af('0x72')]();_0x395998[_0x24af('0x73')](_0x4886ca['table']);for(var _0x18733d=0x0;_0x18733d<_0x308f91[_0x24af('0x3b')];_0x18733d+=0x1){_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x74')]?_0x184575[_0x308f91[_0x18733d][_0x24af('0x74')]][_0x24af('0x90')]:_0x308f91[_0x18733d][_0x24af('0x6d')];_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x75')]?_[_0x24af('0x76')](_0x5635d9[_0x308f91[_0x18733d][_0x24af('0x75')]],'%s',_0x2f722b):_0x2f722b;_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x77')]?_[_0x24af('0x76')](_0x41a722[_0x308f91[_0x18733d][_0x24af('0x77')]],'%s',_0x2f722b):_0x2f722b;if(_0x308f91[_0x18733d][_0x24af('0x78')]){_0x395998[_0x24af('0x6c')](_0x2f722b);}_0x308f91[_0x18733d][_0x24af('0x79')]&&_0x395998['order'](_0x2f722b,_0x308f91[_0x18733d][_0x24af('0x79')]===_0x24af('0x91')?![]:!![]);_0x395998[_0x24af('0x6d')](_0x2f722b,_0x308f91[_0x18733d][_0x24af('0x7a')]||_0x2f722b);}if(_0x4886ca[_0x24af('0x7b')]){_0x4886ca[_0x24af('0x7b')]=JSON[_0x24af('0x82')](_0x4886ca[_0x24af('0x7b')]);for(var _0x610648=0x0;_0x610648<_0x4886ca[_0x24af('0x7b')][_0x24af('0x3b')];_0x610648+=0x1){if(_0x4886ca['joins'][_0x610648][_0x24af('0x31')]&&_[_0x24af('0x67')](_0x1c69a1,_0x4886ca[_0x24af('0x7b')][_0x610648]['type'])&&_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7c')]&&_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')]&&_0x4886ca[_0x24af('0x7b')][_0x610648]['foreignKey']){_0x395998[_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x31')]](_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')],null,util['format'](_0x24af('0x7e'),_0x4886ca[_0x24af('0x7f')],_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7c')],_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')],_0x4886ca['joins'][_0x610648][_0x24af('0x80')]));}}}if(_0x4886ca['conditions']){_0x4886ca[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x4886ca[_0x24af('0x81')]);_0x395998[_0x24af('0x40')](_0x317e29(_0x4886ca[_0x24af('0x81')][_0x24af('0x6c')]));}_0x49f38f=_0x395998[_0x24af('0x92')]();_0x395998[_0x24af('0x1e')](_0x456b3b);_0x395998[_0x24af('0x1d')](0x0);logger['debug'](_0x24af('0x84'),_0x395998['toString']());return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x395998[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')]['QueryTypes']['SELECT']});}})[_0x24af('0x25')](function(){return{'sql':_0x49f38f[_0x24af('0x85')]()};})[_0x24af('0x25')](respondWithResult(_0x2f083b,null))[_0x24af('0x4a')](handleError(_0x2f083b,null));};
\ No newline at end of file
+var _0x7235=['keyBy','from','groupBy','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','runReport','right_join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','json','offset','limit','count','status','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','AnalyticCustomReport','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','SELECT','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','condition'];(function(_0x25eecc,_0x4b5973){var _0x1aff79=function(_0x59564f){while(--_0x59564f){_0x25eecc['push'](_0x25eecc['shift']());}};_0x1aff79(++_0x4b5973);}(_0x7235,0xc5));var _0x5723=function(_0x481475,_0x8045e5){_0x481475=_0x481475-0x0;var _0x18deba=_0x7235[_0x481475];return _0x18deba;};'use strict';var emlformat=require(_0x5723('0x0'));var rimraf=require(_0x5723('0x1'));var zipdir=require(_0x5723('0x2'));var jsonpatch=require(_0x5723('0x3'));var rp=require(_0x5723('0x4'));var moment=require(_0x5723('0x5'));var BPromise=require(_0x5723('0x6'));var Mustache=require('mustache');var util=require(_0x5723('0x7'));var path=require('path');var sox=require(_0x5723('0x8'));var csv=require(_0x5723('0x9'));var ejs=require(_0x5723('0xa'));var fs=require('fs');var fs_extra=require(_0x5723('0xb'));var _=require(_0x5723('0xc'));var squel=require(_0x5723('0xd'));var crypto=require(_0x5723('0xe'));var jsforce=require(_0x5723('0xf'));var deskjs=require(_0x5723('0x10'));var toCsv=require(_0x5723('0x9'));var querystring=require(_0x5723('0x11'));var Papa=require('papaparse');var Redis=require(_0x5723('0x12'));var authService=require(_0x5723('0x13'));var qs=require(_0x5723('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5723('0x15'));var logger=require(_0x5723('0x16'))(_0x5723('0x17'));var utils=require(_0x5723('0x18'));var config=require(_0x5723('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x5723('0x1a'))[_0x5723('0x1b')];function respondWithStatusCode(_0x274900,_0x2bda57){_0x2bda57=_0x2bda57||0xcc;return function(_0x1911b8){if(_0x1911b8){return _0x274900[_0x5723('0x1c')](_0x2bda57);}return _0x274900['status'](_0x2bda57)['end']();};}function respondWithResult(_0x333152,_0x211c66){_0x211c66=_0x211c66||0xc8;return function(_0x2fc2d6){if(_0x2fc2d6){return _0x333152['status'](_0x211c66)[_0x5723('0x1d')](_0x2fc2d6);}};}function respondWithFilteredResult(_0x542f91,_0x33d74e){return function(_0x48ac04){if(_0x48ac04){var _0x44a3c0=typeof _0x33d74e[_0x5723('0x1e')]==='undefined'&&typeof _0x33d74e[_0x5723('0x1f')]==='undefined';var _0x5f2ef3=_0x48ac04[_0x5723('0x20')];var _0x2ea346=_0x44a3c0?0x0:_0x33d74e['offset'];var _0x4e86fc=_0x44a3c0?_0x48ac04[_0x5723('0x20')]:_0x33d74e['offset']+_0x33d74e[_0x5723('0x1f')];var _0x32d8af;if(_0x4e86fc>=_0x5f2ef3){_0x4e86fc=_0x5f2ef3;_0x32d8af=0xc8;}else{_0x32d8af=0xce;}_0x542f91[_0x5723('0x21')](_0x32d8af);return _0x542f91[_0x5723('0x22')](_0x5723('0x23'),_0x2ea346+'-'+_0x4e86fc+'/'+_0x5f2ef3)['json'](_0x48ac04);}return null;};}function patchUpdates(_0x19de69){return function(_0x5d5ff9){try{jsonpatch['apply'](_0x5d5ff9,_0x19de69,!![]);}catch(_0x3c1edb){return BPromise[_0x5723('0x24')](_0x3c1edb);}return _0x5d5ff9[_0x5723('0x25')]();};}function saveUpdates(_0x3b85c5,_0x107968){return function(_0x2967a5){if(_0x2967a5){return _0x2967a5['update'](_0x3b85c5)[_0x5723('0x26')](function(_0x5d52a5){return _0x5d52a5;});}return null;};}function removeEntity(_0x1a4254,_0x3ae1a0){return function(_0x1a0100){if(_0x1a0100){return _0x1a0100[_0x5723('0x27')]()[_0x5723('0x26')](function(){var _0x3a0278=_0x1a0100[_0x5723('0x28')]({'plain':!![]});var _0x3b4262='CustomReports';return db[_0x5723('0x29')][_0x5723('0x27')]({'where':{'type':_0x3b4262,'resourceId':_0x3a0278['id']}})[_0x5723('0x26')](function(){return _0x1a0100;});})[_0x5723('0x26')](function(){_0x1a4254[_0x5723('0x21')](0xcc)[_0x5723('0x2a')]();});}};}function handleEntityNotFound(_0x9432e1,_0x4599f3){return function(_0x4db799){if(!_0x4db799){_0x9432e1[_0x5723('0x1c')](0x194);}return _0x4db799;};}function handleError(_0x5adfea,_0x4d164b){_0x4d164b=_0x4d164b||0x1f4;return function(_0x51587b){logger[_0x5723('0x2b')](_0x51587b[_0x5723('0x2c')]);if(_0x51587b[_0x5723('0x2d')]){delete _0x51587b[_0x5723('0x2d')];}_0x5adfea[_0x5723('0x21')](_0x4d164b)[_0x5723('0x2e')](_0x51587b);};}exports['index']=function(_0xd4f3e5,_0x4fa41d){var _0x3dd43b={},_0x4d277c={},_0x225a35={'count':0x0,'rows':[]};var _0x50e5bc=_[_0x5723('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0x443b7c){return{'name':_0x443b7c[_0x5723('0x30')],'type':_0x443b7c[_0x5723('0x31')][_0x5723('0x32')]};});_0x4d277c[_0x5723('0x33')]=_[_0x5723('0x2f')](_0x50e5bc,_0x5723('0x2d'));_0x4d277c[_0x5723('0x34')]=_['keys'](_0xd4f3e5[_0x5723('0x34')]);_0x4d277c[_0x5723('0x35')]=_[_0x5723('0x36')](_0x4d277c[_0x5723('0x33')],_0x4d277c[_0x5723('0x34')]);_0x3dd43b['attributes']=_[_0x5723('0x36')](_0x4d277c[_0x5723('0x33')],qs['fields'](_0xd4f3e5[_0x5723('0x34')][_0x5723('0x37')]));_0x3dd43b[_0x5723('0x38')]=_0x3dd43b['attributes'][_0x5723('0x39')]?_0x3dd43b['attributes']:_0x4d277c['model'];if(!_0xd4f3e5['query'][_0x5723('0x3a')](_0x5723('0x3b'))){_0x3dd43b[_0x5723('0x1f')]=qs[_0x5723('0x1f')](_0xd4f3e5[_0x5723('0x34')][_0x5723('0x1f')]);_0x3dd43b[_0x5723('0x1e')]=qs[_0x5723('0x1e')](_0xd4f3e5[_0x5723('0x34')]['offset']);}_0x3dd43b[_0x5723('0x3c')]=qs[_0x5723('0x3d')](_0xd4f3e5[_0x5723('0x34')]['sort']);_0x3dd43b[_0x5723('0x3e')]=qs[_0x5723('0x35')](_[_0x5723('0x3f')](_0xd4f3e5[_0x5723('0x34')],_0x4d277c[_0x5723('0x35')]),_0x50e5bc);if(_0xd4f3e5[_0x5723('0x34')][_0x5723('0x40')]){_0x3dd43b[_0x5723('0x3e')]=_[_0x5723('0x41')](_0x3dd43b[_0x5723('0x3e')],{'$or':_[_0x5723('0x2f')](_0x50e5bc,function(_0x400b56){if(_0x400b56[_0x5723('0x31')]!==_0x5723('0x42')){var _0x332c6d={};_0x332c6d[_0x400b56['name']]={'$like':'%'+_0xd4f3e5['query'][_0x5723('0x40')]+'%'};return _0x332c6d;}})});}_0x3dd43b=_[_0x5723('0x41')]({},_0x3dd43b,_0xd4f3e5[_0x5723('0x43')]);var _0x52312d={'where':_0x3dd43b[_0x5723('0x3e')]};return db['AnalyticCustomReport']['count'](_0x52312d)[_0x5723('0x26')](function(_0x474f82){_0x225a35[_0x5723('0x20')]=_0x474f82;if(_0xd4f3e5[_0x5723('0x34')][_0x5723('0x44')]){_0x3dd43b[_0x5723('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5723('0x46')](_0x3dd43b);})[_0x5723('0x26')](function(_0x1c207c){_0x225a35['rows']=_0x1c207c;return _0x225a35;})['then'](respondWithFilteredResult(_0x4fa41d,_0x3dd43b))[_0x5723('0x47')](handleError(_0x4fa41d,null));};exports[_0x5723('0x48')]=function(_0x3374c4,_0x10014d){var _0x41f455={'raw':![],'where':{'id':_0x3374c4[_0x5723('0x49')]['id']}},_0xab2f1c={};_0xab2f1c['model']=_[_0x5723('0x4a')](db['AnalyticCustomReport'][_0x5723('0x4b')]);_0xab2f1c['query']=_[_0x5723('0x4a')](_0x3374c4[_0x5723('0x34')]);_0xab2f1c[_0x5723('0x35')]=_[_0x5723('0x36')](_0xab2f1c[_0x5723('0x33')],_0xab2f1c[_0x5723('0x34')]);_0x41f455[_0x5723('0x38')]=_[_0x5723('0x36')](_0xab2f1c[_0x5723('0x33')],qs['fields'](_0x3374c4['query'][_0x5723('0x37')]));_0x41f455[_0x5723('0x38')]=_0x41f455[_0x5723('0x38')]['length']?_0x41f455[_0x5723('0x38')]:_0xab2f1c[_0x5723('0x33')];if(_0x3374c4['query'][_0x5723('0x44')]){_0x41f455['include']=[{'all':!![]}];}_0x41f455=_[_0x5723('0x41')]({},_0x41f455,_0x3374c4['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x41f455)[_0x5723('0x26')](handleEntityNotFound(_0x10014d,null))[_0x5723('0x26')](respondWithResult(_0x10014d,null))[_0x5723('0x47')](handleError(_0x10014d,null));};exports['create']=function(_0x280bb5,_0x3d417a){return db[_0x5723('0x4c')][_0x5723('0x4e')](_0x280bb5['body'],{})[_0x5723('0x26')](function(_0x2df7ad){var _0x3cdc1e=_0x280bb5[_0x5723('0x4f')]['get']({'plain':!![]});if(!_0x3cdc1e)throw new Error(_0x5723('0x50'));if(_0x3cdc1e[_0x5723('0x51')]===_0x5723('0x4f')){var _0x5c3d58=_0x2df7ad[_0x5723('0x28')]({'plain':!![]});var _0x145d69=_0x5723('0x52');return db[_0x5723('0x53')][_0x5723('0x4d')]({'where':{'name':_0x145d69,'userProfileId':_0x3cdc1e['userProfileId']},'raw':!![]})[_0x5723('0x26')](function(_0x1b0fab){if(_0x1b0fab&&_0x1b0fab[_0x5723('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c3d58[_0x5723('0x2d')],'resourceId':_0x5c3d58['id'],'type':_0x5723('0x55'),'sectionId':_0x1b0fab['id']},{})[_0x5723('0x26')](function(){return _0x2df7ad;});}else{return _0x2df7ad;}})['catch'](function(_0x1f47a3){logger[_0x5723('0x2b')](_0x5723('0x56'),_0x1f47a3);throw _0x1f47a3;});}return _0x2df7ad;})[_0x5723('0x26')](respondWithResult(_0x3d417a,0xc9))[_0x5723('0x47')](handleError(_0x3d417a,null));};exports[_0x5723('0x57')]=function(_0x5d7fa7,_0xc4a4d0){if(_0x5d7fa7['body']['id']){delete _0x5d7fa7[_0x5723('0x58')]['id'];}return db[_0x5723('0x4c')]['find']({'where':{'id':_0x5d7fa7['params']['id']}})['then'](handleEntityNotFound(_0xc4a4d0,null))[_0x5723('0x26')](saveUpdates(_0x5d7fa7[_0x5723('0x58')],null))['then'](respondWithResult(_0xc4a4d0,null))[_0x5723('0x47')](handleError(_0xc4a4d0,null));};exports['destroy']=function(_0x215298,_0x3002c1){return db['AnalyticCustomReport'][_0x5723('0x4d')]({'where':{'id':_0x215298[_0x5723('0x49')]['id']}})[_0x5723('0x26')](handleEntityNotFound(_0x3002c1,null))[_0x5723('0x26')](removeEntity(_0x3002c1,null))['catch'](handleError(_0x3002c1,null));};exports[_0x5723('0x59')]=function(_0x2a14b8,_0x45b37d){var _0x3d9613=0xa;var _0x54c94c=[_0x5723('0x5a'),'left_join','right_join',_0x5723('0x5b')];var _0x307e9a={'SUM':_0x5723('0x5c'),'COUNT':_0x5723('0x5d'),'COUNT DISTINCT':_0x5723('0x5e'),'MAX':_0x5723('0x5f'),'MIN':_0x5723('0x60'),'AVG':_0x5723('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5723('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5d2bba={'SEC_TO_TIME':_0x5723('0x63'),'DATE':_0x5723('0x64'),'HOUR':_0x5723('0x65'),'ROUND':_0x5723('0x66'),'UNIX_TIMESTAMP':_0x5723('0x67')};var _0x223a21=function(_0x4618ae){return!_['includes']([_0x5723('0x68'),_0x5723('0x69'),_0x5723('0x6a'),_0x5723('0x6b')],_0x4618ae);};var _0x6a61b3=function(_0x2e49c5){if(!_0x2e49c5||!_0x2e49c5[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x27d03b='(',_0x1ce986=0x0;_0x1ce986<_0x2e49c5[_0x5723('0x6c')][_0x5723('0x39')];_0x1ce986+=0x1){_0x1ce986>0x0&&(_0x27d03b+='\x20'+_0x2e49c5[_0x5723('0x6d')]+'\x20');_0x27d03b+=_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x6e')]?_0x6a61b3(_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x6e')]):_0x2e49c5['rules'][_0x1ce986][_0x5723('0x6f')]+'\x20'+_0x2e49c5[_0x5723('0x6c')][_0x1ce986]['condition']+(_0x223a21(_0x2e49c5[_0x5723('0x6c')][_0x1ce986]['condition'])?'\x20'+_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x70')]:'');}return _0x27d03b+')';};var _0x469a0d={'where':{'id':_0x2a14b8[_0x5723('0x49')]['id']}},_0x5bfe85,_0x2cbdd2,_0x27667a,_0x223112,_0x1951b5;_0x469a0d=_[_0x5723('0x41')]({},_0x469a0d,_0x2a14b8['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x469a0d)[_0x5723('0x26')](function(_0x56062b){if(_0x56062b){_0x5bfe85=_0x56062b;return _0x56062b[_0x5723('0x71')]();}return null;})['then'](function(_0x4ac47a){if(_0x4ac47a){if(!_0x4ac47a[_0x5723('0x39')]){throw new db[(_0x5723('0x72'))][(_0x5723('0x73'))](_0x5723('0x74'),0x193);}_0x2cbdd2=_0x4ac47a;return db[_0x5723('0x75')][_0x5723('0x46')]({'raw':!![]});}return null;})['then'](function(_0x2c73b3){if(_0x2c73b3){_0x27667a=_['keyBy'](_0x2c73b3,'id');var _0x3dd0a3;var _0x4d259a=squel[_0x5723('0x76')]();_0x4d259a['from'](_0x5bfe85[_0x5723('0x77')]);for(var _0x101cbb=0x0;_0x101cbb<_0x2cbdd2[_0x5723('0x39')];_0x101cbb+=0x1){_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x78')]?_0x27667a[_0x2cbdd2[_0x101cbb][_0x5723('0x78')]][_0x5723('0x79')]:_0x2cbdd2[_0x101cbb][_0x5723('0x6f')];_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x307e9a[_0x2cbdd2[_0x101cbb][_0x5723('0x7a')]],'%s',_0x3dd0a3):_0x3dd0a3;_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x7c')]?_['replace'](_0x5d2bba[_0x2cbdd2[_0x101cbb][_0x5723('0x7c')]],'%s',_0x3dd0a3):_0x3dd0a3;if(_0x2cbdd2[_0x101cbb]['groupBy']){_0x4d259a['group'](_0x3dd0a3);}_0x2cbdd2[_0x101cbb][_0x5723('0x7d')]&&_0x4d259a['order'](_0x3dd0a3,_0x2cbdd2[_0x101cbb][_0x5723('0x7d')]===_0x5723('0x7e')?![]:!![]);_0x4d259a[_0x5723('0x6f')](_0x3dd0a3,_0x2cbdd2[_0x101cbb][_0x5723('0x7f')]||_0x3dd0a3);}if(_0x5bfe85[_0x5723('0x80')]){_0x5bfe85['joins']=JSON[_0x5723('0x81')](_0x5bfe85[_0x5723('0x80')]);for(var _0x36d80b=0x0;_0x36d80b<_0x5bfe85[_0x5723('0x80')][_0x5723('0x39')];_0x36d80b+=0x1){if(_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x31')]&&_[_0x5723('0x82')](_0x54c94c,_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x31')])&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x83')]&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x84')]&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x85')]){_0x4d259a[_0x5bfe85[_0x5723('0x80')][_0x36d80b]['type']](_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x84')],null,util['format'](_0x5723('0x86'),_0x5bfe85['table'],_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x83')],_0x5bfe85['joins'][_0x36d80b]['foreignTable'],_0x5bfe85[_0x5723('0x80')][_0x36d80b]['foreignKey']));}}}if(_0x5bfe85[_0x5723('0x87')]){_0x5bfe85[_0x5723('0x87')]=JSON[_0x5723('0x81')](_0x5bfe85[_0x5723('0x87')]);_0x4d259a[_0x5723('0x3e')](_0x6a61b3(_0x5bfe85['conditions']['group']));}_0x1951b5=_0x4d259a[_0x5723('0x88')]();_0x4d259a[_0x5723('0x1f')](_0x3d9613);_0x4d259a[_0x5723('0x1e')](0x0);logger[_0x5723('0x89')](_0x5723('0x8a'),_0x4d259a[_0x5723('0x8b')]());return dbH['sequelize'][_0x5723('0x34')](_0x4d259a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5723('0x8c')]});}})[_0x5723('0x26')](respondWithResult(_0x45b37d,null))['catch'](handleError(_0x45b37d,null));};function runReport(_0x18c056,_0xd3ff58,_0x1c2bf7){var _0x28e148=_0xd3ff58[_0x5723('0x2d')];var _0x577455=0xa;var _0x45b0f6=[_0x5723('0x5a'),_0x5723('0x8d'),'right_join',_0x5723('0x5b')];var _0x369218={'SUM':_0x5723('0x5c'),'COUNT':_0x5723('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5723('0x5f'),'MIN':'MIN(%s)','AVG':_0x5723('0x61'),'GROUP_CONCAT':_0x5723('0x8e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5723('0x8f')};var _0x122d3b={'SEC_TO_TIME':_0x5723('0x63'),'DATE':_0x5723('0x64'),'HOUR':_0x5723('0x65'),'ROUND':_0x5723('0x66'),'UNIX_TIMESTAMP':_0x5723('0x67')};var _0x59e0f7=function(_0x3b3866){return!_[_0x5723('0x82')]([_0x5723('0x68'),_0x5723('0x69'),'IS\x20EMPTY',_0x5723('0x6b')],_0x3b3866);};var _0x46469e=function(_0x25983b){if(!_0x25983b||!_0x25983b[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x4fe8db='(',_0x1e9860=0x0;_0x1e9860<_0x25983b[_0x5723('0x6c')]['length'];_0x1e9860+=0x1){_0x1e9860>0x0&&(_0x4fe8db+='\x20'+_0x25983b[_0x5723('0x6d')]+'\x20');_0x4fe8db+=_0x25983b[_0x5723('0x6c')][_0x1e9860][_0x5723('0x6e')]?_0x46469e(_0x25983b[_0x5723('0x6c')][_0x1e9860]['group']):_0x25983b[_0x5723('0x6c')][_0x1e9860]['field']+'\x20'+_0x25983b['rules'][_0x1e9860][_0x5723('0x90')]+(_0x59e0f7(_0x25983b['rules'][_0x1e9860][_0x5723('0x90')])?'\x20'+_0x25983b['rules'][_0x1e9860][_0x5723('0x70')]:'');}return _0x4fe8db+')';};var _0x41897f={'where':{'id':_0x18c056['id']}},_0x597c2a,_0x2c897a,_0x192218,_0x1fb757,_0x373143;_0x41897f=_[_0x5723('0x41')]({},_0x41897f,_0x1c2bf7);return db['AnalyticCustomReport'][_0x5723('0x4d')](_0x41897f)[_0x5723('0x26')](function(_0x3d03cb){if(_0x3d03cb){_0x597c2a=_0x3d03cb;return _0x3d03cb['getFields']();}return null;})[_0x5723('0x26')](function(_0x26dfad){if(_0x26dfad){if(!_0x26dfad[_0x5723('0x39')]){throw new db[(_0x5723('0x72'))][(_0x5723('0x73'))](_0x5723('0x74'),0x193);}_0x2c897a=_0x26dfad;return db['AnalyticMetric'][_0x5723('0x46')]({'raw':!![]});}return null;})[_0x5723('0x26')](function(_0x15d68d){if(_0x15d68d){_0x192218=_[_0x5723('0x91')](_0x15d68d,'id');var _0x563776;var _0x181e5b=squel[_0x5723('0x76')]();_0x181e5b[_0x5723('0x92')](_0x597c2a[_0x5723('0x77')]);for(var _0x1375bd=0x0;_0x1375bd<_0x2c897a['length'];_0x1375bd+=0x1){_0x563776=_0x2c897a[_0x1375bd]['MetricId']?_0x192218[_0x2c897a[_0x1375bd][_0x5723('0x78')]]['metric']:_0x2c897a[_0x1375bd]['field'];_0x563776=_0x2c897a[_0x1375bd][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x369218[_0x2c897a[_0x1375bd]['function']],'%s',_0x563776):_0x563776;_0x563776=_0x2c897a[_0x1375bd]['format']?_[_0x5723('0x7b')](_0x122d3b[_0x2c897a[_0x1375bd]['format']],'%s',_0x563776):_0x563776;if(_0x2c897a[_0x1375bd][_0x5723('0x93')]){_0x181e5b['group'](_0x563776);}_0x2c897a[_0x1375bd]['orderBy']&&_0x181e5b['order'](_0x563776,_0x2c897a[_0x1375bd][_0x5723('0x7d')]===_0x5723('0x7e')?![]:!![]);_0x181e5b[_0x5723('0x6f')](_0x563776,_0x2c897a[_0x1375bd][_0x5723('0x7f')]||_0x563776);}if(_0x597c2a['joins']){_0x597c2a[_0x5723('0x80')]=JSON['parse'](_0x597c2a[_0x5723('0x80')]);for(var _0xd3934a=0x0;_0xd3934a<_0x597c2a[_0x5723('0x80')]['length'];_0xd3934a+=0x1){if(_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')]&&_['includes'](_0x45b0f6,_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')])&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x83')]&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x84')]&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x85')]){_0x181e5b[_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')]](_0x597c2a['joins'][_0xd3934a][_0x5723('0x84')],null,util[_0x5723('0x7c')](_0x5723('0x86'),_0x597c2a['table'],_0x597c2a[_0x5723('0x80')][_0xd3934a]['parentKey'],_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x84')],_0x597c2a[_0x5723('0x80')][_0xd3934a]['foreignKey']));}}}if(_0x597c2a[_0x5723('0x87')]){_0x597c2a[_0x5723('0x87')]=JSON[_0x5723('0x81')](_0x597c2a[_0x5723('0x87')]);_0x181e5b[_0x5723('0x3e')](_0x46469e(_0x597c2a[_0x5723('0x87')][_0x5723('0x6e')]));}_0x373143=_0x181e5b['clone']();_0x181e5b[_0x5723('0x1f')](_0x577455);_0x181e5b[_0x5723('0x1e')](0x0);return;}})[_0x5723('0x26')](function(){if(_0xd3ff58[_0x5723('0x94')]==='web'){return null;}var _0x4c238f=_['merge'](_0xd3ff58,{'name':_0xd3ff58[_0x5723('0x95')]||_0xd3ff58['name']||_0x597c2a[_0x5723('0x2d')],'basename':_0x28e148,'savename':util[_0x5723('0x7c')](_0x5723('0x96'),_0xd3ff58[_0x5723('0x2d')]||_0x597c2a['name'],require(_0x5723('0x97'))[_0x5723('0x98')](0x4),_0xd3ff58['output']||_0x5723('0x99')),'reportId':_0x597c2a['id'],'reportType':_0x5723('0x9a')});return db[_0x5723('0x9b')]['create'](_0x4c238f,{'raw':!![]});})[_0x5723('0x26')](function(_0x3ebb57){if(_0x597c2a[_0x5723('0x77')]===_0x5723('0x9c')){_0x373143[_0x5723('0x3e')](_0x597c2a['table']+_0x5723('0x9d'),_0xd3ff58[_0x5723('0x9e')],_0xd3ff58[_0x5723('0x9f')]);}else{_0x373143[_0x5723('0x3e')](_0x597c2a[_0x5723('0x77')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xd3ff58[_0x5723('0x9e')],_0xd3ff58['endDate']);}if(_0x3ebb57){logger[_0x5723('0xa0')]('Run\x20Query:',_0x373143[_0x5723('0x8b')]());require(_0x5723('0xa1'))['fork'](path[_0x5723('0x5a')](__dirname,_0x5723('0xa2'),_0x3ebb57[_0x5723('0x94')]),[_0x3ebb57['id'],_0x373143[_0x5723('0x8b')](),path[_0x5723('0x5a')](__dirname,_0x5723('0xa3'),_0x3ebb57[_0x5723('0xa4')]),_0x28e148]);return _0x3ebb57;}else{var _0x2e6b07=squel[_0x5723('0x76')]();_0x2e6b07[_0x5723('0x92')]('('+_0x373143['toString']()+')',_0x5723('0xa5'));_0x2e6b07['field'](_0x5723('0xa6'),_0x5723('0x20'));_0x373143[_0x5723('0x1f')](_0xd3ff58[_0x5723('0x1f')]||_0x577455);_0x373143[_0x5723('0x1e')](_0xd3ff58[_0x5723('0x1e')]||0x0);return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x2e6b07[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')]['QueryTypes']['SELECT']})[_0x5723('0x26')](function(_0x2176a4){if(!_0x2176a4[_0x5723('0x39')]){_0x1fb757=0x0;}else{_0x1fb757=_0x2176a4[0x0][_0x5723('0x20')]||0x0;}return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x373143[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')][_0x5723('0xa8')][_0x5723('0x8c')]});})[_0x5723('0x26')](function(_0xdf28d){return{'rows':_0xdf28d||[],'count':_0x1fb757};});}});}exports['run']=function(_0x1d5c99,_0x42bd1a){return runReport(_0x1d5c99[_0x5723('0x49')],_0x1d5c99[_0x5723('0x34')],_0x1d5c99['options'])[_0x5723('0x26')](respondWithResult(_0x42bd1a,null))['catch'](handleError(_0x42bd1a,null));};exports[_0x5723('0xa9')]=runReport;exports[_0x5723('0x34')]=function(_0x47b801,_0xbd1f26){var _0x45f92d=0xa;var _0x5a0ebb=[_0x5723('0x5a'),_0x5723('0x8d'),_0x5723('0xaa'),_0x5723('0x5b')];var _0x54e981={'SUM':_0x5723('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5723('0x5f'),'MIN':_0x5723('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5723('0x8e'),'GROUP_CONCAT ASC':_0x5723('0x62'),'GROUP_CONCAT DESC':_0x5723('0x8f')};var _0xffeddd={'SEC_TO_TIME':_0x5723('0x63'),'DATE':'DATE(%s)','HOUR':_0x5723('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5723('0x67')};var _0x1e8402=function(_0x3ac53d){return!_[_0x5723('0x82')]([_0x5723('0x68'),'IS\x20NOT\x20NULL',_0x5723('0x6a'),'IS\x20NOT\x20EMPTY'],_0x3ac53d);};var _0x203c9d=function(_0x29da22){if(!_0x29da22||!_0x29da22[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x18ed66='(',_0x21e997=0x0;_0x21e997<_0x29da22[_0x5723('0x6c')][_0x5723('0x39')];_0x21e997+=0x1){_0x21e997>0x0&&(_0x18ed66+='\x20'+_0x29da22[_0x5723('0x6d')]+'\x20');_0x18ed66+=_0x29da22['rules'][_0x21e997][_0x5723('0x6e')]?_0x203c9d(_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x6e')]):_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x6f')]+'\x20'+_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x90')]+(_0x1e8402(_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x90')])?'\x20'+_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x70')]:'');}return _0x18ed66+')';};var _0x5915eb={'where':{'id':_0x47b801[_0x5723('0x49')]['id']}},_0x1bfe29,_0x2996cb,_0x57edae,_0x471df2,_0x1f8d9b;_0x5915eb=_['merge']({},_0x5915eb,_0x47b801['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x5915eb)[_0x5723('0x26')](function(_0x43abe3){if(_0x43abe3){_0x1bfe29=_0x43abe3;return _0x43abe3['getFields']();}return null;})[_0x5723('0x26')](function(_0x1e3bd4){if(_0x1e3bd4){if(!_0x1e3bd4['length']){throw new db[(_0x5723('0x72'))]['ValidationErrorItem'](_0x5723('0x74'),0x193);}_0x2996cb=_0x1e3bd4;return db[_0x5723('0x75')][_0x5723('0x46')]({'raw':!![]});}return null;})['then'](function(_0x40656d){if(_0x40656d){_0x57edae=_['keyBy'](_0x40656d,'id');var _0x5e57c7;var _0x123034=squel['select']();_0x123034[_0x5723('0x92')](_0x1bfe29[_0x5723('0x77')]);for(var _0xa79251=0x0;_0xa79251<_0x2996cb['length'];_0xa79251+=0x1){_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x78')]?_0x57edae[_0x2996cb[_0xa79251][_0x5723('0x78')]][_0x5723('0x79')]:_0x2996cb[_0xa79251]['field'];_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x54e981[_0x2996cb[_0xa79251][_0x5723('0x7a')]],'%s',_0x5e57c7):_0x5e57c7;_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x7c')]?_[_0x5723('0x7b')](_0xffeddd[_0x2996cb[_0xa79251][_0x5723('0x7c')]],'%s',_0x5e57c7):_0x5e57c7;if(_0x2996cb[_0xa79251][_0x5723('0x93')]){_0x123034['group'](_0x5e57c7);}_0x2996cb[_0xa79251][_0x5723('0x7d')]&&_0x123034[_0x5723('0x3c')](_0x5e57c7,_0x2996cb[_0xa79251]['orderBy']==='DESC'?![]:!![]);_0x123034[_0x5723('0x6f')](_0x5e57c7,_0x2996cb[_0xa79251][_0x5723('0x7f')]||_0x5e57c7);}if(_0x1bfe29[_0x5723('0x80')]){_0x1bfe29[_0x5723('0x80')]=JSON['parse'](_0x1bfe29[_0x5723('0x80')]);for(var _0x1b146e=0x0;_0x1b146e<_0x1bfe29['joins'][_0x5723('0x39')];_0x1b146e+=0x1){if(_0x1bfe29['joins'][_0x1b146e][_0x5723('0x31')]&&_['includes'](_0x5a0ebb,_0x1bfe29[_0x5723('0x80')][_0x1b146e]['type'])&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x83')]&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x84')]&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x85')]){_0x123034[_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x31')]](_0x1bfe29['joins'][_0x1b146e]['foreignTable'],null,util[_0x5723('0x7c')](_0x5723('0x86'),_0x1bfe29['table'],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x83')],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x84')],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x85')]));}}}if(_0x1bfe29[_0x5723('0x87')]){_0x1bfe29['conditions']=JSON[_0x5723('0x81')](_0x1bfe29['conditions']);_0x123034[_0x5723('0x3e')](_0x203c9d(_0x1bfe29['conditions'][_0x5723('0x6e')]));}_0x1f8d9b=_0x123034[_0x5723('0x88')]();_0x123034[_0x5723('0x1f')](_0x45f92d);_0x123034['offset'](0x0);logger[_0x5723('0x89')]('Limited\x20Query:',_0x123034[_0x5723('0x8b')]());return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x123034[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')][_0x5723('0xa8')][_0x5723('0x8c')]});}})[_0x5723('0x26')](function(){return{'sql':_0x1f8d9b[_0x5723('0x8b')]()};})['then'](respondWithResult(_0xbd1f26,null))[_0x5723('0x47')](handleError(_0xbd1f26,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 9e30550..cbd4f91 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 _0xe002=['moment','bluebird','request-promise','path','./analyticCustomReport.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x42f0d1,_0x45fe4a){var _0x43f981=function(_0x5882e8){while(--_0x5882e8){_0x42f0d1['push'](_0x42f0d1['shift']());}};_0x43f981(++_0x45fe4a);}(_0xe002,0xba));var _0x2e00=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xe002[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var logger=require(_0x2e00('0x2'))(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var rp=require(_0x2e00('0x6'));var fs=require('fs');var path=require(_0x2e00('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e00('0x8'));module[_0x2e00('0x9')]=function(_0x351339,_0x11cb7c){return _0x351339['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x81ee=['exports','define','AnalyticCustomReport','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x511d75,_0x3b50bc){var _0x37a68d=function(_0x49698f){while(--_0x49698f){_0x511d75['push'](_0x511d75['shift']());}};_0x37a68d(++_0x3b50bc);}(_0x81ee,0xdf));var _0xe81e=function(_0x4a503d,_0x1bf7ed){_0x4a503d=_0x4a503d-0x0;var _0x1add04=_0x81ee[_0x4a503d];return _0x1add04;};'use strict';var _=require(_0xe81e('0x0'));var util=require(_0xe81e('0x1'));var logger=require(_0xe81e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe81e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe81e('0x4'));var config=require(_0xe81e('0x5'));var attributes=require(_0xe81e('0x6'));module[_0xe81e('0x7')]=function(_0x187430,_0x566fd0){return _0x187430[_0xe81e('0x8')](_0xe81e('0x9'),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 5912bca..71291a1 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 _0x335a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x335a,0x1df));var _0xa335=function(_0x5cf4f2,_0x4dea23){_0x5cf4f2=_0x5cf4f2-0x0;var _0x257949=_0x335a[_0x5cf4f2];return _0x257949;};'use strict';var _=require(_0xa335('0x0'));var util=require('util');var moment=require(_0xa335('0x1'));var BPromise=require(_0xa335('0x2'));var rs=require(_0xa335('0x3'));var fs=require('fs');var Redis=require(_0xa335('0x4'));var db=require(_0xa335('0x5'))['db'];var utils=require(_0xa335('0x6'));var logger=require(_0xa335('0x7'))(_0xa335('0x8'));var config=require('../../config/environment');var jayson=require(_0xa335('0x9'));var client=jayson['client'][_0xa335('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249e7b,_0x194325,_0x515eb7){return new BPromise(function(_0x73d4ef,_0x22e081){return client[_0xa335('0xb')](_0x249e7b,_0x515eb7)['then'](function(_0x35493c){logger[_0xa335('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x194325,_0xa335('0xd'));logger[_0xa335('0xe')](_0xa335('0xf'),_0x194325,_0xa335('0xd'),JSON['stringify'](_0x35493c));if(_0x35493c[_0xa335('0x10')]){if(_0x35493c[_0xa335('0x10')]['code']===0x1f4){logger[_0xa335('0x10')](_0xa335('0x11'),_0x194325,_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);return _0x22e081(_0x35493c[_0xa335('0x10')]['message']);}logger['error'](_0xa335('0x11'),_0x194325,_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);return _0x73d4ef(_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);}else{logger[_0xa335('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x194325,_0xa335('0xd'));_0x73d4ef(_0x35493c[_0xa335('0x13')]['message']);}})['catch'](function(_0x2878af){logger[_0xa335('0x10')](_0xa335('0x11'),_0x194325,_0x2878af);_0x22e081(_0x2878af);});});}
\ No newline at end of file
+var _0x37d8=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3321f0,_0x507b32){var _0x331846=function(_0x459186){while(--_0x459186){_0x3321f0['push'](_0x3321f0['shift']());}};_0x331846(++_0x507b32);}(_0x37d8,0x171));var _0x837d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x37d8[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x837d('0x0'));var util=require('util');var moment=require(_0x837d('0x1'));var BPromise=require(_0x837d('0x2'));var rs=require(_0x837d('0x3'));var fs=require('fs');var Redis=require(_0x837d('0x4'));var db=require(_0x837d('0x5'))['db'];var utils=require(_0x837d('0x6'));var logger=require('../../config/logger')(_0x837d('0x7'));var config=require('../../config/environment');var jayson=require(_0x837d('0x8'));var client=jayson[_0x837d('0x9')][_0x837d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14d4cc,_0x3f255e,_0x5b6460){return new BPromise(function(_0x11401d,_0x10a2ea){return client[_0x837d('0xb')](_0x14d4cc,_0x5b6460)[_0x837d('0xc')](function(_0x15b48d){logger[_0x837d('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f255e,_0x837d('0xe'));logger[_0x837d('0xf')](_0x837d('0x10'),_0x3f255e,_0x837d('0xe'),JSON[_0x837d('0x11')](_0x15b48d));if(_0x15b48d[_0x837d('0x12')]){if(_0x15b48d['error'][_0x837d('0x13')]===0x1f4){logger[_0x837d('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f255e,_0x15b48d[_0x837d('0x12')][_0x837d('0x14')]);return _0x10a2ea(_0x15b48d['error'][_0x837d('0x14')]);}logger[_0x837d('0x12')](_0x837d('0x15'),_0x3f255e,_0x15b48d[_0x837d('0x12')][_0x837d('0x14')]);return _0x11401d(_0x15b48d[_0x837d('0x12')]['message']);}else{logger['info'](_0x837d('0x15'),_0x3f255e,_0x837d('0xe'));_0x11401d(_0x15b48d[_0x837d('0x16')][_0x837d('0x14')]);}})[_0x837d('0x17')](function(_0x4d6d4d){logger['error'](_0x837d('0x15'),_0x3f255e,_0x4d6d4d);_0x10a2ea(_0x4d6d4d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index d121643..328a679 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 _0x6d97=['/:id/query','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run'];(function(_0xf7c076,_0x351a0e){var _0x2dd7c0=function(_0x3a8da1){while(--_0x3a8da1){_0xf7c076['push'](_0xf7c076['shift']());}};_0x2dd7c0(++_0x351a0e);}(_0x6d97,0x1be));var _0x76d9=function(_0x50f92b,_0x32fab3){_0x50f92b=_0x50f92b-0x0;var _0x5cedbc=_0x6d97[_0x50f92b];return _0x5cedbc;};'use strict';var multer=require(_0x76d9('0x0'));var util=require(_0x76d9('0x1'));var path=require(_0x76d9('0x2'));var timeout=require(_0x76d9('0x3'));var express=require(_0x76d9('0x4'));var router=express[_0x76d9('0x5')]();var fs_extra=require(_0x76d9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x76d9('0x7'));var config=require(_0x76d9('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x76d9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x76d9('0xa'),auth[_0x76d9('0xb')](),controller[_0x76d9('0xc')]);router[_0x76d9('0x9')](_0x76d9('0xd'),auth[_0x76d9('0xb')](),controller[_0x76d9('0xe')]);router[_0x76d9('0x9')](_0x76d9('0xf'),auth['isAuthenticated'](),controller['run']);router['get'](_0x76d9('0x10'),auth[_0x76d9('0xb')](),controller['query']);router['post']('/',auth[_0x76d9('0xb')](),controller[_0x76d9('0x11')]);router['put'](_0x76d9('0xa'),auth[_0x76d9('0xb')](),controller[_0x76d9('0x12')]);router[_0x76d9('0x13')](_0x76d9('0xa'),auth['isAuthenticated'](),controller[_0x76d9('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xee54=['get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee54,0x184));var _0x4ee5=function(_0x373dfc,_0x3653d8){_0x373dfc=_0x373dfc-0x0;var _0x19a305=_0xee54[_0x373dfc];return _0x19a305;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee5('0x0'));var timeout=require(_0x4ee5('0x1'));var express=require(_0x4ee5('0x2'));var router=express[_0x4ee5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4ee5('0x4'));var interaction=require(_0x4ee5('0x5'));var config=require(_0x4ee5('0x6'));var controller=require(_0x4ee5('0x7'));router['get']('/',auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x9')]);router['get'](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0xb')]);router[_0x4ee5('0xc')](_0x4ee5('0xd'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0xe')]);router[_0x4ee5('0xc')](_0x4ee5('0xf'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x10')]);router[_0x4ee5('0xc')](_0x4ee5('0x11'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x12')]);router[_0x4ee5('0x13')]('/',auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x14')]);router['put'](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x15')]);router[_0x4ee5('0x16')](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x17')]);module[_0x4ee5('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6835891..ed8c648 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 _0x8958=['TEXT','exports'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x8958,0x93));var _0x8895=function(_0x2ad231,_0x3b2095){_0x2ad231=_0x2ad231-0x0;var _0x4e05df=_0x8958[_0x2ad231];return _0x4e05df;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x6f47=['TEXT','exports','STRING'];(function(_0xe58a55,_0x3bdfcd){var _0x295932=function(_0x211d8d){while(--_0x211d8d){_0xe58a55['push'](_0xe58a55['shift']());}};_0x295932(++_0x3bdfcd);}(_0x6f47,0xc7));var _0x76f4=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x6f47[_0x2a6809];return _0x11c371;};'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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 28f975f..f5095dc 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 _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x5c35ca,_0x2a253f){var _0xe026ac=function(_0x4272bf){while(--_0x4272bf){_0x5c35ca['push'](_0x5c35ca['shift']());}};_0xe026ac(++_0x2a253f);}(_0x4975,0x86));var _0x5497=function(_0x3701e1,_0x45b69e){_0x3701e1=_0x3701e1-0x0;var _0x5e46a8=_0x4975[_0x3701e1];return _0x5e46a8;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
+var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x383e35,_0x57ebee){_0x383e35=_0x383e35-0x0;var _0x149af8=_0xc6ac[_0x383e35];return _0x149af8;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 42ee86b..9b487f2 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 _0x0f4b=['rimraf','define','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5e1be2,_0xfabb80){var _0x15cadd=function(_0xffd4e4){while(--_0xffd4e4){_0x5e1be2['push'](_0x5e1be2['shift']());}};_0x15cadd(++_0xfabb80);}(_0x0f4b,0x99));var _0xb0f4=function(_0x47c4f1,_0x1c5182){_0x47c4f1=_0x47c4f1-0x0;var _0x524053=_0x0f4b[_0x47c4f1];return _0x524053;};'use strict';var _=require(_0xb0f4('0x0'));var util=require(_0xb0f4('0x1'));var logger=require(_0xb0f4('0x2'))('api');var moment=require(_0xb0f4('0x3'));var BPromise=require(_0xb0f4('0x4'));var rp=require(_0xb0f4('0x5'));var fs=require('fs');var path=require(_0xb0f4('0x6'));var rimraf=require(_0xb0f4('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3253a5,_0x3a694d){return _0x3253a5[_0xb0f4('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0xb0f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f86=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8f86,0x162));var _0x68f8=function(_0x1e804c,_0x47d42d){_0x1e804c=_0x1e804c-0x0;var _0x31b58=_0x8f86[_0x1e804c];return _0x31b58;};'use strict';var _=require(_0x68f8('0x0'));var util=require(_0x68f8('0x1'));var logger=require(_0x68f8('0x2'))(_0x68f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x68f8('0x4'));var fs=require('fs');var path=require(_0x68f8('0x5'));var rimraf=require('rimraf');var config=require(_0x68f8('0x6'));var attributes=require(_0x68f8('0x7'));module[_0x68f8('0x8')]=function(_0x43f8fb,_0x54d672){return _0x43f8fb[_0x68f8('0x9')](_0x68f8('0xa'),attributes,{'tableName':_0x68f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index d27d9aa..bb448a1 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 _0xaf9f=['client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xaf9f,0x68));var _0xfaf9=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0xaf9f[_0x139b85];return _0x1e833f;};'use strict';var _=require(_0xfaf9('0x0'));var util=require(_0xfaf9('0x1'));var moment=require(_0xfaf9('0x2'));var BPromise=require(_0xfaf9('0x3'));var rs=require(_0xfaf9('0x4'));var fs=require('fs');var Redis=require(_0xfaf9('0x5'));var db=require(_0xfaf9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaf9('0x7'))(_0xfaf9('0x8'));var config=require(_0xfaf9('0x9'));var jayson=require(_0xfaf9('0xa'));var client=jayson[_0xfaf9('0xb')][_0xfaf9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35f269,_0x17a2e3,_0xc9fc88){return new BPromise(function(_0xf635e7,_0x1a3dcc){return client[_0xfaf9('0xd')](_0x35f269,_0xc9fc88)['then'](function(_0x58f045){logger[_0xfaf9('0xe')](_0xfaf9('0xf'),_0x17a2e3,_0xfaf9('0x10'));logger[_0xfaf9('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x17a2e3,'request\x20sent',JSON[_0xfaf9('0x12')](_0x58f045));if(_0x58f045['error']){if(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x14')]===0x1f4){logger[_0xfaf9('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x17a2e3,_0x58f045[_0xfaf9('0x13')]['message']);return _0x1a3dcc(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);}logger[_0xfaf9('0x13')](_0xfaf9('0xf'),_0x17a2e3,_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);return _0xf635e7(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);}else{logger[_0xfaf9('0xe')](_0xfaf9('0xf'),_0x17a2e3,_0xfaf9('0x10'));_0xf635e7(_0x58f045['result'][_0xfaf9('0x15')]);}})[_0xfaf9('0x16')](function(_0xd3eca0){logger['error'](_0xfaf9('0xf'),_0x17a2e3,_0xd3eca0);_0x1a3dcc(_0xd3eca0);});});}
\ No newline at end of file
+var _0x3dc8=['http','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3b27d3,_0x2c4d9b){var _0x247327=function(_0x3d8dd4){while(--_0x3d8dd4){_0x3b27d3['push'](_0x3b27d3['shift']());}};_0x247327(++_0x2c4d9b);}(_0x3dc8,0x162));var _0x83dc=function(_0x41c7d8,_0x7db48c){_0x41c7d8=_0x41c7d8-0x0;var _0x3d46d0=_0x3dc8[_0x41c7d8];return _0x3d46d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83dc('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83dc('0x1'))['db'];var utils=require(_0x83dc('0x2'));var logger=require(_0x83dc('0x3'))('rpc');var config=require(_0x83dc('0x4'));var jayson=require(_0x83dc('0x5'));var client=jayson[_0x83dc('0x6')][_0x83dc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37fd1c,_0x5a337d,_0x36ced2){return new BPromise(function(_0x6c0986,_0x237dba){return client['request'](_0x37fd1c,_0x36ced2)[_0x83dc('0x8')](function(_0x1ec8c0){logger[_0x83dc('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a337d,_0x83dc('0xa'));logger['debug'](_0x83dc('0xb'),_0x5a337d,_0x83dc('0xa'),JSON[_0x83dc('0xc')](_0x1ec8c0));if(_0x1ec8c0[_0x83dc('0xd')]){if(_0x1ec8c0['error'][_0x83dc('0xe')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a337d,_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);return _0x237dba(_0x1ec8c0[_0x83dc('0xd')]['message']);}logger[_0x83dc('0xd')](_0x83dc('0x10'),_0x5a337d,_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);return _0x6c0986(_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);}else{logger['info'](_0x83dc('0x10'),_0x5a337d,_0x83dc('0xa'));_0x6c0986(_0x1ec8c0[_0x83dc('0x11')]['message']);}})[_0x83dc('0x12')](function(_0x5b939d){logger[_0x83dc('0xd')](_0x83dc('0x10'),_0x5a337d,_0x5b939d);_0x237dba(_0x5b939d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index cbde3a6..86650cb 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 _0x435d=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','query','post','/:id'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x435d,0x96));var _0xd435=function(_0x586ba0,_0x49a28f){_0x586ba0=_0x586ba0-0x0;var _0x2a4277=_0x435d[_0x586ba0];return _0x2a4277;};'use strict';var multer=require(_0xd435('0x0'));var util=require(_0xd435('0x1'));var path=require(_0xd435('0x2'));var timeout=require(_0xd435('0x3'));var express=require(_0xd435('0x4'));var router=express[_0xd435('0x5')]();var fs_extra=require(_0xd435('0x6'));var auth=require(_0xd435('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd435('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0xd435('0x9')]('/',auth[_0xd435('0xa')](),controller[_0xd435('0xb')]);router['get']('/:id',auth[_0xd435('0xa')](),controller[_0xd435('0xc')]);router['get'](_0xd435('0xd'),auth[_0xd435('0xa')](),controller[_0xd435('0xe')]);router[_0xd435('0x9')]('/:id/run',auth[_0xd435('0xa')](),controller['run']);router[_0xd435('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xd435('0xf')]);router[_0xd435('0x10')]('/',auth[_0xd435('0xa')](),controller['create']);router['put'](_0xd435('0x11'),auth['isAuthenticated'](),controller[_0xd435('0x12')]);router[_0xd435('0x13')](_0xd435('0x11'),auth[_0xd435('0xa')](),controller[_0xd435('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x2bbb=['index','/:id','show','get','/:id/run','run','/:id/query','query','post','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated'];(function(_0x122509,_0xc1ee11){var _0x1f5220=function(_0x40ff21){while(--_0x40ff21){_0x122509['push'](_0x122509['shift']());}};_0x1f5220(++_0xc1ee11);}(_0x2bbb,0x1d9));var _0xb2bb=function(_0x48df6d,_0x8e91a){_0x48df6d=_0x48df6d-0x0;var _0x2afe14=_0x2bbb[_0x48df6d];return _0x2afe14;};'use strict';var multer=require(_0xb2bb('0x0'));var util=require(_0xb2bb('0x1'));var path=require(_0xb2bb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb2bb('0x3')]();var fs_extra=require(_0xb2bb('0x4'));var auth=require(_0xb2bb('0x5'));var interaction=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var controller=require(_0xb2bb('0x8'));router['get']('/',auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xa')]);router['get'](_0xb2bb('0xb'),auth['isAuthenticated'](),controller[_0xb2bb('0xc')]);router[_0xb2bb('0xd')]('/:id/preview',auth[_0xb2bb('0x9')](),controller['preview']);router[_0xb2bb('0xd')](_0xb2bb('0xe'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xf')]);router[_0xb2bb('0xd')](_0xb2bb('0x10'),auth['isAuthenticated'](),controller[_0xb2bb('0x11')]);router[_0xb2bb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0x13')]);router[_0xb2bb('0x14')](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0x15')]);module[_0xb2bb('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ebc5d3c..1e1b372 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 _0x11ce=['DATE','ENUM','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf'];(function(_0x5d0345,_0x54340d){var _0x254913=function(_0x11c182){while(--_0x11c182){_0x5d0345['push'](_0x5d0345['shift']());}};_0x254913(++_0x54340d);}(_0x11ce,0x1e5));var _0xe11c=function(_0x377322,_0x2e0097){_0x377322=_0x377322-0x0;var _0x5dac66=_0x11ce[_0x377322];return _0x5dac66;};'use strict';var Sequelize=require(_0xe11c('0x0'));var moment=require('moment');module[_0xe11c('0x1')]={'name':{'type':Sequelize[_0xe11c('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe11c('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe11c('0x3'),_0xe11c('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xe11c('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xe11c('0x6')]('manual',_0xe11c('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe11c('0x8')](0xb)[_0xe11c('0x9')]},'reportType':{'type':Sequelize[_0xe11c('0x2')]}};
\ No newline at end of file
+var _0x9aad=['manual','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','xlsx','DATE','Loading'];(function(_0x1b8524,_0x1bb669){var _0x81418d=function(_0x5f5795){while(--_0x5f5795){_0x1b8524['push'](_0x1b8524['shift']());}};_0x81418d(++_0x1bb669);}(_0x9aad,0x193));var _0xd9aa=function(_0x368b9e,_0x2ae528){_0x368b9e=_0x368b9e-0x0;var _0x8dc3ea=_0x9aad[_0x368b9e];return _0x8dc3ea;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd9aa('0x0')]={'name':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xd9aa('0x2')](_0xd9aa('0x3'),'pdf',_0xd9aa('0x4')),'allowNull':![],'defaultValue':_0xd9aa('0x3')},'savename':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xd9aa('0x5')]},'status':{'type':Sequelize[_0xd9aa('0x1')],'defaultValue':_0xd9aa('0x6')},'type':{'type':Sequelize['ENUM'](_0xd9aa('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0xd9aa('0x7')},'reportId':{'type':Sequelize[_0xd9aa('0x8')](0xb)[_0xd9aa('0x9')]},'reportType':{'type':Sequelize[_0xd9aa('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 8448f62..8bbd63b 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 _0xb9fe=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb9fe,0xd0));var _0xeb9f=function(_0x567d62,_0x5ccdea){_0x567d62=_0x567d62-0x0;var _0x360462=_0xb9fe[_0x567d62];return _0x360462;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb9f('0x0'));var jsonpatch=require(_0xeb9f('0x1'));var rp=require('request-promise');var moment=require(_0xeb9f('0x2'));var BPromise=require(_0xeb9f('0x3'));var Mustache=require(_0xeb9f('0x4'));var util=require(_0xeb9f('0x5'));var path=require(_0xeb9f('0x6'));var sox=require(_0xeb9f('0x7'));var csv=require(_0xeb9f('0x8'));var ejs=require(_0xeb9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb9f('0xa'));var squel=require(_0xeb9f('0xb'));var crypto=require(_0xeb9f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeb9f('0xd'));var toCsv=require(_0xeb9f('0x8'));var querystring=require('querystring');var Papa=require(_0xeb9f('0xe'));var Redis=require(_0xeb9f('0xf'));var authService=require(_0xeb9f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9f('0x11'));var hardwareService=require(_0xeb9f('0x12'));var logger=require(_0xeb9f('0x13'))(_0xeb9f('0x14'));var utils=require(_0xeb9f('0x15'));var config=require(_0xeb9f('0x16'));var licenseUtil=require(_0xeb9f('0x17'));var db=require(_0xeb9f('0x18'))['db'];function respondWithStatusCode(_0x536397,_0x24c264){_0x24c264=_0x24c264||0xcc;return function(_0x179d65){if(_0x179d65){return _0x536397[_0xeb9f('0x19')](_0x24c264);}return _0x536397[_0xeb9f('0x1a')](_0x24c264)['end']();};}function respondWithResult(_0x135794,_0x41e5ec){_0x41e5ec=_0x41e5ec||0xc8;return function(_0x266642){if(_0x266642){return _0x135794[_0xeb9f('0x1a')](_0x41e5ec)[_0xeb9f('0x1b')](_0x266642);}};}function respondWithFilteredResult(_0x3cbd61,_0x262453){return function(_0x3399d3){if(_0x3399d3){var _0x279066=typeof _0x262453[_0xeb9f('0x1c')]===_0xeb9f('0x1d')&&typeof _0x262453[_0xeb9f('0x1e')]===_0xeb9f('0x1d');var _0x20c40a=_0x3399d3['count'];var _0x7cc2ab=_0x279066?0x0:_0x262453['offset'];var _0x35b46e=_0x279066?_0x3399d3[_0xeb9f('0x1f')]:_0x262453[_0xeb9f('0x1c')]+_0x262453['limit'];var _0x16570a;if(_0x35b46e>=_0x20c40a){_0x35b46e=_0x20c40a;_0x16570a=0xc8;}else{_0x16570a=0xce;}_0x3cbd61[_0xeb9f('0x1a')](_0x16570a);return _0x3cbd61[_0xeb9f('0x20')](_0xeb9f('0x21'),_0x7cc2ab+'-'+_0x35b46e+'/'+_0x20c40a)['json'](_0x3399d3);}return null;};}function patchUpdates(_0x5f2933){return function(_0xa484fc){try{jsonpatch['apply'](_0xa484fc,_0x5f2933,!![]);}catch(_0x2e0a1f){return BPromise[_0xeb9f('0x22')](_0x2e0a1f);}return _0xa484fc[_0xeb9f('0x23')]();};}function saveUpdates(_0x38fffc,_0x273d91){return function(_0x314942){if(_0x314942){return _0x314942['update'](_0x38fffc)[_0xeb9f('0x24')](function(_0x457373){return _0x457373;});}return null;};}function removeEntity(_0x89f140,_0x501230){return function(_0x55b2ac){if(_0x55b2ac){return _0x55b2ac[_0xeb9f('0x25')]()[_0xeb9f('0x24')](function(){var _0x17368a=_0x55b2ac[_0xeb9f('0x26')]({'plain':!![]});var _0x58d878='ExtractedReports';return db[_0xeb9f('0x27')]['destroy']({'where':{'type':_0x58d878,'resourceId':_0x17368a['id']}})[_0xeb9f('0x24')](function(){return _0x55b2ac;});})[_0xeb9f('0x24')](function(){_0x89f140[_0xeb9f('0x1a')](0xcc)[_0xeb9f('0x28')]();});}};}function handleEntityNotFound(_0x33d717,_0x2fa000){return function(_0xa43327){if(!_0xa43327){_0x33d717['sendStatus'](0x194);}return _0xa43327;};}function handleError(_0x3fdce2,_0xf69cf4){_0xf69cf4=_0xf69cf4||0x1f4;return function(_0x3af383){logger[_0xeb9f('0x29')](_0x3af383[_0xeb9f('0x2a')]);if(_0x3af383[_0xeb9f('0x2b')]){delete _0x3af383['name'];}_0x3fdce2[_0xeb9f('0x1a')](_0xf69cf4)['send'](_0x3af383);};}exports['index']=function(_0x491b0c,_0x48c093){var _0x2e8159={},_0x4dcfb0={},_0x2fb1a2={'count':0x0,'rows':[]};var _0x478f7b=_[_0xeb9f('0x2c')](db[_0xeb9f('0x2d')][_0xeb9f('0x2e')],function(_0x4819b7){return{'name':_0x4819b7[_0xeb9f('0x2f')],'type':_0x4819b7[_0xeb9f('0x30')]['key']};});_0x4dcfb0['model']=_[_0xeb9f('0x2c')](_0x478f7b,'name');_0x4dcfb0['query']=_['keys'](_0x491b0c['query']);_0x4dcfb0[_0xeb9f('0x31')]=_[_0xeb9f('0x32')](_0x4dcfb0[_0xeb9f('0x33')],_0x4dcfb0[_0xeb9f('0x34')]);_0x2e8159[_0xeb9f('0x35')]=_[_0xeb9f('0x32')](_0x4dcfb0[_0xeb9f('0x33')],qs[_0xeb9f('0x36')](_0x491b0c['query'][_0xeb9f('0x36')]));_0x2e8159[_0xeb9f('0x35')]=_0x2e8159['attributes'][_0xeb9f('0x37')]?_0x2e8159[_0xeb9f('0x35')]:_0x4dcfb0[_0xeb9f('0x33')];if(!_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x38')]('nolimit')){_0x2e8159[_0xeb9f('0x1e')]=qs['limit'](_0x491b0c[_0xeb9f('0x34')]['limit']);_0x2e8159[_0xeb9f('0x1c')]=qs[_0xeb9f('0x1c')](_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x1c')]);}_0x2e8159[_0xeb9f('0x39')]=qs[_0xeb9f('0x3a')](_0x491b0c['query'][_0xeb9f('0x3a')]);_0x2e8159[_0xeb9f('0x3b')]=qs[_0xeb9f('0x31')](_['pick'](_0x491b0c[_0xeb9f('0x34')],_0x4dcfb0[_0xeb9f('0x31')]),_0x478f7b);if(_0x491b0c['query']['filter']){_0x2e8159['where']=_[_0xeb9f('0x3c')](_0x2e8159[_0xeb9f('0x3b')],{'$or':_[_0xeb9f('0x2c')](_0x478f7b,function(_0x12384a){if(_0x12384a[_0xeb9f('0x30')]!==_0xeb9f('0x3d')){var _0x92b1cc={};_0x92b1cc[_0x12384a[_0xeb9f('0x2b')]]={'$like':'%'+_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x3e')]+'%'};return _0x92b1cc;}})});}_0x2e8159=_[_0xeb9f('0x3c')]({},_0x2e8159,_0x491b0c[_0xeb9f('0x3f')]);var _0x5d2103={'where':_0x2e8159[_0xeb9f('0x3b')]};return db[_0xeb9f('0x2d')]['count'](_0x5d2103)[_0xeb9f('0x24')](function(_0xb33b2e){_0x2fb1a2['count']=_0xb33b2e;if(_0x491b0c['query']['includeAll']){_0x2e8159[_0xeb9f('0x40')]=[{'all':!![]}];}return db[_0xeb9f('0x2d')][_0xeb9f('0x41')](_0x2e8159);})[_0xeb9f('0x24')](function(_0x359640){_0x2fb1a2[_0xeb9f('0x42')]=_0x359640;return _0x2fb1a2;})[_0xeb9f('0x24')](respondWithFilteredResult(_0x48c093,_0x2e8159))[_0xeb9f('0x43')](handleError(_0x48c093,null));};exports['show']=function(_0x42f178,_0x1a9827){var _0x14845c={'raw':!![],'where':{'id':_0x42f178[_0xeb9f('0x44')]['id']}},_0x27eb3e={};_0x27eb3e[_0xeb9f('0x33')]=_[_0xeb9f('0x45')](db[_0xeb9f('0x2d')][_0xeb9f('0x2e')]);_0x27eb3e[_0xeb9f('0x34')]=_[_0xeb9f('0x45')](_0x42f178['query']);_0x27eb3e[_0xeb9f('0x31')]=_[_0xeb9f('0x32')](_0x27eb3e[_0xeb9f('0x33')],_0x27eb3e[_0xeb9f('0x34')]);_0x14845c['attributes']=_[_0xeb9f('0x32')](_0x27eb3e[_0xeb9f('0x33')],qs['fields'](_0x42f178[_0xeb9f('0x34')][_0xeb9f('0x36')]));_0x14845c[_0xeb9f('0x35')]=_0x14845c[_0xeb9f('0x35')]['length']?_0x14845c[_0xeb9f('0x35')]:_0x27eb3e[_0xeb9f('0x33')];if(_0x42f178['query'][_0xeb9f('0x46')]){_0x14845c['include']=[{'all':!![]}];}_0x14845c=_[_0xeb9f('0x3c')]({},_0x14845c,_0x42f178['options']);return db['AnalyticExtractedReport'][_0xeb9f('0x47')](_0x14845c)[_0xeb9f('0x24')](handleEntityNotFound(_0x1a9827,null))[_0xeb9f('0x24')](respondWithResult(_0x1a9827,null))['catch'](handleError(_0x1a9827,null));};exports['create']=function(_0x5dc841,_0x4684e8){return db[_0xeb9f('0x2d')][_0xeb9f('0x48')](_0x5dc841[_0xeb9f('0x49')],{})[_0xeb9f('0x24')](function(_0x5acda9){var _0x50bd1a=_0x5dc841[_0xeb9f('0x4a')]['get']({'plain':!![]});if(!_0x50bd1a)throw new Error(_0xeb9f('0x4b'));if(_0x50bd1a['role']===_0xeb9f('0x4a')){var _0x47e17f=_0x5acda9[_0xeb9f('0x26')]({'plain':!![]});var _0xb4a31b=_0xeb9f('0x4c');return db[_0xeb9f('0x4d')][_0xeb9f('0x47')]({'where':{'name':_0xb4a31b,'userProfileId':_0x50bd1a[_0xeb9f('0x4e')]},'raw':!![]})[_0xeb9f('0x24')](function(_0x10dcaa){if(_0x10dcaa&&_0x10dcaa[_0xeb9f('0x4f')]===0x0){return db[_0xeb9f('0x27')]['create']({'name':_0x47e17f[_0xeb9f('0x2b')],'resourceId':_0x47e17f['id'],'type':_0x10dcaa['name'],'sectionId':_0x10dcaa['id']},{})[_0xeb9f('0x24')](function(){return _0x5acda9;});}else{return _0x5acda9;}})['catch'](function(_0x3207fd){logger[_0xeb9f('0x29')](_0xeb9f('0x50'),_0x3207fd);throw _0x3207fd;});}return _0x5acda9;})[_0xeb9f('0x24')](respondWithResult(_0x4684e8,0xc9))[_0xeb9f('0x43')](handleError(_0x4684e8,null));};exports[_0xeb9f('0x51')]=function(_0x5f031b,_0x528a78){if(_0x5f031b[_0xeb9f('0x49')]['id']){delete _0x5f031b[_0xeb9f('0x49')]['id'];}return db[_0xeb9f('0x2d')]['find']({'where':{'id':_0x5f031b[_0xeb9f('0x44')]['id']}})[_0xeb9f('0x24')](handleEntityNotFound(_0x528a78,null))[_0xeb9f('0x24')](saveUpdates(_0x5f031b[_0xeb9f('0x49')],null))['then'](respondWithResult(_0x528a78,null))[_0xeb9f('0x43')](handleError(_0x528a78,null));};exports['destroy']=function(_0x2447fd,_0x21c164){return db[_0xeb9f('0x2d')]['find']({'where':{'id':_0x2447fd[_0xeb9f('0x44')]['id']}})[_0xeb9f('0x24')](handleEntityNotFound(_0x21c164,null))[_0xeb9f('0x24')](removeEntity(_0x21c164,null))[_0xeb9f('0x43')](handleError(_0x21c164,null));};exports[_0xeb9f('0x52')]=function(_0x13578a,_0x370f7c,_0x16239d){return db[_0xeb9f('0x2d')][_0xeb9f('0x47')]({'where':{'id':_0x13578a[_0xeb9f('0x44')]['id']},'attributes':[_0xeb9f('0x2b'),_0xeb9f('0x53'),_0xeb9f('0x54'),_0xeb9f('0x55')],'raw':!![]})[_0xeb9f('0x24')](handleEntityNotFound(_0x370f7c,null))[_0xeb9f('0x24')](function(_0x19907a){if(_0x19907a){if(!fs['existsSync'](path[_0xeb9f('0x56')](config['root'],_0xeb9f('0x57'),_0x19907a[_0xeb9f('0x54')]))){throw new db[(_0xeb9f('0x58'))][(_0xeb9f('0x59'))](_0xeb9f('0x5a'));}if(_0x13578a[_0xeb9f('0x34')][_0xeb9f('0x5b')]){return _0x370f7c[_0xeb9f('0x19')](0xc8);}return _0x370f7c[_0xeb9f('0x52')](path['join'](config[_0xeb9f('0x5c')],_0xeb9f('0x57'),_0x19907a[_0xeb9f('0x54')]),util[_0xeb9f('0x5d')]('%s.%s',_0x19907a['basename']||_0x19907a[_0xeb9f('0x2b')],_0x19907a[_0xeb9f('0x55')]['toLowerCase']()));}})[_0xeb9f('0x43')](handleError(_0x370f7c,null));};
\ No newline at end of file
+var _0xe9f9=['model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','AnalyticExtractedReport','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','update','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xe9f9,0x91));var _0x9e9f=function(_0x4ed4db,_0x5588fe){_0x4ed4db=_0x4ed4db-0x0;var _0x326691=_0xe9f9[_0x4ed4db];return _0x326691;};'use strict';var emlformat=require(_0x9e9f('0x0'));var rimraf=require(_0x9e9f('0x1'));var zipdir=require(_0x9e9f('0x2'));var jsonpatch=require(_0x9e9f('0x3'));var rp=require(_0x9e9f('0x4'));var moment=require('moment');var BPromise=require(_0x9e9f('0x5'));var Mustache=require(_0x9e9f('0x6'));var util=require(_0x9e9f('0x7'));var path=require('path');var sox=require(_0x9e9f('0x8'));var csv=require('to-csv');var ejs=require(_0x9e9f('0x9'));var fs=require('fs');var fs_extra=require(_0x9e9f('0xa'));var _=require('lodash');var squel=require(_0x9e9f('0xb'));var crypto=require(_0x9e9f('0xc'));var jsforce=require(_0x9e9f('0xd'));var deskjs=require(_0x9e9f('0xe'));var toCsv=require(_0x9e9f('0xf'));var querystring=require(_0x9e9f('0x10'));var Papa=require(_0x9e9f('0x11'));var Redis=require(_0x9e9f('0x12'));var authService=require(_0x9e9f('0x13'));var qs=require(_0x9e9f('0x14'));var as=require(_0x9e9f('0x15'));var hardwareService=require(_0x9e9f('0x16'));var logger=require(_0x9e9f('0x17'))(_0x9e9f('0x18'));var utils=require(_0x9e9f('0x19'));var config=require(_0x9e9f('0x1a'));var licenseUtil=require(_0x9e9f('0x1b'));var db=require(_0x9e9f('0x1c'))['db'];function respondWithStatusCode(_0x25a17b,_0x4635ae){_0x4635ae=_0x4635ae||0xcc;return function(_0x87e89a){if(_0x87e89a){return _0x25a17b['sendStatus'](_0x4635ae);}return _0x25a17b[_0x9e9f('0x1d')](_0x4635ae)[_0x9e9f('0x1e')]();};}function respondWithResult(_0x4f187b,_0x195d8a){_0x195d8a=_0x195d8a||0xc8;return function(_0x208f56){if(_0x208f56){return _0x4f187b[_0x9e9f('0x1d')](_0x195d8a)[_0x9e9f('0x1f')](_0x208f56);}};}function respondWithFilteredResult(_0xb9e7bb,_0x5adc1c){return function(_0x1233a4){if(_0x1233a4){var _0x1dbe8e=typeof _0x5adc1c[_0x9e9f('0x20')]===_0x9e9f('0x21')&&typeof _0x5adc1c[_0x9e9f('0x22')]===_0x9e9f('0x21');var _0x2757ba=_0x1233a4['count'];var _0x3803fb=_0x1dbe8e?0x0:_0x5adc1c['offset'];var _0x3d959a=_0x1dbe8e?_0x1233a4[_0x9e9f('0x23')]:_0x5adc1c[_0x9e9f('0x20')]+_0x5adc1c[_0x9e9f('0x22')];var _0x1c9823;if(_0x3d959a>=_0x2757ba){_0x3d959a=_0x2757ba;_0x1c9823=0xc8;}else{_0x1c9823=0xce;}_0xb9e7bb[_0x9e9f('0x1d')](_0x1c9823);return _0xb9e7bb[_0x9e9f('0x24')](_0x9e9f('0x25'),_0x3803fb+'-'+_0x3d959a+'/'+_0x2757ba)['json'](_0x1233a4);}return null;};}function patchUpdates(_0x588bb1){return function(_0x23fb0){try{jsonpatch['apply'](_0x23fb0,_0x588bb1,!![]);}catch(_0x4d98e1){return BPromise[_0x9e9f('0x26')](_0x4d98e1);}return _0x23fb0['save']();};}function saveUpdates(_0x541433,_0x5b1881){return function(_0x4dfefa){if(_0x4dfefa){return _0x4dfefa['update'](_0x541433)[_0x9e9f('0x27')](function(_0x421b7e){return _0x421b7e;});}return null;};}function removeEntity(_0x50eb50,_0x3de374){return function(_0x450e75){if(_0x450e75){return _0x450e75[_0x9e9f('0x28')]()['then'](function(){var _0x407430=_0x450e75[_0x9e9f('0x29')]({'plain':!![]});var _0x4939d4=_0x9e9f('0x2a');return db[_0x9e9f('0x2b')]['destroy']({'where':{'type':_0x4939d4,'resourceId':_0x407430['id']}})[_0x9e9f('0x27')](function(){return _0x450e75;});})[_0x9e9f('0x27')](function(){_0x50eb50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bdd80,_0x1a9f96){return function(_0x188488){if(!_0x188488){_0x2bdd80[_0x9e9f('0x2c')](0x194);}return _0x188488;};}function handleError(_0x7137d,_0x5a5fb1){_0x5a5fb1=_0x5a5fb1||0x1f4;return function(_0xcfeb26){logger[_0x9e9f('0x2d')](_0xcfeb26[_0x9e9f('0x2e')]);if(_0xcfeb26[_0x9e9f('0x2f')]){delete _0xcfeb26[_0x9e9f('0x2f')];}_0x7137d[_0x9e9f('0x1d')](_0x5a5fb1)[_0x9e9f('0x30')](_0xcfeb26);};}exports[_0x9e9f('0x31')]=function(_0x48bf37,_0x3e2dfa){var _0x4c72d8={},_0xfae401={},_0x100a05={'count':0x0,'rows':[]};var _0x1f8177=_['map'](db['AnalyticExtractedReport']['rawAttributes'],function(_0x5badf3){return{'name':_0x5badf3[_0x9e9f('0x32')],'type':_0x5badf3[_0x9e9f('0x33')][_0x9e9f('0x34')]};});_0xfae401[_0x9e9f('0x35')]=_[_0x9e9f('0x36')](_0x1f8177,_0x9e9f('0x2f'));_0xfae401[_0x9e9f('0x37')]=_[_0x9e9f('0x38')](_0x48bf37['query']);_0xfae401[_0x9e9f('0x39')]=_['intersection'](_0xfae401[_0x9e9f('0x35')],_0xfae401[_0x9e9f('0x37')]);_0x4c72d8[_0x9e9f('0x3a')]=_[_0x9e9f('0x3b')](_0xfae401[_0x9e9f('0x35')],qs[_0x9e9f('0x3c')](_0x48bf37['query'][_0x9e9f('0x3c')]));_0x4c72d8[_0x9e9f('0x3a')]=_0x4c72d8['attributes'][_0x9e9f('0x3d')]?_0x4c72d8['attributes']:_0xfae401[_0x9e9f('0x35')];if(!_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x3e')]('nolimit')){_0x4c72d8[_0x9e9f('0x22')]=qs[_0x9e9f('0x22')](_0x48bf37[_0x9e9f('0x37')]['limit']);_0x4c72d8['offset']=qs[_0x9e9f('0x20')](_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x20')]);}_0x4c72d8[_0x9e9f('0x3f')]=qs[_0x9e9f('0x40')](_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x40')]);_0x4c72d8[_0x9e9f('0x41')]=qs[_0x9e9f('0x39')](_[_0x9e9f('0x42')](_0x48bf37[_0x9e9f('0x37')],_0xfae401[_0x9e9f('0x39')]),_0x1f8177);if(_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x43')]){_0x4c72d8[_0x9e9f('0x41')]=_[_0x9e9f('0x44')](_0x4c72d8[_0x9e9f('0x41')],{'$or':_['map'](_0x1f8177,function(_0x261c2b){if(_0x261c2b[_0x9e9f('0x33')]!==_0x9e9f('0x45')){var _0x333dd5={};_0x333dd5[_0x261c2b[_0x9e9f('0x2f')]]={'$like':'%'+_0x48bf37['query'][_0x9e9f('0x43')]+'%'};return _0x333dd5;}})});}_0x4c72d8=_[_0x9e9f('0x44')]({},_0x4c72d8,_0x48bf37[_0x9e9f('0x46')]);var _0x59c290={'where':_0x4c72d8[_0x9e9f('0x41')]};return db['AnalyticExtractedReport'][_0x9e9f('0x23')](_0x59c290)['then'](function(_0x5da307){_0x100a05[_0x9e9f('0x23')]=_0x5da307;if(_0x48bf37['query'][_0x9e9f('0x47')]){_0x4c72d8[_0x9e9f('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x9e9f('0x49')](_0x4c72d8);})['then'](function(_0x1a0910){_0x100a05[_0x9e9f('0x4a')]=_0x1a0910;return _0x100a05;})['then'](respondWithFilteredResult(_0x3e2dfa,_0x4c72d8))[_0x9e9f('0x4b')](handleError(_0x3e2dfa,null));};exports[_0x9e9f('0x4c')]=function(_0x52e03a,_0x2c128b){var _0x2d6d25={'raw':!![],'where':{'id':_0x52e03a[_0x9e9f('0x4d')]['id']}},_0x4f75ca={};_0x4f75ca[_0x9e9f('0x35')]=_['keys'](db[_0x9e9f('0x4e')]['rawAttributes']);_0x4f75ca[_0x9e9f('0x37')]=_[_0x9e9f('0x38')](_0x52e03a[_0x9e9f('0x37')]);_0x4f75ca[_0x9e9f('0x39')]=_['intersection'](_0x4f75ca[_0x9e9f('0x35')],_0x4f75ca['query']);_0x2d6d25['attributes']=_[_0x9e9f('0x3b')](_0x4f75ca[_0x9e9f('0x35')],qs[_0x9e9f('0x3c')](_0x52e03a['query'][_0x9e9f('0x3c')]));_0x2d6d25['attributes']=_0x2d6d25[_0x9e9f('0x3a')][_0x9e9f('0x3d')]?_0x2d6d25[_0x9e9f('0x3a')]:_0x4f75ca[_0x9e9f('0x35')];if(_0x52e03a[_0x9e9f('0x37')][_0x9e9f('0x47')]){_0x2d6d25[_0x9e9f('0x48')]=[{'all':!![]}];}_0x2d6d25=_[_0x9e9f('0x44')]({},_0x2d6d25,_0x52e03a['options']);return db[_0x9e9f('0x4e')][_0x9e9f('0x4f')](_0x2d6d25)[_0x9e9f('0x27')](handleEntityNotFound(_0x2c128b,null))[_0x9e9f('0x27')](respondWithResult(_0x2c128b,null))['catch'](handleError(_0x2c128b,null));};exports['create']=function(_0x216657,_0x13bbf8){return db[_0x9e9f('0x4e')][_0x9e9f('0x50')](_0x216657[_0x9e9f('0x51')],{})[_0x9e9f('0x27')](function(_0xc8b194){var _0x1d334a=_0x216657[_0x9e9f('0x52')][_0x9e9f('0x29')]({'plain':!![]});if(!_0x1d334a)throw new Error(_0x9e9f('0x53'));if(_0x1d334a[_0x9e9f('0x54')]===_0x9e9f('0x52')){var _0x32aad2=_0xc8b194[_0x9e9f('0x29')]({'plain':!![]});var _0x45ce49='ExtractedReports';return db['UserProfileSection'][_0x9e9f('0x4f')]({'where':{'name':_0x45ce49,'userProfileId':_0x1d334a['userProfileId']},'raw':!![]})[_0x9e9f('0x27')](function(_0x35b2cb){if(_0x35b2cb&&_0x35b2cb[_0x9e9f('0x55')]===0x0){return db[_0x9e9f('0x2b')][_0x9e9f('0x50')]({'name':_0x32aad2[_0x9e9f('0x2f')],'resourceId':_0x32aad2['id'],'type':_0x35b2cb[_0x9e9f('0x2f')],'sectionId':_0x35b2cb['id']},{})['then'](function(){return _0xc8b194;});}else{return _0xc8b194;}})['catch'](function(_0x34eeeb){logger[_0x9e9f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34eeeb);throw _0x34eeeb;});}return _0xc8b194;})['then'](respondWithResult(_0x13bbf8,0xc9))[_0x9e9f('0x4b')](handleError(_0x13bbf8,null));};exports[_0x9e9f('0x56')]=function(_0x2676cc,_0x24c6c7){if(_0x2676cc['body']['id']){delete _0x2676cc[_0x9e9f('0x51')]['id'];}return db[_0x9e9f('0x4e')]['find']({'where':{'id':_0x2676cc[_0x9e9f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24c6c7,null))[_0x9e9f('0x27')](saveUpdates(_0x2676cc[_0x9e9f('0x51')],null))[_0x9e9f('0x27')](respondWithResult(_0x24c6c7,null))[_0x9e9f('0x4b')](handleError(_0x24c6c7,null));};exports[_0x9e9f('0x28')]=function(_0x2abf55,_0x30bfd8){return db[_0x9e9f('0x4e')][_0x9e9f('0x4f')]({'where':{'id':_0x2abf55[_0x9e9f('0x4d')]['id']}})[_0x9e9f('0x27')](handleEntityNotFound(_0x30bfd8,null))[_0x9e9f('0x27')](removeEntity(_0x30bfd8,null))[_0x9e9f('0x4b')](handleError(_0x30bfd8,null));};exports[_0x9e9f('0x57')]=function(_0x27ad1b,_0x5d48e4,_0x1da310){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x27ad1b[_0x9e9f('0x4d')]['id']},'attributes':[_0x9e9f('0x2f'),_0x9e9f('0x58'),_0x9e9f('0x59'),_0x9e9f('0x5a')],'raw':!![]})[_0x9e9f('0x27')](handleEntityNotFound(_0x5d48e4,null))[_0x9e9f('0x27')](function(_0xd80095){if(_0xd80095){if(!fs[_0x9e9f('0x5b')](path[_0x9e9f('0x5c')](config[_0x9e9f('0x5d')],_0x9e9f('0x5e'),_0xd80095[_0x9e9f('0x59')]))){throw new db[(_0x9e9f('0x5f'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x27ad1b[_0x9e9f('0x37')][_0x9e9f('0x60')]){return _0x5d48e4[_0x9e9f('0x2c')](0xc8);}return _0x5d48e4[_0x9e9f('0x57')](path[_0x9e9f('0x5c')](config[_0x9e9f('0x5d')],_0x9e9f('0x5e'),_0xd80095['savename']),util['format'](_0x9e9f('0x61'),_0xd80095[_0x9e9f('0x58')]||_0xd80095[_0x9e9f('0x2f')],_0xd80095['output'][_0x9e9f('0x62')]()));}})[_0x9e9f('0x4b')](handleError(_0x5d48e4,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 16ba4f2..b076f5b 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 _0x8e13=['define','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise','rimraf'];(function(_0xaa20b8,_0x1ad9c0){var _0x28f4b6=function(_0xe3d628){while(--_0xe3d628){_0xaa20b8['push'](_0xaa20b8['shift']());}};_0x28f4b6(++_0x1ad9c0);}(_0x8e13,0xfb));var _0x38e1=function(_0x3eeb52,_0x188530){_0x3eeb52=_0x3eeb52-0x0;var _0x362915=_0x8e13[_0x3eeb52];return _0x362915;};'use strict';var _=require('lodash');var util=require(_0x38e1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x38e1('0x1'));var BPromise=require(_0x38e1('0x2'));var rp=require(_0x38e1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38e1('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x3187dc,_0x6cd59b){return _0x3187dc[_0x38e1('0x5')](_0x38e1('0x6'),attributes,{'tableName':_0x38e1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4d8=['api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','lodash','../../config/logger'];(function(_0x1f018b,_0x8640d9){var _0x5f39a4=function(_0x3e87c5){while(--_0x3e87c5){_0x1f018b['push'](_0x1f018b['shift']());}};_0x5f39a4(++_0x8640d9);}(_0xd4d8,0xee));var _0x8d4d=function(_0x42ab91,_0x2a0179){_0x42ab91=_0x42ab91-0x0;var _0x259d35=_0xd4d8[_0x42ab91];return _0x259d35;};'use strict';var _=require(_0x8d4d('0x0'));var util=require('util');var logger=require(_0x8d4d('0x1'))(_0x8d4d('0x2'));var moment=require(_0x8d4d('0x3'));var BPromise=require(_0x8d4d('0x4'));var rp=require(_0x8d4d('0x5'));var fs=require('fs');var path=require(_0x8d4d('0x6'));var rimraf=require(_0x8d4d('0x7'));var config=require('../../config/environment');var attributes=require(_0x8d4d('0x8'));module['exports']=function(_0x3db03d,_0x4c396a){return _0x3db03d[_0x8d4d('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','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 64a43d2..6d12d59 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 _0xf500=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xf500,0x9a));var _0x0f50=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xf500[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f50('0x0'));var BPromise=require(_0x0f50('0x1'));var rs=require(_0x0f50('0x2'));var fs=require('fs');var Redis=require(_0x0f50('0x3'));var db=require(_0x0f50('0x4'))['db'];var utils=require(_0x0f50('0x5'));var logger=require('../../config/logger')(_0x0f50('0x6'));var config=require(_0x0f50('0x7'));var jayson=require(_0x0f50('0x8'));var client=jayson[_0x0f50('0x9')][_0x0f50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e0d80,_0x1209aa,_0x56596f){return new BPromise(function(_0x4cce68,_0x1f5ef0){return client[_0x0f50('0xb')](_0x4e0d80,_0x56596f)[_0x0f50('0xc')](function(_0x5115ed){logger[_0x0f50('0xd')](_0x0f50('0xe'),_0x1209aa,_0x0f50('0xf'));logger[_0x0f50('0x10')](_0x0f50('0x11'),_0x1209aa,'request\x20sent',JSON[_0x0f50('0x12')](_0x5115ed));if(_0x5115ed[_0x0f50('0x13')]){if(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x14')]===0x1f4){logger[_0x0f50('0x13')](_0x0f50('0xe'),_0x1209aa,_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);return _0x1f5ef0(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);}logger['error'](_0x0f50('0xe'),_0x1209aa,_0x5115ed['error']['message']);return _0x4cce68(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);}else{logger[_0x0f50('0xd')](_0x0f50('0xe'),_0x1209aa,'request\x20sent');_0x4cce68(_0x5115ed[_0x0f50('0x16')]['message']);}})['catch'](function(_0xff2322){logger[_0x0f50('0x13')](_0x0f50('0xe'),_0x1209aa,_0xff2322);_0x1f5ef0(_0xff2322);});});}
\ No newline at end of file
+var _0xf263=['rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf263,0x149));var _0x3f26=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0xf263[_0x4cf8d4];return _0x2c1beb;};'use strict';var _=require(_0x3f26('0x0'));var util=require(_0x3f26('0x1'));var moment=require(_0x3f26('0x2'));var BPromise=require(_0x3f26('0x3'));var rs=require(_0x3f26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f26('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f26('0x6'))(_0x3f26('0x7'));var config=require(_0x3f26('0x8'));var jayson=require(_0x3f26('0x9'));var client=jayson['client'][_0x3f26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae1ad,_0x48392a,_0x50fb53){return new BPromise(function(_0x25f9bd,_0x202d88){return client[_0x3f26('0xb')](_0x3ae1ad,_0x50fb53)['then'](function(_0x219fc5){logger[_0x3f26('0xc')](_0x3f26('0xd'),_0x48392a,_0x3f26('0xe'));logger[_0x3f26('0xf')](_0x3f26('0x10'),_0x48392a,_0x3f26('0xe'),JSON[_0x3f26('0x11')](_0x219fc5));if(_0x219fc5[_0x3f26('0x12')]){if(_0x219fc5[_0x3f26('0x12')]['code']===0x1f4){logger['error'](_0x3f26('0xd'),_0x48392a,_0x219fc5[_0x3f26('0x12')][_0x3f26('0x13')]);return _0x202d88(_0x219fc5[_0x3f26('0x12')]['message']);}logger[_0x3f26('0x12')](_0x3f26('0xd'),_0x48392a,_0x219fc5[_0x3f26('0x12')][_0x3f26('0x13')]);return _0x25f9bd(_0x219fc5['error'][_0x3f26('0x13')]);}else{logger[_0x3f26('0xc')](_0x3f26('0xd'),_0x48392a,_0x3f26('0xe'));_0x25f9bd(_0x219fc5['result'][_0x3f26('0x13')]);}})[_0x3f26('0x14')](function(_0x3bcf44){logger[_0x3f26('0x12')](_0x3f26('0xd'),_0x48392a,_0x3bcf44);_0x202d88(_0x3bcf44);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index caa4658..fe2d78d 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 _0xf926=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','download','post','create','put','update','destroy','exports'];(function(_0x41bd33,_0x8dd533){var _0x1ef83a=function(_0x5821aa){while(--_0x5821aa){_0x41bd33['push'](_0x41bd33['shift']());}};_0x1ef83a(++_0x8dd533);}(_0xf926,0xd2));var _0x6f92=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf926[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x6f92('0x0'));var util=require(_0x6f92('0x1'));var path=require(_0x6f92('0x2'));var timeout=require(_0x6f92('0x3'));var express=require(_0x6f92('0x4'));var router=express['Router']();var fs_extra=require(_0x6f92('0x5'));var auth=require(_0x6f92('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f92('0x7'));var controller=require(_0x6f92('0x8'));router[_0x6f92('0x9')]('/',auth['isAuthenticated'](),controller[_0x6f92('0xa')]);router[_0x6f92('0x9')](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0xd')]);router[_0x6f92('0x9')]('/:id/download',auth[_0x6f92('0xc')](),controller[_0x6f92('0xe')]);router[_0x6f92('0xf')]('/',auth[_0x6f92('0xc')](),controller[_0x6f92('0x10')]);router[_0x6f92('0x11')](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0x12')]);router['delete'](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0x13')]);module[_0x6f92('0x14')]=router;
\ No newline at end of file
+var _0x8ec5=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x582e57,_0x85fded){var _0xfef0e6=function(_0x4b78be){while(--_0x4b78be){_0x582e57['push'](_0x582e57['shift']());}};_0xfef0e6(++_0x85fded);}(_0x8ec5,0x1a1));var _0x58ec=function(_0x3782cb,_0x46f0be){_0x3782cb=_0x3782cb-0x0;var _0x557f9a=_0x8ec5[_0x3782cb];return _0x557f9a;};'use strict';var multer=require('multer');var util=require(_0x58ec('0x0'));var path=require(_0x58ec('0x1'));var timeout=require(_0x58ec('0x2'));var express=require(_0x58ec('0x3'));var router=express[_0x58ec('0x4')]();var fs_extra=require(_0x58ec('0x5'));var auth=require(_0x58ec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x58ec('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x58ec('0x8')]('/',auth[_0x58ec('0x9')](),controller[_0x58ec('0xa')]);router[_0x58ec('0x8')](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0xc')]);router[_0x58ec('0x8')](_0x58ec('0xd'),auth[_0x58ec('0x9')](),controller[_0x58ec('0xe')]);router[_0x58ec('0xf')]('/',auth[_0x58ec('0x9')](),controller[_0x58ec('0x10')]);router[_0x58ec('0x11')](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0x12')]);router['delete'](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0x13')]);module[_0x58ec('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e496292..f4448b8 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 _0x6b3b=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x6b3b,0xc3));var _0xb6b3=function(_0x340294,_0x2775a9){_0x340294=_0x340294-0x0;var _0x23baf6=_0x6b3b[_0x340294];return _0x23baf6;};'use strict';var Sequelize=require(_0xb6b3('0x0'));module[_0xb6b3('0x1')]={'field':{'type':Sequelize[_0xb6b3('0x2')]},'alias':{'type':Sequelize[_0xb6b3('0x3')]},'function':{'type':Sequelize[_0xb6b3('0x3')]},'format':{'type':Sequelize[_0xb6b3('0x3')]},'groupBy':{'type':Sequelize[_0xb6b3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb6b3('0x3')]},'custom':{'type':Sequelize[_0xb6b3('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3f78=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f78,0x9a));var _0x83f7=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x3f78[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0x83f7('0x0'));module[_0x83f7('0x1')]={'field':{'type':Sequelize[_0x83f7('0x2')]},'alias':{'type':Sequelize[_0x83f7('0x3')]},'function':{'type':Sequelize[_0x83f7('0x3')]},'format':{'type':Sequelize[_0x83f7('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x83f7('0x3')]},'custom':{'type':Sequelize[_0x83f7('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index c723e1d..db27f9d 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 _0x3503=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','bulkCreate','bulkDestroy','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','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','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x185c5e,_0x1b05f5){var _0x14053a=function(_0xd55b4){while(--_0xd55b4){_0x185c5e['push'](_0x185c5e['shift']());}};_0x14053a(++_0x1b05f5);}(_0x3503,0x1ad));var _0x3350=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3503[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x3350('0x0'));var rimraf=require(_0x3350('0x1'));var zipdir=require(_0x3350('0x2'));var jsonpatch=require(_0x3350('0x3'));var rp=require(_0x3350('0x4'));var moment=require(_0x3350('0x5'));var BPromise=require(_0x3350('0x6'));var Mustache=require('mustache');var util=require(_0x3350('0x7'));var path=require(_0x3350('0x8'));var sox=require(_0x3350('0x9'));var csv=require(_0x3350('0xa'));var ejs=require(_0x3350('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3350('0xc'));var deskjs=require(_0x3350('0xd'));var toCsv=require(_0x3350('0xa'));var querystring=require(_0x3350('0xe'));var Papa=require(_0x3350('0xf'));var Redis=require(_0x3350('0x10'));var authService=require(_0x3350('0x11'));var qs=require(_0x3350('0x12'));var as=require(_0x3350('0x13'));var hardwareService=require(_0x3350('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3350('0x15'));var config=require(_0x3350('0x16'));var licenseUtil=require(_0x3350('0x17'));var db=require(_0x3350('0x18'))['db'];function respondWithStatusCode(_0x41be3f,_0x4f22e3){_0x4f22e3=_0x4f22e3||0xcc;return function(_0x24eb43){if(_0x24eb43){return _0x41be3f[_0x3350('0x19')](_0x4f22e3);}return _0x41be3f[_0x3350('0x1a')](_0x4f22e3)['end']();};}function respondWithResult(_0x46968f,_0x527c08){_0x527c08=_0x527c08||0xc8;return function(_0x861206){if(_0x861206){return _0x46968f[_0x3350('0x1a')](_0x527c08)[_0x3350('0x1b')](_0x861206);}};}function respondWithFilteredResult(_0x484c79,_0x286dce){return function(_0x1dc9f8){if(_0x1dc9f8){var _0x527c26=typeof _0x286dce['offset']==='undefined'&&typeof _0x286dce['limit']===_0x3350('0x1c');var _0x347d81=_0x1dc9f8[_0x3350('0x1d')];var _0x53068b=_0x527c26?0x0:_0x286dce['offset'];var _0x100384=_0x527c26?_0x1dc9f8[_0x3350('0x1d')]:_0x286dce[_0x3350('0x1e')]+_0x286dce[_0x3350('0x1f')];var _0x337b6a;if(_0x100384>=_0x347d81){_0x100384=_0x347d81;_0x337b6a=0xc8;}else{_0x337b6a=0xce;}_0x484c79['status'](_0x337b6a);return _0x484c79[_0x3350('0x20')](_0x3350('0x21'),_0x53068b+'-'+_0x100384+'/'+_0x347d81)[_0x3350('0x1b')](_0x1dc9f8);}return null;};}function patchUpdates(_0x1f880b){return function(_0x5301fd){try{jsonpatch[_0x3350('0x22')](_0x5301fd,_0x1f880b,!![]);}catch(_0x4a41e2){return BPromise[_0x3350('0x23')](_0x4a41e2);}return _0x5301fd[_0x3350('0x24')]();};}function saveUpdates(_0x109409,_0x23e8d8){return function(_0x44b90e){if(_0x44b90e){return _0x44b90e[_0x3350('0x25')](_0x109409)['then'](function(_0x4235a9){return _0x4235a9;});}return null;};}function removeEntity(_0x469775,_0x6a8f3e){return function(_0x42e38c){if(_0x42e38c){return _0x42e38c[_0x3350('0x26')]()[_0x3350('0x27')](function(){_0x469775['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edc17,_0x2d39bd){return function(_0x45eec6){if(!_0x45eec6){_0x4edc17[_0x3350('0x19')](0x194);}return _0x45eec6;};}function handleError(_0x3f0558,_0x162af7){_0x162af7=_0x162af7||0x1f4;return function(_0x5977cf){logger['error'](_0x5977cf[_0x3350('0x28')]);if(_0x5977cf[_0x3350('0x29')]){delete _0x5977cf[_0x3350('0x29')];}_0x3f0558[_0x3350('0x1a')](_0x162af7)[_0x3350('0x2a')](_0x5977cf);};}exports[_0x3350('0x2b')]=function(_0x318efa,_0x30a577){var _0x4afc77={},_0x5633a0={},_0x56879c={'count':0x0,'rows':[]};var _0x74e27=_[_0x3350('0x2c')](db[_0x3350('0x2d')][_0x3350('0x2e')],function(_0x3540f4){return{'name':_0x3540f4[_0x3350('0x2f')],'type':_0x3540f4['type'][_0x3350('0x30')]};});_0x5633a0[_0x3350('0x31')]=_[_0x3350('0x2c')](_0x74e27,_0x3350('0x29'));_0x5633a0['query']=_[_0x3350('0x32')](_0x318efa[_0x3350('0x33')]);_0x5633a0[_0x3350('0x34')]=_[_0x3350('0x35')](_0x5633a0[_0x3350('0x31')],_0x5633a0[_0x3350('0x33')]);_0x4afc77[_0x3350('0x36')]=_[_0x3350('0x35')](_0x5633a0[_0x3350('0x31')],qs['fields'](_0x318efa[_0x3350('0x33')]['fields']));_0x4afc77[_0x3350('0x36')]=_0x4afc77[_0x3350('0x36')][_0x3350('0x37')]?_0x4afc77['attributes']:_0x5633a0[_0x3350('0x31')];if(!_0x318efa['query'][_0x3350('0x38')](_0x3350('0x39'))){_0x4afc77[_0x3350('0x1f')]=qs[_0x3350('0x1f')](_0x318efa[_0x3350('0x33')][_0x3350('0x1f')]);_0x4afc77[_0x3350('0x1e')]=qs['offset'](_0x318efa[_0x3350('0x33')][_0x3350('0x1e')]);}_0x4afc77[_0x3350('0x3a')]=qs[_0x3350('0x3b')](_0x318efa[_0x3350('0x33')][_0x3350('0x3b')]);_0x4afc77['where']=qs[_0x3350('0x34')](_[_0x3350('0x3c')](_0x318efa[_0x3350('0x33')],_0x5633a0['filters']),_0x74e27);if(_0x318efa[_0x3350('0x33')][_0x3350('0x3d')]){_0x4afc77[_0x3350('0x3e')]=_[_0x3350('0x3f')](_0x4afc77[_0x3350('0x3e')],{'$or':_[_0x3350('0x2c')](_0x74e27,function(_0x215704){if(_0x215704['type']!==_0x3350('0x40')){var _0x14343c={};_0x14343c[_0x215704[_0x3350('0x29')]]={'$like':'%'+_0x318efa['query']['filter']+'%'};return _0x14343c;}})});}_0x4afc77=_['merge']({},_0x4afc77,_0x318efa['options']);var _0x348238={'where':_0x4afc77[_0x3350('0x3e')]};return db[_0x3350('0x2d')][_0x3350('0x1d')](_0x348238)[_0x3350('0x27')](function(_0x1942b7){_0x56879c[_0x3350('0x1d')]=_0x1942b7;if(_0x318efa[_0x3350('0x33')][_0x3350('0x41')]){_0x4afc77[_0x3350('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3350('0x43')](_0x4afc77);})[_0x3350('0x27')](function(_0xb54fa0){_0x56879c[_0x3350('0x44')]=_0xb54fa0;return _0x56879c;})[_0x3350('0x27')](respondWithFilteredResult(_0x30a577,_0x4afc77))[_0x3350('0x45')](handleError(_0x30a577,null));};exports[_0x3350('0x46')]=function(_0x54ec7f,_0x1af97d){var _0x24d648={'raw':![],'where':{'id':_0x54ec7f[_0x3350('0x47')]['id']}},_0x56ba90={};_0x56ba90[_0x3350('0x31')]=_[_0x3350('0x32')](db['AnalyticFieldReport'][_0x3350('0x2e')]);_0x56ba90['query']=_[_0x3350('0x32')](_0x54ec7f[_0x3350('0x33')]);_0x56ba90['filters']=_[_0x3350('0x35')](_0x56ba90[_0x3350('0x31')],_0x56ba90[_0x3350('0x33')]);_0x24d648[_0x3350('0x36')]=_['intersection'](_0x56ba90[_0x3350('0x31')],qs[_0x3350('0x48')](_0x54ec7f[_0x3350('0x33')][_0x3350('0x48')]));_0x24d648[_0x3350('0x36')]=_0x24d648['attributes'][_0x3350('0x37')]?_0x24d648[_0x3350('0x36')]:_0x56ba90[_0x3350('0x31')];if(_0x54ec7f['query'][_0x3350('0x41')]){_0x24d648[_0x3350('0x42')]=[{'all':!![]}];}_0x24d648=_[_0x3350('0x3f')]({},_0x24d648,_0x54ec7f['options']);return db['AnalyticFieldReport'][_0x3350('0x49')](_0x24d648)[_0x3350('0x27')](handleEntityNotFound(_0x1af97d,null))[_0x3350('0x27')](respondWithResult(_0x1af97d,null))[_0x3350('0x45')](handleError(_0x1af97d,null));};exports[_0x3350('0x4a')]=function(_0x77699c,_0x30a402){return db[_0x3350('0x2d')]['create'](_0x77699c[_0x3350('0x4b')],{})['then'](respondWithResult(_0x30a402,0xc9))[_0x3350('0x45')](handleError(_0x30a402,null));};exports[_0x3350('0x4c')]=function(_0x27a2bb,_0x435689){return db[_0x3350('0x2d')][_0x3350('0x4c')](_0x27a2bb[_0x3350('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x435689,0xc9))[_0x3350('0x45')](handleError(_0x435689,null));};exports[_0x3350('0x25')]=function(_0x5e4702,_0x283578){if(_0x5e4702[_0x3350('0x4b')]['id']){delete _0x5e4702['body']['id'];}return db['AnalyticFieldReport'][_0x3350('0x49')]({'where':{'id':_0x5e4702[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x283578,null))[_0x3350('0x27')](saveUpdates(_0x5e4702['body'],null))[_0x3350('0x27')](respondWithResult(_0x283578,null))[_0x3350('0x45')](handleError(_0x283578,null));};exports[_0x3350('0x26')]=function(_0x403f82,_0x10b497){return db[_0x3350('0x2d')][_0x3350('0x49')]({'where':{'id':_0x403f82[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x10b497,null))[_0x3350('0x27')](removeEntity(_0x10b497,null))[_0x3350('0x45')](handleError(_0x10b497,null));};exports[_0x3350('0x4d')]=function(_0xaac246,_0x27c5f7){return db[_0x3350('0x2d')][_0x3350('0x26')]({'where':{'id':_0xaac246[_0x3350('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3350('0x27')](respondWithResult(_0x27c5f7,0xcc))[_0x3350('0x45')](handleError(_0x27c5f7,null));};exports['addFields']=function(_0x326dca,_0x12b1c4,_0x297736){return db['AnalyticCustomReport'][_0x3350('0x4e')]({'where':{'id':_0x326dca[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x12b1c4,null))[_0x3350('0x27')](function(_0x311128){if(_0x311128){return db[_0x3350('0x4f')][_0x3350('0x50')](function(_0x6a3070){return db['AnalyticFieldReport'][_0x3350('0x26')]({'where':{'CustomReportId':_0x326dca[_0x3350('0x47')]['id']},'transaction':_0x6a3070})[_0x3350('0x27')](function(_0x33d24d){var _0x1dceb9=_[_0x3350('0x2c')](_0x326dca['body'],function(_0x39dd4f){delete _0x39dd4f['id'];_0x39dd4f[_0x3350('0x51')]=_0x326dca['params']['id'];return _0x39dd4f;});return db[_0x3350('0x2d')][_0x3350('0x4c')](_0x1dceb9,{'transaction':_0x6a3070});});})[_0x3350('0x27')](function(){return db[_0x3350('0x2d')][_0x3350('0x43')]({'where':{'CustomReportId':_0x326dca[_0x3350('0x47')]['id']}});});}})[_0x3350('0x27')](respondWithResult(_0x12b1c4,null))[_0x3350('0x45')](handleError(_0x12b1c4,null));};
\ No newline at end of file
+var _0xd2cd=['ioredis','../../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','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','merge','catch','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x30b9d6,_0x2ad4ea){var _0x5f4d07=function(_0xc507f1){while(--_0xc507f1){_0x30b9d6['push'](_0x30b9d6['shift']());}};_0x5f4d07(++_0x2ad4ea);}(_0xd2cd,0x14f));var _0xdd2c=function(_0xe0dee2,_0x35d2a8){_0xe0dee2=_0xe0dee2-0x0;var _0x568ed0=_0xd2cd[_0xe0dee2];return _0x568ed0;};'use strict';var emlformat=require(_0xdd2c('0x0'));var rimraf=require(_0xdd2c('0x1'));var zipdir=require(_0xdd2c('0x2'));var jsonpatch=require(_0xdd2c('0x3'));var rp=require(_0xdd2c('0x4'));var moment=require(_0xdd2c('0x5'));var BPromise=require(_0xdd2c('0x6'));var Mustache=require(_0xdd2c('0x7'));var util=require(_0xdd2c('0x8'));var path=require('path');var sox=require(_0xdd2c('0x9'));var csv=require('to-csv');var ejs=require(_0xdd2c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd2c('0xb'));var crypto=require(_0xdd2c('0xc'));var jsforce=require(_0xdd2c('0xd'));var deskjs=require(_0xdd2c('0xe'));var toCsv=require(_0xdd2c('0xf'));var querystring=require('querystring');var Papa=require(_0xdd2c('0x10'));var Redis=require(_0xdd2c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd2c('0x12'));var as=require(_0xdd2c('0x13'));var hardwareService=require(_0xdd2c('0x14'));var logger=require(_0xdd2c('0x15'))(_0xdd2c('0x16'));var utils=require(_0xdd2c('0x17'));var config=require(_0xdd2c('0x18'));var licenseUtil=require(_0xdd2c('0x19'));var db=require(_0xdd2c('0x1a'))['db'];function respondWithStatusCode(_0x447453,_0x238934){_0x238934=_0x238934||0xcc;return function(_0x4b505c){if(_0x4b505c){return _0x447453[_0xdd2c('0x1b')](_0x238934);}return _0x447453[_0xdd2c('0x1c')](_0x238934)[_0xdd2c('0x1d')]();};}function respondWithResult(_0x32920c,_0x2524b4){_0x2524b4=_0x2524b4||0xc8;return function(_0x1b4d35){if(_0x1b4d35){return _0x32920c[_0xdd2c('0x1c')](_0x2524b4)[_0xdd2c('0x1e')](_0x1b4d35);}};}function respondWithFilteredResult(_0x550cd6,_0x5a4f82){return function(_0x30d7b8){if(_0x30d7b8){var _0x4321cf=typeof _0x5a4f82[_0xdd2c('0x1f')]===_0xdd2c('0x20')&&typeof _0x5a4f82[_0xdd2c('0x21')]===_0xdd2c('0x20');var _0x1bc142=_0x30d7b8[_0xdd2c('0x22')];var _0x1b69f2=_0x4321cf?0x0:_0x5a4f82[_0xdd2c('0x1f')];var _0x11af89=_0x4321cf?_0x30d7b8['count']:_0x5a4f82[_0xdd2c('0x1f')]+_0x5a4f82[_0xdd2c('0x21')];var _0x48584f;if(_0x11af89>=_0x1bc142){_0x11af89=_0x1bc142;_0x48584f=0xc8;}else{_0x48584f=0xce;}_0x550cd6[_0xdd2c('0x1c')](_0x48584f);return _0x550cd6['set'](_0xdd2c('0x23'),_0x1b69f2+'-'+_0x11af89+'/'+_0x1bc142)[_0xdd2c('0x1e')](_0x30d7b8);}return null;};}function patchUpdates(_0x1cdcc3){return function(_0x2c01a6){try{jsonpatch[_0xdd2c('0x24')](_0x2c01a6,_0x1cdcc3,!![]);}catch(_0x48f473){return BPromise[_0xdd2c('0x25')](_0x48f473);}return _0x2c01a6[_0xdd2c('0x26')]();};}function saveUpdates(_0xecea5a,_0x4c2c90){return function(_0x1049b9){if(_0x1049b9){return _0x1049b9[_0xdd2c('0x27')](_0xecea5a)[_0xdd2c('0x28')](function(_0x40b625){return _0x40b625;});}return null;};}function removeEntity(_0x4d4444,_0x5d44aa){return function(_0x8b670c){if(_0x8b670c){return _0x8b670c[_0xdd2c('0x29')]()[_0xdd2c('0x28')](function(){_0x4d4444['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c043,_0x3b4cfb){return function(_0x3130dd){if(!_0x3130dd){_0x27c043[_0xdd2c('0x1b')](0x194);}return _0x3130dd;};}function handleError(_0x1a2cd0,_0x25f91a){_0x25f91a=_0x25f91a||0x1f4;return function(_0x43b623){logger[_0xdd2c('0x2a')](_0x43b623[_0xdd2c('0x2b')]);if(_0x43b623[_0xdd2c('0x2c')]){delete _0x43b623['name'];}_0x1a2cd0[_0xdd2c('0x1c')](_0x25f91a)['send'](_0x43b623);};}exports[_0xdd2c('0x2d')]=function(_0x2144bd,_0x350c5a){var _0x584168={},_0x3cde73={},_0x33df32={'count':0x0,'rows':[]};var _0x1059ac=_[_0xdd2c('0x2e')](db[_0xdd2c('0x2f')]['rawAttributes'],function(_0x972a97){return{'name':_0x972a97[_0xdd2c('0x30')],'type':_0x972a97[_0xdd2c('0x31')][_0xdd2c('0x32')]};});_0x3cde73[_0xdd2c('0x33')]=_[_0xdd2c('0x2e')](_0x1059ac,_0xdd2c('0x2c'));_0x3cde73['query']=_[_0xdd2c('0x34')](_0x2144bd[_0xdd2c('0x35')]);_0x3cde73[_0xdd2c('0x36')]=_[_0xdd2c('0x37')](_0x3cde73[_0xdd2c('0x33')],_0x3cde73['query']);_0x584168['attributes']=_['intersection'](_0x3cde73[_0xdd2c('0x33')],qs[_0xdd2c('0x38')](_0x2144bd[_0xdd2c('0x35')]['fields']));_0x584168['attributes']=_0x584168[_0xdd2c('0x39')][_0xdd2c('0x3a')]?_0x584168[_0xdd2c('0x39')]:_0x3cde73[_0xdd2c('0x33')];if(!_0x2144bd[_0xdd2c('0x35')]['hasOwnProperty'](_0xdd2c('0x3b'))){_0x584168[_0xdd2c('0x21')]=qs['limit'](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x21')]);_0x584168[_0xdd2c('0x1f')]=qs[_0xdd2c('0x1f')](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x1f')]);}_0x584168[_0xdd2c('0x3c')]=qs[_0xdd2c('0x3d')](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x3d')]);_0x584168[_0xdd2c('0x3e')]=qs[_0xdd2c('0x36')](_[_0xdd2c('0x3f')](_0x2144bd[_0xdd2c('0x35')],_0x3cde73[_0xdd2c('0x36')]),_0x1059ac);if(_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x40')]){_0x584168[_0xdd2c('0x3e')]=_['merge'](_0x584168[_0xdd2c('0x3e')],{'$or':_[_0xdd2c('0x2e')](_0x1059ac,function(_0x3b5393){if(_0x3b5393['type']!==_0xdd2c('0x41')){var _0x324d29={};_0x324d29[_0x3b5393[_0xdd2c('0x2c')]]={'$like':'%'+_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x40')]+'%'};return _0x324d29;}})});}_0x584168=_['merge']({},_0x584168,_0x2144bd[_0xdd2c('0x42')]);var _0x50d5cb={'where':_0x584168[_0xdd2c('0x3e')]};return db[_0xdd2c('0x2f')][_0xdd2c('0x22')](_0x50d5cb)[_0xdd2c('0x28')](function(_0x306a2a){_0x33df32['count']=_0x306a2a;if(_0x2144bd['query'][_0xdd2c('0x43')]){_0x584168[_0xdd2c('0x44')]=[{'all':!![]}];}return db[_0xdd2c('0x2f')][_0xdd2c('0x45')](_0x584168);})[_0xdd2c('0x28')](function(_0x5c3700){_0x33df32[_0xdd2c('0x46')]=_0x5c3700;return _0x33df32;})[_0xdd2c('0x28')](respondWithFilteredResult(_0x350c5a,_0x584168))['catch'](handleError(_0x350c5a,null));};exports[_0xdd2c('0x47')]=function(_0x7e5f72,_0x40aa19){var _0x4e3712={'raw':![],'where':{'id':_0x7e5f72[_0xdd2c('0x48')]['id']}},_0x31e04f={};_0x31e04f[_0xdd2c('0x33')]=_[_0xdd2c('0x34')](db['AnalyticFieldReport'][_0xdd2c('0x49')]);_0x31e04f[_0xdd2c('0x35')]=_[_0xdd2c('0x34')](_0x7e5f72['query']);_0x31e04f[_0xdd2c('0x36')]=_[_0xdd2c('0x37')](_0x31e04f[_0xdd2c('0x33')],_0x31e04f['query']);_0x4e3712[_0xdd2c('0x39')]=_[_0xdd2c('0x37')](_0x31e04f[_0xdd2c('0x33')],qs[_0xdd2c('0x38')](_0x7e5f72['query']['fields']));_0x4e3712[_0xdd2c('0x39')]=_0x4e3712[_0xdd2c('0x39')][_0xdd2c('0x3a')]?_0x4e3712[_0xdd2c('0x39')]:_0x31e04f[_0xdd2c('0x33')];if(_0x7e5f72['query']['includeAll']){_0x4e3712[_0xdd2c('0x44')]=[{'all':!![]}];}_0x4e3712=_[_0xdd2c('0x4a')]({},_0x4e3712,_0x7e5f72['options']);return db[_0xdd2c('0x2f')]['find'](_0x4e3712)['then'](handleEntityNotFound(_0x40aa19,null))[_0xdd2c('0x28')](respondWithResult(_0x40aa19,null))[_0xdd2c('0x4b')](handleError(_0x40aa19,null));};exports[_0xdd2c('0x4c')]=function(_0x9d2248,_0x1e01a6){return db['AnalyticFieldReport']['create'](_0x9d2248[_0xdd2c('0x4d')],{})[_0xdd2c('0x28')](respondWithResult(_0x1e01a6,0xc9))[_0xdd2c('0x4b')](handleError(_0x1e01a6,null));};exports['bulkCreate']=function(_0x38f5a3,_0x1c721d){return db[_0xdd2c('0x2f')][_0xdd2c('0x4e')](_0x38f5a3[_0xdd2c('0x4d')],{'raw':![],'individualHooks':!![]})[_0xdd2c('0x28')](respondWithResult(_0x1c721d,0xc9))[_0xdd2c('0x4b')](handleError(_0x1c721d,null));};exports['update']=function(_0x3120fe,_0x43aa33){if(_0x3120fe[_0xdd2c('0x4d')]['id']){delete _0x3120fe[_0xdd2c('0x4d')]['id'];}return db[_0xdd2c('0x2f')][_0xdd2c('0x4f')]({'where':{'id':_0x3120fe[_0xdd2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x43aa33,null))[_0xdd2c('0x28')](saveUpdates(_0x3120fe['body'],null))['then'](respondWithResult(_0x43aa33,null))[_0xdd2c('0x4b')](handleError(_0x43aa33,null));};exports[_0xdd2c('0x29')]=function(_0x59ec0f,_0x113f19){return db['AnalyticFieldReport'][_0xdd2c('0x4f')]({'where':{'id':_0x59ec0f[_0xdd2c('0x48')]['id']}})[_0xdd2c('0x28')](handleEntityNotFound(_0x113f19,null))[_0xdd2c('0x28')](removeEntity(_0x113f19,null))[_0xdd2c('0x4b')](handleError(_0x113f19,null));};exports[_0xdd2c('0x50')]=function(_0xac54ce,_0x569df1){return db['AnalyticFieldReport'][_0xdd2c('0x29')]({'where':{'id':_0xac54ce['query'][_0xdd2c('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xdd2c('0x28')](respondWithResult(_0x569df1,0xcc))[_0xdd2c('0x4b')](handleError(_0x569df1,null));};exports[_0xdd2c('0x52')]=function(_0x14ed1f,_0x5a651b,_0x149338){return db[_0xdd2c('0x53')][_0xdd2c('0x54')]({'where':{'id':_0x14ed1f[_0xdd2c('0x48')]['id']}})[_0xdd2c('0x28')](handleEntityNotFound(_0x5a651b,null))[_0xdd2c('0x28')](function(_0x3cc5b9){if(_0x3cc5b9){return db[_0xdd2c('0x55')][_0xdd2c('0x56')](function(_0x913ccd){return db[_0xdd2c('0x2f')]['destroy']({'where':{'CustomReportId':_0x14ed1f['params']['id']},'transaction':_0x913ccd})['then'](function(_0x77a343){var _0x255f49=_['map'](_0x14ed1f['body'],function(_0x28f512){delete _0x28f512['id'];_0x28f512[_0xdd2c('0x57')]=_0x14ed1f[_0xdd2c('0x48')]['id'];return _0x28f512;});return db[_0xdd2c('0x2f')][_0xdd2c('0x4e')](_0x255f49,{'transaction':_0x913ccd});});})['then'](function(){return db[_0xdd2c('0x2f')][_0xdd2c('0x45')]({'where':{'CustomReportId':_0x14ed1f['params']['id']}});});}})[_0xdd2c('0x28')](respondWithResult(_0x5a651b,null))[_0xdd2c('0x4b')](handleError(_0x5a651b,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 38e4e57..ab0f127 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 _0x6acf=['analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','./analyticFieldReport.attributes','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6acf,0x17d));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ac('0x0'));var util=require(_0xf6ac('0x1'));var logger=require(_0xf6ac('0x2'))(_0xf6ac('0x3'));var moment=require(_0xf6ac('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6ac('0x5'));var fs=require('fs');var path=require(_0xf6ac('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf6ac('0x7'));module['exports']=function(_0x3536d8,_0x30dace){return _0x3536d8[_0xf6ac('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0xf6ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x95a4=['bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','../../config/logger','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x95a4,0x17d));var _0x495a=function(_0xbd97f4,_0x8b5779){_0xbd97f4=_0xbd97f4-0x0;var _0x11ee12=_0x95a4[_0xbd97f4];return _0x11ee12;};'use strict';var _=require(_0x495a('0x0'));var util=require('util');var logger=require(_0x495a('0x1'))(_0x495a('0x2'));var moment=require(_0x495a('0x3'));var BPromise=require(_0x495a('0x4'));var rp=require(_0x495a('0x5'));var fs=require('fs');var path=require(_0x495a('0x6'));var rimraf=require('rimraf');var config=require(_0x495a('0x7'));var attributes=require(_0x495a('0x8'));module['exports']=function(_0x272c8f,_0x3a3ae4){return _0x272c8f[_0x495a('0x9')](_0x495a('0xa'),attributes,{'tableName':'analytics_report_fields','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 3f95826..917c6a1 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 _0x1a7f=['../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x52ddc8,_0xada5d6){var _0x41e9c3=function(_0x432441){while(--_0x432441){_0x52ddc8['push'](_0x52ddc8['shift']());}};_0x41e9c3(++_0xada5d6);}(_0x1a7f,0xcc));var _0xf1a7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1a7f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xf1a7('0x0'));var moment=require(_0xf1a7('0x1'));var BPromise=require(_0xf1a7('0x2'));var rs=require(_0xf1a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1a7('0x5'))('rpc');var config=require(_0xf1a7('0x6'));var jayson=require(_0xf1a7('0x7'));var client=jayson['client'][_0xf1a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44a238,_0x4b2867,_0x2910e4){return new BPromise(function(_0x3ce10a,_0x2fb837){return client[_0xf1a7('0x9')](_0x44a238,_0x2910e4)[_0xf1a7('0xa')](function(_0x595e96){logger[_0xf1a7('0xb')](_0xf1a7('0xc'),_0x4b2867,'request\x20sent');logger[_0xf1a7('0xd')](_0xf1a7('0xe'),_0x4b2867,_0xf1a7('0xf'),JSON[_0xf1a7('0x10')](_0x595e96));if(_0x595e96[_0xf1a7('0x11')]){if(_0x595e96[_0xf1a7('0x11')]['code']===0x1f4){logger['error'](_0xf1a7('0xc'),_0x4b2867,_0x595e96[_0xf1a7('0x11')]['message']);return _0x2fb837(_0x595e96[_0xf1a7('0x11')]['message']);}logger[_0xf1a7('0x11')](_0xf1a7('0xc'),_0x4b2867,_0x595e96[_0xf1a7('0x11')]['message']);return _0x3ce10a(_0x595e96[_0xf1a7('0x11')]['message']);}else{logger[_0xf1a7('0xb')](_0xf1a7('0xc'),_0x4b2867,'request\x20sent');_0x3ce10a(_0x595e96[_0xf1a7('0x12')][_0xf1a7('0x13')]);}})[_0xf1a7('0x14')](function(_0x4ac35a){logger[_0xf1a7('0x11')](_0xf1a7('0xc'),_0x4b2867,_0x4ac35a);_0x2fb837(_0x4ac35a);});});}
\ No newline at end of file
+var _0xdb8f=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xdb8f,0x1b3));var _0xfdb8=function(_0x243d52,_0x2d5634){_0x243d52=_0x243d52-0x0;var _0xbbf923=_0xdb8f[_0x243d52];return _0xbbf923;};'use strict';var _=require(_0xfdb8('0x0'));var util=require(_0xfdb8('0x1'));var moment=require(_0xfdb8('0x2'));var BPromise=require('bluebird');var rs=require(_0xfdb8('0x3'));var fs=require('fs');var Redis=require(_0xfdb8('0x4'));var db=require(_0xfdb8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfdb8('0x6'))(_0xfdb8('0x7'));var config=require(_0xfdb8('0x8'));var jayson=require(_0xfdb8('0x9'));var client=jayson['client'][_0xfdb8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34dc69,_0x4ebaef,_0x4aaa53){return new BPromise(function(_0x497403,_0x3d4898){return client[_0xfdb8('0xb')](_0x34dc69,_0x4aaa53)[_0xfdb8('0xc')](function(_0x3a2f83){logger[_0xfdb8('0xd')](_0xfdb8('0xe'),_0x4ebaef,_0xfdb8('0xf'));logger[_0xfdb8('0x10')](_0xfdb8('0x11'),_0x4ebaef,_0xfdb8('0xf'),JSON['stringify'](_0x3a2f83));if(_0x3a2f83[_0xfdb8('0x12')]){if(_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x13')]===0x1f4){logger[_0xfdb8('0x12')](_0xfdb8('0xe'),_0x4ebaef,_0x3a2f83['error'][_0xfdb8('0x14')]);return _0x3d4898(_0x3a2f83['error'][_0xfdb8('0x14')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4ebaef,_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x14')]);return _0x497403(_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x14')]);}else{logger[_0xfdb8('0xd')](_0xfdb8('0xe'),_0x4ebaef,_0xfdb8('0xf'));_0x497403(_0x3a2f83[_0xfdb8('0x15')][_0xfdb8('0x14')]);}})[_0xfdb8('0x16')](function(_0x2c9614){logger[_0xfdb8('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ebaef,_0x2c9614);_0x3d4898(_0x2c9614);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index a20f527..29ba26c 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(_0x596f79,_0x515167){var _0x46bccc=function(_0x393c75){while(--_0x393c75){_0x596f79['push'](_0x596f79['shift']());}};_0x46bccc(++_0x515167);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x4512c2,_0x4aed17){var _0x22b433=function(_0x5c3099){while(--_0x5c3099){_0x4512c2['push'](_0x4512c2['shift']());}};_0x22b433(++_0x4aed17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 99387e7..82e7409 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 _0xe3db=['sequelize','exports','name','STRING','TEXT'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe3db,0xc8));var _0xbe3d=function(_0x30f289,_0x351110){_0x30f289=_0x30f289-0x0;var _0x319435=_0xe3db[_0x30f289];return _0x319435;};'use strict';var Sequelize=require(_0xbe3d('0x0'));module[_0xbe3d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbe3d('0x2')},'table':{'type':Sequelize[_0xbe3d('0x3')]},'metric':{'type':Sequelize[_0xbe3d('0x4')]},'description':{'type':Sequelize[_0xbe3d('0x3')]}};
\ No newline at end of file
+var _0x195e=['TEXT','sequelize','exports','STRING','name'];(function(_0x44085a,_0x4381c5){var _0xec581a=function(_0x33120b){while(--_0x33120b){_0x44085a['push'](_0x44085a['shift']());}};_0xec581a(++_0x4381c5);}(_0x195e,0xfb));var _0xe195=function(_0x5a77eb,_0x1ed02d){_0x5a77eb=_0x5a77eb-0x0;var _0x1b3299=_0x195e[_0x5a77eb];return _0x1b3299;};'use strict';var Sequelize=require(_0xe195('0x0'));module[_0xe195('0x1')]={'name':{'type':Sequelize[_0xe195('0x2')],'allowNull':![],'unique':_0xe195('0x3')},'table':{'type':Sequelize[_0xe195('0x2')]},'metric':{'type':Sequelize[_0xe195('0x4')]},'description':{'type':Sequelize[_0xe195('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 3ece0c5..b88d09c 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x5d1aea,_0x2a2fb8){var _0x1a91b6=function(_0x5609ec){while(--_0x5609ec){_0x5d1aea['push'](_0x5d1aea['shift']());}};_0x1a91b6(++_0x2a2fb8);}(_0x6aa7,0x178));var _0x76aa=function(_0x1b5ce2,_0x167e9d){_0x1b5ce2=_0x1b5ce2-0x0;var _0x2d08a3=_0x6aa7[_0x1b5ce2];return _0x2d08a3;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));};
\ No newline at end of file
+var _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x291f89,_0x337249){var _0x6a2fb9=function(_0x59234e){while(--_0x59234e){_0x291f89['push'](_0x291f89['shift']());}};_0x6a2fb9(++_0x337249);}(_0x5fc3,0xa8));var _0x35fc=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5fc3[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 0a20f2d..8fedbf0 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 _0x36bb=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xc8a62b,_0x4e1b0b){var _0x454c14=function(_0x790b69){while(--_0x790b69){_0xc8a62b['push'](_0xc8a62b['shift']());}};_0x454c14(++_0x4e1b0b);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var logger=require(_0xb36b('0x2'))('api');var moment=require(_0xb36b('0x3'));var BPromise=require(_0xb36b('0x4'));var rp=require(_0xb36b('0x5'));var fs=require('fs');var path=require(_0xb36b('0x6'));var rimraf=require(_0xb36b('0x7'));var config=require(_0xb36b('0x8'));var attributes=require(_0xb36b('0x9'));module[_0xb36b('0xa')]=function(_0x439ccc,_0x418837){return _0x439ccc[_0xb36b('0xb')](_0xb36b('0xc'),attributes,{'tableName':_0xb36b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8af=['analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric'];(function(_0x25a048,_0x17f8cc){var _0x5b6d18=function(_0x5c4d6e){while(--_0x5c4d6e){_0x25a048['push'](_0x25a048['shift']());}};_0x5b6d18(++_0x17f8cc);}(_0xd8af,0x18d));var _0xfd8a=function(_0x5a2ad2,_0x5b44ab){_0x5a2ad2=_0x5a2ad2-0x0;var _0x4c0f1a=_0xd8af[_0x5a2ad2];return _0x4c0f1a;};'use strict';var _=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var logger=require(_0xfd8a('0x2'))(_0xfd8a('0x3'));var moment=require(_0xfd8a('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd8a('0x6'));var config=require(_0xfd8a('0x7'));var attributes=require(_0xfd8a('0x8'));module['exports']=function(_0x44c7ed,_0x4c7603){return _0x44c7ed[_0xfd8a('0x9')](_0xfd8a('0xa'),attributes,{'tableName':_0xfd8a('0xb'),'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 5aaec96..9e4dab1 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 _0x8b7e=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x8b7e,0xee));var _0xe8b7=function(_0x4e9b03,_0x523457){_0x4e9b03=_0x4e9b03-0x0;var _0x2ca16a=_0x8b7e[_0x4e9b03];return _0x2ca16a;};'use strict';var _=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var moment=require('moment');var BPromise=require(_0xe8b7('0x2'));var rs=require(_0xe8b7('0x3'));var fs=require('fs');var Redis=require(_0xe8b7('0x4'));var db=require(_0xe8b7('0x5'))['db'];var utils=require(_0xe8b7('0x6'));var logger=require('../../config/logger')(_0xe8b7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8b7('0x8'));var client=jayson['client'][_0xe8b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed1f35,_0x30fd0d,_0x3b2731){return new BPromise(function(_0x3e0817,_0x1cbf6f){return client[_0xe8b7('0xa')](_0xed1f35,_0x3b2731)[_0xe8b7('0xb')](function(_0x14ac61){logger[_0xe8b7('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x30fd0d,_0xe8b7('0xd'));logger[_0xe8b7('0xe')](_0xe8b7('0xf'),_0x30fd0d,_0xe8b7('0xd'),JSON[_0xe8b7('0x10')](_0x14ac61));if(_0x14ac61['error']){if(_0x14ac61['error'][_0xe8b7('0x11')]===0x1f4){logger[_0xe8b7('0x12')](_0xe8b7('0x13'),_0x30fd0d,_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);return _0x1cbf6f(_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);}logger[_0xe8b7('0x12')](_0xe8b7('0x13'),_0x30fd0d,_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);return _0x3e0817(_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);}else{logger['info'](_0xe8b7('0x13'),_0x30fd0d,'request\x20sent');_0x3e0817(_0x14ac61[_0xe8b7('0x15')]['message']);}})[_0xe8b7('0x16')](function(_0x50748c){logger['error'](_0xe8b7('0x13'),_0x30fd0d,_0x50748c);_0x1cbf6f(_0x50748c);});});}
\ No newline at end of file
+var _0x411b=['../../config/logger','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x142e13,_0x211cde){var _0x51f6e1=function(_0xc4925c){while(--_0xc4925c){_0x142e13['push'](_0x142e13['shift']());}};_0x51f6e1(++_0x211cde);}(_0x411b,0x19d));var _0xb411=function(_0x296796,_0x52dcb8){_0x296796=_0x296796-0x0;var _0x4bf398=_0x411b[_0x296796];return _0x4bf398;};'use strict';var _=require(_0xb411('0x0'));var util=require(_0xb411('0x1'));var moment=require(_0xb411('0x2'));var BPromise=require('bluebird');var rs=require(_0xb411('0x3'));var fs=require('fs');var Redis=require(_0xb411('0x4'));var db=require(_0xb411('0x5'))['db'];var utils=require(_0xb411('0x6'));var logger=require(_0xb411('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb411('0x8'));var client=jayson[_0xb411('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bd33d,_0x20062e,_0x4790f2){return new BPromise(function(_0x55c435,_0x3f0614){return client[_0xb411('0xa')](_0x4bd33d,_0x4790f2)[_0xb411('0xb')](function(_0x4edd54){logger[_0xb411('0xc')](_0xb411('0xd'),_0x20062e,_0xb411('0xe'));logger['debug'](_0xb411('0xf'),_0x20062e,_0xb411('0xe'),JSON['stringify'](_0x4edd54));if(_0x4edd54[_0xb411('0x10')]){if(_0x4edd54[_0xb411('0x10')][_0xb411('0x11')]===0x1f4){logger[_0xb411('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x20062e,_0x4edd54[_0xb411('0x10')][_0xb411('0x12')]);return _0x3f0614(_0x4edd54['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x20062e,_0x4edd54[_0xb411('0x10')][_0xb411('0x12')]);return _0x55c435(_0x4edd54['error'][_0xb411('0x12')]);}else{logger['info'](_0xb411('0xd'),_0x20062e,_0xb411('0xe'));_0x55c435(_0x4edd54[_0xb411('0x13')]['message']);}})['catch'](function(_0x361283){logger['error'](_0xb411('0xd'),_0x20062e,_0x361283);_0x3f0614(_0x361283);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 9ffadf9..1c3579c 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 _0x8085=['create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8085,0x71));var _0x5808=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x8085[_0x58547b];return _0x1d3fd2;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var fs_extra=require(_0x5808('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5808('0x5'));var controller=require(_0x5808('0x6'));router['get']('/',auth[_0x5808('0x7')](),controller[_0x5808('0x8')]);router[_0x5808('0x9')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xb')]);router[_0x5808('0xc')]('/',auth[_0x5808('0x7')](),controller[_0x5808('0xd')]);router[_0x5808('0xe')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xf')]);router[_0x5808('0x10')](_0x5808('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5808('0x11')]=router;
\ No newline at end of file
+var _0x94ba=['isAuthenticated','index','get','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x463dbe,_0x34e39f){var _0x1795d2=function(_0xa46cb5){while(--_0xa46cb5){_0x463dbe['push'](_0x463dbe['shift']());}};_0x1795d2(++_0x34e39f);}(_0x94ba,0xbe));var _0xa94b=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x94ba[_0x47b15f];return _0x55bf25;};'use strict';var multer=require(_0xa94b('0x0'));var util=require(_0xa94b('0x1'));var path=require(_0xa94b('0x2'));var timeout=require(_0xa94b('0x3'));var express=require(_0xa94b('0x4'));var router=express['Router']();var fs_extra=require(_0xa94b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa94b('0x6'));var config=require(_0xa94b('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xa94b('0x8')](),controller[_0xa94b('0x9')]);router[_0xa94b('0xa')](_0xa94b('0xb'),auth['isAuthenticated'](),controller[_0xa94b('0xc')]);router[_0xa94b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa94b('0xe')](_0xa94b('0xb'),auth[_0xa94b('0x8')](),controller['update']);router[_0xa94b('0xf')](_0xa94b('0xb'),auth[_0xa94b('0x8')](),controller[_0xa94b('0x10')]);module[_0xa94b('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 1744142..ecbc61f 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 _0x0d60=['exports'];(function(_0x38159c,_0x13039f){var _0x1577fe=function(_0x1dffb2){while(--_0x1dffb2){_0x38159c['push'](_0x38159c['shift']());}};_0x1577fe(++_0x13039f);}(_0x0d60,0x1f0));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x00d6('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x6ff6=['exports','sequelize'];(function(_0x55abba,_0x33640d){var _0x18ffc0=function(_0x1640d0){while(--_0x1640d0){_0x55abba['push'](_0x55abba['shift']());}};_0x18ffc0(++_0x33640d);}(_0x6ff6,0x115));var _0x66ff=function(_0x595c57,_0x415b75){_0x595c57=_0x595c57-0x0;var _0x227198=_0x6ff6[_0x595c57];return _0x227198;};'use strict';var Sequelize=require(_0x66ff('0x0'));module[_0x66ff('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 ea6af8d..e8697d1 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 _0x3ad4=['where','pick','filters','filter','merge','VIRTUAL','AnalyticTreeReport','includeAll','include','rows','show','params','keys','rawAttributes','length','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','status','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x2c6df1,_0x5bc0b0){var _0x37daba=function(_0x311f77){while(--_0x311f77){_0x2c6df1['push'](_0x2c6df1['shift']());}};_0x37daba(++_0x5bc0b0);}(_0x3ad4,0x10a));var _0x43ad=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x3ad4[_0x47e7dd];return _0x38501f;};'use strict';var emlformat=require(_0x43ad('0x0'));var rimraf=require(_0x43ad('0x1'));var zipdir=require(_0x43ad('0x2'));var jsonpatch=require(_0x43ad('0x3'));var rp=require(_0x43ad('0x4'));var moment=require(_0x43ad('0x5'));var BPromise=require(_0x43ad('0x6'));var Mustache=require(_0x43ad('0x7'));var util=require(_0x43ad('0x8'));var path=require(_0x43ad('0x9'));var sox=require(_0x43ad('0xa'));var csv=require('to-csv');var ejs=require(_0x43ad('0xb'));var fs=require('fs');var fs_extra=require(_0x43ad('0xc'));var _=require('lodash');var squel=require(_0x43ad('0xd'));var crypto=require('crypto');var jsforce=require(_0x43ad('0xe'));var deskjs=require(_0x43ad('0xf'));var toCsv=require(_0x43ad('0x10'));var querystring=require(_0x43ad('0x11'));var Papa=require(_0x43ad('0x12'));var Redis=require(_0x43ad('0x13'));var authService=require(_0x43ad('0x14'));var qs=require(_0x43ad('0x15'));var as=require(_0x43ad('0x16'));var hardwareService=require(_0x43ad('0x17'));var logger=require(_0x43ad('0x18'))(_0x43ad('0x19'));var utils=require(_0x43ad('0x1a'));var config=require(_0x43ad('0x1b'));var licenseUtil=require(_0x43ad('0x1c'));var db=require(_0x43ad('0x1d'))['db'];function respondWithStatusCode(_0x5a2170,_0x5dc983){_0x5dc983=_0x5dc983||0xcc;return function(_0x570105){if(_0x570105){return _0x5a2170[_0x43ad('0x1e')](_0x5dc983);}return _0x5a2170['status'](_0x5dc983)[_0x43ad('0x1f')]();};}function respondWithResult(_0x2313d0,_0xbfb7dd){_0xbfb7dd=_0xbfb7dd||0xc8;return function(_0x38ac5a){if(_0x38ac5a){return _0x2313d0['status'](_0xbfb7dd)[_0x43ad('0x20')](_0x38ac5a);}};}function respondWithFilteredResult(_0x30f8f6,_0xd60ff3){return function(_0x272dec){if(_0x272dec){var _0x3a84f0=typeof _0xd60ff3[_0x43ad('0x21')]===_0x43ad('0x22')&&typeof _0xd60ff3['limit']===_0x43ad('0x22');var _0x378110=_0x272dec[_0x43ad('0x23')];var _0x29248d=_0x3a84f0?0x0:_0xd60ff3['offset'];var _0x314a85=_0x3a84f0?_0x272dec[_0x43ad('0x23')]:_0xd60ff3[_0x43ad('0x21')]+_0xd60ff3[_0x43ad('0x24')];var _0x5cc0c4;if(_0x314a85>=_0x378110){_0x314a85=_0x378110;_0x5cc0c4=0xc8;}else{_0x5cc0c4=0xce;}_0x30f8f6['status'](_0x5cc0c4);return _0x30f8f6['set'](_0x43ad('0x25'),_0x29248d+'-'+_0x314a85+'/'+_0x378110)[_0x43ad('0x20')](_0x272dec);}return null;};}function patchUpdates(_0x23dd4a){return function(_0x2cc0ed){try{jsonpatch[_0x43ad('0x26')](_0x2cc0ed,_0x23dd4a,!![]);}catch(_0x135862){return BPromise[_0x43ad('0x27')](_0x135862);}return _0x2cc0ed[_0x43ad('0x28')]();};}function saveUpdates(_0x4f0277,_0x428429){return function(_0x28ba97){if(_0x28ba97){return _0x28ba97[_0x43ad('0x29')](_0x4f0277)[_0x43ad('0x2a')](function(_0x230de3){return _0x230de3;});}return null;};}function removeEntity(_0x2746fa,_0x1f1878){return function(_0x3b4f8f){if(_0x3b4f8f){return _0x3b4f8f['destroy']()[_0x43ad('0x2a')](function(){_0x2746fa['status'](0xcc)[_0x43ad('0x1f')]();});}};}function handleEntityNotFound(_0x5ac5dc,_0x389d66){return function(_0x4f8362){if(!_0x4f8362){_0x5ac5dc[_0x43ad('0x1e')](0x194);}return _0x4f8362;};}function handleError(_0x5e5e4c,_0x4f4245){_0x4f4245=_0x4f4245||0x1f4;return function(_0x2c8098){logger[_0x43ad('0x2b')](_0x2c8098[_0x43ad('0x2c')]);if(_0x2c8098[_0x43ad('0x2d')]){delete _0x2c8098[_0x43ad('0x2d')];}_0x5e5e4c[_0x43ad('0x2e')](_0x4f4245)[_0x43ad('0x2f')](_0x2c8098);};}exports[_0x43ad('0x30')]=function(_0x209ed9,_0x211a75){var _0x4f006e={},_0x276d0d={},_0x4859d4={'count':0x0,'rows':[]};var _0x5e7490=_[_0x43ad('0x31')](db['AnalyticTreeReport']['rawAttributes'],function(_0x3a1843){return{'name':_0x3a1843[_0x43ad('0x32')],'type':_0x3a1843[_0x43ad('0x33')][_0x43ad('0x34')]};});_0x276d0d[_0x43ad('0x35')]=_[_0x43ad('0x31')](_0x5e7490,'name');_0x276d0d[_0x43ad('0x36')]=_['keys'](_0x209ed9[_0x43ad('0x36')]);_0x276d0d['filters']=_[_0x43ad('0x37')](_0x276d0d[_0x43ad('0x35')],_0x276d0d[_0x43ad('0x36')]);_0x4f006e[_0x43ad('0x38')]=_[_0x43ad('0x37')](_0x276d0d[_0x43ad('0x35')],qs[_0x43ad('0x39')](_0x209ed9[_0x43ad('0x36')][_0x43ad('0x39')]));_0x4f006e[_0x43ad('0x38')]=_0x4f006e[_0x43ad('0x38')]['length']?_0x4f006e[_0x43ad('0x38')]:_0x276d0d['model'];if(!_0x209ed9[_0x43ad('0x36')][_0x43ad('0x3a')](_0x43ad('0x3b'))){_0x4f006e['limit']=qs[_0x43ad('0x24')](_0x209ed9[_0x43ad('0x36')][_0x43ad('0x24')]);_0x4f006e['offset']=qs[_0x43ad('0x21')](_0x209ed9['query'][_0x43ad('0x21')]);}_0x4f006e[_0x43ad('0x3c')]=qs[_0x43ad('0x3d')](_0x209ed9[_0x43ad('0x36')]['sort']);_0x4f006e[_0x43ad('0x3e')]=qs['filters'](_[_0x43ad('0x3f')](_0x209ed9[_0x43ad('0x36')],_0x276d0d[_0x43ad('0x40')]),_0x5e7490);if(_0x209ed9['query'][_0x43ad('0x41')]){_0x4f006e[_0x43ad('0x3e')]=_[_0x43ad('0x42')](_0x4f006e[_0x43ad('0x3e')],{'$or':_[_0x43ad('0x31')](_0x5e7490,function(_0x42fc1e){if(_0x42fc1e[_0x43ad('0x33')]!==_0x43ad('0x43')){var _0x21b8ba={};_0x21b8ba[_0x42fc1e['name']]={'$like':'%'+_0x209ed9[_0x43ad('0x36')][_0x43ad('0x41')]+'%'};return _0x21b8ba;}})});}_0x4f006e=_[_0x43ad('0x42')]({},_0x4f006e,_0x209ed9['options']);var _0x21bfb2={'where':_0x4f006e[_0x43ad('0x3e')]};return db[_0x43ad('0x44')][_0x43ad('0x23')](_0x21bfb2)[_0x43ad('0x2a')](function(_0x111d31){_0x4859d4['count']=_0x111d31;if(_0x209ed9[_0x43ad('0x36')][_0x43ad('0x45')]){_0x4f006e[_0x43ad('0x46')]=[{'all':!![]}];}return db[_0x43ad('0x44')]['findAll'](_0x4f006e);})['then'](function(_0x4ad8d9){_0x4859d4[_0x43ad('0x47')]=_0x4ad8d9;return _0x4859d4;})['then'](respondWithFilteredResult(_0x211a75,_0x4f006e))['catch'](handleError(_0x211a75,null));};exports[_0x43ad('0x48')]=function(_0x21426d,_0x3b4b1f){var _0x2ebb5c={'raw':!![],'where':{'id':_0x21426d[_0x43ad('0x49')]['id']}},_0x3e8af3={};_0x3e8af3[_0x43ad('0x35')]=_[_0x43ad('0x4a')](db['AnalyticTreeReport'][_0x43ad('0x4b')]);_0x3e8af3['query']=_['keys'](_0x21426d['query']);_0x3e8af3['filters']=_[_0x43ad('0x37')](_0x3e8af3['model'],_0x3e8af3[_0x43ad('0x36')]);_0x2ebb5c[_0x43ad('0x38')]=_['intersection'](_0x3e8af3['model'],qs[_0x43ad('0x39')](_0x21426d['query'][_0x43ad('0x39')]));_0x2ebb5c[_0x43ad('0x38')]=_0x2ebb5c[_0x43ad('0x38')][_0x43ad('0x4c')]?_0x2ebb5c[_0x43ad('0x38')]:_0x3e8af3[_0x43ad('0x35')];if(_0x21426d[_0x43ad('0x36')]['includeAll']){_0x2ebb5c[_0x43ad('0x46')]=[{'all':!![]}];}_0x2ebb5c=_[_0x43ad('0x42')]({},_0x2ebb5c,_0x21426d[_0x43ad('0x4d')]);return db[_0x43ad('0x44')][_0x43ad('0x4e')](_0x2ebb5c)[_0x43ad('0x2a')](handleEntityNotFound(_0x3b4b1f,null))[_0x43ad('0x2a')](respondWithResult(_0x3b4b1f,null))['catch'](handleError(_0x3b4b1f,null));};exports[_0x43ad('0x4f')]=function(_0x1006eb,_0x5d678e){return db[_0x43ad('0x44')][_0x43ad('0x4f')](_0x1006eb[_0x43ad('0x50')],{})[_0x43ad('0x2a')](respondWithResult(_0x5d678e,0xc9))[_0x43ad('0x51')](handleError(_0x5d678e,null));};exports[_0x43ad('0x29')]=function(_0x3b76c7,_0x244fb0){if(_0x3b76c7[_0x43ad('0x50')]['id']){delete _0x3b76c7[_0x43ad('0x50')]['id'];}return db[_0x43ad('0x44')][_0x43ad('0x4e')]({'where':{'id':_0x3b76c7['params']['id']}})[_0x43ad('0x2a')](handleEntityNotFound(_0x244fb0,null))[_0x43ad('0x2a')](saveUpdates(_0x3b76c7[_0x43ad('0x50')],null))[_0x43ad('0x2a')](respondWithResult(_0x244fb0,null))[_0x43ad('0x51')](handleError(_0x244fb0,null));};exports['destroy']=function(_0x4ad27d,_0x3e8075){return db[_0x43ad('0x44')][_0x43ad('0x4e')]({'where':{'id':_0x4ad27d['params']['id']}})[_0x43ad('0x2a')](handleEntityNotFound(_0x3e8075,null))['then'](removeEntity(_0x3e8075,null))[_0x43ad('0x51')](handleError(_0x3e8075,null));};
\ No newline at end of file
+var _0xe38b=['destroy','end','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','update','then'];(function(_0x30b640,_0x368c12){var _0x67bdb9=function(_0x149d42){while(--_0x149d42){_0x30b640['push'](_0x30b640['shift']());}};_0x67bdb9(++_0x368c12);}(_0xe38b,0x1cb));var _0xbe38=function(_0x24da84,_0x3cdec2){_0x24da84=_0x24da84-0x0;var _0x339545=_0xe38b[_0x24da84];return _0x339545;};'use strict';var emlformat=require(_0xbe38('0x0'));var rimraf=require(_0xbe38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe38('0x2'));var BPromise=require(_0xbe38('0x3'));var Mustache=require(_0xbe38('0x4'));var util=require(_0xbe38('0x5'));var path=require(_0xbe38('0x6'));var sox=require('sox');var csv=require(_0xbe38('0x7'));var ejs=require(_0xbe38('0x8'));var fs=require('fs');var fs_extra=require(_0xbe38('0x9'));var _=require(_0xbe38('0xa'));var squel=require(_0xbe38('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbe38('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe38('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe38('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbe38('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe38('0x10'));var logger=require(_0xbe38('0x11'))(_0xbe38('0x12'));var utils=require('../../config/utils');var config=require(_0xbe38('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe38('0x14'))['db'];function respondWithStatusCode(_0x296b42,_0x446338){_0x446338=_0x446338||0xcc;return function(_0x1b8bf9){if(_0x1b8bf9){return _0x296b42['sendStatus'](_0x446338);}return _0x296b42[_0xbe38('0x15')](_0x446338)['end']();};}function respondWithResult(_0x431f6a,_0x5aad8f){_0x5aad8f=_0x5aad8f||0xc8;return function(_0x2bcdc4){if(_0x2bcdc4){return _0x431f6a[_0xbe38('0x15')](_0x5aad8f)[_0xbe38('0x16')](_0x2bcdc4);}};}function respondWithFilteredResult(_0x2b9b27,_0x2338b5){return function(_0x51d5db){if(_0x51d5db){var _0x336d15=typeof _0x2338b5[_0xbe38('0x17')]===_0xbe38('0x18')&&typeof _0x2338b5['limit']===_0xbe38('0x18');var _0x3aa7ac=_0x51d5db[_0xbe38('0x19')];var _0x5a1b3f=_0x336d15?0x0:_0x2338b5[_0xbe38('0x17')];var _0x1e2eaf=_0x336d15?_0x51d5db[_0xbe38('0x19')]:_0x2338b5[_0xbe38('0x17')]+_0x2338b5['limit'];var _0x3157f0;if(_0x1e2eaf>=_0x3aa7ac){_0x1e2eaf=_0x3aa7ac;_0x3157f0=0xc8;}else{_0x3157f0=0xce;}_0x2b9b27['status'](_0x3157f0);return _0x2b9b27[_0xbe38('0x1a')](_0xbe38('0x1b'),_0x5a1b3f+'-'+_0x1e2eaf+'/'+_0x3aa7ac)[_0xbe38('0x16')](_0x51d5db);}return null;};}function patchUpdates(_0x1797a2){return function(_0x26e4f2){try{jsonpatch[_0xbe38('0x1c')](_0x26e4f2,_0x1797a2,!![]);}catch(_0x36c620){return BPromise['reject'](_0x36c620);}return _0x26e4f2['save']();};}function saveUpdates(_0x4096de,_0x14da9b){return function(_0x264d32){if(_0x264d32){return _0x264d32[_0xbe38('0x1d')](_0x4096de)[_0xbe38('0x1e')](function(_0xea9c0){return _0xea9c0;});}return null;};}function removeEntity(_0x95086c,_0x2cf35a){return function(_0x152cdb){if(_0x152cdb){return _0x152cdb[_0xbe38('0x1f')]()[_0xbe38('0x1e')](function(){_0x95086c[_0xbe38('0x15')](0xcc)[_0xbe38('0x20')]();});}};}function handleEntityNotFound(_0x4cf268,_0x412c34){return function(_0x18a943){if(!_0x18a943){_0x4cf268[_0xbe38('0x21')](0x194);}return _0x18a943;};}function handleError(_0x148d56,_0x4b7e3d){_0x4b7e3d=_0x4b7e3d||0x1f4;return function(_0x4a7a1d){logger['error'](_0x4a7a1d[_0xbe38('0x22')]);if(_0x4a7a1d[_0xbe38('0x23')]){delete _0x4a7a1d[_0xbe38('0x23')];}_0x148d56[_0xbe38('0x15')](_0x4b7e3d)[_0xbe38('0x24')](_0x4a7a1d);};}exports['index']=function(_0x2f4e82,_0x4bede8){var _0x327f4b={},_0x475f36={},_0x23f22e={'count':0x0,'rows':[]};var _0x3c6ee2=_[_0xbe38('0x25')](db[_0xbe38('0x26')][_0xbe38('0x27')],function(_0x48b0a8){return{'name':_0x48b0a8[_0xbe38('0x28')],'type':_0x48b0a8[_0xbe38('0x29')][_0xbe38('0x2a')]};});_0x475f36[_0xbe38('0x2b')]=_[_0xbe38('0x25')](_0x3c6ee2,_0xbe38('0x23'));_0x475f36[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x2f4e82[_0xbe38('0x2c')]);_0x475f36[_0xbe38('0x2e')]=_[_0xbe38('0x2f')](_0x475f36['model'],_0x475f36['query']);_0x327f4b['attributes']=_[_0xbe38('0x2f')](_0x475f36[_0xbe38('0x2b')],qs['fields'](_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x30')]));_0x327f4b[_0xbe38('0x31')]=_0x327f4b[_0xbe38('0x31')][_0xbe38('0x32')]?_0x327f4b['attributes']:_0x475f36[_0xbe38('0x2b')];if(!_0x2f4e82['query'][_0xbe38('0x33')]('nolimit')){_0x327f4b['limit']=qs[_0xbe38('0x34')](_0x2f4e82[_0xbe38('0x2c')]['limit']);_0x327f4b[_0xbe38('0x17')]=qs[_0xbe38('0x17')](_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x17')]);}_0x327f4b[_0xbe38('0x35')]=qs['sort'](_0x2f4e82['query'][_0xbe38('0x36')]);_0x327f4b[_0xbe38('0x37')]=qs['filters'](_[_0xbe38('0x38')](_0x2f4e82[_0xbe38('0x2c')],_0x475f36['filters']),_0x3c6ee2);if(_0x2f4e82['query'][_0xbe38('0x39')]){_0x327f4b[_0xbe38('0x37')]=_[_0xbe38('0x3a')](_0x327f4b[_0xbe38('0x37')],{'$or':_[_0xbe38('0x25')](_0x3c6ee2,function(_0x503264){if(_0x503264[_0xbe38('0x29')]!==_0xbe38('0x3b')){var _0x1c6b22={};_0x1c6b22[_0x503264[_0xbe38('0x23')]]={'$like':'%'+_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x39')]+'%'};return _0x1c6b22;}})});}_0x327f4b=_[_0xbe38('0x3a')]({},_0x327f4b,_0x2f4e82[_0xbe38('0x3c')]);var _0x119e82={'where':_0x327f4b['where']};return db[_0xbe38('0x26')][_0xbe38('0x19')](_0x119e82)['then'](function(_0x1b535c){_0x23f22e[_0xbe38('0x19')]=_0x1b535c;if(_0x2f4e82['query'][_0xbe38('0x3d')]){_0x327f4b[_0xbe38('0x3e')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x327f4b);})[_0xbe38('0x1e')](function(_0x500609){_0x23f22e[_0xbe38('0x3f')]=_0x500609;return _0x23f22e;})[_0xbe38('0x1e')](respondWithFilteredResult(_0x4bede8,_0x327f4b))[_0xbe38('0x40')](handleError(_0x4bede8,null));};exports[_0xbe38('0x41')]=function(_0x22a53c,_0xa7a7f1){var _0x136b6b={'raw':!![],'where':{'id':_0x22a53c[_0xbe38('0x42')]['id']}},_0x556843={};_0x556843['model']=_[_0xbe38('0x2d')](db[_0xbe38('0x26')]['rawAttributes']);_0x556843[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x22a53c['query']);_0x556843['filters']=_[_0xbe38('0x2f')](_0x556843[_0xbe38('0x2b')],_0x556843[_0xbe38('0x2c')]);_0x136b6b['attributes']=_[_0xbe38('0x2f')](_0x556843[_0xbe38('0x2b')],qs[_0xbe38('0x30')](_0x22a53c[_0xbe38('0x2c')][_0xbe38('0x30')]));_0x136b6b[_0xbe38('0x31')]=_0x136b6b['attributes'][_0xbe38('0x32')]?_0x136b6b['attributes']:_0x556843['model'];if(_0x22a53c[_0xbe38('0x2c')][_0xbe38('0x3d')]){_0x136b6b[_0xbe38('0x3e')]=[{'all':!![]}];}_0x136b6b=_[_0xbe38('0x3a')]({},_0x136b6b,_0x22a53c['options']);return db[_0xbe38('0x26')][_0xbe38('0x43')](_0x136b6b)[_0xbe38('0x1e')](handleEntityNotFound(_0xa7a7f1,null))[_0xbe38('0x1e')](respondWithResult(_0xa7a7f1,null))[_0xbe38('0x40')](handleError(_0xa7a7f1,null));};exports[_0xbe38('0x44')]=function(_0x45701a,_0x3b24c4){return db[_0xbe38('0x26')]['create'](_0x45701a[_0xbe38('0x45')],{})[_0xbe38('0x1e')](respondWithResult(_0x3b24c4,0xc9))['catch'](handleError(_0x3b24c4,null));};exports[_0xbe38('0x1d')]=function(_0x2551d8,_0x3b6428){if(_0x2551d8[_0xbe38('0x45')]['id']){delete _0x2551d8[_0xbe38('0x45')]['id'];}return db[_0xbe38('0x26')][_0xbe38('0x43')]({'where':{'id':_0x2551d8[_0xbe38('0x42')]['id']}})[_0xbe38('0x1e')](handleEntityNotFound(_0x3b6428,null))[_0xbe38('0x1e')](saveUpdates(_0x2551d8[_0xbe38('0x45')],null))[_0xbe38('0x1e')](respondWithResult(_0x3b6428,null))[_0xbe38('0x40')](handleError(_0x3b6428,null));};exports['destroy']=function(_0x2240fc,_0x480eff){return db[_0xbe38('0x26')][_0xbe38('0x43')]({'where':{'id':_0x2240fc['params']['id']}})[_0xbe38('0x1e')](handleEntityNotFound(_0x480eff,null))[_0xbe38('0x1e')](removeEntity(_0x480eff,null))['catch'](handleError(_0x480eff,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5faecf0..b3f8fa1 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 _0x4644=['../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x466c87,_0x3f2a31){var _0x391415=function(_0x1d0f66){while(--_0x1d0f66){_0x466c87['push'](_0x466c87['shift']());}};_0x391415(++_0x3f2a31);}(_0x4644,0x180));var _0x4464=function(_0x466cc8,_0x203996){_0x466cc8=_0x466cc8-0x0;var _0x3edc41=_0x4644[_0x466cc8];return _0x3edc41;};'use strict';var _=require(_0x4464('0x0'));var util=require(_0x4464('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4464('0x2'));var rp=require(_0x4464('0x3'));var fs=require('fs');var path=require(_0x4464('0x4'));var rimraf=require(_0x4464('0x5'));var config=require(_0x4464('0x6'));var attributes=require(_0x4464('0x7'));module[_0x4464('0x8')]=function(_0x478c91,_0x8cc86){return _0x478c91[_0x4464('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1dbe=['request-promise','rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x23a33f,_0x413c03){var _0x56e720=function(_0x21a646){while(--_0x21a646){_0x23a33f['push'](_0x23a33f['shift']());}};_0x56e720(++_0x413c03);}(_0x1dbe,0x102));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1db('0x0'));var util=require(_0xe1db('0x1'));var logger=require(_0xe1db('0x2'))(_0xe1db('0x3'));var moment=require(_0xe1db('0x4'));var BPromise=require(_0xe1db('0x5'));var rp=require(_0xe1db('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1db('0x7'));var config=require(_0xe1db('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x1efcc5,_0x321135){return _0x1efcc5[_0xe1db('0x9')](_0xe1db('0xa'),attributes,{'tableName':_0xe1db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 8121871..3b05a4f 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 _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(_0x79c52f,_0x5bd9d3){var _0x37f2a8=function(_0x53d6f2){while(--_0x53d6f2){_0x79c52f['push'](_0x79c52f['shift']());}};_0x37f2a8(++_0x5bd9d3);}(_0x2ef3,0xba));var _0x32ef=function(_0x136e19,_0x3b2f5f){_0x136e19=_0x136e19-0x0;var _0x114dcf=_0x2ef3[_0x136e19];return _0x114dcf;};'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
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5958bf,_0x4bd0ce){var _0x15c777=function(_0x2a3aa7){while(--_0x2a3aa7){_0x5958bf['push'](_0x5958bf['shift']());}};_0x15c777(++_0x4bd0ce);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index b374400..47c7b78 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 _0x11bb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x3ccb93,_0x4adbbf){var _0x5f3149=function(_0x1786e3){while(--_0x1786e3){_0x3ccb93['push'](_0x3ccb93['shift']());}};_0x5f3149(++_0x4adbbf);}(_0x11bb,0x93));var _0xb11b=function(_0x4b249a,_0x35bcc6){_0x4b249a=_0x4b249a-0x0;var _0x283084=_0x11bb[_0x4b249a];return _0x283084;};'use strict';var multer=require(_0xb11b('0x0'));var util=require('util');var path=require(_0xb11b('0x1'));var timeout=require(_0xb11b('0x2'));var express=require('express');var router=express[_0xb11b('0x3')]();var fs_extra=require(_0xb11b('0x4'));var auth=require(_0xb11b('0x5'));var interaction=require(_0xb11b('0x6'));var config=require(_0xb11b('0x7'));var controller=require(_0xb11b('0x8'));router[_0xb11b('0x9')]('/',auth[_0xb11b('0xa')](),controller[_0xb11b('0xb')]);router[_0xb11b('0x9')](_0xb11b('0xc'),auth[_0xb11b('0xa')](),controller[_0xb11b('0xd')]);router[_0xb11b('0xe')]('/',auth[_0xb11b('0xa')](),controller[_0xb11b('0xf')]);router['put'](_0xb11b('0xc'),auth['isAuthenticated'](),controller[_0xb11b('0x10')]);router[_0xb11b('0x11')](_0xb11b('0xc'),auth[_0xb11b('0xa')](),controller[_0xb11b('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xd251=['/:id','show','post','create','put','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index'];(function(_0x115a8b,_0x58d048){var _0x193669=function(_0x50a5b4){while(--_0x50a5b4){_0x115a8b['push'](_0x115a8b['shift']());}};_0x193669(++_0x58d048);}(_0xd251,0xca));var _0x1d25=function(_0x5c7a9d,_0x1ec964){_0x5c7a9d=_0x5c7a9d-0x0;var _0x3819a9=_0xd251[_0x5c7a9d];return _0x3819a9;};'use strict';var multer=require('multer');var util=require(_0x1d25('0x0'));var path=require(_0x1d25('0x1'));var timeout=require('connect-timeout');var express=require(_0x1d25('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1d25('0x3'));var interaction=require(_0x1d25('0x4'));var config=require('../../config/environment');var controller=require(_0x1d25('0x5'));router['get']('/',auth[_0x1d25('0x6')](),controller[_0x1d25('0x7')]);router['get'](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller[_0x1d25('0x9')]);router[_0x1d25('0xa')]('/',auth['isAuthenticated'](),controller[_0x1d25('0xb')]);router[_0x1d25('0xc')](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller['update']);router['delete'](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller['destroy']);module[_0x1d25('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 5649ae8..438658e 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 _0xb377=['sequelize','exports','STRING'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0xb377,0x1b6));var _0x7b37=function(_0x165a10,_0x362dd5){_0x165a10=_0x165a10-0x0;var _0x1316b3=_0xb377[_0x165a10];return _0x1316b3;};'use strict';var Sequelize=require(_0x7b37('0x0'));module[_0x7b37('0x1')]={'name':{'type':Sequelize[_0x7b37('0x2')]},'basename':{'type':Sequelize[_0x7b37('0x2')]},'type':{'type':Sequelize[_0x7b37('0x2')]}};
\ No newline at end of file
+var _0xe4b8=['exports','STRING','sequelize'];(function(_0x12dc7b,_0x49d6d1){var _0x1f37ce=function(_0x43c824){while(--_0x43c824){_0x12dc7b['push'](_0x12dc7b['shift']());}};_0x1f37ce(++_0x49d6d1);}(_0xe4b8,0x179));var _0x8e4b=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xe4b8[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x8e4b('0x0'));module[_0x8e4b('0x1')]={'name':{'type':Sequelize[_0x8e4b('0x2')]},'basename':{'type':Sequelize[_0x8e4b('0x2')]},'type':{'type':Sequelize[_0x8e4b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b094270..264a8ac 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 _0x1ec0=['clone','include','get','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','join','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','Attachment','rawAttributes','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','keys','find'];(function(_0xf7f177,_0x2b11e5){var _0x1811e7=function(_0x40792a){while(--_0x40792a){_0xf7f177['push'](_0xf7f177['shift']());}};_0x1811e7(++_0x2b11e5);}(_0x1ec0,0x15f));var _0x01ec=function(_0x38dcff,_0x129a00){_0x38dcff=_0x38dcff-0x0;var _0x17c442=_0x1ec0[_0x38dcff];return _0x17c442;};'use strict';var emlformat=require(_0x01ec('0x0'));var rimraf=require(_0x01ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01ec('0x2'));var rp=require(_0x01ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x01ec('0x4'));var util=require(_0x01ec('0x5'));var path=require(_0x01ec('0x6'));var sox=require('sox');var csv=require(_0x01ec('0x7'));var ejs=require(_0x01ec('0x8'));var fs=require('fs');var fs_extra=require(_0x01ec('0x9'));var _=require(_0x01ec('0xa'));var squel=require('squel');var crypto=require(_0x01ec('0xb'));var jsforce=require(_0x01ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x01ec('0x7'));var querystring=require(_0x01ec('0xd'));var Papa=require(_0x01ec('0xe'));var Redis=require(_0x01ec('0xf'));var authService=require(_0x01ec('0x10'));var qs=require(_0x01ec('0x11'));var as=require(_0x01ec('0x12'));var hardwareService=require(_0x01ec('0x13'));var logger=require(_0x01ec('0x14'))(_0x01ec('0x15'));var utils=require(_0x01ec('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x01ec('0x17'));var db=require(_0x01ec('0x18'))['db'];function respondWithStatusCode(_0x45cea3,_0x475d00){_0x475d00=_0x475d00||0xcc;return function(_0xbe2a59){if(_0xbe2a59){return _0x45cea3[_0x01ec('0x19')](_0x475d00);}return _0x45cea3[_0x01ec('0x1a')](_0x475d00)[_0x01ec('0x1b')]();};}function respondWithResult(_0x1ef04b,_0xfd3ffc){_0xfd3ffc=_0xfd3ffc||0xc8;return function(_0x19efb0){if(_0x19efb0){return _0x1ef04b[_0x01ec('0x1a')](_0xfd3ffc)['json'](_0x19efb0);}};}function respondWithFilteredResult(_0x4c03a6,_0x344206){return function(_0x59ca14){if(_0x59ca14){var _0x3c8300=typeof _0x344206[_0x01ec('0x1c')]===_0x01ec('0x1d')&&typeof _0x344206[_0x01ec('0x1e')]===_0x01ec('0x1d');var _0x2bdc4f=_0x59ca14[_0x01ec('0x1f')];var _0x338c2e=_0x3c8300?0x0:_0x344206['offset'];var _0x4ee0f2=_0x3c8300?_0x59ca14[_0x01ec('0x1f')]:_0x344206[_0x01ec('0x1c')]+_0x344206[_0x01ec('0x1e')];var _0x2e1325;if(_0x4ee0f2>=_0x2bdc4f){_0x4ee0f2=_0x2bdc4f;_0x2e1325=0xc8;}else{_0x2e1325=0xce;}_0x4c03a6[_0x01ec('0x1a')](_0x2e1325);return _0x4c03a6[_0x01ec('0x20')](_0x01ec('0x21'),_0x338c2e+'-'+_0x4ee0f2+'/'+_0x2bdc4f)[_0x01ec('0x22')](_0x59ca14);}return null;};}function patchUpdates(_0x1e6224){return function(_0x484c8f){try{jsonpatch[_0x01ec('0x23')](_0x484c8f,_0x1e6224,!![]);}catch(_0x12dbda){return BPromise['reject'](_0x12dbda);}return _0x484c8f[_0x01ec('0x24')]();};}function saveUpdates(_0x2a19b9,_0x331062){return function(_0x37a40f){if(_0x37a40f){return _0x37a40f[_0x01ec('0x25')](_0x2a19b9)[_0x01ec('0x26')](function(_0x16dca7){return _0x16dca7;});}return null;};}function removeEntity(_0x2f09d7,_0x4f4ed8){return function(_0x158547){if(_0x158547){return _0x158547[_0x01ec('0x27')]()[_0x01ec('0x26')](function(){_0x2f09d7[_0x01ec('0x1a')](0xcc)[_0x01ec('0x1b')]();});}};}function handleEntityNotFound(_0x426349,_0x1963f4){return function(_0x2666e2){if(!_0x2666e2){_0x426349[_0x01ec('0x19')](0x194);}return _0x2666e2;};}function handleError(_0x488224,_0x2d4903){_0x2d4903=_0x2d4903||0x1f4;return function(_0x50532f){logger[_0x01ec('0x28')](_0x50532f['stack']);if(_0x50532f[_0x01ec('0x29')]){delete _0x50532f[_0x01ec('0x29')];}_0x488224[_0x01ec('0x1a')](_0x2d4903)[_0x01ec('0x2a')](_0x50532f);};}exports[_0x01ec('0x2b')]=function(_0x3db707,_0x52db17){var _0x441a23={},_0x315b25={},_0x392c9b={'count':0x0,'rows':[]};var _0xec28=_['map'](db[_0x01ec('0x2c')][_0x01ec('0x2d')],function(_0x195d20){return{'name':_0x195d20['fieldName'],'type':_0x195d20[_0x01ec('0x2e')]['key']};});_0x315b25[_0x01ec('0x2f')]=_[_0x01ec('0x30')](_0xec28,_0x01ec('0x29'));_0x315b25[_0x01ec('0x31')]=_['keys'](_0x3db707[_0x01ec('0x31')]);_0x315b25[_0x01ec('0x32')]=_[_0x01ec('0x33')](_0x315b25[_0x01ec('0x2f')],_0x315b25['query']);_0x441a23['attributes']=_[_0x01ec('0x33')](_0x315b25['model'],qs[_0x01ec('0x34')](_0x3db707['query']['fields']));_0x441a23[_0x01ec('0x35')]=_0x441a23[_0x01ec('0x35')][_0x01ec('0x36')]?_0x441a23[_0x01ec('0x35')]:_0x315b25['model'];if(!_0x3db707[_0x01ec('0x31')]['hasOwnProperty'](_0x01ec('0x37'))){_0x441a23[_0x01ec('0x1e')]=qs[_0x01ec('0x1e')](_0x3db707[_0x01ec('0x31')][_0x01ec('0x1e')]);_0x441a23[_0x01ec('0x1c')]=qs[_0x01ec('0x1c')](_0x3db707[_0x01ec('0x31')][_0x01ec('0x1c')]);}_0x441a23[_0x01ec('0x38')]=qs[_0x01ec('0x39')](_0x3db707[_0x01ec('0x31')]['sort']);_0x441a23[_0x01ec('0x3a')]=qs['filters'](_[_0x01ec('0x3b')](_0x3db707[_0x01ec('0x31')],_0x315b25[_0x01ec('0x32')]),_0xec28);if(_0x3db707[_0x01ec('0x31')][_0x01ec('0x3c')]){_0x441a23[_0x01ec('0x3a')]=_[_0x01ec('0x3d')](_0x441a23[_0x01ec('0x3a')],{'$or':_[_0x01ec('0x30')](_0xec28,function(_0x4d132d){if(_0x4d132d[_0x01ec('0x2e')]!==_0x01ec('0x3e')){var _0x3b7c42={};_0x3b7c42[_0x4d132d[_0x01ec('0x29')]]={'$like':'%'+_0x3db707[_0x01ec('0x31')][_0x01ec('0x3c')]+'%'};return _0x3b7c42;}})});}_0x441a23=_[_0x01ec('0x3d')]({},_0x441a23,_0x3db707[_0x01ec('0x3f')]);var _0x1676ec={'where':_0x441a23[_0x01ec('0x3a')]};return db[_0x01ec('0x2c')]['count'](_0x1676ec)[_0x01ec('0x26')](function(_0x2c35a2){_0x392c9b[_0x01ec('0x1f')]=_0x2c35a2;if(_0x3db707[_0x01ec('0x31')][_0x01ec('0x40')]){_0x441a23['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0x441a23);})[_0x01ec('0x26')](function(_0x57b79b){_0x392c9b['rows']=_0x57b79b;return _0x392c9b;})['then'](respondWithFilteredResult(_0x52db17,_0x441a23))[_0x01ec('0x41')](handleError(_0x52db17,null));};exports['show']=function(_0x3eec29,_0xf13e62){var _0x5958da={'raw':!![],'where':{'id':_0x3eec29[_0x01ec('0x42')]['id']}},_0x13ceaf={};_0x13ceaf[_0x01ec('0x2f')]=_[_0x01ec('0x43')](db[_0x01ec('0x2c')]['rawAttributes']);_0x13ceaf[_0x01ec('0x31')]=_['keys'](_0x3eec29[_0x01ec('0x31')]);_0x13ceaf['filters']=_[_0x01ec('0x33')](_0x13ceaf['model'],_0x13ceaf[_0x01ec('0x31')]);_0x5958da[_0x01ec('0x35')]=_[_0x01ec('0x33')](_0x13ceaf['model'],qs['fields'](_0x3eec29['query'][_0x01ec('0x34')]));_0x5958da[_0x01ec('0x35')]=_0x5958da[_0x01ec('0x35')][_0x01ec('0x36')]?_0x5958da[_0x01ec('0x35')]:_0x13ceaf[_0x01ec('0x2f')];if(_0x3eec29[_0x01ec('0x31')][_0x01ec('0x40')]){_0x5958da['include']=[{'all':!![]}];}_0x5958da=_[_0x01ec('0x3d')]({},_0x5958da,_0x3eec29[_0x01ec('0x3f')]);return db[_0x01ec('0x2c')][_0x01ec('0x44')](_0x5958da)[_0x01ec('0x26')](handleEntityNotFound(_0xf13e62,null))['then'](respondWithResult(_0xf13e62,null))['catch'](handleError(_0xf13e62,null));};exports[_0x01ec('0x45')]=function(_0xadb924,_0x467882){var _0xafc639={'where':{'id':_0xadb924[_0x01ec('0x42')]['id']}},_0x4ba35f={};_0x4ba35f[_0x01ec('0x2f')]=_[_0x01ec('0x43')](db[_0x01ec('0x2c')][_0x01ec('0x2d')]);_0xafc639[_0x01ec('0x35')]=_[_0x01ec('0x33')](_0x4ba35f[_0x01ec('0x2f')],qs[_0x01ec('0x34')](_0xadb924['query'][_0x01ec('0x34')]));_0xafc639['attributes']=_0xafc639[_0x01ec('0x35')][_0x01ec('0x36')]?_0xafc639[_0x01ec('0x35')]:_0x4ba35f[_0x01ec('0x2f')];if(_0xadb924[_0x01ec('0x31')]['includeAll']){_0xafc639[_0x01ec('0x46')]=[{'all':!![]}];}_0xafc639=_[_0x01ec('0x3d')]({},_0xafc639,_0xadb924[_0x01ec('0x3f')]);return db[_0x01ec('0x2c')]['find'](_0xafc639)['then'](handleEntityNotFound(_0x467882,null))[_0x01ec('0x26')](function(_0x50cd70){if(_0x50cd70){var _0x5974a9=_0x50cd70[_0x01ec('0x47')]({'plain':!![]});_0x5974a9=qs['omit'](_0x5974a9,['id',_0x01ec('0x48'),_0x01ec('0x49')]);_0xadb924['body']=_['omit'](_0xadb924[_0x01ec('0x4a')],['id',_0x01ec('0x48'),_0x01ec('0x49')]);return db['Attachment'][_0x01ec('0x4b')](_[_0x01ec('0x3d')](_0x5974a9,_0xadb924[_0x01ec('0x4a')]),{'include':_0xadb924['query'][_0x01ec('0x40')]?[{'all':!![]}]:undefined});}})[_0x01ec('0x26')](respondWithResult(_0x467882,0xc9))[_0x01ec('0x41')](handleError(_0x467882,null));};exports[_0x01ec('0x25')]=function(_0x4cbfa0,_0x15dc35){if(_0x4cbfa0[_0x01ec('0x4a')]['id']){delete _0x4cbfa0['body']['id'];}return db[_0x01ec('0x2c')][_0x01ec('0x44')]({'where':{'id':_0x4cbfa0[_0x01ec('0x42')]['id']}})[_0x01ec('0x26')](handleEntityNotFound(_0x15dc35,null))[_0x01ec('0x26')](saveUpdates(_0x4cbfa0[_0x01ec('0x4a')],null))[_0x01ec('0x26')](respondWithResult(_0x15dc35,null))[_0x01ec('0x41')](handleError(_0x15dc35,null));};exports[_0x01ec('0x27')]=function(_0x1070cf,_0x10b853){return db['Attachment'][_0x01ec('0x44')]({'where':{'id':_0x1070cf['params']['id']}})[_0x01ec('0x26')](handleEntityNotFound(_0x10b853,null))[_0x01ec('0x26')](removeEntity(_0x10b853,null))[_0x01ec('0x41')](handleError(_0x10b853,null));};exports[_0x01ec('0x4b')]=function(_0x4b0791,_0x3318dd,_0x20f6a5){_0x4b0791[_0x01ec('0x4a')]['name']=_0x4b0791[_0x01ec('0x4c')]['originalname'];_0x4b0791[_0x01ec('0x4a')][_0x01ec('0x4d')]=_0x4b0791[_0x01ec('0x4c')][_0x01ec('0x4e')];_0x4b0791[_0x01ec('0x4a')]['type']=_0x4b0791['file'][_0x01ec('0x4f')];return db['Attachment'][_0x01ec('0x4b')](_0x4b0791[_0x01ec('0x4a')])[_0x01ec('0x26')](respondWithResult(_0x3318dd,0xc9))[_0x01ec('0x41')](handleError(_0x3318dd,null));};exports[_0x01ec('0x50')]=function(_0x35a93d,_0x525444,_0x57bdb4){return db[_0x01ec('0x2c')][_0x01ec('0x51')]({'where':{'id':_0x35a93d[_0x01ec('0x42')]['id']},'raw':!![]})[_0x01ec('0x26')](handleEntityNotFound(_0x525444,null))[_0x01ec('0x26')](function(_0x36d9d8){if(_0x36d9d8){var _0x4b90c5=_0x36d9d8['ChatOfflineMessageId']!==null;var _0x1f4926=path[_0x01ec('0x52')](config['root'],'server/files/attachments/');if(_0x4b90c5){_0x1f4926=path[_0x01ec('0x52')](_0x1f4926,_0x01ec('0x53'));}var _0x51ae97=path['join'](_0x1f4926,_0x36d9d8['basename']);return _0x525444[_0x01ec('0x50')](_0x51ae97);}})[_0x01ec('0x41')](handleError(_0x525444,null));};
\ No newline at end of file
+var _0xccbb=['map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','show','clone','get','omit','createdAt','updatedAt','body','params','destroy','find','create','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xccbb,0xf0));var _0xbccb=function(_0x385b5c,_0x527ff4){_0x385b5c=_0x385b5c-0x0;var _0x5530fa=_0xccbb[_0x385b5c];return _0x5530fa;};'use strict';var emlformat=require(_0xbccb('0x0'));var rimraf=require(_0xbccb('0x1'));var zipdir=require(_0xbccb('0x2'));var jsonpatch=require(_0xbccb('0x3'));var rp=require(_0xbccb('0x4'));var moment=require(_0xbccb('0x5'));var BPromise=require(_0xbccb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbccb('0x7'));var csv=require(_0xbccb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbccb('0x9'));var _=require(_0xbccb('0xa'));var squel=require(_0xbccb('0xb'));var crypto=require(_0xbccb('0xc'));var jsforce=require(_0xbccb('0xd'));var deskjs=require(_0xbccb('0xe'));var toCsv=require(_0xbccb('0x8'));var querystring=require(_0xbccb('0xf'));var Papa=require(_0xbccb('0x10'));var Redis=require('ioredis');var authService=require(_0xbccb('0x11'));var qs=require(_0xbccb('0x12'));var as=require(_0xbccb('0x13'));var hardwareService=require(_0xbccb('0x14'));var logger=require('../../config/logger')(_0xbccb('0x15'));var utils=require(_0xbccb('0x16'));var config=require(_0xbccb('0x17'));var licenseUtil=require(_0xbccb('0x18'));var db=require(_0xbccb('0x19'))['db'];function respondWithStatusCode(_0x86a6e2,_0x7b663d){_0x7b663d=_0x7b663d||0xcc;return function(_0x2154a3){if(_0x2154a3){return _0x86a6e2[_0xbccb('0x1a')](_0x7b663d);}return _0x86a6e2['status'](_0x7b663d)[_0xbccb('0x1b')]();};}function respondWithResult(_0x156b58,_0x440354){_0x440354=_0x440354||0xc8;return function(_0x217f7c){if(_0x217f7c){return _0x156b58[_0xbccb('0x1c')](_0x440354)['json'](_0x217f7c);}};}function respondWithFilteredResult(_0xf40a9e,_0x2af522){return function(_0x138acb){if(_0x138acb){var _0x4a3ba9=typeof _0x2af522['offset']===_0xbccb('0x1d')&&typeof _0x2af522[_0xbccb('0x1e')]===_0xbccb('0x1d');var _0x12626f=_0x138acb[_0xbccb('0x1f')];var _0x2e3c50=_0x4a3ba9?0x0:_0x2af522[_0xbccb('0x20')];var _0x465f2f=_0x4a3ba9?_0x138acb['count']:_0x2af522['offset']+_0x2af522[_0xbccb('0x1e')];var _0x376692;if(_0x465f2f>=_0x12626f){_0x465f2f=_0x12626f;_0x376692=0xc8;}else{_0x376692=0xce;}_0xf40a9e['status'](_0x376692);return _0xf40a9e[_0xbccb('0x21')](_0xbccb('0x22'),_0x2e3c50+'-'+_0x465f2f+'/'+_0x12626f)[_0xbccb('0x23')](_0x138acb);}return null;};}function patchUpdates(_0x4b5d66){return function(_0x52f09f){try{jsonpatch[_0xbccb('0x24')](_0x52f09f,_0x4b5d66,!![]);}catch(_0xaf04c8){return BPromise[_0xbccb('0x25')](_0xaf04c8);}return _0x52f09f[_0xbccb('0x26')]();};}function saveUpdates(_0x2e81d7,_0x1cb985){return function(_0x19b2a){if(_0x19b2a){return _0x19b2a[_0xbccb('0x27')](_0x2e81d7)[_0xbccb('0x28')](function(_0xd9533a){return _0xd9533a;});}return null;};}function removeEntity(_0x22caa9,_0x495141){return function(_0x2730db){if(_0x2730db){return _0x2730db['destroy']()['then'](function(){_0x22caa9[_0xbccb('0x1c')](0xcc)[_0xbccb('0x1b')]();});}};}function handleEntityNotFound(_0x6a71c8,_0x220fc2){return function(_0x35cd25){if(!_0x35cd25){_0x6a71c8[_0xbccb('0x1a')](0x194);}return _0x35cd25;};}function handleError(_0x29a373,_0x2b13b){_0x2b13b=_0x2b13b||0x1f4;return function(_0x4d075b){logger[_0xbccb('0x29')](_0x4d075b[_0xbccb('0x2a')]);if(_0x4d075b[_0xbccb('0x2b')]){delete _0x4d075b[_0xbccb('0x2b')];}_0x29a373[_0xbccb('0x1c')](_0x2b13b)[_0xbccb('0x2c')](_0x4d075b);};}exports['index']=function(_0x3ed099,_0x246b84){var _0x134864={},_0x34013d={},_0x4650b3={'count':0x0,'rows':[]};var _0x20737a=_[_0xbccb('0x2d')](db['Attachment'][_0xbccb('0x2e')],function(_0x14e20a){return{'name':_0x14e20a[_0xbccb('0x2f')],'type':_0x14e20a[_0xbccb('0x30')][_0xbccb('0x31')]};});_0x34013d['model']=_[_0xbccb('0x2d')](_0x20737a,_0xbccb('0x2b'));_0x34013d[_0xbccb('0x32')]=_[_0xbccb('0x33')](_0x3ed099[_0xbccb('0x32')]);_0x34013d[_0xbccb('0x34')]=_[_0xbccb('0x35')](_0x34013d[_0xbccb('0x36')],_0x34013d[_0xbccb('0x32')]);_0x134864['attributes']=_[_0xbccb('0x35')](_0x34013d['model'],qs[_0xbccb('0x37')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x37')]));_0x134864[_0xbccb('0x38')]=_0x134864[_0xbccb('0x38')][_0xbccb('0x39')]?_0x134864[_0xbccb('0x38')]:_0x34013d['model'];if(!_0x3ed099[_0xbccb('0x32')][_0xbccb('0x3a')](_0xbccb('0x3b'))){_0x134864[_0xbccb('0x1e')]=qs[_0xbccb('0x1e')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x1e')]);_0x134864[_0xbccb('0x20')]=qs[_0xbccb('0x20')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x20')]);}_0x134864[_0xbccb('0x3c')]=qs[_0xbccb('0x3d')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x3d')]);_0x134864[_0xbccb('0x3e')]=qs[_0xbccb('0x34')](_[_0xbccb('0x3f')](_0x3ed099[_0xbccb('0x32')],_0x34013d['filters']),_0x20737a);if(_0x3ed099['query'][_0xbccb('0x40')]){_0x134864[_0xbccb('0x3e')]=_[_0xbccb('0x41')](_0x134864['where'],{'$or':_[_0xbccb('0x2d')](_0x20737a,function(_0x41586b){if(_0x41586b[_0xbccb('0x30')]!==_0xbccb('0x42')){var _0x2e28c6={};_0x2e28c6[_0x41586b[_0xbccb('0x2b')]]={'$like':'%'+_0x3ed099[_0xbccb('0x32')]['filter']+'%'};return _0x2e28c6;}})});}_0x134864=_['merge']({},_0x134864,_0x3ed099[_0xbccb('0x43')]);var _0x1a3039={'where':_0x134864['where']};return db[_0xbccb('0x44')][_0xbccb('0x1f')](_0x1a3039)[_0xbccb('0x28')](function(_0x316a18){_0x4650b3[_0xbccb('0x1f')]=_0x316a18;if(_0x3ed099[_0xbccb('0x32')][_0xbccb('0x45')]){_0x134864[_0xbccb('0x46')]=[{'all':!![]}];}return db[_0xbccb('0x44')][_0xbccb('0x47')](_0x134864);})['then'](function(_0x23c86d){_0x4650b3[_0xbccb('0x48')]=_0x23c86d;return _0x4650b3;})[_0xbccb('0x28')](respondWithFilteredResult(_0x246b84,_0x134864))[_0xbccb('0x49')](handleError(_0x246b84,null));};exports[_0xbccb('0x4a')]=function(_0x1480a4,_0x59d74a){var _0x44e40c={'raw':!![],'where':{'id':_0x1480a4['params']['id']}},_0x18ba29={};_0x18ba29[_0xbccb('0x36')]=_[_0xbccb('0x33')](db[_0xbccb('0x44')][_0xbccb('0x2e')]);_0x18ba29[_0xbccb('0x32')]=_[_0xbccb('0x33')](_0x1480a4[_0xbccb('0x32')]);_0x18ba29[_0xbccb('0x34')]=_[_0xbccb('0x35')](_0x18ba29[_0xbccb('0x36')],_0x18ba29['query']);_0x44e40c[_0xbccb('0x38')]=_[_0xbccb('0x35')](_0x18ba29['model'],qs[_0xbccb('0x37')](_0x1480a4[_0xbccb('0x32')][_0xbccb('0x37')]));_0x44e40c[_0xbccb('0x38')]=_0x44e40c[_0xbccb('0x38')]['length']?_0x44e40c['attributes']:_0x18ba29['model'];if(_0x1480a4['query'][_0xbccb('0x45')]){_0x44e40c[_0xbccb('0x46')]=[{'all':!![]}];}_0x44e40c=_[_0xbccb('0x41')]({},_0x44e40c,_0x1480a4[_0xbccb('0x43')]);return db[_0xbccb('0x44')]['find'](_0x44e40c)[_0xbccb('0x28')](handleEntityNotFound(_0x59d74a,null))[_0xbccb('0x28')](respondWithResult(_0x59d74a,null))['catch'](handleError(_0x59d74a,null));};exports[_0xbccb('0x4b')]=function(_0x14a062,_0x178d5b){var _0x118def={'where':{'id':_0x14a062['params']['id']}},_0x342712={};_0x342712[_0xbccb('0x36')]=_[_0xbccb('0x33')](db[_0xbccb('0x44')][_0xbccb('0x2e')]);_0x118def[_0xbccb('0x38')]=_[_0xbccb('0x35')](_0x342712[_0xbccb('0x36')],qs[_0xbccb('0x37')](_0x14a062[_0xbccb('0x32')][_0xbccb('0x37')]));_0x118def[_0xbccb('0x38')]=_0x118def[_0xbccb('0x38')]['length']?_0x118def[_0xbccb('0x38')]:_0x342712['model'];if(_0x14a062['query']['includeAll']){_0x118def['include']=[{'all':!![]}];}_0x118def=_['merge']({},_0x118def,_0x14a062[_0xbccb('0x43')]);return db['Attachment']['find'](_0x118def)['then'](handleEntityNotFound(_0x178d5b,null))[_0xbccb('0x28')](function(_0x1668b4){if(_0x1668b4){var _0x5ca6b6=_0x1668b4[_0xbccb('0x4c')]({'plain':!![]});_0x5ca6b6=qs[_0xbccb('0x4d')](_0x5ca6b6,['id',_0xbccb('0x4e'),_0xbccb('0x4f')]);_0x14a062['body']=_[_0xbccb('0x4d')](_0x14a062['body'],['id',_0xbccb('0x4e'),_0xbccb('0x4f')]);return db[_0xbccb('0x44')]['create'](_[_0xbccb('0x41')](_0x5ca6b6,_0x14a062[_0xbccb('0x50')]),{'include':_0x14a062[_0xbccb('0x32')][_0xbccb('0x45')]?[{'all':!![]}]:undefined});}})[_0xbccb('0x28')](respondWithResult(_0x178d5b,0xc9))[_0xbccb('0x49')](handleError(_0x178d5b,null));};exports[_0xbccb('0x27')]=function(_0x449a6b,_0x333bad){if(_0x449a6b[_0xbccb('0x50')]['id']){delete _0x449a6b[_0xbccb('0x50')]['id'];}return db[_0xbccb('0x44')]['find']({'where':{'id':_0x449a6b[_0xbccb('0x51')]['id']}})[_0xbccb('0x28')](handleEntityNotFound(_0x333bad,null))[_0xbccb('0x28')](saveUpdates(_0x449a6b[_0xbccb('0x50')],null))[_0xbccb('0x28')](respondWithResult(_0x333bad,null))[_0xbccb('0x49')](handleError(_0x333bad,null));};exports[_0xbccb('0x52')]=function(_0x1b6c2c,_0x271a16){return db['Attachment'][_0xbccb('0x53')]({'where':{'id':_0x1b6c2c['params']['id']}})['then'](handleEntityNotFound(_0x271a16,null))[_0xbccb('0x28')](removeEntity(_0x271a16,null))[_0xbccb('0x49')](handleError(_0x271a16,null));};exports[_0xbccb('0x54')]=function(_0xa83236,_0x1b3d75,_0x41a157){_0xa83236[_0xbccb('0x50')][_0xbccb('0x2b')]=_0xa83236['file'][_0xbccb('0x55')];_0xa83236[_0xbccb('0x50')][_0xbccb('0x56')]=_0xa83236[_0xbccb('0x57')][_0xbccb('0x58')];_0xa83236['body']['type']=_0xa83236[_0xbccb('0x57')]['mimetype'];return db[_0xbccb('0x44')][_0xbccb('0x54')](_0xa83236[_0xbccb('0x50')])[_0xbccb('0x28')](respondWithResult(_0x1b3d75,0xc9))[_0xbccb('0x49')](handleError(_0x1b3d75,null));};exports['download']=function(_0x5cca5a,_0x5990a6,_0x54325e){return db['Attachment'][_0xbccb('0x59')]({'where':{'id':_0x5cca5a[_0xbccb('0x51')]['id']},'raw':!![]})[_0xbccb('0x28')](handleEntityNotFound(_0x5990a6,null))[_0xbccb('0x28')](function(_0x5c7675){if(_0x5c7675){var _0x38b618=_0x5c7675[_0xbccb('0x5a')]!==null;var _0x22a307=path[_0xbccb('0x5b')](config[_0xbccb('0x5c')],'server/files/attachments/');if(_0x38b618){_0x22a307=path[_0xbccb('0x5b')](_0x22a307,_0xbccb('0x5d'));}var _0x26a893=path['join'](_0x22a307,_0x5c7675['basename']);return _0x5990a6[_0xbccb('0x5e')](_0x26a893);}})['catch'](handleError(_0x5990a6,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index d79b742..483e204 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 _0x4ea1=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3e4f85,_0x545dba){var _0x4d4f94=function(_0x59ef74){while(--_0x59ef74){_0x3e4f85['push'](_0x3e4f85['shift']());}};_0x4d4f94(++_0x545dba);}(_0x4ea1,0x1c9));var _0x14ea=function(_0x146237,_0x54a9f4){_0x146237=_0x146237-0x0;var _0x736d1b=_0x4ea1[_0x146237];return _0x736d1b;};'use strict';var _=require(_0x14ea('0x0'));var util=require(_0x14ea('0x1'));var logger=require(_0x14ea('0x2'))('api');var moment=require(_0x14ea('0x3'));var BPromise=require(_0x14ea('0x4'));var rp=require(_0x14ea('0x5'));var fs=require('fs');var path=require(_0x14ea('0x6'));var rimraf=require(_0x14ea('0x7'));var config=require(_0x14ea('0x8'));var attributes=require(_0x14ea('0x9'));module[_0x14ea('0xa')]=function(_0x30b415,_0x421c59){return _0x30b415[_0x14ea('0xb')](_0x14ea('0xc'),attributes,{'tableName':_0x14ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ed7=['Attachment','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x354f55,_0x1b2923){var _0x223f6b=function(_0x3ece83){while(--_0x3ece83){_0x354f55['push'](_0x354f55['shift']());}};_0x223f6b(++_0x1b2923);}(_0x5ed7,0xd0));var _0x75ed=function(_0x2204b8,_0xed74f5){_0x2204b8=_0x2204b8-0x0;var _0x3bf14f=_0x5ed7[_0x2204b8];return _0x3bf14f;};'use strict';var _=require(_0x75ed('0x0'));var util=require('util');var logger=require(_0x75ed('0x1'))(_0x75ed('0x2'));var moment=require(_0x75ed('0x3'));var BPromise=require(_0x75ed('0x4'));var rp=require(_0x75ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75ed('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x75ed('0x7')]=function(_0x30c87d,_0x51ed1a){return _0x30c87d['define'](_0x75ed('0x8'),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 dfad147..c6843a2 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 _0x13c0=['message','result','catch','CreateAttachment','create','body','options','raw','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55fb3d,_0x302b19){var _0x5671a7=function(_0x10aced){while(--_0x10aced){_0x55fb3d['push'](_0x55fb3d['shift']());}};_0x5671a7(++_0x302b19);}(_0x13c0,0x79));var _0x013c=function(_0x139ff6,_0xddca5){_0x139ff6=_0x139ff6-0x0;var _0x71b083=_0x13c0[_0x139ff6];return _0x71b083;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3decb5,_0x50caf2,_0x4cf99d){return new BPromise(function(_0x593053,_0x27c830){return client[_0x013c('0xb')](_0x3decb5,_0x4cf99d)['then'](function(_0x28c3a0){logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));logger[_0x013c('0xf')](_0x013c('0x10'),_0x50caf2,_0x013c('0xe'),JSON[_0x013c('0x11')](_0x28c3a0));if(_0x28c3a0[_0x013c('0x12')]){if(_0x28c3a0[_0x013c('0x12')]['code']===0x1f4){logger['error'](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x27c830(_0x28c3a0[_0x013c('0x12')]['message']);}logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x593053(_0x28c3a0[_0x013c('0x12')]['message']);}else{logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));_0x593053(_0x28c3a0[_0x013c('0x14')][_0x013c('0x13')]);}})[_0x013c('0x15')](function(_0x6b8b5){logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x6b8b5);_0x27c830(_0x6b8b5);});});}exports[_0x013c('0x16')]=function(_0x34d59f){var _0x4268cf=this;return new Promise(function(_0x25eb26,_0x5a9142){return db['Attachment'][_0x013c('0x17')](_0x34d59f[_0x013c('0x18')],{'raw':_0x34d59f['options']?_0x34d59f[_0x013c('0x19')][_0x013c('0x1a')]===undefined?!![]:![]:!![]})[_0x013c('0x1b')](function(_0x38bac2){logger[_0x013c('0xc')]('CreateAttachment',_0x34d59f);logger[_0x013c('0xf')](_0x013c('0x16'),_0x34d59f,JSON['stringify'](_0x38bac2));_0x25eb26(_0x38bac2);})[_0x013c('0x15')](function(_0x82f9f1){logger['error']('CreateAttachment',_0x82f9f1[_0x013c('0x13')],_0x34d59f);_0x5a9142(_0x4268cf[_0x013c('0x12')](0x1f4,_0x82f9f1[_0x013c('0x13')]));});});};
\ No newline at end of file
+var _0xee39=['create','body','options','raw','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment'];(function(_0x29806d,_0x296c13){var _0x3b8361=function(_0x58e84d){while(--_0x58e84d){_0x29806d['push'](_0x29806d['shift']());}};_0x3b8361(++_0x296c13);}(_0xee39,0x1e6));var _0x9ee3=function(_0x244e46,_0x5a2dd3){_0x244e46=_0x244e46-0x0;var _0x1bacd5=_0xee39[_0x244e46];return _0x1bacd5;};'use strict';var _=require(_0x9ee3('0x0'));var util=require(_0x9ee3('0x1'));var moment=require(_0x9ee3('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ee3('0x3'));var fs=require('fs');var Redis=require(_0x9ee3('0x4'));var db=require(_0x9ee3('0x5'))['db'];var utils=require(_0x9ee3('0x6'));var logger=require(_0x9ee3('0x7'))(_0x9ee3('0x8'));var config=require(_0x9ee3('0x9'));var jayson=require(_0x9ee3('0xa'));var client=jayson[_0x9ee3('0xb')][_0x9ee3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dc1eb,_0x10e9e6,_0x22264c){return new BPromise(function(_0x22c8fc,_0x4d1a57){return client[_0x9ee3('0xd')](_0x4dc1eb,_0x22264c)['then'](function(_0x1bde67){logger['info'](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');logger['debug'](_0x9ee3('0xf'),_0x10e9e6,'request\x20sent',JSON[_0x9ee3('0x10')](_0x1bde67));if(_0x1bde67['error']){if(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x12')]===0x1f4){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);return _0x4d1a57(_0x1bde67[_0x9ee3('0x11')]['message']);}logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')]['message']);return _0x22c8fc(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);}else{logger[_0x9ee3('0x14')](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');_0x22c8fc(_0x1bde67['result'][_0x9ee3('0x13')]);}})[_0x9ee3('0x15')](function(_0x456bf7){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x456bf7);_0x4d1a57(_0x456bf7);});});}exports[_0x9ee3('0x16')]=function(_0x4a0de5){var _0x4a987a=this;return new Promise(function(_0x1f937f,_0x1342e2){return db[_0x9ee3('0x17')][_0x9ee3('0x18')](_0x4a0de5[_0x9ee3('0x19')],{'raw':_0x4a0de5[_0x9ee3('0x1a')]?_0x4a0de5[_0x9ee3('0x1a')][_0x9ee3('0x1b')]===undefined?!![]:![]:!![]})[_0x9ee3('0x1c')](function(_0x80671d){logger['info'](_0x9ee3('0x16'),_0x4a0de5);logger[_0x9ee3('0x1d')](_0x9ee3('0x16'),_0x4a0de5,JSON[_0x9ee3('0x10')](_0x80671d));_0x1f937f(_0x80671d);})[_0x9ee3('0x15')](function(_0x44bc5a){logger['error'](_0x9ee3('0x16'),_0x44bc5a[_0x9ee3('0x13')],_0x4a0de5);_0x1342e2(_0x4a987a[_0x9ee3('0x11')](0x1f4,_0x44bc5a[_0x9ee3('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index d291d94..2e2a58d 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0x0b0e[_0x5b47d9];return _0x4151f0;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0xa7075c,_0x49eae0){var _0x5ca75f=function(_0x2f7982){while(--_0x2f7982){_0xa7075c['push'](_0xa7075c['shift']());}};_0x5ca75f(++_0x49eae0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1eb4e0,_0x4ebc2d){_0x1eb4e0=_0x1eb4e0-0x0;var _0x18ec21=_0xb10b[_0x1eb4e0];return _0x18ec21;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index c83f7f8..78caf2d 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 _0x5c89=['admin','user','agent','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','ad-login','passport','passport-local','Strategy','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','blocked','blockedAt'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x5c89,0x182));var _0x95c8=function(_0x1b2454,_0x6b04ad){_0x1b2454=_0x1b2454-0x0;var _0x13a165=_0x5c89[_0x1b2454];return _0x13a165;};'use strict';var passport=require(_0x95c8('0x0'));var LocalStrategy=require(_0x95c8('0x1'))[_0x95c8('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require('util');var db=require(_0x95c8('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x95c8('0x4'));var config=require(_0x95c8('0x5'));var logger=require(_0x95c8('0x6'))(_0x95c8('0x7'));function isActiveDirectoryConfigured(_0x39831e){var _0x1ca32b=![];if(typeof _0x39831e[_0x95c8('0x8')]!==_0x95c8('0x9')){_0x1ca32b=_0x39831e[_0x95c8('0x8')][_0x95c8('0xa')]&&_0x39831e['activedirectory'][_0x95c8('0xb')]&&_0x39831e['activedirectory'][_0x95c8('0xc')];}return _0x1ca32b;}function adAuthenticate(_0x3db4c3,_0x118fbd,_0x297ba7){return new BPromise(function(_0x461743,_0x40be94){try{var _0x58dace=new ActiveDirectory(_0x3db4c3);_0x58dace[_0x95c8('0xd')](_0x118fbd,_0x297ba7,function(_0x4eb414,_0x17b731){if(_0x4eb414){logger[_0x95c8('0xe')](_0x95c8('0xf'),_0x118fbd,util['inspect'](_0x4eb414,{'showHidden':![],'depth':null}));_0x40be94(_0x95c8('0x10'));}else if(!_0x17b731){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x118fbd);_0x40be94('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x461743(_0x17b731);}});}catch(_0x59109f){_0x40be94(_0x59109f);}});}function ActiveDirectoryAuthenticate(_0x259511,_0x5b5657,_0x5bdcc2,_0x4c472c){var _0x1bb2c0,_0x288c76;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x95c8('0x11'),_0x5b5657);return _0x4c472c(null,![],{'message':_0x95c8('0x10')});}return db[_0x95c8('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x95c8('0x13'),'blockDuration'],'raw':!![]})[_0x95c8('0x14')](function(_0x18f73c){_0x1bb2c0=_0x18f73c;if(!_0x1bb2c0[_0x95c8('0x13')]){logger[_0x95c8('0xe')](_0x95c8('0x15'),_0x5b5657);throw new Error(_0x95c8('0x10'));}return _0x259511[_0x95c8('0x16')]({'attributes':['id',_0x95c8('0x17'),_0x95c8('0x18'),'salt',_0x95c8('0x19'),'disabled',_0x95c8('0x1a'),_0x95c8('0x1b'),'online'],'where':{'name':_0x5b5657,'role':{'$or':[_0x95c8('0x1c'),_0x95c8('0x1d'),_0x95c8('0x1e')]},'adSsoEnabled':!![]}});})[_0x95c8('0x14')](function(_0x4c759f){if(!_0x4c759f||_0x4c759f&&_0x4c759f[_0x95c8('0x17')]!==_0x5b5657){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x288c76=_0x4c759f;var _0x2f6036=_0x288c76[_0x95c8('0x17')]+'@'+config[_0x95c8('0x8')]['domain'];return adAuthenticate(config[_0x95c8('0x8')],_0x2f6036,_0x5bdcc2);})[_0x95c8('0x14')](function(_0x4e6192){if(_0x288c76[_0x95c8('0x1f')]){throw new Error(_0x95c8('0x10'));}if(_0x1bb2c0[_0x95c8('0x20')]>0x0){if(_0x288c76[_0x95c8('0x1a')]){if(moment(_0x288c76['blockedAt'])[_0x95c8('0x21')](_0x1bb2c0[_0x95c8('0x20')],_0x95c8('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x95c8('0x23')](_0x288c76,0x0,![],null)[_0x95c8('0x14')](function(){return utils[_0x95c8('0x24')](_0x288c76);})['then'](function(){return _0x4c472c(null,_0x288c76);});}else{return utils[_0x95c8('0x24')](_0x288c76)[_0x95c8('0x14')](function(){return _0x4c472c(null,_0x288c76);});}}else{return utils[_0x95c8('0x24')](_0x288c76)['then'](function(){return _0x4c472c(null,_0x288c76);});}})[_0x95c8('0x25')](function(_0x5a93ba){return _0x4c472c(null,![],_0x5a93ba);});}function handleError(_0x1b45a5,_0x441532,_0x34ce77){return _0x1b45a5[_0x95c8('0x26')](_0x441532||0x1f4)[_0x95c8('0x27')]({'message':_0x34ce77?_0x34ce77[_0x95c8('0x28')]||_0x34ce77:''});}exports['login']=function(_0x369f2a,_0x870066,_0x311ca9){passport[_0x95c8('0xd')]('ad-login',function(_0x39fdbc,_0x4d7340,_0x4d76ed){var _0x2e8abd=_0x39fdbc||_0x4d76ed;if(_0x2e8abd){return handleError(_0x870066,0x191,_0x2e8abd);}if(!_0x4d7340){return handleError(_0x870066,0x194,{'message':_0x95c8('0x29')});}else{var _0x16c2a4={'payload':{'id':_0x4d7340['id'],'role':_0x4d7340[_0x95c8('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x95c8('0x2a')](_0x16c2a4)[_0x95c8('0x14')](function(_0x2fcd3d){_0x870066['json']({'id':_0x4d7340['id'],'token':_0x2fcd3d,'statusCall':'','isAlreadyLogged':_0x4d7340[_0x95c8('0x2b')]});});}})(_0x369f2a,_0x870066,_0x311ca9);};passport[_0x95c8('0x2c')](_0x95c8('0x2d'),new LocalStrategy({'usernameField':_0x95c8('0x17'),'passwordField':_0x95c8('0x18')},function(_0x2e658b,_0x1de48c,_0x33dacc){return ActiveDirectoryAuthenticate(db['User'],_0x2e658b,_0x1de48c,_0x33dacc);}));
\ No newline at end of file
+var _0x9d94=['activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','admin','user','add','minutes','clearBlockUser','getLicense','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','Strategy'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9d94,0x11e));var _0x49d9=function(_0x56a77e,_0x5f2d5d){_0x56a77e=_0x56a77e-0x0;var _0x2eca06=_0x9d94[_0x56a77e];return _0x2eca06;};'use strict';var passport=require(_0x49d9('0x0'));var LocalStrategy=require('passport-local')[_0x49d9('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x49d9('0x2'));var BPromise=require(_0x49d9('0x3'));var util=require(_0x49d9('0x4'));var db=require(_0x49d9('0x5'))['db'];var authService=require(_0x49d9('0x6'));var utils=require(_0x49d9('0x7'));var config=require(_0x49d9('0x8'));var logger=require(_0x49d9('0x9'))('api');function isActiveDirectoryConfigured(_0x385571){var _0x25a172=![];if(typeof _0x385571['activedirectory']!==_0x49d9('0xa')){_0x25a172=_0x385571[_0x49d9('0xb')][_0x49d9('0xc')]&&_0x385571[_0x49d9('0xb')]['url']&&_0x385571[_0x49d9('0xb')][_0x49d9('0xd')];}return _0x25a172;}function adAuthenticate(_0x4efc8f,_0x590cb3,_0x508230){return new BPromise(function(_0x2950f9,_0x1ac297){try{var _0x336edc=new ActiveDirectory(_0x4efc8f);_0x336edc['authenticate'](_0x590cb3,_0x508230,function(_0x148966,_0x1bbe29){if(_0x148966){logger[_0x49d9('0xe')](_0x49d9('0xf'),_0x590cb3,util[_0x49d9('0x10')](_0x148966,{'showHidden':![],'depth':null}));_0x1ac297(_0x49d9('0x11'));}else if(!_0x1bbe29){logger['error'](_0x49d9('0x12'),_0x590cb3);_0x1ac297(_0x49d9('0x11'));}else{_0x2950f9(_0x1bbe29);}});}catch(_0x5aa85d){_0x1ac297(_0x5aa85d);}});}function ActiveDirectoryAuthenticate(_0x19e258,_0x2254cf,_0x1e4c49,_0x128a37){var _0x1dc822,_0x8d1b1f;if(!isActiveDirectoryConfigured(config)){logger[_0x49d9('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2254cf);return _0x128a37(null,![],{'message':_0x49d9('0x11')});}return db['Setting'][_0x49d9('0x13')]({'where':{'id':0x1},'attributes':[_0x49d9('0x14'),_0x49d9('0x15')],'raw':!![]})[_0x49d9('0x16')](function(_0x238022){_0x1dc822=_0x238022;if(!_0x1dc822['adSsoEnabled']){logger[_0x49d9('0xe')](_0x49d9('0x17'),_0x2254cf);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x19e258[_0x49d9('0x13')]({'attributes':['id',_0x49d9('0x18'),_0x49d9('0x19'),_0x49d9('0x1a'),_0x49d9('0x1b'),_0x49d9('0x1c'),_0x49d9('0x1d'),_0x49d9('0x1e'),'online'],'where':{'name':_0x2254cf,'role':{'$or':[_0x49d9('0x1f'),_0x49d9('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0x49d9('0x16')](function(_0x47291a){if(!_0x47291a||_0x47291a&&_0x47291a['name']!==_0x2254cf){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x8d1b1f=_0x47291a;var _0x11497a=_0x8d1b1f[_0x49d9('0x18')]+'@'+config[_0x49d9('0xb')][_0x49d9('0xd')];return adAuthenticate(config['activedirectory'],_0x11497a,_0x1e4c49);})[_0x49d9('0x16')](function(_0x4b8fbf){if(_0x8d1b1f[_0x49d9('0x1c')]){throw new Error(_0x49d9('0x11'));}if(_0x1dc822[_0x49d9('0x15')]>0x0){if(_0x8d1b1f[_0x49d9('0x1d')]){if(moment(_0x8d1b1f[_0x49d9('0x1e')])[_0x49d9('0x21')](_0x1dc822[_0x49d9('0x15')],_0x49d9('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x49d9('0x23')](_0x8d1b1f,0x0,![],null)[_0x49d9('0x16')](function(){return utils['getLicense'](_0x8d1b1f);})[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}else{return utils['getLicense'](_0x8d1b1f)[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}}else{return utils[_0x49d9('0x24')](_0x8d1b1f)[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}})['catch'](function(_0x33cff8){return _0x128a37(null,![],_0x33cff8);});}function handleError(_0x574fc0,_0x2af378,_0x599bb3){return _0x574fc0['status'](_0x2af378||0x1f4)[_0x49d9('0x25')]({'message':_0x599bb3?_0x599bb3[_0x49d9('0x26')]||_0x599bb3:''});}exports[_0x49d9('0x27')]=function(_0x1f87d5,_0x9db538,_0x5e4ee5){passport[_0x49d9('0x28')](_0x49d9('0x29'),function(_0x33dbbb,_0x1c527d,_0x5448cd){var _0x3afe6f=_0x33dbbb||_0x5448cd;if(_0x3afe6f){return handleError(_0x9db538,0x191,_0x3afe6f);}if(!_0x1c527d){return handleError(_0x9db538,0x194,{'message':_0x49d9('0x2a')});}else{var _0x471499={'payload':{'id':_0x1c527d['id'],'role':_0x1c527d[_0x49d9('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x49d9('0x2b')](_0x471499)[_0x49d9('0x16')](function(_0x222385){_0x9db538[_0x49d9('0x2c')]({'id':_0x1c527d['id'],'token':_0x222385,'statusCall':'','isAlreadyLogged':_0x1c527d[_0x49d9('0x2d')]});});}})(_0x1f87d5,_0x9db538,_0x5e4ee5);};passport[_0x49d9('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0x49d9('0x18'),'passwordField':_0x49d9('0x19')},function(_0x43d975,_0x45faf6,_0x52dd4){return ActiveDirectoryAuthenticate(db[_0x49d9('0x2f')],_0x43d975,_0x45faf6,_0x52dd4);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 902e7d0..f246e34 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 _0x7fef=['Router','post','login','exports'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x7fef,0x6c));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0xf7fe('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xf7fe('0x1')]('/',controller[_0xf7fe('0x2')]);module[_0xf7fe('0x3')]=router;
\ No newline at end of file
+var _0x3bb2=['Router','./authActiveDirectory.controller','login','express'];(function(_0x454cee,_0x47a520){var _0x12e884=function(_0x50d5b7){while(--_0x50d5b7){_0x454cee['push'](_0x454cee['shift']());}};_0x12e884(++_0x47a520);}(_0x3bb2,0xd7));var _0x23bb=function(_0x3ef525,_0xe12832){_0x3ef525=_0x3ef525-0x0;var _0xcb28b0=_0x3bb2[_0x3ef525];return _0xcb28b0;};'use strict';var express=require(_0x23bb('0x0'));var router=express[_0x23bb('0x1')]();var controller=require(_0x23bb('0x2'));router['post']('/',controller[_0x23bb('0x3')]);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 9ffb5ff..89b0d23 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(_0x4a8563,_0x519be5){var _0x1e66cb=function(_0x3f1250){while(--_0x3f1250){_0x4a8563['push'](_0x4a8563['shift']());}};_0x1e66cb(++_0x519be5);}(_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 _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(_0x1d64b0,_0x4d4725){var _0x28fd02=function(_0x137968){while(--_0x137968){_0x1d64b0['push'](_0x1d64b0['shift']());}};_0x28fd02(++_0x4d4725);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 9809717..3fc3ad6 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 _0xf7fc=['isMiddleware','exports','express','Router','./authGoogle.controller','../../components/auth/service','login','get','callback'];(function(_0x94b526,_0x411024){var _0x116aa8=function(_0x5b459f){while(--_0x5b459f){_0x94b526['push'](_0x94b526['shift']());}};_0x116aa8(++_0x411024);}(_0xf7fc,0x92));var _0xcf7f=function(_0xd9eff2,_0x44c28d){_0xd9eff2=_0xd9eff2-0x0;var _0x35c947=_0xf7fc[_0xd9eff2];return _0x35c947;};'use strict';var express=require(_0xcf7f('0x0'));var passport=require('passport');var router=express[_0xcf7f('0x1')]();var controller=require(_0xcf7f('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xcf7f('0x3'));router['get']('/',controller[_0xcf7f('0x4')]);router[_0xcf7f('0x5')]('/callback',controller[_0xcf7f('0x6')],authService[_0xcf7f('0x7')],userController[_0xcf7f('0x4')],authService['setTokenCookie']);module[_0xcf7f('0x8')]=router;
\ No newline at end of file
+var _0x4e92=['../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express','passport','../user/user.controller.js'];(function(_0x5ca5d1,_0x2c27f1){var _0x89feb8=function(_0x4d9eed){while(--_0x4d9eed){_0x5ca5d1['push'](_0x5ca5d1['shift']());}};_0x89feb8(++_0x2c27f1);}(_0x4e92,0xed));var _0x24e9=function(_0x434903,_0x2bae84){_0x434903=_0x434903-0x0;var _0x31021e=_0x4e92[_0x434903];return _0x31021e;};'use strict';var express=require(_0x24e9('0x0'));var passport=require(_0x24e9('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x24e9('0x2'));var authService=require(_0x24e9('0x3'));router[_0x24e9('0x4')]('/',controller[_0x24e9('0x5')]);router['get'](_0x24e9('0x6'),controller[_0x24e9('0x7')],authService['isMiddleware'],userController['login'],authService[_0x24e9('0x8')]);module[_0x24e9('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index c2a5c08..9288ffe 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 _0x7dd2=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','/reset/','reset','User','find','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request'];(function(_0x507901,_0x58b9f8){var _0x1aced2=function(_0x40e8dd){while(--_0x40e8dd){_0x507901['push'](_0x507901['shift']());}};_0x1aced2(++_0x58b9f8);}(_0x7dd2,0x11d));var _0x27dd=function(_0x4b55a2,_0x1559ce){_0x4b55a2=_0x4b55a2-0x0;var _0x11d72a=_0x7dd2[_0x4b55a2];return _0x11d72a;};'use strict';var util=require(_0x27dd('0x0'));var passport=require(_0x27dd('0x1'));var LocalStrategy=require(_0x27dd('0x2'))[_0x27dd('0x3')];var jayson=require(_0x27dd('0x4'));var _=require(_0x27dd('0x5'));var rs=require(_0x27dd('0x6'));var moment=require(_0x27dd('0x7'));var db=require(_0x27dd('0x8'))['db'];var authService=require(_0x27dd('0x9'));var utils=require(_0x27dd('0xa'));var client=jayson[_0x27dd('0xb')][_0x27dd('0xc')]({'port':0x232b});function localAuthenticate(_0x3bbefe,_0x296864,_0x3ebe72,_0x1c5c00){var _0x1b5832,_0x1fd241;return db[_0x27dd('0xd')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x27dd('0xe')],'raw':!![]})[_0x27dd('0xf')](function(_0x38575e){_0x1b5832=_0x38575e;return _0x3bbefe['findOne']({'attributes':['id',_0x27dd('0x10'),_0x27dd('0x11'),'salt',_0x27dd('0x12'),_0x27dd('0x13'),_0x27dd('0x14'),'blockedAt',_0x27dd('0x15')],'where':{'name':_0x296864,'role':{'$or':[_0x27dd('0x16'),_0x27dd('0x17'),_0x27dd('0x18')]}}});})[_0x27dd('0xf')](function(_0x218270){if(!_0x218270||_0x218270&&_0x218270[_0x27dd('0x10')]!==_0x296864){throw new Error(_0x27dd('0x19'));}else{_0x1fd241=_0x218270;return _0x1fd241;}})[_0x27dd('0xf')](function(){_0x1fd241['authenticate'](_0x3ebe72,function(_0x1a8442,_0x3bfa75){var _0x590add=_0x1fd241[_0x27dd('0x15')]+0x1;if(_0x1a8442){return _0x1c5c00(_0x1a8442);}else if(!_0x3bfa75){if(_0x1fd241[_0x27dd('0x13')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else if(_0x1b5832['allowedLoginAttempts']>0x0){if(_0x1fd241[_0x27dd('0x14')]){if(_0x1b5832[_0x27dd('0xe')]>0x0){if(moment(_0x1fd241[_0x27dd('0x1a')])[_0x27dd('0x1b')](_0x1b5832['blockDuration'],_0x27dd('0x1c'))>moment()){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1d')](_0x1fd241,_0x590add,![],null)[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{if(_0x590add>=_0x1b5832['allowedLoginAttempts']){return utils['clearBlockUser'](_0x1fd241,0x0,!![],moment())[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}else{return utils[_0x27dd('0x1d')](_0x1fd241,_0x590add,![],null)[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{if(_0x1fd241[_0x27dd('0x13')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else if(_0x1b5832[_0x27dd('0x1e')]>0x0){if(_0x1fd241['blocked']){if(_0x1b5832[_0x27dd('0xe')]>0x0){if(moment(_0x1fd241['blockedAt'])[_0x27dd('0x1b')](_0x1b5832[_0x27dd('0xe')],_0x27dd('0x1c'))>moment()){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1d')](_0x1fd241,0x0,![],null)['then'](function(){return utils[_0x27dd('0x1f')](_0x1fd241);})[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);});}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{return utils['clearBlockUser'](_0x1fd241,0x0,![],null)[_0x27dd('0xf')](function(){return utils['getLicense'](_0x1fd241);})[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);})[_0x27dd('0x20')](function(_0x4f6feb){return _0x1c5c00(null,![],_0x4f6feb);});}}else{if(_0x1fd241[_0x27dd('0x14')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1f')](_0x1fd241)[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);});}}}});})[_0x27dd('0x20')](function(_0x103ca6){return _0x1c5c00(null,![],_0x103ca6);});}function sendServiceMail(_0x167c79){return db[_0x27dd('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x27dd('0x10'),_0x27dd('0x22')],'include':[{'model':db[_0x27dd('0x23')],'as':_0x27dd('0x24'),'include':[{'model':db[_0x27dd('0x25')],'as':'CloudProvider'}]}]})['then'](function(_0x4d9b46){if(!_0x4d9b46){throw new Error(_0x27dd('0x26'));}var _0x35e3e4=_0x4d9b46[_0x27dd('0x27')]();var _0x456f5c={'account':_0x35e3e4,'message':_['merge']({'from':util[_0x27dd('0x28')](_0x27dd('0x29'),_0x4d9b46[_0x27dd('0x10')],_0x4d9b46['email']||_0x4d9b46[_0x27dd('0x24')][_0x27dd('0x17')])},_0x167c79)};return client[_0x27dd('0x2a')]('SendMail',_0x456f5c);})[_0x27dd('0xf')](function(_0x3d0377){if(_0x3d0377[_0x27dd('0x2b')]){throw new Error(util['format'](_0x27dd('0x2c'),_0x3d0377['error'][_0x27dd('0x2d')]||JSON[_0x27dd('0x2e')](_0x3d0377['error'])));}return!![];});}function handleError(_0x331c77,_0x36ad10,_0x2e87e1){return _0x331c77[_0x27dd('0x2f')](_0x36ad10||0x1f4)[_0x27dd('0x30')]({'message':_0x2e87e1?_0x2e87e1[_0x27dd('0x2d')]||_0x2e87e1:''});}exports[_0x27dd('0x31')]=function(_0x158726,_0x4872f7,_0x16761c){passport[_0x27dd('0x32')](_0x27dd('0x33'),function(_0x563554,_0x34930a,_0x11d7e9){var _0x5203e4=_0x563554||_0x11d7e9;if(_0x5203e4){return handleError(_0x4872f7,0x191,_0x5203e4);}if(!_0x34930a){return handleError(_0x4872f7,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x467bbf={'payload':{'id':_0x34930a['id'],'role':_0x34930a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x467bbf)[_0x27dd('0xf')](function(_0x203b58){_0x4872f7[_0x27dd('0x34')]({'id':_0x34930a['id'],'token':_0x203b58,'statusCall':'','isAlreadyLogged':_0x34930a[_0x27dd('0x35')]});});}})(_0x158726,_0x4872f7,_0x16761c);};exports[_0x27dd('0x36')]=function(_0x348a50,_0x42445f){if(!_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')]){return handleError(_0x42445f,0x1f4,{'message':_0x27dd('0x38')});}var _0x2f643f=rs[_0x27dd('0x39')]();_0x348a50[_0x27dd('0x37')]['email']=_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')][_0x27dd('0x3a')]()[_0x27dd('0x3b')]();var _0x18b332;return db[_0x27dd('0xd')][_0x27dd('0x3c')]({'where':{'id':0x1},'attributes':[_0x27dd('0x1e'),_0x27dd('0xe')],'raw':!![]})[_0x27dd('0xf')](function(_0x27842a){_0x18b332=_0x27842a;return db['User']['find']({'where':{'email':_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')]}});})[_0x27dd('0xf')](function(_0x51cba5){if(!_0x51cba5){throw new Error(_0x27dd('0x3d'));}if(_0x51cba5[_0x27dd('0x13')]){throw new Error(_0x27dd('0x3e'));}if(_0x51cba5[_0x27dd('0x14')]){if(moment(_0x51cba5[_0x27dd('0x1a')])[_0x27dd('0x1b')](_0x18b332[_0x27dd('0xe')],_0x27dd('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x51cba5[_0x27dd('0x14')]=![];_0x51cba5[_0x27dd('0x1a')]=null;}}_0x51cba5[_0x27dd('0x3f')]=_0x2f643f;_0x51cba5[_0x27dd('0x40')]=Date['now']()+0x36ee80;return _0x51cba5[_0x27dd('0x41')]();})[_0x27dd('0xf')](function(){return sendServiceMail({'to':_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')],'subject':_0x27dd('0x42'),'text':_0x27dd('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x27dd('0x44')+_0x348a50['headers']['host']+_0x27dd('0x45')+_0x2f643f+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x27dd('0xf')](function(){_0x42445f[_0x27dd('0x2f')](0xc8)[_0x27dd('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x27dd('0x20')](function(_0x35f404){return handleError(_0x42445f,0x1f4,_0x35f404);});};exports[_0x27dd('0x46')]=function(_0x2d22e3,_0x13d17a){return db[_0x27dd('0x47')][_0x27dd('0x48')]({'where':{'resetPasswordToken':_0x2d22e3['params'][_0x27dd('0x49')],'resetPasswordExpires':{'$gt':Date[_0x27dd('0x4a')]()}}})[_0x27dd('0xf')](function(_0x113446){if(!_0x113446){throw new Error(_0x27dd('0x4b'));}return db[_0x27dd('0xd')][_0x27dd('0x3c')]({'attributes':['id',_0x27dd('0x4c'),_0x27dd('0x4d'),_0x27dd('0x4e')]})[_0x27dd('0xf')](function(_0xf4ae9c){if(_0xf4ae9c['securePassword'])authService[_0x27dd('0x4f')](_0x2d22e3[_0x27dd('0x37')][_0x27dd('0x11')]);if(!_0xf4ae9c[_0x27dd('0x4d')]||!_0x113446[_0x27dd('0x50')])return _0x113446;authService[_0x27dd('0x51')](_0x2d22e3[_0x27dd('0x37')][_0x27dd('0x11')],_0x113446['previousPasswords'],_0xf4ae9c[_0x27dd('0x4e')]);return _0x113446;})[_0x27dd('0xf')](function(){_0x113446[_0x27dd('0x11')]=_0x2d22e3[_0x27dd('0x37')]['password'];_0x113446[_0x27dd('0x3f')]=null;_0x113446[_0x27dd('0x40')]=null;return _0x113446[_0x27dd('0x41')]();});})[_0x27dd('0xf')](function(){_0x13d17a[_0x27dd('0x2f')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x4ff33d){return handleError(_0x13d17a,0x1f4,_0x4ff33d);});};passport['use'](_0x27dd('0x33'),new LocalStrategy({'usernameField':_0x27dd('0x10'),'passwordField':'password'},function(_0x2b6359,_0x14b47a,_0x23804e){return localAuthenticate(db[_0x27dd('0x47')],_0x2b6359,_0x14b47a,_0x23804e);}));
\ No newline at end of file
+var _0x616e=['now','save','body','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://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','use','util','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x1b5b4e,_0x14bbd9){var _0x3f4ff4=function(_0x2973a6){while(--_0x2973a6){_0x1b5b4e['push'](_0x1b5b4e['shift']());}};_0x3f4ff4(++_0x14bbd9);}(_0x616e,0x111));var _0xe616=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x616e[_0x1ca890];return _0x3f8e01;};'use strict';var util=require(_0xe616('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xe616('0x1')];var jayson=require(_0xe616('0x2'));var _=require('lodash');var rs=require(_0xe616('0x3'));var moment=require(_0xe616('0x4'));var db=require(_0xe616('0x5'))['db'];var authService=require(_0xe616('0x6'));var utils=require(_0xe616('0x7'));var client=jayson[_0xe616('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4052c6,_0xad3a8,_0x359cc8,_0x2b75dc){var _0x37cdf7,_0x176998;return db[_0xe616('0x9')][_0xe616('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe616('0xb')],'raw':!![]})[_0xe616('0xc')](function(_0x4cf55e){_0x37cdf7=_0x4cf55e;return _0x4052c6['findOne']({'attributes':['id',_0xe616('0xd'),_0xe616('0xe'),_0xe616('0xf'),_0xe616('0x10'),'disabled','blocked',_0xe616('0x11'),_0xe616('0x12')],'where':{'name':_0xad3a8,'role':{'$or':[_0xe616('0x13'),_0xe616('0x14'),_0xe616('0x15')]}}});})[_0xe616('0xc')](function(_0x50753d){if(!_0x50753d||_0x50753d&&_0x50753d[_0xe616('0xd')]!==_0xad3a8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x176998=_0x50753d;return _0x176998;}})[_0xe616('0xc')](function(){_0x176998[_0xe616('0x16')](_0x359cc8,function(_0x9c9e77,_0xbd9f6){var _0x42bdb0=_0x176998['loginAttempts']+0x1;if(_0x9c9e77){return _0x2b75dc(_0x9c9e77);}else if(!_0xbd9f6){if(_0x176998[_0xe616('0x17')]){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else if(_0x37cdf7[_0xe616('0x19')]>0x0){if(_0x176998[_0xe616('0x1a')]){if(_0x37cdf7[_0xe616('0xb')]>0x0){if(moment(_0x176998[_0xe616('0x11')])['add'](_0x37cdf7[_0xe616('0xb')],_0xe616('0x1b'))>moment()){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else{return utils[_0xe616('0x1c')](_0x176998,_0x42bdb0,![],null)[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}}else{return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}}else{if(_0x42bdb0>=_0x37cdf7[_0xe616('0x19')]){return utils[_0xe616('0x1c')](_0x176998,0x0,!![],moment())[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}else{return utils['clearBlockUser'](_0x176998,_0x42bdb0,![],null)[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}}}else{return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}}else{if(_0x176998[_0xe616('0x17')]){return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x37cdf7[_0xe616('0x19')]>0x0){if(_0x176998['blocked']){if(_0x37cdf7['blockDuration']>0x0){if(moment(_0x176998[_0xe616('0x11')])[_0xe616('0x1d')](_0x37cdf7[_0xe616('0xb')],_0xe616('0x1b'))>moment()){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else{return utils[_0xe616('0x1c')](_0x176998,0x0,![],null)[_0xe616('0xc')](function(){return utils[_0xe616('0x1e')](_0x176998);})['then'](function(){return _0x2b75dc(null,_0x176998);});}}else{return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x176998,0x0,![],null)[_0xe616('0xc')](function(){return utils[_0xe616('0x1e')](_0x176998);})[_0xe616('0xc')](function(){return _0x2b75dc(null,_0x176998);})[_0xe616('0x1f')](function(_0x379321){return _0x2b75dc(null,![],_0x379321);});}}else{if(_0x176998[_0xe616('0x1a')]){return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe616('0x1e')](_0x176998)[_0xe616('0xc')](function(){return _0x2b75dc(null,_0x176998);});}}}});})['catch'](function(_0x1b0c3c){return _0x2b75dc(null,![],_0x1b0c3c);});}function sendServiceMail(_0x43f46a){return db[_0xe616('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0xe616('0xd'),_0xe616('0x21')],'include':[{'model':db[_0xe616('0x22')],'as':_0xe616('0x23'),'include':[{'model':db['CloudProvider'],'as':_0xe616('0x24')}]}]})['then'](function(_0x3e5cea){if(!_0x3e5cea){throw new Error(_0xe616('0x25'));}var _0x18402c=_0x3e5cea[_0xe616('0x26')]();var _0x278d59={'account':_0x18402c,'message':_[_0xe616('0x27')]({'from':util[_0xe616('0x28')](_0xe616('0x29'),_0x3e5cea[_0xe616('0xd')],_0x3e5cea[_0xe616('0x21')]||_0x3e5cea['Smtp'][_0xe616('0x14')])},_0x43f46a)};return client[_0xe616('0x2a')](_0xe616('0x2b'),_0x278d59);})[_0xe616('0xc')](function(_0x5c558e){if(_0x5c558e[_0xe616('0x2c')]){throw new Error(util[_0xe616('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5c558e[_0xe616('0x2c')][_0xe616('0x2d')]||JSON['stringify'](_0x5c558e['error'])));}return!![];});}function handleError(_0x45de73,_0xe6ba70,_0x367088){return _0x45de73[_0xe616('0x2e')](_0xe6ba70||0x1f4)[_0xe616('0x2f')]({'message':_0x367088?_0x367088[_0xe616('0x2d')]||_0x367088:''});}exports[_0xe616('0x30')]=function(_0x41d140,_0x9314e0,_0x2fa5e0){passport[_0xe616('0x16')](_0xe616('0x31'),function(_0x3555aa,_0x3df887,_0x39aba4){var _0x559889=_0x3555aa||_0x39aba4;if(_0x559889){return handleError(_0x9314e0,0x191,_0x559889);}if(!_0x3df887){return handleError(_0x9314e0,0x194,{'message':_0xe616('0x32')});}else{var _0x2baffb={'payload':{'id':_0x3df887['id'],'role':_0x3df887[_0xe616('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xe616('0x33')](_0x2baffb)[_0xe616('0xc')](function(_0x7854a5){_0x9314e0[_0xe616('0x34')]({'id':_0x3df887['id'],'token':_0x7854a5,'statusCall':'','isAlreadyLogged':_0x3df887[_0xe616('0x35')]});});}})(_0x41d140,_0x9314e0,_0x2fa5e0);};exports[_0xe616('0x36')]=function(_0x5b1f50,_0x582a4e){if(!_0x5b1f50['body'][_0xe616('0x21')]){return handleError(_0x582a4e,0x1f4,{'message':_0xe616('0x37')});}var _0x5815d7=rs['generate']();_0x5b1f50['body'][_0xe616('0x21')]=_0x5b1f50['body'][_0xe616('0x21')][_0xe616('0x38')]()[_0xe616('0x39')]();var _0x4173c6;return db[_0xe616('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xe616('0x19'),_0xe616('0xb')],'raw':!![]})[_0xe616('0xc')](function(_0x47e1b4){_0x4173c6=_0x47e1b4;return db[_0xe616('0x3a')][_0xe616('0x3b')]({'where':{'email':_0x5b1f50['body']['email']}});})['then'](function(_0x5346fd){if(!_0x5346fd){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5346fd[_0xe616('0x17')]){throw new Error(_0xe616('0x3c'));}if(_0x5346fd[_0xe616('0x1a')]){if(moment(_0x5346fd[_0xe616('0x11')])[_0xe616('0x1d')](_0x4173c6[_0xe616('0xb')],'minutes')>moment()){throw new Error(_0xe616('0x3d'));}else{_0x5346fd['blocked']=![];_0x5346fd['blockedAt']=null;}}_0x5346fd[_0xe616('0x3e')]=_0x5815d7;_0x5346fd['resetPasswordExpires']=Date[_0xe616('0x3f')]()+0x36ee80;return _0x5346fd[_0xe616('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x5b1f50[_0xe616('0x41')]['email'],'subject':_0xe616('0x42'),'text':_0xe616('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe616('0x44')+_0x5b1f50[_0xe616('0x45')][_0xe616('0x46')]+_0xe616('0x47')+_0x5815d7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x582a4e[_0xe616('0x2e')](0xc8)[_0xe616('0x2f')]({'message':_0xe616('0x48')});})[_0xe616('0x1f')](function(_0x32beec){return handleError(_0x582a4e,0x1f4,_0x32beec);});};exports[_0xe616('0x49')]=function(_0x173d02,_0x5079d8){return db['User'][_0xe616('0x3b')]({'where':{'resetPasswordToken':_0x173d02[_0xe616('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x3abc4d){if(!_0x3abc4d){throw new Error(_0xe616('0x4b'));}return db[_0xe616('0x9')][_0xe616('0xa')]({'attributes':['id',_0xe616('0x4c'),_0xe616('0x4d'),_0xe616('0x4e')]})[_0xe616('0xc')](function(_0x41d766){if(_0x41d766[_0xe616('0x4c')])authService[_0xe616('0x4f')](_0x173d02[_0xe616('0x41')][_0xe616('0xe')]);if(!_0x41d766[_0xe616('0x4d')]||!_0x3abc4d[_0xe616('0x50')])return _0x3abc4d;authService[_0xe616('0x51')](_0x173d02['body'][_0xe616('0xe')],_0x3abc4d['previousPasswords'],_0x41d766['passwordHistoryLimit']);return _0x3abc4d;})[_0xe616('0xc')](function(){_0x3abc4d[_0xe616('0xe')]=_0x173d02[_0xe616('0x41')][_0xe616('0xe')];_0x3abc4d[_0xe616('0x3e')]=null;_0x3abc4d[_0xe616('0x52')]=null;return _0x3abc4d['save']();});})['then'](function(){_0x5079d8[_0xe616('0x2e')](0xc8)[_0xe616('0x2f')]({'message':'Password\x20reset!'});})['catch'](function(_0x1bde4c){return handleError(_0x5079d8,0x1f4,_0x1bde4c);});};passport[_0xe616('0x53')](_0xe616('0x31'),new LocalStrategy({'usernameField':_0xe616('0xd'),'passwordField':_0xe616('0xe')},function(_0x4c58f4,_0x185bca,_0x28a9fc){return localAuthenticate(db['User'],_0x4c58f4,_0x185bca,_0x28a9fc);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 783f780..71084b7 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 _0x9425=['post','login','/forgot','forgot','reset','exports','Router'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9425,0x1db));var _0x5942=function(_0xfad0ef,_0x4a78e0){_0xfad0ef=_0xfad0ef-0x0;var _0x43bde4=_0x9425[_0xfad0ef];return _0x43bde4;};'use strict';var express=require('express');var router=express[_0x5942('0x0')]();var controller=require('./authLocal.controller');router[_0x5942('0x1')]('/',controller[_0x5942('0x2')]);router[_0x5942('0x1')](_0x5942('0x3'),controller[_0x5942('0x4')]);router['post']('/reset/:token',controller[_0x5942('0x5')]);module[_0x5942('0x6')]=router;
\ No newline at end of file
+var _0x0a9c=['post','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x50b9f9,_0x36909f){var _0x5f3d43=function(_0x3bd6f4){while(--_0x3bd6f4){_0x50b9f9['push'](_0x50b9f9['shift']());}};_0x5f3d43(++_0x36909f);}(_0x0a9c,0x1be));var _0xc0a9=function(_0x431aea,_0x405d3a){_0x431aea=_0x431aea-0x0;var _0x27782b=_0x0a9c[_0x431aea];return _0x27782b;};'use strict';var express=require(_0xc0a9('0x0'));var router=express['Router']();var controller=require(_0xc0a9('0x1'));router[_0xc0a9('0x2')]('/',controller['login']);router[_0xc0a9('0x2')](_0xc0a9('0x3'),controller[_0xc0a9('0x4')]);router[_0xc0a9('0x2')](_0xc0a9('0x5'),controller[_0xc0a9('0x6')]);module[_0xc0a9('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 4380ea0..039bf5f 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 _0x1e08=['STRING','BOOLEAN','sequelize','exports'];(function(_0xe5a22,_0x45eca4){var _0x49ef68=function(_0x4b0f62){while(--_0x4b0f62){_0xe5a22['push'](_0xe5a22['shift']());}};_0x49ef68(++_0x45eca4);}(_0x1e08,0xae));var _0x81e0=function(_0x39c745,_0xa4b72a){_0x39c745=_0x39c745-0x0;var _0x3b4c9c=_0x1e08[_0x39c745];return _0x3b4c9c;};'use strict';var Sequelize=require(_0x81e0('0x0'));module[_0x81e0('0x1')]={'name':{'type':Sequelize[_0x81e0('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x81e0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xd9d7=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1cf429,_0x4ec40f){var _0x621bbe=function(_0x28e2f7){while(--_0x28e2f7){_0x1cf429['push'](_0x1cf429['shift']());}};_0x621bbe(++_0x4ec40f);}(_0xd9d7,0x173));var _0x7d9d=function(_0x486efc,_0x1cca6a){_0x486efc=_0x486efc-0x0;var _0x42ae7e=_0xd9d7[_0x486efc];return _0x42ae7e;};'use strict';var Sequelize=require(_0x7d9d('0x0'));module[_0x7d9d('0x1')]={'name':{'type':Sequelize[_0x7d9d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7d9d('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7d9d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7d9d('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 32ad10d..85210d7 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 _0xf7a4=['lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','filters','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','fields','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','sort','filter','addActions','Action','order','pick','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra'];(function(_0x56259d,_0x20aef8){var _0x507ffb=function(_0x200c27){while(--_0x200c27){_0x56259d['push'](_0x56259d['shift']());}};_0x507ffb(++_0x20aef8);}(_0xf7a4,0xf7));var _0x4f7a=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf7a4[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0x4f7a('0x0'));var rimraf=require(_0x4f7a('0x1'));var zipdir=require(_0x4f7a('0x2'));var jsonpatch=require(_0x4f7a('0x3'));var rp=require(_0x4f7a('0x4'));var moment=require(_0x4f7a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f7a('0x6'));var sox=require(_0x4f7a('0x7'));var csv=require(_0x4f7a('0x8'));var ejs=require(_0x4f7a('0x9'));var fs=require('fs');var fs_extra=require(_0x4f7a('0xa'));var _=require(_0x4f7a('0xb'));var squel=require(_0x4f7a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f7a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4f7a('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f7a('0xf'));var authService=require(_0x4f7a('0x10'));var qs=require(_0x4f7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f7a('0x12'));var logger=require(_0x4f7a('0x13'))(_0x4f7a('0x14'));var utils=require(_0x4f7a('0x15'));var config=require(_0x4f7a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f7a('0x17'))['db'];function respondWithStatusCode(_0x118dac,_0x32b573){_0x32b573=_0x32b573||0xcc;return function(_0x447794){if(_0x447794){return _0x118dac[_0x4f7a('0x18')](_0x32b573);}return _0x118dac[_0x4f7a('0x19')](_0x32b573)['end']();};}function respondWithResult(_0x3d2394,_0x179ca1){_0x179ca1=_0x179ca1||0xc8;return function(_0x403062){if(_0x403062){return _0x3d2394[_0x4f7a('0x19')](_0x179ca1)[_0x4f7a('0x1a')](_0x403062);}};}function respondWithFilteredResult(_0x199673,_0x1156ca){return function(_0x3e1956){if(_0x3e1956){var _0x2c514a=typeof _0x1156ca[_0x4f7a('0x1b')]===_0x4f7a('0x1c')&&typeof _0x1156ca['limit']===_0x4f7a('0x1c');var _0x3fee96=_0x3e1956['count'];var _0x2c38ad=_0x2c514a?0x0:_0x1156ca[_0x4f7a('0x1b')];var _0xf040d9=_0x2c514a?_0x3e1956[_0x4f7a('0x1d')]:_0x1156ca[_0x4f7a('0x1b')]+_0x1156ca['limit'];var _0x127b31;if(_0xf040d9>=_0x3fee96){_0xf040d9=_0x3fee96;_0x127b31=0xc8;}else{_0x127b31=0xce;}_0x199673['status'](_0x127b31);return _0x199673[_0x4f7a('0x1e')](_0x4f7a('0x1f'),_0x2c38ad+'-'+_0xf040d9+'/'+_0x3fee96)[_0x4f7a('0x1a')](_0x3e1956);}return null;};}function patchUpdates(_0x294aa9){return function(_0xaa28cb){try{jsonpatch[_0x4f7a('0x20')](_0xaa28cb,_0x294aa9,!![]);}catch(_0x5dbc37){return BPromise[_0x4f7a('0x21')](_0x5dbc37);}return _0xaa28cb['save']();};}function saveUpdates(_0x39c200,_0x9aee9b){return function(_0xa660a3){if(_0xa660a3){return _0xa660a3[_0x4f7a('0x22')](_0x39c200)[_0x4f7a('0x23')](function(_0x2799a8){return _0x2799a8;});}return null;};}function removeEntity(_0x59026b,_0x2f2b15){return function(_0x2e7888){if(_0x2e7888){return _0x2e7888[_0x4f7a('0x24')]()[_0x4f7a('0x23')](function(){_0x59026b['status'](0xcc)[_0x4f7a('0x25')]();});}};}function handleEntityNotFound(_0x3ff6be,_0x501be6){return function(_0x5e34ad){if(!_0x5e34ad){_0x3ff6be[_0x4f7a('0x18')](0x194);}return _0x5e34ad;};}function handleError(_0x4ca0ea,_0x4909eb){_0x4909eb=_0x4909eb||0x1f4;return function(_0x1a5654){logger[_0x4f7a('0x26')](_0x1a5654[_0x4f7a('0x27')]);if(_0x1a5654[_0x4f7a('0x28')]){delete _0x1a5654[_0x4f7a('0x28')];}_0x4ca0ea[_0x4f7a('0x19')](_0x4909eb)[_0x4f7a('0x29')](_0x1a5654);};}exports[_0x4f7a('0x2a')]=function(_0x10c774,_0x11144f){var _0x56c228={},_0x2c0756={},_0x885cfa={'count':0x0,'rows':[]};var _0x5c6fe5=_[_0x4f7a('0x2b')](db[_0x4f7a('0x2c')][_0x4f7a('0x2d')],function(_0x3b5a5a){return{'name':_0x3b5a5a[_0x4f7a('0x2e')],'type':_0x3b5a5a[_0x4f7a('0x2f')][_0x4f7a('0x30')]};});_0x2c0756[_0x4f7a('0x31')]=_[_0x4f7a('0x2b')](_0x5c6fe5,_0x4f7a('0x28'));_0x2c0756[_0x4f7a('0x32')]=_['keys'](_0x10c774[_0x4f7a('0x32')]);_0x2c0756['filters']=_[_0x4f7a('0x33')](_0x2c0756[_0x4f7a('0x31')],_0x2c0756[_0x4f7a('0x32')]);_0x56c228[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x2c0756[_0x4f7a('0x31')],qs['fields'](_0x10c774[_0x4f7a('0x32')]['fields']));_0x56c228['attributes']=_0x56c228[_0x4f7a('0x34')][_0x4f7a('0x35')]?_0x56c228[_0x4f7a('0x34')]:_0x2c0756[_0x4f7a('0x31')];if(!_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x56c228[_0x4f7a('0x38')]=qs['limit'](_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x38')]);_0x56c228[_0x4f7a('0x1b')]=qs[_0x4f7a('0x1b')](_0x10c774[_0x4f7a('0x32')]['offset']);}_0x56c228['order']=qs['sort'](_0x10c774[_0x4f7a('0x32')]['sort']);_0x56c228['where']=qs[_0x4f7a('0x39')](_['pick'](_0x10c774[_0x4f7a('0x32')],_0x2c0756[_0x4f7a('0x39')]),_0x5c6fe5);if(_0x10c774['query']['filter']){_0x56c228[_0x4f7a('0x3a')]=_[_0x4f7a('0x3b')](_0x56c228[_0x4f7a('0x3a')],{'$or':_['map'](_0x5c6fe5,function(_0x7f084b){if(_0x7f084b[_0x4f7a('0x2f')]!==_0x4f7a('0x3c')){var _0x3e14bc={};_0x3e14bc[_0x7f084b[_0x4f7a('0x28')]]={'$like':'%'+_0x10c774[_0x4f7a('0x32')]['filter']+'%'};return _0x3e14bc;}})});}_0x56c228=_[_0x4f7a('0x3b')]({},_0x56c228,_0x10c774[_0x4f7a('0x3d')]);var _0x183dbd={'where':_0x56c228[_0x4f7a('0x3a')]};return db[_0x4f7a('0x2c')][_0x4f7a('0x1d')](_0x183dbd)[_0x4f7a('0x23')](function(_0x54e6df){_0x885cfa[_0x4f7a('0x1d')]=_0x54e6df;if(_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x3e')]){_0x56c228['include']=[{'all':!![]}];}return db['Automation'][_0x4f7a('0x3f')](_0x56c228);})[_0x4f7a('0x23')](function(_0x19ebe7){_0x885cfa['rows']=_0x19ebe7;return _0x885cfa;})[_0x4f7a('0x23')](respondWithFilteredResult(_0x11144f,_0x56c228))[_0x4f7a('0x40')](handleError(_0x11144f,null));};exports[_0x4f7a('0x41')]=function(_0x4a7ee1,_0x426f8f){var _0x54c5e2={'raw':![],'where':{'id':_0x4a7ee1[_0x4f7a('0x42')]['id']}},_0x38fa11={};_0x38fa11[_0x4f7a('0x31')]=_[_0x4f7a('0x43')](db[_0x4f7a('0x2c')][_0x4f7a('0x2d')]);_0x38fa11[_0x4f7a('0x32')]=_['keys'](_0x4a7ee1[_0x4f7a('0x32')]);_0x38fa11['filters']=_[_0x4f7a('0x33')](_0x38fa11['model'],_0x38fa11[_0x4f7a('0x32')]);_0x54c5e2[_0x4f7a('0x34')]=_['intersection'](_0x38fa11[_0x4f7a('0x31')],qs[_0x4f7a('0x44')](_0x4a7ee1[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x54c5e2[_0x4f7a('0x34')]=_0x54c5e2[_0x4f7a('0x34')]['length']?_0x54c5e2['attributes']:_0x38fa11[_0x4f7a('0x31')];if(_0x4a7ee1['query']['includeAll']){_0x54c5e2[_0x4f7a('0x45')]=[{'all':!![]}];}_0x54c5e2=_[_0x4f7a('0x3b')]({},_0x54c5e2,_0x4a7ee1[_0x4f7a('0x3d')]);return db[_0x4f7a('0x2c')][_0x4f7a('0x46')](_0x54c5e2)[_0x4f7a('0x23')](handleEntityNotFound(_0x426f8f,null))[_0x4f7a('0x23')](respondWithResult(_0x426f8f,null))[_0x4f7a('0x40')](handleError(_0x426f8f,null));};exports[_0x4f7a('0x47')]=function(_0x16bb02,_0x13eeb2){return db['Automation'][_0x4f7a('0x47')](_0x16bb02[_0x4f7a('0x48')],{})['then'](respondWithResult(_0x13eeb2,0xc9))['catch'](handleError(_0x13eeb2,null));};exports['update']=function(_0x45276e,_0x171a77){if(_0x45276e['body']['id']){delete _0x45276e[_0x4f7a('0x48')]['id'];}return db[_0x4f7a('0x2c')][_0x4f7a('0x46')]({'where':{'id':_0x45276e['params']['id']}})['then'](handleEntityNotFound(_0x171a77,null))[_0x4f7a('0x23')](saveUpdates(_0x45276e[_0x4f7a('0x48')],null))[_0x4f7a('0x23')](respondWithResult(_0x171a77,null))[_0x4f7a('0x40')](handleError(_0x171a77,null));};exports[_0x4f7a('0x24')]=function(_0x524f25,_0xa3ab19){return db[_0x4f7a('0x2c')][_0x4f7a('0x46')]({'where':{'id':_0x524f25[_0x4f7a('0x42')]['id']}})['then'](handleEntityNotFound(_0xa3ab19,null))[_0x4f7a('0x23')](removeEntity(_0xa3ab19,null))[_0x4f7a('0x40')](handleError(_0xa3ab19,null));};exports[_0x4f7a('0x49')]=function(_0x18919f,_0x1467c2,_0x27f5c3){return db[_0x4f7a('0x4a')][_0x4f7a('0x46')]({'where':{'id':_0x18919f['params']['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x1467c2,null))[_0x4f7a('0x23')](function(_0x62a1c2){if(_0x62a1c2){return _0x62a1c2[_0x4f7a('0x49')](_0x18919f[_0x4f7a('0x48')][_0x4f7a('0x4b')],_[_0x4f7a('0x4c')](_0x18919f[_0x4f7a('0x48')],[_0x4f7a('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x1467c2,null))[_0x4f7a('0x40')](handleError(_0x1467c2,null));};exports[_0x4f7a('0x4d')]=function(_0x101674,_0x345f9a,_0x10cd64){var _0x258fc4={};var _0x70a142={};var _0x2c04d8;var _0x7fd197;return db[_0x4f7a('0x2c')][_0x4f7a('0x4e')]({'where':{'id':_0x101674[_0x4f7a('0x42')]['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x345f9a,null))['then'](function(_0x51c017){if(_0x51c017){_0x2c04d8=_0x51c017;_0x70a142[_0x4f7a('0x31')]=_['keys'](db[_0x4f7a('0x4a')][_0x4f7a('0x2d')]);_0x70a142[_0x4f7a('0x32')]=_[_0x4f7a('0x43')](_0x101674[_0x4f7a('0x32')]);_0x70a142[_0x4f7a('0x39')]=_[_0x4f7a('0x33')](_0x70a142[_0x4f7a('0x31')],_0x70a142['query']);_0x258fc4[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x70a142[_0x4f7a('0x31')],qs[_0x4f7a('0x44')](_0x101674[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x258fc4[_0x4f7a('0x34')]=_0x258fc4[_0x4f7a('0x34')][_0x4f7a('0x35')]?_0x258fc4['attributes']:_0x70a142[_0x4f7a('0x31')];_0x258fc4['order']=qs[_0x4f7a('0x4f')](_0x101674[_0x4f7a('0x32')][_0x4f7a('0x4f')]);_0x258fc4[_0x4f7a('0x3a')]=qs[_0x4f7a('0x39')](_['pick'](_0x101674['query'],_0x70a142['filters']));if(_0x101674[_0x4f7a('0x32')][_0x4f7a('0x50')]){_0x258fc4[_0x4f7a('0x3a')]=_[_0x4f7a('0x3b')](_0x258fc4['where'],{'$or':_[_0x4f7a('0x2b')](_0x258fc4['attributes'],function(_0x222549){var _0x5306be={};_0x5306be[_0x222549]={'$like':'%'+_0x101674[_0x4f7a('0x32')]['filter']+'%'};return _0x5306be;})});}_0x258fc4=_[_0x4f7a('0x3b')]({},_0x258fc4,_0x101674[_0x4f7a('0x3d')]);return _0x2c04d8[_0x4f7a('0x4d')](_0x258fc4);}})['then'](function(_0x8616a9){if(_0x8616a9){_0x7fd197=_0x8616a9[_0x4f7a('0x35')];if(!_0x101674[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x258fc4[_0x4f7a('0x38')]=qs[_0x4f7a('0x38')](_0x101674[_0x4f7a('0x32')]['limit']);_0x258fc4[_0x4f7a('0x1b')]=qs[_0x4f7a('0x1b')](_0x101674[_0x4f7a('0x32')]['offset']);}return _0x2c04d8[_0x4f7a('0x4d')](_0x258fc4);}})['then'](function(_0x2c1916){if(_0x2c1916){return _0x2c1916?{'count':_0x7fd197,'rows':_0x2c1916}:null;}})['then'](respondWithResult(_0x345f9a,null))[_0x4f7a('0x40')](handleError(_0x345f9a,null));};exports[_0x4f7a('0x51')]=function(_0x32c202,_0x3a7ae5,_0x57b16f){return db[_0x4f7a('0x52')][_0x4f7a('0x46')]({'where':{'id':_0x32c202[_0x4f7a('0x42')]['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x3a7ae5,null))[_0x4f7a('0x23')](function(_0x2b0104){if(_0x2b0104){return _0x2b0104[_0x4f7a('0x51')](_0x32c202[_0x4f7a('0x48')][_0x4f7a('0x4b')],_[_0x4f7a('0x4c')](_0x32c202['body'],[_0x4f7a('0x4b'),'id'])||{});}})[_0x4f7a('0x23')](respondWithResult(_0x3a7ae5,null))[_0x4f7a('0x40')](handleError(_0x3a7ae5,null));};exports['getActions']=function(_0xa83e40,_0x290d0b,_0x2585df){var _0x45ab82={};var _0x151e4c={};var _0x2ebdd;var _0x3ca5d6;return db['Automation']['findOne']({'where':{'id':_0xa83e40['params']['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x290d0b,null))['then'](function(_0x105549){if(_0x105549){_0x2ebdd=_0x105549;_0x151e4c[_0x4f7a('0x31')]=_[_0x4f7a('0x43')](db[_0x4f7a('0x52')][_0x4f7a('0x2d')]);_0x151e4c[_0x4f7a('0x32')]=_[_0x4f7a('0x43')](_0xa83e40[_0x4f7a('0x32')]);_0x151e4c[_0x4f7a('0x39')]=_[_0x4f7a('0x33')](_0x151e4c['model'],_0x151e4c['query']);_0x45ab82[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x151e4c[_0x4f7a('0x31')],qs['fields'](_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x45ab82[_0x4f7a('0x34')]=_0x45ab82['attributes'][_0x4f7a('0x35')]?_0x45ab82[_0x4f7a('0x34')]:_0x151e4c[_0x4f7a('0x31')];_0x45ab82[_0x4f7a('0x53')]=qs[_0x4f7a('0x4f')](_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x4f')]);_0x45ab82[_0x4f7a('0x3a')]=qs['filters'](_[_0x4f7a('0x54')](_0xa83e40[_0x4f7a('0x32')],_0x151e4c[_0x4f7a('0x39')]));if(_0xa83e40[_0x4f7a('0x32')]['filter']){_0x45ab82['where']=_[_0x4f7a('0x3b')](_0x45ab82[_0x4f7a('0x3a')],{'$or':_[_0x4f7a('0x2b')](_0x45ab82['attributes'],function(_0x11bc52){var _0x589244={};_0x589244[_0x11bc52]={'$like':'%'+_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x50')]+'%'};return _0x589244;})});}_0x45ab82=_['merge']({},_0x45ab82,_0xa83e40[_0x4f7a('0x3d')]);return _0x2ebdd[_0x4f7a('0x55')](_0x45ab82);}})[_0x4f7a('0x23')](function(_0x66e603){if(_0x66e603){_0x3ca5d6=_0x66e603['length'];if(!_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x45ab82[_0x4f7a('0x38')]=qs[_0x4f7a('0x38')](_0xa83e40['query'][_0x4f7a('0x38')]);_0x45ab82[_0x4f7a('0x1b')]=qs['offset'](_0xa83e40['query']['offset']);}return _0x2ebdd[_0x4f7a('0x55')](_0x45ab82);}})[_0x4f7a('0x23')](function(_0x57c9a4){if(_0x57c9a4){return _0x57c9a4?{'count':_0x3ca5d6,'rows':_0x57c9a4}:null;}})[_0x4f7a('0x23')](respondWithResult(_0x290d0b,null))[_0x4f7a('0x40')](handleError(_0x290d0b,null));};
\ No newline at end of file
+var _0x7c6a=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','addConditions','ids','omit','getConditions','Condition','length','addActions','Action','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3b6cc2,_0x2bbb89){var _0x292300=function(_0x3f02bf){while(--_0x3f02bf){_0x3b6cc2['push'](_0x3b6cc2['shift']());}};_0x292300(++_0x2bbb89);}(_0x7c6a,0x1eb));var _0xa7c6=function(_0x2ea6fe,_0x549575){_0x2ea6fe=_0x2ea6fe-0x0;var _0x368a32=_0x7c6a[_0x2ea6fe];return _0x368a32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7c6('0x0'));var zipdir=require(_0xa7c6('0x1'));var jsonpatch=require(_0xa7c6('0x2'));var rp=require(_0xa7c6('0x3'));var moment=require('moment');var BPromise=require(_0xa7c6('0x4'));var Mustache=require(_0xa7c6('0x5'));var util=require(_0xa7c6('0x6'));var path=require(_0xa7c6('0x7'));var sox=require(_0xa7c6('0x8'));var csv=require(_0xa7c6('0x9'));var ejs=require(_0xa7c6('0xa'));var fs=require('fs');var fs_extra=require(_0xa7c6('0xb'));var _=require(_0xa7c6('0xc'));var squel=require(_0xa7c6('0xd'));var crypto=require(_0xa7c6('0xe'));var jsforce=require(_0xa7c6('0xf'));var deskjs=require(_0xa7c6('0x10'));var toCsv=require(_0xa7c6('0x9'));var querystring=require(_0xa7c6('0x11'));var Papa=require(_0xa7c6('0x12'));var Redis=require('ioredis');var authService=require(_0xa7c6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa7c6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa7c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa7c6('0x16'));var db=require(_0xa7c6('0x17'))['db'];function respondWithStatusCode(_0x16f7d0,_0x101ff3){_0x101ff3=_0x101ff3||0xcc;return function(_0x3379af){if(_0x3379af){return _0x16f7d0[_0xa7c6('0x18')](_0x101ff3);}return _0x16f7d0[_0xa7c6('0x19')](_0x101ff3)['end']();};}function respondWithResult(_0x25ba92,_0x477448){_0x477448=_0x477448||0xc8;return function(_0x5af902){if(_0x5af902){return _0x25ba92['status'](_0x477448)[_0xa7c6('0x1a')](_0x5af902);}};}function respondWithFilteredResult(_0x565bf9,_0x8eec6){return function(_0x2be04f){if(_0x2be04f){var _0x47d8ae=typeof _0x8eec6['offset']===_0xa7c6('0x1b')&&typeof _0x8eec6[_0xa7c6('0x1c')]==='undefined';var _0x3cd46a=_0x2be04f[_0xa7c6('0x1d')];var _0x36b97d=_0x47d8ae?0x0:_0x8eec6['offset'];var _0x3c77a8=_0x47d8ae?_0x2be04f[_0xa7c6('0x1d')]:_0x8eec6[_0xa7c6('0x1e')]+_0x8eec6[_0xa7c6('0x1c')];var _0x19fd91;if(_0x3c77a8>=_0x3cd46a){_0x3c77a8=_0x3cd46a;_0x19fd91=0xc8;}else{_0x19fd91=0xce;}_0x565bf9['status'](_0x19fd91);return _0x565bf9[_0xa7c6('0x1f')]('Content-Range',_0x36b97d+'-'+_0x3c77a8+'/'+_0x3cd46a)[_0xa7c6('0x1a')](_0x2be04f);}return null;};}function patchUpdates(_0x21f20f){return function(_0x33a359){try{jsonpatch['apply'](_0x33a359,_0x21f20f,!![]);}catch(_0xb7c7a7){return BPromise[_0xa7c6('0x20')](_0xb7c7a7);}return _0x33a359['save']();};}function saveUpdates(_0x1a2b9c,_0x5dadda){return function(_0x236c28){if(_0x236c28){return _0x236c28[_0xa7c6('0x21')](_0x1a2b9c)[_0xa7c6('0x22')](function(_0x423c1a){return _0x423c1a;});}return null;};}function removeEntity(_0x44cb77,_0x4ab6ea){return function(_0x3fee84){if(_0x3fee84){return _0x3fee84[_0xa7c6('0x23')]()[_0xa7c6('0x22')](function(){_0x44cb77[_0xa7c6('0x19')](0xcc)[_0xa7c6('0x24')]();});}};}function handleEntityNotFound(_0x2909a0,_0x32bd68){return function(_0x327dbd){if(!_0x327dbd){_0x2909a0[_0xa7c6('0x18')](0x194);}return _0x327dbd;};}function handleError(_0x5ebcab,_0x31335d){_0x31335d=_0x31335d||0x1f4;return function(_0x4a8abb){logger[_0xa7c6('0x25')](_0x4a8abb[_0xa7c6('0x26')]);if(_0x4a8abb[_0xa7c6('0x27')]){delete _0x4a8abb['name'];}_0x5ebcab['status'](_0x31335d)[_0xa7c6('0x28')](_0x4a8abb);};}exports[_0xa7c6('0x29')]=function(_0x143068,_0xacd8ff){var _0x3ee0e8={},_0x38c092={},_0x121365={'count':0x0,'rows':[]};var _0xba3c3f=_[_0xa7c6('0x2a')](db[_0xa7c6('0x2b')]['rawAttributes'],function(_0x13e01f){return{'name':_0x13e01f[_0xa7c6('0x2c')],'type':_0x13e01f[_0xa7c6('0x2d')][_0xa7c6('0x2e')]};});_0x38c092[_0xa7c6('0x2f')]=_[_0xa7c6('0x2a')](_0xba3c3f,'name');_0x38c092[_0xa7c6('0x30')]=_[_0xa7c6('0x31')](_0x143068[_0xa7c6('0x30')]);_0x38c092[_0xa7c6('0x32')]=_['intersection'](_0x38c092[_0xa7c6('0x2f')],_0x38c092[_0xa7c6('0x30')]);_0x3ee0e8[_0xa7c6('0x33')]=_[_0xa7c6('0x34')](_0x38c092['model'],qs[_0xa7c6('0x35')](_0x143068['query'][_0xa7c6('0x35')]));_0x3ee0e8['attributes']=_0x3ee0e8[_0xa7c6('0x33')]['length']?_0x3ee0e8[_0xa7c6('0x33')]:_0x38c092[_0xa7c6('0x2f')];if(!_0x143068[_0xa7c6('0x30')][_0xa7c6('0x36')](_0xa7c6('0x37'))){_0x3ee0e8[_0xa7c6('0x1c')]=qs[_0xa7c6('0x1c')](_0x143068[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0x3ee0e8[_0xa7c6('0x1e')]=qs['offset'](_0x143068[_0xa7c6('0x30')][_0xa7c6('0x1e')]);}_0x3ee0e8[_0xa7c6('0x38')]=qs[_0xa7c6('0x39')](_0x143068['query'][_0xa7c6('0x39')]);_0x3ee0e8[_0xa7c6('0x3a')]=qs['filters'](_[_0xa7c6('0x3b')](_0x143068[_0xa7c6('0x30')],_0x38c092['filters']),_0xba3c3f);if(_0x143068[_0xa7c6('0x30')][_0xa7c6('0x3c')]){_0x3ee0e8[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0x3ee0e8[_0xa7c6('0x3a')],{'$or':_['map'](_0xba3c3f,function(_0x3a808c){if(_0x3a808c[_0xa7c6('0x2d')]!==_0xa7c6('0x3e')){var _0xcefaab={};_0xcefaab[_0x3a808c[_0xa7c6('0x27')]]={'$like':'%'+_0x143068[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0xcefaab;}})});}_0x3ee0e8=_[_0xa7c6('0x3d')]({},_0x3ee0e8,_0x143068[_0xa7c6('0x3f')]);var _0x4c7375={'where':_0x3ee0e8['where']};return db[_0xa7c6('0x2b')][_0xa7c6('0x1d')](_0x4c7375)[_0xa7c6('0x22')](function(_0x3c834b){_0x121365[_0xa7c6('0x1d')]=_0x3c834b;if(_0x143068[_0xa7c6('0x30')][_0xa7c6('0x40')]){_0x3ee0e8[_0xa7c6('0x41')]=[{'all':!![]}];}return db['Automation'][_0xa7c6('0x42')](_0x3ee0e8);})[_0xa7c6('0x22')](function(_0x540d68){_0x121365['rows']=_0x540d68;return _0x121365;})[_0xa7c6('0x22')](respondWithFilteredResult(_0xacd8ff,_0x3ee0e8))[_0xa7c6('0x43')](handleError(_0xacd8ff,null));};exports[_0xa7c6('0x44')]=function(_0x5c6619,_0x286c15){var _0x460610={'raw':![],'where':{'id':_0x5c6619[_0xa7c6('0x45')]['id']}},_0x2f2cc={};_0x2f2cc[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x2b')][_0xa7c6('0x46')]);_0x2f2cc['query']=_[_0xa7c6('0x31')](_0x5c6619['query']);_0x2f2cc['filters']=_[_0xa7c6('0x34')](_0x2f2cc['model'],_0x2f2cc[_0xa7c6('0x30')]);_0x460610[_0xa7c6('0x33')]=_[_0xa7c6('0x34')](_0x2f2cc['model'],qs[_0xa7c6('0x35')](_0x5c6619['query'][_0xa7c6('0x35')]));_0x460610[_0xa7c6('0x33')]=_0x460610[_0xa7c6('0x33')]['length']?_0x460610[_0xa7c6('0x33')]:_0x2f2cc[_0xa7c6('0x2f')];if(_0x5c6619[_0xa7c6('0x30')][_0xa7c6('0x40')]){_0x460610[_0xa7c6('0x41')]=[{'all':!![]}];}_0x460610=_['merge']({},_0x460610,_0x5c6619[_0xa7c6('0x3f')]);return db[_0xa7c6('0x2b')]['find'](_0x460610)[_0xa7c6('0x22')](handleEntityNotFound(_0x286c15,null))[_0xa7c6('0x22')](respondWithResult(_0x286c15,null))[_0xa7c6('0x43')](handleError(_0x286c15,null));};exports[_0xa7c6('0x47')]=function(_0x4066ad,_0x357e12){return db[_0xa7c6('0x2b')][_0xa7c6('0x47')](_0x4066ad['body'],{})[_0xa7c6('0x22')](respondWithResult(_0x357e12,0xc9))['catch'](handleError(_0x357e12,null));};exports[_0xa7c6('0x21')]=function(_0x44b984,_0x273b44){if(_0x44b984[_0xa7c6('0x48')]['id']){delete _0x44b984[_0xa7c6('0x48')]['id'];}return db[_0xa7c6('0x2b')][_0xa7c6('0x49')]({'where':{'id':_0x44b984[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x273b44,null))[_0xa7c6('0x22')](saveUpdates(_0x44b984['body'],null))['then'](respondWithResult(_0x273b44,null))[_0xa7c6('0x43')](handleError(_0x273b44,null));};exports[_0xa7c6('0x23')]=function(_0x406471,_0x24908a){return db[_0xa7c6('0x2b')][_0xa7c6('0x49')]({'where':{'id':_0x406471[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x24908a,null))['then'](removeEntity(_0x24908a,null))[_0xa7c6('0x43')](handleError(_0x24908a,null));};exports[_0xa7c6('0x4a')]=function(_0x299f33,_0x488fd9,_0x5967d8){return db['Condition'][_0xa7c6('0x49')]({'where':{'id':_0x299f33[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x488fd9,null))['then'](function(_0x162937){if(_0x162937){return _0x162937['addConditions'](_0x299f33[_0xa7c6('0x48')][_0xa7c6('0x4b')],_[_0xa7c6('0x4c')](_0x299f33[_0xa7c6('0x48')],['ids','id'])||{});}})[_0xa7c6('0x22')](respondWithResult(_0x488fd9,null))[_0xa7c6('0x43')](handleError(_0x488fd9,null));};exports[_0xa7c6('0x4d')]=function(_0x58e949,_0x354309,_0x25835d){var _0x3983c5={};var _0x262d7b={};var _0x5267d1;var _0x381406;return db['Automation']['findOne']({'where':{'id':_0x58e949[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x354309,null))[_0xa7c6('0x22')](function(_0x3dcade){if(_0x3dcade){_0x5267d1=_0x3dcade;_0x262d7b[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x4e')][_0xa7c6('0x46')]);_0x262d7b['query']=_[_0xa7c6('0x31')](_0x58e949[_0xa7c6('0x30')]);_0x262d7b[_0xa7c6('0x32')]=_['intersection'](_0x262d7b[_0xa7c6('0x2f')],_0x262d7b[_0xa7c6('0x30')]);_0x3983c5[_0xa7c6('0x33')]=_['intersection'](_0x262d7b[_0xa7c6('0x2f')],qs[_0xa7c6('0x35')](_0x58e949['query'][_0xa7c6('0x35')]));_0x3983c5[_0xa7c6('0x33')]=_0x3983c5[_0xa7c6('0x33')][_0xa7c6('0x4f')]?_0x3983c5[_0xa7c6('0x33')]:_0x262d7b['model'];_0x3983c5['order']=qs['sort'](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x39')]);_0x3983c5[_0xa7c6('0x3a')]=qs[_0xa7c6('0x32')](_[_0xa7c6('0x3b')](_0x58e949[_0xa7c6('0x30')],_0x262d7b[_0xa7c6('0x32')]));if(_0x58e949['query'][_0xa7c6('0x3c')]){_0x3983c5[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0x3983c5[_0xa7c6('0x3a')],{'$or':_[_0xa7c6('0x2a')](_0x3983c5['attributes'],function(_0x14dfbf){var _0x557ed2={};_0x557ed2[_0x14dfbf]={'$like':'%'+_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0x557ed2;})});}_0x3983c5=_['merge']({},_0x3983c5,_0x58e949[_0xa7c6('0x3f')]);return _0x5267d1['getConditions'](_0x3983c5);}})[_0xa7c6('0x22')](function(_0x3b70ff){if(_0x3b70ff){_0x381406=_0x3b70ff[_0xa7c6('0x4f')];if(!_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x36')](_0xa7c6('0x37'))){_0x3983c5[_0xa7c6('0x1c')]=qs[_0xa7c6('0x1c')](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0x3983c5[_0xa7c6('0x1e')]=qs[_0xa7c6('0x1e')](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x1e')]);}return _0x5267d1[_0xa7c6('0x4d')](_0x3983c5);}})['then'](function(_0x3a251f){if(_0x3a251f){return _0x3a251f?{'count':_0x381406,'rows':_0x3a251f}:null;}})[_0xa7c6('0x22')](respondWithResult(_0x354309,null))[_0xa7c6('0x43')](handleError(_0x354309,null));};exports[_0xa7c6('0x50')]=function(_0x5e5380,_0x1d111c,_0x4bee17){return db[_0xa7c6('0x51')]['find']({'where':{'id':_0x5e5380[_0xa7c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d111c,null))[_0xa7c6('0x22')](function(_0x4fb82a){if(_0x4fb82a){return _0x4fb82a[_0xa7c6('0x50')](_0x5e5380[_0xa7c6('0x48')][_0xa7c6('0x4b')],_[_0xa7c6('0x4c')](_0x5e5380[_0xa7c6('0x48')],[_0xa7c6('0x4b'),'id'])||{});}})[_0xa7c6('0x22')](respondWithResult(_0x1d111c,null))[_0xa7c6('0x43')](handleError(_0x1d111c,null));};exports[_0xa7c6('0x52')]=function(_0x157a1f,_0x2d6aaf,_0x1fb5aa){var _0xc4c53a={};var _0x530137={};var _0x198822;var _0x3ba8dd;return db[_0xa7c6('0x2b')][_0xa7c6('0x53')]({'where':{'id':_0x157a1f[_0xa7c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d6aaf,null))[_0xa7c6('0x22')](function(_0x19fe84){if(_0x19fe84){_0x198822=_0x19fe84;_0x530137[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x51')][_0xa7c6('0x46')]);_0x530137[_0xa7c6('0x30')]=_['keys'](_0x157a1f[_0xa7c6('0x30')]);_0x530137[_0xa7c6('0x32')]=_[_0xa7c6('0x34')](_0x530137[_0xa7c6('0x2f')],_0x530137['query']);_0xc4c53a[_0xa7c6('0x33')]=_['intersection'](_0x530137[_0xa7c6('0x2f')],qs['fields'](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x35')]));_0xc4c53a[_0xa7c6('0x33')]=_0xc4c53a[_0xa7c6('0x33')][_0xa7c6('0x4f')]?_0xc4c53a[_0xa7c6('0x33')]:_0x530137[_0xa7c6('0x2f')];_0xc4c53a['order']=qs[_0xa7c6('0x39')](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x39')]);_0xc4c53a['where']=qs[_0xa7c6('0x32')](_[_0xa7c6('0x3b')](_0x157a1f[_0xa7c6('0x30')],_0x530137[_0xa7c6('0x32')]));if(_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x3c')]){_0xc4c53a[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0xc4c53a[_0xa7c6('0x3a')],{'$or':_[_0xa7c6('0x2a')](_0xc4c53a['attributes'],function(_0x44ba21){var _0xfd7f33={};_0xfd7f33[_0x44ba21]={'$like':'%'+_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0xfd7f33;})});}_0xc4c53a=_[_0xa7c6('0x3d')]({},_0xc4c53a,_0x157a1f[_0xa7c6('0x3f')]);return _0x198822[_0xa7c6('0x52')](_0xc4c53a);}})['then'](function(_0xd762a8){if(_0xd762a8){_0x3ba8dd=_0xd762a8[_0xa7c6('0x4f')];if(!_0x157a1f[_0xa7c6('0x30')]['hasOwnProperty']('nolimit')){_0xc4c53a['limit']=qs['limit'](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0xc4c53a[_0xa7c6('0x1e')]=qs[_0xa7c6('0x1e')](_0x157a1f['query']['offset']);}return _0x198822[_0xa7c6('0x52')](_0xc4c53a);}})[_0xa7c6('0x22')](function(_0x519b1f){if(_0x519b1f){return _0x519b1f?{'count':_0x3ba8dd,'rows':_0x519b1f}:null;}})[_0xa7c6('0x22')](respondWithResult(_0x2d6aaf,null))[_0xa7c6('0x43')](handleError(_0x2d6aaf,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index dfcf1b7..a16de99 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 _0x78b1=['./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x78b1,0x1d3));var _0x178b=function(_0x3a50de,_0x1654be){_0x3a50de=_0x3a50de-0x0;var _0x5b205f=_0x78b1[_0x3a50de];return _0x5b205f;};'use strict';var _=require(_0x178b('0x0'));var util=require(_0x178b('0x1'));var logger=require('../../config/logger')(_0x178b('0x2'));var moment=require(_0x178b('0x3'));var BPromise=require(_0x178b('0x4'));var rp=require(_0x178b('0x5'));var fs=require('fs');var path=require(_0x178b('0x6'));var rimraf=require(_0x178b('0x7'));var config=require(_0x178b('0x8'));var attributes=require(_0x178b('0x9'));module[_0x178b('0xa')]=function(_0x29b052,_0x59aad5){return _0x29b052[_0x178b('0xb')](_0x178b('0xc'),attributes,{'tableName':_0x178b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f85=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_automations','util'];(function(_0x2700cd,_0x499355){var _0x351be3=function(_0x34eba9){while(--_0x34eba9){_0x2700cd['push'](_0x2700cd['shift']());}};_0x351be3(++_0x499355);}(_0x8f85,0x1cb));var _0x58f8=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x8f85[_0x2235bf];return _0x4c3a64;};'use strict';var _=require('lodash');var util=require(_0x58f8('0x0'));var logger=require(_0x58f8('0x1'))('api');var moment=require(_0x58f8('0x2'));var BPromise=require(_0x58f8('0x3'));var rp=require(_0x58f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58f8('0x5'));var config=require(_0x58f8('0x6'));var attributes=require('./automation.attributes');module[_0x58f8('0x7')]=function(_0x1700ae,_0x299f67){return _0x1700ae[_0x58f8('0x8')]('Automation',attributes,{'tableName':_0x58f8('0x9'),'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 97b8468..043230e 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 _0xc17d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x38d45b,_0x54c034){var _0x112c3d=function(_0x48713b){while(--_0x48713b){_0x38d45b['push'](_0x38d45b['shift']());}};_0x112c3d(++_0x54c034);}(_0xc17d,0x96));var _0xdc17=function(_0x2026b5,_0x3c9568){_0x2026b5=_0x2026b5-0x0;var _0x1fc628=_0xc17d[_0x2026b5];return _0x1fc628;};'use strict';var _=require(_0xdc17('0x0'));var util=require(_0xdc17('0x1'));var moment=require(_0xdc17('0x2'));var BPromise=require(_0xdc17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc17('0x4'));var db=require(_0xdc17('0x5'))['db'];var utils=require(_0xdc17('0x6'));var logger=require(_0xdc17('0x7'))('rpc');var config=require(_0xdc17('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52a11b,_0x16ac50,_0x373463){return new BPromise(function(_0x53143d,_0x5ccdc5){return client[_0xdc17('0xa')](_0x52a11b,_0x373463)[_0xdc17('0xb')](function(_0x17c626){logger[_0xdc17('0xc')](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));logger[_0xdc17('0xf')](_0xdc17('0x10'),_0x16ac50,'request\x20sent',JSON[_0xdc17('0x11')](_0x17c626));if(_0x17c626[_0xdc17('0x12')]){if(_0x17c626[_0xdc17('0x12')]['code']===0x1f4){logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);return _0x5ccdc5(_0x17c626['error'][_0xdc17('0x13')]);}logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')]['message']);return _0x53143d(_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);}else{logger['info'](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));_0x53143d(_0x17c626[_0xdc17('0x14')][_0xdc17('0x13')]);}})[_0xdc17('0x15')](function(_0x3adc90){logger['error'](_0xdc17('0xd'),_0x16ac50,_0x3adc90);_0x5ccdc5(_0x3adc90);});});}
\ No newline at end of file
+var _0x8d62=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x463303,_0x1c9593){var _0x412845=function(_0x150cb7){while(--_0x150cb7){_0x463303['push'](_0x463303['shift']());}};_0x412845(++_0x1c9593);}(_0x8d62,0xf8));var _0x28d6=function(_0xd41060,_0x119def){_0xd41060=_0xd41060-0x0;var _0xe8029f=_0x8d62[_0xd41060];return _0xe8029f;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var moment=require(_0x28d6('0x1'));var BPromise=require(_0x28d6('0x2'));var rs=require(_0x28d6('0x3'));var fs=require('fs');var Redis=require(_0x28d6('0x4'));var db=require(_0x28d6('0x5'))['db'];var utils=require(_0x28d6('0x6'));var logger=require(_0x28d6('0x7'))(_0x28d6('0x8'));var config=require(_0x28d6('0x9'));var jayson=require(_0x28d6('0xa'));var client=jayson[_0x28d6('0xb')][_0x28d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe8aa7b,_0x5c8a27,_0x1d5399){return new BPromise(function(_0xb9dccb,_0x3f3235){return client['request'](_0xe8aa7b,_0x1d5399)[_0x28d6('0xd')](function(_0x4b564f){logger[_0x28d6('0xe')](_0x28d6('0xf'),_0x5c8a27,_0x28d6('0x10'));logger[_0x28d6('0x11')](_0x28d6('0x12'),_0x5c8a27,'request\x20sent',JSON[_0x28d6('0x13')](_0x4b564f));if(_0x4b564f[_0x28d6('0x14')]){if(_0x4b564f[_0x28d6('0x14')][_0x28d6('0x15')]===0x1f4){logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f[_0x28d6('0x14')][_0x28d6('0x16')]);return _0x3f3235(_0x4b564f['error'][_0x28d6('0x16')]);}logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f['error'][_0x28d6('0x16')]);return _0xb9dccb(_0x4b564f['error'][_0x28d6('0x16')]);}else{logger[_0x28d6('0xe')]('Automation,\x20%s,\x20%s',_0x5c8a27,_0x28d6('0x10'));_0xb9dccb(_0x4b564f[_0x28d6('0x17')][_0x28d6('0x16')]);}})[_0x28d6('0x18')](function(_0x154c4d){logger['error'](_0x28d6('0xf'),_0x5c8a27,_0x154c4d);_0x3f3235(_0x154c4d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 89deec8..69b0b79 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 _0xd51f=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','put','update','destroy','exports'];(function(_0x4b4154,_0x38a122){var _0x340ed7=function(_0x1250b9){while(--_0x1250b9){_0x4b4154['push'](_0x4b4154['shift']());}};_0x340ed7(++_0x38a122);}(_0xd51f,0xf0));var _0xfd51=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd51f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var path=require('path');var timeout=require(_0xfd51('0x2'));var express=require(_0xfd51('0x3'));var router=express['Router']();var fs_extra=require(_0xfd51('0x4'));var auth=require(_0xfd51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfd51('0x6'));var controller=require(_0xfd51('0x7'));router['get']('/',auth[_0xfd51('0x8')](),controller[_0xfd51('0x9')]);router['get'](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0xb')]);router[_0xfd51('0xc')](_0xfd51('0xd'),auth['isAuthenticated'](),controller[_0xfd51('0xe')]);router[_0xfd51('0xc')](_0xfd51('0xf'),auth['isAuthenticated'](),controller[_0xfd51('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfd51('0x11')]);router[_0xfd51('0x12')](_0xfd51('0xd'),auth['isAuthenticated'](),controller['addConditions']);router['post'](_0xfd51('0xf'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x13')]);router[_0xfd51('0x14')](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x15')]);router['delete'](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x16')]);module[_0xfd51('0x17')]=router;
\ No newline at end of file
+var _0x7846=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','/:id','destroy'];(function(_0x567259,_0x3c3241){var _0x36a775=function(_0x288b94){while(--_0x288b94){_0x567259['push'](_0x567259['shift']());}};_0x36a775(++_0x3c3241);}(_0x7846,0xf4));var _0x6784=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x7846[_0x186376];return _0x2dbdd9;};'use strict';var multer=require('multer');var util=require(_0x6784('0x0'));var path=require(_0x6784('0x1'));var timeout=require(_0x6784('0x2'));var express=require(_0x6784('0x3'));var router=express[_0x6784('0x4')]();var fs_extra=require(_0x6784('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6784('0x6'));var config=require(_0x6784('0x7'));var controller=require(_0x6784('0x8'));router[_0x6784('0x9')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0xb')]);router[_0x6784('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6784('0xc')]);router[_0x6784('0x9')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0xe')]);router[_0x6784('0x9')](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x10')]);router[_0x6784('0x11')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0x12')]);router[_0x6784('0x11')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0x13')]);router['post'](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x14')]);router[_0x6784('0x15')]('/:id',auth[_0x6784('0xa')](),controller[_0x6784('0x16')]);router[_0x6784('0x17')](_0x6784('0x18'),auth[_0x6784('0xa')](),controller[_0x6784('0x19')]);module[_0x6784('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 3ae0510..05d092b 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 _0x42e2=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','Random\x20Last\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)','#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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x27f406,_0x4729e2){var _0x5e42f1=function(_0x537d9a){while(--_0x537d9a){_0x27f406['push'](_0x27f406['shift']());}};_0x5e42f1(++_0x4729e2);}(_0x42e2,0xee));var _0x242e=function(_0x30a52c,_0x2f47a3){_0x30a52c=_0x30a52c-0x0;var _0x4e4e36=_0x42e2[_0x30a52c];return _0x4e4e36;};'use strict';var Sequelize=require(_0x242e('0x0'));module[_0x242e('0x1')]={'name':{'type':Sequelize[_0x242e('0x2')],'unique':_0x242e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x242e('0x4')](_0x242e('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x242e('0x2')]},'active':{'type':Sequelize[_0x242e('0x6')],'defaultValue':0x0,'comment':_0x242e('0x7')},'limitCalls':{'type':Sequelize[_0x242e('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x242e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x242e('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x242e('0x2')],'defaultValue':_0x242e('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x242e('0x11'),'never',_0x242e('0x12')),'defaultValue':_0x242e('0x11')},'dialAMDActive':{'type':Sequelize[_0x242e('0x6')],'defaultValue':0x0,'comment':_0x242e('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x242e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x242e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x242e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x242e('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x242e('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x242e('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x242e('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x242e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x242e('0x4')]('DESC',_0x242e('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x242e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x242e('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x24')}};
\ No newline at end of file
+var _0x51c5=['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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x51c5,0xc8));var _0x551c=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x51c5[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x551c('0x0')],'unique':_0x551c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x551c('0x2')](_0x551c('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x551c('0x0')]},'active':{'type':Sequelize[_0x551c('0x4')],'defaultValue':0x0,'comment':_0x551c('0x5')},'limitCalls':{'type':Sequelize[_0x551c('0x6')](0x4)[_0x551c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x551c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x551c('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x551c('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x551c('0xf')},'dialTimezone':{'type':Sequelize[_0x551c('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x551c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x551c('0x2')]('always','never',_0x551c('0x11')),'defaultValue':_0x551c('0x12')},'dialAMDActive':{'type':Sequelize[_0x551c('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x551c('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x551c('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x551c('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x551c('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x551c('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x551c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x551c('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x551c('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x551c('0x1a'),'ASC'),'defaultValue':_0x551c('0x1a')},'dialPrefix':{'type':Sequelize[_0x551c('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x551c('0x1b')},'dialCutDigit':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x551c('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index d7c12e4..7689197 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 _0xa9e1=['sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','includeAll','rows','catch','params','keys','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','getHoppers','CmHopper','hasOwnProperty','nolimit','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','phone','scheduledAt','ListId','select','NOW()','ContactId','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','cm_contacts','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','format','sequelize','removeBlackLists','CmHopperBlack','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../config/license/util'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xa9e1[_0x4a7843];return _0x2c57fe;};'use strict';var emlformat=require(_0x1a9e('0x0'));var rimraf=require(_0x1a9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a9e('0x2'));var rp=require(_0x1a9e('0x3'));var moment=require(_0x1a9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a9e('0x5'));var util=require('util');var path=require(_0x1a9e('0x6'));var sox=require('sox');var csv=require(_0x1a9e('0x7'));var ejs=require(_0x1a9e('0x8'));var fs=require('fs');var fs_extra=require(_0x1a9e('0x9'));var _=require(_0x1a9e('0xa'));var squel=require(_0x1a9e('0xb'));var crypto=require(_0x1a9e('0xc'));var jsforce=require(_0x1a9e('0xd'));var deskjs=require(_0x1a9e('0xe'));var toCsv=require(_0x1a9e('0x7'));var querystring=require(_0x1a9e('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a9e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a9e('0x11'));var logger=require('../../config/logger')(_0x1a9e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ac0e,_0x4f6319){_0x4f6319=_0x4f6319||0xcc;return function(_0xe41277){if(_0xe41277){return _0x27ac0e[_0x1a9e('0x14')](_0x4f6319);}return _0x27ac0e[_0x1a9e('0x15')](_0x4f6319)[_0x1a9e('0x16')]();};}function respondWithResult(_0x6cf4d0,_0x1ac5aa){_0x1ac5aa=_0x1ac5aa||0xc8;return function(_0x39c1c0){if(_0x39c1c0){return _0x6cf4d0[_0x1a9e('0x15')](_0x1ac5aa)['json'](_0x39c1c0);}};}function respondWithFilteredResult(_0x2beade,_0x1a9aed){return function(_0x3d51bd){if(_0x3d51bd){var _0x3540d=typeof _0x1a9aed[_0x1a9e('0x17')]==='undefined'&&typeof _0x1a9aed[_0x1a9e('0x18')]===_0x1a9e('0x19');var _0xfe073f=_0x3d51bd['count'];var _0x44f39e=_0x3540d?0x0:_0x1a9aed[_0x1a9e('0x17')];var _0x3869cb=_0x3540d?_0x3d51bd[_0x1a9e('0x1a')]:_0x1a9aed[_0x1a9e('0x17')]+_0x1a9aed[_0x1a9e('0x18')];var _0x52df94;if(_0x3869cb>=_0xfe073f){_0x3869cb=_0xfe073f;_0x52df94=0xc8;}else{_0x52df94=0xce;}_0x2beade[_0x1a9e('0x15')](_0x52df94);return _0x2beade[_0x1a9e('0x1b')](_0x1a9e('0x1c'),_0x44f39e+'-'+_0x3869cb+'/'+_0xfe073f)[_0x1a9e('0x1d')](_0x3d51bd);}return null;};}function patchUpdates(_0x89a640){return function(_0x19d859){try{jsonpatch[_0x1a9e('0x1e')](_0x19d859,_0x89a640,!![]);}catch(_0x106385){return BPromise['reject'](_0x106385);}return _0x19d859[_0x1a9e('0x1f')]();};}function saveUpdates(_0x3e517e,_0x10ab8a){return function(_0x194778){if(_0x194778){return _0x194778[_0x1a9e('0x20')](_0x3e517e)[_0x1a9e('0x21')](function(_0x19b3d7){return _0x19b3d7;});}return null;};}function removeEntity(_0x2f8ed6,_0x21aa68){return function(_0x5cbf91){if(_0x5cbf91){return _0x5cbf91[_0x1a9e('0x22')]()['then'](function(){var _0xc219de=_0x5cbf91[_0x1a9e('0x23')]({'plain':!![]});var _0x2953ac=_0x1a9e('0x24');return db[_0x1a9e('0x25')][_0x1a9e('0x22')]({'where':{'type':_0x2953ac,'resourceId':_0xc219de['id']}})[_0x1a9e('0x21')](function(){return _0x5cbf91;});})['then'](function(){_0x2f8ed6[_0x1a9e('0x15')](0xcc)[_0x1a9e('0x16')]();});}};}function handleEntityNotFound(_0x49af1a,_0x50a176){return function(_0x439f32){if(!_0x439f32){_0x49af1a[_0x1a9e('0x14')](0x194);}return _0x439f32;};}function handleError(_0x2a51b8,_0x1dbdb0){_0x1dbdb0=_0x1dbdb0||0x1f4;return function(_0x44b3df){logger[_0x1a9e('0x26')](_0x44b3df[_0x1a9e('0x27')]);if(_0x44b3df[_0x1a9e('0x28')]){delete _0x44b3df[_0x1a9e('0x28')];}_0x2a51b8[_0x1a9e('0x15')](_0x1dbdb0)[_0x1a9e('0x29')](_0x44b3df);};}exports[_0x1a9e('0x2a')]=function(_0x265f8d,_0x443707){var _0x5d6d05={},_0x1c78ba={},_0x4ffaec={'count':0x0,'rows':[]};var _0x1d6ee5=_[_0x1a9e('0x2b')](db[_0x1a9e('0x2c')][_0x1a9e('0x2d')],function(_0x2a95c3){return{'name':_0x2a95c3[_0x1a9e('0x2e')],'type':_0x2a95c3['type'][_0x1a9e('0x2f')]};});_0x1c78ba[_0x1a9e('0x30')]=_[_0x1a9e('0x2b')](_0x1d6ee5,_0x1a9e('0x28'));_0x1c78ba[_0x1a9e('0x31')]=_['keys'](_0x265f8d[_0x1a9e('0x31')]);_0x1c78ba[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x1c78ba[_0x1a9e('0x30')],_0x1c78ba[_0x1a9e('0x31')]);_0x5d6d05['attributes']=_['intersection'](_0x1c78ba['model'],qs[_0x1a9e('0x34')](_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x5d6d05['attributes']=_0x5d6d05[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x5d6d05[_0x1a9e('0x35')]:_0x1c78ba[_0x1a9e('0x30')];if(!_0x265f8d[_0x1a9e('0x31')]['hasOwnProperty']('nolimit')){_0x5d6d05[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x265f8d[_0x1a9e('0x31')]['limit']);_0x5d6d05['offset']=qs[_0x1a9e('0x17')](_0x265f8d[_0x1a9e('0x31')]['offset']);}_0x5d6d05[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x265f8d['query'][_0x1a9e('0x38')]);_0x5d6d05[_0x1a9e('0x39')]=qs['filters'](_[_0x1a9e('0x3a')](_0x265f8d[_0x1a9e('0x31')],_0x1c78ba[_0x1a9e('0x32')]),_0x1d6ee5);if(_0x265f8d['query'][_0x1a9e('0x3b')]){_0x5d6d05['where']=_[_0x1a9e('0x3c')](_0x5d6d05[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x1d6ee5,function(_0x2b682b){if(_0x2b682b[_0x1a9e('0x3d')]!=='VIRTUAL'){var _0x4cdc2a={};_0x4cdc2a[_0x2b682b[_0x1a9e('0x28')]]={'$like':'%'+_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x4cdc2a;}})});}_0x5d6d05=_[_0x1a9e('0x3c')]({},_0x5d6d05,_0x265f8d['options']);var _0x3a08ec={'where':_0x5d6d05[_0x1a9e('0x39')]};return db[_0x1a9e('0x2c')][_0x1a9e('0x1a')](_0x3a08ec)[_0x1a9e('0x21')](function(_0xeb3e58){_0x4ffaec[_0x1a9e('0x1a')]=_0xeb3e58;if(_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x5d6d05['include']=[{'all':!![]}];}return db[_0x1a9e('0x2c')]['findAll'](_0x5d6d05);})[_0x1a9e('0x21')](function(_0x124c86){_0x4ffaec[_0x1a9e('0x3f')]=_0x124c86;return _0x4ffaec;})[_0x1a9e('0x21')](respondWithFilteredResult(_0x443707,_0x5d6d05))[_0x1a9e('0x40')](handleError(_0x443707,null));};exports['show']=function(_0x1f6702,_0x4b7c49){var _0x18d25a={'raw':![],'where':{'id':_0x1f6702[_0x1a9e('0x41')]['id']}},_0x65f153={};_0x65f153['model']=_[_0x1a9e('0x42')](db[_0x1a9e('0x2c')]['rawAttributes']);_0x65f153[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x1f6702[_0x1a9e('0x31')]);_0x65f153[_0x1a9e('0x32')]=_['intersection'](_0x65f153[_0x1a9e('0x30')],_0x65f153[_0x1a9e('0x31')]);_0x18d25a[_0x1a9e('0x35')]=_['intersection'](_0x65f153[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x1f6702[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x18d25a[_0x1a9e('0x35')]=_0x18d25a[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x18d25a[_0x1a9e('0x35')]:_0x65f153[_0x1a9e('0x30')];if(_0x1f6702[_0x1a9e('0x31')]['includeAll']){_0x18d25a[_0x1a9e('0x43')]=[{'all':!![]}];}_0x18d25a=_[_0x1a9e('0x3c')]({},_0x18d25a,_0x1f6702[_0x1a9e('0x44')]);return db[_0x1a9e('0x2c')]['find'](_0x18d25a)[_0x1a9e('0x21')](handleEntityNotFound(_0x4b7c49,null))[_0x1a9e('0x21')](respondWithResult(_0x4b7c49,null))[_0x1a9e('0x40')](handleError(_0x4b7c49,null));};exports[_0x1a9e('0x45')]=function(_0x29133e,_0x231526){return db[_0x1a9e('0x2c')][_0x1a9e('0x45')](_0x29133e[_0x1a9e('0x46')],{})['then'](function(_0x351fa){var _0x5aed8e=_0x29133e['user'][_0x1a9e('0x23')]({'plain':!![]});if(!_0x5aed8e)throw new Error(_0x1a9e('0x47'));if(_0x5aed8e[_0x1a9e('0x48')]===_0x1a9e('0x49')){var _0xe6025e=_0x351fa[_0x1a9e('0x23')]({'plain':!![]});var _0x2e9f38='IvrCampaigns';return db[_0x1a9e('0x4a')][_0x1a9e('0x4b')]({'where':{'name':_0x2e9f38,'userProfileId':_0x5aed8e[_0x1a9e('0x4c')]},'raw':!![]})[_0x1a9e('0x21')](function(_0x3859ff){if(_0x3859ff&&_0x3859ff['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a9e('0x45')]({'name':_0xe6025e['name'],'resourceId':_0xe6025e['id'],'type':_0x3859ff['name'],'sectionId':_0x3859ff['id']},{})[_0x1a9e('0x21')](function(){return _0x351fa;});}else{return _0x351fa;}})[_0x1a9e('0x40')](function(_0x399336){logger[_0x1a9e('0x26')](_0x1a9e('0x4d'),_0x399336);throw _0x399336;});}return _0x351fa;})['then'](respondWithResult(_0x231526,0xc9))['catch'](handleError(_0x231526,null));};exports['clone']=function(_0x2721f3,_0x5f4b5e){var _0x378d32={'where':{'id':_0x2721f3['params']['id']}},_0x29c208={};_0x29c208[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x2c')][_0x1a9e('0x2d')]);_0x378d32['attributes']=_[_0x1a9e('0x33')](_0x29c208[_0x1a9e('0x30')],qs['fields'](_0x2721f3[_0x1a9e('0x31')]['fields']));_0x378d32[_0x1a9e('0x35')]=_0x378d32[_0x1a9e('0x35')]['length']?_0x378d32[_0x1a9e('0x35')]:_0x29c208[_0x1a9e('0x30')];if(_0x2721f3[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x378d32[_0x1a9e('0x43')]=[{'all':!![]}];}_0x378d32=_[_0x1a9e('0x3c')]({},_0x378d32,_0x2721f3[_0x1a9e('0x44')]);return db[_0x1a9e('0x2c')]['find'](_0x378d32)[_0x1a9e('0x21')](handleEntityNotFound(_0x5f4b5e,null))[_0x1a9e('0x21')](function(_0x31e420){if(_0x31e420){var _0x197a85=_0x31e420[_0x1a9e('0x23')]({'plain':!![]});_0x197a85=qs['omit'](_0x197a85,['id',_0x1a9e('0x4e'),_0x1a9e('0x4f')]);_0x2721f3[_0x1a9e('0x46')]=_['omit'](_0x2721f3[_0x1a9e('0x46')],['id',_0x1a9e('0x4e'),_0x1a9e('0x4f')]);return db[_0x1a9e('0x2c')]['create'](_[_0x1a9e('0x3c')](_0x197a85,_0x2721f3['body']),{'include':_0x2721f3[_0x1a9e('0x31')][_0x1a9e('0x3e')]?[{'all':!![]}]:undefined})[_0x1a9e('0x21')](function(_0x5b4b98){var _0x3d3792=_0x2721f3[_0x1a9e('0x49')]['get']({'plain':!![]});if(!_0x3d3792)throw new Error(_0x1a9e('0x47'));if(_0x3d3792[_0x1a9e('0x48')]===_0x1a9e('0x49')){var _0x16f55b=_0x5b4b98[_0x1a9e('0x23')]({'plain':!![]});var _0x2dcb44=_0x1a9e('0x24');return db[_0x1a9e('0x4a')]['find']({'where':{'name':_0x2dcb44,'userProfileId':_0x3d3792[_0x1a9e('0x4c')]},'raw':!![]})[_0x1a9e('0x21')](function(_0x5ebf9e){if(_0x5ebf9e&&_0x5ebf9e['autoAssociation']===0x0){return db[_0x1a9e('0x25')][_0x1a9e('0x45')]({'name':_0x16f55b[_0x1a9e('0x28')],'resourceId':_0x16f55b['id'],'type':_0x5ebf9e[_0x1a9e('0x28')],'sectionId':_0x5ebf9e['id']},{})['then'](function(){return _0x5b4b98;});}else{return _0x5b4b98;}})['catch'](function(_0x37e53c){logger[_0x1a9e('0x26')](_0x1a9e('0x4d'),_0x37e53c);throw _0x37e53c;});}return _0x5b4b98;});}})[_0x1a9e('0x21')](respondWithResult(_0x5f4b5e,0xc9))[_0x1a9e('0x40')](handleError(_0x5f4b5e,null));};exports['update']=function(_0x496fa1,_0x12522f){if(_0x496fa1[_0x1a9e('0x46')]['id']){delete _0x496fa1[_0x1a9e('0x46')]['id'];}return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x496fa1[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x12522f,null))['then'](saveUpdates(_0x496fa1['body'],null))['then'](respondWithResult(_0x12522f,null))[_0x1a9e('0x40')](handleError(_0x12522f,null));};exports['destroy']=function(_0x373391,_0x39fda0){return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x373391['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x39fda0,null))[_0x1a9e('0x21')](removeEntity(_0x39fda0,null))[_0x1a9e('0x40')](handleError(_0x39fda0,null));};exports[_0x1a9e('0x50')]=function(_0x9d48d4,_0x4b0b62,_0x5d37f1){var _0x5c4b28={'raw':!![],'where':{}};var _0x50ec82={};var _0x4df20c={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x9d48d4['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x4b0b62,null))[_0x1a9e('0x21')](function(_0x54d456){if(_0x54d456){_0x50ec82[_0x1a9e('0x30')]=_['keys'](db[_0x1a9e('0x51')][_0x1a9e('0x2d')]);_0x50ec82[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x9d48d4[_0x1a9e('0x31')]);_0x50ec82[_0x1a9e('0x32')]=_['intersection'](_0x50ec82['model'],_0x50ec82[_0x1a9e('0x31')]);_0x5c4b28[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x50ec82[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x9d48d4[_0x1a9e('0x31')]['fields']));_0x5c4b28[_0x1a9e('0x35')]=_0x5c4b28[_0x1a9e('0x35')]['length']?_0x5c4b28['attributes']:_0x50ec82[_0x1a9e('0x30')];if(!_0x9d48d4['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x5c4b28[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x9d48d4[_0x1a9e('0x31')]['limit']);_0x5c4b28[_0x1a9e('0x17')]=qs['offset'](_0x9d48d4['query'][_0x1a9e('0x17')]);}_0x5c4b28['order']=qs['sort'](_0x9d48d4['query'][_0x1a9e('0x38')]);_0x5c4b28[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_['pick'](_0x9d48d4[_0x1a9e('0x31')],_0x50ec82[_0x1a9e('0x32')]));_0x5c4b28['where'][_0x1a9e('0x54')]=_0x54d456['id'];if(_0x9d48d4[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x5c4b28[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x5c4b28[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x5c4b28[_0x1a9e('0x35')],function(_0x4c345c){var _0x4ec68d={};_0x4ec68d[_0x4c345c]={'$like':'%'+_0x9d48d4[_0x1a9e('0x31')]['filter']+'%'};return _0x4ec68d;})});}_0x5c4b28=_[_0x1a9e('0x3c')]({},_0x5c4b28,_0x9d48d4['options']);return db['CmHopper'][_0x1a9e('0x1a')]({'where':_0x5c4b28[_0x1a9e('0x39')]})[_0x1a9e('0x21')](function(_0x1cb819){_0x4df20c['count']=_0x1cb819;if(_0x9d48d4['query'][_0x1a9e('0x3e')]){_0x5c4b28['include']=[{'all':!![]}];}return db[_0x1a9e('0x51')][_0x1a9e('0x55')](_0x5c4b28);})['then'](function(_0x311861){_0x4df20c[_0x1a9e('0x3f')]=_0x311861;return _0x4df20c;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x4b0b62,_0x5c4b28))[_0x1a9e('0x40')](handleError(_0x4b0b62,null));};exports[_0x1a9e('0x56')]=function(_0x4e2d83,_0x7a08d1,_0x104d08){var _0x45c2e1={'raw':!![],'where':{}};var _0x23a3d8={};var _0x3a83b5={'count':0x0,'rows':[]};return db[_0x1a9e('0x2c')][_0x1a9e('0x57')]({'where':{'id':_0x4e2d83[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x7a08d1,null))[_0x1a9e('0x21')](function(_0x26daed){if(_0x26daed){_0x23a3d8[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x58')][_0x1a9e('0x2d')]);_0x23a3d8[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x4e2d83[_0x1a9e('0x31')]);_0x23a3d8[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x23a3d8[_0x1a9e('0x30')],_0x23a3d8[_0x1a9e('0x31')]);_0x45c2e1[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x23a3d8['model'],qs[_0x1a9e('0x34')](_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x45c2e1['attributes']=_0x45c2e1['attributes'][_0x1a9e('0x36')]?_0x45c2e1[_0x1a9e('0x35')]:_0x23a3d8[_0x1a9e('0x30')];if(!_0x4e2d83[_0x1a9e('0x31')]['hasOwnProperty'](_0x1a9e('0x53'))){_0x45c2e1[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x4e2d83['query'][_0x1a9e('0x18')]);_0x45c2e1['offset']=qs['offset'](_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x17')]);}_0x45c2e1[_0x1a9e('0x37')]=qs['sort'](_0x4e2d83[_0x1a9e('0x31')]['sort']);_0x45c2e1[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_['pick'](_0x4e2d83['query'],_0x23a3d8['filters']));_0x45c2e1['where']['CampaignId']=_0x26daed['id'];if(_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x45c2e1[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x45c2e1[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x45c2e1[_0x1a9e('0x35')],function(_0x13781d){var _0x3ab007={};_0x3ab007[_0x13781d]={'$like':'%'+_0x4e2d83['query']['filter']+'%'};return _0x3ab007;})});}_0x45c2e1=_['merge']({},_0x45c2e1,_0x4e2d83[_0x1a9e('0x44')]);return db[_0x1a9e('0x58')][_0x1a9e('0x1a')]({'where':_0x45c2e1['where']})['then'](function(_0x19724c){_0x3a83b5['count']=_0x19724c;if(_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x45c2e1[_0x1a9e('0x43')]=[{'all':!![]}];}return db[_0x1a9e('0x58')][_0x1a9e('0x55')](_0x45c2e1);})[_0x1a9e('0x21')](function(_0x34dc0d){_0x3a83b5[_0x1a9e('0x3f')]=_0x34dc0d;return _0x3a83b5;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x7a08d1,_0x45c2e1))[_0x1a9e('0x40')](handleError(_0x7a08d1,null));};exports['getHopperFinals']=function(_0xa109ff,_0x43425c,_0x1924bf){var _0x25932d={'raw':!![],'where':{}};var _0x4c9869={};var _0x4431c3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xa109ff[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x43425c,null))['then'](function(_0x4b5c3e){if(_0x4b5c3e){_0x4c9869[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x59')][_0x1a9e('0x2d')]);_0x4c9869['query']=_[_0x1a9e('0x42')](_0xa109ff['query']);_0x4c9869[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x4c9869[_0x1a9e('0x30')],_0x4c9869[_0x1a9e('0x31')]);_0x25932d['attributes']=_[_0x1a9e('0x33')](_0x4c9869[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x25932d[_0x1a9e('0x35')]=_0x25932d[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x25932d[_0x1a9e('0x35')]:_0x4c9869[_0x1a9e('0x30')];if(!_0xa109ff[_0x1a9e('0x31')]['hasOwnProperty'](_0x1a9e('0x53'))){_0x25932d[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x25932d[_0x1a9e('0x17')]=qs[_0x1a9e('0x17')](_0xa109ff['query'][_0x1a9e('0x17')]);}_0x25932d['order']=qs[_0x1a9e('0x38')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x25932d[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0xa109ff[_0x1a9e('0x31')],_0x4c9869['filters']));_0x25932d['where'][_0x1a9e('0x54')]=_0x4b5c3e['id'];if(_0xa109ff['query'][_0x1a9e('0x3b')]){_0x25932d[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x25932d[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x25932d[_0x1a9e('0x35')],function(_0x1ad3ef){var _0x1afdef={};_0x1afdef[_0x1ad3ef]={'$like':'%'+_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x1afdef;})});}_0x25932d=_[_0x1a9e('0x3c')]({},_0x25932d,_0xa109ff[_0x1a9e('0x44')]);return db[_0x1a9e('0x59')]['count']({'where':_0x25932d[_0x1a9e('0x39')]})[_0x1a9e('0x21')](function(_0x28acee){_0x4431c3[_0x1a9e('0x1a')]=_0x28acee;if(_0xa109ff['query'][_0x1a9e('0x3e')]){_0x25932d[_0x1a9e('0x43')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x25932d);})[_0x1a9e('0x21')](function(_0x3e4a7c){_0x4431c3[_0x1a9e('0x3f')]=_0x3e4a7c;return _0x4431c3;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x43425c,_0x25932d))[_0x1a9e('0x40')](handleError(_0x43425c,null));};exports[_0x1a9e('0x5a')]=function(_0x26a41f,_0x31677f,_0x4f5897){var _0x562699={'raw':!![],'where':{}};var _0x1cc333={};var _0xfae220={'count':0x0,'rows':[]};return db['Campaign'][_0x1a9e('0x57')]({'where':{'id':_0x26a41f[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x31677f,null))['then'](function(_0x39c52f){if(_0x39c52f){_0x1cc333[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db['CmHopperBlack']['rawAttributes']);_0x1cc333[_0x1a9e('0x31')]=_['keys'](_0x26a41f[_0x1a9e('0x31')]);_0x1cc333['filters']=_[_0x1a9e('0x33')](_0x1cc333[_0x1a9e('0x30')],_0x1cc333[_0x1a9e('0x31')]);_0x562699[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x1cc333[_0x1a9e('0x30')],qs['fields'](_0x26a41f['query'][_0x1a9e('0x34')]));_0x562699[_0x1a9e('0x35')]=_0x562699[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x562699['attributes']:_0x1cc333[_0x1a9e('0x30')];if(!_0x26a41f['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x562699[_0x1a9e('0x18')]=qs['limit'](_0x26a41f['query'][_0x1a9e('0x18')]);_0x562699['offset']=qs[_0x1a9e('0x17')](_0x26a41f['query']['offset']);}_0x562699[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x26a41f[_0x1a9e('0x31')]['sort']);_0x562699['where']=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x26a41f[_0x1a9e('0x31')],_0x1cc333[_0x1a9e('0x32')]));_0x562699[_0x1a9e('0x39')]['CampaignId']=_0x39c52f['id'];if(_0x26a41f[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x562699['where']=_[_0x1a9e('0x3c')](_0x562699['where'],{'$or':_[_0x1a9e('0x2b')](_0x562699['attributes'],function(_0x4ff1be){var _0x3e4216={};_0x3e4216[_0x4ff1be]={'$like':'%'+_0x26a41f['query']['filter']+'%'};return _0x3e4216;})});}_0x562699=_['merge']({},_0x562699,_0x26a41f['options']);return db['CmHopperBlack']['count']({'where':_0x562699['where']})['then'](function(_0x13f201){_0xfae220['count']=_0x13f201;if(_0x26a41f['query'][_0x1a9e('0x3e')]){_0x562699[_0x1a9e('0x43')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x562699);})['then'](function(_0x15ffc7){_0xfae220[_0x1a9e('0x3f')]=_0x15ffc7;return _0xfae220;});}})['then'](respondWithFilteredResult(_0x31677f,_0x562699))[_0x1a9e('0x40')](handleError(_0x31677f,null));};exports['getLists']=function(_0x345df3,_0x5719a9,_0x97d2c1){var _0x161acd={};var _0x21f5b3={};var _0x46679d;var _0x264e95;return db[_0x1a9e('0x2c')][_0x1a9e('0x57')]({'where':{'id':_0x345df3['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x5719a9,null))['then'](function(_0x517c29){if(_0x517c29){_0x46679d=_0x517c29;_0x21f5b3['model']=_[_0x1a9e('0x42')](db[_0x1a9e('0x5b')][_0x1a9e('0x2d')]);_0x21f5b3['query']=_[_0x1a9e('0x42')](_0x345df3['query']);_0x21f5b3['filters']=_[_0x1a9e('0x33')](_0x21f5b3[_0x1a9e('0x30')],_0x21f5b3[_0x1a9e('0x31')]);_0x161acd[_0x1a9e('0x35')]=_['intersection'](_0x21f5b3[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x161acd[_0x1a9e('0x35')]=_0x161acd['attributes']['length']?_0x161acd[_0x1a9e('0x35')]:_0x21f5b3[_0x1a9e('0x30')];_0x161acd[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x161acd['where']=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x345df3[_0x1a9e('0x31')],_0x21f5b3[_0x1a9e('0x32')]));if(_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x161acd[_0x1a9e('0x39')]=_['merge'](_0x161acd[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x161acd['attributes'],function(_0x1d7b11){var _0x1f8a95={};_0x1f8a95[_0x1d7b11]={'$like':'%'+_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x1f8a95;})});}_0x161acd=_[_0x1a9e('0x3c')]({},_0x161acd,_0x345df3[_0x1a9e('0x44')]);return _0x46679d[_0x1a9e('0x5c')](_0x161acd);}})['then'](function(_0x316d5c){if(_0x316d5c){_0x264e95=_0x316d5c['length'];if(!_0x345df3['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x161acd[_0x1a9e('0x18')]=qs['limit'](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x161acd['offset']=qs[_0x1a9e('0x17')](_0x345df3[_0x1a9e('0x31')]['offset']);}return _0x46679d[_0x1a9e('0x5c')](_0x161acd);}})['then'](function(_0x418772){if(_0x418772){return _0x418772?{'count':_0x264e95,'rows':_0x418772}:null;}})[_0x1a9e('0x21')](respondWithResult(_0x5719a9,null))[_0x1a9e('0x40')](handleError(_0x5719a9,null));};exports['addLists']=function(_0x54c5b0,_0x456e72,_0x5a4355){var _0x465470,_0x11c6a2;var _0x84b6ab=[];var _0x262599=moment()['format'](_0x1a9e('0x5d'));return db[_0x1a9e('0x2c')][_0x1a9e('0x4b')]({'where':{'id':_0x54c5b0['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x456e72,null))['then'](function(_0x3ee3a0){if(_0x3ee3a0){_0x11c6a2=_0x3ee3a0;return _0x3ee3a0[_0x1a9e('0x5e')](_0x54c5b0[_0x1a9e('0x46')][_0x1a9e('0x5f')],_[_0x1a9e('0x60')](_0x54c5b0[_0x1a9e('0x46')],['ids','id'])||{});}return null;})[_0x1a9e('0x61')](function(_0xbc8cdf){var _0x5d22f5;var _0x4e532f;_0x465470=_0xbc8cdf||[];var _0x4125a0=[];if(_0xbc8cdf){for(var _0x3dd97e=0x0;_0x3dd97e<_0xbc8cdf['length'];_0x3dd97e+=0x1){var _0x36051d=_0xbc8cdf[_0x3dd97e][_0x1a9e('0x23')]({'plain':!![]});_0x11c6a2[_0x1a9e('0x62')]=_0x54c5b0[_0x1a9e('0x46')][_0x1a9e('0x62')]?_0x54c5b0[_0x1a9e('0x46')]['dialCheckDuplicateType']:_0x11c6a2['dialCheckDuplicateType'];switch(_0x11c6a2[_0x1a9e('0x62')]){case _0x1a9e('0x63'):_0x5d22f5=squel[_0x1a9e('0x64')]()['into']('cm_hopper')['fromQuery']([_0x1a9e('0x65'),_0x1a9e('0x66'),'ContactId',_0x1a9e('0x67'),_0x1a9e('0x54'),'createdAt','updatedAt'],squel[_0x1a9e('0x68')]()['field'](_0x1a9e('0x65'),_0x1a9e('0x65'))['field'](_0x1a9e('0x69'),_0x1a9e('0x66'))['field']('id',_0x1a9e('0x6a'))[_0x1a9e('0x6b')](_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),_0x1a9e('0x67'))['field'](_0x54c5b0['params']['id']['toString'](),_0x1a9e('0x54'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contacts')[_0x1a9e('0x39')](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d['CmListId']['toString']())[_0x1a9e('0x39')](_0x1a9e('0x71'))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x1a9e('0x6e')](_0x1a9e('0x73'))[_0x1a9e('0x39')]('CampaignId\x20=\x20?',_0x54c5b0[_0x1a9e('0x41')]['id']['toString']()))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()['field'](_0x1a9e('0x74'))['from'](_0x1a9e('0x75'))[_0x1a9e('0x39')](_0x1a9e('0x76'),_0x54c5b0[_0x1a9e('0x41')]['id']['toString']())))[_0x1a9e('0x6d')]();break;case _0x1a9e('0x77'):_0x5d22f5=squel[_0x1a9e('0x64')]()[_0x1a9e('0x78')](_0x1a9e('0x75'))[_0x1a9e('0x79')]([_0x1a9e('0x65'),'scheduledAt',_0x1a9e('0x6a'),_0x1a9e('0x67'),'CampaignId',_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),_0x1a9e('0x66'))['field']('id',_0x1a9e('0x6a'))[_0x1a9e('0x6b')](_0x36051d['CmListId'][_0x1a9e('0x6d')](),_0x1a9e('0x67'))[_0x1a9e('0x6b')](_0x54c5b0[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27','updatedAt')['from'](_0x1a9e('0x7a'))[_0x1a9e('0x39')](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d['CmListId'][_0x1a9e('0x6d')]())['where'](_0x1a9e('0x71'))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()['field']('COALESCE(phone,\x27\x27)')[_0x1a9e('0x6e')](_0x1a9e('0x75'))[_0x1a9e('0x39')](_0x1a9e('0x76'),_0x54c5b0[_0x1a9e('0x41')]['id']['toString']())))['toString']();break;default:_0x5d22f5=squel['insert']()[_0x1a9e('0x78')](_0x1a9e('0x75'))[_0x1a9e('0x79')]([_0x1a9e('0x65'),_0x1a9e('0x66'),'ContactId','ListId',_0x1a9e('0x54'),_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),'scheduledAt')[_0x1a9e('0x6b')]('id','ContactId')[_0x1a9e('0x6b')](_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),'ListId')[_0x1a9e('0x6b')](_0x54c5b0[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))['from'](_0x1a9e('0x7a'))['where'](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d[_0x1a9e('0x6c')]['toString']())['where'](_0x1a9e('0x71')))[_0x1a9e('0x6d')]();}_0x4e532f=squel[_0x1a9e('0x64')]()['into']('cm_hopper_additional_phones')[_0x1a9e('0x79')]([_0x1a9e('0x7b'),'scheduledAt',_0x1a9e('0x65'),_0x1a9e('0x7c'),_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x7d'),'id')[_0x1a9e('0x6b')](_0x1a9e('0x69'),'scheduledAt')['field'](_0x1a9e('0x7e'),'phone')[_0x1a9e('0x6b')](_0x1a9e('0x7f'),'OrderBy')[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contact_has_items','ci')[_0x1a9e('0x80')](_0x1a9e('0x75'),'h',_0x1a9e('0x81'))[_0x1a9e('0x39')](_0x1a9e('0x82'),_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')]())[_0x1a9e('0x39')](_0x1a9e('0x83'),_0x54c5b0['params']['id'][_0x1a9e('0x6d')]())[_0x1a9e('0x39')](_0x1a9e('0x84'),_0x262599))[_0x1a9e('0x6d')]();_0x4125a0[_0x1a9e('0x85')](db['sequelize'][_0x1a9e('0x31')](_0x5d22f5));_0x84b6ab[_0x1a9e('0x85')](db['sequelize'][_0x1a9e('0x31')](_0x4e532f));}return BPromise[_0x1a9e('0x86')](_0x4125a0);}})[_0x1a9e('0x21')](function(){return BPromise[_0x1a9e('0x86')](_0x84b6ab);})['then'](function(){return _0x465470;})['then'](respondWithResult(_0x456e72,null))[_0x1a9e('0x40')](handleError(_0x456e72,null));};exports[_0x1a9e('0x87')]=function(_0x4d4554,_0x515a18,_0x285919){return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x4d4554['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x515a18,null))[_0x1a9e('0x21')](function(_0x241ce8){if(_0x241ce8){return _0x241ce8[_0x1a9e('0x87')](_0x4d4554[_0x1a9e('0x31')]['ids']);}})[_0x1a9e('0x21')](function(_0x55c022){if(_0x55c022){return db[_0x1a9e('0x51')][_0x1a9e('0x22')]({'where':{'ListId':_0x4d4554[_0x1a9e('0x31')][_0x1a9e('0x5f')],'CampaignId':_0x4d4554[_0x1a9e('0x41')]['id']}})['then'](function(){return _0x55c022;});}})[_0x1a9e('0x21')](respondWithStatusCode(_0x515a18,null))[_0x1a9e('0x40')](handleError(_0x515a18,null));};exports[_0x1a9e('0x88')]=function(_0x3991f7,_0x294a12,_0x361397){var _0x201c1e={};var _0x58d48b={};var _0x3d4bc6;var _0x27d2ec;return db[_0x1a9e('0x2c')]['findOne']({'where':{'id':_0x3991f7[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x294a12,null))['then'](function(_0x4aeae5){if(_0x4aeae5){_0x3d4bc6=_0x4aeae5;_0x58d48b[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x5b')][_0x1a9e('0x2d')]);_0x58d48b['query']=_[_0x1a9e('0x42')](_0x3991f7['query']);_0x58d48b[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x58d48b[_0x1a9e('0x30')],_0x58d48b[_0x1a9e('0x31')]);_0x201c1e['attributes']=_['intersection'](_0x58d48b[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x201c1e[_0x1a9e('0x35')]=_0x201c1e[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x201c1e[_0x1a9e('0x35')]:_0x58d48b[_0x1a9e('0x30')];_0x201c1e[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x201c1e[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x3991f7['query'],_0x58d48b[_0x1a9e('0x32')]));if(_0x3991f7[_0x1a9e('0x31')]['filter']){_0x201c1e[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x201c1e['where'],{'$or':_[_0x1a9e('0x2b')](_0x201c1e['attributes'],function(_0x1ad2ba){var _0x27997c={};_0x27997c[_0x1ad2ba]={'$like':'%'+_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x27997c;})});}_0x201c1e=_[_0x1a9e('0x3c')]({},_0x201c1e,_0x3991f7[_0x1a9e('0x44')]);return _0x3d4bc6[_0x1a9e('0x88')](_0x201c1e);}})[_0x1a9e('0x21')](function(_0xe01180){if(_0xe01180){_0x27d2ec=_0xe01180[_0x1a9e('0x36')];if(!_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x52')]('nolimit')){_0x201c1e['limit']=qs[_0x1a9e('0x18')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x201c1e[_0x1a9e('0x17')]=qs[_0x1a9e('0x17')](_0x3991f7['query'][_0x1a9e('0x17')]);}return _0x3d4bc6['getBlackLists'](_0x201c1e);}})[_0x1a9e('0x21')](function(_0x41b24a){if(_0x41b24a){return _0x41b24a?{'count':_0x27d2ec,'rows':_0x41b24a}:null;}})[_0x1a9e('0x21')](respondWithResult(_0x294a12,null))[_0x1a9e('0x40')](handleError(_0x294a12,null));};exports[_0x1a9e('0x89')]=function(_0x4676ed,_0x5179c3,_0x45f827){var _0x17698b,_0x28a7a1;var _0x47cbba=[];var _0x669bd9=moment()[_0x1a9e('0x8a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1a9e('0x2c')]['find']({'where':{'id':_0x4676ed[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x5179c3,null))[_0x1a9e('0x21')](function(_0x395165){if(_0x395165){_0x28a7a1=_0x395165;return _0x395165[_0x1a9e('0x89')](_0x4676ed[_0x1a9e('0x46')][_0x1a9e('0x5f')],_['omit'](_0x4676ed[_0x1a9e('0x46')],['ids','id'])||{});}return null;})[_0x1a9e('0x61')](function(_0x3ab65c){var _0x48b127;var _0x46ccdc;_0x17698b=_0x3ab65c||[];var _0x3a8863=[];if(_0x3ab65c){for(var _0x55b1fa=0x0;_0x55b1fa<_0x3ab65c['length'];_0x55b1fa+=0x1){var _0x362770=_0x3ab65c[_0x55b1fa]['get']({'plain':!![]});_0x48b127=squel['insert']()['into']('cm_hopper_black')['fromQuery'](['phone','ContactId','ListId',_0x1a9e('0x54'),'createdAt',_0x1a9e('0x4f')],squel['select']()['field'](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')]('id',_0x1a9e('0x6a'))['field'](_0x362770[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),'ListId')[_0x1a9e('0x6b')](_0x4676ed[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),'createdAt')[_0x1a9e('0x6b')](_0x1a9e('0x69'),_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contacts')[_0x1a9e('0x39')](_0x1a9e('0x6f'))['where'](_0x1a9e('0x70'),_0x362770[_0x1a9e('0x6c')]['toString']())[_0x1a9e('0x39')](_0x1a9e('0x71')))[_0x1a9e('0x6d')]();_0x3a8863[_0x1a9e('0x85')](db[_0x1a9e('0x8b')][_0x1a9e('0x31')](_0x48b127));}return BPromise['all'](_0x3a8863);}})[_0x1a9e('0x21')](function(){return _0x17698b;})['then'](respondWithResult(_0x5179c3,null))['catch'](handleError(_0x5179c3,null));};exports['removeBlackLists']=function(_0x4840ac,_0xe6fc97,_0x44ec3e){return db[_0x1a9e('0x2c')][_0x1a9e('0x4b')]({'where':{'id':_0x4840ac[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0xe6fc97,null))[_0x1a9e('0x21')](function(_0x268211){if(_0x268211){return _0x268211[_0x1a9e('0x8c')](_0x4840ac[_0x1a9e('0x31')]['ids']);}})[_0x1a9e('0x21')](function(_0x35df83){if(_0x35df83){return db[_0x1a9e('0x8d')]['destroy']({'where':{'ListId':_0x4840ac[_0x1a9e('0x31')][_0x1a9e('0x5f')],'CampaignId':_0x4840ac['params']['id']}})[_0x1a9e('0x21')](function(){return _0x35df83;});}})['then'](respondWithStatusCode(_0xe6fc97,null))['catch'](handleError(_0xe6fc97,null));};
\ No newline at end of file
+var _0x6f3e=['h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','format','ids','spread','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','cm_contacts','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','join'];(function(_0x2198a1,_0x5cab5c){var _0xcbb626=function(_0x586630){while(--_0x586630){_0x2198a1['push'](_0x2198a1['shift']());}};_0xcbb626(++_0x5cab5c);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe6f3('0x0'));var rimraf=require(_0xe6f3('0x1'));var zipdir=require(_0xe6f3('0x2'));var jsonpatch=require(_0xe6f3('0x3'));var rp=require(_0xe6f3('0x4'));var moment=require(_0xe6f3('0x5'));var BPromise=require(_0xe6f3('0x6'));var Mustache=require('mustache');var util=require(_0xe6f3('0x7'));var path=require(_0xe6f3('0x8'));var sox=require('sox');var csv=require(_0xe6f3('0x9'));var ejs=require(_0xe6f3('0xa'));var fs=require('fs');var fs_extra=require(_0xe6f3('0xb'));var _=require('lodash');var squel=require(_0xe6f3('0xc'));var crypto=require(_0xe6f3('0xd'));var jsforce=require(_0xe6f3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe6f3('0x9'));var querystring=require('querystring');var Papa=require(_0xe6f3('0xf'));var Redis=require(_0xe6f3('0x10'));var authService=require(_0xe6f3('0x11'));var qs=require(_0xe6f3('0x12'));var as=require(_0xe6f3('0x13'));var hardwareService=require(_0xe6f3('0x14'));var logger=require('../../config/logger')(_0xe6f3('0x15'));var utils=require('../../config/utils');var config=require(_0xe6f3('0x16'));var licenseUtil=require(_0xe6f3('0x17'));var db=require(_0xe6f3('0x18'))['db'];function respondWithStatusCode(_0x1cca90,_0x563a20){_0x563a20=_0x563a20||0xcc;return function(_0x15d740){if(_0x15d740){return _0x1cca90[_0xe6f3('0x19')](_0x563a20);}return _0x1cca90[_0xe6f3('0x1a')](_0x563a20)[_0xe6f3('0x1b')]();};}function respondWithResult(_0x7c2664,_0x2f8885){_0x2f8885=_0x2f8885||0xc8;return function(_0x26f4a7){if(_0x26f4a7){return _0x7c2664['status'](_0x2f8885)[_0xe6f3('0x1c')](_0x26f4a7);}};}function respondWithFilteredResult(_0x1e8dcd,_0x31e0a1){return function(_0x34a730){if(_0x34a730){var _0x1706a9=typeof _0x31e0a1['offset']==='undefined'&&typeof _0x31e0a1[_0xe6f3('0x1d')]===_0xe6f3('0x1e');var _0x22dcf7=_0x34a730['count'];var _0x39d6be=_0x1706a9?0x0:_0x31e0a1[_0xe6f3('0x1f')];var _0x1aa839=_0x1706a9?_0x34a730[_0xe6f3('0x20')]:_0x31e0a1[_0xe6f3('0x1f')]+_0x31e0a1['limit'];var _0x537568;if(_0x1aa839>=_0x22dcf7){_0x1aa839=_0x22dcf7;_0x537568=0xc8;}else{_0x537568=0xce;}_0x1e8dcd['status'](_0x537568);return _0x1e8dcd[_0xe6f3('0x21')](_0xe6f3('0x22'),_0x39d6be+'-'+_0x1aa839+'/'+_0x22dcf7)[_0xe6f3('0x1c')](_0x34a730);}return null;};}function patchUpdates(_0x398a6b){return function(_0x14dd0e){try{jsonpatch[_0xe6f3('0x23')](_0x14dd0e,_0x398a6b,!![]);}catch(_0x47f69b){return BPromise[_0xe6f3('0x24')](_0x47f69b);}return _0x14dd0e[_0xe6f3('0x25')]();};}function saveUpdates(_0x37041b,_0x1405bd){return function(_0x43c0d5){if(_0x43c0d5){return _0x43c0d5[_0xe6f3('0x26')](_0x37041b)[_0xe6f3('0x27')](function(_0x4d75d3){return _0x4d75d3;});}return null;};}function removeEntity(_0x4b1bf2,_0x88ed03){return function(_0x3989c5){if(_0x3989c5){return _0x3989c5[_0xe6f3('0x28')]()[_0xe6f3('0x27')](function(){var _0x617847=_0x3989c5[_0xe6f3('0x29')]({'plain':!![]});var _0x5b1a12=_0xe6f3('0x2a');return db[_0xe6f3('0x2b')][_0xe6f3('0x28')]({'where':{'type':_0x5b1a12,'resourceId':_0x617847['id']}})[_0xe6f3('0x27')](function(){return _0x3989c5;});})['then'](function(){_0x4b1bf2['status'](0xcc)[_0xe6f3('0x1b')]();});}};}function handleEntityNotFound(_0x3eef65,_0x482cef){return function(_0x5e5f44){if(!_0x5e5f44){_0x3eef65[_0xe6f3('0x19')](0x194);}return _0x5e5f44;};}function handleError(_0x19691c,_0x37a5a5){_0x37a5a5=_0x37a5a5||0x1f4;return function(_0x4627de){logger[_0xe6f3('0x2c')](_0x4627de[_0xe6f3('0x2d')]);if(_0x4627de[_0xe6f3('0x2e')]){delete _0x4627de['name'];}_0x19691c[_0xe6f3('0x1a')](_0x37a5a5)['send'](_0x4627de);};}exports[_0xe6f3('0x2f')]=function(_0x104677,_0x473064){var _0x5c8494={},_0x34ad3c={},_0x5163e0={'count':0x0,'rows':[]};var _0x359c2d=_[_0xe6f3('0x30')](db[_0xe6f3('0x31')][_0xe6f3('0x32')],function(_0x498a16){return{'name':_0x498a16[_0xe6f3('0x33')],'type':_0x498a16[_0xe6f3('0x34')]['key']};});_0x34ad3c[_0xe6f3('0x35')]=_[_0xe6f3('0x30')](_0x359c2d,_0xe6f3('0x2e'));_0x34ad3c[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x104677[_0xe6f3('0x36')]);_0x34ad3c[_0xe6f3('0x38')]=_['intersection'](_0x34ad3c[_0xe6f3('0x35')],_0x34ad3c[_0xe6f3('0x36')]);_0x5c8494[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x34ad3c['model'],qs[_0xe6f3('0x3b')](_0x104677[_0xe6f3('0x36')]['fields']));_0x5c8494['attributes']=_0x5c8494[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x5c8494[_0xe6f3('0x39')]:_0x34ad3c[_0xe6f3('0x35')];if(!_0x104677['query'][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x5c8494['limit']=qs['limit'](_0x104677[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x5c8494[_0xe6f3('0x1f')]=qs[_0xe6f3('0x1f')](_0x104677[_0xe6f3('0x36')]['offset']);}_0x5c8494[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x104677[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x5c8494['where']=qs[_0xe6f3('0x38')](_['pick'](_0x104677[_0xe6f3('0x36')],_0x34ad3c[_0xe6f3('0x38')]),_0x359c2d);if(_0x104677[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x5c8494['where']=_['merge'](_0x5c8494[_0xe6f3('0x42')],{'$or':_[_0xe6f3('0x30')](_0x359c2d,function(_0x30a160){if(_0x30a160[_0xe6f3('0x34')]!==_0xe6f3('0x43')){var _0x51bd3f={};_0x51bd3f[_0x30a160[_0xe6f3('0x2e')]]={'$like':'%'+_0x104677[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x51bd3f;}})});}_0x5c8494=_[_0xe6f3('0x44')]({},_0x5c8494,_0x104677[_0xe6f3('0x45')]);var _0x1badac={'where':_0x5c8494['where']};return db[_0xe6f3('0x31')][_0xe6f3('0x20')](_0x1badac)['then'](function(_0x2e5108){_0x5163e0[_0xe6f3('0x20')]=_0x2e5108;if(_0x104677[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x5c8494[_0xe6f3('0x47')]=[{'all':!![]}];}return db[_0xe6f3('0x31')][_0xe6f3('0x48')](_0x5c8494);})[_0xe6f3('0x27')](function(_0x25f946){_0x5163e0[_0xe6f3('0x49')]=_0x25f946;return _0x5163e0;})[_0xe6f3('0x27')](respondWithFilteredResult(_0x473064,_0x5c8494))[_0xe6f3('0x4a')](handleError(_0x473064,null));};exports[_0xe6f3('0x4b')]=function(_0x21f142,_0x24ce66){var _0x127583={'raw':![],'where':{'id':_0x21f142[_0xe6f3('0x4c')]['id']}},_0x2fde49={};_0x2fde49[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x31')][_0xe6f3('0x32')]);_0x2fde49['query']=_[_0xe6f3('0x37')](_0x21f142[_0xe6f3('0x36')]);_0x2fde49[_0xe6f3('0x38')]=_['intersection'](_0x2fde49[_0xe6f3('0x35')],_0x2fde49[_0xe6f3('0x36')]);_0x127583[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x2fde49[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x21f142['query'][_0xe6f3('0x3b')]));_0x127583[_0xe6f3('0x39')]=_0x127583[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x127583[_0xe6f3('0x39')]:_0x2fde49['model'];if(_0x21f142['query']['includeAll']){_0x127583['include']=[{'all':!![]}];}_0x127583=_[_0xe6f3('0x44')]({},_0x127583,_0x21f142[_0xe6f3('0x45')]);return db[_0xe6f3('0x31')][_0xe6f3('0x4d')](_0x127583)[_0xe6f3('0x27')](handleEntityNotFound(_0x24ce66,null))['then'](respondWithResult(_0x24ce66,null))[_0xe6f3('0x4a')](handleError(_0x24ce66,null));};exports[_0xe6f3('0x4e')]=function(_0x33e3a9,_0x19e0c7){return db['Campaign'][_0xe6f3('0x4e')](_0x33e3a9[_0xe6f3('0x4f')],{})[_0xe6f3('0x27')](function(_0xc305e3){var _0xcfc2c=_0x33e3a9['user']['get']({'plain':!![]});if(!_0xcfc2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcfc2c[_0xe6f3('0x50')]==='user'){var _0x392ec6=_0xc305e3[_0xe6f3('0x29')]({'plain':!![]});var _0x473adf=_0xe6f3('0x2a');return db[_0xe6f3('0x51')][_0xe6f3('0x4d')]({'where':{'name':_0x473adf,'userProfileId':_0xcfc2c[_0xe6f3('0x52')]},'raw':!![]})[_0xe6f3('0x27')](function(_0x358d5b){if(_0x358d5b&&_0x358d5b[_0xe6f3('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x392ec6[_0xe6f3('0x2e')],'resourceId':_0x392ec6['id'],'type':_0x358d5b[_0xe6f3('0x2e')],'sectionId':_0x358d5b['id']},{})[_0xe6f3('0x27')](function(){return _0xc305e3;});}else{return _0xc305e3;}})[_0xe6f3('0x4a')](function(_0x5ec345){logger[_0xe6f3('0x2c')](_0xe6f3('0x54'),_0x5ec345);throw _0x5ec345;});}return _0xc305e3;})['then'](respondWithResult(_0x19e0c7,0xc9))[_0xe6f3('0x4a')](handleError(_0x19e0c7,null));};exports[_0xe6f3('0x55')]=function(_0x20fa56,_0x11df4f){var _0x47fe00={'where':{'id':_0x20fa56['params']['id']}},_0xe23956={};_0xe23956[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x31')][_0xe6f3('0x32')]);_0x47fe00[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0xe23956[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x20fa56[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x47fe00[_0xe6f3('0x39')]=_0x47fe00[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x47fe00[_0xe6f3('0x39')]:_0xe23956[_0xe6f3('0x35')];if(_0x20fa56[_0xe6f3('0x36')]['includeAll']){_0x47fe00['include']=[{'all':!![]}];}_0x47fe00=_[_0xe6f3('0x44')]({},_0x47fe00,_0x20fa56[_0xe6f3('0x45')]);return db['Campaign'][_0xe6f3('0x4d')](_0x47fe00)[_0xe6f3('0x27')](handleEntityNotFound(_0x11df4f,null))['then'](function(_0x52e8af){if(_0x52e8af){var _0x5af456=_0x52e8af[_0xe6f3('0x29')]({'plain':!![]});_0x5af456=qs[_0xe6f3('0x56')](_0x5af456,['id',_0xe6f3('0x57'),_0xe6f3('0x58')]);_0x20fa56[_0xe6f3('0x4f')]=_['omit'](_0x20fa56[_0xe6f3('0x4f')],['id',_0xe6f3('0x57'),_0xe6f3('0x58')]);return db[_0xe6f3('0x31')][_0xe6f3('0x4e')](_[_0xe6f3('0x44')](_0x5af456,_0x20fa56[_0xe6f3('0x4f')]),{'include':_0x20fa56[_0xe6f3('0x36')][_0xe6f3('0x46')]?[{'all':!![]}]:undefined})[_0xe6f3('0x27')](function(_0x1024d0){var _0x15e297=_0x20fa56[_0xe6f3('0x59')][_0xe6f3('0x29')]({'plain':!![]});if(!_0x15e297)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15e297[_0xe6f3('0x50')]===_0xe6f3('0x59')){var _0x2ded8e=_0x1024d0[_0xe6f3('0x29')]({'plain':!![]});var _0x2900b2=_0xe6f3('0x2a');return db[_0xe6f3('0x51')]['find']({'where':{'name':_0x2900b2,'userProfileId':_0x15e297[_0xe6f3('0x52')]},'raw':!![]})[_0xe6f3('0x27')](function(_0x3cb9de){if(_0x3cb9de&&_0x3cb9de[_0xe6f3('0x53')]===0x0){return db[_0xe6f3('0x2b')][_0xe6f3('0x4e')]({'name':_0x2ded8e['name'],'resourceId':_0x2ded8e['id'],'type':_0x3cb9de[_0xe6f3('0x2e')],'sectionId':_0x3cb9de['id']},{})[_0xe6f3('0x27')](function(){return _0x1024d0;});}else{return _0x1024d0;}})[_0xe6f3('0x4a')](function(_0x1cf8ae){logger[_0xe6f3('0x2c')](_0xe6f3('0x54'),_0x1cf8ae);throw _0x1cf8ae;});}return _0x1024d0;});}})['then'](respondWithResult(_0x11df4f,0xc9))[_0xe6f3('0x4a')](handleError(_0x11df4f,null));};exports[_0xe6f3('0x26')]=function(_0x171950,_0xc37282){if(_0x171950[_0xe6f3('0x4f')]['id']){delete _0x171950['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x171950[_0xe6f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc37282,null))[_0xe6f3('0x27')](saveUpdates(_0x171950[_0xe6f3('0x4f')],null))[_0xe6f3('0x27')](respondWithResult(_0xc37282,null))[_0xe6f3('0x4a')](handleError(_0xc37282,null));};exports[_0xe6f3('0x28')]=function(_0x1caf9b,_0x48b8d1){return db[_0xe6f3('0x31')]['find']({'where':{'id':_0x1caf9b['params']['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x48b8d1,null))[_0xe6f3('0x27')](removeEntity(_0x48b8d1,null))[_0xe6f3('0x4a')](handleError(_0x48b8d1,null));};exports[_0xe6f3('0x5a')]=function(_0x24bd75,_0x2807bf,_0x24dbd2){var _0x29428b={'raw':!![],'where':{}};var _0x5e825c={};var _0x38c1c4={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x24bd75[_0xe6f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2807bf,null))[_0xe6f3('0x27')](function(_0x4875e9){if(_0x4875e9){_0x5e825c[_0xe6f3('0x35')]=_['keys'](db['CmHopper'][_0xe6f3('0x32')]);_0x5e825c[_0xe6f3('0x36')]=_['keys'](_0x24bd75['query']);_0x5e825c[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x5e825c[_0xe6f3('0x35')],_0x5e825c['query']);_0x29428b[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x5e825c['model'],qs['fields'](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x29428b[_0xe6f3('0x39')]=_0x29428b[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x29428b['attributes']:_0x5e825c[_0xe6f3('0x35')];if(!_0x24bd75['query'][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x29428b[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x29428b['offset']=qs[_0xe6f3('0x1f')](_0x24bd75[_0xe6f3('0x36')]['offset']);}_0x29428b[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x29428b[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x24bd75[_0xe6f3('0x36')],_0x5e825c[_0xe6f3('0x38')]));_0x29428b[_0xe6f3('0x42')][_0xe6f3('0x5d')]=_0x4875e9['id'];if(_0x24bd75[_0xe6f3('0x36')]['filter']){_0x29428b[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x29428b['where'],{'$or':_['map'](_0x29428b[_0xe6f3('0x39')],function(_0x30d5f7){var _0x799399={};_0x799399[_0x30d5f7]={'$like':'%'+_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x799399;})});}_0x29428b=_[_0xe6f3('0x44')]({},_0x29428b,_0x24bd75['options']);return db[_0xe6f3('0x5e')][_0xe6f3('0x20')]({'where':_0x29428b[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x3e18fa){_0x38c1c4[_0xe6f3('0x20')]=_0x3e18fa;if(_0x24bd75['query'][_0xe6f3('0x46')]){_0x29428b[_0xe6f3('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0xe6f3('0x48')](_0x29428b);})['then'](function(_0x2b22a0){_0x38c1c4['rows']=_0x2b22a0;return _0x38c1c4;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x2807bf,_0x29428b))[_0xe6f3('0x4a')](handleError(_0x2807bf,null));};exports[_0xe6f3('0x5f')]=function(_0x221bd9,_0x11d640,_0x229477){var _0x53eb94={'raw':!![],'where':{}};var _0x13212f={};var _0x4e533a={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x221bd9[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x11d640,null))[_0xe6f3('0x27')](function(_0x13f260){if(_0x13f260){_0x13212f[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x60')][_0xe6f3('0x32')]);_0x13212f[_0xe6f3('0x36')]=_['keys'](_0x221bd9['query']);_0x13212f[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x13212f[_0xe6f3('0x35')],_0x13212f['query']);_0x53eb94[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x13212f[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x221bd9[_0xe6f3('0x36')]['fields']));_0x53eb94[_0xe6f3('0x39')]=_0x53eb94[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x53eb94['attributes']:_0x13212f[_0xe6f3('0x35')];if(!_0x221bd9[_0xe6f3('0x36')]['hasOwnProperty']('nolimit')){_0x53eb94[_0xe6f3('0x1d')]=qs['limit'](_0x221bd9[_0xe6f3('0x36')]['limit']);_0x53eb94['offset']=qs['offset'](_0x221bd9['query'][_0xe6f3('0x1f')]);}_0x53eb94[_0xe6f3('0x3f')]=qs['sort'](_0x221bd9[_0xe6f3('0x36')]['sort']);_0x53eb94[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x221bd9[_0xe6f3('0x36')],_0x13212f[_0xe6f3('0x38')]));_0x53eb94[_0xe6f3('0x42')]['CampaignId']=_0x13f260['id'];if(_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x53eb94[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x53eb94[_0xe6f3('0x42')],{'$or':_[_0xe6f3('0x30')](_0x53eb94['attributes'],function(_0x596b21){var _0x32929b={};_0x32929b[_0x596b21]={'$like':'%'+_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x32929b;})});}_0x53eb94=_['merge']({},_0x53eb94,_0x221bd9['options']);return db['CmHopperHistory'][_0xe6f3('0x20')]({'where':_0x53eb94[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x845b5c){_0x4e533a[_0xe6f3('0x20')]=_0x845b5c;if(_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x53eb94['include']=[{'all':!![]}];}return db[_0xe6f3('0x60')][_0xe6f3('0x48')](_0x53eb94);})['then'](function(_0x5ab162){_0x4e533a[_0xe6f3('0x49')]=_0x5ab162;return _0x4e533a;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x11d640,_0x53eb94))[_0xe6f3('0x4a')](handleError(_0x11d640,null));};exports[_0xe6f3('0x61')]=function(_0x103b1e,_0x5447d5,_0x34bdad){var _0x3682ca={'raw':!![],'where':{}};var _0x32bce8={};var _0x58202c={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x103b1e[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x5447d5,null))[_0xe6f3('0x27')](function(_0x4ab738){if(_0x4ab738){_0x32bce8[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x62')][_0xe6f3('0x32')]);_0x32bce8['query']=_[_0xe6f3('0x37')](_0x103b1e[_0xe6f3('0x36')]);_0x32bce8['filters']=_[_0xe6f3('0x3a')](_0x32bce8[_0xe6f3('0x35')],_0x32bce8[_0xe6f3('0x36')]);_0x3682ca[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x32bce8[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x3682ca['attributes']=_0x3682ca[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x3682ca[_0xe6f3('0x39')]:_0x32bce8['model'];if(!_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x3682ca['limit']=qs['limit'](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x3682ca[_0xe6f3('0x1f')]=qs[_0xe6f3('0x1f')](_0x103b1e['query'][_0xe6f3('0x1f')]);}_0x3682ca[_0xe6f3('0x3f')]=qs['sort'](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x3682ca[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x103b1e[_0xe6f3('0x36')],_0x32bce8[_0xe6f3('0x38')]));_0x3682ca['where'][_0xe6f3('0x5d')]=_0x4ab738['id'];if(_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x3682ca[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x3682ca['where'],{'$or':_[_0xe6f3('0x30')](_0x3682ca['attributes'],function(_0xbf614b){var _0x36be9d={};_0x36be9d[_0xbf614b]={'$like':'%'+_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x36be9d;})});}_0x3682ca=_[_0xe6f3('0x44')]({},_0x3682ca,_0x103b1e[_0xe6f3('0x45')]);return db[_0xe6f3('0x62')]['count']({'where':_0x3682ca['where']})[_0xe6f3('0x27')](function(_0x3264af){_0x58202c[_0xe6f3('0x20')]=_0x3264af;if(_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x3682ca['include']=[{'all':!![]}];}return db[_0xe6f3('0x62')][_0xe6f3('0x48')](_0x3682ca);})[_0xe6f3('0x27')](function(_0x347f39){_0x58202c['rows']=_0x347f39;return _0x58202c;});}})['then'](respondWithFilteredResult(_0x5447d5,_0x3682ca))['catch'](handleError(_0x5447d5,null));};exports['getHopperBlacks']=function(_0x5d1470,_0x423088,_0x46ae4a){var _0xf8052c={'raw':!![],'where':{}};var _0x547fa2={};var _0x1eb4b3={'count':0x0,'rows':[]};return db['Campaign'][_0xe6f3('0x5b')]({'where':{'id':_0x5d1470['params']['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x423088,null))[_0xe6f3('0x27')](function(_0x2d8b5b){if(_0x2d8b5b){_0x547fa2[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x63')][_0xe6f3('0x32')]);_0x547fa2[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x5d1470[_0xe6f3('0x36')]);_0x547fa2[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x547fa2[_0xe6f3('0x35')],_0x547fa2[_0xe6f3('0x36')]);_0xf8052c[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x547fa2[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x5d1470[_0xe6f3('0x36')]['fields']));_0xf8052c['attributes']=_0xf8052c['attributes'][_0xe6f3('0x3c')]?_0xf8052c[_0xe6f3('0x39')]:_0x547fa2[_0xe6f3('0x35')];if(!_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0xf8052c[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0xf8052c[_0xe6f3('0x1f')]=qs['offset'](_0x5d1470['query'][_0xe6f3('0x1f')]);}_0xf8052c['order']=qs['sort'](_0x5d1470[_0xe6f3('0x36')]['sort']);_0xf8052c['where']=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x5d1470['query'],_0x547fa2[_0xe6f3('0x38')]));_0xf8052c[_0xe6f3('0x42')]['CampaignId']=_0x2d8b5b['id'];if(_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0xf8052c[_0xe6f3('0x42')]=_['merge'](_0xf8052c[_0xe6f3('0x42')],{'$or':_['map'](_0xf8052c[_0xe6f3('0x39')],function(_0x13a6b4){var _0x8a722d={};_0x8a722d[_0x13a6b4]={'$like':'%'+_0x5d1470['query'][_0xe6f3('0x41')]+'%'};return _0x8a722d;})});}_0xf8052c=_[_0xe6f3('0x44')]({},_0xf8052c,_0x5d1470[_0xe6f3('0x45')]);return db[_0xe6f3('0x63')][_0xe6f3('0x20')]({'where':_0xf8052c[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x3fea28){_0x1eb4b3['count']=_0x3fea28;if(_0x5d1470['query']['includeAll']){_0xf8052c[_0xe6f3('0x47')]=[{'all':!![]}];}return db[_0xe6f3('0x63')][_0xe6f3('0x48')](_0xf8052c);})[_0xe6f3('0x27')](function(_0xa2bb66){_0x1eb4b3[_0xe6f3('0x49')]=_0xa2bb66;return _0x1eb4b3;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x423088,_0xf8052c))[_0xe6f3('0x4a')](handleError(_0x423088,null));};exports['getLists']=function(_0x13ae5b,_0x10eb2b,_0x54e719){var _0x354f1e={};var _0x5f528a={};var _0x3c79e5;var _0x4f4c1f;return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x13ae5b[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x10eb2b,null))[_0xe6f3('0x27')](function(_0x3cb4f4){if(_0x3cb4f4){_0x3c79e5=_0x3cb4f4;_0x5f528a[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db['CmList'][_0xe6f3('0x32')]);_0x5f528a['query']=_[_0xe6f3('0x37')](_0x13ae5b[_0xe6f3('0x36')]);_0x5f528a[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x5f528a[_0xe6f3('0x35')],_0x5f528a[_0xe6f3('0x36')]);_0x354f1e[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x5f528a[_0xe6f3('0x35')],qs['fields'](_0x13ae5b[_0xe6f3('0x36')]['fields']));_0x354f1e[_0xe6f3('0x39')]=_0x354f1e[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x354f1e['attributes']:_0x5f528a[_0xe6f3('0x35')];_0x354f1e[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x354f1e[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x13ae5b[_0xe6f3('0x36')],_0x5f528a[_0xe6f3('0x38')]));if(_0x13ae5b[_0xe6f3('0x36')]['filter']){_0x354f1e[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x354f1e['where'],{'$or':_[_0xe6f3('0x30')](_0x354f1e[_0xe6f3('0x39')],function(_0xe04f93){var _0x30e569={};_0x30e569[_0xe04f93]={'$like':'%'+_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x30e569;})});}_0x354f1e=_[_0xe6f3('0x44')]({},_0x354f1e,_0x13ae5b[_0xe6f3('0x45')]);return _0x3c79e5[_0xe6f3('0x64')](_0x354f1e);}})[_0xe6f3('0x27')](function(_0x5479bd){if(_0x5479bd){_0x4f4c1f=_0x5479bd[_0xe6f3('0x3c')];if(!_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x3d')]('nolimit')){_0x354f1e[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x13ae5b[_0xe6f3('0x36')]['limit']);_0x354f1e['offset']=qs[_0xe6f3('0x1f')](_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x1f')]);}return _0x3c79e5['getLists'](_0x354f1e);}})[_0xe6f3('0x27')](function(_0x1a9cdc){if(_0x1a9cdc){return _0x1a9cdc?{'count':_0x4f4c1f,'rows':_0x1a9cdc}:null;}})[_0xe6f3('0x27')](respondWithResult(_0x10eb2b,null))[_0xe6f3('0x4a')](handleError(_0x10eb2b,null));};exports['addLists']=function(_0x69990a,_0x817aa2,_0x54963a){var _0x20e015,_0x4bb525;var _0x123626=[];var _0x25224a=moment()[_0xe6f3('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x69990a[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x817aa2,null))[_0xe6f3('0x27')](function(_0x5cb788){if(_0x5cb788){_0x4bb525=_0x5cb788;return _0x5cb788['addLists'](_0x69990a[_0xe6f3('0x4f')][_0xe6f3('0x66')],_[_0xe6f3('0x56')](_0x69990a[_0xe6f3('0x4f')],[_0xe6f3('0x66'),'id'])||{});}return null;})[_0xe6f3('0x67')](function(_0x3ca584){var _0xe73186;var _0x157b70;_0x20e015=_0x3ca584||[];var _0x2557c4=[];if(_0x3ca584){for(var _0x2fb222=0x0;_0x2fb222<_0x3ca584[_0xe6f3('0x3c')];_0x2fb222+=0x1){var _0x5333c7=_0x3ca584[_0x2fb222]['get']({'plain':!![]});_0x4bb525[_0xe6f3('0x68')]=_0x69990a[_0xe6f3('0x4f')]['dialCheckDuplicateType']?_0x69990a[_0xe6f3('0x4f')]['dialCheckDuplicateType']:_0x4bb525[_0xe6f3('0x68')];switch(_0x4bb525[_0xe6f3('0x68')]){case'always':_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6c'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),_0xe6f3('0x5d'),_0xe6f3('0x57'),_0xe6f3('0x58')],squel['select']()[_0xe6f3('0x6f')]('phone',_0xe6f3('0x6b'))['field'](_0xe6f3('0x70'),_0xe6f3('0x6c'))['field']('id',_0xe6f3('0x6d'))['field'](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x69990a[_0xe6f3('0x4c')]['id']['toString'](),_0xe6f3('0x5d'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27','updatedAt')[_0xe6f3('0x73')]('cm_contacts')[_0xe6f3('0x42')](_0xe6f3('0x74'))['where'](_0xe6f3('0x75'),_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x78'))[_0xe6f3('0x73')](_0xe6f3('0x79'))[_0xe6f3('0x42')](_0xe6f3('0x7a'),_0x69990a[_0xe6f3('0x4c')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe6f3('0x77')]()['field'](_0xe6f3('0x7b'))[_0xe6f3('0x73')](_0xe6f3('0x6a'))[_0xe6f3('0x42')](_0xe6f3('0x7a'),_0x69990a[_0xe6f3('0x4c')]['id'][_0xe6f3('0x72')]())))['toString']();break;case'onlyIfOpen':_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))[_0xe6f3('0x7c')]([_0xe6f3('0x6b'),'scheduledAt','ContactId',_0xe6f3('0x6e'),'CampaignId',_0xe6f3('0x57'),'updatedAt'],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x6b'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('NOW()',_0xe6f3('0x6c'))['field']('id',_0xe6f3('0x6d'))[_0xe6f3('0x6f')](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),'ListId')[_0xe6f3('0x6f')](_0x69990a['params']['id']['toString'](),_0xe6f3('0x5d'))['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where'](_0xe6f3('0x74'))['where'](_0xe6f3('0x75'),_0x5333c7['CmListId'][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76'))[_0xe6f3('0x42')](_0xe6f3('0x7e'),squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x7b'))[_0xe6f3('0x73')](_0xe6f3('0x6a'))['where']('CampaignId\x20=\x20?',_0x69990a[_0xe6f3('0x4c')]['id'][_0xe6f3('0x72')]())))['toString']();break;default:_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6c'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),'CampaignId','createdAt',_0xe6f3('0x58')],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x6b'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('NOW()',_0xe6f3('0x6c'))[_0xe6f3('0x6f')]('id',_0xe6f3('0x6d'))[_0xe6f3('0x6f')](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x69990a[_0xe6f3('0x4c')]['id']['toString'](),_0xe6f3('0x5d'))['field']('\x27'+_0x25224a+'\x27','createdAt')['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where']('deletedAt\x20IS\x20NULL')[_0xe6f3('0x42')](_0xe6f3('0x75'),_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76')))['toString']();}_0x157b70=squel['insert']()['into'](_0xe6f3('0x7f'))[_0xe6f3('0x7c')]([_0xe6f3('0x80'),_0xe6f3('0x6c'),'phone',_0xe6f3('0x81'),'createdAt',_0xe6f3('0x58')],squel['select']()[_0xe6f3('0x6f')]('h.id','id')[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x6c'))[_0xe6f3('0x6f')](_0xe6f3('0x82'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')](_0xe6f3('0x83'),_0xe6f3('0x81'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')]('cm_contact_has_items','ci')[_0xe6f3('0x84')](_0xe6f3('0x6a'),'h',_0xe6f3('0x85'))[_0xe6f3('0x42')]('h.ListId\x20=\x20?',_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x86'),_0x69990a[_0xe6f3('0x4c')]['id']['toString']())[_0xe6f3('0x42')](_0xe6f3('0x87'),_0x25224a))[_0xe6f3('0x72')]();_0x2557c4[_0xe6f3('0x88')](db['sequelize']['query'](_0xe73186));_0x123626[_0xe6f3('0x88')](db[_0xe6f3('0x89')][_0xe6f3('0x36')](_0x157b70));}return BPromise[_0xe6f3('0x8a')](_0x2557c4);}})[_0xe6f3('0x27')](function(){return BPromise['all'](_0x123626);})[_0xe6f3('0x27')](function(){return _0x20e015;})['then'](respondWithResult(_0x817aa2,null))[_0xe6f3('0x4a')](handleError(_0x817aa2,null));};exports[_0xe6f3('0x8b')]=function(_0x5105d2,_0x3f0acb,_0x1cd3f3){return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x5105d2[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x3f0acb,null))[_0xe6f3('0x27')](function(_0x2eb815){if(_0x2eb815){return _0x2eb815['removeLists'](_0x5105d2['query']['ids']);}})[_0xe6f3('0x27')](function(_0x1b4916){if(_0x1b4916){return db[_0xe6f3('0x5e')][_0xe6f3('0x28')]({'where':{'ListId':_0x5105d2[_0xe6f3('0x36')][_0xe6f3('0x66')],'CampaignId':_0x5105d2[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](function(){return _0x1b4916;});}})['then'](respondWithStatusCode(_0x3f0acb,null))[_0xe6f3('0x4a')](handleError(_0x3f0acb,null));};exports[_0xe6f3('0x8c')]=function(_0x546296,_0x10a22f,_0x2a4df1){var _0x24b1ca={};var _0x492e69={};var _0x14e8fc;var _0x4db105;return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x546296[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x10a22f,null))[_0xe6f3('0x27')](function(_0x45b410){if(_0x45b410){_0x14e8fc=_0x45b410;_0x492e69[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x8d')][_0xe6f3('0x32')]);_0x492e69[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x546296[_0xe6f3('0x36')]);_0x492e69[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x492e69['model'],_0x492e69[_0xe6f3('0x36')]);_0x24b1ca[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x492e69[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x546296[_0xe6f3('0x36')]['fields']));_0x24b1ca[_0xe6f3('0x39')]=_0x24b1ca[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x24b1ca['attributes']:_0x492e69['model'];_0x24b1ca['order']=qs[_0xe6f3('0x40')](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x24b1ca['where']=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x546296[_0xe6f3('0x36')],_0x492e69[_0xe6f3('0x38')]));if(_0x546296[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x24b1ca[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x24b1ca[_0xe6f3('0x42')],{'$or':_['map'](_0x24b1ca[_0xe6f3('0x39')],function(_0x43e42b){var _0x273dad={};_0x273dad[_0x43e42b]={'$like':'%'+_0x546296[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x273dad;})});}_0x24b1ca=_['merge']({},_0x24b1ca,_0x546296[_0xe6f3('0x45')]);return _0x14e8fc[_0xe6f3('0x8c')](_0x24b1ca);}})[_0xe6f3('0x27')](function(_0x1f93e1){if(_0x1f93e1){_0x4db105=_0x1f93e1[_0xe6f3('0x3c')];if(!_0x546296[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x24b1ca['limit']=qs['limit'](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x24b1ca['offset']=qs[_0xe6f3('0x1f')](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x1f')]);}return _0x14e8fc[_0xe6f3('0x8c')](_0x24b1ca);}})['then'](function(_0x314a32){if(_0x314a32){return _0x314a32?{'count':_0x4db105,'rows':_0x314a32}:null;}})[_0xe6f3('0x27')](respondWithResult(_0x10a22f,null))[_0xe6f3('0x4a')](handleError(_0x10a22f,null));};exports[_0xe6f3('0x8e')]=function(_0x2cfc20,_0x3a9926,_0x4b461f){var _0xc2cdd8,_0x5a4ccf;var _0x1a8205=[];var _0x5ac6c0=moment()[_0xe6f3('0x65')](_0xe6f3('0x8f'));return db['Campaign']['find']({'where':{'id':_0x2cfc20[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x3a9926,null))[_0xe6f3('0x27')](function(_0x32167a){if(_0x32167a){_0x5a4ccf=_0x32167a;return _0x32167a[_0xe6f3('0x8e')](_0x2cfc20['body'][_0xe6f3('0x66')],_[_0xe6f3('0x56')](_0x2cfc20[_0xe6f3('0x4f')],['ids','id'])||{});}return null;})[_0xe6f3('0x67')](function(_0x337df8){var _0x115fcf;var _0x1c20f5;_0xc2cdd8=_0x337df8||[];var _0x37204c=[];if(_0x337df8){for(var _0x51c01f=0x0;_0x51c01f<_0x337df8[_0xe6f3('0x3c')];_0x51c01f+=0x1){var _0x4b40f7=_0x337df8[_0x51c01f][_0xe6f3('0x29')]({'plain':!![]});_0x115fcf=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x90'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),_0xe6f3('0x5d'),_0xe6f3('0x57'),_0xe6f3('0x58')],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')]('phone',_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('id','ContactId')[_0xe6f3('0x6f')](_0x4b40f7[_0xe6f3('0x71')]['toString'](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x2cfc20['params']['id']['toString'](),_0xe6f3('0x5d'))[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x57'))[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where'](_0xe6f3('0x74'))[_0xe6f3('0x42')]('ListId\x20=\x20?',_0x4b40f7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76')))[_0xe6f3('0x72')]();_0x37204c[_0xe6f3('0x88')](db[_0xe6f3('0x89')][_0xe6f3('0x36')](_0x115fcf));}return BPromise[_0xe6f3('0x8a')](_0x37204c);}})['then'](function(){return _0xc2cdd8;})[_0xe6f3('0x27')](respondWithResult(_0x3a9926,null))['catch'](handleError(_0x3a9926,null));};exports[_0xe6f3('0x91')]=function(_0x498bb1,_0x2baf8c,_0x5b2063){return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x498bb1[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x2baf8c,null))[_0xe6f3('0x27')](function(_0x3ba927){if(_0x3ba927){return _0x3ba927[_0xe6f3('0x91')](_0x498bb1[_0xe6f3('0x36')]['ids']);}})[_0xe6f3('0x27')](function(_0x11ba37){if(_0x11ba37){return db[_0xe6f3('0x63')]['destroy']({'where':{'ListId':_0x498bb1['query'][_0xe6f3('0x66')],'CampaignId':_0x498bb1['params']['id']}})['then'](function(){return _0x11ba37;});}})['then'](respondWithStatusCode(_0x2baf8c,null))[_0xe6f3('0x4a')](handleError(_0x2baf8c,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 8888607..17a6d80 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1ea50c,_0x3dd2e7){var _0x37e769=function(_0x2dcb20){while(--_0x2dcb20){_0x1ea50c['push'](_0x1ea50c['shift']());}};_0x37e769(++_0x3dd2e7);}(_0x7a54,0x106));var _0x47a5=function(_0x1c97c0,_0xaf8fc8){_0x1c97c0=_0x1c97c0-0x0;var _0x40e517=_0x7a54[_0x1c97c0];return _0x40e517;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 98a0794..c1f4a27 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 _0x94dc=['attributes','limit','include','map','model','GetCampaign','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x94dc,0xb1));var _0xc94d=function(_0x5cc4e4,_0x83347a){_0x5cc4e4=_0x5cc4e4-0x0;var _0x3fa242=_0x94dc[_0x5cc4e4];return _0x3fa242;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('Campaign,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('Campaign,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['GetCampaign']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['Campaign'][_0xc94d('0x17')]({'raw':_0x48b879[_0xc94d('0x18')]?_0x48b879['options'][_0xc94d('0x19')]===undefined?!![]:![]:!![],'where':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1a')]||null:null,'attributes':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1b')]||null:null,'limit':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1c')]||null:null,'include':_0x48b879['options']?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')],function(_0x557bfb){return{'model':db[_0x557bfb['model']],'as':_0x557bfb['as'],'attributes':_0x557bfb['attributes'],'include':_0x557bfb[_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x557bfb[_0xc94d('0x1d')],function(_0x1de964){return{'model':db[_0x1de964['model']],'as':_0x1de964['as'],'attributes':_0x1de964['attributes'],'include':_0x1de964[_0xc94d('0x1d')]?_['map'](_0x1de964[_0xc94d('0x1d')],function(_0x362ff4){return{'model':db[_0x362ff4[_0xc94d('0x1f')]],'as':_0x362ff4['as'],'attributes':_0x362ff4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc94d('0xc')](function(_0x196b59){logger[_0xc94d('0xd')](_0xc94d('0x20'),_0x48b879);logger[_0xc94d('0x10')]('GetCampaign',_0x48b879,JSON[_0xc94d('0x21')](_0x196b59));_0x4784a2(_0x196b59);})[_0xc94d('0x16')](function(_0x3a2342){logger[_0xc94d('0x12')](_0xc94d('0x20'),_0x3a2342['message'],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x3a2342[_0xc94d('0x14')]));});});};
\ No newline at end of file
+var _0xa37e=['debug','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x2a5030,_0x5416a5){var _0xe7ee51=function(_0x1bdaaf){while(--_0x1bdaaf){_0x2a5030['push'](_0x2a5030['shift']());}};_0xe7ee51(++_0x5416a5);}(_0xa37e,0x97));var _0xea37=function(_0x597de2,_0x241b83){_0x597de2=_0x597de2-0x0;var _0x59a86e=_0xa37e[_0x597de2];return _0x59a86e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c489,_0x4a9e08,_0x4ae081){return new BPromise(function(_0x2c2890,_0x1401e1){return client[_0xea37('0x8')](_0x36c489,_0x4ae081)[_0xea37('0x9')](function(_0x5e4ebe){logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,_0xea37('0xc'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4a9e08,_0xea37('0xc'),JSON[_0xea37('0xd')](_0x5e4ebe));if(_0x5e4ebe[_0xea37('0xe')]){if(_0x5e4ebe['error'][_0xea37('0xf')]===0x1f4){logger[_0xea37('0xe')](_0xea37('0xb'),_0x4a9e08,_0x5e4ebe['error'][_0xea37('0x10')]);return _0x1401e1(_0x5e4ebe[_0xea37('0xe')]['message']);}logger[_0xea37('0xe')]('Campaign,\x20%s,\x20%s',_0x4a9e08,_0x5e4ebe[_0xea37('0xe')]['message']);return _0x2c2890(_0x5e4ebe[_0xea37('0xe')][_0xea37('0x10')]);}else{logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,'request\x20sent');_0x2c2890(_0x5e4ebe[_0xea37('0x11')]['message']);}})['catch'](function(_0x3ae3cc){logger['error'](_0xea37('0xb'),_0x4a9e08,_0x3ae3cc);_0x1401e1(_0x3ae3cc);});});}exports[_0xea37('0x12')]=function(_0x4ef3c9){var _0x2242f0=this;return new Promise(function(_0x465d3b,_0x5427e7){return db[_0xea37('0x13')][_0xea37('0x14')]({'raw':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x16')]===undefined?!![]:![]:!![],'where':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x17')]||null:null,'attributes':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')]['attributes']||null:null,'limit':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x18')]||null:null,'include':_0x4ef3c9['options']?_0x4ef3c9['options'][_0xea37('0x19')]?_[_0xea37('0x1a')](_0x4ef3c9[_0xea37('0x15')][_0xea37('0x19')],function(_0x4996e9){return{'model':db[_0x4996e9[_0xea37('0x1b')]],'as':_0x4996e9['as'],'attributes':_0x4996e9['attributes'],'include':_0x4996e9['include']?_['map'](_0x4996e9[_0xea37('0x19')],function(_0x4ff973){return{'model':db[_0x4ff973[_0xea37('0x1b')]],'as':_0x4ff973['as'],'attributes':_0x4ff973[_0xea37('0x1c')],'include':_0x4ff973[_0xea37('0x19')]?_[_0xea37('0x1a')](_0x4ff973[_0xea37('0x19')],function(_0xb99cc6){return{'model':db[_0xb99cc6['model']],'as':_0xb99cc6['as'],'attributes':_0xb99cc6[_0xea37('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x477e25){logger[_0xea37('0xa')]('GetCampaign',_0x4ef3c9);logger[_0xea37('0x1d')](_0xea37('0x12'),_0x4ef3c9,JSON[_0xea37('0xd')](_0x477e25));_0x465d3b(_0x477e25);})['catch'](function(_0xe5b07a){logger[_0xea37('0xe')](_0xea37('0x12'),_0xe5b07a[_0xea37('0x10')],_0x4ef3c9);_0x5427e7(_0x2242f0['error'](0x1f4,_0xe5b07a[_0xea37('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 5705728..4f951ca 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 _0x28a1=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers'];(function(_0x2c98cc,_0x230805){var _0x51f0ee=function(_0xe91305){while(--_0xe91305){_0x2c98cc['push'](_0x2c98cc['shift']());}};_0x51f0ee(++_0x230805);}(_0x28a1,0x145));var _0x128a=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x28a1[_0x5f08a6];return _0x5d0641;};'use strict';var multer=require(_0x128a('0x0'));var util=require(_0x128a('0x1'));var path=require('path');var timeout=require(_0x128a('0x2'));var express=require(_0x128a('0x3'));var router=express[_0x128a('0x4')]();var fs_extra=require(_0x128a('0x5'));var auth=require(_0x128a('0x6'));var interaction=require(_0x128a('0x7'));var config=require(_0x128a('0x8'));var controller=require(_0x128a('0x9'));router[_0x128a('0xa')]('/',auth['isAuthenticated'](),controller[_0x128a('0xb')]);router[_0x128a('0xa')](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0xe')]);router[_0x128a('0xa')](_0x128a('0xf'),auth['isAuthenticated'](),controller[_0x128a('0x10')]);router[_0x128a('0xa')](_0x128a('0x11'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x128a('0xa')](_0x128a('0x12'),auth[_0x128a('0xd')](),controller[_0x128a('0x13')]);router[_0x128a('0xa')](_0x128a('0x14'),auth[_0x128a('0xd')](),controller[_0x128a('0x15')]);router['get']('/:id/lists',auth[_0x128a('0xd')](),controller[_0x128a('0x16')]);router[_0x128a('0xa')](_0x128a('0x17'),auth[_0x128a('0xd')](),controller[_0x128a('0x18')]);router[_0x128a('0x19')]('/',auth[_0x128a('0xd')](),controller[_0x128a('0x1a')]);router[_0x128a('0x19')](_0x128a('0x1b'),auth[_0x128a('0xd')](),controller[_0x128a('0x1c')]);router[_0x128a('0x19')](_0x128a('0x1d'),auth['isAuthenticated'](),controller[_0x128a('0x1e')]);router[_0x128a('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x128a('0x1f')]);router['put'](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0x20')]);router['delete'](_0x128a('0xc'),auth['isAuthenticated'](),controller[_0x128a('0x21')]);router[_0x128a('0x22')]('/:id/lists',auth[_0x128a('0xd')](),controller[_0x128a('0x23')]);router[_0x128a('0x22')](_0x128a('0x17'),auth[_0x128a('0xd')](),controller[_0x128a('0x24')]);module[_0x128a('0x25')]=router;
\ No newline at end of file
+var _0x0137=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','/:id','removeLists','multer'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x0137,0xa4));var _0x7013=function(_0x118c30,_0x7eb1eb){_0x118c30=_0x118c30-0x0;var _0x569999=_0x0137[_0x118c30];return _0x569999;};'use strict';var multer=require(_0x7013('0x0'));var util=require('util');var path=require(_0x7013('0x1'));var timeout=require(_0x7013('0x2'));var express=require(_0x7013('0x3'));var router=express[_0x7013('0x4')]();var fs_extra=require(_0x7013('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7013('0x6'));var controller=require(_0x7013('0x7'));router[_0x7013('0x8')]('/',auth[_0x7013('0x9')](),controller[_0x7013('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7013('0xb')]);router[_0x7013('0x8')](_0x7013('0xc'),auth['isAuthenticated'](),controller[_0x7013('0xd')]);router[_0x7013('0x8')]('/:id/hopper_histories',auth[_0x7013('0x9')](),controller[_0x7013('0xe')]);router[_0x7013('0x8')](_0x7013('0xf'),auth[_0x7013('0x9')](),controller[_0x7013('0x10')]);router[_0x7013('0x8')](_0x7013('0x11'),auth[_0x7013('0x9')](),controller['getHopperBlacks']);router['get'](_0x7013('0x12'),auth[_0x7013('0x9')](),controller[_0x7013('0x13')]);router[_0x7013('0x8')](_0x7013('0x14'),auth[_0x7013('0x9')](),controller[_0x7013('0x15')]);router['post']('/',auth[_0x7013('0x9')](),controller[_0x7013('0x16')]);router[_0x7013('0x17')](_0x7013('0x18'),auth[_0x7013('0x9')](),controller[_0x7013('0x19')]);router[_0x7013('0x17')](_0x7013('0x12'),auth['isAuthenticated'](),controller[_0x7013('0x1a')]);router['post']('/:id/blacklists',auth[_0x7013('0x9')](),controller[_0x7013('0x1b')]);router[_0x7013('0x1c')]('/:id',auth[_0x7013('0x9')](),controller[_0x7013('0x1d')]);router[_0x7013('0x1e')](_0x7013('0x1f'),auth[_0x7013('0x9')](),controller['destroy']);router['delete'](_0x7013('0x12'),auth[_0x7013('0x9')](),controller[_0x7013('0x20')]);router[_0x7013('0x1e')]('/:id/blacklists',auth[_0x7013('0x9')](),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 0992a3b..cbff88c 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 _0xcbb2=['sequelize','exports','STRING','TEXT','getDataValue','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbb2,0x1e6));var _0x2cbb=function(_0x399367,_0x38084a){_0x399367=_0x399367-0x0;var _0x3f2434=_0xcbb2[_0x399367];return _0x3f2434;};'use strict';var Sequelize=require(_0x2cbb('0x0'));module[_0x2cbb('0x1')]={'key':{'type':Sequelize[_0x2cbb('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2cbb('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x2cbb('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2cbb('0x4')](_0x2cbb('0x5'));}}};
\ No newline at end of file
+var _0xc081=['TEXT','VIRTUAL','key','exports','STRING'];(function(_0x60157f,_0x22d244){var _0x109db1=function(_0x5cf069){while(--_0x5cf069){_0x60157f['push'](_0x60157f['shift']());}};_0x109db1(++_0x22d244);}(_0xc081,0x143));var _0x1c08=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xc081[_0x21f9c2];return _0x3da17f;};'use strict';var Sequelize=require('sequelize');module[_0x1c08('0x0')]={'key':{'type':Sequelize[_0x1c08('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1c08('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1c08('0x1')]},'name':{'type':Sequelize[_0x1c08('0x3')],'get':function(){return this['getDataValue'](_0x1c08('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index e09f569..a59b7a6 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 _0x77fb=['filter','where','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','UserProfileResource','then','stack','name','index','map','CannedAnswer','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x3c46bf,_0x22ea4f){var _0x24efe6=function(_0x2c5288){while(--_0x2c5288){_0x3c46bf['push'](_0x3c46bf['shift']());}};_0x24efe6(++_0x22ea4f);}(_0x77fb,0xc3));var _0xb77f=function(_0x390784,_0x513443){_0x390784=_0x390784-0x0;var _0x311d00=_0x77fb[_0x390784];return _0x311d00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb77f('0x0'));var zipdir=require(_0xb77f('0x1'));var jsonpatch=require(_0xb77f('0x2'));var rp=require('request-promise');var moment=require(_0xb77f('0x3'));var BPromise=require(_0xb77f('0x4'));var Mustache=require('mustache');var util=require(_0xb77f('0x5'));var path=require(_0xb77f('0x6'));var sox=require(_0xb77f('0x7'));var csv=require('to-csv');var ejs=require(_0xb77f('0x8'));var fs=require('fs');var fs_extra=require(_0xb77f('0x9'));var _=require('lodash');var squel=require(_0xb77f('0xa'));var crypto=require(_0xb77f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb77f('0xc'));var querystring=require(_0xb77f('0xd'));var Papa=require('papaparse');var Redis=require(_0xb77f('0xe'));var authService=require(_0xb77f('0xf'));var qs=require(_0xb77f('0x10'));var as=require(_0xb77f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb77f('0x12'))(_0xb77f('0x13'));var utils=require(_0xb77f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30612b,_0x5d9a9c){_0x5d9a9c=_0x5d9a9c||0xcc;return function(_0x333a76){if(_0x333a76){return _0x30612b[_0xb77f('0x15')](_0x5d9a9c);}return _0x30612b['status'](_0x5d9a9c)[_0xb77f('0x16')]();};}function respondWithResult(_0x3a061c,_0x1b0dd8){_0x1b0dd8=_0x1b0dd8||0xc8;return function(_0x519b8d){if(_0x519b8d){return _0x3a061c[_0xb77f('0x17')](_0x1b0dd8)[_0xb77f('0x18')](_0x519b8d);}};}function respondWithFilteredResult(_0x26e7af,_0x203485){return function(_0x387a7f){if(_0x387a7f){var _0x4f24e8=typeof _0x203485[_0xb77f('0x19')]===_0xb77f('0x1a')&&typeof _0x203485['limit']===_0xb77f('0x1a');var _0x792b5a=_0x387a7f[_0xb77f('0x1b')];var _0x36155b=_0x4f24e8?0x0:_0x203485[_0xb77f('0x19')];var _0xad2918=_0x4f24e8?_0x387a7f[_0xb77f('0x1b')]:_0x203485['offset']+_0x203485[_0xb77f('0x1c')];var _0x521528;if(_0xad2918>=_0x792b5a){_0xad2918=_0x792b5a;_0x521528=0xc8;}else{_0x521528=0xce;}_0x26e7af[_0xb77f('0x17')](_0x521528);return _0x26e7af[_0xb77f('0x1d')](_0xb77f('0x1e'),_0x36155b+'-'+_0xad2918+'/'+_0x792b5a)[_0xb77f('0x18')](_0x387a7f);}return null;};}function patchUpdates(_0x43f4d8){return function(_0x16ecd2){try{jsonpatch[_0xb77f('0x1f')](_0x16ecd2,_0x43f4d8,!![]);}catch(_0x394a3d){return BPromise[_0xb77f('0x20')](_0x394a3d);}return _0x16ecd2['save']();};}function saveUpdates(_0x2c621d,_0x23f514){return function(_0x3aaef1){if(_0x3aaef1){return _0x3aaef1[_0xb77f('0x21')](_0x2c621d)['then'](function(_0x5deede){return _0x5deede;});}return null;};}function removeEntity(_0x3391aa,_0x5377a8){return function(_0x569e45){if(_0x569e45){return _0x569e45[_0xb77f('0x22')]()['then'](function(){var _0x3232e4=_0x569e45['get']({'plain':!![]});var _0x3c28ff='CannedAnswers';return db[_0xb77f('0x23')][_0xb77f('0x22')]({'where':{'type':_0x3c28ff,'resourceId':_0x3232e4['id']}})[_0xb77f('0x24')](function(){return _0x569e45;});})[_0xb77f('0x24')](function(){_0x3391aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3201c9,_0x2d4ea5){return function(_0x3d5252){if(!_0x3d5252){_0x3201c9['sendStatus'](0x194);}return _0x3d5252;};}function handleError(_0x3117e2,_0x29a314){_0x29a314=_0x29a314||0x1f4;return function(_0x48146b){logger['error'](_0x48146b[_0xb77f('0x25')]);if(_0x48146b[_0xb77f('0x26')]){delete _0x48146b[_0xb77f('0x26')];}_0x3117e2[_0xb77f('0x17')](_0x29a314)['send'](_0x48146b);};}exports[_0xb77f('0x27')]=function(_0x168c5a,_0x2be1a6){var _0x39e613={},_0x5b48be={},_0x3f4782={'count':0x0,'rows':[]};var _0x451ed0=_[_0xb77f('0x28')](db[_0xb77f('0x29')][_0xb77f('0x2a')],function(_0x19a9ad){return{'name':_0x19a9ad['fieldName'],'type':_0x19a9ad['type'][_0xb77f('0x2b')]};});_0x5b48be[_0xb77f('0x2c')]=_[_0xb77f('0x28')](_0x451ed0,'name');_0x5b48be['query']=_[_0xb77f('0x2d')](_0x168c5a[_0xb77f('0x2e')]);_0x5b48be[_0xb77f('0x2f')]=_['intersection'](_0x5b48be['model'],_0x5b48be['query']);_0x39e613[_0xb77f('0x30')]=_[_0xb77f('0x31')](_0x5b48be[_0xb77f('0x2c')],qs[_0xb77f('0x32')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x32')]));_0x39e613[_0xb77f('0x30')]=_0x39e613[_0xb77f('0x30')][_0xb77f('0x33')]?_0x39e613[_0xb77f('0x30')]:_0x5b48be['model'];if(!_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x34')](_0xb77f('0x35'))){_0x39e613[_0xb77f('0x1c')]=qs[_0xb77f('0x1c')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x1c')]);_0x39e613[_0xb77f('0x19')]=qs['offset'](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x19')]);}_0x39e613[_0xb77f('0x36')]=qs[_0xb77f('0x37')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x37')]);_0x39e613['where']=qs[_0xb77f('0x2f')](_[_0xb77f('0x38')](_0x168c5a[_0xb77f('0x2e')],_0x5b48be[_0xb77f('0x2f')]),_0x451ed0);if(_0x168c5a['query'][_0xb77f('0x39')]){_0x39e613[_0xb77f('0x3a')]=_['merge'](_0x39e613[_0xb77f('0x3a')],{'$or':[{'key':{'$like':'%'+_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x39')]+'%'}},{'value':{'$like':'%'+_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x39')]+'%'}}]});}_0x39e613=_[_0xb77f('0x3b')]({},_0x39e613,_0x168c5a[_0xb77f('0x3c')]);var _0x1fd1fc={'where':_0x39e613[_0xb77f('0x3a')]};return db[_0xb77f('0x29')][_0xb77f('0x1b')](_0x1fd1fc)['then'](function(_0x2b8b9a){_0x3f4782[_0xb77f('0x1b')]=_0x2b8b9a;if(_0x168c5a[_0xb77f('0x2e')]['includeAll']){_0x39e613[_0xb77f('0x3d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb77f('0x3e')](_0x39e613);})[_0xb77f('0x24')](function(_0x3cad5f){_0x3f4782[_0xb77f('0x3f')]=_0x3cad5f;return _0x3f4782;})['then'](respondWithFilteredResult(_0x2be1a6,_0x39e613))[_0xb77f('0x40')](handleError(_0x2be1a6,null));};exports[_0xb77f('0x41')]=function(_0x326247,_0xf46e27){var _0x401a23={'raw':!![],'where':{'id':_0x326247[_0xb77f('0x42')]['id']}},_0x494364={};_0x494364[_0xb77f('0x2c')]=_[_0xb77f('0x2d')](db['CannedAnswer'][_0xb77f('0x2a')]);_0x494364['query']=_[_0xb77f('0x2d')](_0x326247[_0xb77f('0x2e')]);_0x494364[_0xb77f('0x2f')]=_[_0xb77f('0x31')](_0x494364[_0xb77f('0x2c')],_0x494364[_0xb77f('0x2e')]);_0x401a23[_0xb77f('0x30')]=_['intersection'](_0x494364['model'],qs[_0xb77f('0x32')](_0x326247[_0xb77f('0x2e')]['fields']));_0x401a23['attributes']=_0x401a23[_0xb77f('0x30')][_0xb77f('0x33')]?_0x401a23['attributes']:_0x494364[_0xb77f('0x2c')];if(_0x326247[_0xb77f('0x2e')][_0xb77f('0x43')]){_0x401a23['include']=[{'all':!![]}];}_0x401a23=_[_0xb77f('0x3b')]({},_0x401a23,_0x326247[_0xb77f('0x3c')]);return db[_0xb77f('0x29')][_0xb77f('0x44')](_0x401a23)['then'](handleEntityNotFound(_0xf46e27,null))[_0xb77f('0x24')](respondWithResult(_0xf46e27,null))[_0xb77f('0x40')](handleError(_0xf46e27,null));};exports[_0xb77f('0x21')]=function(_0x45221b,_0x1aff03){if(_0x45221b[_0xb77f('0x45')]['id']){delete _0x45221b['body']['id'];}return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':{'id':_0x45221b[_0xb77f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1aff03,null))[_0xb77f('0x24')](saveUpdates(_0x45221b['body'],null))['then'](respondWithResult(_0x1aff03,null))[_0xb77f('0x40')](handleError(_0x1aff03,null));};exports[_0xb77f('0x22')]=function(_0x3d97d2,_0x21f16c){return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':{'id':_0x3d97d2[_0xb77f('0x42')]['id']}})[_0xb77f('0x24')](handleEntityNotFound(_0x21f16c,null))[_0xb77f('0x24')](removeEntity(_0x21f16c,null))[_0xb77f('0x40')](handleError(_0x21f16c,null));};exports['create']=function(_0x1b4dd4,_0xd5f64d){var _0x15c49d={'key':_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x2b')]};if(_0x1b4dd4['body'][_0xb77f('0x46')]){_0x15c49d[_0xb77f('0x46')]=_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x46')];}else if(_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x47')]){_0x15c49d[_0xb77f('0x47')]=_0x1b4dd4[_0xb77f('0x45')]['SmsAccountId'];}else if(_0x1b4dd4[_0xb77f('0x45')]['OpenchannelAccountId']){_0x15c49d[_0xb77f('0x48')]=_0x1b4dd4['body']['OpenchannelAccountId'];}else if(_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x49')]){_0x15c49d[_0xb77f('0x49')]=_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x49')];}return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':_0x15c49d})[_0xb77f('0x24')](function(_0x165b43){if(_0x165b43){throw new db[(_0xb77f('0x4a'))][(_0xb77f('0x4b'))](_0xb77f('0x4c'));}return db[_0xb77f('0x29')][_0xb77f('0x4d')](_0x1b4dd4[_0xb77f('0x45')]);})[_0xb77f('0x24')](function(_0x9d1c94){var _0x4702bd=_0x1b4dd4[_0xb77f('0x4e')][_0xb77f('0x4f')]({'plain':!![]});if(!_0x4702bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4702bd['role']==='user'){var _0x57011a=_0x9d1c94['get']({'plain':!![]});return db['UserProfileSection'][_0xb77f('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x4702bd[_0xb77f('0x50')]},'raw':!![]})[_0xb77f('0x24')](function(_0x421198){if(_0x421198&&_0x421198[_0xb77f('0x51')]===0x0){return db[_0xb77f('0x23')][_0xb77f('0x4d')]({'name':_0x57011a['name'],'resourceId':_0x57011a['id'],'type':_0x421198['name'],'sectionId':_0x421198['id']},{})[_0xb77f('0x24')](function(){return _0x9d1c94;});}else{return _0x9d1c94;}})['catch'](function(_0x40cfac){logger[_0xb77f('0x52')](_0xb77f('0x53'),_0x40cfac);throw _0x40cfac;});}return _0x9d1c94;})[_0xb77f('0x24')](respondWithResult(_0xd5f64d,0xc9))['catch'](handleError(_0xd5f64d,null));};
\ No newline at end of file
+var _0xf188=['destroy','then','get','CannedAnswers','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xf188,0x8c));var _0x8f18=function(_0x579d37,_0x378bc1){_0x579d37=_0x579d37-0x0;var _0x431c5b=_0xf188[_0x579d37];return _0x431c5b;};'use strict';var emlformat=require(_0x8f18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f18('0x2'));var BPromise=require(_0x8f18('0x3'));var Mustache=require('mustache');var util=require(_0x8f18('0x4'));var path=require(_0x8f18('0x5'));var sox=require(_0x8f18('0x6'));var csv=require(_0x8f18('0x7'));var ejs=require(_0x8f18('0x8'));var fs=require('fs');var fs_extra=require(_0x8f18('0x9'));var _=require(_0x8f18('0xa'));var squel=require(_0x8f18('0xb'));var crypto=require(_0x8f18('0xc'));var jsforce=require(_0x8f18('0xd'));var deskjs=require(_0x8f18('0xe'));var toCsv=require(_0x8f18('0x7'));var querystring=require('querystring');var Papa=require(_0x8f18('0xf'));var Redis=require(_0x8f18('0x10'));var authService=require(_0x8f18('0x11'));var qs=require(_0x8f18('0x12'));var as=require(_0x8f18('0x13'));var hardwareService=require(_0x8f18('0x14'));var logger=require(_0x8f18('0x15'))(_0x8f18('0x16'));var utils=require(_0x8f18('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8f18('0x18'));var db=require(_0x8f18('0x19'))['db'];function respondWithStatusCode(_0x1f83ba,_0x4a17ab){_0x4a17ab=_0x4a17ab||0xcc;return function(_0x45ca90){if(_0x45ca90){return _0x1f83ba[_0x8f18('0x1a')](_0x4a17ab);}return _0x1f83ba[_0x8f18('0x1b')](_0x4a17ab)[_0x8f18('0x1c')]();};}function respondWithResult(_0x2ab3f4,_0xaa5b68){_0xaa5b68=_0xaa5b68||0xc8;return function(_0x426799){if(_0x426799){return _0x2ab3f4['status'](_0xaa5b68)[_0x8f18('0x1d')](_0x426799);}};}function respondWithFilteredResult(_0xb46859,_0xb5c6aa){return function(_0xf154b2){if(_0xf154b2){var _0x52f2ce=typeof _0xb5c6aa[_0x8f18('0x1e')]==='undefined'&&typeof _0xb5c6aa[_0x8f18('0x1f')]==='undefined';var _0x5b5e13=_0xf154b2[_0x8f18('0x20')];var _0x5401eb=_0x52f2ce?0x0:_0xb5c6aa['offset'];var _0x1e09c0=_0x52f2ce?_0xf154b2[_0x8f18('0x20')]:_0xb5c6aa[_0x8f18('0x1e')]+_0xb5c6aa[_0x8f18('0x1f')];var _0x50bf4d;if(_0x1e09c0>=_0x5b5e13){_0x1e09c0=_0x5b5e13;_0x50bf4d=0xc8;}else{_0x50bf4d=0xce;}_0xb46859[_0x8f18('0x1b')](_0x50bf4d);return _0xb46859[_0x8f18('0x21')](_0x8f18('0x22'),_0x5401eb+'-'+_0x1e09c0+'/'+_0x5b5e13)[_0x8f18('0x1d')](_0xf154b2);}return null;};}function patchUpdates(_0x4c86c9){return function(_0x106166){try{jsonpatch[_0x8f18('0x23')](_0x106166,_0x4c86c9,!![]);}catch(_0x5122f4){return BPromise['reject'](_0x5122f4);}return _0x106166['save']();};}function saveUpdates(_0x38defb,_0x4f87b5){return function(_0x396241){if(_0x396241){return _0x396241['update'](_0x38defb)['then'](function(_0x2bdd0f){return _0x2bdd0f;});}return null;};}function removeEntity(_0x297ccc,_0x423b3a){return function(_0x2a4066){if(_0x2a4066){return _0x2a4066[_0x8f18('0x24')]()[_0x8f18('0x25')](function(){var _0x3dc979=_0x2a4066[_0x8f18('0x26')]({'plain':!![]});var _0x6c536b=_0x8f18('0x27');return db[_0x8f18('0x28')][_0x8f18('0x24')]({'where':{'type':_0x6c536b,'resourceId':_0x3dc979['id']}})[_0x8f18('0x25')](function(){return _0x2a4066;});})[_0x8f18('0x25')](function(){_0x297ccc[_0x8f18('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277281,_0x2822f2){return function(_0x4dba87){if(!_0x4dba87){_0x277281[_0x8f18('0x1a')](0x194);}return _0x4dba87;};}function handleError(_0x1450fb,_0x5bbf05){_0x5bbf05=_0x5bbf05||0x1f4;return function(_0xb5e20f){logger[_0x8f18('0x29')](_0xb5e20f[_0x8f18('0x2a')]);if(_0xb5e20f['name']){delete _0xb5e20f['name'];}_0x1450fb[_0x8f18('0x1b')](_0x5bbf05)[_0x8f18('0x2b')](_0xb5e20f);};}exports[_0x8f18('0x2c')]=function(_0x5c9f70,_0x14bf47){var _0x41e970={},_0x282933={},_0x421c75={'count':0x0,'rows':[]};var _0x48479a=_[_0x8f18('0x2d')](db['CannedAnswer'][_0x8f18('0x2e')],function(_0x3ea112){return{'name':_0x3ea112[_0x8f18('0x2f')],'type':_0x3ea112[_0x8f18('0x30')]['key']};});_0x282933[_0x8f18('0x31')]=_[_0x8f18('0x2d')](_0x48479a,_0x8f18('0x32'));_0x282933['query']=_[_0x8f18('0x33')](_0x5c9f70[_0x8f18('0x34')]);_0x282933[_0x8f18('0x35')]=_[_0x8f18('0x36')](_0x282933['model'],_0x282933[_0x8f18('0x34')]);_0x41e970[_0x8f18('0x37')]=_[_0x8f18('0x36')](_0x282933['model'],qs[_0x8f18('0x38')](_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x38')]));_0x41e970[_0x8f18('0x37')]=_0x41e970[_0x8f18('0x37')][_0x8f18('0x39')]?_0x41e970[_0x8f18('0x37')]:_0x282933[_0x8f18('0x31')];if(!_0x5c9f70['query'][_0x8f18('0x3a')](_0x8f18('0x3b'))){_0x41e970[_0x8f18('0x1f')]=qs[_0x8f18('0x1f')](_0x5c9f70['query'][_0x8f18('0x1f')]);_0x41e970[_0x8f18('0x1e')]=qs[_0x8f18('0x1e')](_0x5c9f70[_0x8f18('0x34')]['offset']);}_0x41e970['order']=qs[_0x8f18('0x3c')](_0x5c9f70[_0x8f18('0x34')]['sort']);_0x41e970[_0x8f18('0x3d')]=qs['filters'](_[_0x8f18('0x3e')](_0x5c9f70[_0x8f18('0x34')],_0x282933[_0x8f18('0x35')]),_0x48479a);if(_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x3f')]){_0x41e970[_0x8f18('0x3d')]=_[_0x8f18('0x40')](_0x41e970[_0x8f18('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x3f')]+'%'}},{'value':{'$like':'%'+_0x5c9f70[_0x8f18('0x34')]['filter']+'%'}}]});}_0x41e970=_['merge']({},_0x41e970,_0x5c9f70[_0x8f18('0x41')]);var _0x36558a={'where':_0x41e970[_0x8f18('0x3d')]};return db[_0x8f18('0x42')]['count'](_0x36558a)[_0x8f18('0x25')](function(_0x2ba4f4){_0x421c75['count']=_0x2ba4f4;if(_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x43')]){_0x41e970['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8f18('0x44')](_0x41e970);})['then'](function(_0xfe3c3b){_0x421c75[_0x8f18('0x45')]=_0xfe3c3b;return _0x421c75;})[_0x8f18('0x25')](respondWithFilteredResult(_0x14bf47,_0x41e970))[_0x8f18('0x46')](handleError(_0x14bf47,null));};exports['show']=function(_0x10be9b,_0x3c04ec){var _0x5afece={'raw':!![],'where':{'id':_0x10be9b[_0x8f18('0x47')]['id']}},_0x5879df={};_0x5879df[_0x8f18('0x31')]=_[_0x8f18('0x33')](db[_0x8f18('0x42')][_0x8f18('0x2e')]);_0x5879df[_0x8f18('0x34')]=_[_0x8f18('0x33')](_0x10be9b[_0x8f18('0x34')]);_0x5879df['filters']=_[_0x8f18('0x36')](_0x5879df[_0x8f18('0x31')],_0x5879df['query']);_0x5afece['attributes']=_[_0x8f18('0x36')](_0x5879df[_0x8f18('0x31')],qs[_0x8f18('0x38')](_0x10be9b[_0x8f18('0x34')][_0x8f18('0x38')]));_0x5afece[_0x8f18('0x37')]=_0x5afece[_0x8f18('0x37')]['length']?_0x5afece[_0x8f18('0x37')]:_0x5879df['model'];if(_0x10be9b[_0x8f18('0x34')][_0x8f18('0x43')]){_0x5afece['include']=[{'all':!![]}];}_0x5afece=_['merge']({},_0x5afece,_0x10be9b['options']);return db[_0x8f18('0x42')][_0x8f18('0x48')](_0x5afece)[_0x8f18('0x25')](handleEntityNotFound(_0x3c04ec,null))[_0x8f18('0x25')](respondWithResult(_0x3c04ec,null))[_0x8f18('0x46')](handleError(_0x3c04ec,null));};exports['update']=function(_0x4f0c05,_0x2c6b4c){if(_0x4f0c05[_0x8f18('0x49')]['id']){delete _0x4f0c05['body']['id'];}return db[_0x8f18('0x42')]['find']({'where':{'id':_0x4f0c05[_0x8f18('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c6b4c,null))[_0x8f18('0x25')](saveUpdates(_0x4f0c05['body'],null))['then'](respondWithResult(_0x2c6b4c,null))[_0x8f18('0x46')](handleError(_0x2c6b4c,null));};exports[_0x8f18('0x24')]=function(_0x3e6e8e,_0x59f282){return db[_0x8f18('0x42')]['find']({'where':{'id':_0x3e6e8e[_0x8f18('0x47')]['id']}})[_0x8f18('0x25')](handleEntityNotFound(_0x59f282,null))['then'](removeEntity(_0x59f282,null))['catch'](handleError(_0x59f282,null));};exports[_0x8f18('0x4a')]=function(_0x2f0c0c,_0x59522d){var _0xaa8ee3={'key':_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4b')]};if(_0x2f0c0c[_0x8f18('0x49')]['MailAccountId']){_0xaa8ee3[_0x8f18('0x4c')]=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4c')];}else if(_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4d')]){_0xaa8ee3[_0x8f18('0x4d')]=_0x2f0c0c['body'][_0x8f18('0x4d')];}else if(_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4e')]){_0xaa8ee3['OpenchannelAccountId']=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4e')];}else if(_0x2f0c0c['body']['ChatWebsiteId']){_0xaa8ee3[_0x8f18('0x4f')]=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4f')];}return db[_0x8f18('0x42')][_0x8f18('0x48')]({'where':_0xaa8ee3})['then'](function(_0x331056){if(_0x331056){throw new db[(_0x8f18('0x50'))][(_0x8f18('0x51'))](_0x8f18('0x52'));}return db[_0x8f18('0x42')][_0x8f18('0x4a')](_0x2f0c0c[_0x8f18('0x49')]);})[_0x8f18('0x25')](function(_0x3874e6){var _0x432a29=_0x2f0c0c[_0x8f18('0x53')][_0x8f18('0x26')]({'plain':!![]});if(!_0x432a29)throw new Error(_0x8f18('0x54'));if(_0x432a29['role']===_0x8f18('0x53')){var _0x162cb3=_0x3874e6[_0x8f18('0x26')]({'plain':!![]});return db[_0x8f18('0x55')]['find']({'where':{'name':_0x8f18('0x27'),'userProfileId':_0x432a29['userProfileId']},'raw':!![]})[_0x8f18('0x25')](function(_0x2248be){if(_0x2248be&&_0x2248be[_0x8f18('0x56')]===0x0){return db[_0x8f18('0x28')][_0x8f18('0x4a')]({'name':_0x162cb3[_0x8f18('0x32')],'resourceId':_0x162cb3['id'],'type':_0x2248be[_0x8f18('0x32')],'sectionId':_0x2248be['id']},{})[_0x8f18('0x25')](function(){return _0x3874e6;});}else{return _0x3874e6;}})[_0x8f18('0x46')](function(_0x516ed5){logger[_0x8f18('0x29')](_0x8f18('0x57'),_0x516ed5);throw _0x516ed5;});}return _0x3874e6;})[_0x8f18('0x25')](respondWithResult(_0x59522d,0xc9))[_0x8f18('0x46')](handleError(_0x59522d,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 3e95d9d..bc922bc 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 _0x8f09=['tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x8f09,0x157));var _0x98f0=function(_0x2f2d97,_0x43fcb9){_0x2f2d97=_0x2f2d97-0x0;var _0x1c0a52=_0x8f09[_0x2f2d97];return _0x1c0a52;};'use strict';var _=require(_0x98f0('0x0'));var util=require('util');var logger=require(_0x98f0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x98f0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f0('0x3'));var rimraf=require(_0x98f0('0x4'));var config=require(_0x98f0('0x5'));var attributes=require(_0x98f0('0x6'));module['exports']=function(_0x92b6b2,_0x94ffa2){return _0x92b6b2[_0x98f0('0x7')](_0x98f0('0x8'),attributes,{'tableName':_0x98f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x98f0('0xa')});};
\ No newline at end of file
+var _0xea10=['rimraf','../../config/environment','./cannedAnswer.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xea10,0x95));var _0x0ea1=function(_0x32abbe,_0x4649c2){_0x32abbe=_0x32abbe-0x0;var _0x40ea67=_0xea10[_0x32abbe];return _0x40ea67;};'use strict';var _=require(_0x0ea1('0x0'));var util=require(_0x0ea1('0x1'));var logger=require('../../config/logger')(_0x0ea1('0x2'));var moment=require(_0x0ea1('0x3'));var BPromise=require(_0x0ea1('0x4'));var rp=require(_0x0ea1('0x5'));var fs=require('fs');var path=require(_0x0ea1('0x6'));var rimraf=require(_0x0ea1('0x7'));var config=require(_0x0ea1('0x8'));var attributes=require(_0x0ea1('0x9'));module['exports']=function(_0xd81f3e,_0xeb349b){return _0xd81f3e['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ea1('0xa'),'collate':_0x0ea1('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 0043e7e..b8a2eaa 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(_0x2b39f8,_0x4d8c2e){var _0x273fc6=function(_0x2e4201){while(--_0x2e4201){_0x2b39f8['push'](_0x2b39f8['shift']());}};_0x273fc6(++_0x4d8c2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x4e8a09,_0x3f02ec){var _0x23b670=function(_0x27b3bc){while(--_0x27b3bc){_0x4e8a09['push'](_0x4e8a09['shift']());}};_0x23b670(++_0x3f02ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 49b9003..f670c6d 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 _0xf954=['/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x4f50ac,_0x7efc91){var _0x62030d=function(_0x356907){while(--_0x356907){_0x4f50ac['push'](_0x4f50ac['shift']());}};_0x62030d(++_0x7efc91);}(_0xf954,0x106));var _0x4f95=function(_0x42f6ca,_0x268900){_0x42f6ca=_0x42f6ca-0x0;var _0x509ea9=_0xf954[_0x42f6ca];return _0x509ea9;};'use strict';var multer=require(_0x4f95('0x0'));var util=require(_0x4f95('0x1'));var path=require(_0x4f95('0x2'));var timeout=require(_0x4f95('0x3'));var express=require(_0x4f95('0x4'));var router=express[_0x4f95('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4f95('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f95('0x7'));var controller=require(_0x4f95('0x8'));router[_0x4f95('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4f95('0xa'),auth[_0x4f95('0xb')](),controller[_0x4f95('0xc')]);router[_0x4f95('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4f95('0xe')]);router[_0x4f95('0xf')](_0x4f95('0xa'),auth[_0x4f95('0xb')](),controller[_0x4f95('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x98a1=['./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x98a1,0x171));var _0x198a=function(_0x1cf1cc,_0x2e63b2){_0x1cf1cc=_0x1cf1cc-0x0;var _0x1d5fb8=_0x98a1[_0x1cf1cc];return _0x1d5fb8;};'use strict';var multer=require('multer');var util=require(_0x198a('0x0'));var path=require(_0x198a('0x1'));var timeout=require(_0x198a('0x2'));var express=require(_0x198a('0x3'));var router=express[_0x198a('0x4')]();var fs_extra=require(_0x198a('0x5'));var auth=require(_0x198a('0x6'));var interaction=require(_0x198a('0x7'));var config=require(_0x198a('0x8'));var controller=require(_0x198a('0x9'));router['get']('/',auth[_0x198a('0xa')](),controller[_0x198a('0xb')]);router[_0x198a('0xc')](_0x198a('0xd'),auth['isAuthenticated'](),controller[_0x198a('0xe')]);router[_0x198a('0xf')]('/',auth[_0x198a('0xa')](),controller['create']);router['put'](_0x198a('0xd'),auth['isAuthenticated'](),controller[_0x198a('0x10')]);router['delete'](_0x198a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x198a('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 8b1f48d..e954256 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 _0xbe0f=['exports','STRING','INTEGER','sequelize'];(function(_0x2113d6,_0x45e5f5){var _0x14554c=function(_0xc5f39a){while(--_0xc5f39a){_0x2113d6['push'](_0x2113d6['shift']());}};_0x14554c(++_0x45e5f5);}(_0xbe0f,0x1d3));var _0xfbe0=function(_0x8bd3fe,_0x4efbf8){_0x8bd3fe=_0x8bd3fe-0x0;var _0x3ef569=_0xbe0f[_0x8bd3fe];return _0x3ef569;};'use strict';var Sequelize=require(_0xfbe0('0x0'));module[_0xfbe0('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xfbe0('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xfbe0('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfbe0('0x2')]},'dstchannel':{'type':Sequelize[_0xfbe0('0x2')]},'lastapp':{'type':Sequelize[_0xfbe0('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfbe0('0x2')]},'userfield':{'type':Sequelize[_0xfbe0('0x2')]},'uniqueid':{'type':Sequelize[_0xfbe0('0x2')]},'linkedid':{'type':Sequelize[_0xfbe0('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xfbe0('0x2')]},'type':{'type':Sequelize[_0xfbe0('0x2')]},'tag':{'type':Sequelize[_0xfbe0('0x2')]}};
\ No newline at end of file
+var _0x138d=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x143558,_0x2e9f17){var _0x426caa=function(_0x5b2213){while(--_0x5b2213){_0x143558['push'](_0x143558['shift']());}};_0x426caa(++_0x2e9f17);}(_0x138d,0x1ab));var _0xd138=function(_0x325a08,_0x571fff){_0x325a08=_0x325a08-0x0;var _0x436e01=_0x138d[_0x325a08];return _0x436e01;};'use strict';var Sequelize=require(_0xd138('0x0'));module[_0xd138('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd138('0x2')},'clid':{'type':Sequelize[_0xd138('0x3')]},'src':{'type':Sequelize[_0xd138('0x3')]},'dst':{'type':Sequelize[_0xd138('0x3')]},'dcontext':{'type':Sequelize[_0xd138('0x3')]},'channel':{'type':Sequelize[_0xd138('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd138('0x3')]},'lastdata':{'type':Sequelize[_0xd138('0x3')]},'duration':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd138('0x3')]},'amaflags':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd138('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xd138('0x3')]},'sequence':{'type':Sequelize[_0xd138('0x3')]},'peeraccount':{'type':Sequelize[_0xd138('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xd138('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 814245a..17fbd33 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 _0x2d17=['destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','then','error','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','count','includeAll','include','findAll','rows','show','params','find','catch','create','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0x33c383,_0x202cbe){_0x33c383=_0x33c383-0x0;var _0x49bc8c=_0x2d17[_0x33c383];return _0x49bc8c;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={},_0x32588f={},_0x2cc0c8={'count':0x0,'rows':[]};var _0x51242b=_[_0x72d1('0x27')](db['Cdr'][_0x72d1('0x28')],function(_0x32dc5e){return{'name':_0x32dc5e['fieldName'],'type':_0x32dc5e[_0x72d1('0x29')][_0x72d1('0x2a')]};});_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x27')](_0x51242b,_0x72d1('0x25'));_0x32588f['query']=_[_0x72d1('0x2c')](_0x4c4c41[_0x72d1('0x2d')]);_0x32588f[_0x72d1('0x2e')]=_['intersection'](_0x32588f[_0x72d1('0x2b')],_0x32588f[_0x72d1('0x2d')]);_0x20055f['attributes']=_[_0x72d1('0x2f')](_0x32588f[_0x72d1('0x2b')],qs[_0x72d1('0x30')](_0x4c4c41['query'][_0x72d1('0x30')]));_0x20055f['attributes']=_0x20055f[_0x72d1('0x31')][_0x72d1('0x32')]?_0x20055f[_0x72d1('0x31')]:_0x32588f[_0x72d1('0x2b')];if(!_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x33')](_0x72d1('0x34'))){_0x20055f[_0x72d1('0x1f')]=qs[_0x72d1('0x1f')](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x1f')]);_0x20055f['offset']=qs[_0x72d1('0x1e')](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x1e')]);}_0x20055f[_0x72d1('0x35')]=qs['sort'](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x36')]);_0x20055f[_0x72d1('0x37')]=qs['filters'](_[_0x72d1('0x38')](_0x4c4c41[_0x72d1('0x2d')],_0x32588f[_0x72d1('0x2e')]),_0x51242b);if(_0x4c4c41['query'][_0x72d1('0x39')]){_0x20055f[_0x72d1('0x37')]=_[_0x72d1('0x3a')](_0x20055f['where'],{'$or':_[_0x72d1('0x27')](_0x51242b,function(_0x40cdbd){if(_0x40cdbd[_0x72d1('0x29')]!==_0x72d1('0x3b')){var _0x44c4f5={};_0x44c4f5[_0x40cdbd[_0x72d1('0x25')]]={'$like':'%'+_0x4c4c41[_0x72d1('0x2d')]['filter']+'%'};return _0x44c4f5;}})});}_0x20055f=_[_0x72d1('0x3a')]({},_0x20055f,_0x4c4c41[_0x72d1('0x3c')]);var _0x440ac5={'where':_0x20055f[_0x72d1('0x37')]};return db[_0x72d1('0x3d')][_0x72d1('0x3e')](_0x440ac5)[_0x72d1('0x23')](function(_0x1d4fdf){_0x2cc0c8['count']=_0x1d4fdf;if(_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x3f')]){_0x20055f[_0x72d1('0x40')]=[{'all':!![]}];}return db[_0x72d1('0x3d')][_0x72d1('0x41')](_0x20055f);})[_0x72d1('0x23')](function(_0xb911fa){_0x2cc0c8[_0x72d1('0x42')]=_0xb911fa;return _0x2cc0c8;})['then'](respondWithFilteredResult(_0x707cd0,_0x20055f))['catch'](handleError(_0x707cd0,null));};exports[_0x72d1('0x43')]=function(_0x881d97,_0x824c17){var _0x21d361={'raw':!![],'where':{'id':_0x881d97[_0x72d1('0x44')]['id']}},_0x5a6bc4={};_0x5a6bc4[_0x72d1('0x2b')]=_['keys'](db[_0x72d1('0x3d')]['rawAttributes']);_0x5a6bc4[_0x72d1('0x2d')]=_[_0x72d1('0x2c')](_0x881d97['query']);_0x5a6bc4[_0x72d1('0x2e')]=_['intersection'](_0x5a6bc4['model'],_0x5a6bc4['query']);_0x21d361[_0x72d1('0x31')]=_['intersection'](_0x5a6bc4[_0x72d1('0x2b')],qs[_0x72d1('0x30')](_0x881d97[_0x72d1('0x2d')]['fields']));_0x21d361['attributes']=_0x21d361[_0x72d1('0x31')]['length']?_0x21d361['attributes']:_0x5a6bc4[_0x72d1('0x2b')];if(_0x881d97[_0x72d1('0x2d')][_0x72d1('0x3f')]){_0x21d361['include']=[{'all':!![]}];}_0x21d361=_['merge']({},_0x21d361,_0x881d97['options']);return db['Cdr'][_0x72d1('0x45')](_0x21d361)[_0x72d1('0x23')](handleEntityNotFound(_0x824c17,null))[_0x72d1('0x23')](respondWithResult(_0x824c17,null))[_0x72d1('0x46')](handleError(_0x824c17,null));};exports[_0x72d1('0x47')]=function(_0x1ba64e,_0x1d1465){return db[_0x72d1('0x3d')][_0x72d1('0x47')](_0x1ba64e['body'],{})[_0x72d1('0x23')](respondWithResult(_0x1d1465,0xc9))[_0x72d1('0x46')](handleError(_0x1d1465,null));};exports[_0x72d1('0x48')]=function(_0x51b1a9,_0x418e6f){if(_0x51b1a9[_0x72d1('0x49')]['id']){delete _0x51b1a9[_0x72d1('0x49')]['id'];}return db['Cdr'][_0x72d1('0x45')]({'where':{'id':_0x51b1a9[_0x72d1('0x44')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x418e6f,null))[_0x72d1('0x23')](saveUpdates(_0x51b1a9['body'],null))['then'](respondWithResult(_0x418e6f,null))[_0x72d1('0x46')](handleError(_0x418e6f,null));};exports[_0x72d1('0x4a')]=function(_0x1a8dd2,_0x5ad683){return db[_0x72d1('0x3d')][_0x72d1('0x45')]({'where':{'id':_0x1a8dd2[_0x72d1('0x44')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x5ad683,null))[_0x72d1('0x23')](removeEntity(_0x5ad683,null))[_0x72d1('0x46')](handleError(_0x5ad683,null));};exports[_0x72d1('0x4b')]=function(_0xebe855,_0x12870c){return db[_0x72d1('0x3d')][_0x72d1('0x4b')]()['then'](respondWithResult(_0x12870c,null))[_0x72d1('0x46')](handleError(_0x12870c,null));};
\ No newline at end of file
+var _0x3c6c=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x2cf37f,_0x2217b7){var _0x1bd369=function(_0x12d071){while(--_0x12d071){_0x2cf37f['push'](_0x2cf37f['shift']());}};_0x1bd369(++_0x2217b7);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x161a85,_0x5740c5){_0x161a85=_0x161a85-0x0;var _0x427798=_0x3c6c[_0x161a85];return _0x427798;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={},_0xb047b1={},_0x4571f4={'count':0x0,'rows':[]};var _0x31975e=_[_0xc3c6('0x29')](db['Cdr'][_0xc3c6('0x2a')],function(_0x1bcc34){return{'name':_0x1bcc34[_0xc3c6('0x2b')],'type':_0x1bcc34[_0xc3c6('0x2c')][_0xc3c6('0x2d')]};});_0xb047b1[_0xc3c6('0x2e')]=_['map'](_0x31975e,_0xc3c6('0x26'));_0xb047b1[_0xc3c6('0x2f')]=_[_0xc3c6('0x30')](_0x2e4094[_0xc3c6('0x2f')]);_0xb047b1[_0xc3c6('0x31')]=_['intersection'](_0xb047b1[_0xc3c6('0x2e')],_0xb047b1[_0xc3c6('0x2f')]);_0x478a4b[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0xb047b1[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x2e4094[_0xc3c6('0x2f')]['fields']));_0x478a4b[_0xc3c6('0x32')]=_0x478a4b['attributes'][_0xc3c6('0x35')]?_0x478a4b[_0xc3c6('0x32')]:_0xb047b1[_0xc3c6('0x2e')];if(!_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x36')](_0xc3c6('0x37'))){_0x478a4b['limit']=qs[_0xc3c6('0x1a')](_0x2e4094[_0xc3c6('0x2f')]['limit']);_0x478a4b[_0xc3c6('0x18')]=qs[_0xc3c6('0x18')](_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x18')]);}_0x478a4b[_0xc3c6('0x38')]=qs[_0xc3c6('0x39')](_0x2e4094[_0xc3c6('0x2f')]['sort']);_0x478a4b['where']=qs[_0xc3c6('0x31')](_[_0xc3c6('0x3a')](_0x2e4094[_0xc3c6('0x2f')],_0xb047b1[_0xc3c6('0x31')]),_0x31975e);if(_0x2e4094[_0xc3c6('0x2f')]['filter']){_0x478a4b[_0xc3c6('0x3b')]=_[_0xc3c6('0x3c')](_0x478a4b[_0xc3c6('0x3b')],{'$or':_[_0xc3c6('0x29')](_0x31975e,function(_0x1eb423){if(_0x1eb423[_0xc3c6('0x2c')]!==_0xc3c6('0x3d')){var _0xada6f={};_0xada6f[_0x1eb423[_0xc3c6('0x26')]]={'$like':'%'+_0x2e4094['query'][_0xc3c6('0x3e')]+'%'};return _0xada6f;}})});}_0x478a4b=_[_0xc3c6('0x3c')]({},_0x478a4b,_0x2e4094[_0xc3c6('0x3f')]);var _0x316605={'where':_0x478a4b[_0xc3c6('0x3b')]};return db[_0xc3c6('0x40')][_0xc3c6('0x1b')](_0x316605)[_0xc3c6('0x23')](function(_0x59b2d9){_0x4571f4[_0xc3c6('0x1b')]=_0x59b2d9;if(_0x2e4094[_0xc3c6('0x2f')]['includeAll']){_0x478a4b[_0xc3c6('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xc3c6('0x42')](_0x478a4b);})[_0xc3c6('0x23')](function(_0x25bb1e){_0x4571f4[_0xc3c6('0x43')]=_0x25bb1e;return _0x4571f4;})[_0xc3c6('0x23')](respondWithFilteredResult(_0x1f1d36,_0x478a4b))[_0xc3c6('0x44')](handleError(_0x1f1d36,null));};exports[_0xc3c6('0x45')]=function(_0x998388,_0x572339){var _0xda8652={'raw':!![],'where':{'id':_0x998388[_0xc3c6('0x46')]['id']}},_0x570d11={};_0x570d11[_0xc3c6('0x2e')]=_[_0xc3c6('0x30')](db[_0xc3c6('0x40')]['rawAttributes']);_0x570d11['query']=_[_0xc3c6('0x30')](_0x998388[_0xc3c6('0x2f')]);_0x570d11[_0xc3c6('0x31')]=_[_0xc3c6('0x33')](_0x570d11['model'],_0x570d11[_0xc3c6('0x2f')]);_0xda8652[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0x570d11[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x34')]));_0xda8652['attributes']=_0xda8652['attributes'][_0xc3c6('0x35')]?_0xda8652[_0xc3c6('0x32')]:_0x570d11['model'];if(_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x47')]){_0xda8652['include']=[{'all':!![]}];}_0xda8652=_[_0xc3c6('0x3c')]({},_0xda8652,_0x998388[_0xc3c6('0x3f')]);return db['Cdr'][_0xc3c6('0x48')](_0xda8652)[_0xc3c6('0x23')](handleEntityNotFound(_0x572339,null))[_0xc3c6('0x23')](respondWithResult(_0x572339,null))[_0xc3c6('0x44')](handleError(_0x572339,null));};exports[_0xc3c6('0x49')]=function(_0x333698,_0x508731){return db[_0xc3c6('0x40')][_0xc3c6('0x49')](_0x333698[_0xc3c6('0x4a')],{})[_0xc3c6('0x23')](respondWithResult(_0x508731,0xc9))[_0xc3c6('0x44')](handleError(_0x508731,null));};exports[_0xc3c6('0x21')]=function(_0x21b8a0,_0x55b8bc){if(_0x21b8a0['body']['id']){delete _0x21b8a0[_0xc3c6('0x4a')]['id'];}return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x21b8a0[_0xc3c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b8bc,null))['then'](saveUpdates(_0x21b8a0[_0xc3c6('0x4a')],null))[_0xc3c6('0x23')](respondWithResult(_0x55b8bc,null))[_0xc3c6('0x44')](handleError(_0x55b8bc,null));};exports[_0xc3c6('0x22')]=function(_0x34ed73,_0x313277){return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x34ed73[_0xc3c6('0x46')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x313277,null))[_0xc3c6('0x23')](removeEntity(_0x313277,null))[_0xc3c6('0x44')](handleError(_0x313277,null));};exports[_0xc3c6('0x4b')]=function(_0xc84c69,_0xad293e){return db[_0xc3c6('0x40')]['describe']()[_0xc3c6('0x23')](respondWithResult(_0xad293e,null))[_0xc3c6('0x44')](handleError(_0xad293e,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 40002fa..62bdacb 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(_0x5f221f,_0xe2f7be){var _0x49d4cd=function(_0x459135){while(--_0x459135){_0x5f221f['push'](_0x5f221f['shift']());}};_0x49d4cd(++_0xe2f7be);}(_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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xd5aef5,_0x1c0460){var _0xe67900=function(_0x9d33f4){while(--_0x9d33f4){_0xd5aef5['push'](_0xd5aef5['shift']());}};_0xe67900(++_0x1c0460);}(_0x7a54,0x106));var _0x47a5=function(_0x48afef,_0x298040){_0x48afef=_0x48afef-0x0;var _0x1dba70=_0x7a54[_0x48afef];return _0x1dba70;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 343e8b2..a6194f7 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 _0x6bc6=['message','Cdr,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','request\x20sent','stringify','error','code'];(function(_0x335853,_0x1e1bac){var _0x2b282f=function(_0x19c11b){while(--_0x19c11b){_0x335853['push'](_0x335853['shift']());}};_0x2b282f(++_0x1e1bac);}(_0x6bc6,0x6f));var _0x66bc=function(_0x16ae34,_0x1dc6d){_0x16ae34=_0x16ae34-0x0;var _0x184836=_0x6bc6[_0x16ae34];return _0x184836;};'use strict';var _=require(_0x66bc('0x0'));var util=require('util');var moment=require(_0x66bc('0x1'));var BPromise=require(_0x66bc('0x2'));var rs=require(_0x66bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66bc('0x4'))['db'];var utils=require(_0x66bc('0x5'));var logger=require(_0x66bc('0x6'))('rpc');var config=require(_0x66bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x66bc('0x8')][_0x66bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27226d,_0x18cc85,_0x30bb4b){return new BPromise(function(_0x1f4579,_0x19c77e){return client['request'](_0x27226d,_0x30bb4b)['then'](function(_0x3bc18b){logger[_0x66bc('0xa')]('Cdr,\x20%s,\x20%s',_0x18cc85,_0x66bc('0xb'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x18cc85,'request\x20sent',JSON[_0x66bc('0xc')](_0x3bc18b));if(_0x3bc18b[_0x66bc('0xd')]){if(_0x3bc18b['error'][_0x66bc('0xe')]===0x1f4){logger[_0x66bc('0xd')]('Cdr,\x20%s,\x20%s',_0x18cc85,_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);return _0x19c77e(_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);}logger[_0x66bc('0xd')](_0x66bc('0x10'),_0x18cc85,_0x3bc18b['error'][_0x66bc('0xf')]);return _0x1f4579(_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);}else{logger[_0x66bc('0xa')]('Cdr,\x20%s,\x20%s',_0x18cc85,'request\x20sent');_0x1f4579(_0x3bc18b[_0x66bc('0x11')][_0x66bc('0xf')]);}})['catch'](function(_0x375ddd){logger[_0x66bc('0xd')](_0x66bc('0x10'),_0x18cc85,_0x375ddd);_0x19c77e(_0x375ddd);});});}
\ No newline at end of file
+var _0xad31=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xad31,0x1d3));var _0x1ad3=function(_0x31881f,_0x5c505b){_0x31881f=_0x31881f-0x0;var _0x52c79a=_0xad31[_0x31881f];return _0x52c79a;};'use strict';var _=require(_0x1ad3('0x0'));var util=require(_0x1ad3('0x1'));var moment=require(_0x1ad3('0x2'));var BPromise=require(_0x1ad3('0x3'));var rs=require(_0x1ad3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ad3('0x5'))['db'];var utils=require(_0x1ad3('0x6'));var logger=require(_0x1ad3('0x7'))(_0x1ad3('0x8'));var config=require(_0x1ad3('0x9'));var jayson=require(_0x1ad3('0xa'));var client=jayson[_0x1ad3('0xb')][_0x1ad3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2079a4,_0x53ecde,_0x499cba){return new BPromise(function(_0x43cf92,_0x23c76a){return client[_0x1ad3('0xd')](_0x2079a4,_0x499cba)[_0x1ad3('0xe')](function(_0x420704){logger[_0x1ad3('0xf')](_0x1ad3('0x10'),_0x53ecde,_0x1ad3('0x11'));logger[_0x1ad3('0x12')](_0x1ad3('0x13'),_0x53ecde,_0x1ad3('0x11'),JSON['stringify'](_0x420704));if(_0x420704['error']){if(_0x420704['error'][_0x1ad3('0x14')]===0x1f4){logger[_0x1ad3('0x15')](_0x1ad3('0x10'),_0x53ecde,_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);return _0x23c76a(_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);}logger['error'](_0x1ad3('0x10'),_0x53ecde,_0x420704[_0x1ad3('0x15')]['message']);return _0x43cf92(_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);}else{logger[_0x1ad3('0xf')]('Cdr,\x20%s,\x20%s',_0x53ecde,'request\x20sent');_0x43cf92(_0x420704[_0x1ad3('0x17')][_0x1ad3('0x16')]);}})[_0x1ad3('0x18')](function(_0x2f99f5){logger['error'](_0x1ad3('0x10'),_0x53ecde,_0x2f99f5);_0x23c76a(_0x2f99f5);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 5396aea..62c374a 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(_0x20a63e,_0xcb0bea){var _0x56fe3d=function(_0x2d4208){while(--_0x2d4208){_0x20a63e['push'](_0x20a63e['shift']());}};_0x56fe3d(++_0xcb0bea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index b12526c..ec854f1 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 _0xc57d=['STRING','sequelize','exports','TEXT'];(function(_0x29c2c8,_0x3f77fe){var _0x15ec2d=function(_0x8a6c8d){while(--_0x8a6c8d){_0x29c2c8['push'](_0x29c2c8['shift']());}};_0x15ec2d(++_0x3f77fe);}(_0xc57d,0x111));var _0xdc57=function(_0x45dbff,_0x13a782){_0x45dbff=_0x45dbff-0x0;var _0x25e2f0=_0xc57d[_0x45dbff];return _0x25e2f0;};'use strict';var Sequelize=require(_0xdc57('0x0'));module[_0xdc57('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdc57('0x2')]()},'description':{'type':Sequelize[_0xdc57('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x4c6b=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x4c6b,0xf0));var _0xb4c6=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x4c6b[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require('sequelize');module[_0xb4c6('0x0')]={'priority':{'type':Sequelize[_0xb4c6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4c6('0x2')],'allowNull':![],'defaultValue':_0xb4c6('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb4c6('0x2')]},'interval':{'type':Sequelize[_0xb4c6('0x2')],'defaultValue':_0xb4c6('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 83d7c31..17a6a36 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 _0x95af=['merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x95af,0x173));var _0xf95a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95af[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf95a('0x0'));var rimraf=require(_0xf95a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf95a('0x2'));var rp=require(_0xf95a('0x3'));var moment=require(_0xf95a('0x4'));var BPromise=require(_0xf95a('0x5'));var Mustache=require(_0xf95a('0x6'));var util=require(_0xf95a('0x7'));var path=require(_0xf95a('0x8'));var sox=require('sox');var csv=require(_0xf95a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf95a('0xa'));var _=require('lodash');var squel=require(_0xf95a('0xb'));var crypto=require(_0xf95a('0xc'));var jsforce=require(_0xf95a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf95a('0x9'));var querystring=require(_0xf95a('0xe'));var Papa=require('papaparse');var Redis=require(_0xf95a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf95a('0x10'));var as=require(_0xf95a('0x11'));var hardwareService=require(_0xf95a('0x12'));var logger=require(_0xf95a('0x13'))(_0xf95a('0x14'));var utils=require(_0xf95a('0x15'));var config=require(_0xf95a('0x16'));var licenseUtil=require(_0xf95a('0x17'));var db=require(_0xf95a('0x18'))['db'];function respondWithStatusCode(_0xc428f7,_0x2d9d0a){_0x2d9d0a=_0x2d9d0a||0xcc;return function(_0x22e042){if(_0x22e042){return _0xc428f7['sendStatus'](_0x2d9d0a);}return _0xc428f7[_0xf95a('0x19')](_0x2d9d0a)[_0xf95a('0x1a')]();};}function respondWithResult(_0x3b43d1,_0x570be5){_0x570be5=_0x570be5||0xc8;return function(_0x5449a0){if(_0x5449a0){return _0x3b43d1['status'](_0x570be5)[_0xf95a('0x1b')](_0x5449a0);}};}function respondWithFilteredResult(_0x54b9bc,_0x210561){return function(_0x2848b6){if(_0x2848b6){var _0x30fb30=typeof _0x210561['offset']===_0xf95a('0x1c')&&typeof _0x210561[_0xf95a('0x1d')]===_0xf95a('0x1c');var _0x3b47dc=_0x2848b6[_0xf95a('0x1e')];var _0x2991d1=_0x30fb30?0x0:_0x210561[_0xf95a('0x1f')];var _0x2144e4=_0x30fb30?_0x2848b6['count']:_0x210561[_0xf95a('0x1f')]+_0x210561[_0xf95a('0x1d')];var _0x2aefd7;if(_0x2144e4>=_0x3b47dc){_0x2144e4=_0x3b47dc;_0x2aefd7=0xc8;}else{_0x2aefd7=0xce;}_0x54b9bc[_0xf95a('0x19')](_0x2aefd7);return _0x54b9bc[_0xf95a('0x20')](_0xf95a('0x21'),_0x2991d1+'-'+_0x2144e4+'/'+_0x3b47dc)[_0xf95a('0x1b')](_0x2848b6);}return null;};}function patchUpdates(_0x53ffb1){return function(_0x57f0dd){try{jsonpatch[_0xf95a('0x22')](_0x57f0dd,_0x53ffb1,!![]);}catch(_0x3fea2f){return BPromise[_0xf95a('0x23')](_0x3fea2f);}return _0x57f0dd[_0xf95a('0x24')]();};}function saveUpdates(_0xdf912c,_0x3f3e07){return function(_0xc8cf5b){if(_0xc8cf5b){return _0xc8cf5b['update'](_0xdf912c)[_0xf95a('0x25')](function(_0x1c9a37){return _0x1c9a37;});}return null;};}function removeEntity(_0xaa985e,_0x4bbcca){return function(_0x3822f4){if(_0x3822f4){return _0x3822f4[_0xf95a('0x26')]()[_0xf95a('0x25')](function(){_0xaa985e[_0xf95a('0x19')](0xcc)[_0xf95a('0x1a')]();});}};}function handleEntityNotFound(_0x43d3c3,_0xa9ab6d){return function(_0x3f25a2){if(!_0x3f25a2){_0x43d3c3[_0xf95a('0x27')](0x194);}return _0x3f25a2;};}function handleError(_0x411812,_0x3a3761){_0x3a3761=_0x3a3761||0x1f4;return function(_0x4f82b4){logger[_0xf95a('0x28')](_0x4f82b4['stack']);if(_0x4f82b4[_0xf95a('0x29')]){delete _0x4f82b4['name'];}_0x411812[_0xf95a('0x19')](_0x3a3761)[_0xf95a('0x2a')](_0x4f82b4);};}exports[_0xf95a('0x2b')]=function(_0x495f46,_0x42a5b4){var _0x538168={'raw':!![],'where':{'id':_0x495f46[_0xf95a('0x2c')]['id']}},_0x2fd126={};_0x2fd126[_0xf95a('0x2d')]=_[_0xf95a('0x2e')](db[_0xf95a('0x2f')][_0xf95a('0x30')]);_0x2fd126[_0xf95a('0x31')]=_[_0xf95a('0x2e')](_0x495f46[_0xf95a('0x31')]);_0x2fd126['filters']=_[_0xf95a('0x32')](_0x2fd126[_0xf95a('0x2d')],_0x2fd126[_0xf95a('0x31')]);_0x538168[_0xf95a('0x33')]=_[_0xf95a('0x32')](_0x2fd126['model'],qs[_0xf95a('0x34')](_0x495f46[_0xf95a('0x31')][_0xf95a('0x34')]));_0x538168[_0xf95a('0x33')]=_0x538168['attributes'][_0xf95a('0x35')]?_0x538168[_0xf95a('0x33')]:_0x2fd126[_0xf95a('0x2d')];if(_0x495f46[_0xf95a('0x31')][_0xf95a('0x36')]){_0x538168[_0xf95a('0x37')]=[{'all':!![]}];}_0x538168=_[_0xf95a('0x38')]({},_0x538168,_0x495f46[_0xf95a('0x39')]);return db['ChatApplication'][_0xf95a('0x3a')](_0x538168)[_0xf95a('0x25')](handleEntityNotFound(_0x42a5b4,null))[_0xf95a('0x25')](respondWithResult(_0x42a5b4,null))[_0xf95a('0x3b')](handleError(_0x42a5b4,null));};exports['update']=function(_0x3e0749,_0x545b9f){if(_0x3e0749[_0xf95a('0x3c')]['id']){delete _0x3e0749['body']['id'];}return db[_0xf95a('0x2f')]['find']({'where':{'id':_0x3e0749[_0xf95a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x545b9f,null))[_0xf95a('0x25')](saveUpdates(_0x3e0749[_0xf95a('0x3c')],null))[_0xf95a('0x25')](respondWithResult(_0x545b9f,null))[_0xf95a('0x3b')](handleError(_0x545b9f,null));};exports[_0xf95a('0x26')]=function(_0x1d55c7,_0x37b78c){return db[_0xf95a('0x2f')][_0xf95a('0x3a')]({'where':{'id':_0x1d55c7[_0xf95a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x37b78c,null))['then'](removeEntity(_0x37b78c,null))['catch'](handleError(_0x37b78c,null));};
\ No newline at end of file
+var _0x97c1=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','show','rawAttributes','keys','query','intersection','attributes','model','fields','includeAll','include','merge','options','ChatApplication','catch','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x582c18,_0x19969a){var _0x485f24=function(_0xdfad1d){while(--_0xdfad1d){_0x582c18['push'](_0x582c18['shift']());}};_0x485f24(++_0x19969a);}(_0x97c1,0xdf));var _0x197c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x2911dd,_0x2b6319){return function(_0x499051){if(!_0x499051){_0x2911dd[_0x197c('0x26')](0x194);}return _0x499051;};}function handleError(_0x3331ac,_0x4c3337){_0x4c3337=_0x4c3337||0x1f4;return function(_0x5e7bc9){logger[_0x197c('0x27')](_0x5e7bc9['stack']);if(_0x5e7bc9[_0x197c('0x28')]){delete _0x5e7bc9[_0x197c('0x28')];}_0x3331ac[_0x197c('0x17')](_0x4c3337)[_0x197c('0x29')](_0x5e7bc9);};}exports[_0x197c('0x2a')]=function(_0x3cdcd8,_0x2b6154){var _0x215df1={'raw':!![],'where':{'id':_0x3cdcd8['params']['id']}},_0x4422d1={};_0x4422d1['model']=_['keys'](db['ChatApplication'][_0x197c('0x2b')]);_0x4422d1['query']=_[_0x197c('0x2c')](_0x3cdcd8[_0x197c('0x2d')]);_0x4422d1['filters']=_[_0x197c('0x2e')](_0x4422d1['model'],_0x4422d1[_0x197c('0x2d')]);_0x215df1[_0x197c('0x2f')]=_[_0x197c('0x2e')](_0x4422d1[_0x197c('0x30')],qs[_0x197c('0x31')](_0x3cdcd8[_0x197c('0x2d')][_0x197c('0x31')]));_0x215df1[_0x197c('0x2f')]=_0x215df1[_0x197c('0x2f')]['length']?_0x215df1['attributes']:_0x4422d1[_0x197c('0x30')];if(_0x3cdcd8[_0x197c('0x2d')][_0x197c('0x32')]){_0x215df1[_0x197c('0x33')]=[{'all':!![]}];}_0x215df1=_[_0x197c('0x34')]({},_0x215df1,_0x3cdcd8[_0x197c('0x35')]);return db[_0x197c('0x36')]['find'](_0x215df1)['then'](handleEntityNotFound(_0x2b6154,null))[_0x197c('0x24')](respondWithResult(_0x2b6154,null))[_0x197c('0x37')](handleError(_0x2b6154,null));};exports['update']=function(_0x5bebe7,_0x3cdaa1){if(_0x5bebe7[_0x197c('0x38')]['id']){delete _0x5bebe7[_0x197c('0x38')]['id'];}return db[_0x197c('0x36')][_0x197c('0x39')]({'where':{'id':_0x5bebe7[_0x197c('0x3a')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x3cdaa1,null))[_0x197c('0x24')](saveUpdates(_0x5bebe7[_0x197c('0x38')],null))['then'](respondWithResult(_0x3cdaa1,null))[_0x197c('0x37')](handleError(_0x3cdaa1,null));};exports[_0x197c('0x25')]=function(_0x358900,_0x41269e){return db[_0x197c('0x36')][_0x197c('0x39')]({'where':{'id':_0x358900['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x41269e,null))[_0x197c('0x24')](removeEntity(_0x41269e,null))[_0x197c('0x37')](handleError(_0x41269e,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index ce5a70d..d6346c0 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 _0x3b8e=['request-promise','../../config/environment','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird'];(function(_0x210343,_0x3f65ae){var _0x6f1f7=function(_0x15e243){while(--_0x15e243){_0x210343['push'](_0x210343['shift']());}};_0x6f1f7(++_0x3f65ae);}(_0x3b8e,0x10b));var _0xe3b8=function(_0x222e2d,_0x4cff0c){_0x222e2d=_0x222e2d-0x0;var _0x3dbbac=_0x3b8e[_0x222e2d];return _0x3dbbac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3b8('0x0'))('api');var moment=require(_0xe3b8('0x1'));var BPromise=require(_0xe3b8('0x2'));var rp=require(_0xe3b8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe3b8('0x4'));var attributes=require('./chatApplication.attributes');module[_0xe3b8('0x5')]=function(_0x4b0bf0,_0x540432){return _0x4b0bf0['define']('ChatApplication',attributes,{'tableName':_0xe3b8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe3b8('0x7'),'collate':_0xe3b8('0x8')});};
\ No newline at end of file
+var _0xeb0d=['../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','lodash','moment','bluebird','path','rimraf'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x50d7c7,_0x3cef1d){_0x50d7c7=_0x50d7c7-0x0;var _0x5cb0f5=_0xeb0d[_0x50d7c7];return _0x5cb0f5;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdeb0('0x1'));var BPromise=require(_0xdeb0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb0('0x3'));var rimraf=require(_0xdeb0('0x4'));var config=require(_0xdeb0('0x5'));var attributes=require(_0xdeb0('0x6'));module[_0xdeb0('0x7')]=function(_0x13d486,_0xc48108){return _0x13d486[_0xdeb0('0x8')]('ChatApplication',attributes,{'tableName':_0xdeb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb0('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index a1107ec..8283254 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 _0x9986=['../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','../../config/logger'];(function(_0x25f341,_0x2847ab){var _0x219b50=function(_0x1f2ae8){while(--_0x1f2ae8){_0x25f341['push'](_0x25f341['shift']());}};_0x219b50(++_0x2847ab);}(_0x9986,0x12c));var _0x6998=function(_0x1f7af5,_0x5902ba){_0x1f7af5=_0x1f7af5-0x0;var _0x576a87=_0x9986[_0x1f7af5];return _0x576a87;};'use strict';var _=require(_0x6998('0x0'));var util=require('util');var moment=require(_0x6998('0x1'));var BPromise=require(_0x6998('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6998('0x3'))('rpc');var config=require(_0x6998('0x4'));var jayson=require(_0x6998('0x5'));var client=jayson[_0x6998('0x6')][_0x6998('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7d9df4,_0x54e75c,_0x46efae){return new BPromise(function(_0x478b88,_0x3769a5){return client[_0x6998('0x8')](_0x7d9df4,_0x46efae)['then'](function(_0x17b363){logger[_0x6998('0x9')](_0x6998('0xa'),_0x54e75c,_0x6998('0xb'));logger[_0x6998('0xc')](_0x6998('0xd'),_0x54e75c,_0x6998('0xb'),JSON[_0x6998('0xe')](_0x17b363));if(_0x17b363['error']){if(_0x17b363[_0x6998('0xf')]['code']===0x1f4){logger[_0x6998('0xf')]('ChatApplication,\x20%s,\x20%s',_0x54e75c,_0x17b363[_0x6998('0xf')][_0x6998('0x10')]);return _0x3769a5(_0x17b363['error'][_0x6998('0x10')]);}logger[_0x6998('0xf')]('ChatApplication,\x20%s,\x20%s',_0x54e75c,_0x17b363[_0x6998('0xf')][_0x6998('0x10')]);return _0x478b88(_0x17b363[_0x6998('0xf')]['message']);}else{logger[_0x6998('0x9')](_0x6998('0xa'),_0x54e75c,_0x6998('0xb'));_0x478b88(_0x17b363[_0x6998('0x11')][_0x6998('0x10')]);}})[_0x6998('0x12')](function(_0x10e9ea){logger[_0x6998('0xf')](_0x6998('0xa'),_0x54e75c,_0x10e9ea);_0x3769a5(_0x10e9ea);});});}
\ No newline at end of file
+var _0xea9b=['../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3452d1,_0x2be075){var _0x4a6a2c=function(_0x20620a){while(--_0x20620a){_0x3452d1['push'](_0x3452d1['shift']());}};_0x4a6a2c(++_0x2be075);}(_0xea9b,0xdf));var _0xbea9=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0xea9b[_0x162780];return _0x1ea2dc;};'use strict';var _=require('lodash');var util=require(_0xbea9('0x0'));var moment=require('moment');var BPromise=require(_0xbea9('0x1'));var rs=require(_0xbea9('0x2'));var fs=require('fs');var Redis=require(_0xbea9('0x3'));var db=require(_0xbea9('0x4'))['db'];var utils=require(_0xbea9('0x5'));var logger=require(_0xbea9('0x6'))(_0xbea9('0x7'));var config=require(_0xbea9('0x8'));var jayson=require(_0xbea9('0x9'));var client=jayson[_0xbea9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf563e5,_0x5d47c6,_0x101e5b){return new BPromise(function(_0x403fe5,_0x3a1f7a){return client[_0xbea9('0xb')](_0xf563e5,_0x101e5b)['then'](function(_0x2b2818){logger[_0xbea9('0xc')](_0xbea9('0xd'),_0x5d47c6,'request\x20sent');logger[_0xbea9('0xe')](_0xbea9('0xf'),_0x5d47c6,_0xbea9('0x10'),JSON[_0xbea9('0x11')](_0x2b2818));if(_0x2b2818[_0xbea9('0x12')]){if(_0x2b2818[_0xbea9('0x12')]['code']===0x1f4){logger['error'](_0xbea9('0xd'),_0x5d47c6,_0x2b2818[_0xbea9('0x12')]['message']);return _0x3a1f7a(_0x2b2818['error'][_0xbea9('0x13')]);}logger[_0xbea9('0x12')](_0xbea9('0xd'),_0x5d47c6,_0x2b2818[_0xbea9('0x12')]['message']);return _0x403fe5(_0x2b2818[_0xbea9('0x12')][_0xbea9('0x13')]);}else{logger['info'](_0xbea9('0xd'),_0x5d47c6,_0xbea9('0x10'));_0x403fe5(_0x2b2818['result'][_0xbea9('0x13')]);}})[_0xbea9('0x14')](function(_0xa72f3c){logger[_0xbea9('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5d47c6,_0xa72f3c);_0x3a1f7a(_0xa72f3c);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index a18d5d0..a48ddd7 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 _0x6d92=['get','isAuthenticated','show','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x27e5f2,_0x4e5d65){var _0x543d96=function(_0x38732c){while(--_0x38732c){_0x27e5f2['push'](_0x27e5f2['shift']());}};_0x543d96(++_0x4e5d65);}(_0x6d92,0x8e));var _0x26d9=function(_0x3160b1,_0x1af397){_0x3160b1=_0x3160b1-0x0;var _0x5242c9=_0x6d92[_0x3160b1];return _0x5242c9;};'use strict';var multer=require(_0x26d9('0x0'));var util=require(_0x26d9('0x1'));var path=require(_0x26d9('0x2'));var timeout=require(_0x26d9('0x3'));var express=require(_0x26d9('0x4'));var router=express[_0x26d9('0x5')]();var fs_extra=require(_0x26d9('0x6'));var auth=require(_0x26d9('0x7'));var interaction=require(_0x26d9('0x8'));var config=require(_0x26d9('0x9'));var controller=require(_0x26d9('0xa'));router[_0x26d9('0xb')]('/:id',auth[_0x26d9('0xc')](),controller[_0x26d9('0xd')]);router['put'](_0x26d9('0xe'),auth[_0x26d9('0xc')](),controller['update']);router[_0x26d9('0xf')](_0x26d9('0xe'),auth[_0x26d9('0xc')](),controller['destroy']);module[_0x26d9('0x10')]=router;
\ No newline at end of file
+var _0xd0d4=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy'];(function(_0x14f53b,_0x3fea28){var _0x10b218=function(_0x3813e6){while(--_0x3813e6){_0x14f53b['push'](_0x14f53b['shift']());}};_0x10b218(++_0x3fea28);}(_0xd0d4,0x18d));var _0x4d0d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd0d4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4d0d('0x0'));var util=require(_0x4d0d('0x1'));var path=require('path');var timeout=require(_0x4d0d('0x2'));var express=require(_0x4d0d('0x3'));var router=express[_0x4d0d('0x4')]();var fs_extra=require(_0x4d0d('0x5'));var auth=require(_0x4d0d('0x6'));var interaction=require(_0x4d0d('0x7'));var config=require(_0x4d0d('0x8'));var controller=require(_0x4d0d('0x9'));router[_0x4d0d('0xa')]('/:id',auth[_0x4d0d('0xb')](),controller[_0x4d0d('0xc')]);router[_0x4d0d('0xd')](_0x4d0d('0xe'),auth[_0x4d0d('0xb')](),controller[_0x4d0d('0xf')]);router['delete'](_0x4d0d('0xe'),auth[_0x4d0d('0xb')](),controller[_0x4d0d('0x10')]);module[_0x4d0d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 00779cb..2f80b4d 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 _0xc08a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2c87f6,_0x525c2a){var _0x431a13=function(_0x50bb5a){while(--_0x50bb5a){_0x2c87f6['push'](_0x2c87f6['shift']());}};_0x431a13(++_0x525c2a);}(_0xc08a,0x167));var _0xac08=function(_0x253c5d,_0x3928ae){_0x253c5d=_0x253c5d-0x0;var _0x1b984c=_0xc08a[_0x253c5d];return _0x1b984c;};'use strict';var Sequelize=require(_0xac08('0x0'));module[_0xac08('0x1')]={'name':{'type':Sequelize[_0xac08('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xac08('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x87b4=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87b4,0xaa));var _0x487b=function(_0x4d4a09,_0x2ce4b3){_0x4d4a09=_0x4d4a09-0x0;var _0xc3ab96=_0x87b4[_0x4d4a09];return _0xc3ab96;};'use strict';var Sequelize=require(_0x487b('0x0'));module[_0x487b('0x1')]={'name':{'type':Sequelize[_0x487b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x487b('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index eafc752..0050927 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 _0xcea1=['jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','toInteger','addMembers','ids','getMembers','findOne','User','order','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','lodash','crypto'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcea1,0xb2));var _0x1cea=function(_0x58f555,_0x552ef2){_0x58f555=_0x58f555-0x0;var _0x4eb99b=_0xcea1[_0x58f555];return _0x4eb99b;};'use strict';var emlformat=require(_0x1cea('0x0'));var rimraf=require(_0x1cea('0x1'));var zipdir=require(_0x1cea('0x2'));var jsonpatch=require(_0x1cea('0x3'));var rp=require(_0x1cea('0x4'));var moment=require('moment');var BPromise=require(_0x1cea('0x5'));var Mustache=require(_0x1cea('0x6'));var util=require(_0x1cea('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cea('0x8'));var squel=require('squel');var crypto=require(_0x1cea('0x9'));var jsforce=require(_0x1cea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1cea('0xb'));var querystring=require(_0x1cea('0xc'));var Papa=require(_0x1cea('0xd'));var Redis=require(_0x1cea('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cea('0xf'));var logger=require(_0x1cea('0x10'))(_0x1cea('0x11'));var utils=require(_0x1cea('0x12'));var config=require(_0x1cea('0x13'));var licenseUtil=require(_0x1cea('0x14'));var db=require(_0x1cea('0x15'))['db'];config[_0x1cea('0x16')]=_[_0x1cea('0x17')](config[_0x1cea('0x16')],{'host':_0x1cea('0x18'),'port':0x18eb});var socket=require(_0x1cea('0x19'))(new Redis(config[_0x1cea('0x16')]));require('./chatGroup.socket')[_0x1cea('0x1a')](socket);function respondWithStatusCode(_0x4a7c6c,_0x28d188){_0x28d188=_0x28d188||0xcc;return function(_0x33decc){if(_0x33decc){return _0x4a7c6c['sendStatus'](_0x28d188);}return _0x4a7c6c[_0x1cea('0x1b')](_0x28d188)[_0x1cea('0x1c')]();};}function respondWithResult(_0x481005,_0x4f5558){_0x4f5558=_0x4f5558||0xc8;return function(_0x6017a0){if(_0x6017a0){return _0x481005['status'](_0x4f5558)[_0x1cea('0x1d')](_0x6017a0);}};}function respondWithFilteredResult(_0x441e72,_0x251cb9){return function(_0x1c2771){if(_0x1c2771){var _0x776718=typeof _0x251cb9[_0x1cea('0x1e')]==='undefined'&&typeof _0x251cb9[_0x1cea('0x1f')]===_0x1cea('0x20');var _0x3fef0e=_0x1c2771['count'];var _0x100b88=_0x776718?0x0:_0x251cb9[_0x1cea('0x1e')];var _0x28a513=_0x776718?_0x1c2771[_0x1cea('0x21')]:_0x251cb9[_0x1cea('0x1e')]+_0x251cb9['limit'];var _0x87853e;if(_0x28a513>=_0x3fef0e){_0x28a513=_0x3fef0e;_0x87853e=0xc8;}else{_0x87853e=0xce;}_0x441e72[_0x1cea('0x1b')](_0x87853e);return _0x441e72[_0x1cea('0x22')](_0x1cea('0x23'),_0x100b88+'-'+_0x28a513+'/'+_0x3fef0e)[_0x1cea('0x1d')](_0x1c2771);}return null;};}function patchUpdates(_0x5d6f69){return function(_0x440b67){try{jsonpatch[_0x1cea('0x24')](_0x440b67,_0x5d6f69,!![]);}catch(_0x46224d){return BPromise['reject'](_0x46224d);}return _0x440b67[_0x1cea('0x25')]();};}function saveUpdates(_0x17d0c0,_0x2e7a3d){return function(_0x194822){if(_0x194822){return _0x194822['update'](_0x17d0c0)['then'](function(_0x216815){return _0x216815;});}return null;};}function removeEntity(_0x3e8f35,_0x4f7ac0){return function(_0x283cae){if(_0x283cae){return _0x283cae[_0x1cea('0x26')]()[_0x1cea('0x27')](function(){_0x3e8f35[_0x1cea('0x1b')](0xcc)[_0x1cea('0x1c')]();});}};}function handleEntityNotFound(_0x6bf211,_0x4f7fe9){return function(_0x11eff6){if(!_0x11eff6){_0x6bf211[_0x1cea('0x28')](0x194);}return _0x11eff6;};}function handleError(_0x6d9a5,_0x3ee099){_0x3ee099=_0x3ee099||0x1f4;return function(_0x3e6cc8){logger[_0x1cea('0x29')](_0x3e6cc8[_0x1cea('0x2a')]);if(_0x3e6cc8['name']){delete _0x3e6cc8[_0x1cea('0x2b')];}_0x6d9a5['status'](_0x3ee099)['send'](_0x3e6cc8);};}exports[_0x1cea('0x2c')]=function(_0x446508,_0xc8e1df){var _0xb0b538={},_0x2150a2={},_0x3f7324={'count':0x0,'rows':[]};var _0x41826c=_[_0x1cea('0x2d')](db[_0x1cea('0x2e')][_0x1cea('0x2f')],function(_0x3fc89d){return{'name':_0x3fc89d[_0x1cea('0x30')],'type':_0x3fc89d[_0x1cea('0x31')]['key']};});_0x2150a2[_0x1cea('0x32')]=_[_0x1cea('0x2d')](_0x41826c,_0x1cea('0x2b'));_0x2150a2['query']=_[_0x1cea('0x33')](_0x446508[_0x1cea('0x34')]);_0x2150a2['filters']=_['intersection'](_0x2150a2[_0x1cea('0x32')],_0x2150a2[_0x1cea('0x34')]);_0xb0b538['attributes']=_[_0x1cea('0x35')](_0x2150a2[_0x1cea('0x32')],qs[_0x1cea('0x36')](_0x446508[_0x1cea('0x34')]['fields']));_0xb0b538[_0x1cea('0x37')]=_0xb0b538[_0x1cea('0x37')][_0x1cea('0x38')]?_0xb0b538['attributes']:_0x2150a2[_0x1cea('0x32')];if(!_0x446508[_0x1cea('0x34')]['hasOwnProperty'](_0x1cea('0x39'))){_0xb0b538[_0x1cea('0x1f')]=qs[_0x1cea('0x1f')](_0x446508[_0x1cea('0x34')][_0x1cea('0x1f')]);_0xb0b538[_0x1cea('0x1e')]=qs[_0x1cea('0x1e')](_0x446508['query'][_0x1cea('0x1e')]);}_0xb0b538['order']=qs[_0x1cea('0x3a')](_0x446508[_0x1cea('0x34')][_0x1cea('0x3a')]);_0xb0b538[_0x1cea('0x3b')]=qs[_0x1cea('0x3c')](_[_0x1cea('0x3d')](_0x446508[_0x1cea('0x34')],_0x2150a2['filters']),_0x41826c);if(_0x446508[_0x1cea('0x34')][_0x1cea('0x3e')]){_0xb0b538[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0xb0b538[_0x1cea('0x3b')],{'$or':_[_0x1cea('0x2d')](_0x41826c,function(_0x115c2a){if(_0x115c2a[_0x1cea('0x31')]!==_0x1cea('0x40')){var _0x9fcd93={};_0x9fcd93[_0x115c2a['name']]={'$like':'%'+_0x446508[_0x1cea('0x34')][_0x1cea('0x3e')]+'%'};return _0x9fcd93;}})});}_0xb0b538=_['merge']({},_0xb0b538,_0x446508[_0x1cea('0x41')]);var _0x19cd24={'where':_0xb0b538[_0x1cea('0x3b')]};return db[_0x1cea('0x2e')][_0x1cea('0x21')](_0x19cd24)[_0x1cea('0x27')](function(_0x12a51b){_0x3f7324['count']=_0x12a51b;if(_0x446508[_0x1cea('0x34')][_0x1cea('0x42')]){_0xb0b538[_0x1cea('0x43')]=[{'all':!![]}];}return db[_0x1cea('0x2e')][_0x1cea('0x44')](_0xb0b538);})['then'](function(_0x1b3b29){_0x3f7324[_0x1cea('0x45')]=_0x1b3b29;return _0x3f7324;})['then'](respondWithFilteredResult(_0xc8e1df,_0xb0b538))[_0x1cea('0x46')](handleError(_0xc8e1df,null));};exports[_0x1cea('0x47')]=function(_0x1699a0,_0x6411f2){var _0xb91035={'raw':!![],'where':{'id':_0x1699a0[_0x1cea('0x48')]['id']}},_0x3e0b92={};_0x3e0b92[_0x1cea('0x32')]=_[_0x1cea('0x33')](db[_0x1cea('0x2e')]['rawAttributes']);_0x3e0b92['query']=_[_0x1cea('0x33')](_0x1699a0[_0x1cea('0x34')]);_0x3e0b92[_0x1cea('0x3c')]=_[_0x1cea('0x35')](_0x3e0b92['model'],_0x3e0b92[_0x1cea('0x34')]);_0xb91035['attributes']=_[_0x1cea('0x35')](_0x3e0b92[_0x1cea('0x32')],qs[_0x1cea('0x36')](_0x1699a0[_0x1cea('0x34')][_0x1cea('0x36')]));_0xb91035[_0x1cea('0x37')]=_0xb91035[_0x1cea('0x37')][_0x1cea('0x38')]?_0xb91035[_0x1cea('0x37')]:_0x3e0b92[_0x1cea('0x32')];if(_0x1699a0[_0x1cea('0x34')]['includeAll']){_0xb91035[_0x1cea('0x43')]=[{'all':!![]}];}_0xb91035=_[_0x1cea('0x3f')]({},_0xb91035,_0x1699a0['options']);return db[_0x1cea('0x2e')][_0x1cea('0x49')](_0xb91035)[_0x1cea('0x27')](handleEntityNotFound(_0x6411f2,null))[_0x1cea('0x27')](respondWithResult(_0x6411f2,null))[_0x1cea('0x46')](handleError(_0x6411f2,null));};exports[_0x1cea('0x4a')]=function(_0x42effa,_0x58b960){return db[_0x1cea('0x2e')]['create'](_0x42effa[_0x1cea('0x4b')],{})[_0x1cea('0x27')](respondWithResult(_0x58b960,0xc9))[_0x1cea('0x46')](handleError(_0x58b960,null));};exports['update']=function(_0x32f583,_0x217588){if(_0x32f583['body']['id']){delete _0x32f583[_0x1cea('0x4b')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x32f583['params']['id']}})['then'](handleEntityNotFound(_0x217588,null))[_0x1cea('0x27')](saveUpdates(_0x32f583[_0x1cea('0x4b')],null))[_0x1cea('0x27')](respondWithResult(_0x217588,null))[_0x1cea('0x46')](handleError(_0x217588,null));};exports[_0x1cea('0x26')]=function(_0x23a1e2,_0x5eda10){return db[_0x1cea('0x2e')][_0x1cea('0x49')]({'where':{'id':_0x23a1e2['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x5eda10,null))[_0x1cea('0x27')](removeEntity(_0x5eda10,null))[_0x1cea('0x46')](handleError(_0x5eda10,null));};exports[_0x1cea('0x4c')]=function(_0x51ba61,_0x241496){return db['ChatGroup'][_0x1cea('0x4c')]()[_0x1cea('0x27')](respondWithResult(_0x241496,null))[_0x1cea('0x46')](handleError(_0x241496,null));};exports[_0x1cea('0x4d')]=function(_0x38a68d,_0x349b14,_0x1ecb24){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x38a68d['params']['id'],'ToId':_0x38a68d['user']['id'],'read':![]}})[_0x1cea('0x27')](function(_0x2c8b41){return{'id':_[_0x1cea('0x4e')](_0x38a68d['params']['id']),'count':_0x2c8b41};})['then'](respondWithResult(_0x349b14,null))[_0x1cea('0x46')](handleError(_0x349b14,null));};exports[_0x1cea('0x4f')]=function(_0x130bd8,_0x19a0a4,_0x45742){return db['ChatGroup']['find']({'where':{'id':_0x130bd8[_0x1cea('0x48')]['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x19a0a4,null))['then'](function(_0x96102f){if(_0x96102f){return _0x96102f['addMembers'](_0x130bd8[_0x1cea('0x4b')][_0x1cea('0x50')],_['omit'](_0x130bd8[_0x1cea('0x4b')],[_0x1cea('0x50'),'id'])||{});}})[_0x1cea('0x27')](respondWithResult(_0x19a0a4,null))[_0x1cea('0x46')](handleError(_0x19a0a4,null));};exports[_0x1cea('0x51')]=function(_0x8edf37,_0x5cd58b,_0x1340f3){var _0x1e82e3={};var _0x359bb9={};var _0x8d96ca;var _0xd81d1d;return db[_0x1cea('0x2e')][_0x1cea('0x52')]({'where':{'id':_0x8edf37[_0x1cea('0x48')]['id']}})['then'](handleEntityNotFound(_0x5cd58b,null))[_0x1cea('0x27')](function(_0x1d99c5){if(_0x1d99c5){_0x8d96ca=_0x1d99c5;_0x359bb9[_0x1cea('0x32')]=_[_0x1cea('0x33')](db[_0x1cea('0x53')][_0x1cea('0x2f')]);_0x359bb9[_0x1cea('0x34')]=_['keys'](_0x8edf37[_0x1cea('0x34')]);_0x359bb9[_0x1cea('0x3c')]=_['intersection'](_0x359bb9['model'],_0x359bb9[_0x1cea('0x34')]);_0x1e82e3['attributes']=_[_0x1cea('0x35')](_0x359bb9['model'],qs['fields'](_0x8edf37['query'][_0x1cea('0x36')]));_0x1e82e3['attributes']=_0x1e82e3['attributes']['length']?_0x1e82e3[_0x1cea('0x37')]:_0x359bb9[_0x1cea('0x32')];_0x1e82e3[_0x1cea('0x54')]=qs[_0x1cea('0x3a')](_0x8edf37[_0x1cea('0x34')][_0x1cea('0x3a')]);_0x1e82e3[_0x1cea('0x3b')]=qs[_0x1cea('0x3c')](_[_0x1cea('0x3d')](_0x8edf37[_0x1cea('0x34')],_0x359bb9[_0x1cea('0x3c')]));if(_0x8edf37['query'][_0x1cea('0x3e')]){_0x1e82e3[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x1e82e3[_0x1cea('0x3b')],{'$or':_['map'](_0x1e82e3[_0x1cea('0x37')],function(_0x11b2ba){var _0x34b677={};_0x34b677[_0x11b2ba]={'$like':'%'+_0x8edf37['query'][_0x1cea('0x3e')]+'%'};return _0x34b677;})});}_0x1e82e3=_['merge']({},_0x1e82e3,_0x8edf37[_0x1cea('0x41')]);return _0x8d96ca[_0x1cea('0x51')](_0x1e82e3);}})[_0x1cea('0x27')](function(_0x392ca9){if(_0x392ca9){_0xd81d1d=_0x392ca9[_0x1cea('0x38')];if(!_0x8edf37[_0x1cea('0x34')][_0x1cea('0x55')](_0x1cea('0x39'))){_0x1e82e3[_0x1cea('0x1f')]=qs[_0x1cea('0x1f')](_0x8edf37['query'][_0x1cea('0x1f')]);_0x1e82e3[_0x1cea('0x1e')]=qs[_0x1cea('0x1e')](_0x8edf37[_0x1cea('0x34')][_0x1cea('0x1e')]);}return _0x8d96ca[_0x1cea('0x51')](_0x1e82e3);}})['then'](function(_0x277c1e){if(_0x277c1e){return _0x277c1e?{'count':_0xd81d1d,'rows':_0x277c1e}:null;}})[_0x1cea('0x27')](respondWithResult(_0x5cd58b,null))['catch'](handleError(_0x5cd58b,null));};exports[_0x1cea('0x56')]=function(_0x370a23,_0x401d16,_0xa4c4ac){return db['ChatGroup'][_0x1cea('0x49')]({'where':{'id':_0x370a23['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x401d16,null))[_0x1cea('0x27')](function(_0x13fa3d){if(_0x13fa3d){return _0x13fa3d[_0x1cea('0x56')](_0x370a23[_0x1cea('0x34')][_0x1cea('0x50')]);}})[_0x1cea('0x27')](respondWithStatusCode(_0x401d16,null))[_0x1cea('0x46')](handleError(_0x401d16,null));};exports[_0x1cea('0x57')]=function(_0x531c35,_0x5cdfd5,_0x2f4a49){if(_0x531c35[_0x1cea('0x4b')]['id']){delete _0x531c35[_0x1cea('0x4b')]['id'];}return db[_0x1cea('0x2e')][_0x1cea('0x49')]({'where':{'id':_0x531c35['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x5cdfd5,null))[_0x1cea('0x27')](function(_0x2f5abf){if(_0x2f5abf){_0x531c35[_0x1cea('0x4b')][_0x1cea('0x58')]=_0x2f5abf['id'];return db['ChatInternalMessage'][_0x1cea('0x4a')](_0x531c35[_0x1cea('0x4b')]);}})[_0x1cea('0x27')](respondWithResult(_0x5cdfd5,null))[_0x1cea('0x46')](handleError(_0x5cdfd5,null));};exports['getMessages']=function(_0x3740a3,_0x3ec81a,_0x24afcd){var _0x249951={};var _0x2c467d={};var _0x1ba903;var _0x820dfa;return db[_0x1cea('0x2e')][_0x1cea('0x52')]({'where':{'id':_0x3740a3[_0x1cea('0x48')]['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x3ec81a,null))[_0x1cea('0x27')](function(_0x1c4d15){if(_0x1c4d15){_0x1ba903=_0x1c4d15;_0x2c467d[_0x1cea('0x32')]=_['keys'](db['ChatInternalMessage'][_0x1cea('0x2f')]);_0x2c467d['query']=_[_0x1cea('0x33')](_0x3740a3[_0x1cea('0x34')]);_0x2c467d[_0x1cea('0x3c')]=_['intersection'](_0x2c467d[_0x1cea('0x32')],_0x2c467d[_0x1cea('0x34')]);_0x249951[_0x1cea('0x37')]=_[_0x1cea('0x35')](_0x2c467d[_0x1cea('0x32')],qs['fields'](_0x3740a3['query'][_0x1cea('0x36')]));_0x249951[_0x1cea('0x37')]=_0x249951['attributes'][_0x1cea('0x38')]?_0x249951['attributes']:_0x2c467d[_0x1cea('0x32')];_0x249951['order']=qs['sort'](_0x3740a3[_0x1cea('0x34')]['sort']);_0x249951[_0x1cea('0x3b')]=qs['filters'](_[_0x1cea('0x3d')](_0x3740a3[_0x1cea('0x34')],_0x2c467d[_0x1cea('0x3c')]));if(_0x3740a3[_0x1cea('0x34')]['filter']){_0x249951[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x249951['where'],{'$or':_[_0x1cea('0x2d')](_0x249951[_0x1cea('0x37')],function(_0x42a0a3){var _0x4c1228={};_0x4c1228[_0x42a0a3]={'$like':'%'+_0x3740a3[_0x1cea('0x34')][_0x1cea('0x3e')]+'%'};return _0x4c1228;})});}if(_0x3740a3['query'][_0x1cea('0x59')]){var _0x11914c=_0x3740a3[_0x1cea('0x34')][_0x1cea('0x59')][_0x1cea('0x5a')](',');var _0x330fe2={};_0x330fe2[_0x11914c[0x0]]={'$gte':moment(_0x11914c[0x1])[_0x1cea('0x5b')](_0x1cea('0x5c'))};_0x249951[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x249951['where'],_0x330fe2);}_0x249951=_['merge']({},_0x249951,_0x3740a3[_0x1cea('0x41')]);return _0x1ba903[_0x1cea('0x5d')](_0x249951);}})[_0x1cea('0x27')](function(_0xc5c618){if(_0xc5c618){_0x820dfa=_0xc5c618[_0x1cea('0x38')];if(!_0x3740a3[_0x1cea('0x34')][_0x1cea('0x55')](_0x1cea('0x39'))){_0x249951['limit']=qs['limit'](_0x3740a3[_0x1cea('0x34')][_0x1cea('0x1f')]);_0x249951['offset']=qs[_0x1cea('0x1e')](_0x3740a3[_0x1cea('0x34')][_0x1cea('0x1e')]);}return _0x1ba903[_0x1cea('0x5d')](_0x249951);}})['then'](function(_0x58744c){if(_0x58744c){return _0x58744c?{'count':_0x820dfa,'rows':_0x58744c}:null;}})[_0x1cea('0x27')](respondWithResult(_0x3ec81a,null))['catch'](handleError(_0x3ec81a,null));};
\ No newline at end of file
+var _0xbcb5=['catch','show','rawAttributes','length','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','removeMembers','ChatGroupId','getMessages','$gte','format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows'];(function(_0x4f18a4,_0x4522ea){var _0x23a9bc=function(_0x3302a3){while(--_0x3302a3){_0x4f18a4['push'](_0x4f18a4['shift']());}};_0x23a9bc(++_0x4522ea);}(_0xbcb5,0x134));var _0x5bcb=function(_0x2aa36f,_0x2e549e){_0x2aa36f=_0x2aa36f-0x0;var _0x5f5a0c=_0xbcb5[_0x2aa36f];return _0x5f5a0c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5bcb('0x0'));var jsonpatch=require(_0x5bcb('0x1'));var rp=require('request-promise');var moment=require(_0x5bcb('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5bcb('0x3'));var path=require(_0x5bcb('0x4'));var sox=require(_0x5bcb('0x5'));var csv=require('to-csv');var ejs=require(_0x5bcb('0x6'));var fs=require('fs');var fs_extra=require(_0x5bcb('0x7'));var _=require(_0x5bcb('0x8'));var squel=require('squel');var crypto=require(_0x5bcb('0x9'));var jsforce=require(_0x5bcb('0xa'));var deskjs=require(_0x5bcb('0xb'));var toCsv=require(_0x5bcb('0xc'));var querystring=require(_0x5bcb('0xd'));var Papa=require(_0x5bcb('0xe'));var Redis=require(_0x5bcb('0xf'));var authService=require(_0x5bcb('0x10'));var qs=require(_0x5bcb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bcb('0x12'));var logger=require('../../config/logger')(_0x5bcb('0x13'));var utils=require(_0x5bcb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5bcb('0x15'));var db=require(_0x5bcb('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5bcb('0x17'),'port':0x18eb});var socket=require(_0x5bcb('0x18'))(new Redis(config[_0x5bcb('0x19')]));require('./chatGroup.socket')[_0x5bcb('0x1a')](socket);function respondWithStatusCode(_0xedf2ab,_0xbaa5f4){_0xbaa5f4=_0xbaa5f4||0xcc;return function(_0x237a66){if(_0x237a66){return _0xedf2ab[_0x5bcb('0x1b')](_0xbaa5f4);}return _0xedf2ab[_0x5bcb('0x1c')](_0xbaa5f4)[_0x5bcb('0x1d')]();};}function respondWithResult(_0x265220,_0x42a397){_0x42a397=_0x42a397||0xc8;return function(_0x19f2a0){if(_0x19f2a0){return _0x265220[_0x5bcb('0x1c')](_0x42a397)[_0x5bcb('0x1e')](_0x19f2a0);}};}function respondWithFilteredResult(_0x1e3cf6,_0x5edde5){return function(_0x308e35){if(_0x308e35){var _0x522250=typeof _0x5edde5[_0x5bcb('0x1f')]===_0x5bcb('0x20')&&typeof _0x5edde5[_0x5bcb('0x21')]===_0x5bcb('0x20');var _0x164310=_0x308e35[_0x5bcb('0x22')];var _0x3bc3d4=_0x522250?0x0:_0x5edde5[_0x5bcb('0x1f')];var _0x10d056=_0x522250?_0x308e35[_0x5bcb('0x22')]:_0x5edde5['offset']+_0x5edde5[_0x5bcb('0x21')];var _0x3eaea6;if(_0x10d056>=_0x164310){_0x10d056=_0x164310;_0x3eaea6=0xc8;}else{_0x3eaea6=0xce;}_0x1e3cf6['status'](_0x3eaea6);return _0x1e3cf6[_0x5bcb('0x23')](_0x5bcb('0x24'),_0x3bc3d4+'-'+_0x10d056+'/'+_0x164310)[_0x5bcb('0x1e')](_0x308e35);}return null;};}function patchUpdates(_0x2172dd){return function(_0x3ca324){try{jsonpatch[_0x5bcb('0x25')](_0x3ca324,_0x2172dd,!![]);}catch(_0x1752ee){return BPromise[_0x5bcb('0x26')](_0x1752ee);}return _0x3ca324[_0x5bcb('0x27')]();};}function saveUpdates(_0x57ef9f,_0x513ab4){return function(_0x146e85){if(_0x146e85){return _0x146e85[_0x5bcb('0x28')](_0x57ef9f)[_0x5bcb('0x29')](function(_0x2308fe){return _0x2308fe;});}return null;};}function removeEntity(_0x28ac04,_0x1a8864){return function(_0x32fc45){if(_0x32fc45){return _0x32fc45[_0x5bcb('0x2a')]()[_0x5bcb('0x29')](function(){_0x28ac04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x263f21,_0x277fa6){return function(_0x2507cc){if(!_0x2507cc){_0x263f21[_0x5bcb('0x1b')](0x194);}return _0x2507cc;};}function handleError(_0x1ba918,_0x3199e9){_0x3199e9=_0x3199e9||0x1f4;return function(_0xc8d637){logger['error'](_0xc8d637['stack']);if(_0xc8d637['name']){delete _0xc8d637[_0x5bcb('0x2b')];}_0x1ba918[_0x5bcb('0x1c')](_0x3199e9)[_0x5bcb('0x2c')](_0xc8d637);};}exports[_0x5bcb('0x2d')]=function(_0xf09d0b,_0x2feeba){var _0x47560d={},_0x20cede={},_0x296f5b={'count':0x0,'rows':[]};var _0x290c51=_[_0x5bcb('0x2e')](db['ChatGroup']['rawAttributes'],function(_0x2826e3){return{'name':_0x2826e3[_0x5bcb('0x2f')],'type':_0x2826e3['type'][_0x5bcb('0x30')]};});_0x20cede[_0x5bcb('0x31')]=_['map'](_0x290c51,'name');_0x20cede['query']=_[_0x5bcb('0x32')](_0xf09d0b[_0x5bcb('0x33')]);_0x20cede[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x20cede[_0x5bcb('0x31')],_0x20cede[_0x5bcb('0x33')]);_0x47560d[_0x5bcb('0x36')]=_['intersection'](_0x20cede[_0x5bcb('0x31')],qs[_0x5bcb('0x37')](_0xf09d0b[_0x5bcb('0x33')]['fields']));_0x47560d['attributes']=_0x47560d[_0x5bcb('0x36')]['length']?_0x47560d[_0x5bcb('0x36')]:_0x20cede['model'];if(!_0xf09d0b['query'][_0x5bcb('0x38')](_0x5bcb('0x39'))){_0x47560d[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x21')]);_0x47560d[_0x5bcb('0x1f')]=qs['offset'](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}_0x47560d[_0x5bcb('0x3a')]=qs[_0x5bcb('0x3b')](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x3b')]);_0x47560d['where']=qs[_0x5bcb('0x34')](_[_0x5bcb('0x3c')](_0xf09d0b[_0x5bcb('0x33')],_0x20cede[_0x5bcb('0x34')]),_0x290c51);if(_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x3d')]){_0x47560d[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x47560d[_0x5bcb('0x3e')],{'$or':_[_0x5bcb('0x2e')](_0x290c51,function(_0x27ab6c){if(_0x27ab6c[_0x5bcb('0x40')]!==_0x5bcb('0x41')){var _0x3bd363={};_0x3bd363[_0x27ab6c[_0x5bcb('0x2b')]]={'$like':'%'+_0xf09d0b['query'][_0x5bcb('0x3d')]+'%'};return _0x3bd363;}})});}_0x47560d=_[_0x5bcb('0x3f')]({},_0x47560d,_0xf09d0b[_0x5bcb('0x42')]);var _0x169694={'where':_0x47560d[_0x5bcb('0x3e')]};return db[_0x5bcb('0x43')][_0x5bcb('0x22')](_0x169694)[_0x5bcb('0x29')](function(_0x2d9ed2){_0x296f5b[_0x5bcb('0x22')]=_0x2d9ed2;if(_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x44')]){_0x47560d[_0x5bcb('0x45')]=[{'all':!![]}];}return db[_0x5bcb('0x43')][_0x5bcb('0x46')](_0x47560d);})['then'](function(_0x10dabb){_0x296f5b[_0x5bcb('0x47')]=_0x10dabb;return _0x296f5b;})[_0x5bcb('0x29')](respondWithFilteredResult(_0x2feeba,_0x47560d))[_0x5bcb('0x48')](handleError(_0x2feeba,null));};exports[_0x5bcb('0x49')]=function(_0x30435c,_0x3d7b54){var _0x33bb6f={'raw':!![],'where':{'id':_0x30435c['params']['id']}},_0x2840de={};_0x2840de[_0x5bcb('0x31')]=_[_0x5bcb('0x32')](db[_0x5bcb('0x43')][_0x5bcb('0x4a')]);_0x2840de['query']=_[_0x5bcb('0x32')](_0x30435c[_0x5bcb('0x33')]);_0x2840de[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x2840de[_0x5bcb('0x31')],_0x2840de['query']);_0x33bb6f['attributes']=_[_0x5bcb('0x35')](_0x2840de[_0x5bcb('0x31')],qs['fields'](_0x30435c[_0x5bcb('0x33')][_0x5bcb('0x37')]));_0x33bb6f[_0x5bcb('0x36')]=_0x33bb6f['attributes'][_0x5bcb('0x4b')]?_0x33bb6f[_0x5bcb('0x36')]:_0x2840de['model'];if(_0x30435c[_0x5bcb('0x33')][_0x5bcb('0x44')]){_0x33bb6f[_0x5bcb('0x45')]=[{'all':!![]}];}_0x33bb6f=_[_0x5bcb('0x3f')]({},_0x33bb6f,_0x30435c[_0x5bcb('0x42')]);return db[_0x5bcb('0x43')][_0x5bcb('0x4c')](_0x33bb6f)[_0x5bcb('0x29')](handleEntityNotFound(_0x3d7b54,null))[_0x5bcb('0x29')](respondWithResult(_0x3d7b54,null))[_0x5bcb('0x48')](handleError(_0x3d7b54,null));};exports[_0x5bcb('0x4d')]=function(_0x2b34b1,_0x316030){return db['ChatGroup']['create'](_0x2b34b1['body'],{})[_0x5bcb('0x29')](respondWithResult(_0x316030,0xc9))[_0x5bcb('0x48')](handleError(_0x316030,null));};exports[_0x5bcb('0x28')]=function(_0x6046c2,_0x570897){if(_0x6046c2[_0x5bcb('0x4e')]['id']){delete _0x6046c2[_0x5bcb('0x4e')]['id'];}return db['ChatGroup'][_0x5bcb('0x4c')]({'where':{'id':_0x6046c2[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x570897,null))['then'](saveUpdates(_0x6046c2[_0x5bcb('0x4e')],null))[_0x5bcb('0x29')](respondWithResult(_0x570897,null))[_0x5bcb('0x48')](handleError(_0x570897,null));};exports['destroy']=function(_0x270f77,_0x343a95){return db['ChatGroup'][_0x5bcb('0x4c')]({'where':{'id':_0x270f77[_0x5bcb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x343a95,null))[_0x5bcb('0x29')](removeEntity(_0x343a95,null))[_0x5bcb('0x48')](handleError(_0x343a95,null));};exports['describe']=function(_0x11050a,_0x2eaf6b){return db[_0x5bcb('0x43')][_0x5bcb('0x50')]()[_0x5bcb('0x29')](respondWithResult(_0x2eaf6b,null))[_0x5bcb('0x48')](handleError(_0x2eaf6b,null));};exports[_0x5bcb('0x51')]=function(_0x14ce95,_0x4adc34,_0x33eaf5){return db[_0x5bcb('0x52')][_0x5bcb('0x22')]({'where':{'ChatGroupId':_0x14ce95[_0x5bcb('0x4f')]['id'],'ToId':_0x14ce95[_0x5bcb('0x53')]['id'],'read':![]}})['then'](function(_0x185b80){return{'id':_[_0x5bcb('0x54')](_0x14ce95[_0x5bcb('0x4f')]['id']),'count':_0x185b80};})[_0x5bcb('0x29')](respondWithResult(_0x4adc34,null))[_0x5bcb('0x48')](handleError(_0x4adc34,null));};exports[_0x5bcb('0x55')]=function(_0x25ed51,_0x4e0bee,_0x402b74){return db[_0x5bcb('0x43')][_0x5bcb('0x4c')]({'where':{'id':_0x25ed51[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x4e0bee,null))[_0x5bcb('0x29')](function(_0x2c0f77){if(_0x2c0f77){return _0x2c0f77[_0x5bcb('0x55')](_0x25ed51[_0x5bcb('0x4e')][_0x5bcb('0x56')],_[_0x5bcb('0x57')](_0x25ed51['body'],[_0x5bcb('0x56'),'id'])||{});}})[_0x5bcb('0x29')](respondWithResult(_0x4e0bee,null))[_0x5bcb('0x48')](handleError(_0x4e0bee,null));};exports['getMembers']=function(_0x525166,_0x4e1935,_0x471c83){var _0x350fbb={};var _0x3e448f={};var _0x34d407;var _0x26a65;return db['ChatGroup']['findOne']({'where':{'id':_0x525166[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x4e1935,null))[_0x5bcb('0x29')](function(_0x3648b0){if(_0x3648b0){_0x34d407=_0x3648b0;_0x3e448f[_0x5bcb('0x31')]=_[_0x5bcb('0x32')](db[_0x5bcb('0x58')][_0x5bcb('0x4a')]);_0x3e448f[_0x5bcb('0x33')]=_[_0x5bcb('0x32')](_0x525166['query']);_0x3e448f[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x3e448f[_0x5bcb('0x31')],_0x3e448f[_0x5bcb('0x33')]);_0x350fbb['attributes']=_[_0x5bcb('0x35')](_0x3e448f[_0x5bcb('0x31')],qs['fields'](_0x525166[_0x5bcb('0x33')]['fields']));_0x350fbb[_0x5bcb('0x36')]=_0x350fbb[_0x5bcb('0x36')][_0x5bcb('0x4b')]?_0x350fbb[_0x5bcb('0x36')]:_0x3e448f['model'];_0x350fbb[_0x5bcb('0x3a')]=qs['sort'](_0x525166[_0x5bcb('0x33')][_0x5bcb('0x3b')]);_0x350fbb[_0x5bcb('0x3e')]=qs[_0x5bcb('0x34')](_[_0x5bcb('0x3c')](_0x525166['query'],_0x3e448f[_0x5bcb('0x34')]));if(_0x525166['query'][_0x5bcb('0x3d')]){_0x350fbb[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x350fbb[_0x5bcb('0x3e')],{'$or':_['map'](_0x350fbb[_0x5bcb('0x36')],function(_0xabe3b5){var _0x27506e={};_0x27506e[_0xabe3b5]={'$like':'%'+_0x525166[_0x5bcb('0x33')][_0x5bcb('0x3d')]+'%'};return _0x27506e;})});}_0x350fbb=_[_0x5bcb('0x3f')]({},_0x350fbb,_0x525166['options']);return _0x34d407[_0x5bcb('0x59')](_0x350fbb);}})[_0x5bcb('0x29')](function(_0x44115b){if(_0x44115b){_0x26a65=_0x44115b[_0x5bcb('0x4b')];if(!_0x525166[_0x5bcb('0x33')][_0x5bcb('0x38')](_0x5bcb('0x39'))){_0x350fbb[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0x525166[_0x5bcb('0x33')]['limit']);_0x350fbb['offset']=qs[_0x5bcb('0x1f')](_0x525166[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}return _0x34d407['getMembers'](_0x350fbb);}})['then'](function(_0x5c7ace){if(_0x5c7ace){return _0x5c7ace?{'count':_0x26a65,'rows':_0x5c7ace}:null;}})['then'](respondWithResult(_0x4e1935,null))[_0x5bcb('0x48')](handleError(_0x4e1935,null));};exports[_0x5bcb('0x5a')]=function(_0x441a28,_0x186e1d,_0x25a317){return db[_0x5bcb('0x43')][_0x5bcb('0x4c')]({'where':{'id':_0x441a28[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x186e1d,null))['then'](function(_0x4ecdf6){if(_0x4ecdf6){return _0x4ecdf6[_0x5bcb('0x5a')](_0x441a28[_0x5bcb('0x33')][_0x5bcb('0x56')]);}})[_0x5bcb('0x29')](respondWithStatusCode(_0x186e1d,null))['catch'](handleError(_0x186e1d,null));};exports['addMessage']=function(_0x5ba6ac,_0x475779,_0x522b04){if(_0x5ba6ac['body']['id']){delete _0x5ba6ac[_0x5bcb('0x4e')]['id'];}return db[_0x5bcb('0x43')]['find']({'where':{'id':_0x5ba6ac['params']['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x475779,null))['then'](function(_0x1bd757){if(_0x1bd757){_0x5ba6ac['body'][_0x5bcb('0x5b')]=_0x1bd757['id'];return db[_0x5bcb('0x52')][_0x5bcb('0x4d')](_0x5ba6ac[_0x5bcb('0x4e')]);}})[_0x5bcb('0x29')](respondWithResult(_0x475779,null))[_0x5bcb('0x48')](handleError(_0x475779,null));};exports[_0x5bcb('0x5c')]=function(_0x2bfc1f,_0x29cf71,_0xb55a4f){var _0x583665={};var _0x5e656c={};var _0x240902;var _0x4347b6;return db['ChatGroup']['findOne']({'where':{'id':_0x2bfc1f['params']['id']}})['then'](handleEntityNotFound(_0x29cf71,null))['then'](function(_0xf0d662){if(_0xf0d662){_0x240902=_0xf0d662;_0x5e656c['model']=_[_0x5bcb('0x32')](db['ChatInternalMessage']['rawAttributes']);_0x5e656c[_0x5bcb('0x33')]=_['keys'](_0x2bfc1f[_0x5bcb('0x33')]);_0x5e656c['filters']=_[_0x5bcb('0x35')](_0x5e656c[_0x5bcb('0x31')],_0x5e656c[_0x5bcb('0x33')]);_0x583665[_0x5bcb('0x36')]=_[_0x5bcb('0x35')](_0x5e656c['model'],qs[_0x5bcb('0x37')](_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x37')]));_0x583665[_0x5bcb('0x36')]=_0x583665[_0x5bcb('0x36')]['length']?_0x583665['attributes']:_0x5e656c[_0x5bcb('0x31')];_0x583665['order']=qs[_0x5bcb('0x3b')](_0x2bfc1f['query'][_0x5bcb('0x3b')]);_0x583665[_0x5bcb('0x3e')]=qs[_0x5bcb('0x34')](_['pick'](_0x2bfc1f[_0x5bcb('0x33')],_0x5e656c['filters']));if(_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x3d')]){_0x583665[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x583665['where'],{'$or':_['map'](_0x583665[_0x5bcb('0x36')],function(_0x3cfb5a){var _0x8c54ed={};_0x8c54ed[_0x3cfb5a]={'$like':'%'+_0x2bfc1f['query'][_0x5bcb('0x3d')]+'%'};return _0x8c54ed;})});}if(_0x2bfc1f['query'][_0x5bcb('0x5d')]){var _0x4a8a6e=_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x5d')]['split'](',');var _0xe06610={};_0xe06610[_0x4a8a6e[0x0]]={'$gte':moment(_0x4a8a6e[0x1])[_0x5bcb('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x583665[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x583665['where'],_0xe06610);}_0x583665=_['merge']({},_0x583665,_0x2bfc1f[_0x5bcb('0x42')]);return _0x240902[_0x5bcb('0x5c')](_0x583665);}})[_0x5bcb('0x29')](function(_0x1ac874){if(_0x1ac874){_0x4347b6=_0x1ac874[_0x5bcb('0x4b')];if(!_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x38')]('nolimit')){_0x583665[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0x2bfc1f[_0x5bcb('0x33')]['limit']);_0x583665[_0x5bcb('0x1f')]=qs[_0x5bcb('0x1f')](_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}return _0x240902['getMessages'](_0x583665);}})[_0x5bcb('0x29')](function(_0x57c723){if(_0x57c723){return _0x57c723?{'count':_0x4347b6,'rows':_0x57c723}:null;}})[_0x5bcb('0x29')](respondWithResult(_0x29cf71,null))[_0x5bcb('0x48')](handleError(_0x29cf71,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 14d3ea3..17071df 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 _0xfb93=['hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0xccb896,_0x3d6c86){var _0x412b5e=function(_0x4346fa){while(--_0x4346fa){_0xccb896['push'](_0xccb896['shift']());}};_0x412b5e(++_0x3d6c86);}(_0xfb93,0x111));var _0x3fb9=function(_0x595275,_0x1b5d9a){_0x595275=_0x595275-0x0;var _0x528e02=_0xfb93[_0x595275];return _0x528e02;};'use strict';var EventEmitter=require(_0x3fb9('0x0'));var ChatGroup=require(_0x3fb9('0x1'))['db'][_0x3fb9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3fb9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fb9('0x4'),'afterDestroy':_0x3fb9('0x5')};function emitEvent(_0x492ff9){return function(_0x49ac35,_0x4d5ec9,_0x131e5a){ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9+':'+_0x49ac35['id'],_0x49ac35);ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9,_0x49ac35);_0x131e5a(null);};}for(var e in events){if(events[_0x3fb9('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x84d6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatGroup'];(function(_0x14a6f7,_0x586f25){var _0x42c47d=function(_0x2ed1c8){while(--_0x2ed1c8){_0x14a6f7['push'](_0x14a6f7['shift']());}};_0x42c47d(++_0x586f25);}(_0x84d6,0x180));var _0x684d=function(_0x40ba45,_0x13be71){_0x40ba45=_0x40ba45-0x0;var _0x4e290e=_0x84d6[_0x40ba45];return _0x4e290e;};'use strict';var EventEmitter=require(_0x684d('0x0'));var ChatGroup=require(_0x684d('0x1'))['db'][_0x684d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x684d('0x3')](0x0);var events={'afterCreate':_0x684d('0x4'),'afterUpdate':_0x684d('0x5'),'afterDestroy':_0x684d('0x6')};function emitEvent(_0x917d4d){return function(_0xb449ca,_0x26fcbe,_0x34c9b6){ChatGroupEvents[_0x684d('0x7')](_0x917d4d+':'+_0xb449ca['id'],_0xb449ca);ChatGroupEvents[_0x684d('0x7')](_0x917d4d,_0xb449ca);_0x34c9b6(null);};}for(var e in events){if(events[_0x684d('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 86d03a5..fad15b5 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 _0x9a3a=['api','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','util','../../config/logger'];(function(_0x16f41b,_0x5e0f92){var _0x321c3b=function(_0x5253f0){while(--_0x5253f0){_0x16f41b['push'](_0x16f41b['shift']());}};_0x321c3b(++_0x5e0f92);}(_0x9a3a,0xc6));var _0xa9a3=function(_0x17c3d9,_0x53c486){_0x17c3d9=_0x17c3d9-0x0;var _0x497c0f=_0x9a3a[_0x17c3d9];return _0x497c0f;};'use strict';var _=require('lodash');var util=require(_0xa9a3('0x0'));var logger=require(_0xa9a3('0x1'))(_0xa9a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa9a3('0x3'));var fs=require('fs');var path=require(_0xa9a3('0x4'));var rimraf=require(_0xa9a3('0x5'));var config=require(_0xa9a3('0x6'));var attributes=require('./chatGroup.attributes');module[_0xa9a3('0x7')]=function(_0x3abf7d,_0x406d34){return _0x3abf7d[_0xa9a3('0x8')](_0xa9a3('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc12b=['exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc12b,0x64));var _0xbc12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbc12('0x0'));var util=require(_0xbc12('0x1'));var logger=require(_0xbc12('0x2'))('api');var moment=require(_0xbc12('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc12('0x4'));var fs=require('fs');var path=require(_0xbc12('0x5'));var rimraf=require(_0xbc12('0x6'));var config=require(_0xbc12('0x7'));var attributes=require('./chatGroup.attributes');module[_0xbc12('0x8')]=function(_0x3d3dbd,_0x559364){return _0x3d3dbd[_0xbc12('0x9')](_0xbc12('0xa'),attributes,{'tableName':_0xbc12('0xb'),'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 4ab7f2b..9909a42 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 _0xfd2f=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfd2f,0x14a));var _0xffd2=function(_0xd33ad7,_0x46b20a){_0xd33ad7=_0xd33ad7-0x0;var _0x3040bb=_0xfd2f[_0xd33ad7];return _0x3040bb;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xffd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffd2('0x4'))['db'];var utils=require(_0xffd2('0x5'));var logger=require('../../config/logger')(_0xffd2('0x6'));var config=require(_0xffd2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xffd2('0x8')]=_[_0xffd2('0x9')](config['redis'],{'host':_0xffd2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xffd2('0xb'))[_0xffd2('0xc')](socket);function respondWithRpcPromise(_0x242109,_0xececd8,_0x4be9e4){return new BPromise(function(_0x179c11,_0x5292bd){return client['request'](_0x242109,_0x4be9e4)['then'](function(_0x2cac45){logger[_0xffd2('0xd')](_0xffd2('0xe'),_0xececd8,_0xffd2('0xf'));logger[_0xffd2('0x10')](_0xffd2('0x11'),_0xececd8,_0xffd2('0xf'),JSON['stringify'](_0x2cac45));if(_0x2cac45['error']){if(_0x2cac45['error']['code']===0x1f4){logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x2cac45['error'][_0xffd2('0x13')]);return _0x5292bd(_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);}logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);return _0x179c11(_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);}else{logger['info'](_0xffd2('0xe'),_0xececd8,_0xffd2('0xf'));_0x179c11(_0x2cac45[_0xffd2('0x14')]['message']);}})[_0xffd2('0x15')](function(_0x21f344){logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x21f344);_0x5292bd(_0x21f344);});});}
\ No newline at end of file
+var _0x3c70=['defaults','localhost','socket.io-emitter','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c70,0x10c));var _0x03c7=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x3c70[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var moment=require(_0x03c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x03c7('0x3'));var fs=require('fs');var Redis=require(_0x03c7('0x4'));var db=require(_0x03c7('0x5'))['db'];var utils=require(_0x03c7('0x6'));var logger=require(_0x03c7('0x7'))(_0x03c7('0x8'));var config=require('../../config/environment');var jayson=require(_0x03c7('0x9'));var client=jayson['client'][_0x03c7('0xa')]({'port':0x232a});config[_0x03c7('0xb')]=_[_0x03c7('0xc')](config['redis'],{'host':_0x03c7('0xd'),'port':0x18eb});var socket=require(_0x03c7('0xe'))(new Redis(config[_0x03c7('0xb')]));require('./chatGroup.socket')[_0x03c7('0xf')](socket);function respondWithRpcPromise(_0x48c3f7,_0x103052,_0x20c6c8){return new BPromise(function(_0x57c8fb,_0x856199){return client[_0x03c7('0x10')](_0x48c3f7,_0x20c6c8)[_0x03c7('0x11')](function(_0xf98747){logger[_0x03c7('0x12')]('ChatGroup,\x20%s,\x20%s',_0x103052,'request\x20sent');logger[_0x03c7('0x13')](_0x03c7('0x14'),_0x103052,'request\x20sent',JSON[_0x03c7('0x15')](_0xf98747));if(_0xf98747[_0x03c7('0x16')]){if(_0xf98747[_0x03c7('0x16')][_0x03c7('0x17')]===0x1f4){logger[_0x03c7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x103052,_0xf98747[_0x03c7('0x16')]['message']);return _0x856199(_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);}logger['error'](_0x03c7('0x19'),_0x103052,_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);return _0x57c8fb(_0xf98747['error'][_0x03c7('0x18')]);}else{logger[_0x03c7('0x12')](_0x03c7('0x19'),_0x103052,_0x03c7('0x1a'));_0x57c8fb(_0xf98747[_0x03c7('0x1b')][_0x03c7('0x18')]);}})['catch'](function(_0x571108){logger[_0x03c7('0x16')](_0x03c7('0x19'),_0x103052,_0x571108);_0x856199(_0x571108);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 3dcade7..d8c2519 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 _0x686e=['register','./chatGroup.events','save','remove','update','emit'];(function(_0x486451,_0xe0e65e){var _0x585456=function(_0x2417ff){while(--_0x2417ff){_0x486451['push'](_0x486451['shift']());}};_0x585456(++_0xe0e65e);}(_0x686e,0x1db));var _0xe686=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x686e[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0xe686('0x0'));var events=[_0xe686('0x1'),_0xe686('0x2'),_0xe686('0x3')];function createListener(_0x42a6b3,_0x5c936f){return function(_0xf51c49){_0x5c936f[_0xe686('0x4')](_0x42a6b3,_0xf51c49);};}function removeListener(_0x57d6bb,_0x3e90d5){return function(){ChatGroupEvents['removeListener'](_0x57d6bb,_0x3e90d5);};}exports[_0xe686('0x5')]=function(_0x5a9681){for(var _0x48485b=0x0,_0x9457f6=events['length'];_0x48485b<_0x9457f6;_0x48485b++){var _0x1f802f=events[_0x48485b];var _0x1cc96a=createListener('chatGroup:'+_0x1f802f,_0x5a9681);ChatGroupEvents['on'](_0x1f802f,_0x1cc96a);}};
\ No newline at end of file
+var _0x0a82=['removeListener','register','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x138d3d,_0x41a640){var _0x2e1cac=function(_0x1a2a8b){while(--_0x1a2a8b){_0x138d3d['push'](_0x138d3d['shift']());}};_0x2e1cac(++_0x41a640);}(_0x0a82,0x137));var _0x20a8=function(_0x1147e7,_0x22494d){_0x1147e7=_0x1147e7-0x0;var _0x3438bf=_0x0a82[_0x1147e7];return _0x3438bf;};'use strict';var ChatGroupEvents=require(_0x20a8('0x0'));var events=[_0x20a8('0x1'),'remove',_0x20a8('0x2')];function createListener(_0x5eeec1,_0x10e28f){return function(_0x32f1c9){_0x10e28f[_0x20a8('0x3')](_0x5eeec1,_0x32f1c9);};}function removeListener(_0xa96946,_0x154037){return function(){ChatGroupEvents[_0x20a8('0x4')](_0xa96946,_0x154037);};}exports[_0x20a8('0x5')]=function(_0x13b380){for(var _0x4e5924=0x0,_0x5a8f47=events['length'];_0x4e5924<_0x5a8f47;_0x4e5924++){var _0x298e20=events[_0x4e5924];var _0x63d692=createListener(_0x20a8('0x6')+_0x298e20,_0x13b380);ChatGroupEvents['on'](_0x298e20,_0x63d692);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 629a415..f93b279 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 _0x7013=['destroy','removeMembers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x7013,0x16b));var _0x3701=function(_0x3d1c4c,_0xfc49f0){_0x3d1c4c=_0x3d1c4c-0x0;var _0xa03358=_0x7013[_0x3d1c4c];return _0xa03358;};'use strict';var multer=require(_0x3701('0x0'));var util=require(_0x3701('0x1'));var path=require(_0x3701('0x2'));var timeout=require('connect-timeout');var express=require(_0x3701('0x3'));var router=express[_0x3701('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3701('0x5'));var interaction=require(_0x3701('0x6'));var config=require(_0x3701('0x7'));var controller=require('./chatGroup.controller');router[_0x3701('0x8')]('/',auth[_0x3701('0x9')](),controller[_0x3701('0xa')]);router[_0x3701('0x8')]('/describe',auth[_0x3701('0x9')](),controller[_0x3701('0xb')]);router[_0x3701('0x8')](_0x3701('0xc'),auth[_0x3701('0x9')](),controller[_0x3701('0xd')]);router['get'](_0x3701('0xe'),auth[_0x3701('0x9')](),controller[_0x3701('0xf')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x3701('0x10')]);router[_0x3701('0x8')]('/:id/messages',auth[_0x3701('0x9')](),controller[_0x3701('0x11')]);router[_0x3701('0x12')]('/',auth[_0x3701('0x9')](),controller[_0x3701('0x13')]);router[_0x3701('0x12')](_0x3701('0x14'),auth['isAuthenticated'](),controller[_0x3701('0x15')]);router[_0x3701('0x12')](_0x3701('0x16'),auth[_0x3701('0x9')](),controller[_0x3701('0x17')]);router[_0x3701('0x18')](_0x3701('0xc'),auth[_0x3701('0x9')](),controller[_0x3701('0x19')]);router[_0x3701('0x1a')]('/:id',auth[_0x3701('0x9')](),controller[_0x3701('0x1b')]);router[_0x3701('0x1a')](_0x3701('0x14'),auth[_0x3701('0x9')](),controller[_0x3701('0x1c')]);module[_0x3701('0x1d')]=router;
\ No newline at end of file
+var _0x93b2=['express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','post','create','addMembers','put','update','destroy','delete','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x93b2,0xb9));var _0x293b=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x93b2[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0x293b('0x0'));var util=require(_0x293b('0x1'));var path=require(_0x293b('0x2'));var timeout=require(_0x293b('0x3'));var express=require(_0x293b('0x4'));var router=express[_0x293b('0x5')]();var fs_extra=require(_0x293b('0x6'));var auth=require(_0x293b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x293b('0x8'));router[_0x293b('0x9')]('/',auth[_0x293b('0xa')](),controller[_0x293b('0xb')]);router['get']('/describe',auth[_0x293b('0xa')](),controller[_0x293b('0xc')]);router[_0x293b('0x9')](_0x293b('0xd'),auth[_0x293b('0xa')](),controller[_0x293b('0xe')]);router[_0x293b('0x9')](_0x293b('0xf'),auth[_0x293b('0xa')](),controller[_0x293b('0x10')]);router[_0x293b('0x9')](_0x293b('0x11'),auth[_0x293b('0xa')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x293b('0xa')](),controller['getMessages']);router[_0x293b('0x12')]('/',auth[_0x293b('0xa')](),controller[_0x293b('0x13')]);router[_0x293b('0x12')]('/:id/members',auth['isAuthenticated'](),controller[_0x293b('0x14')]);router['post']('/:id/messages',auth[_0x293b('0xa')](),controller['addMessage']);router[_0x293b('0x15')](_0x293b('0xd'),auth[_0x293b('0xa')](),controller[_0x293b('0x16')]);router['delete'](_0x293b('0xd'),auth['isAuthenticated'](),controller[_0x293b('0x17')]);router[_0x293b('0x18')]('/:id/members',auth[_0x293b('0xa')](),controller[_0x293b('0x19')]);module[_0x293b('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 013a24d..62288cc 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 _0xa693=['exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize'];(function(_0x54c529,_0x2bcd83){var _0x40bc2b=function(_0x9562c3){while(--_0x9562c3){_0x54c529['push'](_0x54c529['shift']());}};_0x40bc2b(++_0x2bcd83);}(_0xa693,0xf1));var _0x3a69=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xa693[_0x2aefb6];return _0x202772;};'use strict';var Sequelize=require(_0x3a69('0x0'));module[_0x3a69('0x1')]={'closed':{'type':Sequelize[_0x3a69('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3a69('0x3')]},'ratingType':{'type':Sequelize[_0x3a69('0x4')](_0x3a69('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3a69('0x6')]},'mailTranscript':{'type':Sequelize[_0x3a69('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3a69('0x8')]},'disposition':{'type':Sequelize[_0x3a69('0x7')]},'secondDisposition':{'type':Sequelize[_0x3a69('0x7')]},'thirdDisposition':{'type':Sequelize[_0x3a69('0x7')]},'note':{'type':Sequelize[_0x3a69('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3a69('0x7')]},'osName':{'type':Sequelize[_0x3a69('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3a69('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3a69('0x7')]},'formData':{'type':Sequelize[_0x3a69('0x6')](_0x3a69('0x9'))},'read1stAt':{'type':Sequelize[_0x3a69('0x8')]},'lastMsgAt':{'type':Sequelize[_0x3a69('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3a69('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3a69('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x3a69('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3a69('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7033=['star','thumb','TEXT','STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7033,0x19e));var _0x3703=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7033[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'closed':{'type':Sequelize[_0x3703('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3703('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x3703('0x4'),_0x3703('0x5')),'defaultValue':_0x3703('0x4')},'ratingMessage':{'type':Sequelize[_0x3703('0x6')]},'pathTranscript':{'type':Sequelize[_0x3703('0x6')]},'mailTranscript':{'type':Sequelize[_0x3703('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3703('0x8')]},'disposition':{'type':Sequelize[_0x3703('0x7')]},'secondDisposition':{'type':Sequelize[_0x3703('0x7')]},'thirdDisposition':{'type':Sequelize[_0x3703('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x3703('0x7')]},'osVersion':{'type':Sequelize[_0x3703('0x7')]},'deviceModel':{'type':Sequelize[_0x3703('0x7')]},'deviceVendor':{'type':Sequelize[_0x3703('0x7')]},'deviceType':{'type':Sequelize[_0x3703('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3703('0x7')]},'formData':{'type':Sequelize[_0x3703('0x6')](_0x3703('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3703('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3703('0x7')]},'customerPort':{'type':Sequelize[_0x3703('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x3703('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3703('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 0577331..467844d 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 _0x4dc0=['show','params','model','keys','ChatInteraction','query','filters','intersection','attributes','fields','includeAll','include','options','find','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','Attachment','attachmentDownload','closed','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','mailTranscript','now','pathTranscript','Messages','User','CmContact','ContactId','length','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','nolimit','pick','ChatInteractionId','push','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','read','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','Contact','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','stack','name','send','render','merge','body','agent','interaction','account','index','map','type','key','getOptions','chat','user'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4dc0,0x168));var _0x04dc=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4dc0[_0x47b58b];return _0x46bebe;};'use strict';var rimraf=require(_0x04dc('0x0'));var zipdir=require(_0x04dc('0x1'));var rp=require('request-promise');var moment=require(_0x04dc('0x2'));var BPromise=require(_0x04dc('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04dc('0x4'));var ejs=require(_0x04dc('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x04dc('0x6'));var interaction=require(_0x04dc('0x7'));var qs=require(_0x04dc('0x8'));var pdf=require(_0x04dc('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x04dc('0xa'));var db=require(_0x04dc('0xb'))['db'];config[_0x04dc('0xc')]=_[_0x04dc('0xd')](config[_0x04dc('0xc')],{'host':_0x04dc('0xe'),'port':0x18eb});var socket=require(_0x04dc('0xf'))(new Redis(config[_0x04dc('0xc')]));require(_0x04dc('0x10'))[_0x04dc('0x11')](socket);var jayson=require(_0x04dc('0x12'));var client=jayson[_0x04dc('0x13')][_0x04dc('0x14')]({'port':0x232b});var client9004=jayson[_0x04dc('0x13')][_0x04dc('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x401d46,_0x514af8,_0x23b6e1,_0x27c3c4){return new BPromise(function(_0x1f6ef8,_0x9b3fab){var _0x7395f5=_0x27c3c4||client;return _0x7395f5[_0x04dc('0x15')](_0x401d46,_0x23b6e1)[_0x04dc('0x16')](function(_0x2f84bf){logger['info'](_0x04dc('0x17'),_0x514af8,_0x04dc('0x18'));logger[_0x04dc('0x19')](_0x04dc('0x1a'),_0x514af8,_0x04dc('0x18'),JSON['stringify'](_0x2f84bf));if(_0x2f84bf[_0x04dc('0x1b')]){if(_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1c')]===0x1f4){logger['error'](_0x04dc('0x17'),_0x514af8,_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1d')]);return _0x9b3fab(_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1d')]);}logger[_0x04dc('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x514af8,_0x2f84bf['error'][_0x04dc('0x1d')]);return _0x1f6ef8(_0x2f84bf['error']['message']);}else{logger[_0x04dc('0x1e')](_0x04dc('0x17'),_0x514af8,_0x04dc('0x18'));_0x1f6ef8(_0x2f84bf[_0x04dc('0x1f')]['message']);}})[_0x04dc('0x20')](function(_0x532095){logger[_0x04dc('0x1b')](_0x04dc('0x17'),_0x514af8,_0x532095);_0x9b3fab(_0x532095);});});}function respondWithStatusCode(_0x5f221a,_0x237db6){_0x237db6=_0x237db6||0xcc;return function(_0x540d6e){if(_0x540d6e){return _0x5f221a[_0x04dc('0x21')](_0x237db6);}return _0x5f221a[_0x04dc('0x22')](_0x237db6)[_0x04dc('0x23')]();};}function respondWithResult(_0x16f515,_0x91661a){_0x91661a=_0x91661a||0xc8;return function(_0x48a072){if(_0x48a072){return _0x16f515[_0x04dc('0x22')](_0x91661a)[_0x04dc('0x24')](_0x48a072);}};}function respondWithFilteredResult(_0x3fa53,_0xd1cccb){return function(_0x45622e){if(_0x45622e){var _0x39d82f=typeof _0xd1cccb[_0x04dc('0x25')]==='undefined'&&typeof _0xd1cccb[_0x04dc('0x26')]==='undefined';var _0xf9328e=_0x45622e['count'];var _0x4aeb50=_0x39d82f?0x0:_0xd1cccb[_0x04dc('0x25')];var _0x5e5556=_0x39d82f?_0x45622e[_0x04dc('0x27')]:_0xd1cccb['offset']+_0xd1cccb[_0x04dc('0x26')];var _0x165342;if(_0x5e5556>=_0xf9328e){_0x5e5556=_0xf9328e;_0x165342=0xc8;}else{_0x165342=0xce;}_0x3fa53[_0x04dc('0x22')](_0x165342);return _0x3fa53[_0x04dc('0x28')](_0x04dc('0x29'),_0x4aeb50+'-'+_0x5e5556+'/'+_0xf9328e)[_0x04dc('0x24')](_0x45622e);}return null;};}function saveUpdates(_0x17ce7c){return function(_0x2f0b92){if(_0x2f0b92){return _0x2f0b92['update'](_0x17ce7c)['then'](function(_0x36b0e1){return _0x36b0e1;});}return null;};}function removeEntity(_0x188680){return function(_0x4df92c){if(_0x4df92c){return _0x4df92c['destroy']()[_0x04dc('0x16')](function(){_0x188680[_0x04dc('0x22')](0xcc)[_0x04dc('0x23')]();});}};}function handleEntityNotFound(_0x2dfdf4){return function(_0x1cca42){if(!_0x1cca42){_0x2dfdf4[_0x04dc('0x21')](0x194);}return _0x1cca42;};}function handleError(_0x34077c,_0x13ff61){_0x13ff61=_0x13ff61||0x1f4;return function(_0x160a5c){logger['error'](_0x160a5c[_0x04dc('0x2a')]);if(_0x160a5c[_0x04dc('0x2b')]){delete _0x160a5c[_0x04dc('0x2b')];}_0x34077c[_0x04dc('0x22')](_0x13ff61)[_0x04dc('0x2c')](_0x160a5c);};}function getMustacheRender(_0x383d2f,_0x1b0e24){return Mustache[_0x04dc('0x2d')](_0x383d2f,_[_0x04dc('0x2e')](_0x1b0e24[_0x04dc('0x2f')],{'contact':_0x1b0e24['contact'],'message':_0x1b0e24[_0x04dc('0x1d')],'agent':_0x1b0e24[_0x04dc('0x30')],'interaction':_0x1b0e24[_0x04dc('0x31')],'account':_0x1b0e24[_0x04dc('0x32')]}))||'';}exports[_0x04dc('0x33')]=function(_0x3205bf,_0x3c1742){var _0xc35e78={};var _0x4f7d6f=_[_0x04dc('0x34')](db['ChatInteraction']['rawAttributes'],function(_0xf8f423){return{'name':_0xf8f423['fieldName'],'type':_0xf8f423[_0x04dc('0x35')][_0x04dc('0x36')]};});_0xc35e78=qs[_0x04dc('0x37')](_0x4f7d6f,_0x3205bf);return interaction['findAll'](_0x04dc('0x38'),_0x3205bf['query'],_0x3205bf[_0x04dc('0x39')],_0xc35e78,_0x4f7d6f)['then'](respondWithFilteredResult(_0x3c1742,_0xc35e78))[_0x04dc('0x20')](handleError(_0x3c1742,null));};exports[_0x04dc('0x3a')]=function(_0x1c4427,_0x32b5e5){var _0x4c76bb={'raw':![],'where':{'id':_0x1c4427[_0x04dc('0x3b')]['id']}},_0x24534c={};_0x24534c[_0x04dc('0x3c')]=_[_0x04dc('0x3d')](db[_0x04dc('0x3e')]['rawAttributes']);_0x24534c['query']=_['keys'](_0x1c4427[_0x04dc('0x3f')]);_0x24534c[_0x04dc('0x40')]=_[_0x04dc('0x41')](_0x24534c[_0x04dc('0x3c')],_0x24534c[_0x04dc('0x3f')]);_0x4c76bb[_0x04dc('0x42')]=_[_0x04dc('0x41')](_0x24534c[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x1c4427['query'][_0x04dc('0x43')]));_0x4c76bb[_0x04dc('0x42')]=_0x4c76bb['attributes']['length']?_0x4c76bb['attributes']:_0x24534c[_0x04dc('0x3c')];if(_0x1c4427[_0x04dc('0x3f')][_0x04dc('0x44')]){_0x4c76bb[_0x04dc('0x45')]=[{'all':!![]}];}_0x4c76bb=_[_0x04dc('0x2e')]({},_0x4c76bb,_0x1c4427[_0x04dc('0x46')]);return db['ChatInteraction'][_0x04dc('0x47')](_0x4c76bb)[_0x04dc('0x16')](handleEntityNotFound(_0x32b5e5,null))['then'](respondWithResult(_0x32b5e5,null))[_0x04dc('0x20')](handleError(_0x32b5e5,null));};exports[_0x04dc('0x48')]=function(_0x801dd1,_0x5927f1){return db[_0x04dc('0x3e')]['create'](_0x801dd1[_0x04dc('0x2f')],{})['then'](respondWithResult(_0x5927f1,0xc9))[_0x04dc('0x20')](handleError(_0x5927f1,null));};exports[_0x04dc('0x49')]=function(_0x4e0835,_0x425c5b){if(_0x4e0835['body']['id']){delete _0x4e0835[_0x04dc('0x2f')]['id'];}return db[_0x04dc('0x3e')]['find']({'where':{'id':_0x4e0835[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](handleEntityNotFound(_0x425c5b,null))[_0x04dc('0x16')](saveUpdates(_0x4e0835[_0x04dc('0x2f')],null))['then'](respondWithResult(_0x425c5b,null))[_0x04dc('0x20')](handleError(_0x425c5b,null));};exports[_0x04dc('0x4a')]=function(_0x24bd2a,_0x43358f){return db['ChatInteraction'][_0x04dc('0x47')]({'where':{'id':_0x24bd2a[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x43358f,null))[_0x04dc('0x16')](removeEntity(_0x43358f,null))[_0x04dc('0x20')](handleError(_0x43358f,null));};exports[_0x04dc('0x4b')]=function(_0x81237d,_0x4c32d6){return db['ChatInteraction'][_0x04dc('0x4b')]()[_0x04dc('0x16')](respondWithResult(_0x4c32d6,null))[_0x04dc('0x20')](handleError(_0x4c32d6,null));};exports[_0x04dc('0x4c')]=function(_0x5e08ec,_0x5a2e5a){var _0x1f2aca=_0x5e08ec['params']['id'];var _0x1048ed;var _0x19dd4a;var _0x4cfe9b;return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x1f2aca}})[_0x04dc('0x16')](function(_0x1b7c83){_0x1048ed=_0x1b7c83;return db[_0x04dc('0x4e')][_0x04dc('0x4d')]({'where':{'id':_0x1b7c83[_0x04dc('0x4f')]},'attributes':['id','vidaooApiKey',_0x04dc('0x50'),_0x04dc('0x51'),_0x04dc('0x52'),_0x04dc('0x53')],'raw':!![]});})[_0x04dc('0x16')](function(_0x5bd876){if(_0x5bd876&&_0x5bd876[_0x04dc('0x54')]&&_0x5bd876[_0x04dc('0x50')]){_0x19dd4a=_0x5bd876;var _0x35711c={'interaction':{'id':_0x1f2aca},'agent':{'id':_0x5e08ec['user']['id'],'name':_0x5e08ec[_0x04dc('0x39')]['name'],'fullname':_0x5e08ec[_0x04dc('0x39')][_0x04dc('0x55')],'email':_0x5e08ec[_0x04dc('0x39')][_0x04dc('0x56')]},'contact':_0x5e08ec[_0x04dc('0x2f')]['contact'],'account':_0x5e08ec[_0x04dc('0x2f')]['account']};var _0x364636={'rejectUnauthorized':![],'method':_0x04dc('0x57'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5bd876[_0x04dc('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e08ec['user'][_0x04dc('0x56')]],'buttons':null,'topic':_0x19dd4a[_0x04dc('0x51')],'note':_[_0x04dc('0x58')](_0x19dd4a[_0x04dc('0x52')])?null:getMustacheRender(_0x19dd4a[_0x04dc('0x52')],_0x35711c),'metadata':null},'redirect':_0x04dc('0x59'),'json':!![]};try{if(!_[_0x04dc('0x58')](_0x19dd4a[_0x04dc('0x53')])){var _0x270143=getMustacheRender(_0x19dd4a[_0x04dc('0x53')],_0x35711c);var _0xebff68=JSON[_0x04dc('0x5a')](_0x270143);_0x364636['body']['metadata']=_0xebff68;}}catch(_0x4673f0){throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x5d'));}return rp(_0x364636);}else{throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x5e'));}})[_0x04dc('0x16')](function(_0x399054){_0x4cfe9b=_0x399054;if(_0x4cfe9b['id']){var _0x2e9ad8={'body':_0x4cfe9b[_0x04dc('0x5f')],'ChatWebsiteId':_0x19dd4a['id'],'ChatInteractionId':_0x1048ed['id'],'direction':_0x04dc('0x60'),'UserId':_0x5e08ec[_0x04dc('0x39')]['id']};return db[_0x04dc('0x61')]['create'](_0x2e9ad8,{});}else{throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x62'));}})[_0x04dc('0x16')](function(){return _0x1048ed[_0x04dc('0x63')]({'vidaooSessionId':_0x4cfe9b['id']});})[_0x04dc('0x16')](respondWithResult(_0x5a2e5a,null))[_0x04dc('0x20')](handleError(_0x5a2e5a,null));};exports[_0x04dc('0x64')]=function(_0x8d67e7,_0x3718e6){if(_0x8d67e7[_0x04dc('0x2f')]['id']){delete _0x8d67e7[_0x04dc('0x2f')]['id'];}return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x8d67e7[_0x04dc('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x04dc('0x16')](handleEntityNotFound(_0x3718e6,null))[_0x04dc('0x16')](saveUpdates(_0x8d67e7['body'],null))[_0x04dc('0x16')](respondWithResult(_0x3718e6,null))[_0x04dc('0x20')](handleError(_0x3718e6,null));};exports[_0x04dc('0x65')]=function(_0x451b7e,_0x2c1282){if(_0x451b7e['body']['id']){delete _0x451b7e['body']['id'];}return db['ChatInteraction'][_0x04dc('0x47')]({'where':{'id':_0x451b7e[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](function(_0x3c5462){if(!_0x3c5462){logger[_0x04dc('0x1b')](_0x04dc('0x66'),_0x04dc('0x65'),0x194,_0x04dc('0x67'));_0x2c1282[_0x04dc('0x21')](0x194);}else{if(_0x3c5462[_0x04dc('0x68')]){throw new db['Sequelize'][(_0x04dc('0x5c'))](_0x04dc('0x69'));}}return _0x3c5462;})[_0x04dc('0x16')](function(_0x1a0f28){if(_0x1a0f28){return _0x1a0f28['update']({'closed':_0x451b7e[_0x04dc('0x2f')]['closed'],'disposition':_0x451b7e[_0x04dc('0x2f')]['disposition']})[_0x04dc('0x16')](function(_0x10ba54){return _0x10ba54;});}})['then'](function(){return respondWithRpcPromise(_0x04dc('0x6a'),'abandon',_0x451b7e[_0x04dc('0x2f')],client9004);})[_0x04dc('0x16')](respondWithResult(_0x2c1282,null))[_0x04dc('0x20')](handleError(_0x2c1282,null));};exports[_0x04dc('0x6b')]=function(_0x20286a,_0x5579dc){_0x20286a[_0x04dc('0x2f')][_0x04dc('0x2b')]=_0x20286a[_0x04dc('0x6c')][_0x04dc('0x6d')];_0x20286a[_0x04dc('0x2f')][_0x04dc('0x6e')]=_0x20286a['file']['filename'];_0x20286a[_0x04dc('0x2f')]['type']=_0x20286a[_0x04dc('0x6c')]['mimetype'];return db[_0x04dc('0x6f')][_0x04dc('0x48')](_0x20286a[_0x04dc('0x2f')])[_0x04dc('0x16')](respondWithResult(_0x5579dc,0xc9))['catch'](handleError(_0x5579dc,null));};exports[_0x04dc('0x70')]=function(_0x53f90c,_0x19d573){return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x53f90c[_0x04dc('0x3b')]['id']},'raw':!![]})[_0x04dc('0x16')](handleEntityNotFound(_0x19d573,null))['then'](function(_0x4d429b){if(_0x4d429b){if(_0x4d429b[_0x04dc('0x71')]){return _0x19d573[_0x04dc('0x22')](0x193)[_0x04dc('0x24')]({'status':0x193,'message':'Unauthorized'});}return db[_0x04dc('0x6f')][_0x04dc('0x4d')]({'where':{'id':_0x53f90c[_0x04dc('0x3f')][_0x04dc('0x72')]},'raw':!![]})[_0x04dc('0x16')](handleEntityNotFound(_0x19d573,null));}})[_0x04dc('0x16')](function(_0x1948fb){if(_0x1948fb){var _0x5882a0=_0x1948fb[_0x04dc('0x73')]!==null;var _0x244f72=path[_0x04dc('0x74')](config[_0x04dc('0x75')],_0x04dc('0x76'));if(_0x5882a0){_0x244f72=path[_0x04dc('0x74')](_0x244f72,_0x04dc('0x77'));}var _0x212b44=path['join'](_0x244f72,_0x1948fb[_0x04dc('0x6e')]);return _0x19d573['download'](_0x212b44);}})[_0x04dc('0x20')](handleError(_0x19d573,null));};exports['close']=function(_0x39a152,_0x200d13){var _0x4b6542=null;var _0x57112e=null;var _0x333f74=null;if(_0x39a152['body']['id']){delete _0x39a152['body']['id'];}if(_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')]){_0x333f74=path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0x04dc('0x79')]()));_0x39a152[_0x04dc('0x2f')][_0x04dc('0x7a')]=_0x333f74;}return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x39a152[_0x04dc('0x3b')]['id']},'include':[{'model':db[_0x04dc('0x61')],'as':_0x04dc('0x7b'),'include':[{'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c')}]}]})['then'](handleEntityNotFound(_0x200d13,null))['then'](saveUpdates(_0x39a152[_0x04dc('0x2f')],null))[_0x04dc('0x16')](function(_0x285457){if(_0x285457){_0x4b6542=_0x285457;return db[_0x04dc('0x4e')]['find']({'where':{'id':_0x4b6542[_0x04dc('0x4f')]}});}})[_0x04dc('0x16')](function(_0x1a0704){if(_0x1a0704){_0x57112e=_0x1a0704;return db[_0x04dc('0x7d')][_0x04dc('0x47')]({'where':{'id':_0x4b6542[_0x04dc('0x7e')]}});}})[_0x04dc('0x16')](function(_0x2ab98d){if(_0x2ab98d){if(_0x333f74){var _0x28f626=null;for(var _0x465691=0x1;_0x465691<_0x4b6542[_0x04dc('0x7b')][_0x04dc('0x7f')];++_0x465691){_0x28f626=_0x4b6542['Messages'][_0x465691];var _0x43782e=_0x28f626[_0x04dc('0x68')]?util[_0x04dc('0x80')](_0x04dc('0x81'),_0x57112e[_0x04dc('0x82')],_0x28f626[_0x04dc('0x68')]):_0x04dc('0x83');var _0x453875=_0x39a152['body'][_0x04dc('0x84')]||util[_0x04dc('0x80')]('%s%d',_0x04dc('0x85'),_0x28f626['ContactId']);switch(_0x57112e[_0x04dc('0x86')]){case _0x04dc('0x87'):_0x43782e=_0x28f626['UserId']?util[_0x04dc('0x80')](_0x04dc('0x81'),_0x57112e[_0x04dc('0x82')],_0x28f626['UserId']):'System';break;case'agent_alias':_0x43782e=_0x28f626[_0x04dc('0x68')]?_0x28f626[_0x04dc('0x7c')][_0x04dc('0x88')]||_0x28f626[_0x04dc('0x7c')][_0x04dc('0x55')]:_0x04dc('0x83');break;case _0x04dc('0x89'):_0x43782e=_0x28f626[_0x04dc('0x68')]?_0x28f626[_0x04dc('0x7c')]['fullname']:_0x04dc('0x83');break;default:_0x43782e=_0x28f626['UserId']?util[_0x04dc('0x80')]('%s%d',_0x57112e['agentAlias'],_0x28f626[_0x04dc('0x68')]):_0x04dc('0x83');}var _0x240a6a=util[_0x04dc('0x80')](_0x04dc('0x8a'),moment(_0x28f626[_0x04dc('0x8b')])[_0x04dc('0x80')]('MM/DD/YYYY\x20HH:mm:ss'),_0x28f626[_0x04dc('0x8c')]==='in'?_0x453875:_0x43782e,_0x28f626[_0x04dc('0x2f')]);if(!_0x28f626[_0x04dc('0x8d')]){fs[_0x04dc('0x8e')](_0x333f74,_0x240a6a);}}return db[_0x04dc('0x8f')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x04dc('0x90')],'as':_0x04dc('0x90'),'raw':!![]}]}]});}}})[_0x04dc('0x16')](function(_0x84b7b9){if(!_0x84b7b9||!_0x84b7b9['Smtp']||!_0x39a152[_0x04dc('0x2f')])return _0x4b6542;var _0x1bcf76=_0x84b7b9[_0x04dc('0x91')]();return respondWithRpcPromise(_0x04dc('0x92'),_0x04dc('0x93'),{'account':_0x1bcf76,'message':{'from':util[_0x04dc('0x80')](_0x04dc('0x94'),_0x84b7b9[_0x04dc('0x2b')],_0x84b7b9[_0x04dc('0x56')]||_0x84b7b9['Smtp'][_0x04dc('0x39')]),'to':_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')],'subject':_0x04dc('0x95'),'text':util['format'](_0x04dc('0x96'),_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')]),'attachments':[{'path':_0x333f74}]}})[_0x04dc('0x16')](function(){return _0x4b6542;})[_0x04dc('0x20')](function(_0x2a7195){logger[_0x04dc('0x1b')](_0x2a7195);});})[_0x04dc('0x16')](respondWithStatusCode(_0x200d13,0xc8))['catch'](handleError(_0x200d13,null));};exports[_0x04dc('0x97')]=function(_0xae1370,_0x110315){return db[_0x04dc('0x61')]['find']({'where':{'id':_0xae1370[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x110315,null))[_0x04dc('0x16')](function(_0x50cb2f){if(_0x50cb2f){return _0x50cb2f['addMessage'](_0xae1370['body']['ids'],_[_0x04dc('0x98')](_0xae1370[_0x04dc('0x2f')],[_0x04dc('0x99'),'id'])||{});}})[_0x04dc('0x16')](respondWithResult(_0x110315,null))[_0x04dc('0x20')](handleError(_0x110315,null));};exports[_0x04dc('0x9a')]=function(_0x3b2d59,_0x1d3f9b){var _0x99a2cc={'raw':![],'where':{}};var _0x19bf61={};var _0xde2ec4={'count':0x0,'rows':[]};return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x3b2d59[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1d3f9b,null))['then'](function(_0x2d6404){if(_0x2d6404){_0x19bf61[_0x04dc('0x3c')]=_['keys'](db[_0x04dc('0x61')]['rawAttributes']);_0x19bf61[_0x04dc('0x3f')]=_[_0x04dc('0x3d')](_0x3b2d59['query']);_0x19bf61['filters']=_[_0x04dc('0x41')](_0x19bf61[_0x04dc('0x3c')],_0x19bf61['query']);_0x99a2cc['attributes']=_['intersection'](_0x19bf61[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x43')]));_0x99a2cc['attributes']=_0x99a2cc[_0x04dc('0x42')]['length']?_0x99a2cc[_0x04dc('0x42')]:_0x19bf61[_0x04dc('0x3c')];if(!_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x9b')]('nolimit')){_0x99a2cc[_0x04dc('0x26')]=qs['limit'](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x26')]);_0x99a2cc[_0x04dc('0x25')]=qs[_0x04dc('0x25')](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x25')]);}_0x99a2cc[_0x04dc('0x9c')]=qs[_0x04dc('0x9d')](_0x3b2d59[_0x04dc('0x3f')]['sort']);_0x99a2cc[_0x04dc('0x9e')]=qs[_0x04dc('0x40')](_['pick'](_0x3b2d59['query'],_0x19bf61[_0x04dc('0x40')]));_0x99a2cc[_0x04dc('0x9e')]['ChatInteractionId']=_0x2d6404['id'];if(_0x3b2d59[_0x04dc('0x3f')]['filter']){_0x99a2cc[_0x04dc('0x9e')]=_[_0x04dc('0x2e')](_0x99a2cc[_0x04dc('0x9e')],{'$or':_[_0x04dc('0x34')](_0x99a2cc[_0x04dc('0x42')],function(_0x1e627e){var _0x5b2895={};_0x5b2895[_0x1e627e]={'$like':'%'+_0x3b2d59['query'][_0x04dc('0x9f')]+'%'};return _0x5b2895;})});}if(_0x3b2d59['query']['$gte']){var _0x161cce=_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0xa0')][_0x04dc('0xa1')](',');var _0x3a428f={};_0x3a428f[_0x161cce[0x0]]={'$gte':moment(_0x161cce[0x1])[_0x04dc('0x80')](_0x04dc('0xa2'))};_0x99a2cc[_0x04dc('0x9e')]=_[_0x04dc('0x2e')](_0x99a2cc['where'],_0x3a428f);}_0x99a2cc=_[_0x04dc('0x2e')]({},_0x99a2cc,_0x3b2d59[_0x04dc('0x46')]);return db[_0x04dc('0x61')][_0x04dc('0x27')]({'where':_0x99a2cc[_0x04dc('0x9e')]})[_0x04dc('0x16')](function(_0x119dbc){_0xde2ec4[_0x04dc('0x27')]=_0x119dbc;if(_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x44')]){_0x99a2cc[_0x04dc('0x45')]=[{'all':!![]}];}return db[_0x04dc('0x61')][_0x04dc('0xa3')](_0x99a2cc);})[_0x04dc('0x16')](function(_0x4dd095){_0xde2ec4[_0x04dc('0xa4')]=_0x4dd095;return _0xde2ec4;});}})['then'](respondWithFilteredResult(_0x1d3f9b,_0x99a2cc))[_0x04dc('0x20')](handleError(_0x1d3f9b,null));};exports[_0x04dc('0xa5')]=function(_0x26e847,_0xb1f572){var _0x3e28aa={'where':{}},_0x105a52={},_0x155f87={'count':0x0,'rows':[]};return db[_0x04dc('0x3e')]['findOne']({'where':{'id':_0x26e847['params']['id']}})['then'](handleEntityNotFound(_0xb1f572,null))['then'](function(_0x346b59){if(_0x346b59){_0x105a52[_0x04dc('0x3c')]=_[_0x04dc('0x3d')](db[_0x04dc('0x61')]['rawAttributes']);_0x105a52[_0x04dc('0x3f')]=_[_0x04dc('0x3d')](_0x26e847[_0x04dc('0x3f')]);_0x105a52['filters']=_[_0x04dc('0x41')](_0x105a52['model'],_0x105a52['query']);_0x3e28aa[_0x04dc('0x42')]=_[_0x04dc('0x41')](_0x105a52[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x26e847[_0x04dc('0x3f')]['fields']));_0x3e28aa['attributes']=_0x3e28aa[_0x04dc('0x42')][_0x04dc('0x7f')]?_0x3e28aa[_0x04dc('0x42')]:_0x105a52[_0x04dc('0x3c')];if(!_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9b')](_0x04dc('0xa6'))){_0x3e28aa[_0x04dc('0x26')]=qs[_0x04dc('0x26')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x26')]);_0x3e28aa[_0x04dc('0x25')]=qs[_0x04dc('0x25')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x25')]);}_0x3e28aa[_0x04dc('0x9c')]=qs[_0x04dc('0x9d')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9d')]);_0x3e28aa[_0x04dc('0x9e')]=qs[_0x04dc('0x40')](_[_0x04dc('0xa7')](_0x26e847[_0x04dc('0x3f')],_0x105a52[_0x04dc('0x40')]));_0x3e28aa[_0x04dc('0x9e')][_0x04dc('0xa8')]=_0x346b59['id'];if(_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9f')]){_0x3e28aa['where']=_[_0x04dc('0x2e')](_0x3e28aa[_0x04dc('0x9e')],{'$or':_['map'](_0x3e28aa[_0x04dc('0x42')],function(_0x58da5e){var _0x1bd2b5={};_0x1bd2b5[_0x58da5e]={'$like':'%'+_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9f')]+'%'};return _0x1bd2b5;})});}_0x3e28aa[_0x04dc('0x9e')][_0x04dc('0x8d')]=![];if(_0x26e847[_0x04dc('0x3f')]['id']){_0x3e28aa[_0x04dc('0x9e')]['id']={'$gt':_0x26e847['query']['id']};}_0x3e28aa=_[_0x04dc('0x2e')]({},_0x3e28aa,_0x26e847[_0x04dc('0x46')]);return db[_0x04dc('0x61')][_0x04dc('0x27')]({'where':_0x3e28aa['where']})['then'](function(_0x35691b){_0x155f87[_0x04dc('0x27')]=_0x35691b;_0x3e28aa[_0x04dc('0x45')]=[];if(_0x26e847['query']['includeAgent']){_0x3e28aa[_0x04dc('0x45')][_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c'),'attributes':['id',_0x04dc('0x55'),_0x04dc('0x88')]});}if(_0x26e847['query'][_0x04dc('0x44')]){_0x3e28aa[_0x04dc('0x45')]=[{'all':!![]}];}return db[_0x04dc('0x61')][_0x04dc('0xa3')](_0x3e28aa);})['then'](function(_0xa219d5){_0x155f87[_0x04dc('0xa4')]=_0xa219d5;return _0x155f87;});}})[_0x04dc('0x16')](respondWithFilteredResult(_0xb1f572,_0x3e28aa))[_0x04dc('0x20')](handleError(_0xb1f572,null));};exports['addTags']=function(_0x52a3f7,_0x560069){return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x52a3f7[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x560069,null))[_0x04dc('0x16')](function(_0xaecba4){if(_0xaecba4){return _0xaecba4[_0x04dc('0xaa')](_0x52a3f7[_0x04dc('0x2f')][_0x04dc('0x99')],_['omit'](_0x52a3f7[_0x04dc('0x2f')],[_0x04dc('0x99'),'id'])||{})['spread'](function(){return db[_0x04dc('0xab')][_0x04dc('0xa3')]({'attributes':['id',_0x04dc('0x2b'),_0x04dc('0xac')],'where':{'id':_0x52a3f7[_0x04dc('0x2f')]['ids']}});})[_0x04dc('0x16')](function(_0x602284){socket[_0x04dc('0xad')](_0x04dc('0xae'),{'id':Number(_0x52a3f7['params']['id']),'tags':_0x602284||[]});return{'id':Number(_0x52a3f7[_0x04dc('0x3b')]['id']),'tags':_0x602284||[]};});}})['then'](respondWithResult(_0x560069,null))[_0x04dc('0x20')](handleError(_0x560069,null));};exports[_0x04dc('0xaf')]=function(_0x36c31d,_0x310f3c){return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x36c31d[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](handleEntityNotFound(_0x310f3c,null))[_0x04dc('0x16')](function(_0x5181b3){if(_0x5181b3){return _0x5181b3[_0x04dc('0xaf')](_0x36c31d['query']['ids']);}})['then'](respondWithStatusCode(_0x310f3c,null))[_0x04dc('0x20')](handleError(_0x310f3c,null));};exports['download']=function(_0x4db98f,_0xe71324){var _0x90b90=moment()[_0x04dc('0xb0')]()['toString']();var _0x39fd99=path[_0x04dc('0x74')](config[_0x04dc('0x75')],_0x04dc('0xb1'),_0x04dc('0xb2'),_0x04dc('0xb3'));var _0x14e602=path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server','files','attachments');var _0x324247=path['join'](_0x39fd99,_0x90b90);var _0xb84238=util[_0x04dc('0x80')](_0x04dc('0xb4'),_0x4db98f[_0x04dc('0x3b')]['id'],_0x90b90);var _0x1a42f2=path['join'](_0x39fd99,_0xb84238);var _0x5d6ae9=[];_0x5d6ae9[_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c'),'attributes':['id',_0x04dc('0x55')],'raw':!![]});_0x5d6ae9[_0x04dc('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x04dc('0xb5'),_0x04dc('0xb6')],'raw':!![]});if(_0x4db98f['query']['attachments']){_0x5d6ae9['push']({'model':db['Attachment'],'as':_0x04dc('0x6f'),'raw':!![]});}var _0x5cf151=[{'model':db[_0x04dc('0x61')],'as':_0x04dc('0x7b'),'attributes':['id','body','createdAt',_0x04dc('0x8c'),_0x04dc('0x8d'),_0x04dc('0xb7')],'include':_0x5d6ae9}];_0x5cf151[_0x04dc('0xa9')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x04dc('0x2b')]});_0x5cf151[_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0xb8'),'attributes':['id',_0x04dc('0x55')]});return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x4db98f['params']['id']},'include':_0x5cf151})[_0x04dc('0x16')](handleEntityNotFound(_0xe71324,null))[_0x04dc('0x16')](function(_0x14bd5e){if(_0x14bd5e){var _0x10e98a=_0x14bd5e[_0x04dc('0xb9')]({'plain':!![]});fs[_0x04dc('0xba')](_0x324247);var _0x303e1d={'channel':_0x04dc('0xbb'),'account':_0x10e98a['Account'][_0x04dc('0x2b')],'agent':_0x10e98a[_0x04dc('0xb8')]?_0x10e98a[_0x04dc('0xb8')][_0x04dc('0x55')]:_0x04dc('0xbc'),'createdAt':moment(_0x10e98a['createdAt'])[_0x04dc('0x80')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x10e98a[_0x04dc('0x71')]?moment(_0x10e98a[_0x04dc('0xbd')])[_0x04dc('0x80')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x10e98a[_0x04dc('0xbe')],'chatInfo':{'browser':_0x10e98a[_0x04dc('0xbf')],'os':_0x10e98a[_0x04dc('0xc0')],'referer':_0x10e98a[_0x04dc('0xc1')],'customerIp':_0x10e98a['customerIp'],'customerPort':_0x10e98a[_0x04dc('0xc2')]?_0x10e98a['customerPort']:_0x04dc('0xbc')},'messages':_(_0x10e98a[_0x04dc('0x7b')])[_0x04dc('0xc3')]()[_0x04dc('0x9f')]({'secret':![]})[_0x04dc('0x34')](function(_0x551102){if(_0x551102[_0x04dc('0x6f')]){var _0x5876c3=path[_0x04dc('0x74')](_0x14e602,_0x551102[_0x04dc('0x6f')]['basename']);if(fs[_0x04dc('0xc4')](_0x5876c3)){fs[_0x04dc('0xc5')](_0x5876c3)[_0x04dc('0xc6')](fs[_0x04dc('0xc7')](path['join'](_0x324247,_0x551102[_0x04dc('0x6f')]['basename'])));}}return{'date':moment(_0x551102[_0x04dc('0x8b')])[_0x04dc('0x80')](_0x04dc('0xa2'))['toString'](),'sender':_0x551102[_0x04dc('0x8c')]===_0x04dc('0x60')?_0x551102[_0x04dc('0x7c')]?_0x551102['User']['fullname']:_0x04dc('0x83'):_0x551102[_0x04dc('0xc8')][_0x04dc('0xb5')]+(_0x551102['Contact'][_0x04dc('0xb6')]?'\x20'+_0x551102['Contact'][_0x04dc('0xb6')]:''),'body':_0x551102[_0x04dc('0x6f')]?_0x551102['Attachment']['basename']:_0x551102[_0x04dc('0x2f')],'direction':_0x551102[_0x04dc('0x8c')]===_0x04dc('0x60')?'A':'C','secret':_0x551102['secret'],'read':_0x551102[_0x04dc('0xb7')],'attachment':_0x551102[_0x04dc('0x6f')]};})[_0x04dc('0xc9')]()};return ejs['renderFile'](path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server',_0x04dc('0xca'),_0x04dc('0xcb')),{'interaction':_0x303e1d})[_0x04dc('0x16')](function(_0x54549b){var _0x4d84c5=path[_0x04dc('0x74')](_0x324247,'transcript-'+_0x10e98a['id']+'-'+_0x90b90+_0x04dc('0xcc'));var _0x392c7d={'path':_0x4d84c5,'channel':_0x04dc('0xbb'),'interactionId':_0x10e98a['id']};return pdf[_0x04dc('0xcd')](_0x54549b,_0x392c7d);})[_0x04dc('0x16')](function(){return new Promise(function(_0x3670dd,_0x1a53d2){zipdir(_0x324247,{'saveTo':_0x1a42f2},function(_0xe095b2,_0x204817){if(_0xe095b2)return _0x1a53d2(_0xe095b2);return _0x3670dd(_0x204817);});})['then'](function(){return new BPromise(function(_0x42d3a5,_0x1845bd){rimraf(_0x324247,function(_0x4ec2d7){if(_0x4ec2d7)_0x1845bd(_0x4ec2d7);return _0x42d3a5();});});})[_0x04dc('0x16')](function(){return _0xe71324[_0x04dc('0xce')](_0x1a42f2,_0xb84238,function(_0x4534d0){if(_0x4534d0){logger[_0x04dc('0x1b')](_0x04dc('0xcf'),_0x4534d0);}else{fs[_0x04dc('0xd0')](_0x1a42f2);}});});});}else{return _0xe71324[_0x04dc('0x21')](0xc8);}})[_0x04dc('0x20')](handleError(_0xe71324,null));};
\ No newline at end of file
+var _0x48c7=['includeAgent','setTags','Tag','color','emit','removeTags','unix','toString','server','files','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','closedAt','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','stack','name','send','render','body','contact','account','map','ChatInteraction','fieldName','type','key','getOptions','chat','user','show','params','model','rawAttributes','query','keys','filters','fields','attributes','length','includeAll','include','merge','options','find','create','describe','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','server/files/attachments/','offline-chat/','download','close','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','agentAlias','Visitor','agentIdentifier','website_alias','%s%d','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','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','addMessage','ids','getMessages','intersection','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','nolimit','order','pick','secret'];(function(_0x5637bf,_0x43fde4){var _0x56852a=function(_0x315f99){while(--_0x315f99){_0x5637bf['push'](_0x5637bf['shift']());}};_0x56852a(++_0x43fde4);}(_0x48c7,0x1c3));var _0x748c=function(_0x5285f9,_0x2bd7d7){_0x5285f9=_0x5285f9-0x0;var _0x6edc0c=_0x48c7[_0x5285f9];return _0x6edc0c;};'use strict';var rimraf=require(_0x748c('0x0'));var zipdir=require('zip-dir');var rp=require(_0x748c('0x1'));var moment=require(_0x748c('0x2'));var BPromise=require(_0x748c('0x3'));var Mustache=require(_0x748c('0x4'));var util=require(_0x748c('0x5'));var path=require(_0x748c('0x6'));var ejs=require(_0x748c('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x748c('0x8'));var qs=require(_0x748c('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x748c('0xa'));var config=require('../../config/environment');var db=require(_0x748c('0xb'))['db'];config[_0x748c('0xc')]=_[_0x748c('0xd')](config[_0x748c('0xc')],{'host':_0x748c('0xe'),'port':0x18eb});var socket=require(_0x748c('0xf'))(new Redis(config[_0x748c('0xc')]));require(_0x748c('0x10'))[_0x748c('0x11')](socket);var jayson=require(_0x748c('0x12'));var client=jayson[_0x748c('0x13')]['http']({'port':0x232b});var client9004=jayson['client'][_0x748c('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x552d30,_0x3d24f5,_0x5c2290,_0x394188){return new BPromise(function(_0x5b2326,_0x5e6c59){var _0x3cc317=_0x394188||client;return _0x3cc317[_0x748c('0x15')](_0x552d30,_0x5c2290)[_0x748c('0x16')](function(_0x8b4ae3){logger[_0x748c('0x17')](_0x748c('0x18'),_0x3d24f5,_0x748c('0x19'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3d24f5,_0x748c('0x19'),JSON[_0x748c('0x1a')](_0x8b4ae3));if(_0x8b4ae3[_0x748c('0x1b')]){if(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3d24f5,_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);return _0x5e6c59(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);}logger['error'](_0x748c('0x18'),_0x3d24f5,_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);return _0x5b2326(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3d24f5,'request\x20sent');_0x5b2326(_0x8b4ae3[_0x748c('0x1e')][_0x748c('0x1d')]);}})[_0x748c('0x1f')](function(_0x23e44c){logger['error'](_0x748c('0x18'),_0x3d24f5,_0x23e44c);_0x5e6c59(_0x23e44c);});});}function respondWithStatusCode(_0x5579e1,_0x2ee69f){_0x2ee69f=_0x2ee69f||0xcc;return function(_0xf54003){if(_0xf54003){return _0x5579e1[_0x748c('0x20')](_0x2ee69f);}return _0x5579e1[_0x748c('0x21')](_0x2ee69f)[_0x748c('0x22')]();};}function respondWithResult(_0x3e1406,_0x1043c7){_0x1043c7=_0x1043c7||0xc8;return function(_0x1ce179){if(_0x1ce179){return _0x3e1406[_0x748c('0x21')](_0x1043c7)[_0x748c('0x23')](_0x1ce179);}};}function respondWithFilteredResult(_0x3976aa,_0x3da752){return function(_0x5c7a80){if(_0x5c7a80){var _0x530707=typeof _0x3da752['offset']===_0x748c('0x24')&&typeof _0x3da752[_0x748c('0x25')]===_0x748c('0x24');var _0x37f20e=_0x5c7a80[_0x748c('0x26')];var _0x37d6ef=_0x530707?0x0:_0x3da752['offset'];var _0x386e9a=_0x530707?_0x5c7a80[_0x748c('0x26')]:_0x3da752[_0x748c('0x27')]+_0x3da752['limit'];var _0x420fde;if(_0x386e9a>=_0x37f20e){_0x386e9a=_0x37f20e;_0x420fde=0xc8;}else{_0x420fde=0xce;}_0x3976aa[_0x748c('0x21')](_0x420fde);return _0x3976aa[_0x748c('0x28')](_0x748c('0x29'),_0x37d6ef+'-'+_0x386e9a+'/'+_0x37f20e)[_0x748c('0x23')](_0x5c7a80);}return null;};}function saveUpdates(_0xb7a6c7){return function(_0x3cfe2a){if(_0x3cfe2a){return _0x3cfe2a[_0x748c('0x2a')](_0xb7a6c7)[_0x748c('0x16')](function(_0x2a3801){return _0x2a3801;});}return null;};}function removeEntity(_0x50d8bf){return function(_0x1ea6b0){if(_0x1ea6b0){return _0x1ea6b0[_0x748c('0x2b')]()[_0x748c('0x16')](function(){_0x50d8bf[_0x748c('0x21')](0xcc)[_0x748c('0x22')]();});}};}function handleEntityNotFound(_0x2bc698){return function(_0xdd9dc6){if(!_0xdd9dc6){_0x2bc698[_0x748c('0x20')](0x194);}return _0xdd9dc6;};}function handleError(_0x3e6532,_0x11a48f){_0x11a48f=_0x11a48f||0x1f4;return function(_0xad7e0c){logger['error'](_0xad7e0c[_0x748c('0x2c')]);if(_0xad7e0c[_0x748c('0x2d')]){delete _0xad7e0c[_0x748c('0x2d')];}_0x3e6532[_0x748c('0x21')](_0x11a48f)[_0x748c('0x2e')](_0xad7e0c);};}function getMustacheRender(_0x5551af,_0x59e779){return Mustache[_0x748c('0x2f')](_0x5551af,_['merge'](_0x59e779[_0x748c('0x30')],{'contact':_0x59e779[_0x748c('0x31')],'message':_0x59e779[_0x748c('0x1d')],'agent':_0x59e779['agent'],'interaction':_0x59e779['interaction'],'account':_0x59e779[_0x748c('0x32')]}))||'';}exports['index']=function(_0x2af656,_0x4deab3){var _0xce15cd={};var _0x3d68ab=_[_0x748c('0x33')](db[_0x748c('0x34')]['rawAttributes'],function(_0x27bd22){return{'name':_0x27bd22[_0x748c('0x35')],'type':_0x27bd22[_0x748c('0x36')][_0x748c('0x37')]};});_0xce15cd=qs[_0x748c('0x38')](_0x3d68ab,_0x2af656);return interaction['findAll'](_0x748c('0x39'),_0x2af656['query'],_0x2af656[_0x748c('0x3a')],_0xce15cd,_0x3d68ab)[_0x748c('0x16')](respondWithFilteredResult(_0x4deab3,_0xce15cd))[_0x748c('0x1f')](handleError(_0x4deab3,null));};exports[_0x748c('0x3b')]=function(_0x4cf2ce,_0x22d125){var _0x26a1d5={'raw':![],'where':{'id':_0x4cf2ce[_0x748c('0x3c')]['id']}},_0x34f57c={};_0x34f57c[_0x748c('0x3d')]=_['keys'](db[_0x748c('0x34')][_0x748c('0x3e')]);_0x34f57c[_0x748c('0x3f')]=_[_0x748c('0x40')](_0x4cf2ce[_0x748c('0x3f')]);_0x34f57c[_0x748c('0x41')]=_['intersection'](_0x34f57c[_0x748c('0x3d')],_0x34f57c[_0x748c('0x3f')]);_0x26a1d5['attributes']=_['intersection'](_0x34f57c[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x4cf2ce[_0x748c('0x3f')][_0x748c('0x42')]));_0x26a1d5[_0x748c('0x43')]=_0x26a1d5['attributes'][_0x748c('0x44')]?_0x26a1d5[_0x748c('0x43')]:_0x34f57c[_0x748c('0x3d')];if(_0x4cf2ce[_0x748c('0x3f')][_0x748c('0x45')]){_0x26a1d5[_0x748c('0x46')]=[{'all':!![]}];}_0x26a1d5=_[_0x748c('0x47')]({},_0x26a1d5,_0x4cf2ce[_0x748c('0x48')]);return db[_0x748c('0x34')][_0x748c('0x49')](_0x26a1d5)[_0x748c('0x16')](handleEntityNotFound(_0x22d125,null))['then'](respondWithResult(_0x22d125,null))[_0x748c('0x1f')](handleError(_0x22d125,null));};exports[_0x748c('0x4a')]=function(_0x52599c,_0x561f81){return db[_0x748c('0x34')][_0x748c('0x4a')](_0x52599c['body'],{})[_0x748c('0x16')](respondWithResult(_0x561f81,0xc9))[_0x748c('0x1f')](handleError(_0x561f81,null));};exports[_0x748c('0x2a')]=function(_0x4d0a50,_0x56d1c1){if(_0x4d0a50[_0x748c('0x30')]['id']){delete _0x4d0a50[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x4d0a50[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x56d1c1,null))[_0x748c('0x16')](saveUpdates(_0x4d0a50['body'],null))[_0x748c('0x16')](respondWithResult(_0x56d1c1,null))['catch'](handleError(_0x56d1c1,null));};exports['destroy']=function(_0x14670d,_0x13fd26){return db['ChatInteraction'][_0x748c('0x49')]({'where':{'id':_0x14670d[_0x748c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x13fd26,null))[_0x748c('0x16')](removeEntity(_0x13fd26,null))[_0x748c('0x1f')](handleError(_0x13fd26,null));};exports[_0x748c('0x4b')]=function(_0x3029f9,_0x52c7d6){return db[_0x748c('0x34')][_0x748c('0x4b')]()[_0x748c('0x16')](respondWithResult(_0x52c7d6,null))[_0x748c('0x1f')](handleError(_0x52c7d6,null));};exports['createVidaooSession']=function(_0x3c5b46,_0x3088a5){var _0x2e8f67=_0x3c5b46[_0x748c('0x3c')]['id'];var _0x4f342a;var _0xffc2c3;var _0x514825;return db['ChatInteraction'][_0x748c('0x4c')]({'where':{'id':_0x2e8f67}})[_0x748c('0x16')](function(_0x125857){_0x4f342a=_0x125857;return db['ChatWebsite'][_0x748c('0x4c')]({'where':{'id':_0x125857[_0x748c('0x4d')]},'attributes':['id','vidaooApiKey',_0x748c('0x4e'),_0x748c('0x4f'),_0x748c('0x50'),_0x748c('0x51')],'raw':!![]});})[_0x748c('0x16')](function(_0xe65988){if(_0xe65988&&_0xe65988['vidaooApiKey']&&_0xe65988[_0x748c('0x4e')]){_0xffc2c3=_0xe65988;var _0x295c9c={'interaction':{'id':_0x2e8f67},'agent':{'id':_0x3c5b46[_0x748c('0x3a')]['id'],'name':_0x3c5b46['user']['name'],'fullname':_0x3c5b46[_0x748c('0x3a')][_0x748c('0x52')],'email':_0x3c5b46[_0x748c('0x3a')][_0x748c('0x53')]},'contact':_0x3c5b46[_0x748c('0x30')][_0x748c('0x31')],'account':_0x3c5b46[_0x748c('0x30')][_0x748c('0x32')]};var _0x3e805b={'rejectUnauthorized':![],'method':_0x748c('0x54'),'url':_0x748c('0x55'),'headers':{'X-APIKEY':_0xe65988[_0x748c('0x56')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c5b46[_0x748c('0x3a')][_0x748c('0x53')]],'buttons':null,'topic':_0xffc2c3[_0x748c('0x4f')],'note':_[_0x748c('0x57')](_0xffc2c3['vidaooNote'])?null:getMustacheRender(_0xffc2c3[_0x748c('0x50')],_0x295c9c),'metadata':null},'redirect':_0x748c('0x58'),'json':!![]};try{if(!_[_0x748c('0x57')](_0xffc2c3['vidaooMetadata'])){var _0x20e454=getMustacheRender(_0xffc2c3[_0x748c('0x51')],_0x295c9c);var _0x13c4e2=JSON[_0x748c('0x59')](_0x20e454);_0x3e805b['body'][_0x748c('0x5a')]=_0x13c4e2;}}catch(_0x188633){throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))](_0x748c('0x5d'));}return rp(_0x3e805b);}else{throw new db['Sequelize'][(_0x748c('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x1cf4ac){_0x514825=_0x1cf4ac;if(_0x514825['id']){var _0x5e55fc={'body':_0x514825['join_url'],'ChatWebsiteId':_0xffc2c3['id'],'ChatInteractionId':_0x4f342a['id'],'direction':'out','UserId':_0x3c5b46['user']['id']};return db[_0x748c('0x5e')][_0x748c('0x4a')](_0x5e55fc,{});}else{throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))](_0x748c('0x5f'));}})[_0x748c('0x16')](function(){return _0x4f342a[_0x748c('0x60')]({'vidaooSessionId':_0x514825['id']});})['then'](respondWithResult(_0x3088a5,null))[_0x748c('0x1f')](handleError(_0x3088a5,null));};exports[_0x748c('0x61')]=function(_0x161cef,_0xf19973){if(_0x161cef[_0x748c('0x30')]['id']){delete _0x161cef[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x161cef['params']['id']},'include':[{'model':db[_0x748c('0x62')],'as':_0x748c('0x63')}]})[_0x748c('0x16')](handleEntityNotFound(_0xf19973,null))[_0x748c('0x16')](saveUpdates(_0x161cef[_0x748c('0x30')],null))['then'](respondWithResult(_0xf19973,null))[_0x748c('0x1f')](handleError(_0xf19973,null));};exports[_0x748c('0x64')]=function(_0x3404c5,_0x59e2ba){if(_0x3404c5[_0x748c('0x30')]['id']){delete _0x3404c5[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x3404c5[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](function(_0xc6e39b){if(!_0xc6e39b){logger['error'](_0x748c('0x65'),'abandon',0x194,_0x748c('0x66'));_0x59e2ba['sendStatus'](0x194);}else{if(_0xc6e39b[_0x748c('0x67')]){throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))]('Interaction\x20already\x20assigned');}}return _0xc6e39b;})[_0x748c('0x16')](function(_0x4ae3fc){if(_0x4ae3fc){return _0x4ae3fc[_0x748c('0x2a')]({'closed':_0x3404c5[_0x748c('0x30')][_0x748c('0x68')],'disposition':_0x3404c5[_0x748c('0x30')][_0x748c('0x69')]})[_0x748c('0x16')](function(_0x39d0bf){return _0x39d0bf;});}})[_0x748c('0x16')](function(){return respondWithRpcPromise(_0x748c('0x6a'),'abandon',_0x3404c5['body'],client9004);})[_0x748c('0x16')](respondWithResult(_0x59e2ba,null))[_0x748c('0x1f')](handleError(_0x59e2ba,null));};exports[_0x748c('0x6b')]=function(_0x427b49,_0x47784c){_0x427b49[_0x748c('0x30')][_0x748c('0x2d')]=_0x427b49['file'][_0x748c('0x6c')];_0x427b49[_0x748c('0x30')][_0x748c('0x6d')]=_0x427b49[_0x748c('0x6e')][_0x748c('0x6f')];_0x427b49[_0x748c('0x30')][_0x748c('0x36')]=_0x427b49['file'][_0x748c('0x70')];return db[_0x748c('0x71')][_0x748c('0x4a')](_0x427b49[_0x748c('0x30')])[_0x748c('0x16')](respondWithResult(_0x47784c,0xc9))[_0x748c('0x1f')](handleError(_0x47784c,null));};exports[_0x748c('0x72')]=function(_0x191bcd,_0x587fa5){return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x191bcd[_0x748c('0x3c')]['id']},'raw':!![]})[_0x748c('0x16')](handleEntityNotFound(_0x587fa5,null))[_0x748c('0x16')](function(_0x88b355){if(_0x88b355){if(_0x88b355[_0x748c('0x68')]){return _0x587fa5[_0x748c('0x21')](0x193)[_0x748c('0x23')]({'status':0x193,'message':_0x748c('0x73')});}return db[_0x748c('0x71')][_0x748c('0x4c')]({'where':{'id':_0x191bcd[_0x748c('0x3f')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x587fa5,null));}})['then'](function(_0x269b89){if(_0x269b89){var _0x3648d3=_0x269b89['ChatOfflineMessageId']!==null;var _0x2a3b88=path[_0x748c('0x74')](config['root'],_0x748c('0x75'));if(_0x3648d3){_0x2a3b88=path[_0x748c('0x74')](_0x2a3b88,_0x748c('0x76'));}var _0x27cee3=path[_0x748c('0x74')](_0x2a3b88,_0x269b89[_0x748c('0x6d')]);return _0x587fa5[_0x748c('0x77')](_0x27cee3);}})['catch'](handleError(_0x587fa5,null));};exports[_0x748c('0x78')]=function(_0x548ae1,_0x1fade1){var _0x391f39=null;var _0x47d239=null;var _0x29a62d=null;if(_0x548ae1['body']['id']){delete _0x548ae1['body']['id'];}if(_0x548ae1[_0x748c('0x30')]['mailTranscript']){_0x29a62d=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0x7a'),util[_0x748c('0x7b')](_0x748c('0x7c'),Date[_0x748c('0x7d')]()));_0x548ae1[_0x748c('0x30')][_0x748c('0x7e')]=_0x29a62d;}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x548ae1[_0x748c('0x3c')]['id']},'include':[{'model':db[_0x748c('0x5e')],'as':'Messages','include':[{'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f')}]}]})[_0x748c('0x16')](handleEntityNotFound(_0x1fade1,null))[_0x748c('0x16')](saveUpdates(_0x548ae1[_0x748c('0x30')],null))[_0x748c('0x16')](function(_0x1c331c){if(_0x1c331c){_0x391f39=_0x1c331c;return db['ChatWebsite'][_0x748c('0x49')]({'where':{'id':_0x391f39['ChatWebsiteId']}});}})[_0x748c('0x16')](function(_0x1fe033){if(_0x1fe033){_0x47d239=_0x1fe033;return db[_0x748c('0x62')][_0x748c('0x49')]({'where':{'id':_0x391f39[_0x748c('0x80')]}});}})[_0x748c('0x16')](function(_0x339a03){if(_0x339a03){if(_0x29a62d){var _0x5c0dc8=null;for(var _0x4b7fc5=0x1;_0x4b7fc5<_0x391f39[_0x748c('0x81')]['length'];++_0x4b7fc5){_0x5c0dc8=_0x391f39[_0x748c('0x81')][_0x4b7fc5];var _0x468208=_0x5c0dc8['UserId']?util[_0x748c('0x7b')]('%s%d',_0x47d239[_0x748c('0x82')],_0x5c0dc8[_0x748c('0x67')]):'System';var _0x50e2fc=_0x548ae1[_0x748c('0x30')]['customer']||util['format']('%s%d',_0x748c('0x83'),_0x5c0dc8[_0x748c('0x80')]);switch(_0x47d239[_0x748c('0x84')]){case _0x748c('0x85'):_0x468208=_0x5c0dc8['UserId']?util[_0x748c('0x7b')](_0x748c('0x86'),_0x47d239['agentAlias'],_0x5c0dc8[_0x748c('0x67')]):_0x748c('0x87');break;case _0x748c('0x88'):_0x468208=_0x5c0dc8[_0x748c('0x67')]?_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x89')]||_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x52')]:_0x748c('0x87');break;case'agent_fullname':_0x468208=_0x5c0dc8['UserId']?_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x52')]:'System';break;default:_0x468208=_0x5c0dc8[_0x748c('0x67')]?util[_0x748c('0x7b')](_0x748c('0x86'),_0x47d239[_0x748c('0x82')],_0x5c0dc8[_0x748c('0x67')]):_0x748c('0x87');}var _0x1140ee=util[_0x748c('0x7b')](_0x748c('0x8a'),moment(_0x5c0dc8[_0x748c('0x8b')])[_0x748c('0x7b')](_0x748c('0x8c')),_0x5c0dc8[_0x748c('0x8d')]==='in'?_0x50e2fc:_0x468208,_0x5c0dc8[_0x748c('0x30')]);if(!_0x5c0dc8['secret']){fs['appendFileSync'](_0x29a62d,_0x1140ee);}}return db[_0x748c('0x8e')][_0x748c('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x748c('0x8f')],'as':_0x748c('0x90'),'raw':!![],'include':[{'model':db[_0x748c('0x91')],'as':_0x748c('0x91'),'raw':!![]}]}]});}}})['then'](function(_0x5ebb4c){if(!_0x5ebb4c||!_0x5ebb4c[_0x748c('0x90')]||!_0x548ae1[_0x748c('0x30')])return _0x391f39;var _0x5ab3a3=_0x5ebb4c[_0x748c('0x92')]();return respondWithRpcPromise(_0x748c('0x93'),_0x748c('0x94'),{'account':_0x5ab3a3,'message':{'from':util[_0x748c('0x7b')](_0x748c('0x95'),_0x5ebb4c[_0x748c('0x2d')],_0x5ebb4c[_0x748c('0x53')]||_0x5ebb4c[_0x748c('0x90')]['user']),'to':_0x548ae1[_0x748c('0x30')][_0x748c('0x96')],'subject':_0x748c('0x97'),'text':util['format'](_0x748c('0x98'),_0x548ae1['body'][_0x748c('0x96')]),'attachments':[{'path':_0x29a62d}]}})[_0x748c('0x16')](function(){return _0x391f39;})['catch'](function(_0x43f612){logger[_0x748c('0x1b')](_0x43f612);});})[_0x748c('0x16')](respondWithStatusCode(_0x1fade1,0xc8))[_0x748c('0x1f')](handleError(_0x1fade1,null));};exports[_0x748c('0x99')]=function(_0x5b40a0,_0x11362a){return db['ChatMessage']['find']({'where':{'id':_0x5b40a0['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x11362a,null))[_0x748c('0x16')](function(_0x245445){if(_0x245445){return _0x245445[_0x748c('0x99')](_0x5b40a0['body']['ids'],_['omit'](_0x5b40a0[_0x748c('0x30')],[_0x748c('0x9a'),'id'])||{});}})[_0x748c('0x16')](respondWithResult(_0x11362a,null))['catch'](handleError(_0x11362a,null));};exports[_0x748c('0x9b')]=function(_0x49b2fb,_0x2b652f){var _0x57c2ac={'raw':![],'where':{}};var _0x1f2379={};var _0x11a3da={'count':0x0,'rows':[]};return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x49b2fb['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x2b652f,null))[_0x748c('0x16')](function(_0xc14dd6){if(_0xc14dd6){_0x1f2379[_0x748c('0x3d')]=_[_0x748c('0x40')](db['ChatMessage']['rawAttributes']);_0x1f2379['query']=_['keys'](_0x49b2fb['query']);_0x1f2379[_0x748c('0x41')]=_[_0x748c('0x9c')](_0x1f2379[_0x748c('0x3d')],_0x1f2379['query']);_0x57c2ac[_0x748c('0x43')]=_[_0x748c('0x9c')](_0x1f2379[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x49b2fb[_0x748c('0x3f')][_0x748c('0x42')]));_0x57c2ac[_0x748c('0x43')]=_0x57c2ac[_0x748c('0x43')][_0x748c('0x44')]?_0x57c2ac[_0x748c('0x43')]:_0x1f2379[_0x748c('0x3d')];if(!_0x49b2fb[_0x748c('0x3f')]['hasOwnProperty']('nolimit')){_0x57c2ac[_0x748c('0x25')]=qs[_0x748c('0x25')](_0x49b2fb[_0x748c('0x3f')]['limit']);_0x57c2ac[_0x748c('0x27')]=qs[_0x748c('0x27')](_0x49b2fb[_0x748c('0x3f')]['offset']);}_0x57c2ac['order']=qs[_0x748c('0x9d')](_0x49b2fb[_0x748c('0x3f')][_0x748c('0x9d')]);_0x57c2ac[_0x748c('0x9e')]=qs[_0x748c('0x41')](_['pick'](_0x49b2fb['query'],_0x1f2379[_0x748c('0x41')]));_0x57c2ac[_0x748c('0x9e')][_0x748c('0x9f')]=_0xc14dd6['id'];if(_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa0')]){_0x57c2ac[_0x748c('0x9e')]=_[_0x748c('0x47')](_0x57c2ac[_0x748c('0x9e')],{'$or':_[_0x748c('0x33')](_0x57c2ac[_0x748c('0x43')],function(_0x215f11){var _0x317f4a={};_0x317f4a[_0x215f11]={'$like':'%'+_0x49b2fb['query'][_0x748c('0xa0')]+'%'};return _0x317f4a;})});}if(_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa1')]){var _0x379f14=_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa1')][_0x748c('0xa2')](',');var _0x29a108={};_0x29a108[_0x379f14[0x0]]={'$gte':moment(_0x379f14[0x1])[_0x748c('0x7b')](_0x748c('0xa3'))};_0x57c2ac[_0x748c('0x9e')]=_['merge'](_0x57c2ac[_0x748c('0x9e')],_0x29a108);}_0x57c2ac=_[_0x748c('0x47')]({},_0x57c2ac,_0x49b2fb[_0x748c('0x48')]);return db['ChatMessage'][_0x748c('0x26')]({'where':_0x57c2ac[_0x748c('0x9e')]})['then'](function(_0x465230){_0x11a3da[_0x748c('0x26')]=_0x465230;if(_0x49b2fb['query'][_0x748c('0x45')]){_0x57c2ac[_0x748c('0x46')]=[{'all':!![]}];}return db['ChatMessage'][_0x748c('0xa4')](_0x57c2ac);})[_0x748c('0x16')](function(_0xa8d724){_0x11a3da['rows']=_0xa8d724;return _0x11a3da;});}})[_0x748c('0x16')](respondWithFilteredResult(_0x2b652f,_0x57c2ac))[_0x748c('0x1f')](handleError(_0x2b652f,null));};exports['getMyMessages']=function(_0x60b5c1,_0x2e3e66){var _0x395bda={'where':{}},_0x550d43={},_0xa2d4ca={'count':0x0,'rows':[]};return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x60b5c1[_0x748c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2e3e66,null))[_0x748c('0x16')](function(_0x1d2180){if(_0x1d2180){_0x550d43[_0x748c('0x3d')]=_[_0x748c('0x40')](db[_0x748c('0x5e')][_0x748c('0x3e')]);_0x550d43[_0x748c('0x3f')]=_['keys'](_0x60b5c1[_0x748c('0x3f')]);_0x550d43[_0x748c('0x41')]=_['intersection'](_0x550d43[_0x748c('0x3d')],_0x550d43[_0x748c('0x3f')]);_0x395bda['attributes']=_[_0x748c('0x9c')](_0x550d43[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x42')]));_0x395bda[_0x748c('0x43')]=_0x395bda['attributes'][_0x748c('0x44')]?_0x395bda[_0x748c('0x43')]:_0x550d43[_0x748c('0x3d')];if(!_0x60b5c1[_0x748c('0x3f')][_0x748c('0xa5')](_0x748c('0xa6'))){_0x395bda['limit']=qs[_0x748c('0x25')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x25')]);_0x395bda[_0x748c('0x27')]=qs[_0x748c('0x27')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x27')]);}_0x395bda[_0x748c('0xa7')]=qs[_0x748c('0x9d')](_0x60b5c1[_0x748c('0x3f')]['sort']);_0x395bda[_0x748c('0x9e')]=qs[_0x748c('0x41')](_[_0x748c('0xa8')](_0x60b5c1[_0x748c('0x3f')],_0x550d43['filters']));_0x395bda[_0x748c('0x9e')][_0x748c('0x9f')]=_0x1d2180['id'];if(_0x60b5c1[_0x748c('0x3f')][_0x748c('0xa0')]){_0x395bda[_0x748c('0x9e')]=_['merge'](_0x395bda[_0x748c('0x9e')],{'$or':_[_0x748c('0x33')](_0x395bda[_0x748c('0x43')],function(_0x2c1cc6){var _0x492fe4={};_0x492fe4[_0x2c1cc6]={'$like':'%'+_0x60b5c1['query'][_0x748c('0xa0')]+'%'};return _0x492fe4;})});}_0x395bda[_0x748c('0x9e')][_0x748c('0xa9')]=![];if(_0x60b5c1[_0x748c('0x3f')]['id']){_0x395bda[_0x748c('0x9e')]['id']={'$gt':_0x60b5c1[_0x748c('0x3f')]['id']};}_0x395bda=_[_0x748c('0x47')]({},_0x395bda,_0x60b5c1[_0x748c('0x48')]);return db['ChatMessage'][_0x748c('0x26')]({'where':_0x395bda[_0x748c('0x9e')]})[_0x748c('0x16')](function(_0x2e45a4){_0xa2d4ca[_0x748c('0x26')]=_0x2e45a4;_0x395bda[_0x748c('0x46')]=[];if(_0x60b5c1['query'][_0x748c('0xaa')]){_0x395bda['include']['push']({'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f'),'attributes':['id',_0x748c('0x52'),_0x748c('0x89')]});}if(_0x60b5c1[_0x748c('0x3f')][_0x748c('0x45')]){_0x395bda['include']=[{'all':!![]}];}return db['ChatMessage'][_0x748c('0xa4')](_0x395bda);})[_0x748c('0x16')](function(_0x533f34){_0xa2d4ca['rows']=_0x533f34;return _0xa2d4ca;});}})['then'](respondWithFilteredResult(_0x2e3e66,_0x395bda))[_0x748c('0x1f')](handleError(_0x2e3e66,null));};exports['addTags']=function(_0x106fb7,_0x56dd0b){return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x106fb7[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x56dd0b,null))['then'](function(_0x3c814d){if(_0x3c814d){return _0x3c814d[_0x748c('0xab')](_0x106fb7[_0x748c('0x30')][_0x748c('0x9a')],_['omit'](_0x106fb7['body'],[_0x748c('0x9a'),'id'])||{})['spread'](function(){return db[_0x748c('0xac')][_0x748c('0xa4')]({'attributes':['id',_0x748c('0x2d'),_0x748c('0xad')],'where':{'id':_0x106fb7[_0x748c('0x30')][_0x748c('0x9a')]}});})[_0x748c('0x16')](function(_0x1de4ad){socket[_0x748c('0xae')]('chatInteractionTags:save',{'id':Number(_0x106fb7[_0x748c('0x3c')]['id']),'tags':_0x1de4ad||[]});return{'id':Number(_0x106fb7['params']['id']),'tags':_0x1de4ad||[]};});}})['then'](respondWithResult(_0x56dd0b,null))['catch'](handleError(_0x56dd0b,null));};exports[_0x748c('0xaf')]=function(_0x19b2e1,_0x389179){return db['ChatInteraction'][_0x748c('0x49')]({'where':{'id':_0x19b2e1['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x389179,null))['then'](function(_0x483c7e){if(_0x483c7e){return _0x483c7e[_0x748c('0xaf')](_0x19b2e1[_0x748c('0x3f')][_0x748c('0x9a')]);}})['then'](respondWithStatusCode(_0x389179,null))[_0x748c('0x1f')](handleError(_0x389179,null));};exports[_0x748c('0x77')]=function(_0x164b70,_0x37e99e){var _0x32062e=moment()[_0x748c('0xb0')]()[_0x748c('0xb1')]();var _0x163319=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0xb2'),'files','tmp');var _0x11d584=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0xb2'),_0x748c('0xb3'),'attachments');var _0x502499=path['join'](_0x163319,_0x32062e);var _0x2616f9=util['format'](_0x748c('0xb4'),_0x164b70['params']['id'],_0x32062e);var _0x38dd53=path[_0x748c('0x74')](_0x163319,_0x2616f9);var _0x16c8e8=[];_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f'),'attributes':['id',_0x748c('0x52')],'raw':!![]});_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x62')],'as':_0x748c('0x63'),'attributes':['id',_0x748c('0xb6'),_0x748c('0xb7')],'raw':!![]});if(_0x164b70[_0x748c('0x3f')]['attachments']){_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x71')],'as':'Attachment','raw':!![]});}var _0x30685c=[{'model':db[_0x748c('0x5e')],'as':_0x748c('0x81'),'attributes':['id',_0x748c('0x30'),_0x748c('0x8b'),'direction',_0x748c('0xa9'),_0x748c('0xb8')],'include':_0x16c8e8}];_0x30685c[_0x748c('0xb5')]({'model':db['ChatWebsite'],'as':_0x748c('0xb9'),'attributes':['id','name']});_0x30685c[_0x748c('0xb5')]({'model':db[_0x748c('0x7f')],'as':_0x748c('0xba'),'attributes':['id',_0x748c('0x52')]});return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x164b70['params']['id']},'include':_0x30685c})[_0x748c('0x16')](handleEntityNotFound(_0x37e99e,null))[_0x748c('0x16')](function(_0x460186){if(_0x460186){var _0x25215a=_0x460186[_0x748c('0xbb')]({'plain':!![]});fs[_0x748c('0xbc')](_0x502499);var _0x33c53a={'channel':'Chat','account':_0x25215a[_0x748c('0xb9')]['name'],'agent':_0x25215a['Owner']?_0x25215a[_0x748c('0xba')][_0x748c('0x52')]:'N.A.','createdAt':moment(_0x25215a['createdAt'])[_0x748c('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x25215a[_0x748c('0x68')]?moment(_0x25215a[_0x748c('0xbd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x748c('0xb1')]():'','disposition':_0x25215a[_0x748c('0x69')],'chatInfo':{'browser':_0x25215a['browserName'],'os':_0x25215a[_0x748c('0xbe')],'referer':_0x25215a[_0x748c('0xbf')],'customerIp':_0x25215a[_0x748c('0xc0')],'customerPort':_0x25215a['customerPort']?_0x25215a[_0x748c('0xc1')]:'N.A.'},'messages':_(_0x25215a[_0x748c('0x81')])[_0x748c('0xc2')]()[_0x748c('0xa0')]({'secret':![]})['map'](function(_0x2fb608){if(_0x2fb608[_0x748c('0x71')]){var _0xc12fae=path['join'](_0x11d584,_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')]);if(fs[_0x748c('0xc3')](_0xc12fae)){fs[_0x748c('0xc4')](_0xc12fae)[_0x748c('0xc5')](fs['createWriteStream'](path[_0x748c('0x74')](_0x502499,_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')])));}}return{'date':moment(_0x2fb608[_0x748c('0x8b')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2fb608['direction']===_0x748c('0xc6')?_0x2fb608[_0x748c('0x7f')]?_0x2fb608[_0x748c('0x7f')][_0x748c('0x52')]:_0x748c('0x87'):_0x2fb608[_0x748c('0x63')][_0x748c('0xb6')]+(_0x2fb608['Contact']['lastName']?'\x20'+_0x2fb608[_0x748c('0x63')][_0x748c('0xb7')]:''),'body':_0x2fb608[_0x748c('0x71')]?_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')]:_0x2fb608[_0x748c('0x30')],'direction':_0x2fb608[_0x748c('0x8d')]==='out'?'A':'C','secret':_0x2fb608[_0x748c('0xa9')],'read':_0x2fb608['read'],'attachment':_0x2fb608[_0x748c('0x71')]};})['value']()};return ejs[_0x748c('0xc7')](path[_0x748c('0x74')](config['root'],_0x748c('0xb2'),_0x748c('0xc8'),_0x748c('0xc9')),{'interaction':_0x33c53a})['then'](function(_0x8225b9){var _0xcd7506=path[_0x748c('0x74')](_0x502499,_0x748c('0xca')+_0x25215a['id']+'-'+_0x32062e+_0x748c('0xcb'));var _0x5a5a90={'path':_0xcd7506,'channel':_0x748c('0xcc'),'interactionId':_0x25215a['id']};return pdf['createPdfFromHTML'](_0x8225b9,_0x5a5a90);})[_0x748c('0x16')](function(){return new Promise(function(_0xafd4d2,_0x49d053){zipdir(_0x502499,{'saveTo':_0x38dd53},function(_0x3ddb34,_0x5eb960){if(_0x3ddb34)return _0x49d053(_0x3ddb34);return _0xafd4d2(_0x5eb960);});})[_0x748c('0x16')](function(){return new BPromise(function(_0x5bf18f,_0x4bd855){rimraf(_0x502499,function(_0x5cbf2f){if(_0x5cbf2f)_0x4bd855(_0x5cbf2f);return _0x5bf18f();});});})[_0x748c('0x16')](function(){return _0x37e99e['download'](_0x38dd53,_0x2616f9,function(_0xbcbf66){if(_0xbcbf66){logger[_0x748c('0x1b')](_0x748c('0xcd'),_0xbcbf66);}else{fs[_0x748c('0xce')](_0x38dd53);}});});});}else{return _0x37e99e[_0x748c('0x20')](0xc8);}})['catch'](handleError(_0x37e99e,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index df6d7b1..fe819bd 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 _0x3163=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue'];(function(_0x5583f,_0x36b976){var _0x196941=function(_0x5472fb){while(--_0x5472fb){_0x5583f['push'](_0x5583f['shift']());}};_0x196941(++_0x36b976);}(_0x3163,0x1d6));var _0x3316=function(_0x240b53,_0x3c3c8d){_0x240b53=_0x240b53-0x0;var _0x1af3db=_0x3163[_0x240b53];return _0x1af3db;};'use strict';var EventEmitter=require(_0x3316('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3316('0x1')];var ChatMessage=require(_0x3316('0x2'))['db'][_0x3316('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3316('0x4'),'afterUpdate':_0x3316('0x5'),'afterDestroy':_0x3316('0x6')};function emitEvent(_0x440ca7){return function(_0x372ef8,_0x1bdbfc,_0x1307ca){_0x372ef8[_0x3316('0x7')]({'attributes':['id'],'raw':!![]})[_0x3316('0x8')](function(_0x41bbd0){_0x372ef8[_0x3316('0x9')](_0x3316('0xa'),_0x41bbd0[_0x3316('0xb')](function(_0x38bf76){return{'id':_0x38bf76['id']};}));return ChatMessage[_0x3316('0xc')]({'where':{'ChatInteractionId':_0x372ef8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3316('0x8')](function(_0x400cda){_0x372ef8[_0x3316('0x9')](_0x3316('0xd'),_0x400cda[_0x3316('0xe')]);ChatInteractionEvents['emit'](_0x440ca7+':'+_0x372ef8['id'],_0x372ef8);ChatInteractionEvents[_0x3316('0xf')](_0x440ca7,_0x372ef8);_0x1307ca(null);})[_0x3316('0x10')](_0x1307ca(null));};}for(var e in events){if(events[_0x3316('0x11')](e)){var event=events[e];ChatInteraction[_0x3316('0x12')](e,emitEvent(event));}}module[_0x3316('0x13')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x86f9=['setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then','Users','map','findAll'];(function(_0xd7e544,_0x4811bf){var _0x3dbcf7=function(_0x1641e0){while(--_0x1641e0){_0xd7e544['push'](_0xd7e544['shift']());}};_0x3dbcf7(++_0x4811bf);}(_0x86f9,0xcd));var _0x986f=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x86f9[_0x2a558d];return _0xa7bc9c;};'use strict';var EventEmitter=require(_0x986f('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x986f('0x1'))['db'][_0x986f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x986f('0x3')](0x0);var events={'afterCreate':_0x986f('0x4'),'afterUpdate':_0x986f('0x5'),'afterDestroy':_0x986f('0x6')};function emitEvent(_0x191e0b){return function(_0x3fc4a5,_0x4f69c0,_0x2f843c){_0x3fc4a5['getUsers']({'attributes':['id'],'raw':!![]})[_0x986f('0x7')](function(_0x2a49a8){_0x3fc4a5['setDataValue'](_0x986f('0x8'),_0x2a49a8[_0x986f('0x9')](function(_0x14159d){return{'id':_0x14159d['id']};}));return ChatMessage[_0x986f('0xa')]({'where':{'ChatInteractionId':_0x3fc4a5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x986f('0x7')](function(_0x1edd72){_0x3fc4a5[_0x986f('0xb')]('unreadMessages',_0x1edd72[_0x986f('0xc')]);ChatInteractionEvents[_0x986f('0xd')](_0x191e0b+':'+_0x3fc4a5['id'],_0x3fc4a5);ChatInteractionEvents[_0x986f('0xd')](_0x191e0b,_0x3fc4a5);_0x2f843c(null);})[_0x986f('0xe')](_0x2f843c(null));};}for(var e in events){if(events[_0x986f('0xf')](e)){var event=events[e];ChatInteraction[_0x986f('0x10')](e,emitEvent(event));}}module[_0x986f('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e56ff9b..3dc5f7c 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 _0x0914=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2a3367,_0x25913a){var _0x230264=function(_0xffa54a){while(--_0xffa54a){_0x2a3367['push'](_0x2a3367['shift']());}};_0x230264(++_0x25913a);}(_0x0914,0xfc));var _0x4091=function(_0x50ce73,_0x3dcbf2){_0x50ce73=_0x50ce73-0x0;var _0x25e3a4=_0x0914[_0x50ce73];return _0x25e3a4;};'use strict';var _=require(_0x4091('0x0'));var util=require(_0x4091('0x1'));var logger=require(_0x4091('0x2'))(_0x4091('0x3'));var moment=require('moment');var BPromise=require(_0x4091('0x4'));var rp=require(_0x4091('0x5'));var fs=require('fs');var path=require(_0x4091('0x6'));var rimraf=require(_0x4091('0x7'));var config=require(_0x4091('0x8'));var attributes=require(_0x4091('0x9'));module['exports']=function(_0x559611,_0x5f3e75){return _0x559611[_0x4091('0xa')](_0x4091('0xb'),attributes,{'tableName':_0x4091('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29f6ef,_0x44a05a,_0x535207){if(_0x29f6ef[_0x4091('0xd')]('closed')){_0x29f6ef['closedAt']=moment()[_0x4091('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x535207(null,_0x29f6ef);}},'charset':'utf8mb4','collate':_0x4091('0xf')});};
\ No newline at end of file
+var _0x44c4=['format','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closedAt'];(function(_0x29e54f,_0x33535a){var _0x4c619f=function(_0xc98342){while(--_0xc98342){_0x29e54f['push'](_0x29e54f['shift']());}};_0x4c619f(++_0x33535a);}(_0x44c4,0x11f));var _0x444c=function(_0x3385c1,_0x16921b){_0x3385c1=_0x3385c1-0x0;var _0x3a19fd=_0x44c4[_0x3385c1];return _0x3a19fd;};'use strict';var _=require('lodash');var util=require(_0x444c('0x0'));var logger=require(_0x444c('0x1'))(_0x444c('0x2'));var moment=require(_0x444c('0x3'));var BPromise=require(_0x444c('0x4'));var rp=require(_0x444c('0x5'));var fs=require('fs');var path=require(_0x444c('0x6'));var rimraf=require(_0x444c('0x7'));var config=require('../../config/environment');var attributes=require(_0x444c('0x8'));module[_0x444c('0x9')]=function(_0x5f5603,_0x3a3454){return _0x5f5603['define'](_0x444c('0xa'),attributes,{'tableName':_0x444c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x193487,_0x4a9c30,_0x583b16){if(_0x193487['changed']('closed')){_0x193487[_0x444c('0xc')]=moment()[_0x444c('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x583b16(null,_0x193487);}},'charset':_0x444c('0xe'),'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 e9ce50a..f84e024 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 _0x4763=['raw','where','attributes','limit','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x18eb38,_0x479d4a){var _0x4e8faf=function(_0x926c3f){while(--_0x926c3f){_0x18eb38['push'](_0x18eb38['shift']());}};_0x4e8faf(++_0x479d4a);}(_0x4763,0xb2));var _0x3476=function(_0x37a8e2,_0x4d5aae){_0x37a8e2=_0x37a8e2-0x0;var _0xcf2950=_0x4763[_0x37a8e2];return _0xcf2950;};'use strict';var _=require('lodash');var util=require(_0x3476('0x0'));var moment=require(_0x3476('0x1'));var BPromise=require('bluebird');var rs=require(_0x3476('0x2'));var fs=require('fs');var Redis=require(_0x3476('0x3'));var db=require(_0x3476('0x4'))['db'];var utils=require(_0x3476('0x5'));var logger=require('../../config/logger')(_0x3476('0x6'));var config=require(_0x3476('0x7'));var jayson=require(_0x3476('0x8'));var client=jayson[_0x3476('0x9')][_0x3476('0xa')]({'port':0x232a});config[_0x3476('0xb')]=_[_0x3476('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3476('0xd'))(new Redis(config[_0x3476('0xb')]));require('./chatInteraction.socket')[_0x3476('0xe')](socket);function respondWithRpcPromise(_0x5517f2,_0x176cc3,_0x45b82f){return new BPromise(function(_0x1f5d06,_0x47cce5){return client[_0x3476('0xf')](_0x5517f2,_0x45b82f)[_0x3476('0x10')](function(_0x5415f7){logger[_0x3476('0x11')](_0x3476('0x12'),_0x176cc3,_0x3476('0x13'));logger[_0x3476('0x14')](_0x3476('0x15'),_0x176cc3,'request\x20sent',JSON[_0x3476('0x16')](_0x5415f7));if(_0x5415f7[_0x3476('0x17')]){if(_0x5415f7[_0x3476('0x17')][_0x3476('0x18')]===0x1f4){logger[_0x3476('0x17')](_0x3476('0x12'),_0x176cc3,_0x5415f7[_0x3476('0x17')][_0x3476('0x19')]);return _0x47cce5(_0x5415f7[_0x3476('0x17')][_0x3476('0x19')]);}logger[_0x3476('0x17')](_0x3476('0x12'),_0x176cc3,_0x5415f7[_0x3476('0x17')]['message']);return _0x1f5d06(_0x5415f7[_0x3476('0x17')]['message']);}else{logger['info'](_0x3476('0x12'),_0x176cc3,'request\x20sent');_0x1f5d06(_0x5415f7['result'][_0x3476('0x19')]);}})[_0x3476('0x1a')](function(_0x2a740a){logger['error'](_0x3476('0x12'),_0x176cc3,_0x2a740a);_0x47cce5(_0x2a740a);});});}exports[_0x3476('0x1b')]=function(_0x3d16d0){var _0x4dc412=this;return new Promise(function(_0x3f2d5e,_0x198ae8){return db[_0x3476('0x1c')][_0x3476('0x1d')](_0x3d16d0[_0x3476('0x1e')],{'raw':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0['options'][_0x3476('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d16d0['options']?_0x3d16d0['options'][_0x3476('0x21')]||null:null,'attributes':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0['options'][_0x3476('0x22')]||null:null,'limit':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0[_0x3476('0x1f')][_0x3476('0x23')]||null:null})[_0x3476('0x10')](function(_0x5455af){logger[_0x3476('0x11')](_0x3476('0x1b'),_0x3d16d0);logger[_0x3476('0x14')](_0x3476('0x1b'),_0x3d16d0,JSON[_0x3476('0x16')](_0x5455af));_0x3f2d5e(_0x5455af);})[_0x3476('0x1a')](function(_0x36fd1c){logger[_0x3476('0x17')]('UpdateChatInteraction',_0x36fd1c[_0x3476('0x19')],_0x3d16d0);_0x198ae8(_0x4dc412['error'](0x1f4,_0x36fd1c['message']));});});};exports[_0x3476('0x24')]=function(_0x41be69){return new Promise(function(_0x100d3c,_0x5b2a5b){return db[_0x3476('0x1c')][_0x3476('0x25')]({'where':_0x41be69[_0x3476('0x1f')]?_0x41be69['options']['where']||null:null})[_0x3476('0x10')](function(_0x12dbf3){if(_0x12dbf3){return _0x12dbf3['addTags'](_0x41be69[_0x3476('0x1e')][_0x3476('0x26')],_[_0x3476('0x27')](_0x41be69[_0x3476('0x1e')],['ids','id'])||{});}})[_0x3476('0x28')](function(_0x4ec8d4){logger[_0x3476('0x11')](_0x3476('0x29'),_0x41be69);logger['debug'](_0x3476('0x29'),_0x41be69,JSON[_0x3476('0x16')](_0x4ec8d4));_0x100d3c(_0x4ec8d4);})['catch'](function(_0x4cf892){logger[_0x3476('0x17')]('AddTags',_0x4cf892[_0x3476('0x19')],_0x41be69);_0x5b2a5b(_this[_0x3476('0x17')](0x1f4,_0x4cf892[_0x3476('0x19')]));});});};
\ No newline at end of file
+var _0x4633=['ioredis','../../config/logger','../../config/environment','http','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','ChatInteraction','update','body','options','raw','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','where','addTags','ids','spread','AddTags','lodash','util','bluebird'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4633,0x66));var _0x3463=function(_0x50b475,_0x96fff7){_0x50b475=_0x50b475-0x0;var _0x418b3d=_0x4633[_0x50b475];return _0x418b3d;};'use strict';var _=require(_0x3463('0x0'));var util=require(_0x3463('0x1'));var moment=require('moment');var BPromise=require(_0x3463('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3463('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3463('0x4'))('rpc');var config=require(_0x3463('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3463('0x6')]({'port':0x232a});config['redis']=_[_0x3463('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3463('0x8'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x3463('0x9')](socket);function respondWithRpcPromise(_0x3db661,_0x17886d,_0x20e2b5){return new BPromise(function(_0x4657a3,_0x59fe32){return client['request'](_0x3db661,_0x20e2b5)[_0x3463('0xa')](function(_0x44d77d){logger[_0x3463('0xb')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'));logger[_0x3463('0xd')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'),JSON[_0x3463('0xe')](_0x44d77d));if(_0x44d77d[_0x3463('0xf')]){if(_0x44d77d[_0x3463('0xf')][_0x3463('0x10')]===0x1f4){logger[_0x3463('0xf')](_0x3463('0x11'),_0x17886d,_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);return _0x59fe32(_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);}logger[_0x3463('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);return _0x4657a3(_0x44d77d[_0x3463('0xf')]['message']);}else{logger[_0x3463('0xb')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'));_0x4657a3(_0x44d77d[_0x3463('0x13')][_0x3463('0x12')]);}})['catch'](function(_0x5448c5){logger[_0x3463('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x5448c5);_0x59fe32(_0x5448c5);});});}exports['UpdateChatInteraction']=function(_0x3b0722){var _0x23ba19=this;return new Promise(function(_0x1ca25b,_0x2925fd){return db[_0x3463('0x14')][_0x3463('0x15')](_0x3b0722[_0x3463('0x16')],{'raw':_0x3b0722[_0x3463('0x17')]?_0x3b0722['options'][_0x3463('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b0722[_0x3463('0x17')]?_0x3b0722[_0x3463('0x17')]['where']||null:null,'attributes':_0x3b0722[_0x3463('0x17')]?_0x3b0722[_0x3463('0x17')][_0x3463('0x19')]||null:null,'limit':_0x3b0722[_0x3463('0x17')]?_0x3b0722['options'][_0x3463('0x1a')]||null:null})['then'](function(_0x20d433){logger['info'](_0x3463('0x1b'),_0x3b0722);logger[_0x3463('0xd')](_0x3463('0x1b'),_0x3b0722,JSON[_0x3463('0xe')](_0x20d433));_0x1ca25b(_0x20d433);})[_0x3463('0x1c')](function(_0x5cdb52){logger[_0x3463('0xf')](_0x3463('0x1b'),_0x5cdb52[_0x3463('0x12')],_0x3b0722);_0x2925fd(_0x23ba19[_0x3463('0xf')](0x1f4,_0x5cdb52['message']));});});};exports[_0x3463('0x1d')]=function(_0x4f8fea){return new Promise(function(_0x254f1b,_0x48a994){return db[_0x3463('0x14')]['find']({'where':_0x4f8fea['options']?_0x4f8fea[_0x3463('0x17')][_0x3463('0x1e')]||null:null})['then'](function(_0x4eaf8f){if(_0x4eaf8f){return _0x4eaf8f[_0x3463('0x1f')](_0x4f8fea['body'][_0x3463('0x20')],_['omit'](_0x4f8fea[_0x3463('0x16')],[_0x3463('0x20'),'id'])||{});}})[_0x3463('0x21')](function(_0x5599e8){logger[_0x3463('0xb')](_0x3463('0x22'),_0x4f8fea);logger['debug']('AddTags',_0x4f8fea,JSON['stringify'](_0x5599e8));_0x254f1b(_0x5599e8);})[_0x3463('0x1c')](function(_0x194967){logger[_0x3463('0xf')]('AddTags',_0x194967[_0x3463('0x12')],_0x4f8fea);_0x48a994(_this[_0x3463('0xf')](0x1f4,_0x194967[_0x3463('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0fb730f..a817635 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 _0x16c2=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','length'];(function(_0x4b2662,_0x1fc9fa){var _0x47dd9d=function(_0x40d3fe){while(--_0x40d3fe){_0x4b2662['push'](_0x4b2662['shift']());}};_0x47dd9d(++_0x1fc9fa);}(_0x16c2,0x19e));var _0x216c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16c2[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x216c('0x0'));var events=[_0x216c('0x1'),_0x216c('0x2'),_0x216c('0x3')];function createListener(_0x43149f,_0x5a49c7){return function(_0x4069d5){_0x5a49c7['emit'](_0x43149f,_0x4069d5);};}function removeListener(_0x138378,_0x51ea03){return function(){ChatInteractionEvents[_0x216c('0x4')](_0x138378,_0x51ea03);};}exports['register']=function(_0x8833ab){for(var _0x2c9b60=0x0,_0xa734e5=events[_0x216c('0x5')];_0x2c9b60<_0xa734e5;_0x2c9b60++){var _0x3e3b5a=events[_0x2c9b60];var _0x239f12=createListener(_0x216c('0x6')+_0x3e3b5a,_0x8833ab);ChatInteractionEvents['on'](_0x3e3b5a,_0x239f12);}};
\ No newline at end of file
+var _0x133a=['register','length','chatInteraction:','save','remove','update','emit','removeListener'];(function(_0x2c54dd,_0x22d4a2){var _0x3dccba=function(_0x7ba02c){while(--_0x7ba02c){_0x2c54dd['push'](_0x2c54dd['shift']());}};_0x3dccba(++_0x22d4a2);}(_0x133a,0xcb));var _0xa133=function(_0x2d90cc,_0x45bb4e){_0x2d90cc=_0x2d90cc-0x0;var _0x227a99=_0x133a[_0x2d90cc];return _0x227a99;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xa133('0x0'),_0xa133('0x1'),_0xa133('0x2')];function createListener(_0x31ee7a,_0x5f0eea){return function(_0x30e2cb){_0x5f0eea[_0xa133('0x3')](_0x31ee7a,_0x30e2cb);};}function removeListener(_0x2841ba,_0x52f874){return function(){ChatInteractionEvents[_0xa133('0x4')](_0x2841ba,_0x52f874);};}exports[_0xa133('0x5')]=function(_0x17fe9b){for(var _0x1e16a7=0x0,_0x56fbbf=events[_0xa133('0x6')];_0x1e16a7<_0x56fbbf;_0x1e16a7++){var _0x1fdfa5=events[_0x1e16a7];var _0x15ba48=createListener(_0xa133('0x7')+_0x1fdfa5,_0x17fe9b);ChatInteractionEvents['on'](_0x1fdfa5,_0x15ba48);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 636477e..76ea473 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 _0xbda1=['%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chat','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','index','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','format'];(function(_0x59f860,_0x24716c){var _0x2d558a=function(_0x474b8a){while(--_0x474b8a){_0x59f860['push'](_0x59f860['shift']());}};_0x2d558a(++_0x24716c);}(_0xbda1,0x1b1));var _0x1bda=function(_0x636991,_0x17d479){_0x636991=_0x636991-0x0;var _0x5a2224=_0xbda1[_0x636991];return _0x5a2224;};'use strict';var multer=require(_0x1bda('0x0'));var util=require(_0x1bda('0x1'));var path=require(_0x1bda('0x2'));var timeout=require(_0x1bda('0x3'));var express=require('express');var router=express[_0x1bda('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1bda('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1bda('0x6')]);router[_0x1bda('0x7')](_0x1bda('0x8'),auth[_0x1bda('0x9')](),controller[_0x1bda('0xa')]);router[_0x1bda('0x7')](_0x1bda('0xb'),auth[_0x1bda('0xc')](),controller['show']);router[_0x1bda('0x7')](_0x1bda('0xd'),auth[_0x1bda('0xc')](),controller['attachmentDownload']);router['get'](_0x1bda('0xe'),auth['isAuthenticated'](),controller[_0x1bda('0xf')]);router[_0x1bda('0x7')](_0x1bda('0x10'),auth[_0x1bda('0xc')](),controller[_0x1bda('0x11')]);router[_0x1bda('0x7')](_0x1bda('0x12'),auth['isAuthenticated'](),controller[_0x1bda('0x13')]);router[_0x1bda('0x14')]('/',auth['isAuthenticated'](),controller[_0x1bda('0x15')]);router[_0x1bda('0x14')](_0x1bda('0x16'),auth[_0x1bda('0x9')](),controller[_0x1bda('0x17')]);var upload=multer({'storage':multer[_0x1bda('0x18')]({'destination':function(_0x94399d,_0x564148,_0x1e89f3){_0x1e89f3(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x2cf6d5,_0x1901dc,_0x42ade7){_0x42ade7(null,util[_0x1bda('0x19')](_0x1bda('0x1a'),Date[_0x1bda('0x1b')](),_0x1901dc[_0x1bda('0x1c')][_0x1bda('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1bda('0x14')]('/:id/attachment_upload',upload[_0x1bda('0x1e')](_0x1bda('0x1f')),controller[_0x1bda('0x20')]);router[_0x1bda('0x14')]('/:id/messages',auth[_0x1bda('0xc')](),controller[_0x1bda('0x21')]);router[_0x1bda('0x14')](_0x1bda('0x22'),auth['isAuthenticated'](),interaction[_0x1bda('0x23')]('chat','chatinteraction:addtags'),controller[_0x1bda('0x24')]);router[_0x1bda('0x25')](_0x1bda('0xb'),auth[_0x1bda('0x9')](),interaction[_0x1bda('0x23')]('chat',_0x1bda('0x26')),controller[_0x1bda('0x27')]);router[_0x1bda('0x25')](_0x1bda('0x28'),controller[_0x1bda('0x29')]);router[_0x1bda('0x25')](_0x1bda('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x1bda('0x2b')]);router['put']('/:id/close',controller[_0x1bda('0x2c')]);router[_0x1bda('0x2d')](_0x1bda('0xb'),auth[_0x1bda('0x9')](),interaction[_0x1bda('0x23')](_0x1bda('0x2e'),_0x1bda('0x2f')),controller[_0x1bda('0x30')]);router[_0x1bda('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x1bda('0x31')]);module[_0x1bda('0x32')]=router;
\ No newline at end of file
+var _0xe459=['/:id/vidaoo','diskStorage','join','root','format','originalname','replace','/:id/attachment_upload','file','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','post','create'];(function(_0x1b0afd,_0x367934){var _0x4ba0d2=function(_0x4755b8){while(--_0x4755b8){_0x1b0afd['push'](_0x1b0afd['shift']());}};_0x4ba0d2(++_0x367934);}(_0xe459,0x7a));var _0x9e45=function(_0x59a68a,_0xc0c564){_0x59a68a=_0x59a68a-0x0;var _0x1e114d=_0xe459[_0x59a68a];return _0x1e114d;};'use strict';var multer=require(_0x9e45('0x0'));var util=require('util');var path=require(_0x9e45('0x1'));var timeout=require(_0x9e45('0x2'));var express=require(_0x9e45('0x3'));var router=express['Router']();var fs_extra=require(_0x9e45('0x4'));var auth=require(_0x9e45('0x5'));var interaction=require(_0x9e45('0x6'));var config=require('../../config/environment');var controller=require(_0x9e45('0x7'));router[_0x9e45('0x8')]('/',auth[_0x9e45('0x9')](),controller[_0x9e45('0xa')]);router[_0x9e45('0x8')](_0x9e45('0xb'),auth[_0x9e45('0x9')](),controller[_0x9e45('0xc')]);router['get'](_0x9e45('0xd'),auth[_0x9e45('0xe')](),controller[_0x9e45('0xf')]);router[_0x9e45('0x8')]('/:id/attachment_download',auth[_0x9e45('0xe')](),controller[_0x9e45('0x10')]);router[_0x9e45('0x8')]('/:id/messages',auth[_0x9e45('0x9')](),controller[_0x9e45('0x11')]);router[_0x9e45('0x8')](_0x9e45('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x9e45('0x13')]);router['get']('/:id/download',auth[_0x9e45('0x9')](),controller['download']);router[_0x9e45('0x14')]('/',auth['isAuthenticated'](),controller[_0x9e45('0x15')]);router[_0x9e45('0x14')](_0x9e45('0x16'),auth[_0x9e45('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x9e45('0x17')]({'destination':function(_0x500f6e,_0x41b56d,_0x538f2f){_0x538f2f(null,path[_0x9e45('0x18')](config[_0x9e45('0x19')],'server/files/attachments/'));},'filename':function(_0x3846bd,_0x13806e,_0x1e3690){_0x1e3690(null,util[_0x9e45('0x1a')]('%s-%s',Date['now'](),_0x13806e[_0x9e45('0x1b')][_0x9e45('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9e45('0x14')](_0x9e45('0x1d'),upload['single'](_0x9e45('0x1e')),controller['attachmentUpload']);router[_0x9e45('0x14')]('/:id/messages',auth[_0x9e45('0xe')](),controller[_0x9e45('0x1f')]);router[_0x9e45('0x14')](_0x9e45('0x20'),auth['isAuthenticated'](),interaction[_0x9e45('0x21')](_0x9e45('0x22'),'chatinteraction:addtags'),controller[_0x9e45('0x23')]);router[_0x9e45('0x24')](_0x9e45('0xd'),auth['isAuthenticated'](),interaction[_0x9e45('0x21')](_0x9e45('0x22'),_0x9e45('0x25')),controller[_0x9e45('0x26')]);router['put'](_0x9e45('0x27'),controller['customUpdate']);router[_0x9e45('0x24')](_0x9e45('0x28'),auth[_0x9e45('0xe')](),controller[_0x9e45('0x29')]);router[_0x9e45('0x24')](_0x9e45('0x2a'),controller[_0x9e45('0x2b')]);router[_0x9e45('0x2c')](_0x9e45('0xd'),auth[_0x9e45('0x9')](),interaction['tracked']('chat',_0x9e45('0x2d')),controller[_0x9e45('0x2e')]);router[_0x9e45('0x2c')](_0x9e45('0x20'),auth[_0x9e45('0x9')](),controller['removeTags']);module[_0x9e45('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 4c9e398..0321b3f 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 _0x3574=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3e1da3,_0x432031){var _0xe03e0=function(_0x5b6de7){while(--_0x5b6de7){_0x3e1da3['push'](_0x3e1da3['shift']());}};_0xe03e0(++_0x432031);}(_0x3574,0x11b));var _0x4357=function(_0x3e4531,_0x4d7cee){_0x3e4531=_0x3e4531-0x0;var _0x5f2b05=_0x3574[_0x3e4531];return _0x5f2b05;};'use strict';var Sequelize=require(_0x4357('0x0'));module[_0x4357('0x1')]={'body':{'type':Sequelize[_0x4357('0x2')](_0x4357('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4357('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4357('0x5')]}};
\ No newline at end of file
+var _0x18ec=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x437eda,_0x35eaa6){var _0x35b585=function(_0x23c15a){while(--_0x23c15a){_0x437eda['push'](_0x437eda['shift']());}};_0x35b585(++_0x35eaa6);}(_0x18ec,0xb4));var _0xc18e=function(_0x5ab69c,_0x52f26b){_0x5ab69c=_0x5ab69c-0x0;var _0x112e12=_0x18ec[_0x5ab69c];return _0x112e12;};'use strict';var Sequelize=require(_0xc18e('0x0'));module[_0xc18e('0x1')]={'body':{'type':Sequelize[_0xc18e('0x2')](_0xc18e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc18e('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc18e('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index b454c29..f8bf888 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 _0x95da=['body','describe','get','createdAt','lastMessage','lastMessageAt','format','getUsers','User','agent','admin','user','fullname','internal','online','lastLoginAt','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','isEmpty','messages','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','length','find','create'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x95da,0x1d5));var _0xa95d=function(_0x37624e,_0x58edc9){_0x37624e=_0x37624e-0x0;var _0x279e86=_0x95da[_0x37624e];return _0x279e86;};'use strict';var emlformat=require(_0xa95d('0x0'));var rimraf=require(_0xa95d('0x1'));var zipdir=require(_0xa95d('0x2'));var jsonpatch=require(_0xa95d('0x3'));var rp=require('request-promise');var moment=require(_0xa95d('0x4'));var BPromise=require(_0xa95d('0x5'));var Mustache=require('mustache');var util=require(_0xa95d('0x6'));var path=require(_0xa95d('0x7'));var sox=require(_0xa95d('0x8'));var csv=require(_0xa95d('0x9'));var ejs=require(_0xa95d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa95d('0xb'));var squel=require(_0xa95d('0xc'));var crypto=require(_0xa95d('0xd'));var jsforce=require(_0xa95d('0xe'));var deskjs=require(_0xa95d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa95d('0x10'));var Papa=require('papaparse');var Redis=require(_0xa95d('0x11'));var authService=require(_0xa95d('0x12'));var qs=require(_0xa95d('0x13'));var as=require(_0xa95d('0x14'));var hardwareService=require(_0xa95d('0x15'));var logger=require(_0xa95d('0x16'))(_0xa95d('0x17'));var utils=require(_0xa95d('0x18'));var config=require(_0xa95d('0x19'));var licenseUtil=require(_0xa95d('0x1a'));var db=require(_0xa95d('0x1b'))['db'];config[_0xa95d('0x1c')]=_[_0xa95d('0x1d')](config[_0xa95d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa95d('0x1c')]));require(_0xa95d('0x1e'))[_0xa95d('0x1f')](socket);function respondWithStatusCode(_0x37ff31,_0x89d779){_0x89d779=_0x89d779||0xcc;return function(_0x20f744){if(_0x20f744){return _0x37ff31['sendStatus'](_0x89d779);}return _0x37ff31[_0xa95d('0x20')](_0x89d779)[_0xa95d('0x21')]();};}function respondWithResult(_0x4029e0,_0x44538b){_0x44538b=_0x44538b||0xc8;return function(_0xf9b8c2){if(_0xf9b8c2){return _0x4029e0[_0xa95d('0x20')](_0x44538b)[_0xa95d('0x22')](_0xf9b8c2);}};}function respondWithFilteredResult(_0x70c319,_0x22597a){return function(_0x12ce6d){if(_0x12ce6d){var _0x5e4090=typeof _0x22597a[_0xa95d('0x23')]===_0xa95d('0x24')&&typeof _0x22597a[_0xa95d('0x25')]===_0xa95d('0x24');var _0x1a1e9c=_0x12ce6d[_0xa95d('0x26')];var _0x34439f=_0x5e4090?0x0:_0x22597a[_0xa95d('0x23')];var _0x38e0ac=_0x5e4090?_0x12ce6d['count']:_0x22597a[_0xa95d('0x23')]+_0x22597a['limit'];var _0x267743;if(_0x38e0ac>=_0x1a1e9c){_0x38e0ac=_0x1a1e9c;_0x267743=0xc8;}else{_0x267743=0xce;}_0x70c319['status'](_0x267743);return _0x70c319[_0xa95d('0x27')]('Content-Range',_0x34439f+'-'+_0x38e0ac+'/'+_0x1a1e9c)[_0xa95d('0x22')](_0x12ce6d);}return null;};}function patchUpdates(_0x1a9be2){return function(_0x5d5bd9){try{jsonpatch[_0xa95d('0x28')](_0x5d5bd9,_0x1a9be2,!![]);}catch(_0x231ad1){return BPromise[_0xa95d('0x29')](_0x231ad1);}return _0x5d5bd9[_0xa95d('0x2a')]();};}function saveUpdates(_0xe56e8f,_0x102e31){return function(_0x2ac9a8){if(_0x2ac9a8){return _0x2ac9a8[_0xa95d('0x2b')](_0xe56e8f)[_0xa95d('0x2c')](function(_0x434dea){return _0x434dea;});}return null;};}function removeEntity(_0x37b8ae,_0x38eb7e){return function(_0x59a9c5){if(_0x59a9c5){return _0x59a9c5[_0xa95d('0x2d')]()[_0xa95d('0x2c')](function(){_0x37b8ae[_0xa95d('0x20')](0xcc)[_0xa95d('0x21')]();});}};}function handleEntityNotFound(_0x7bfbbc,_0x23dbf4){return function(_0x45edac){if(!_0x45edac){_0x7bfbbc[_0xa95d('0x2e')](0x194);}return _0x45edac;};}function handleError(_0x197ed7,_0x5d6fc1){_0x5d6fc1=_0x5d6fc1||0x1f4;return function(_0xc0e63a){logger['error'](_0xc0e63a[_0xa95d('0x2f')]);if(_0xc0e63a[_0xa95d('0x30')]){delete _0xc0e63a[_0xa95d('0x30')];}_0x197ed7[_0xa95d('0x20')](_0x5d6fc1)['send'](_0xc0e63a);};}exports[_0xa95d('0x31')]=function(_0x523039,_0x3c39a6){var _0xe620ca={},_0x59da05={},_0x304fab={'count':0x0,'rows':[]};var _0x31d49b=_[_0xa95d('0x32')](db[_0xa95d('0x33')][_0xa95d('0x34')],function(_0x4c7ae6){return{'name':_0x4c7ae6[_0xa95d('0x35')],'type':_0x4c7ae6[_0xa95d('0x36')][_0xa95d('0x37')]};});_0x59da05['model']=_[_0xa95d('0x32')](_0x31d49b,_0xa95d('0x30'));_0x59da05[_0xa95d('0x38')]=_[_0xa95d('0x39')](_0x523039['query']);_0x59da05[_0xa95d('0x3a')]=_['intersection'](_0x59da05[_0xa95d('0x3b')],_0x59da05[_0xa95d('0x38')]);_0xe620ca[_0xa95d('0x3c')]=_[_0xa95d('0x3d')](_0x59da05[_0xa95d('0x3b')],qs['fields'](_0x523039[_0xa95d('0x38')][_0xa95d('0x3e')]));_0xe620ca[_0xa95d('0x3c')]=_0xe620ca[_0xa95d('0x3c')]['length']?_0xe620ca[_0xa95d('0x3c')]:_0x59da05[_0xa95d('0x3b')];if(!_0x523039['query'][_0xa95d('0x3f')](_0xa95d('0x40'))){_0xe620ca[_0xa95d('0x25')]=qs[_0xa95d('0x25')](_0x523039[_0xa95d('0x38')]['limit']);_0xe620ca[_0xa95d('0x23')]=qs[_0xa95d('0x23')](_0x523039['query'][_0xa95d('0x23')]);}_0xe620ca[_0xa95d('0x41')]=qs[_0xa95d('0x42')](_0x523039[_0xa95d('0x38')][_0xa95d('0x42')]);_0xe620ca[_0xa95d('0x43')]=qs[_0xa95d('0x3a')](_['pick'](_0x523039[_0xa95d('0x38')],_0x59da05[_0xa95d('0x3a')]),_0x31d49b);if(_0x523039['query']['filter']){_0xe620ca[_0xa95d('0x43')]=_[_0xa95d('0x44')](_0xe620ca[_0xa95d('0x43')],{'$or':_[_0xa95d('0x32')](_0x31d49b,function(_0x3a5257){if(_0x3a5257['type']!==_0xa95d('0x45')){var _0x42beb2={};_0x42beb2[_0x3a5257['name']]={'$like':'%'+_0x523039[_0xa95d('0x38')][_0xa95d('0x46')]+'%'};return _0x42beb2;}})});}_0xe620ca=_['merge']({},_0xe620ca,_0x523039[_0xa95d('0x47')]);var _0x1a0551={'where':_0xe620ca['where']};return db['ChatInternalMessage']['count'](_0x1a0551)[_0xa95d('0x2c')](function(_0x4104bc){_0x304fab[_0xa95d('0x26')]=_0x4104bc;if(_0x523039['query'][_0xa95d('0x48')]){_0xe620ca[_0xa95d('0x49')]=[{'all':!![]}];}return db[_0xa95d('0x33')][_0xa95d('0x4a')](_0xe620ca);})[_0xa95d('0x2c')](function(_0x193c79){_0x304fab[_0xa95d('0x4b')]=_0x193c79;return _0x304fab;})[_0xa95d('0x2c')](respondWithFilteredResult(_0x3c39a6,_0xe620ca))[_0xa95d('0x4c')](handleError(_0x3c39a6,null));};exports['show']=function(_0x49a787,_0x4d3b38){var _0x244d7c={'raw':!![],'where':{'id':_0x49a787[_0xa95d('0x4d')]['id']}},_0x2948a3={};_0x2948a3[_0xa95d('0x3b')]=_[_0xa95d('0x39')](db['ChatInternalMessage']['rawAttributes']);_0x2948a3[_0xa95d('0x38')]=_[_0xa95d('0x39')](_0x49a787['query']);_0x2948a3[_0xa95d('0x3a')]=_[_0xa95d('0x3d')](_0x2948a3['model'],_0x2948a3[_0xa95d('0x38')]);_0x244d7c[_0xa95d('0x3c')]=_[_0xa95d('0x3d')](_0x2948a3[_0xa95d('0x3b')],qs[_0xa95d('0x3e')](_0x49a787['query'][_0xa95d('0x3e')]));_0x244d7c[_0xa95d('0x3c')]=_0x244d7c[_0xa95d('0x3c')][_0xa95d('0x4e')]?_0x244d7c[_0xa95d('0x3c')]:_0x2948a3[_0xa95d('0x3b')];if(_0x49a787[_0xa95d('0x38')][_0xa95d('0x48')]){_0x244d7c['include']=[{'all':!![]}];}_0x244d7c=_[_0xa95d('0x44')]({},_0x244d7c,_0x49a787[_0xa95d('0x47')]);return db[_0xa95d('0x33')][_0xa95d('0x4f')](_0x244d7c)[_0xa95d('0x2c')](handleEntityNotFound(_0x4d3b38,null))[_0xa95d('0x2c')](respondWithResult(_0x4d3b38,null))['catch'](handleError(_0x4d3b38,null));};exports[_0xa95d('0x50')]=function(_0x40a9ba,_0x2c476e){return db['ChatInternalMessage'][_0xa95d('0x50')](_0x40a9ba[_0xa95d('0x51')],{})[_0xa95d('0x2c')](respondWithResult(_0x2c476e,0xc9))[_0xa95d('0x4c')](handleError(_0x2c476e,null));};exports['update']=function(_0x20a92e,_0xaeb6b3){if(_0x20a92e['body']['id']){delete _0x20a92e[_0xa95d('0x51')]['id'];}return db[_0xa95d('0x33')]['find']({'where':{'id':_0x20a92e[_0xa95d('0x4d')]['id']}})[_0xa95d('0x2c')](handleEntityNotFound(_0xaeb6b3,null))[_0xa95d('0x2c')](saveUpdates(_0x20a92e[_0xa95d('0x51')],null))[_0xa95d('0x2c')](respondWithResult(_0xaeb6b3,null))[_0xa95d('0x4c')](handleError(_0xaeb6b3,null));};exports[_0xa95d('0x2d')]=function(_0xae3350,_0x52efa1){return db[_0xa95d('0x33')][_0xa95d('0x4f')]({'where':{'id':_0xae3350[_0xa95d('0x4d')]['id']}})[_0xa95d('0x2c')](handleEntityNotFound(_0x52efa1,null))[_0xa95d('0x2c')](removeEntity(_0x52efa1,null))[_0xa95d('0x4c')](handleError(_0x52efa1,null));};exports[_0xa95d('0x52')]=function(_0x529a27,_0x10d22b){return db[_0xa95d('0x33')][_0xa95d('0x52')]()[_0xa95d('0x2c')](respondWithResult(_0x10d22b,null))[_0xa95d('0x4c')](handleError(_0x10d22b,null));};function wrapUser(_0x44ef41){return function(_0x235f76){var _0x1c28b7=_0x44ef41[_0xa95d('0x53')]({'plain':!![]});_0x1c28b7['messages']=[];if(_0x235f76){_0x1c28b7['lastMessageAt']=_0x235f76[_0xa95d('0x54')];_0x1c28b7[_0xa95d('0x55')]=_0x235f76;}else{_0x1c28b7[_0xa95d('0x56')]=moment(0x0)[_0xa95d('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c28b7['lastMessage']={};}return _0x1c28b7;};}exports[_0xa95d('0x58')]=function(_0x1cce2b,_0xff6ce9,_0x5941dd){var _0x11a9b0=[];return db[_0xa95d('0x59')]['findAll']({'where':{'role':[_0xa95d('0x5a'),_0xa95d('0x5b'),_0xa95d('0x5c')]},'attributes':['id',_0xa95d('0x5d'),_0xa95d('0x30'),'role','userpic',_0xa95d('0x5e'),_0xa95d('0x5f'),_0xa95d('0x60'),'allowmessenger',_0xa95d('0x61')],'order':qs[_0xa95d('0x42')](_0xa95d('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0xa95d('0x63'),'attributes':['id',_0xa95d('0x30'),_0xa95d('0x36')],'through':{'attributes':[]}}]})[_0xa95d('0x2c')](function(_0x404402){if(_0x404402){var _0x50e92f=_0x1cce2b[_0xa95d('0x5c')][_0xa95d('0x53')]({'plain':!![]});if(!_0x50e92f)throw new Error(_0xa95d('0x64'));if(_0x50e92f[_0xa95d('0x65')]===_0xa95d('0x5c')){return db['UserProfileSection'][_0xa95d('0x4f')]({'where':{'name':'Agents','userProfileId':_0x50e92f['userProfileId']},'raw':!![]})[_0xa95d('0x2c')](function(_0x4dfec9){if(_0x4dfec9){if(_0x4dfec9[_0xa95d('0x66')]===0x0){return db['UserProfileResource'][_0xa95d('0x4a')]({'where':{'sectionId':_0x4dfec9['id']},'raw':!![]})[_0xa95d('0x2c')](function(_0x2b7c7f){var _0x3c334e=[];if(_[_0xa95d('0x67')](_0x2b7c7f)){_0x3c334e=_[_0xa95d('0x46')](_0x404402,function(_0x20d30f){if(_0x20d30f[_0xa95d('0x65')]!=='agent'){return _0x20d30f;}});return _0x3c334e;}else{for(var _0x2fde9a=0x0;_0x2fde9a<_0x404402[_0xa95d('0x4e')];_0x2fde9a++){var _0x368e0d=_0x404402[_0x2fde9a];if(_0x368e0d[_0xa95d('0x65')]===_0xa95d('0x5a')){var _0x20df9d=_[_0xa95d('0x4f')](_0x2b7c7f,function(_0x2702e4){return _0x2702e4['resourceId']===_0x368e0d['id'];});if(_0x20df9d)_0x3c334e['push'](_0x368e0d);}else{_0x3c334e['push'](_0x368e0d);}}return _0x3c334e;}});}else{return _0x404402;}}else{var _0x53bf5e=_['filter'](_0x404402,function(_0x47c05d){if(_0x47c05d['role']!==_0xa95d('0x5a')){return _0x47c05d;}});return _0x53bf5e;}});}else{return _0x404402;}}})[_0xa95d('0x2c')](function(_0x5475b5){var _0x427e3e=[];if(_0x5475b5){_0x11a9b0=_0x5475b5;for(var _0x4a528f=0x0;_0x4a528f<_0x5475b5['length'];_0x4a528f+=0x1){_0x11a9b0[_0x4a528f][_0xa95d('0x68')]=[];_0x427e3e[_0xa95d('0x69')](db['ChatInternalMessage'][_0xa95d('0x4f')]({'where':{'FromId':[_0x1cce2b[_0xa95d('0x5c')]['id'],_0x5475b5[_0x4a528f]['id']],'ToId':[_0x1cce2b[_0xa95d('0x5c')]['id'],_0x5475b5[_0x4a528f]['id']],'ChatGroupId':null},'attributes':['id',_0xa95d('0x54'),_0xa95d('0x6a'),_0xa95d('0x6b'),'read','body'],'order':qs[_0xa95d('0x42')](_0xa95d('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa95d('0x2c')](wrapUser(_0x5475b5[_0x4a528f])));}return BPromise[_0xa95d('0x6d')](_0x427e3e);}return[];})['then'](function(_0xaefbf){return{'rows':_0xaefbf,'count':_0xaefbf['length']};})['then'](respondWithResult(_0xff6ce9,null))[_0xa95d('0x4c')](handleError(_0xff6ce9,null));};
\ No newline at end of file
+var _0x2bb9=['merge','VIRTUAL','filter','includeAll','include','show','params','filters','options','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','findAll','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x19bdd2,_0x152c0f){var _0x218bcf=function(_0x112b8c){while(--_0x112b8c){_0x19bdd2['push'](_0x19bdd2['shift']());}};_0x218bcf(++_0x152c0f);}(_0x2bb9,0x16e));var _0x92bb=function(_0x513cbb,_0x5bbea5){_0x513cbb=_0x513cbb-0x0;var _0x481b9e=_0x2bb9[_0x513cbb];return _0x481b9e;};'use strict';var emlformat=require(_0x92bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92bb('0x1'));var jsonpatch=require(_0x92bb('0x2'));var rp=require(_0x92bb('0x3'));var moment=require(_0x92bb('0x4'));var BPromise=require(_0x92bb('0x5'));var Mustache=require(_0x92bb('0x6'));var util=require(_0x92bb('0x7'));var path=require(_0x92bb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92bb('0x9'));var squel=require(_0x92bb('0xa'));var crypto=require('crypto');var jsforce=require(_0x92bb('0xb'));var deskjs=require(_0x92bb('0xc'));var toCsv=require(_0x92bb('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x92bb('0xe'));var qs=require(_0x92bb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92bb('0x10'));var logger=require(_0x92bb('0x11'))(_0x92bb('0x12'));var utils=require(_0x92bb('0x13'));var config=require(_0x92bb('0x14'));var licenseUtil=require(_0x92bb('0x15'));var db=require(_0x92bb('0x16'))['db'];config['redis']=_[_0x92bb('0x17')](config[_0x92bb('0x18')],{'host':_0x92bb('0x19'),'port':0x18eb});var socket=require(_0x92bb('0x1a'))(new Redis(config[_0x92bb('0x18')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x5049b4,_0x549532){_0x549532=_0x549532||0xcc;return function(_0x59bba2){if(_0x59bba2){return _0x5049b4[_0x92bb('0x1b')](_0x549532);}return _0x5049b4[_0x92bb('0x1c')](_0x549532)[_0x92bb('0x1d')]();};}function respondWithResult(_0x4e996d,_0x2c95f2){_0x2c95f2=_0x2c95f2||0xc8;return function(_0x3c7fde){if(_0x3c7fde){return _0x4e996d[_0x92bb('0x1c')](_0x2c95f2)['json'](_0x3c7fde);}};}function respondWithFilteredResult(_0xcf57bc,_0x4d1477){return function(_0x564b7f){if(_0x564b7f){var _0x1222ce=typeof _0x4d1477[_0x92bb('0x1e')]==='undefined'&&typeof _0x4d1477[_0x92bb('0x1f')]==='undefined';var _0x33fd01=_0x564b7f[_0x92bb('0x20')];var _0x513338=_0x1222ce?0x0:_0x4d1477[_0x92bb('0x1e')];var _0x3f3ac0=_0x1222ce?_0x564b7f[_0x92bb('0x20')]:_0x4d1477[_0x92bb('0x1e')]+_0x4d1477[_0x92bb('0x1f')];var _0x30c08e;if(_0x3f3ac0>=_0x33fd01){_0x3f3ac0=_0x33fd01;_0x30c08e=0xc8;}else{_0x30c08e=0xce;}_0xcf57bc[_0x92bb('0x1c')](_0x30c08e);return _0xcf57bc[_0x92bb('0x21')](_0x92bb('0x22'),_0x513338+'-'+_0x3f3ac0+'/'+_0x33fd01)[_0x92bb('0x23')](_0x564b7f);}return null;};}function patchUpdates(_0x725571){return function(_0x275158){try{jsonpatch[_0x92bb('0x24')](_0x275158,_0x725571,!![]);}catch(_0x5ef69d){return BPromise['reject'](_0x5ef69d);}return _0x275158[_0x92bb('0x25')]();};}function saveUpdates(_0x37c400,_0x527eb0){return function(_0x3a1452){if(_0x3a1452){return _0x3a1452[_0x92bb('0x26')](_0x37c400)['then'](function(_0x87c619){return _0x87c619;});}return null;};}function removeEntity(_0x323007,_0x4d926e){return function(_0x39f8a1){if(_0x39f8a1){return _0x39f8a1['destroy']()[_0x92bb('0x27')](function(){_0x323007['status'](0xcc)[_0x92bb('0x1d')]();});}};}function handleEntityNotFound(_0x1e83c1,_0x513b45){return function(_0x179985){if(!_0x179985){_0x1e83c1[_0x92bb('0x1b')](0x194);}return _0x179985;};}function handleError(_0x22cd1a,_0x4853b9){_0x4853b9=_0x4853b9||0x1f4;return function(_0xe58677){logger[_0x92bb('0x28')](_0xe58677[_0x92bb('0x29')]);if(_0xe58677[_0x92bb('0x2a')]){delete _0xe58677[_0x92bb('0x2a')];}_0x22cd1a[_0x92bb('0x1c')](_0x4853b9)[_0x92bb('0x2b')](_0xe58677);};}exports[_0x92bb('0x2c')]=function(_0x66f374,_0x51f3de){var _0x2d5f13={},_0x164c6b={},_0x4592c5={'count':0x0,'rows':[]};var _0x4dc6b6=_[_0x92bb('0x2d')](db[_0x92bb('0x2e')][_0x92bb('0x2f')],function(_0x2689d8){return{'name':_0x2689d8['fieldName'],'type':_0x2689d8[_0x92bb('0x30')][_0x92bb('0x31')]};});_0x164c6b[_0x92bb('0x32')]=_[_0x92bb('0x2d')](_0x4dc6b6,_0x92bb('0x2a'));_0x164c6b[_0x92bb('0x33')]=_[_0x92bb('0x34')](_0x66f374['query']);_0x164c6b['filters']=_[_0x92bb('0x35')](_0x164c6b[_0x92bb('0x32')],_0x164c6b[_0x92bb('0x33')]);_0x2d5f13['attributes']=_[_0x92bb('0x35')](_0x164c6b[_0x92bb('0x32')],qs[_0x92bb('0x36')](_0x66f374['query']['fields']));_0x2d5f13[_0x92bb('0x37')]=_0x2d5f13['attributes'][_0x92bb('0x38')]?_0x2d5f13['attributes']:_0x164c6b[_0x92bb('0x32')];if(!_0x66f374[_0x92bb('0x33')][_0x92bb('0x39')]('nolimit')){_0x2d5f13[_0x92bb('0x1f')]=qs[_0x92bb('0x1f')](_0x66f374[_0x92bb('0x33')][_0x92bb('0x1f')]);_0x2d5f13[_0x92bb('0x1e')]=qs[_0x92bb('0x1e')](_0x66f374['query'][_0x92bb('0x1e')]);}_0x2d5f13[_0x92bb('0x3a')]=qs[_0x92bb('0x3b')](_0x66f374['query'][_0x92bb('0x3b')]);_0x2d5f13[_0x92bb('0x3c')]=qs['filters'](_[_0x92bb('0x3d')](_0x66f374['query'],_0x164c6b['filters']),_0x4dc6b6);if(_0x66f374['query']['filter']){_0x2d5f13[_0x92bb('0x3c')]=_[_0x92bb('0x3e')](_0x2d5f13['where'],{'$or':_[_0x92bb('0x2d')](_0x4dc6b6,function(_0x5762fa){if(_0x5762fa['type']!==_0x92bb('0x3f')){var _0x56b35f={};_0x56b35f[_0x5762fa[_0x92bb('0x2a')]]={'$like':'%'+_0x66f374[_0x92bb('0x33')][_0x92bb('0x40')]+'%'};return _0x56b35f;}})});}_0x2d5f13=_[_0x92bb('0x3e')]({},_0x2d5f13,_0x66f374['options']);var _0x5b3558={'where':_0x2d5f13['where']};return db[_0x92bb('0x2e')][_0x92bb('0x20')](_0x5b3558)['then'](function(_0x4a8053){_0x4592c5['count']=_0x4a8053;if(_0x66f374[_0x92bb('0x33')][_0x92bb('0x41')]){_0x2d5f13[_0x92bb('0x42')]=[{'all':!![]}];}return db[_0x92bb('0x2e')]['findAll'](_0x2d5f13);})[_0x92bb('0x27')](function(_0x2541bb){_0x4592c5['rows']=_0x2541bb;return _0x4592c5;})[_0x92bb('0x27')](respondWithFilteredResult(_0x51f3de,_0x2d5f13))['catch'](handleError(_0x51f3de,null));};exports[_0x92bb('0x43')]=function(_0xfd485a,_0x53fd31){var _0x34c66c={'raw':!![],'where':{'id':_0xfd485a[_0x92bb('0x44')]['id']}},_0x23d7a0={};_0x23d7a0['model']=_[_0x92bb('0x34')](db['ChatInternalMessage'][_0x92bb('0x2f')]);_0x23d7a0[_0x92bb('0x33')]=_[_0x92bb('0x34')](_0xfd485a['query']);_0x23d7a0[_0x92bb('0x45')]=_[_0x92bb('0x35')](_0x23d7a0[_0x92bb('0x32')],_0x23d7a0['query']);_0x34c66c['attributes']=_['intersection'](_0x23d7a0['model'],qs[_0x92bb('0x36')](_0xfd485a['query'][_0x92bb('0x36')]));_0x34c66c['attributes']=_0x34c66c['attributes']['length']?_0x34c66c[_0x92bb('0x37')]:_0x23d7a0[_0x92bb('0x32')];if(_0xfd485a[_0x92bb('0x33')]['includeAll']){_0x34c66c[_0x92bb('0x42')]=[{'all':!![]}];}_0x34c66c=_[_0x92bb('0x3e')]({},_0x34c66c,_0xfd485a[_0x92bb('0x46')]);return db['ChatInternalMessage'][_0x92bb('0x47')](_0x34c66c)['then'](handleEntityNotFound(_0x53fd31,null))[_0x92bb('0x27')](respondWithResult(_0x53fd31,null))['catch'](handleError(_0x53fd31,null));};exports[_0x92bb('0x48')]=function(_0x454e19,_0x3745d6){return db[_0x92bb('0x2e')]['create'](_0x454e19[_0x92bb('0x49')],{})['then'](respondWithResult(_0x3745d6,0xc9))[_0x92bb('0x4a')](handleError(_0x3745d6,null));};exports[_0x92bb('0x26')]=function(_0x568cdd,_0x1cc939){if(_0x568cdd[_0x92bb('0x49')]['id']){delete _0x568cdd[_0x92bb('0x49')]['id'];}return db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'id':_0x568cdd[_0x92bb('0x44')]['id']}})[_0x92bb('0x27')](handleEntityNotFound(_0x1cc939,null))[_0x92bb('0x27')](saveUpdates(_0x568cdd[_0x92bb('0x49')],null))['then'](respondWithResult(_0x1cc939,null))[_0x92bb('0x4a')](handleError(_0x1cc939,null));};exports['destroy']=function(_0x5eccc5,_0x661ef){return db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'id':_0x5eccc5[_0x92bb('0x44')]['id']}})['then'](handleEntityNotFound(_0x661ef,null))[_0x92bb('0x27')](removeEntity(_0x661ef,null))[_0x92bb('0x4a')](handleError(_0x661ef,null));};exports[_0x92bb('0x4b')]=function(_0xe91c9b,_0x189595){return db[_0x92bb('0x2e')][_0x92bb('0x4b')]()[_0x92bb('0x27')](respondWithResult(_0x189595,null))[_0x92bb('0x4a')](handleError(_0x189595,null));};function wrapUser(_0x44d6f4){return function(_0x302cb2){var _0x24dfdb=_0x44d6f4[_0x92bb('0x4c')]({'plain':!![]});_0x24dfdb[_0x92bb('0x4d')]=[];if(_0x302cb2){_0x24dfdb[_0x92bb('0x4e')]=_0x302cb2[_0x92bb('0x4f')];_0x24dfdb[_0x92bb('0x50')]=_0x302cb2;}else{_0x24dfdb[_0x92bb('0x4e')]=moment(0x0)[_0x92bb('0x51')](_0x92bb('0x52'));_0x24dfdb[_0x92bb('0x50')]={};}return _0x24dfdb;};}exports[_0x92bb('0x53')]=function(_0x3e27a1,_0x52433f,_0x2e8cdc){var _0x445d78=[];return db[_0x92bb('0x54')]['findAll']({'where':{'role':['agent',_0x92bb('0x55'),_0x92bb('0x56')]},'attributes':['id','fullname',_0x92bb('0x2a'),'role','userpic',_0x92bb('0x57'),_0x92bb('0x58'),_0x92bb('0x59'),_0x92bb('0x5a'),'showWebBar'],'order':qs[_0x92bb('0x3b')](_0x92bb('0x5b')),'include':[{'model':db[_0x92bb('0x5c')],'as':_0x92bb('0x5d'),'attributes':['id',_0x92bb('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x92bb('0x27')](function(_0x2ba634){if(_0x2ba634){var _0x3356bd=_0x3e27a1[_0x92bb('0x56')][_0x92bb('0x4c')]({'plain':!![]});if(!_0x3356bd)throw new Error(_0x92bb('0x5e'));if(_0x3356bd[_0x92bb('0x5f')]==='user'){return db[_0x92bb('0x60')][_0x92bb('0x47')]({'where':{'name':'Agents','userProfileId':_0x3356bd['userProfileId']},'raw':!![]})[_0x92bb('0x27')](function(_0xf906d0){if(_0xf906d0){if(_0xf906d0[_0x92bb('0x61')]===0x0){return db['UserProfileResource'][_0x92bb('0x62')]({'where':{'sectionId':_0xf906d0['id']},'raw':!![]})[_0x92bb('0x27')](function(_0x20e01f){var _0xc827e8=[];if(_['isEmpty'](_0x20e01f)){_0xc827e8=_[_0x92bb('0x40')](_0x2ba634,function(_0x2c1507){if(_0x2c1507['role']!==_0x92bb('0x63')){return _0x2c1507;}});return _0xc827e8;}else{for(var _0x420ef7=0x0;_0x420ef7<_0x2ba634['length'];_0x420ef7++){var _0x5350f5=_0x2ba634[_0x420ef7];if(_0x5350f5['role']===_0x92bb('0x63')){var _0x39199a=_[_0x92bb('0x47')](_0x20e01f,function(_0x512076){return _0x512076[_0x92bb('0x64')]===_0x5350f5['id'];});if(_0x39199a)_0xc827e8[_0x92bb('0x65')](_0x5350f5);}else{_0xc827e8['push'](_0x5350f5);}}return _0xc827e8;}});}else{return _0x2ba634;}}else{var _0x1bab42=_['filter'](_0x2ba634,function(_0x55ecf1){if(_0x55ecf1[_0x92bb('0x5f')]!=='agent'){return _0x55ecf1;}});return _0x1bab42;}});}else{return _0x2ba634;}}})[_0x92bb('0x27')](function(_0xe6254f){var _0x19ce2b=[];if(_0xe6254f){_0x445d78=_0xe6254f;for(var _0x2bc1d6=0x0;_0x2bc1d6<_0xe6254f[_0x92bb('0x38')];_0x2bc1d6+=0x1){_0x445d78[_0x2bc1d6]['messages']=[];_0x19ce2b[_0x92bb('0x65')](db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'FromId':[_0x3e27a1[_0x92bb('0x56')]['id'],_0xe6254f[_0x2bc1d6]['id']],'ToId':[_0x3e27a1['user']['id'],_0xe6254f[_0x2bc1d6]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x92bb('0x66'),_0x92bb('0x67'),_0x92bb('0x68'),_0x92bb('0x49')],'order':qs[_0x92bb('0x3b')](_0x92bb('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xe6254f[_0x2bc1d6])));}return BPromise[_0x92bb('0x6a')](_0x19ce2b);}return[];})[_0x92bb('0x27')](function(_0x515639){return{'rows':_0x515639,'count':_0x515639[_0x92bb('0x38')]};})[_0x92bb('0x27')](respondWithResult(_0x52433f,null))[_0x92bb('0x4a')](handleError(_0x52433f,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 77c7af8..aaf5337 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 _0xec25=['hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x1000a4,_0x5ac0b7){var _0x9d47e7=function(_0x407580){while(--_0x407580){_0x1000a4['push'](_0x1000a4['shift']());}};_0x9d47e7(++_0x5ac0b7);}(_0xec25,0x136));var _0x5ec2=function(_0x11fa62,_0x26435b){_0x11fa62=_0x11fa62-0x0;var _0x4fe256=_0xec25[_0x11fa62];return _0x4fe256;};'use strict';var EventEmitter=require(_0x5ec2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5ec2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ec2('0x2'),'afterDestroy':_0x5ec2('0x3')};function emitEvent(_0x4f0513){return function(_0x2e4d23,_0x5f1aa6,_0x55aa6c){ChatInternalMessageEvents[_0x5ec2('0x4')](_0x4f0513+':'+_0x2e4d23['id'],_0x2e4d23);ChatInternalMessageEvents[_0x5ec2('0x4')](_0x4f0513,_0x2e4d23);_0x55aa6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x5ec2('0x5')](e,emitEvent(event));}}module[_0x5ec2('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x00ca=['events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x2ed636,_0x3e4f62){var _0x39224c=function(_0x379fcd){while(--_0x379fcd){_0x2ed636['push'](_0x2ed636['shift']());}};_0x39224c(++_0x3e4f62);}(_0x00ca,0x96));var _0xa00c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x00ca[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xa00c('0x0'));var ChatInternalMessage=require(_0xa00c('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa00c('0x2'),'afterUpdate':'update','afterDestroy':_0xa00c('0x3')};function emitEvent(_0x5d01cd){return function(_0x1b8f74,_0xe42dbd,_0x31b9e7){ChatInternalMessageEvents[_0xa00c('0x4')](_0x5d01cd+':'+_0x1b8f74['id'],_0x1b8f74);ChatInternalMessageEvents[_0xa00c('0x4')](_0x5d01cd,_0x1b8f74);_0x31b9e7(null);};}for(var e in events){if(events[_0xa00c('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index a18edca..2f4d538 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 _0xe744=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path'];(function(_0x42a9ef,_0x30f310){var _0x521ca0=function(_0x2688a9){while(--_0x2688a9){_0x42a9ef['push'](_0x42a9ef['shift']());}};_0x521ca0(++_0x30f310);}(_0xe744,0x11b));var _0x4e74=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xe744[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x4e74('0x0'));var util=require(_0x4e74('0x1'));var logger=require('../../config/logger')(_0x4e74('0x2'));var moment=require('moment');var BPromise=require(_0x4e74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e74('0x4'));var rimraf=require(_0x4e74('0x5'));var config=require(_0x4e74('0x6'));var attributes=require(_0x4e74('0x7'));module[_0x4e74('0x8')]=function(_0x3a91f8,_0x453096){return _0x3a91f8['define'](_0x4e74('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e74('0xa'),'collate':_0x4e74('0xb')});};
\ No newline at end of file
+var _0x9005=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatInternalMessage.attributes','exports'];(function(_0x321327,_0x4965b){var _0x33be38=function(_0x27e02c){while(--_0x27e02c){_0x321327['push'](_0x321327['shift']());}};_0x33be38(++_0x4965b);}(_0x9005,0x138));var _0x5900=function(_0x420a5b,_0x26c365){_0x420a5b=_0x420a5b-0x0;var _0x1a4f26=_0x9005[_0x420a5b];return _0x1a4f26;};'use strict';var _=require(_0x5900('0x0'));var util=require(_0x5900('0x1'));var logger=require(_0x5900('0x2'))(_0x5900('0x3'));var moment=require(_0x5900('0x4'));var BPromise=require(_0x5900('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5900('0x6'));var rimraf=require(_0x5900('0x7'));var config=require('../../config/environment');var attributes=require(_0x5900('0x8'));module[_0x5900('0x9')]=function(_0x5c5447,_0x243850){return _0x5c5447[_0x5900('0xa')](_0x5900('0xb'),attributes,{'tableName':_0x5900('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5900('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 7471494..a6802d8 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 _0xc913=['result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x4bee59,_0x48f132){var _0x3ed6bb=function(_0x2b6c48){while(--_0x2b6c48){_0x4bee59['push'](_0x4bee59['shift']());}};_0x3ed6bb(++_0x48f132);}(_0xc913,0xd9));var _0x3c91=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xc913[_0x2160a9];return _0xa88cf7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c91('0x0'));var BPromise=require(_0x3c91('0x1'));var rs=require(_0x3c91('0x2'));var fs=require('fs');var Redis=require(_0x3c91('0x3'));var db=require(_0x3c91('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c91('0x5'))(_0x3c91('0x6'));var config=require(_0x3c91('0x7'));var jayson=require(_0x3c91('0x8'));var client=jayson[_0x3c91('0x9')][_0x3c91('0xa')]({'port':0x232a});config['redis']=_[_0x3c91('0xb')](config[_0x3c91('0xc')],{'host':_0x3c91('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3c91('0xe'))[_0x3c91('0xf')](socket);function respondWithRpcPromise(_0x459f45,_0x4c769d,_0x86299f){return new BPromise(function(_0x4ebcee,_0x7057d0){return client[_0x3c91('0x10')](_0x459f45,_0x86299f)[_0x3c91('0x11')](function(_0x455fe5){logger['info'](_0x3c91('0x12'),_0x4c769d,_0x3c91('0x13'));logger[_0x3c91('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4c769d,_0x3c91('0x13'),JSON[_0x3c91('0x15')](_0x455fe5));if(_0x455fe5[_0x3c91('0x16')]){if(_0x455fe5[_0x3c91('0x16')][_0x3c91('0x17')]===0x1f4){logger[_0x3c91('0x16')](_0x3c91('0x12'),_0x4c769d,_0x455fe5[_0x3c91('0x16')][_0x3c91('0x18')]);return _0x7057d0(_0x455fe5['error'][_0x3c91('0x18')]);}logger[_0x3c91('0x16')](_0x3c91('0x12'),_0x4c769d,_0x455fe5[_0x3c91('0x16')]['message']);return _0x4ebcee(_0x455fe5[_0x3c91('0x16')]['message']);}else{logger[_0x3c91('0x19')](_0x3c91('0x12'),_0x4c769d,'request\x20sent');_0x4ebcee(_0x455fe5[_0x3c91('0x1a')][_0x3c91('0x18')]);}})['catch'](function(_0x45deb9){logger[_0x3c91('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c769d,_0x45deb9);_0x7057d0(_0x45deb9);});});}
\ No newline at end of file
+var _0xb877=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x508232,_0x43af25){var _0x2b761d=function(_0x306a62){while(--_0x306a62){_0x508232['push'](_0x508232['shift']());}};_0x2b761d(++_0x43af25);}(_0xb877,0x1cb));var _0x7b87=function(_0x13b433,_0x285036){_0x13b433=_0x13b433-0x0;var _0x4db0aa=_0xb877[_0x13b433];return _0x4db0aa;};'use strict';var _=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var moment=require(_0x7b87('0x2'));var BPromise=require(_0x7b87('0x3'));var rs=require(_0x7b87('0x4'));var fs=require('fs');var Redis=require(_0x7b87('0x5'));var db=require(_0x7b87('0x6'))['db'];var utils=require(_0x7b87('0x7'));var logger=require(_0x7b87('0x8'))(_0x7b87('0x9'));var config=require(_0x7b87('0xa'));var jayson=require(_0x7b87('0xb'));var client=jayson[_0x7b87('0xc')][_0x7b87('0xd')]({'port':0x232a});config[_0x7b87('0xe')]=_[_0x7b87('0xf')](config[_0x7b87('0xe')],{'host':_0x7b87('0x10'),'port':0x18eb});var socket=require(_0x7b87('0x11'))(new Redis(config[_0x7b87('0xe')]));require(_0x7b87('0x12'))[_0x7b87('0x13')](socket);function respondWithRpcPromise(_0x5a0e91,_0xa8d5cc,_0x3215c7){return new BPromise(function(_0x222760,_0x2f6040){return client[_0x7b87('0x14')](_0x5a0e91,_0x3215c7)[_0x7b87('0x15')](function(_0x466403){logger[_0x7b87('0x16')](_0x7b87('0x17'),_0xa8d5cc,_0x7b87('0x18'));logger[_0x7b87('0x19')](_0x7b87('0x1a'),_0xa8d5cc,'request\x20sent',JSON['stringify'](_0x466403));if(_0x466403['error']){if(_0x466403['error']['code']===0x1f4){logger[_0x7b87('0x1b')](_0x7b87('0x17'),_0xa8d5cc,_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);return _0x2f6040(_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);}logger[_0x7b87('0x1b')](_0x7b87('0x17'),_0xa8d5cc,_0x466403['error']['message']);return _0x222760(_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);}else{logger[_0x7b87('0x16')](_0x7b87('0x17'),_0xa8d5cc,_0x7b87('0x18'));_0x222760(_0x466403[_0x7b87('0x1d')][_0x7b87('0x1c')]);}})['catch'](function(_0x4456c7){logger[_0x7b87('0x1b')]('ChatInternalMessage,\x20%s,\x20%s',_0xa8d5cc,_0x4456c7);_0x2f6040(_0x4456c7);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 9356e76..76a6b9a 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 _0xbacc=['register','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xbacc,0x182));var _0xcbac=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xbacc[_0x42f009];return _0x22a1e0;};'use strict';var ChatInternalMessageEvents=require(_0xcbac('0x0'));var events=[_0xcbac('0x1'),_0xcbac('0x2'),_0xcbac('0x3')];function createListener(_0x59bc2d,_0x28f045){return function(_0x85139b){_0x28f045[_0xcbac('0x4')](_0x59bc2d,_0x85139b);};}function removeListener(_0xd3bec9,_0x32973c){return function(){ChatInternalMessageEvents[_0xcbac('0x5')](_0xd3bec9,_0x32973c);};}exports[_0xcbac('0x6')]=function(_0x455760){for(var _0x141a0b=0x0,_0x17e8ad=events['length'];_0x141a0b<_0x17e8ad;_0x141a0b++){var _0x5e18ab=events[_0x141a0b];var _0x3dd945=createListener('chatInternalMessage:'+_0x5e18ab,_0x455760);ChatInternalMessageEvents['on'](_0x5e18ab,_0x3dd945);}};
\ No newline at end of file
+var _0xdc9c=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x197884,_0x4ecf5f){var _0x33b1af=function(_0x4fae72){while(--_0x4fae72){_0x197884['push'](_0x197884['shift']());}};_0x33b1af(++_0x4ecf5f);}(_0xdc9c,0x9d));var _0xcdc9=function(_0x30a0c0,_0x41014c){_0x30a0c0=_0x30a0c0-0x0;var _0x42cbdf=_0xdc9c[_0x30a0c0];return _0x42cbdf;};'use strict';var ChatInternalMessageEvents=require(_0xcdc9('0x0'));var events=[_0xcdc9('0x1'),'remove',_0xcdc9('0x2')];function createListener(_0x152b40,_0x8d4057){return function(_0x42f536){_0x8d4057[_0xcdc9('0x3')](_0x152b40,_0x42f536);};}function removeListener(_0x23bc59,_0x1139d6){return function(){ChatInternalMessageEvents[_0xcdc9('0x4')](_0x23bc59,_0x1139d6);};}exports[_0xcdc9('0x5')]=function(_0x446c89){for(var _0x502830=0x0,_0x3a71bc=events[_0xcdc9('0x6')];_0x502830<_0x3a71bc;_0x502830++){var _0x104dae=events[_0x502830];var _0x27d0c3=createListener(_0xcdc9('0x7')+_0x104dae,_0x446c89);ChatInternalMessageEvents['on'](_0x104dae,_0x27d0c3);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 46f00c3..c4a2fd5 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 _0x0ec8=['express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x74118b,_0x239694){var _0x257525=function(_0x531db8){while(--_0x531db8){_0x74118b['push'](_0x74118b['shift']());}};_0x257525(++_0x239694);}(_0x0ec8,0x167));var _0x80ec=function(_0x3dbc19,_0x2ac491){_0x3dbc19=_0x3dbc19-0x0;var _0x50a54e=_0x0ec8[_0x3dbc19];return _0x50a54e;};'use strict';var multer=require(_0x80ec('0x0'));var util=require(_0x80ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x80ec('0x2'));var router=express['Router']();var fs_extra=require(_0x80ec('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x80ec('0x4'));var config=require(_0x80ec('0x5'));var controller=require(_0x80ec('0x6'));router[_0x80ec('0x7')]('/',auth[_0x80ec('0x8')](),controller['index']);router[_0x80ec('0x7')](_0x80ec('0x9'),auth[_0x80ec('0x8')](),controller[_0x80ec('0xa')]);router[_0x80ec('0x7')](_0x80ec('0xb'),auth['isAuthenticated'](),controller[_0x80ec('0xc')]);router[_0x80ec('0x7')]('/:id',auth[_0x80ec('0x8')](),controller['show']);router[_0x80ec('0xd')]('/',auth[_0x80ec('0x8')](),controller['create']);router['put'](_0x80ec('0xe'),controller[_0x80ec('0xf')]);router[_0x80ec('0x10')](_0x80ec('0xe'),auth['isAuthenticated'](),controller[_0x80ec('0x11')]);module[_0x80ec('0x12')]=router;
\ No newline at end of file
+var _0xdac2=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/users','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x22d292,_0x2d85fd){var _0x36a152=function(_0xb76399){while(--_0xb76399){_0x22d292['push'](_0x22d292['shift']());}};_0x36a152(++_0x2d85fd);}(_0xdac2,0x72));var _0x2dac=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xdac2[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2dac('0x0'));var timeout=require(_0x2dac('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2dac('0x2'));var auth=require(_0x2dac('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2dac('0x4'));var controller=require(_0x2dac('0x5'));router[_0x2dac('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2dac('0x6')](_0x2dac('0x7'),auth[_0x2dac('0x8')](),controller[_0x2dac('0x9')]);router[_0x2dac('0x6')](_0x2dac('0xa'),auth[_0x2dac('0x8')](),controller['getUsers']);router[_0x2dac('0x6')](_0x2dac('0xb'),auth[_0x2dac('0x8')](),controller[_0x2dac('0xc')]);router[_0x2dac('0xd')]('/',auth[_0x2dac('0x8')](),controller[_0x2dac('0xe')]);router[_0x2dac('0xf')](_0x2dac('0xb'),controller['update']);router[_0x2dac('0x10')](_0x2dac('0xb'),auth[_0x2dac('0x8')](),controller[_0x2dac('0x11')]);module[_0x2dac('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index cfbd012..f5cf779 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 _0x65c9=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x5a6503,_0x4935fd){var _0x3692ab=function(_0x27c9ee){while(--_0x27c9ee){_0x5a6503['push'](_0x5a6503['shift']());}};_0x3692ab(++_0x4935fd);}(_0x65c9,0x182));var _0x965c=function(_0x5ed682,_0x3a7d4c){_0x5ed682=_0x5ed682-0x0;var _0x3024be=_0x65c9[_0x5ed682];return _0x3024be;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x965c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x965c('0x4')]('in',_0x965c('0x5')),'defaultValue':_0x965c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x965c('0x6')]},'providerName':{'type':Sequelize[_0x965c('0x7')]},'providerResponse':{'type':Sequelize[_0x965c('0x8')]}};
\ No newline at end of file
+var _0x4c71=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x3d9ec7,_0x59d1f3){var _0x500f81=function(_0x39dad8){while(--_0x39dad8){_0x3d9ec7['push'](_0x3d9ec7['shift']());}};_0x500f81(++_0x59d1f3);}(_0x4c71,0x12b));var _0x14c7=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4c71[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x14c7('0x0'));module[_0x14c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x14c7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x14c7('0x4')]('in',_0x14c7('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x14c7('0x6')]},'providerName':{'type':Sequelize[_0x14c7('0x7')]},'providerResponse':{'type':Sequelize[_0x14c7('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index caa4ecc..6654b10 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 _0x9158=['ChatMessage','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','ChatInteractionId','RejectMessage','rejectMessage','ContactId','contact','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','name','index'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x9158,0xcc));var _0x8915=function(_0xd58577,_0x4a704e){_0xd58577=_0xd58577-0x0;var _0x2dc319=_0x9158[_0xd58577];return _0x2dc319;};'use strict';var emlformat=require(_0x8915('0x0'));var rimraf=require(_0x8915('0x1'));var zipdir=require(_0x8915('0x2'));var jsonpatch=require(_0x8915('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8915('0x4'));var Mustache=require('mustache');var util=require(_0x8915('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8915('0x6'));var ejs=require(_0x8915('0x7'));var fs=require('fs');var fs_extra=require(_0x8915('0x8'));var _=require('lodash');var squel=require(_0x8915('0x9'));var crypto=require(_0x8915('0xa'));var jsforce=require(_0x8915('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8915('0x6'));var querystring=require(_0x8915('0xc'));var Papa=require(_0x8915('0xd'));var Redis=require(_0x8915('0xe'));var authService=require(_0x8915('0xf'));var qs=require(_0x8915('0x10'));var as=require(_0x8915('0x11'));var hardwareService=require(_0x8915('0x12'));var logger=require(_0x8915('0x13'))(_0x8915('0x14'));var utils=require(_0x8915('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8915('0x16'));var db=require('../../mysqldb')['db'];config[_0x8915('0x17')]=_[_0x8915('0x18')](config['redis'],{'host':_0x8915('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8915('0x17')]));require(_0x8915('0x1a'))['register'](socket);var jayson=require(_0x8915('0x1b'));var client=jayson[_0x8915('0x1c')][_0x8915('0x1d')]({'port':0x232c});var client9002=jayson[_0x8915('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x251f07,_0x545f70,_0x520004,_0xd054cc){return new BPromise(function(_0x415dd5,_0x5ae0aa){var _0x3932f3=_0xd054cc||client;return _0x3932f3[_0x8915('0x1e')](_0x251f07,_0x520004)[_0x8915('0x1f')](function(_0x25e23b){logger[_0x8915('0x20')](_0x8915('0x21'),_0x545f70,_0x8915('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x545f70,_0x8915('0x22'),JSON[_0x8915('0x23')](_0x25e23b));if(_0x25e23b['error']){if(_0x25e23b[_0x8915('0x24')][_0x8915('0x25')]===0x1f4){logger[_0x8915('0x24')]('ChatMessage,\x20%s,\x20%s',_0x545f70,_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);return _0x5ae0aa(_0x25e23b['error'][_0x8915('0x26')]);}logger[_0x8915('0x24')](_0x8915('0x21'),_0x545f70,_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);return _0x415dd5(_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);}else{logger[_0x8915('0x20')]('ChatMessage,\x20%s,\x20%s',_0x545f70,_0x8915('0x22'));_0x415dd5(_0x25e23b[_0x8915('0x27')][_0x8915('0x26')]);}})['catch'](function(_0x62f920){logger[_0x8915('0x24')](_0x8915('0x21'),_0x545f70,_0x62f920);_0x5ae0aa(_0x62f920);});});}function respondWithStatusCode(_0x637d72,_0x4bfa67){_0x4bfa67=_0x4bfa67||0xcc;return function(_0x369b65){if(_0x369b65){return _0x637d72[_0x8915('0x28')](_0x4bfa67);}return _0x637d72[_0x8915('0x29')](_0x4bfa67)['end']();};}function respondWithResult(_0x1de901,_0x42ae76){_0x42ae76=_0x42ae76||0xc8;return function(_0x3005a9){if(_0x3005a9){return _0x1de901[_0x8915('0x29')](_0x42ae76)['json'](_0x3005a9);}};}function respondWithFilteredResult(_0x3dedf2,_0x10a1e1){return function(_0x542639){if(_0x542639){var _0x1c3132=typeof _0x10a1e1[_0x8915('0x2a')]===_0x8915('0x2b')&&typeof _0x10a1e1[_0x8915('0x2c')]===_0x8915('0x2b');var _0x5400f5=_0x542639[_0x8915('0x2d')];var _0xffecec=_0x1c3132?0x0:_0x10a1e1[_0x8915('0x2a')];var _0x5f5324=_0x1c3132?_0x542639[_0x8915('0x2d')]:_0x10a1e1[_0x8915('0x2a')]+_0x10a1e1[_0x8915('0x2c')];var _0x1032e9;if(_0x5f5324>=_0x5400f5){_0x5f5324=_0x5400f5;_0x1032e9=0xc8;}else{_0x1032e9=0xce;}_0x3dedf2['status'](_0x1032e9);return _0x3dedf2[_0x8915('0x2e')]('Content-Range',_0xffecec+'-'+_0x5f5324+'/'+_0x5400f5)[_0x8915('0x2f')](_0x542639);}return null;};}function patchUpdates(_0x12a613){return function(_0x19c6a8){try{jsonpatch[_0x8915('0x30')](_0x19c6a8,_0x12a613,!![]);}catch(_0x2fd813){return BPromise[_0x8915('0x31')](_0x2fd813);}return _0x19c6a8[_0x8915('0x32')]();};}function saveUpdates(_0x3a29d7,_0xe22ef9){return function(_0x2089f8){if(_0x2089f8){return _0x2089f8[_0x8915('0x33')](_0x3a29d7)[_0x8915('0x1f')](function(_0x2210ba){return _0x2210ba;});}return null;};}function removeEntity(_0x168233,_0x538d61){return function(_0x2b7e08){if(_0x2b7e08){return _0x2b7e08[_0x8915('0x34')]()['then'](function(){_0x168233['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4116e6,_0x5c9dd6){return function(_0x509532){if(!_0x509532){_0x4116e6[_0x8915('0x28')](0x194);}return _0x509532;};}function handleError(_0x135876,_0x25726f){_0x25726f=_0x25726f||0x1f4;return function(_0x243115){logger[_0x8915('0x24')](_0x243115[_0x8915('0x35')]);if(_0x243115[_0x8915('0x36')]){delete _0x243115['name'];}_0x135876['status'](_0x25726f)['send'](_0x243115);};}exports[_0x8915('0x37')]=function(_0x7350b4,_0x1a65d1){var _0x57cf14={},_0xb7bd1d={},_0x117e6e={'count':0x0,'rows':[]};var _0x234ee9=_['map'](db[_0x8915('0x38')]['rawAttributes'],function(_0xf28aef){return{'name':_0xf28aef[_0x8915('0x39')],'type':_0xf28aef[_0x8915('0x3a')]['key']};});_0xb7bd1d[_0x8915('0x3b')]=_[_0x8915('0x3c')](_0x234ee9,_0x8915('0x36'));_0xb7bd1d[_0x8915('0x3d')]=_[_0x8915('0x3e')](_0x7350b4[_0x8915('0x3d')]);_0xb7bd1d['filters']=_[_0x8915('0x3f')](_0xb7bd1d[_0x8915('0x3b')],_0xb7bd1d['query']);_0x57cf14['attributes']=_[_0x8915('0x3f')](_0xb7bd1d[_0x8915('0x3b')],qs[_0x8915('0x40')](_0x7350b4[_0x8915('0x3d')][_0x8915('0x40')]));_0x57cf14[_0x8915('0x41')]=_0x57cf14[_0x8915('0x41')][_0x8915('0x42')]?_0x57cf14[_0x8915('0x41')]:_0xb7bd1d[_0x8915('0x3b')];if(!_0x7350b4[_0x8915('0x3d')][_0x8915('0x43')](_0x8915('0x44'))){_0x57cf14[_0x8915('0x2c')]=qs['limit'](_0x7350b4['query']['limit']);_0x57cf14[_0x8915('0x2a')]=qs['offset'](_0x7350b4[_0x8915('0x3d')]['offset']);}_0x57cf14[_0x8915('0x45')]=qs['sort'](_0x7350b4[_0x8915('0x3d')][_0x8915('0x46')]);_0x57cf14[_0x8915('0x47')]=qs[_0x8915('0x48')](_['pick'](_0x7350b4[_0x8915('0x3d')],_0xb7bd1d[_0x8915('0x48')]),_0x234ee9);if(_0x7350b4['query'][_0x8915('0x49')]){_0x57cf14[_0x8915('0x47')]=_[_0x8915('0x4a')](_0x57cf14[_0x8915('0x47')],{'$or':_[_0x8915('0x3c')](_0x234ee9,function(_0x56f25e){if(_0x56f25e['type']!==_0x8915('0x4b')){var _0x3e5949={};_0x3e5949[_0x56f25e['name']]={'$like':'%'+_0x7350b4[_0x8915('0x3d')][_0x8915('0x49')]+'%'};return _0x3e5949;}})});}_0x57cf14=_[_0x8915('0x4a')]({},_0x57cf14,_0x7350b4[_0x8915('0x4c')]);var _0x45a813={'where':_0x57cf14[_0x8915('0x47')]};return db[_0x8915('0x38')][_0x8915('0x2d')](_0x45a813)['then'](function(_0x535dca){_0x117e6e[_0x8915('0x2d')]=_0x535dca;if(_0x7350b4[_0x8915('0x3d')]['includeAll']){_0x57cf14[_0x8915('0x4d')]=[{'all':!![]}];}return db[_0x8915('0x38')][_0x8915('0x4e')](_0x57cf14);})[_0x8915('0x1f')](function(_0x35ee56){_0x117e6e[_0x8915('0x4f')]=_0x35ee56;return _0x117e6e;})['then'](respondWithFilteredResult(_0x1a65d1,_0x57cf14))[_0x8915('0x50')](handleError(_0x1a65d1,null));};exports[_0x8915('0x51')]=function(_0x5c82f4,_0x1d43e1){var _0x5eacb0={'raw':!![],'where':{'id':_0x5c82f4[_0x8915('0x52')]['id']}},_0x3d63c2={};_0x3d63c2[_0x8915('0x3b')]=_[_0x8915('0x3e')](db['ChatMessage'][_0x8915('0x53')]);_0x3d63c2['query']=_[_0x8915('0x3e')](_0x5c82f4[_0x8915('0x3d')]);_0x3d63c2[_0x8915('0x48')]=_['intersection'](_0x3d63c2[_0x8915('0x3b')],_0x3d63c2[_0x8915('0x3d')]);_0x5eacb0[_0x8915('0x41')]=_[_0x8915('0x3f')](_0x3d63c2[_0x8915('0x3b')],qs[_0x8915('0x40')](_0x5c82f4[_0x8915('0x3d')][_0x8915('0x40')]));_0x5eacb0['attributes']=_0x5eacb0['attributes']['length']?_0x5eacb0[_0x8915('0x41')]:_0x3d63c2[_0x8915('0x3b')];if(_0x5c82f4[_0x8915('0x3d')][_0x8915('0x54')]){_0x5eacb0[_0x8915('0x4d')]=[{'all':!![]}];}_0x5eacb0=_['merge']({},_0x5eacb0,_0x5c82f4[_0x8915('0x4c')]);return db[_0x8915('0x38')][_0x8915('0x55')](_0x5eacb0)[_0x8915('0x1f')](handleEntityNotFound(_0x1d43e1,null))['then'](respondWithResult(_0x1d43e1,null))[_0x8915('0x50')](handleError(_0x1d43e1,null));};exports[_0x8915('0x56')]=function(_0xa4ae81,_0x2b199b){return db[_0x8915('0x38')][_0x8915('0x56')](_0xa4ae81[_0x8915('0x57')],{})[_0x8915('0x1f')](respondWithResult(_0x2b199b,0xc9))[_0x8915('0x50')](handleError(_0x2b199b,null));};exports[_0x8915('0x33')]=function(_0x36bbab,_0x5b7028){if(_0x36bbab['body']['id']){delete _0x36bbab[_0x8915('0x57')]['id'];}return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x36bbab[_0x8915('0x52')]['id']}})[_0x8915('0x1f')](handleEntityNotFound(_0x5b7028,null))[_0x8915('0x1f')](saveUpdates(_0x36bbab[_0x8915('0x57')],null))['then'](respondWithResult(_0x5b7028,null))['catch'](handleError(_0x5b7028,null));};exports[_0x8915('0x34')]=function(_0x1f120b,_0x214309){return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x1f120b[_0x8915('0x52')]['id']}})['then'](handleEntityNotFound(_0x214309,null))[_0x8915('0x1f')](removeEntity(_0x214309,null))[_0x8915('0x50')](handleError(_0x214309,null));};exports[_0x8915('0x58')]=function(_0x3756ff,_0x3aeb7e){return db[_0x8915('0x38')][_0x8915('0x58')]()[_0x8915('0x1f')](respondWithResult(_0x3aeb7e,null))[_0x8915('0x50')](handleError(_0x3aeb7e,null));};var interaction_log=require(_0x8915('0x13'))(_0x8915('0x59'));exports['accept']=function(_0x12563b,_0x236412,_0x474c56){var _0x30fda5={'agent':{},'channel':_0x8915('0x5a')};if(_0x12563b[_0x8915('0x57')]['id']){delete _0x12563b['body']['id'];}_0x12563b[_0x8915('0x57')]['read']=!![];_0x12563b['body'][_0x8915('0x5b')]=moment()[_0x8915('0x5c')](_0x8915('0x5d'));_0x12563b[_0x8915('0x57')][_0x8915('0x5e')]=_0x12563b[_0x8915('0x57')][_0x8915('0x5e')]||_0x12563b['user']['id'];_0x30fda5[_0x8915('0x5f')]['id']=_0x12563b[_0x8915('0x57')][_0x8915('0x5e')];return db[_0x8915('0x38')]['find']({'where':{'id':_0x12563b[_0x8915('0x52')]['id'],'UserId':null}})[_0x8915('0x1f')](handleEntityNotFound(_0x236412,null))[_0x8915('0x1f')](saveUpdates(_0x12563b[_0x8915('0x57')],null))[_0x8915('0x1f')](function(_0x9900e7){if(_0x9900e7){_0x30fda5['message']=_0x9900e7[_0x8915('0x60')]({'plain':!![]});return db[_0x8915('0x61')]['find']({'where':{'id':_0x9900e7['ChatInteractionId']}});}return null;})[_0x8915('0x1f')](handleEntityNotFound(_0x236412,null))[_0x8915('0x1f')](function(_0x44b8a7){if(_0x44b8a7){return _0x44b8a7[_0x8915('0x33')]({'UserId':_0x12563b[_0x8915('0x57')][_0x8915('0x5e')],'read1stAt':_[_0x8915('0x62')](_0x44b8a7[_0x8915('0x63')])?moment()[_0x8915('0x5c')](_0x8915('0x5d')):undefined});}return null;})[_0x8915('0x1f')](function(_0x2e4241){if(_0x2e4241){_0x30fda5[_0x8915('0x64')]=_0x2e4241[_0x8915('0x60')]({'plain':!![]});interaction_log[_0x8915('0x20')](_0x8915('0x65'),_0x12563b[_0x8915('0x66')]['id'],_0x12563b[_0x8915('0x66')][_0x8915('0x36')],_0x12563b['user'][_0x8915('0x67')],_0x30fda5[_0x8915('0x64')]['id'],_0x12563b[_0x8915('0x57')]?JSON[_0x8915('0x23')](_0x12563b['body']):'null');return respondWithRpcPromise(_0x8915('0x68'),_0x8915('0x69'),_0x30fda5);}return null;})[_0x8915('0x1f')](function(_0x3a177c){var _0x55fb40=_0x8915('0x6a')+_0x3a177c[_0x8915('0x26')]['ContactId'];return db[_0x8915('0x6b')][_0x8915('0x3d')](_0x55fb40,{'type':db[_0x8915('0x6c')][_0x8915('0x6d')][_0x8915('0x6e')],'raw':!![]})[_0x8915('0x1f')](function(_0x400f62){return _0x400f62;});})[_0x8915('0x1f')](function(_0x7ce557){if(_0x7ce557){_0x30fda5[_0x8915('0x26')]['contact']=_0x7ce557[0x0];if(!_0x12563b[_0x8915('0x57')][_0x8915('0x5e')])return;return db[_0x8915('0x6f')][_0x8915('0x55')]({'where':{'id':_0x12563b[_0x8915('0x57')][_0x8915('0x5e')],'role':_0x8915('0x5f')},'attributes':['id',_0x8915('0x36'),_0x8915('0x70'),_0x8915('0x71'),_0x8915('0x72')],'raw':!![]});}return null;})[_0x8915('0x1f')](function(_0x19210e){if(!_0x19210e)return null;_0x30fda5['message'][_0x8915('0x5f')]=_0x19210e;return _0x30fda5;})[_0x8915('0x1f')](function(_0x570536){if(_0x570536){if(_0x12563b[_0x8915('0x57')][_0x8915('0x73')]){_0x30fda5[_0x8915('0x26')][_0x8915('0x74')]=util[_0x8915('0x5c')](_0x8915('0x75'),_0x12563b[_0x8915('0x66')][_0x8915('0x36')]);_0x30fda5[_0x8915('0x26')][_0x8915('0x76')]=_0x30fda5[_0x8915('0x76')];_0x30fda5['message']['motionChannel']=_0x30fda5['channel'];_0x30fda5[_0x8915('0x26')][_0x8915('0x77')]='accept';return respondWithRpcPromise(_0x8915('0x78'),'EventManager',{'event':_0x8915('0x79'),'message':_[_0x8915('0x4a')](_0x30fda5[_0x8915('0x26')],JSON[_0x8915('0x7a')](_0x30fda5[_0x8915('0x64')]['formData']))},client9002)[_0x8915('0x1f')](function(){return _0x30fda5;});}return _0x30fda5;}return null;})['then'](respondWithResult(_0x236412,null))[_0x8915('0x50')](handleError(_0x236412,null));};var interaction_log=require(_0x8915('0x13'))(_0x8915('0x59'));exports['reject']=function(_0x31135c,_0x595a02,_0x7a587c){var _0x4e4dc8={'agent':{},'channel':_0x8915('0x5a')};if(_0x31135c[_0x8915('0x57')]['id']){delete _0x31135c[_0x8915('0x57')]['id'];}_0x31135c[_0x8915('0x57')][_0x8915('0x5e')]=_0x31135c[_0x8915('0x57')][_0x8915('0x5e')]||_0x31135c[_0x8915('0x66')]['id'];_0x4e4dc8[_0x8915('0x5f')]['id']=_0x31135c['body'][_0x8915('0x5e')];return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x31135c[_0x8915('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x595a02,null))[_0x8915('0x1f')](function(_0x192a44){if(_0x192a44){_0x4e4dc8[_0x8915('0x26')]=_0x192a44['get']({'plain':!![]});return db[_0x8915('0x61')][_0x8915('0x55')]({'where':{'id':_0x192a44[_0x8915('0x7b')]}});}return null;})[_0x8915('0x1f')](handleEntityNotFound(_0x595a02,null))[_0x8915('0x1f')](function(_0x20e03a){if(_0x20e03a){_0x4e4dc8[_0x8915('0x64')]=_0x20e03a[_0x8915('0x60')]({'plain':!![]});interaction_log[_0x8915('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31135c[_0x8915('0x66')]['id'],_0x31135c[_0x8915('0x66')][_0x8915('0x36')],_0x31135c[_0x8915('0x66')][_0x8915('0x67')],_0x4e4dc8[_0x8915('0x64')]['id'],_0x31135c[_0x8915('0x57')]?JSON['stringify'](_0x31135c['body']):'null');return respondWithRpcPromise(_0x8915('0x7c'),_0x8915('0x7d'),_0x4e4dc8);}return null;})['then'](function(_0x17c8c5){var _0x19da56='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17c8c5[_0x8915('0x26')][_0x8915('0x7e')];return db[_0x8915('0x6b')]['query'](_0x19da56,{'type':db['Sequelize'][_0x8915('0x6d')][_0x8915('0x6e')],'raw':!![]})[_0x8915('0x1f')](function(_0x551855){return _0x551855;});})[_0x8915('0x1f')](function(_0x58a4fc){if(_0x58a4fc){_0x4e4dc8[_0x8915('0x26')][_0x8915('0x7f')]=_0x58a4fc[0x0];if(!_0x31135c[_0x8915('0x57')]['UserId'])return;return db[_0x8915('0x6f')][_0x8915('0x55')]({'where':{'id':_0x31135c['body'][_0x8915('0x5e')],'role':_0x8915('0x5f')},'attributes':['id',_0x8915('0x36'),_0x8915('0x70'),'email',_0x8915('0x72')],'raw':!![]});}return null;})['then'](function(_0x242267){if(!_0x242267)return null;_0x4e4dc8[_0x8915('0x26')][_0x8915('0x5f')]=_0x242267;return _0x4e4dc8;})[_0x8915('0x1f')](function(_0x5aefdf){if(_0x5aefdf){_0x5aefdf[_0x8915('0x26')][_0x8915('0x74')]=util['format']('SIP/%s',_0x31135c['user'][_0x8915('0x36')]);_0x5aefdf[_0x8915('0x26')]['channel']=_0x4e4dc8[_0x8915('0x76')];_0x5aefdf[_0x8915('0x26')][_0x8915('0x80')]=_0x4e4dc8[_0x8915('0x76')];_0x5aefdf['message'][_0x8915('0x77')]=_0x8915('0x31');respondWithRpcPromise(_0x8915('0x78'),'EventManager',{'event':_0x8915('0x81'),'message':_[_0x8915('0x4a')](_0x4e4dc8['message'],JSON[_0x8915('0x7a')](_0x4e4dc8[_0x8915('0x64')]['formData']))},client9002);return _0x4e4dc8;}return null;})[_0x8915('0x1f')](respondWithResult(_0x595a02,null))[_0x8915('0x50')](handleError(_0x595a02,null));};
\ No newline at end of file
+var _0xbae0=['fullname','internal','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','email','interface','rejectmessage','parse','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','sendStatus','name','send','map','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','ChatMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User'];(function(_0x1e3aac,_0x5118ba){var _0x4e72d0=function(_0x15648c){while(--_0x15648c){_0x1e3aac['push'](_0x1e3aac['shift']());}};_0x4e72d0(++_0x5118ba);}(_0xbae0,0x198));var _0x0bae=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xbae0[_0x2c0dc0];return _0x4c0990;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bae('0x0'));var zipdir=require(_0x0bae('0x1'));var jsonpatch=require(_0x0bae('0x2'));var rp=require('request-promise');var moment=require(_0x0bae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bae('0x4'));var util=require(_0x0bae('0x5'));var path=require(_0x0bae('0x6'));var sox=require(_0x0bae('0x7'));var csv=require(_0x0bae('0x8'));var ejs=require(_0x0bae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bae('0xa'));var squel=require(_0x0bae('0xb'));var crypto=require('crypto');var jsforce=require(_0x0bae('0xc'));var deskjs=require(_0x0bae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0bae('0xe'));var Papa=require(_0x0bae('0xf'));var Redis=require(_0x0bae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0bae('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bae('0x12'))(_0x0bae('0x13'));var utils=require(_0x0bae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0bae('0x15'))['db'];config[_0x0bae('0x16')]=_[_0x0bae('0x17')](config[_0x0bae('0x16')],{'host':_0x0bae('0x18'),'port':0x18eb});var socket=require(_0x0bae('0x19'))(new Redis(config[_0x0bae('0x16')]));require(_0x0bae('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0bae('0x1b')][_0x0bae('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59863d,_0x47532d,_0x3339b1,_0x18d4fb){return new BPromise(function(_0x1fc5d0,_0x29b2e4){var _0x2503ea=_0x18d4fb||client;return _0x2503ea[_0x0bae('0x1d')](_0x59863d,_0x3339b1)[_0x0bae('0x1e')](function(_0x4ab4ae){logger[_0x0bae('0x1f')](_0x0bae('0x20'),_0x47532d,_0x0bae('0x21'));logger[_0x0bae('0x22')](_0x0bae('0x23'),_0x47532d,_0x0bae('0x21'),JSON[_0x0bae('0x24')](_0x4ab4ae));if(_0x4ab4ae[_0x0bae('0x25')]){if(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x26')]===0x1f4){logger['error'](_0x0bae('0x20'),_0x47532d,_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);return _0x29b2e4(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);}logger[_0x0bae('0x25')](_0x0bae('0x20'),_0x47532d,_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);return _0x1fc5d0(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);}else{logger[_0x0bae('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x47532d,_0x0bae('0x21'));_0x1fc5d0(_0x4ab4ae[_0x0bae('0x28')][_0x0bae('0x27')]);}})['catch'](function(_0x5c681c){logger[_0x0bae('0x25')](_0x0bae('0x20'),_0x47532d,_0x5c681c);_0x29b2e4(_0x5c681c);});});}function respondWithStatusCode(_0x2fbf18,_0xec47e1){_0xec47e1=_0xec47e1||0xcc;return function(_0x928f78){if(_0x928f78){return _0x2fbf18['sendStatus'](_0xec47e1);}return _0x2fbf18['status'](_0xec47e1)[_0x0bae('0x29')]();};}function respondWithResult(_0x451b59,_0x4b39e3){_0x4b39e3=_0x4b39e3||0xc8;return function(_0x4a5ca6){if(_0x4a5ca6){return _0x451b59[_0x0bae('0x2a')](_0x4b39e3)[_0x0bae('0x2b')](_0x4a5ca6);}};}function respondWithFilteredResult(_0x30e5b5,_0x2bfca5){return function(_0x5f71e6){if(_0x5f71e6){var _0x253647=typeof _0x2bfca5['offset']===_0x0bae('0x2c')&&typeof _0x2bfca5[_0x0bae('0x2d')]===_0x0bae('0x2c');var _0x774b09=_0x5f71e6[_0x0bae('0x2e')];var _0x27d9e7=_0x253647?0x0:_0x2bfca5[_0x0bae('0x2f')];var _0x4494da=_0x253647?_0x5f71e6[_0x0bae('0x2e')]:_0x2bfca5[_0x0bae('0x2f')]+_0x2bfca5[_0x0bae('0x2d')];var _0x13941e;if(_0x4494da>=_0x774b09){_0x4494da=_0x774b09;_0x13941e=0xc8;}else{_0x13941e=0xce;}_0x30e5b5['status'](_0x13941e);return _0x30e5b5[_0x0bae('0x30')](_0x0bae('0x31'),_0x27d9e7+'-'+_0x4494da+'/'+_0x774b09)[_0x0bae('0x2b')](_0x5f71e6);}return null;};}function patchUpdates(_0x39b9c3){return function(_0x566f5c){try{jsonpatch['apply'](_0x566f5c,_0x39b9c3,!![]);}catch(_0x3989e8){return BPromise[_0x0bae('0x32')](_0x3989e8);}return _0x566f5c[_0x0bae('0x33')]();};}function saveUpdates(_0x468075,_0x378d02){return function(_0x213c9c){if(_0x213c9c){return _0x213c9c[_0x0bae('0x34')](_0x468075)[_0x0bae('0x1e')](function(_0x49179c){return _0x49179c;});}return null;};}function removeEntity(_0x16a51f,_0xb7ee57){return function(_0x23b688){if(_0x23b688){return _0x23b688[_0x0bae('0x35')]()[_0x0bae('0x1e')](function(){_0x16a51f[_0x0bae('0x2a')](0xcc)[_0x0bae('0x29')]();});}};}function handleEntityNotFound(_0x50ea7c,_0x4ae12f){return function(_0x505e0d){if(!_0x505e0d){_0x50ea7c[_0x0bae('0x36')](0x194);}return _0x505e0d;};}function handleError(_0x1cd2f2,_0x6d5d68){_0x6d5d68=_0x6d5d68||0x1f4;return function(_0x31ee1e){logger[_0x0bae('0x25')](_0x31ee1e['stack']);if(_0x31ee1e[_0x0bae('0x37')]){delete _0x31ee1e[_0x0bae('0x37')];}_0x1cd2f2[_0x0bae('0x2a')](_0x6d5d68)[_0x0bae('0x38')](_0x31ee1e);};}exports['index']=function(_0x54ed09,_0x4d3a13){var _0x3a2af3={},_0x24e3e1={},_0x3e8d93={'count':0x0,'rows':[]};var _0x455869=_[_0x0bae('0x39')](db['ChatMessage']['rawAttributes'],function(_0x590e49){return{'name':_0x590e49['fieldName'],'type':_0x590e49['type'][_0x0bae('0x3a')]};});_0x24e3e1[_0x0bae('0x3b')]=_[_0x0bae('0x39')](_0x455869,_0x0bae('0x37'));_0x24e3e1['query']=_[_0x0bae('0x3c')](_0x54ed09[_0x0bae('0x3d')]);_0x24e3e1[_0x0bae('0x3e')]=_[_0x0bae('0x3f')](_0x24e3e1['model'],_0x24e3e1[_0x0bae('0x3d')]);_0x3a2af3['attributes']=_[_0x0bae('0x3f')](_0x24e3e1['model'],qs[_0x0bae('0x40')](_0x54ed09[_0x0bae('0x3d')]['fields']));_0x3a2af3['attributes']=_0x3a2af3[_0x0bae('0x41')]['length']?_0x3a2af3['attributes']:_0x24e3e1[_0x0bae('0x3b')];if(!_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x42')]('nolimit')){_0x3a2af3[_0x0bae('0x2d')]=qs[_0x0bae('0x2d')](_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x2d')]);_0x3a2af3[_0x0bae('0x2f')]=qs[_0x0bae('0x2f')](_0x54ed09['query'][_0x0bae('0x2f')]);}_0x3a2af3[_0x0bae('0x43')]=qs['sort'](_0x54ed09['query'][_0x0bae('0x44')]);_0x3a2af3[_0x0bae('0x45')]=qs[_0x0bae('0x3e')](_[_0x0bae('0x46')](_0x54ed09[_0x0bae('0x3d')],_0x24e3e1[_0x0bae('0x3e')]),_0x455869);if(_0x54ed09['query']['filter']){_0x3a2af3['where']=_[_0x0bae('0x47')](_0x3a2af3['where'],{'$or':_['map'](_0x455869,function(_0x327dd2){if(_0x327dd2[_0x0bae('0x48')]!==_0x0bae('0x49')){var _0x2ca4be={};_0x2ca4be[_0x327dd2[_0x0bae('0x37')]]={'$like':'%'+_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x4a')]+'%'};return _0x2ca4be;}})});}_0x3a2af3=_[_0x0bae('0x47')]({},_0x3a2af3,_0x54ed09['options']);var _0x1efe2d={'where':_0x3a2af3[_0x0bae('0x45')]};return db[_0x0bae('0x4b')]['count'](_0x1efe2d)['then'](function(_0x6a49b1){_0x3e8d93['count']=_0x6a49b1;if(_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x4c')]){_0x3a2af3[_0x0bae('0x4d')]=[{'all':!![]}];}return db[_0x0bae('0x4b')][_0x0bae('0x4e')](_0x3a2af3);})[_0x0bae('0x1e')](function(_0xca3ec5){_0x3e8d93[_0x0bae('0x4f')]=_0xca3ec5;return _0x3e8d93;})[_0x0bae('0x1e')](respondWithFilteredResult(_0x4d3a13,_0x3a2af3))[_0x0bae('0x50')](handleError(_0x4d3a13,null));};exports[_0x0bae('0x51')]=function(_0x398bff,_0x14e0c8){var _0x514e26={'raw':!![],'where':{'id':_0x398bff[_0x0bae('0x52')]['id']}},_0x3ff432={};_0x3ff432[_0x0bae('0x3b')]=_['keys'](db[_0x0bae('0x4b')][_0x0bae('0x53')]);_0x3ff432[_0x0bae('0x3d')]=_[_0x0bae('0x3c')](_0x398bff[_0x0bae('0x3d')]);_0x3ff432[_0x0bae('0x3e')]=_[_0x0bae('0x3f')](_0x3ff432[_0x0bae('0x3b')],_0x3ff432[_0x0bae('0x3d')]);_0x514e26[_0x0bae('0x41')]=_['intersection'](_0x3ff432['model'],qs['fields'](_0x398bff[_0x0bae('0x3d')][_0x0bae('0x40')]));_0x514e26[_0x0bae('0x41')]=_0x514e26['attributes'][_0x0bae('0x54')]?_0x514e26['attributes']:_0x3ff432[_0x0bae('0x3b')];if(_0x398bff[_0x0bae('0x3d')][_0x0bae('0x4c')]){_0x514e26[_0x0bae('0x4d')]=[{'all':!![]}];}_0x514e26=_[_0x0bae('0x47')]({},_0x514e26,_0x398bff[_0x0bae('0x55')]);return db[_0x0bae('0x4b')][_0x0bae('0x56')](_0x514e26)[_0x0bae('0x1e')](handleEntityNotFound(_0x14e0c8,null))[_0x0bae('0x1e')](respondWithResult(_0x14e0c8,null))[_0x0bae('0x50')](handleError(_0x14e0c8,null));};exports[_0x0bae('0x57')]=function(_0x5b1a15,_0x501a4b){return db[_0x0bae('0x4b')]['create'](_0x5b1a15[_0x0bae('0x58')],{})[_0x0bae('0x1e')](respondWithResult(_0x501a4b,0xc9))[_0x0bae('0x50')](handleError(_0x501a4b,null));};exports[_0x0bae('0x34')]=function(_0x4d0876,_0xba0e87){if(_0x4d0876[_0x0bae('0x58')]['id']){delete _0x4d0876[_0x0bae('0x58')]['id'];}return db['ChatMessage'][_0x0bae('0x56')]({'where':{'id':_0x4d0876[_0x0bae('0x52')]['id']}})[_0x0bae('0x1e')](handleEntityNotFound(_0xba0e87,null))[_0x0bae('0x1e')](saveUpdates(_0x4d0876['body'],null))[_0x0bae('0x1e')](respondWithResult(_0xba0e87,null))[_0x0bae('0x50')](handleError(_0xba0e87,null));};exports[_0x0bae('0x35')]=function(_0x321a67,_0x861fee){return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x321a67['params']['id']}})['then'](handleEntityNotFound(_0x861fee,null))['then'](removeEntity(_0x861fee,null))[_0x0bae('0x50')](handleError(_0x861fee,null));};exports[_0x0bae('0x59')]=function(_0x99e466,_0x5139fa){return db[_0x0bae('0x4b')][_0x0bae('0x59')]()[_0x0bae('0x1e')](respondWithResult(_0x5139fa,null))['catch'](handleError(_0x5139fa,null));};var interaction_log=require(_0x0bae('0x12'))(_0x0bae('0x5a'));exports[_0x0bae('0x5b')]=function(_0x135285,_0x439d3a,_0x52d067){var _0x172591={'agent':{},'channel':_0x0bae('0x5c')};if(_0x135285[_0x0bae('0x58')]['id']){delete _0x135285[_0x0bae('0x58')]['id'];}_0x135285['body'][_0x0bae('0x5d')]=!![];_0x135285[_0x0bae('0x58')][_0x0bae('0x5e')]=moment()[_0x0bae('0x5f')](_0x0bae('0x60'));_0x135285['body'][_0x0bae('0x61')]=_0x135285[_0x0bae('0x58')]['UserId']||_0x135285[_0x0bae('0x62')]['id'];_0x172591[_0x0bae('0x63')]['id']=_0x135285[_0x0bae('0x58')]['UserId'];return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x135285['params']['id'],'UserId':null}})[_0x0bae('0x1e')](handleEntityNotFound(_0x439d3a,null))[_0x0bae('0x1e')](saveUpdates(_0x135285[_0x0bae('0x58')],null))[_0x0bae('0x1e')](function(_0x485178){if(_0x485178){_0x172591[_0x0bae('0x27')]=_0x485178[_0x0bae('0x64')]({'plain':!![]});return db[_0x0bae('0x65')][_0x0bae('0x56')]({'where':{'id':_0x485178[_0x0bae('0x66')]}});}return null;})[_0x0bae('0x1e')](handleEntityNotFound(_0x439d3a,null))[_0x0bae('0x1e')](function(_0x6a1dc9){if(_0x6a1dc9){return _0x6a1dc9[_0x0bae('0x34')]({'UserId':_0x135285[_0x0bae('0x58')]['UserId'],'read1stAt':_[_0x0bae('0x67')](_0x6a1dc9[_0x0bae('0x68')])?moment()[_0x0bae('0x5f')](_0x0bae('0x60')):undefined});}return null;})[_0x0bae('0x1e')](function(_0x249608){if(_0x249608){_0x172591[_0x0bae('0x69')]=_0x249608['get']({'plain':!![]});interaction_log[_0x0bae('0x1f')](_0x0bae('0x6a'),_0x135285[_0x0bae('0x62')]['id'],_0x135285[_0x0bae('0x62')][_0x0bae('0x37')],_0x135285[_0x0bae('0x62')][_0x0bae('0x6b')],_0x172591[_0x0bae('0x69')]['id'],_0x135285[_0x0bae('0x58')]?JSON[_0x0bae('0x24')](_0x135285['body']):_0x0bae('0x6c'));return respondWithRpcPromise(_0x0bae('0x6d'),'acceptMessage',_0x172591);}return null;})[_0x0bae('0x1e')](function(_0x409c0d){var _0x2a05c3=_0x0bae('0x6e')+_0x409c0d['message'][_0x0bae('0x6f')];return db[_0x0bae('0x70')][_0x0bae('0x3d')](_0x2a05c3,{'type':db['Sequelize'][_0x0bae('0x71')]['SELECT'],'raw':!![]})[_0x0bae('0x1e')](function(_0x57307c){return _0x57307c;});})[_0x0bae('0x1e')](function(_0x4d0c34){if(_0x4d0c34){_0x172591['message'][_0x0bae('0x72')]=_0x4d0c34[0x0];if(!_0x135285['body'][_0x0bae('0x61')])return;return db[_0x0bae('0x73')][_0x0bae('0x56')]({'where':{'id':_0x135285['body'][_0x0bae('0x61')],'role':'agent'},'attributes':['id',_0x0bae('0x37'),_0x0bae('0x74'),'email',_0x0bae('0x75')],'raw':!![]});}return null;})[_0x0bae('0x1e')](function(_0x877096){if(!_0x877096)return null;_0x172591[_0x0bae('0x27')]['agent']=_0x877096;return _0x172591;})[_0x0bae('0x1e')](function(_0x4b17ac){if(_0x4b17ac){if(_0x135285[_0x0bae('0x58')]['manual']){_0x172591['message']['interface']=util['format']('SIP/%s',_0x135285[_0x0bae('0x62')][_0x0bae('0x37')]);_0x172591[_0x0bae('0x27')][_0x0bae('0x76')]=_0x172591[_0x0bae('0x76')];_0x172591[_0x0bae('0x27')][_0x0bae('0x77')]=_0x172591[_0x0bae('0x76')];_0x172591[_0x0bae('0x27')][_0x0bae('0x78')]=_0x0bae('0x5b');return respondWithRpcPromise(_0x0bae('0x79'),_0x0bae('0x79'),{'event':_0x0bae('0x7a'),'message':_[_0x0bae('0x47')](_0x172591[_0x0bae('0x27')],JSON['parse'](_0x172591[_0x0bae('0x69')][_0x0bae('0x7b')]))},client9002)['then'](function(){return _0x172591;});}return _0x172591;}return null;})[_0x0bae('0x1e')](respondWithResult(_0x439d3a,null))[_0x0bae('0x50')](handleError(_0x439d3a,null));};var interaction_log=require(_0x0bae('0x12'))(_0x0bae('0x5a'));exports[_0x0bae('0x32')]=function(_0x3700b5,_0x18ce9c,_0x5f0489){var _0x2d168d={'agent':{},'channel':_0x0bae('0x5c')};if(_0x3700b5['body']['id']){delete _0x3700b5['body']['id'];}_0x3700b5[_0x0bae('0x58')]['UserId']=_0x3700b5['body']['UserId']||_0x3700b5[_0x0bae('0x62')]['id'];_0x2d168d[_0x0bae('0x63')]['id']=_0x3700b5[_0x0bae('0x58')][_0x0bae('0x61')];return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x3700b5[_0x0bae('0x52')]['id'],'UserId':null}})[_0x0bae('0x1e')](handleEntityNotFound(_0x18ce9c,null))[_0x0bae('0x1e')](function(_0x2ce5e2){if(_0x2ce5e2){_0x2d168d[_0x0bae('0x27')]=_0x2ce5e2['get']({'plain':!![]});return db[_0x0bae('0x65')][_0x0bae('0x56')]({'where':{'id':_0x2ce5e2['ChatInteractionId']}});}return null;})[_0x0bae('0x1e')](handleEntityNotFound(_0x18ce9c,null))['then'](function(_0x1d436e){if(_0x1d436e){_0x2d168d[_0x0bae('0x69')]=_0x1d436e[_0x0bae('0x64')]({'plain':!![]});interaction_log[_0x0bae('0x1f')](_0x0bae('0x7c'),_0x3700b5['user']['id'],_0x3700b5['user'][_0x0bae('0x37')],_0x3700b5[_0x0bae('0x62')][_0x0bae('0x6b')],_0x2d168d[_0x0bae('0x69')]['id'],_0x3700b5[_0x0bae('0x58')]?JSON[_0x0bae('0x24')](_0x3700b5[_0x0bae('0x58')]):_0x0bae('0x6c'));return respondWithRpcPromise('RejectMessage',_0x0bae('0x7d'),_0x2d168d);}return null;})[_0x0bae('0x1e')](function(_0x541cd3){var _0x17db3c=_0x0bae('0x6e')+_0x541cd3['message'][_0x0bae('0x6f')];return db[_0x0bae('0x70')]['query'](_0x17db3c,{'type':db['Sequelize'][_0x0bae('0x71')][_0x0bae('0x7e')],'raw':!![]})['then'](function(_0xbc6b6d){return _0xbc6b6d;});})[_0x0bae('0x1e')](function(_0x206328){if(_0x206328){_0x2d168d[_0x0bae('0x27')]['contact']=_0x206328[0x0];if(!_0x3700b5['body'][_0x0bae('0x61')])return;return db[_0x0bae('0x73')][_0x0bae('0x56')]({'where':{'id':_0x3700b5[_0x0bae('0x58')][_0x0bae('0x61')],'role':_0x0bae('0x63')},'attributes':['id',_0x0bae('0x37'),'fullname',_0x0bae('0x7f'),_0x0bae('0x75')],'raw':!![]});}return null;})['then'](function(_0x37acfe){if(!_0x37acfe)return null;_0x2d168d[_0x0bae('0x27')][_0x0bae('0x63')]=_0x37acfe;return _0x2d168d;})[_0x0bae('0x1e')](function(_0x4892c8){if(_0x4892c8){_0x4892c8[_0x0bae('0x27')][_0x0bae('0x80')]=util[_0x0bae('0x5f')]('SIP/%s',_0x3700b5[_0x0bae('0x62')]['name']);_0x4892c8[_0x0bae('0x27')][_0x0bae('0x76')]=_0x2d168d[_0x0bae('0x76')];_0x4892c8[_0x0bae('0x27')][_0x0bae('0x77')]=_0x2d168d[_0x0bae('0x76')];_0x4892c8[_0x0bae('0x27')][_0x0bae('0x78')]=_0x0bae('0x32');respondWithRpcPromise('EventManager',_0x0bae('0x79'),{'event':_0x0bae('0x81'),'message':_[_0x0bae('0x47')](_0x2d168d[_0x0bae('0x27')],JSON[_0x0bae('0x82')](_0x2d168d[_0x0bae('0x69')][_0x0bae('0x7b')]))},client9002);return _0x2d168d;}return null;})['then'](respondWithResult(_0x18ce9c,null))[_0x0bae('0x50')](handleError(_0x18ce9c,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index bbe86aa..1010557 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 _0x4e3b=['setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0x4e3b,0x175));var _0xb4e3=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x4e3b[_0x1fcaf1];return _0x55f464;};'use strict';var EventEmitter=require(_0xb4e3('0x0'));var ChatMessage=require(_0xb4e3('0x1'))['db'][_0xb4e3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb4e3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4e3('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe6c91a){return function(_0x370963,_0x315d1a,_0x547e66){ChatMessageEvents[_0xb4e3('0x5')](_0xe6c91a+':'+_0x370963['id'],_0x370963);ChatMessageEvents[_0xb4e3('0x5')](_0xe6c91a,_0x370963);_0x547e66(null);};}for(var e in events){if(events[_0xb4e3('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xb4e3('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xfbc5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','ChatMessage'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xfbc5,0xdf));var _0x5fbc=function(_0x4df3bb,_0x5aef0b){_0x4df3bb=_0x4df3bb-0x0;var _0x58c001=_0xfbc5[_0x4df3bb];return _0x58c001;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x5fbc('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5fbc('0x1')](0x0);var events={'afterCreate':_0x5fbc('0x2'),'afterUpdate':_0x5fbc('0x3'),'afterDestroy':_0x5fbc('0x4')};function emitEvent(_0x36dee7){return function(_0x53f1dc,_0x29b65d,_0x5229b4){ChatMessageEvents[_0x5fbc('0x5')](_0x36dee7+':'+_0x53f1dc['id'],_0x53f1dc);ChatMessageEvents[_0x5fbc('0x5')](_0x36dee7,_0x53f1dc);_0x5229b4(null);};}for(var e in events){if(events[_0x5fbc('0x6')](e)){var event=events[e];ChatMessage[_0x5fbc('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index cb8cd90..e64a346 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 _0xd9ca=['UserId','ChatInteraction','ChatInteractionId','then','createdAt','direction','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','fti_chat_messages','body','models','toLowerCase','secret','isNil'];(function(_0x33d608,_0x3a299b){var _0x4cd78a=function(_0x5ed735){while(--_0x5ed735){_0x33d608['push'](_0x33d608['shift']());}};_0x4cd78a(++_0x3a299b);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x337717,_0x3c4288){_0x337717=_0x337717-0x0;var _0x35bf96=_0xd9ca[_0x337717];return _0x35bf96;};'use strict';var _=require(_0xad9c('0x0'));var util=require(_0xad9c('0x1'));var logger=require(_0xad9c('0x2'))('api');var moment=require(_0xad9c('0x3'));var BPromise=require(_0xad9c('0x4'));var rp=require(_0xad9c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad9c('0x6'));var config=require(_0xad9c('0x7'));var attributes=require('./chatMessage.attributes');module[_0xad9c('0x8')]=function(_0x42b0b9,_0xe37208){return _0x42b0b9[_0xad9c('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xad9c('0xa'),'fields':[_0xad9c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x89de23,_0x1d0aa5,_0x4f0323){var _0x4f580a=_0x42b0b9[_0xad9c('0xc')];var _0x354fac=_0x89de23['get']({'plain':!![]});if(_0x354fac['direction']['toLowerCase']()==='in'||_0x354fac['direction'][_0xad9c('0xd')]()==='out'&&!_0x354fac[_0xad9c('0xe')]&&!_[_0xad9c('0xf')](_0x354fac[_0xad9c('0x10')])){_0x4f580a[_0xad9c('0x11')]['findOne']({'where':{'id':_0x354fac[_0xad9c('0x12')]}})[_0xad9c('0x13')](function(_0x3a8615){if(_0x3a8615){_0x3a8615['update']({'lastMsgAt':_0x354fac[_0xad9c('0x14')],'lastMsgDirection':_0x354fac[_0xad9c('0x15')][_0xad9c('0xd')]()});}})['catch'](function(_0x2c13c0){console[_0xad9c('0x16')](_0x2c13c0);});}_0x4f0323();}},'charset':_0xad9c('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1bdf=['UserId','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x1bdf,0x15e));var _0xf1bd=function(_0x8e73ee,_0x3d0eb3){_0x8e73ee=_0x8e73ee-0x0;var _0x1e812a=_0x1bdf[_0x8e73ee];return _0x1e812a;};'use strict';var _=require(_0xf1bd('0x0'));var util=require('util');var logger=require(_0xf1bd('0x1'))(_0xf1bd('0x2'));var moment=require(_0xf1bd('0x3'));var BPromise=require(_0xf1bd('0x4'));var rp=require(_0xf1bd('0x5'));var fs=require('fs');var path=require(_0xf1bd('0x6'));var rimraf=require(_0xf1bd('0x7'));var config=require(_0xf1bd('0x8'));var attributes=require('./chatMessage.attributes');module[_0xf1bd('0x9')]=function(_0x3b300c,_0xb39866){return _0x3b300c['define'](_0xf1bd('0xa'),attributes,{'tableName':_0xf1bd('0xb'),'paranoid':![],'indexes':[{'name':_0xf1bd('0xc'),'fields':[_0xf1bd('0xd')],'type':_0xf1bd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x312083,_0x3e8cd4,_0x2bcba9){var _0x439d07=_0x3b300c[_0xf1bd('0xf')];var _0xad44d5=_0x312083[_0xf1bd('0x10')]({'plain':!![]});if(_0xad44d5[_0xf1bd('0x11')][_0xf1bd('0x12')]()==='in'||_0xad44d5[_0xf1bd('0x11')]['toLowerCase']()===_0xf1bd('0x13')&&!_0xad44d5[_0xf1bd('0x14')]&&!_[_0xf1bd('0x15')](_0xad44d5[_0xf1bd('0x16')])){_0x439d07['ChatInteraction'][_0xf1bd('0x17')]({'where':{'id':_0xad44d5[_0xf1bd('0x18')]}})[_0xf1bd('0x19')](function(_0x206788){if(_0x206788){_0x206788[_0xf1bd('0x1a')]({'lastMsgAt':_0xad44d5[_0xf1bd('0x1b')],'lastMsgDirection':_0xad44d5[_0xf1bd('0x11')]['toLowerCase']()});}})['catch'](function(_0x32b16e){console[_0xf1bd('0x1c')](_0x32b16e);});}_0x2bcba9();}},'charset':_0xf1bd('0x1d'),'collate':_0xf1bd('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index ea5ad94..70c068d 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 _0xdccf=['then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0xdccf,0x95));var _0xfdcc=function(_0x32fa44,_0xfb5e6a){_0x32fa44=_0x32fa44-0x0;var _0x47c603=_0xdccf[_0x32fa44];return _0x47c603;};'use strict';var _=require(_0xfdcc('0x0'));var util=require(_0xfdcc('0x1'));var moment=require('moment');var BPromise=require(_0xfdcc('0x2'));var rs=require(_0xfdcc('0x3'));var fs=require('fs');var Redis=require(_0xfdcc('0x4'));var db=require(_0xfdcc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfdcc('0x6'))(_0xfdcc('0x7'));var config=require(_0xfdcc('0x8'));var jayson=require(_0xfdcc('0x9'));var client=jayson[_0xfdcc('0xa')][_0xfdcc('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfdcc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdcc('0xd'))(new Redis(config[_0xfdcc('0xc')]));require(_0xfdcc('0xe'))[_0xfdcc('0xf')](socket);function respondWithRpcPromise(_0x5ba2c8,_0x14f89d,_0x515fe1){return new BPromise(function(_0x516d23,_0x28aa0e){return client['request'](_0x5ba2c8,_0x515fe1)[_0xfdcc('0x10')](function(_0x1595f9){logger[_0xfdcc('0x11')](_0xfdcc('0x12'),_0x14f89d,_0xfdcc('0x13'));logger[_0xfdcc('0x14')](_0xfdcc('0x15'),_0x14f89d,_0xfdcc('0x13'),JSON[_0xfdcc('0x16')](_0x1595f9));if(_0x1595f9[_0xfdcc('0x17')]){if(_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x18')]===0x1f4){logger[_0xfdcc('0x17')]('ChatMessage,\x20%s,\x20%s',_0x14f89d,_0x1595f9['error'][_0xfdcc('0x19')]);return _0x28aa0e(_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x19')]);}logger[_0xfdcc('0x17')](_0xfdcc('0x12'),_0x14f89d,_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x19')]);return _0x516d23(_0x1595f9['error'][_0xfdcc('0x19')]);}else{logger[_0xfdcc('0x11')]('ChatMessage,\x20%s,\x20%s',_0x14f89d,'request\x20sent');_0x516d23(_0x1595f9[_0xfdcc('0x1a')][_0xfdcc('0x19')]);}})[_0xfdcc('0x1b')](function(_0xbd44db){logger['error'](_0xfdcc('0x12'),_0x14f89d,_0xbd44db);_0x28aa0e(_0xbd44db);});});}exports[_0xfdcc('0x1c')]=function(_0x59e9fe){var _0x44e3c5=this;return new Promise(function(_0x1f6b3d,_0x362a7c){return db[_0xfdcc('0x1d')][_0xfdcc('0x1e')](_0x59e9fe['body'],{'raw':_0x59e9fe['options']?_0x59e9fe[_0xfdcc('0x1f')][_0xfdcc('0x20')]===undefined?!![]:![]:!![]})[_0xfdcc('0x10')](function(_0x13eb1c){logger[_0xfdcc('0x11')](_0xfdcc('0x1c'),_0x59e9fe);logger['debug'](_0xfdcc('0x1c'),_0x59e9fe,JSON['stringify'](_0x13eb1c));_0x1f6b3d(_0x13eb1c);})[_0xfdcc('0x1b')](function(_0x21d622){logger[_0xfdcc('0x17')]('CreateChatMessage',_0x21d622[_0xfdcc('0x19')],_0x59e9fe);_0x362a7c(_0x44e3c5[_0xfdcc('0x17')](0x1f4,_0x21d622['message']));});});};
\ No newline at end of file
+var _0x04e7=['code','message','result','ChatMessage','options','raw','CreateChatMessage','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x04e7,0x121));var _0x704e=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x04e7[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x704e('0x0'));var util=require(_0x704e('0x1'));var moment=require(_0x704e('0x2'));var BPromise=require(_0x704e('0x3'));var rs=require(_0x704e('0x4'));var fs=require('fs');var Redis=require(_0x704e('0x5'));var db=require(_0x704e('0x6'))['db'];var utils=require(_0x704e('0x7'));var logger=require(_0x704e('0x8'))(_0x704e('0x9'));var config=require(_0x704e('0xa'));var jayson=require(_0x704e('0xb'));var client=jayson['client'][_0x704e('0xc')]({'port':0x232a});config[_0x704e('0xd')]=_[_0x704e('0xe')](config[_0x704e('0xd')],{'host':_0x704e('0xf'),'port':0x18eb});var socket=require(_0x704e('0x10'))(new Redis(config[_0x704e('0xd')]));require(_0x704e('0x11'))[_0x704e('0x12')](socket);function respondWithRpcPromise(_0xc0d178,_0x1a2f74,_0x458537){return new BPromise(function(_0x48dc9b,_0x3c80dd){return client[_0x704e('0x13')](_0xc0d178,_0x458537)[_0x704e('0x14')](function(_0x42c150){logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1a2f74,_0x704e('0x17'),JSON[_0x704e('0x18')](_0x42c150));if(_0x42c150[_0x704e('0x19')]){if(_0x42c150[_0x704e('0x19')][_0x704e('0x1a')]===0x1f4){logger[_0x704e('0x19')](_0x704e('0x16'),_0x1a2f74,_0x42c150[_0x704e('0x19')]['message']);return _0x3c80dd(_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);}logger[_0x704e('0x19')]('ChatMessage,\x20%s,\x20%s',_0x1a2f74,_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);return _0x48dc9b(_0x42c150[_0x704e('0x19')]['message']);}else{logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));_0x48dc9b(_0x42c150[_0x704e('0x1c')][_0x704e('0x1b')]);}})['catch'](function(_0x333524){logger['error'](_0x704e('0x16'),_0x1a2f74,_0x333524);_0x3c80dd(_0x333524);});});}exports['CreateChatMessage']=function(_0x5e0542){var _0x5bd786=this;return new Promise(function(_0x295d5a,_0x361cb7){return db[_0x704e('0x1d')]['create'](_0x5e0542['body'],{'raw':_0x5e0542[_0x704e('0x1e')]?_0x5e0542[_0x704e('0x1e')][_0x704e('0x1f')]===undefined?!![]:![]:!![]})[_0x704e('0x14')](function(_0x418322){logger[_0x704e('0x15')](_0x704e('0x20'),_0x5e0542);logger[_0x704e('0x21')](_0x704e('0x20'),_0x5e0542,JSON[_0x704e('0x18')](_0x418322));_0x295d5a(_0x418322);})[_0x704e('0x22')](function(_0x5554d0){logger['error'](_0x704e('0x20'),_0x5554d0[_0x704e('0x1b')],_0x5e0542);_0x361cb7(_0x5bd786[_0x704e('0x19')](0x1f4,_0x5554d0[_0x704e('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 2db1b75..bf392d5 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 _0x9ab0=['save','remove','update','emit','length','chatMessage:','./chatMessage.events'];(function(_0x65d16d,_0x19b3fd){var _0x2df98a=function(_0x25def9){while(--_0x25def9){_0x65d16d['push'](_0x65d16d['shift']());}};_0x2df98a(++_0x19b3fd);}(_0x9ab0,0x195));var _0x09ab=function(_0x1fbc26,_0x80e0f){_0x1fbc26=_0x1fbc26-0x0;var _0x43a85d=_0x9ab0[_0x1fbc26];return _0x43a85d;};'use strict';var ChatMessageEvents=require(_0x09ab('0x0'));var events=[_0x09ab('0x1'),_0x09ab('0x2'),_0x09ab('0x3')];function createListener(_0x38fee4,_0x428fc1){return function(_0x38c30a){_0x428fc1[_0x09ab('0x4')](_0x38fee4,_0x38c30a);};}function removeListener(_0x3c0cd0,_0x4bb59a){return function(){ChatMessageEvents['removeListener'](_0x3c0cd0,_0x4bb59a);};}exports['register']=function(_0x3144ec){for(var _0x387ac8=0x0,_0x241bd1=events[_0x09ab('0x5')];_0x387ac8<_0x241bd1;_0x387ac8++){var _0x610663=events[_0x387ac8];var _0x464d64=createListener(_0x09ab('0x6')+_0x610663,_0x3144ec);ChatMessageEvents['on'](_0x610663,_0x464d64);}};
\ No newline at end of file
+var _0x3e9d=['chatMessage:','./chatMessage.events','save','update','removeListener','register','length'];(function(_0xf711da,_0x5dfce7){var _0x219748=function(_0x39d857){while(--_0x39d857){_0xf711da['push'](_0xf711da['shift']());}};_0x219748(++_0x5dfce7);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x1e6e99,_0x2ef9ac){_0x1e6e99=_0x1e6e99-0x0;var _0x41d4f3=_0x3e9d[_0x1e6e99];return _0x41d4f3;};'use strict';var ChatMessageEvents=require(_0xd3e9('0x0'));var events=[_0xd3e9('0x1'),'remove',_0xd3e9('0x2')];function createListener(_0x4bc1c3,_0x328e91){return function(_0x2ebba5){_0x328e91['emit'](_0x4bc1c3,_0x2ebba5);};}function removeListener(_0x4887ba,_0xa499a3){return function(){ChatMessageEvents[_0xd3e9('0x3')](_0x4887ba,_0xa499a3);};}exports[_0xd3e9('0x4')]=function(_0x3dea0a){for(var _0x568eea=0x0,_0x4dc1de=events[_0xd3e9('0x5')];_0x568eea<_0x4dc1de;_0x568eea++){var _0x140f2d=events[_0x568eea];var _0x45364e=createListener(_0xd3e9('0x6')+_0x140f2d,_0x3dea0a);ChatMessageEvents['on'](_0x140f2d,_0x45364e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index e853d4e..cb556b7 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 _0x05fa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','describe','/:id','show','isAuthenticated','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x05fa,0x181));var _0xa05f=function(_0x50425c,_0x11f5dc){_0x50425c=_0x50425c-0x0;var _0x4093a4=_0x05fa[_0x50425c];return _0x4093a4;};'use strict';var multer=require(_0xa05f('0x0'));var util=require('util');var path=require(_0xa05f('0x1'));var timeout=require(_0xa05f('0x2'));var express=require(_0xa05f('0x3'));var router=express[_0xa05f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa05f('0x5'));var interaction=require(_0xa05f('0x6'));var config=require(_0xa05f('0x7'));var controller=require(_0xa05f('0x8'));router[_0xa05f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa05f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa05f('0xa')]);router[_0xa05f('0x9')](_0xa05f('0xb'),auth['isAuthenticated'](),controller[_0xa05f('0xc')]);router['post']('/',auth[_0xa05f('0xd')](),interaction[_0xa05f('0xe')](_0xa05f('0xf'),_0xa05f('0x10')),controller[_0xa05f('0x11')]);router[_0xa05f('0x12')]('/:id',controller[_0xa05f('0x13')]);router['put'](_0xa05f('0x14'),auth[_0xa05f('0xd')](),controller[_0xa05f('0x15')]);router['put'](_0xa05f('0x16'),auth[_0xa05f('0xd')](),controller[_0xa05f('0x17')]);router[_0xa05f('0x18')]('/:id',auth[_0xa05f('0xd')](),controller[_0xa05f('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xe5a5=['post','chat','chatmessage:create','create','update','accept','put','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xe5a5,0x15b));var _0x5e5a=function(_0x480e53,_0x5c8da4){_0x480e53=_0x480e53-0x0;var _0x12c12f=_0xe5a5[_0x480e53];return _0x12c12f;};'use strict';var multer=require(_0x5e5a('0x0'));var util=require(_0x5e5a('0x1'));var path=require(_0x5e5a('0x2'));var timeout=require(_0x5e5a('0x3'));var express=require('express');var router=express[_0x5e5a('0x4')]();var fs_extra=require(_0x5e5a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5e5a('0x6'));var config=require(_0x5e5a('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5e5a('0x8')]);router[_0x5e5a('0x9')]('/describe',auth[_0x5e5a('0xa')](),controller[_0x5e5a('0xb')]);router[_0x5e5a('0x9')](_0x5e5a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5e5a('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5e5a('0xe'),_0x5e5a('0xf')),controller[_0x5e5a('0x10')]);router['put'](_0x5e5a('0xc'),controller[_0x5e5a('0x11')]);router['put']('/:id/accept',auth[_0x5e5a('0xa')](),controller[_0x5e5a('0x12')]);router[_0x5e5a('0x13')](_0x5e5a('0x14'),auth[_0x5e5a('0xa')](),controller[_0x5e5a('0x15')]);router[_0x5e5a('0x16')](_0x5e5a('0xc'),auth['isAuthenticated'](),controller[_0x5e5a('0x17')]);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 6c1206e..20f4c50 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x1b9cfa,_0x36281e){var _0x1ed4d3=function(_0x2bed19){while(--_0x2bed19){_0x1b9cfa['push'](_0x1b9cfa['shift']());}};_0x1ed4d3(++_0x36281e);}(_0xdb28,0x106));var _0x8db2=function(_0x57503e,_0x52d747){_0x57503e=_0x57503e-0x0;var _0x214e59=_0xdb28[_0x57503e];return _0x214e59;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x36fec3,_0x455039){var _0x5bba9c=function(_0x3b8353){while(--_0x3b8353){_0x36fec3['push'](_0x36fec3['shift']());}};_0x5bba9c(++_0x455039);}(_0xdb28,0x106));var _0x8db2=function(_0x28dac0,_0x40b8ad){_0x28dac0=_0x28dac0-0x0;var _0x26efbc=_0xdb28[_0x28dac0];return _0x26efbc;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 9f61463..9f559d4 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7a54,0x106));var _0x47a5=function(_0x3e8f74,_0x5219d9){_0x3e8f74=_0x3e8f74-0x0;var _0x1619e4=_0x7a54[_0x3e8f74];return _0x1619e4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7a54,0x106));var _0x47a5=function(_0x10beef,_0x4c26e1){_0x10beef=_0x10beef-0x0;var _0x244288=_0x7a54[_0x10beef];return _0x244288;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 5cdae2d..391d845 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 _0xaf0d=['hasOwnProperty','../../mysqldb','ChatOfflineMessage','emit'];(function(_0x11ff7f,_0x5bf87c){var _0xcca7bc=function(_0x4e77c0){while(--_0x4e77c0){_0x11ff7f['push'](_0x11ff7f['shift']());}};_0xcca7bc(++_0x5bf87c);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x3c718c,_0x4cc3bf){_0x3c718c=_0x3c718c-0x0;var _0x46aefc=_0xaf0d[_0x3c718c];return _0x46aefc;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xdaf0('0x0'))['db'][_0xdaf0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c0ebc){return function(_0x1b6f35,_0x21a3fa,_0xe9d8f4){ChatOfflineMessageEvents['emit'](_0x5c0ebc+':'+_0x1b6f35['id'],_0x1b6f35);ChatOfflineMessageEvents[_0xdaf0('0x2')](_0x5c0ebc,_0x1b6f35);_0xe9d8f4(null);};}for(var e in events){if(events[_0xdaf0('0x3')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xd5fc=['emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1d978e,_0x30032a){var _0x2fe0c9=function(_0x1b661c){while(--_0x1b661c){_0x1d978e['push'](_0x1d978e['shift']());}};_0x2fe0c9(++_0x30032a);}(_0xd5fc,0x11a));var _0xcd5f=function(_0x332e1,_0x225f10){_0x332e1=_0x332e1-0x0;var _0x41380b=_0xd5fc[_0x332e1];return _0x41380b;};'use strict';var EventEmitter=require(_0xcd5f('0x0'));var ChatOfflineMessage=require(_0xcd5f('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcd5f('0x2')](0x0);var events={'afterCreate':_0xcd5f('0x3'),'afterUpdate':_0xcd5f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbd0dc4){return function(_0x2897ed,_0x4ab81b,_0xf83ba0){ChatOfflineMessageEvents[_0xcd5f('0x5')](_0xbd0dc4+':'+_0x2897ed['id'],_0x2897ed);ChatOfflineMessageEvents[_0xcd5f('0x5')](_0xbd0dc4,_0x2897ed);_0xf83ba0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xcd5f('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3fa3bb7..934bf66 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 _0x0f18=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0x0f18,0x90));var _0x80f1=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x0f18[_0x3f1710];return _0x528458;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x80f1('0x0')]=function(_0x1f6d29){return _0x1f6d29['define'](_0x80f1('0x1'),attributes,{'tableName':_0x80f1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80f1('0x3'),'collate':_0x80f1('0x4')});};
\ No newline at end of file
+var _0x3af1=['define','ChatOfflineMessage','./chatOfflineMessage.attributes','exports'];(function(_0x2e4e85,_0x37262f){var _0x52f763=function(_0x26c195){while(--_0x26c195){_0x2e4e85['push'](_0x2e4e85['shift']());}};_0x52f763(++_0x37262f);}(_0x3af1,0xfe));var _0x13af=function(_0x36f340,_0x218b82){_0x36f340=_0x36f340-0x0;var _0x48ac0e=_0x3af1[_0x36f340];return _0x48ac0e;};'use strict';var attributes=require(_0x13af('0x0'));module[_0x13af('0x1')]=function(_0x2fa3e2){return _0x2fa3e2[_0x13af('0x2')](_0x13af('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 6d1c295..918c37e 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 _0xa728=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird'];(function(_0x3b5141,_0x2beaf2){var _0x431f71=function(_0x71318b){while(--_0x71318b){_0x3b5141['push'](_0x3b5141['shift']());}};_0x431f71(++_0x2beaf2);}(_0xa728,0xb4));var _0x8a72=function(_0x315a95,_0x580ecd){_0x315a95=_0x315a95-0x0;var _0x2e485e=_0xa728[_0x315a95];return _0x2e485e;};'use strict';var _=require(_0x8a72('0x0'));var util=require(_0x8a72('0x1'));var moment=require(_0x8a72('0x2'));var BPromise=require(_0x8a72('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a72('0x4'));var db=require(_0x8a72('0x5'))['db'];var utils=require(_0x8a72('0x6'));var logger=require(_0x8a72('0x7'))('rpc');var config=require(_0x8a72('0x8'));var jayson=require(_0x8a72('0x9'));var client=jayson[_0x8a72('0xa')][_0x8a72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44a8a9,_0x3d004a,_0x1421d2){return new BPromise(function(_0x23f5df,_0x3bcf8a){return client[_0x8a72('0xc')](_0x44a8a9,_0x1421d2)[_0x8a72('0xd')](function(_0x327e53){logger[_0x8a72('0xe')](_0x8a72('0xf'),_0x3d004a,_0x8a72('0x10'));logger[_0x8a72('0x11')](_0x8a72('0x12'),_0x3d004a,_0x8a72('0x10'),JSON['stringify'](_0x327e53));if(_0x327e53['error']){if(_0x327e53['error'][_0x8a72('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3d004a,_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);return _0x3bcf8a(_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);}logger['error'](_0x8a72('0xf'),_0x3d004a,_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);return _0x23f5df(_0x327e53['error'][_0x8a72('0x15')]);}else{logger[_0x8a72('0xe')](_0x8a72('0xf'),_0x3d004a,_0x8a72('0x10'));_0x23f5df(_0x327e53[_0x8a72('0x16')][_0x8a72('0x15')]);}})['catch'](function(_0x36f20b){logger['error'](_0x8a72('0xf'),_0x3d004a,_0x36f20b);_0x3bcf8a(_0x36f20b);});});}
\ No newline at end of file
+var _0x4974=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x4974,0x127));var _0x4497=function(_0x42f58d,_0x44a5a3){_0x42f58d=_0x42f58d-0x0;var _0x3207f5=_0x4974[_0x42f58d];return _0x3207f5;};'use strict';var _=require(_0x4497('0x0'));var util=require('util');var moment=require(_0x4497('0x1'));var BPromise=require(_0x4497('0x2'));var rs=require(_0x4497('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4497('0x4'))['db'];var utils=require(_0x4497('0x5'));var logger=require('../../config/logger')(_0x4497('0x6'));var config=require(_0x4497('0x7'));var jayson=require(_0x4497('0x8'));var client=jayson['client'][_0x4497('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445e3c,_0x571aa8,_0x9acff7){return new BPromise(function(_0x484983,_0x4ebfdf){return client[_0x4497('0xa')](_0x445e3c,_0x9acff7)[_0x4497('0xb')](function(_0x487f6a){logger[_0x4497('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x571aa8,_0x4497('0xd'));logger[_0x4497('0xe')](_0x4497('0xf'),_0x571aa8,'request\x20sent',JSON[_0x4497('0x10')](_0x487f6a));if(_0x487f6a[_0x4497('0x11')]){if(_0x487f6a[_0x4497('0x11')][_0x4497('0x12')]===0x1f4){logger[_0x4497('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x571aa8,_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);return _0x4ebfdf(_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);}logger[_0x4497('0x11')](_0x4497('0x14'),_0x571aa8,_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);return _0x484983(_0x487f6a['error'][_0x4497('0x13')]);}else{logger[_0x4497('0xc')](_0x4497('0x14'),_0x571aa8,_0x4497('0xd'));_0x484983(_0x487f6a['result'][_0x4497('0x13')]);}})[_0x4497('0x15')](function(_0x3db095){logger[_0x4497('0x11')](_0x4497('0x14'),_0x571aa8,_0x3db095);_0x4ebfdf(_0x3db095);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 91524b8..87a99ed 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 _0x3308=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc298ad,_0xea4dc2){var _0x11b2e6=function(_0xe2314f){while(--_0xe2314f){_0xc298ad['push'](_0xc298ad['shift']());}};_0x11b2e6(++_0xea4dc2);}(_0x3308,0x116));var _0x8330=function(_0x192430,_0x6763ba){_0x192430=_0x192430-0x0;var _0x179c80=_0x3308[_0x192430];return _0x179c80;};'use strict';var multer=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var path=require(_0x8330('0x2'));var timeout=require(_0x8330('0x3'));var express=require(_0x8330('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8330('0x5'));var interaction=require(_0x8330('0x6'));var config=require(_0x8330('0x7'));var controller=require(_0x8330('0x8'));router[_0x8330('0x9')]('/',auth[_0x8330('0xa')](),controller[_0x8330('0xb')]);router[_0x8330('0x9')](_0x8330('0xc'),auth[_0x8330('0xa')](),controller[_0x8330('0xd')]);router[_0x8330('0x9')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller[_0x8330('0xf')]);router[_0x8330('0x10')]('/',auth['isAuthenticated'](),controller[_0x8330('0x11')]);router[_0x8330('0x12')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller['update']);router[_0x8330('0x13')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller[_0x8330('0x14')]);module[_0x8330('0x15')]=router;
\ No newline at end of file
+var _0x1f5f=['post','create','put','/:id','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe'];(function(_0x30f06f,_0x160eaf){var _0x7e3a80=function(_0x47fa04){while(--_0x47fa04){_0x30f06f['push'](_0x30f06f['shift']());}};_0x7e3a80(++_0x160eaf);}(_0x1f5f,0x116));var _0xf1f5=function(_0x2eeb79,_0x5c81e3){_0x2eeb79=_0x2eeb79-0x0;var _0x91495d=_0x1f5f[_0x2eeb79];return _0x91495d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf1f5('0x0'));var timeout=require('connect-timeout');var express=require(_0xf1f5('0x1'));var router=express[_0xf1f5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf1f5('0x3'));var interaction=require(_0xf1f5('0x4'));var config=require('../../config/environment');var controller=require(_0xf1f5('0x5'));router[_0xf1f5('0x6')]('/',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0x8')]);router['get']('/describe',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0x9')]);router[_0xf1f5('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf1f5('0xa')]('/',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0xb')]);router[_0xf1f5('0xc')](_0xf1f5('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf1f5('0xd'),auth[_0xf1f5('0x7')](),controller[_0xf1f5('0xe')]);module[_0xf1f5('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f05a7b4..35615b4 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 _0xa19c=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x3798d8,_0xc1aacf){var _0x345c15=function(_0x617d97){while(--_0x617d97){_0x3798d8['push'](_0x3798d8['shift']());}};_0x345c15(++_0xc1aacf);}(_0xa19c,0x11b));var _0xca19=function(_0x40f9a9,_0x171ffd){_0x40f9a9=_0x40f9a9-0x0;var _0x39672c=_0xa19c[_0x40f9a9];return _0x39672c;};'use strict';var Sequelize=require(_0xca19('0x0'));module[_0xca19('0x1')]={'name':{'type':Sequelize[_0xca19('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xca19('0x3'),_0xca19('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xca19('0x2')]},'timeout':{'type':Sequelize[_0xca19('0x5')]}};
\ No newline at end of file
+var _0x974d=['ENUM','INTEGER','sequelize','exports','STRING'];(function(_0x58cb96,_0x3d7cec){var _0x58b556=function(_0x2455d2){while(--_0x2455d2){_0x58cb96['push'](_0x58cb96['shift']());}};_0x58b556(++_0x3d7cec);}(_0x974d,0x115));var _0xd974=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x974d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xd974('0x0'));module[_0xd974('0x1')]={'name':{'type':Sequelize[_0xd974('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd974('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd974('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d981465..06c8b7d 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 _0x0845=['name','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','find','catch','body','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','then','end','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0845,0x125));var _0x5084=function(_0x3f5859,_0x38ecde){_0x3f5859=_0x3f5859-0x0;var _0x18465a=_0x0845[_0x3f5859];return _0x18465a;};'use strict';var emlformat=require(_0x5084('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5084('0x1'));var rp=require(_0x5084('0x2'));var moment=require(_0x5084('0x3'));var BPromise=require(_0x5084('0x4'));var Mustache=require(_0x5084('0x5'));var util=require(_0x5084('0x6'));var path=require('path');var sox=require(_0x5084('0x7'));var csv=require(_0x5084('0x8'));var ejs=require(_0x5084('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5084('0xa'));var jsforce=require(_0x5084('0xb'));var deskjs=require(_0x5084('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5084('0xd'));var Redis=require(_0x5084('0xe'));var authService=require(_0x5084('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5084('0x10'));var hardwareService=require(_0x5084('0x11'));var logger=require(_0x5084('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x5084('0x13'));var licenseUtil=require(_0x5084('0x14'));var db=require(_0x5084('0x15'))['db'];function respondWithStatusCode(_0x1bc737,_0x35355a){_0x35355a=_0x35355a||0xcc;return function(_0x86dc11){if(_0x86dc11){return _0x1bc737[_0x5084('0x16')](_0x35355a);}return _0x1bc737[_0x5084('0x17')](_0x35355a)['end']();};}function respondWithResult(_0x2e3f5b,_0x2b92d9){_0x2b92d9=_0x2b92d9||0xc8;return function(_0x3c48e5){if(_0x3c48e5){return _0x2e3f5b['status'](_0x2b92d9)[_0x5084('0x18')](_0x3c48e5);}};}function respondWithFilteredResult(_0xd4ff23,_0x27023b){return function(_0x263642){if(_0x263642){var _0x4918e2=typeof _0x27023b[_0x5084('0x19')]==='undefined'&&typeof _0x27023b[_0x5084('0x1a')]===_0x5084('0x1b');var _0x300efc=_0x263642[_0x5084('0x1c')];var _0x2072b8=_0x4918e2?0x0:_0x27023b[_0x5084('0x19')];var _0x369fb5=_0x4918e2?_0x263642[_0x5084('0x1c')]:_0x27023b[_0x5084('0x19')]+_0x27023b[_0x5084('0x1a')];var _0x35e563;if(_0x369fb5>=_0x300efc){_0x369fb5=_0x300efc;_0x35e563=0xc8;}else{_0x35e563=0xce;}_0xd4ff23[_0x5084('0x17')](_0x35e563);return _0xd4ff23[_0x5084('0x1d')](_0x5084('0x1e'),_0x2072b8+'-'+_0x369fb5+'/'+_0x300efc)[_0x5084('0x18')](_0x263642);}return null;};}function patchUpdates(_0x2f1889){return function(_0xa92a15){try{jsonpatch[_0x5084('0x1f')](_0xa92a15,_0x2f1889,!![]);}catch(_0x1843b9){return BPromise[_0x5084('0x20')](_0x1843b9);}return _0xa92a15['save']();};}function saveUpdates(_0x44461a,_0xd4080b){return function(_0x330ffa){if(_0x330ffa){return _0x330ffa['update'](_0x44461a)['then'](function(_0x5461db){return _0x5461db;});}return null;};}function removeEntity(_0xc14e05,_0x224c29){return function(_0x4a2f3f){if(_0x4a2f3f){return _0x4a2f3f[_0x5084('0x21')]()[_0x5084('0x22')](function(){_0xc14e05['status'](0xcc)[_0x5084('0x23')]();});}};}function handleEntityNotFound(_0xfe242a,_0xed0d17){return function(_0x2d01e1){if(!_0x2d01e1){_0xfe242a[_0x5084('0x16')](0x194);}return _0x2d01e1;};}function handleError(_0x146b21,_0x55b6e0){_0x55b6e0=_0x55b6e0||0x1f4;return function(_0x11b910){logger[_0x5084('0x24')](_0x11b910['stack']);if(_0x11b910[_0x5084('0x25')]){delete _0x11b910[_0x5084('0x25')];}_0x146b21['status'](_0x55b6e0)['send'](_0x11b910);};}exports['show']=function(_0xca5b2d,_0x177853){var _0x2538bb={'raw':!![],'where':{'id':_0xca5b2d[_0x5084('0x26')]['id']}},_0x5760e2={};_0x5760e2['model']=_[_0x5084('0x27')](db[_0x5084('0x28')][_0x5084('0x29')]);_0x5760e2[_0x5084('0x2a')]=_[_0x5084('0x27')](_0xca5b2d[_0x5084('0x2a')]);_0x5760e2[_0x5084('0x2b')]=_[_0x5084('0x2c')](_0x5760e2[_0x5084('0x2d')],_0x5760e2[_0x5084('0x2a')]);_0x2538bb[_0x5084('0x2e')]=_[_0x5084('0x2c')](_0x5760e2['model'],qs[_0x5084('0x2f')](_0xca5b2d[_0x5084('0x2a')]['fields']));_0x2538bb['attributes']=_0x2538bb[_0x5084('0x2e')][_0x5084('0x30')]?_0x2538bb[_0x5084('0x2e')]:_0x5760e2['model'];if(_0xca5b2d[_0x5084('0x2a')]['includeAll']){_0x2538bb[_0x5084('0x31')]=[{'all':!![]}];}_0x2538bb=_[_0x5084('0x32')]({},_0x2538bb,_0xca5b2d['options']);return db[_0x5084('0x28')][_0x5084('0x33')](_0x2538bb)[_0x5084('0x22')](handleEntityNotFound(_0x177853,null))[_0x5084('0x22')](respondWithResult(_0x177853,null))[_0x5084('0x34')](handleError(_0x177853,null));};exports['create']=function(_0xae716c,_0x7191e1){return db[_0x5084('0x28')]['create'](_0xae716c[_0x5084('0x35')],{})[_0x5084('0x22')](respondWithResult(_0x7191e1,0xc9))[_0x5084('0x34')](handleError(_0x7191e1,null));};exports[_0x5084('0x36')]=function(_0xefdab2,_0x4cdfc0){if(_0xefdab2[_0x5084('0x35')]['id']){delete _0xefdab2[_0x5084('0x35')]['id'];}return db[_0x5084('0x28')]['find']({'where':{'id':_0xefdab2[_0x5084('0x26')]['id']}})[_0x5084('0x22')](handleEntityNotFound(_0x4cdfc0,null))[_0x5084('0x22')](saveUpdates(_0xefdab2[_0x5084('0x35')],null))[_0x5084('0x22')](respondWithResult(_0x4cdfc0,null))['catch'](handleError(_0x4cdfc0,null));};exports['destroy']=function(_0x5a93b9,_0x57a746){return db['ChatProactiveAction'][_0x5084('0x33')]({'where':{'id':_0x5a93b9['params']['id']}})['then'](handleEntityNotFound(_0x57a746,null))[_0x5084('0x22')](removeEntity(_0x57a746,null))[_0x5084('0x34')](handleError(_0x57a746,null));};
\ No newline at end of file
+var _0xf3a7=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x14884f,_0x382384){var _0x36acae=function(_0x3ec689){while(--_0x3ec689){_0x14884f['push'](_0x14884f['shift']());}};_0x36acae(++_0x382384);}(_0xf3a7,0x99));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f3a('0x0'));var zipdir=require(_0x7f3a('0x1'));var jsonpatch=require(_0x7f3a('0x2'));var rp=require(_0x7f3a('0x3'));var moment=require(_0x7f3a('0x4'));var BPromise=require(_0x7f3a('0x5'));var Mustache=require(_0x7f3a('0x6'));var util=require(_0x7f3a('0x7'));var path=require(_0x7f3a('0x8'));var sox=require(_0x7f3a('0x9'));var csv=require('to-csv');var ejs=require(_0x7f3a('0xa'));var fs=require('fs');var fs_extra=require(_0x7f3a('0xb'));var _=require(_0x7f3a('0xc'));var squel=require(_0x7f3a('0xd'));var crypto=require(_0x7f3a('0xe'));var jsforce=require(_0x7f3a('0xf'));var deskjs=require(_0x7f3a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7f3a('0x11'));var Papa=require(_0x7f3a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7f3a('0x13'));var as=require(_0x7f3a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f3a('0x15'))('api');var utils=require(_0x7f3a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f3a('0x17'));var db=require(_0x7f3a('0x18'))['db'];function respondWithStatusCode(_0x200efc,_0x424ccb){_0x424ccb=_0x424ccb||0xcc;return function(_0x46b8e3){if(_0x46b8e3){return _0x200efc[_0x7f3a('0x19')](_0x424ccb);}return _0x200efc[_0x7f3a('0x1a')](_0x424ccb)[_0x7f3a('0x1b')]();};}function respondWithResult(_0x42b28f,_0x4b775b){_0x4b775b=_0x4b775b||0xc8;return function(_0x2bb3e4){if(_0x2bb3e4){return _0x42b28f['status'](_0x4b775b)[_0x7f3a('0x1c')](_0x2bb3e4);}};}function respondWithFilteredResult(_0x238e50,_0x17d457){return function(_0x3310fc){if(_0x3310fc){var _0x22112c=typeof _0x17d457[_0x7f3a('0x1d')]===_0x7f3a('0x1e')&&typeof _0x17d457['limit']===_0x7f3a('0x1e');var _0x1a9dab=_0x3310fc['count'];var _0x2eefb1=_0x22112c?0x0:_0x17d457[_0x7f3a('0x1d')];var _0x235e64=_0x22112c?_0x3310fc[_0x7f3a('0x1f')]:_0x17d457['offset']+_0x17d457['limit'];var _0x2d2164;if(_0x235e64>=_0x1a9dab){_0x235e64=_0x1a9dab;_0x2d2164=0xc8;}else{_0x2d2164=0xce;}_0x238e50[_0x7f3a('0x1a')](_0x2d2164);return _0x238e50[_0x7f3a('0x20')](_0x7f3a('0x21'),_0x2eefb1+'-'+_0x235e64+'/'+_0x1a9dab)[_0x7f3a('0x1c')](_0x3310fc);}return null;};}function patchUpdates(_0x48032d){return function(_0x44d250){try{jsonpatch[_0x7f3a('0x22')](_0x44d250,_0x48032d,!![]);}catch(_0x17f0e8){return BPromise[_0x7f3a('0x23')](_0x17f0e8);}return _0x44d250[_0x7f3a('0x24')]();};}function saveUpdates(_0x144067,_0x7c55cb){return function(_0x203067){if(_0x203067){return _0x203067[_0x7f3a('0x25')](_0x144067)[_0x7f3a('0x26')](function(_0x5c96a2){return _0x5c96a2;});}return null;};}function removeEntity(_0x537819,_0x4d5d4d){return function(_0x22cb57){if(_0x22cb57){return _0x22cb57[_0x7f3a('0x27')]()[_0x7f3a('0x26')](function(){_0x537819['status'](0xcc)[_0x7f3a('0x1b')]();});}};}function handleEntityNotFound(_0x38ccbf,_0x2505de){return function(_0x3479dc){if(!_0x3479dc){_0x38ccbf[_0x7f3a('0x19')](0x194);}return _0x3479dc;};}function handleError(_0x198cb8,_0x204266){_0x204266=_0x204266||0x1f4;return function(_0x1f48d6){logger[_0x7f3a('0x28')](_0x1f48d6['stack']);if(_0x1f48d6[_0x7f3a('0x29')]){delete _0x1f48d6[_0x7f3a('0x29')];}_0x198cb8[_0x7f3a('0x1a')](_0x204266)[_0x7f3a('0x2a')](_0x1f48d6);};}exports[_0x7f3a('0x2b')]=function(_0x440e28,_0x43940b){var _0x180700={'raw':!![],'where':{'id':_0x440e28[_0x7f3a('0x2c')]['id']}},_0x160f7e={};_0x160f7e[_0x7f3a('0x2d')]=_[_0x7f3a('0x2e')](db[_0x7f3a('0x2f')][_0x7f3a('0x30')]);_0x160f7e['query']=_[_0x7f3a('0x2e')](_0x440e28[_0x7f3a('0x31')]);_0x160f7e['filters']=_['intersection'](_0x160f7e[_0x7f3a('0x2d')],_0x160f7e[_0x7f3a('0x31')]);_0x180700[_0x7f3a('0x32')]=_['intersection'](_0x160f7e[_0x7f3a('0x2d')],qs[_0x7f3a('0x33')](_0x440e28[_0x7f3a('0x31')]['fields']));_0x180700[_0x7f3a('0x32')]=_0x180700[_0x7f3a('0x32')]['length']?_0x180700[_0x7f3a('0x32')]:_0x160f7e[_0x7f3a('0x2d')];if(_0x440e28['query']['includeAll']){_0x180700['include']=[{'all':!![]}];}_0x180700=_[_0x7f3a('0x34')]({},_0x180700,_0x440e28['options']);return db[_0x7f3a('0x2f')][_0x7f3a('0x35')](_0x180700)[_0x7f3a('0x26')](handleEntityNotFound(_0x43940b,null))[_0x7f3a('0x26')](respondWithResult(_0x43940b,null))[_0x7f3a('0x36')](handleError(_0x43940b,null));};exports[_0x7f3a('0x37')]=function(_0x954157,_0x2e7a3f){return db[_0x7f3a('0x2f')][_0x7f3a('0x37')](_0x954157[_0x7f3a('0x38')],{})['then'](respondWithResult(_0x2e7a3f,0xc9))['catch'](handleError(_0x2e7a3f,null));};exports[_0x7f3a('0x25')]=function(_0x489c66,_0x4da5fe){if(_0x489c66[_0x7f3a('0x38')]['id']){delete _0x489c66[_0x7f3a('0x38')]['id'];}return db[_0x7f3a('0x2f')]['find']({'where':{'id':_0x489c66[_0x7f3a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4da5fe,null))[_0x7f3a('0x26')](saveUpdates(_0x489c66[_0x7f3a('0x38')],null))['then'](respondWithResult(_0x4da5fe,null))[_0x7f3a('0x36')](handleError(_0x4da5fe,null));};exports[_0x7f3a('0x27')]=function(_0xf74b87,_0x3e0006){return db[_0x7f3a('0x2f')][_0x7f3a('0x35')]({'where':{'id':_0xf74b87[_0x7f3a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3e0006,null))['then'](removeEntity(_0x3e0006,null))[_0x7f3a('0x36')](handleError(_0x3e0006,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0ecead4..5f955d6 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 _0xf79a=['request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x6cd197,_0x33df63){var _0x3480c7=function(_0x16dbb4){while(--_0x16dbb4){_0x6cd197['push'](_0x6cd197['shift']());}};_0x3480c7(++_0x33df63);}(_0xf79a,0x10f));var _0xaf79=function(_0x47076d,_0x26e4b5){_0x47076d=_0x47076d-0x0;var _0x59d3d2=_0xf79a[_0x47076d];return _0x59d3d2;};'use strict';var _=require(_0xaf79('0x0'));var util=require(_0xaf79('0x1'));var logger=require(_0xaf79('0x2'))(_0xaf79('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf79('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf79('0x5'));var config=require(_0xaf79('0x6'));var attributes=require(_0xaf79('0x7'));module[_0xaf79('0x8')]=function(_0x1b66d8,_0x181748){return _0x1b66d8[_0xaf79('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xaf79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0bc8=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b815b,_0x2c2f7c){var _0x58c082=function(_0x2b64eb){while(--_0x2b64eb){_0x2b815b['push'](_0x2b815b['shift']());}};_0x58c082(++_0x2c2f7c);}(_0x0bc8,0xae));var _0x80bc=function(_0x37a803,_0x39b66a){_0x37a803=_0x37a803-0x0;var _0x306045=_0x0bc8[_0x37a803];return _0x306045;};'use strict';var _=require(_0x80bc('0x0'));var util=require(_0x80bc('0x1'));var logger=require(_0x80bc('0x2'))(_0x80bc('0x3'));var moment=require(_0x80bc('0x4'));var BPromise=require(_0x80bc('0x5'));var rp=require(_0x80bc('0x6'));var fs=require('fs');var path=require(_0x80bc('0x7'));var rimraf=require(_0x80bc('0x8'));var config=require(_0x80bc('0x9'));var attributes=require(_0x80bc('0xa'));module[_0x80bc('0xb')]=function(_0x2aef1b,_0x364ae3){return _0x2aef1b[_0x80bc('0xc')]('ChatProactiveAction',attributes,{'tableName':_0x80bc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 5711bad..84afb44 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 _0x3785=['rpc','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x3785,0x1f1));var _0x5378=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3785[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x5378('0x0'));var util=require('util');var moment=require(_0x5378('0x1'));var BPromise=require(_0x5378('0x2'));var rs=require(_0x5378('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5378('0x4'))['db'];var utils=require(_0x5378('0x5'));var logger=require(_0x5378('0x6'))(_0x5378('0x7'));var config=require('../../config/environment');var jayson=require(_0x5378('0x8'));var client=jayson[_0x5378('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3472e6,_0x4ec8d0,_0x51be6e){return new BPromise(function(_0x24664e,_0x156917){return client['request'](_0x3472e6,_0x51be6e)[_0x5378('0xa')](function(_0x294484){logger['info'](_0x5378('0xb'),_0x4ec8d0,_0x5378('0xc'));logger[_0x5378('0xd')](_0x5378('0xe'),_0x4ec8d0,'request\x20sent',JSON[_0x5378('0xf')](_0x294484));if(_0x294484[_0x5378('0x10')]){if(_0x294484[_0x5378('0x10')][_0x5378('0x11')]===0x1f4){logger['error'](_0x5378('0xb'),_0x4ec8d0,_0x294484['error']['message']);return _0x156917(_0x294484[_0x5378('0x10')][_0x5378('0x12')]);}logger['error'](_0x5378('0xb'),_0x4ec8d0,_0x294484['error'][_0x5378('0x12')]);return _0x24664e(_0x294484[_0x5378('0x10')][_0x5378('0x12')]);}else{logger[_0x5378('0x13')](_0x5378('0xb'),_0x4ec8d0,'request\x20sent');_0x24664e(_0x294484['result'][_0x5378('0x12')]);}})[_0x5378('0x14')](function(_0x3576a6){logger[_0x5378('0x10')](_0x5378('0xb'),_0x4ec8d0,_0x3576a6);_0x156917(_0x3576a6);});});}
\ No newline at end of file
+var _0x1a94=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x5cdc88,_0x1d0650){var _0x132a99=function(_0x51c5f6){while(--_0x51c5f6){_0x5cdc88['push'](_0x5cdc88['shift']());}};_0x132a99(++_0x1d0650);}(_0x1a94,0x1a2));var _0x41a9=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1a94[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x41a9('0x0'));var util=require(_0x41a9('0x1'));var moment=require(_0x41a9('0x2'));var BPromise=require(_0x41a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41a9('0x4'));var db=require(_0x41a9('0x5'))['db'];var utils=require(_0x41a9('0x6'));var logger=require(_0x41a9('0x7'))(_0x41a9('0x8'));var config=require(_0x41a9('0x9'));var jayson=require(_0x41a9('0xa'));var client=jayson[_0x41a9('0xb')][_0x41a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f58c4,_0x1c7db4,_0x13eaa9){return new BPromise(function(_0x3a11c9,_0x4d628a){return client['request'](_0x2f58c4,_0x13eaa9)['then'](function(_0x5b888b){logger[_0x41a9('0xd')](_0x41a9('0xe'),_0x1c7db4,'request\x20sent');logger['debug'](_0x41a9('0xf'),_0x1c7db4,'request\x20sent',JSON[_0x41a9('0x10')](_0x5b888b));if(_0x5b888b[_0x41a9('0x11')]){if(_0x5b888b[_0x41a9('0x11')]['code']===0x1f4){logger[_0x41a9('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1c7db4,_0x5b888b['error'][_0x41a9('0x12')]);return _0x4d628a(_0x5b888b[_0x41a9('0x11')][_0x41a9('0x12')]);}logger[_0x41a9('0x11')](_0x41a9('0xe'),_0x1c7db4,_0x5b888b['error'][_0x41a9('0x12')]);return _0x3a11c9(_0x5b888b['error'][_0x41a9('0x12')]);}else{logger[_0x41a9('0xd')](_0x41a9('0xe'),_0x1c7db4,_0x41a9('0x13'));_0x3a11c9(_0x5b888b[_0x41a9('0x14')][_0x41a9('0x12')]);}})[_0x41a9('0x15')](function(_0x554a07){logger[_0x41a9('0x11')](_0x41a9('0xe'),_0x1c7db4,_0x554a07);_0x4d628a(_0x554a07);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index e79431c..4d9b394 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4a53ca,_0x4eac98){_0x4a53ca=_0x4a53ca-0x0;var _0x451cfc=_0x8d0e[_0x4a53ca];return _0x451cfc;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0x347380,_0x55914d){var _0x410b4c=function(_0x1e48a4){while(--_0x1e48a4){_0x347380['push'](_0x347380['shift']());}};_0x410b4c(++_0x55914d);}(_0x5fd1,0x155));var _0x15fd=function(_0x2a2674,_0x308160){_0x2a2674=_0x2a2674-0x0;var _0x42c11f=_0x5fd1[_0x2a2674];return _0x42c11f;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('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 fac58a6..213ab8f 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 _0x8247=['INTEGER','rrmemory','sequelize','STRING'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x8247,0x13e));var _0x7824=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x8247[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x7824('0x0'));module['exports']={'name':{'type':Sequelize[_0x7824('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7824('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7824('0x3'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0xdeb9=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x24ffb4,_0x2072aa){var _0x404ce4=function(_0x48e0c1){while(--_0x48e0c1){_0x24ffb4['push'](_0x24ffb4['shift']());}};_0x404ce4(++_0x2072aa);}(_0xdeb9,0x6a));var _0x9deb=function(_0x36a1b6,_0x5b56ef){_0x36a1b6=_0x36a1b6-0x0;var _0x5f5a09=_0xdeb9[_0x36a1b6];return _0x5f5a09;};'use strict';var Sequelize=require(_0x9deb('0x0'));module[_0x9deb('0x1')]={'name':{'type':Sequelize[_0x9deb('0x2')],'unique':_0x9deb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9deb('0x2')]},'timeout':{'type':Sequelize[_0x9deb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9deb('0x5')](_0x9deb('0x6'),_0x9deb('0x7'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4bf610d..d07d9d9 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 _0x9578=['rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','http','request','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','ChatQueues','destroy','end','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','ChatQueueId','UserChatQueue','findAll','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','from','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents'];(function(_0x3cb765,_0x3cebd0){var _0x7f6785=function(_0x551462){while(--_0x551462){_0x3cb765['push'](_0x3cb765['shift']());}};_0x7f6785(++_0x3cebd0);}(_0x9578,0x96));var _0x8957=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9578[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8957('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8957('0x1'));var rp=require(_0x8957('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8957('0x3'));var util=require(_0x8957('0x4'));var path=require(_0x8957('0x5'));var sox=require(_0x8957('0x6'));var csv=require(_0x8957('0x7'));var ejs=require(_0x8957('0x8'));var fs=require('fs');var fs_extra=require(_0x8957('0x9'));var _=require(_0x8957('0xa'));var squel=require('squel');var crypto=require(_0x8957('0xb'));var jsforce=require(_0x8957('0xc'));var deskjs=require(_0x8957('0xd'));var toCsv=require(_0x8957('0x7'));var querystring=require(_0x8957('0xe'));var Papa=require(_0x8957('0xf'));var Redis=require(_0x8957('0x10'));var authService=require(_0x8957('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8957('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8957('0x13'))(_0x8957('0x14'));var utils=require('../../config/utils');var config=require(_0x8957('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8957('0x16')]=_[_0x8957('0x17')](config[_0x8957('0x16')],{'host':_0x8957('0x18'),'port':0x18eb});var socket=require(_0x8957('0x19'))(new Redis(config[_0x8957('0x16')]));require(_0x8957('0x1a'))[_0x8957('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8957('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3e5460,_0x11bb4d,_0x51b16d,_0x138353){return new BPromise(function(_0x17a125,_0x4e50ba){var _0x5b9cbf=_0x138353||client;return _0x5b9cbf[_0x8957('0x1d')](_0x3e5460,_0x51b16d)['then'](function(_0x26a87d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x11bb4d,'request\x20sent');logger[_0x8957('0x1e')](_0x8957('0x1f'),_0x11bb4d,_0x8957('0x20'),JSON[_0x8957('0x21')](_0x26a87d));if(_0x26a87d[_0x8957('0x22')]){if(_0x26a87d[_0x8957('0x22')][_0x8957('0x23')]===0x1f4){logger[_0x8957('0x22')](_0x8957('0x24'),_0x11bb4d,_0x26a87d[_0x8957('0x22')][_0x8957('0x25')]);return _0x4e50ba(_0x26a87d['error'][_0x8957('0x25')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x11bb4d,_0x26a87d[_0x8957('0x22')][_0x8957('0x25')]);return _0x17a125(_0x26a87d['error'][_0x8957('0x25')]);}else{logger[_0x8957('0x26')](_0x8957('0x24'),_0x11bb4d,_0x8957('0x20'));_0x17a125(_0x26a87d[_0x8957('0x27')][_0x8957('0x25')]);}})[_0x8957('0x28')](function(_0x157aeb){logger[_0x8957('0x22')](_0x8957('0x24'),_0x11bb4d,_0x157aeb);_0x4e50ba(_0x157aeb);});});}function respondWithStatusCode(_0x3170de,_0x30303a){_0x30303a=_0x30303a||0xcc;return function(_0x173fde){if(_0x173fde){return _0x3170de[_0x8957('0x29')](_0x30303a);}return _0x3170de[_0x8957('0x2a')](_0x30303a)['end']();};}function respondWithResult(_0x26351a,_0x2de29c){_0x2de29c=_0x2de29c||0xc8;return function(_0x2f856b){if(_0x2f856b){return _0x26351a[_0x8957('0x2a')](_0x2de29c)[_0x8957('0x2b')](_0x2f856b);}};}function respondWithFilteredResult(_0x3a3b5d,_0x543727){return function(_0x2f021c){if(_0x2f021c){var _0x203031=typeof _0x543727[_0x8957('0x2c')]===_0x8957('0x2d')&&typeof _0x543727[_0x8957('0x2e')]===_0x8957('0x2d');var _0x5bbd23=_0x2f021c[_0x8957('0x2f')];var _0x10adb7=_0x203031?0x0:_0x543727[_0x8957('0x2c')];var _0x53e233=_0x203031?_0x2f021c[_0x8957('0x2f')]:_0x543727[_0x8957('0x2c')]+_0x543727[_0x8957('0x2e')];var _0x456da0;if(_0x53e233>=_0x5bbd23){_0x53e233=_0x5bbd23;_0x456da0=0xc8;}else{_0x456da0=0xce;}_0x3a3b5d[_0x8957('0x2a')](_0x456da0);return _0x3a3b5d[_0x8957('0x30')]('Content-Range',_0x10adb7+'-'+_0x53e233+'/'+_0x5bbd23)['json'](_0x2f021c);}return null;};}function patchUpdates(_0x435bf1){return function(_0x42aea2){try{jsonpatch['apply'](_0x42aea2,_0x435bf1,!![]);}catch(_0x4a6647){return BPromise[_0x8957('0x31')](_0x4a6647);}return _0x42aea2['save']();};}function saveUpdates(_0x4236c3,_0xc56603){return function(_0x30b1d8){if(_0x30b1d8){return _0x30b1d8['update'](_0x4236c3)['then'](function(_0x137798){return _0x137798;});}return null;};}function removeEntity(_0x4bb9e1,_0xba3b64){return function(_0x147f21){if(_0x147f21){return _0x147f21['destroy']()[_0x8957('0x32')](function(){var _0x262d6d=_0x147f21['get']({'plain':!![]});var _0x1a0875=_0x8957('0x33');return db['UserProfileResource'][_0x8957('0x34')]({'where':{'type':_0x1a0875,'resourceId':_0x262d6d['id']}})[_0x8957('0x32')](function(){return _0x147f21;});})[_0x8957('0x32')](function(){_0x4bb9e1[_0x8957('0x2a')](0xcc)[_0x8957('0x35')]();});}};}function handleEntityNotFound(_0x4beff9,_0x502c03){return function(_0x3400ba){if(!_0x3400ba){_0x4beff9['sendStatus'](0x194);}return _0x3400ba;};}function handleError(_0x52bd02,_0x4648ca){_0x4648ca=_0x4648ca||0x1f4;return function(_0x23d088){logger[_0x8957('0x22')](_0x23d088['stack']);if(_0x23d088[_0x8957('0x36')]){delete _0x23d088['name'];}_0x52bd02[_0x8957('0x2a')](_0x4648ca)[_0x8957('0x37')](_0x23d088);};}exports[_0x8957('0x38')]=function(_0x1c4ead,_0x638d38){var _0x2fd873={},_0x481b8f={},_0x54330f={'count':0x0,'rows':[]};var _0x2e3c82=_['map'](db[_0x8957('0x39')][_0x8957('0x3a')],function(_0x4c4102){return{'name':_0x4c4102[_0x8957('0x3b')],'type':_0x4c4102[_0x8957('0x3c')][_0x8957('0x3d')]};});_0x481b8f[_0x8957('0x3e')]=_[_0x8957('0x3f')](_0x2e3c82,_0x8957('0x36'));_0x481b8f[_0x8957('0x40')]=_[_0x8957('0x41')](_0x1c4ead[_0x8957('0x40')]);_0x481b8f[_0x8957('0x42')]=_[_0x8957('0x43')](_0x481b8f['model'],_0x481b8f[_0x8957('0x40')]);_0x2fd873[_0x8957('0x44')]=_[_0x8957('0x43')](_0x481b8f['model'],qs['fields'](_0x1c4ead['query']['fields']));_0x2fd873['attributes']=_0x2fd873[_0x8957('0x44')]['length']?_0x2fd873[_0x8957('0x44')]:_0x481b8f[_0x8957('0x3e')];if(!_0x1c4ead[_0x8957('0x40')][_0x8957('0x45')](_0x8957('0x46'))){_0x2fd873['limit']=qs['limit'](_0x1c4ead[_0x8957('0x40')][_0x8957('0x2e')]);_0x2fd873[_0x8957('0x2c')]=qs[_0x8957('0x2c')](_0x1c4ead[_0x8957('0x40')][_0x8957('0x2c')]);}_0x2fd873[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x1c4ead[_0x8957('0x40')][_0x8957('0x48')]);_0x2fd873[_0x8957('0x49')]=qs[_0x8957('0x42')](_['pick'](_0x1c4ead['query'],_0x481b8f[_0x8957('0x42')]),_0x2e3c82);if(_0x1c4ead[_0x8957('0x40')]['filter']){_0x2fd873[_0x8957('0x49')]=_[_0x8957('0x4a')](_0x2fd873[_0x8957('0x49')],{'$or':_['map'](_0x2e3c82,function(_0x2d0d3d){if(_0x2d0d3d[_0x8957('0x3c')]!==_0x8957('0x4b')){var _0x607a86={};_0x607a86[_0x2d0d3d[_0x8957('0x36')]]={'$like':'%'+_0x1c4ead[_0x8957('0x40')][_0x8957('0x4c')]+'%'};return _0x607a86;}})});}_0x2fd873=_[_0x8957('0x4a')]({},_0x2fd873,_0x1c4ead[_0x8957('0x4d')]);var _0x24ca09={'where':_0x2fd873[_0x8957('0x49')]};return db['ChatQueue'][_0x8957('0x2f')](_0x24ca09)[_0x8957('0x32')](function(_0x2cd6c4){_0x54330f['count']=_0x2cd6c4;if(_0x1c4ead[_0x8957('0x40')][_0x8957('0x4e')]){_0x2fd873[_0x8957('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x2fd873);})['then'](function(_0x1f2b97){_0x54330f[_0x8957('0x50')]=_0x1f2b97;return _0x54330f;})[_0x8957('0x32')](respondWithFilteredResult(_0x638d38,_0x2fd873))[_0x8957('0x28')](handleError(_0x638d38,null));};exports['show']=function(_0x5ae477,_0x5da1cd){var _0x45dff4={'raw':!![],'where':{'id':_0x5ae477[_0x8957('0x51')]['id']}},_0x388441={};_0x388441['model']=_[_0x8957('0x41')](db[_0x8957('0x39')][_0x8957('0x3a')]);_0x388441[_0x8957('0x40')]=_[_0x8957('0x41')](_0x5ae477[_0x8957('0x40')]);_0x388441['filters']=_['intersection'](_0x388441[_0x8957('0x3e')],_0x388441[_0x8957('0x40')]);_0x45dff4[_0x8957('0x44')]=_['intersection'](_0x388441['model'],qs[_0x8957('0x52')](_0x5ae477[_0x8957('0x40')]['fields']));_0x45dff4[_0x8957('0x44')]=_0x45dff4[_0x8957('0x44')][_0x8957('0x53')]?_0x45dff4['attributes']:_0x388441[_0x8957('0x3e')];if(_0x5ae477[_0x8957('0x40')][_0x8957('0x4e')]){_0x45dff4[_0x8957('0x4f')]=[{'all':!![]}];}_0x45dff4=_[_0x8957('0x4a')]({},_0x45dff4,_0x5ae477[_0x8957('0x4d')]);return db[_0x8957('0x39')][_0x8957('0x54')](_0x45dff4)[_0x8957('0x32')](handleEntityNotFound(_0x5da1cd,null))[_0x8957('0x32')](respondWithResult(_0x5da1cd,null))[_0x8957('0x28')](handleError(_0x5da1cd,null));};exports[_0x8957('0x55')]=function(_0x295915,_0x423f78){return db[_0x8957('0x39')][_0x8957('0x55')](_0x295915[_0x8957('0x56')],{})[_0x8957('0x32')](function(_0xc56038){var _0x4ec3c4=_0x295915[_0x8957('0x57')][_0x8957('0x58')]({'plain':!![]});if(!_0x4ec3c4)throw new Error(_0x8957('0x59'));if(_0x4ec3c4[_0x8957('0x5a')]===_0x8957('0x57')){var _0x1911c3=_0xc56038[_0x8957('0x58')]({'plain':!![]});var _0xa5ee1b='ChatQueues';return db[_0x8957('0x5b')]['find']({'where':{'name':_0xa5ee1b,'userProfileId':_0x4ec3c4[_0x8957('0x5c')]},'raw':!![]})[_0x8957('0x32')](function(_0x2988bc){if(_0x2988bc&&_0x2988bc['autoAssociation']===0x0){return db[_0x8957('0x5d')]['create']({'name':_0x1911c3['name'],'resourceId':_0x1911c3['id'],'type':_0x2988bc[_0x8957('0x36')],'sectionId':_0x2988bc['id']},{})[_0x8957('0x32')](function(){return _0xc56038;});}else{return _0xc56038;}})[_0x8957('0x28')](function(_0x2fa4b8){logger['error'](_0x8957('0x5e'),_0x2fa4b8);throw _0x2fa4b8;});}return _0xc56038;})[_0x8957('0x32')](respondWithResult(_0x423f78,0xc9))[_0x8957('0x28')](handleError(_0x423f78,null));};exports[_0x8957('0x5f')]=function(_0x2d8780,_0x50309d){if(_0x2d8780[_0x8957('0x56')]['id']){delete _0x2d8780[_0x8957('0x56')]['id'];}return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x2d8780['params']['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x50309d,null))['then'](saveUpdates(_0x2d8780[_0x8957('0x56')],null))['then'](respondWithResult(_0x50309d,null))[_0x8957('0x28')](handleError(_0x50309d,null));};exports[_0x8957('0x34')]=function(_0x3ade11,_0x2accad){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x3ade11[_0x8957('0x51')]['id']}})['then'](handleEntityNotFound(_0x2accad,null))[_0x8957('0x32')](removeEntity(_0x2accad,null))[_0x8957('0x28')](handleError(_0x2accad,null));};exports[_0x8957('0x60')]=function(_0x53b325,_0x345c5d){return db[_0x8957('0x39')]['describe']()[_0x8957('0x32')](respondWithResult(_0x345c5d,null))[_0x8957('0x28')](handleError(_0x345c5d,null));};exports['getMembers']=function(_0xc61f9e,_0x1d08dc,_0x583d00){var _0x244559={'raw':!![],'where':{}},_0x324e5e={},_0x4af6df;return db[_0x8957('0x39')][_0x8957('0x61')]({'where':{'id':_0xc61f9e['params']['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x1d08dc,null))[_0x8957('0x32')](function(_0x2fc0d1){if(_0x2fc0d1){_0x4af6df=_0x2fc0d1[_0x8957('0x58')]({'plain':!![]});_0x324e5e['model']=_[_0x8957('0x41')](db['UserChatQueue'][_0x8957('0x3a')]);_0x324e5e[_0x8957('0x40')]=_[_0x8957('0x41')](_0xc61f9e[_0x8957('0x40')]);_0x324e5e['filters']=_['intersection'](_0x324e5e[_0x8957('0x3e')],_0x324e5e[_0x8957('0x40')]);_0x244559[_0x8957('0x44')]=_[_0x8957('0x43')](_0x324e5e[_0x8957('0x3e')],qs['fields'](_0xc61f9e[_0x8957('0x40')][_0x8957('0x52')]));_0x244559['attributes']=_0x244559[_0x8957('0x44')]['length']?_0x244559[_0x8957('0x44')]:_0x324e5e[_0x8957('0x3e')];if(!_0xc61f9e[_0x8957('0x40')]['hasOwnProperty'](_0x8957('0x46'))){_0x244559[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0xc61f9e['query'][_0x8957('0x2e')]);_0x244559['offset']=qs[_0x8957('0x2c')](_0xc61f9e['query']['offset']);}_0x244559[_0x8957('0x47')]=qs[_0x8957('0x48')](_0xc61f9e[_0x8957('0x40')][_0x8957('0x48')]);_0x244559['where']=qs[_0x8957('0x42')](_['pick'](_0xc61f9e['query'],_0x324e5e['filters']));_0x244559[_0x8957('0x49')][_0x8957('0x62')]=_0x2fc0d1['id'];if(_0xc61f9e['query'][_0x8957('0x4c')]){_0x244559[_0x8957('0x49')]=_['merge'](_0x244559[_0x8957('0x49')],{'$or':_[_0x8957('0x3f')](_0x244559[_0x8957('0x44')],function(_0x4af118){var _0x35ed92={};_0x35ed92[_0x4af118]={'$like':'%'+_0xc61f9e[_0x8957('0x40')]['filter']+'%'};return _0x35ed92;})});}_0x244559=_[_0x8957('0x4a')]({},_0x244559,_0xc61f9e['options']);return db[_0x8957('0x63')][_0x8957('0x64')](_0x244559);}})[_0x8957('0x32')](function(_0x1b8e5a){if(_0x1b8e5a){return db[_0x8957('0x65')]['findAndCountAll']({'where':{'id':_[_0x8957('0x3f')](_0x1b8e5a,_0x8957('0x66')),'role':_0x8957('0x67')},'attributes':['id',_0x8957('0x36'),'chatPause',_0x8957('0x68'),_0x8957('0x69')]});}})[_0x8957('0x32')](function(_0x1a0cf6){if(_0x1a0cf6){return{'count':_0x1a0cf6[_0x8957('0x2f')],'rows':_[_0x8957('0x3f')](_0x1a0cf6[_0x8957('0x50')],function(_0x3c6a09){return{'membername':_0x3c6a09[_0x8957('0x36')],'UserId':_0x3c6a09['id'],'queue_name':_0x4af6df[_0x8957('0x36')],'ChatQueueId':_0x4af6df['id'],'interface':util[_0x8957('0x6a')](_0x8957('0x6b'),_0x8957('0x6c'),_0x3c6a09['name']),'penalty':0x0,'paused':_0x3c6a09['chatPause'],'createdAt':_0x3c6a09[_0x8957('0x69')],'updatedAt':_0x3c6a09[_0x8957('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8957('0x32')](respondWithFilteredResult(_0x1d08dc,_0x244559))['catch'](handleError(_0x1d08dc,null));};exports[_0x8957('0x6d')]=function(_0x27b9d6,_0x490810,_0x458771){var _0x7d7f08={};var _0x5e8031={};var _0x26f3f9;var _0x11df7e;return db['ChatQueue'][_0x8957('0x61')]({'where':{'id':_0x27b9d6[_0x8957('0x51')]['id']}})['then'](handleEntityNotFound(_0x490810,null))[_0x8957('0x32')](function(_0x30747f){if(_0x30747f){_0x26f3f9=_0x30747f;_0x5e8031[_0x8957('0x3e')]=_['keys'](db[_0x8957('0x6e')][_0x8957('0x3a')]);_0x5e8031['query']=_[_0x8957('0x41')](_0x27b9d6[_0x8957('0x40')]);_0x5e8031[_0x8957('0x42')]=_['intersection'](_0x5e8031[_0x8957('0x3e')],_0x5e8031['query']);_0x7d7f08[_0x8957('0x44')]=_['intersection'](_0x5e8031['model'],qs[_0x8957('0x52')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x52')]));_0x7d7f08['attributes']=_0x7d7f08[_0x8957('0x44')][_0x8957('0x53')]?_0x7d7f08[_0x8957('0x44')]:_0x5e8031[_0x8957('0x3e')];_0x7d7f08[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x27b9d6[_0x8957('0x40')]['sort']);_0x7d7f08[_0x8957('0x49')]=qs[_0x8957('0x42')](_[_0x8957('0x6f')](_0x27b9d6[_0x8957('0x40')],_0x5e8031[_0x8957('0x42')]));if(_0x27b9d6['query']['filter']){_0x7d7f08['where']=_[_0x8957('0x4a')](_0x7d7f08[_0x8957('0x49')],{'$or':_[_0x8957('0x3f')](_0x7d7f08['attributes'],function(_0x3b53c3){var _0xe2ebca={};_0xe2ebca[_0x3b53c3]={'$like':'%'+_0x27b9d6[_0x8957('0x40')][_0x8957('0x4c')]+'%'};return _0xe2ebca;})});}_0x7d7f08=_[_0x8957('0x4a')]({},_0x7d7f08,_0x27b9d6[_0x8957('0x4d')]);return _0x26f3f9[_0x8957('0x6d')](_0x7d7f08);}})['then'](function(_0x1998f8){if(_0x1998f8){_0x11df7e=_0x1998f8[_0x8957('0x53')];if(!_0x27b9d6['query'][_0x8957('0x45')](_0x8957('0x46'))){_0x7d7f08[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x2e')]);_0x7d7f08['offset']=qs[_0x8957('0x2c')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x2c')]);}return _0x26f3f9[_0x8957('0x6d')](_0x7d7f08);}})['then'](function(_0x17801c){if(_0x17801c){return _0x17801c?{'count':_0x11df7e,'rows':_0x17801c}:null;}})[_0x8957('0x32')](respondWithResult(_0x490810,null))[_0x8957('0x28')](handleError(_0x490810,null));};exports[_0x8957('0x70')]=function(_0x1a7aa5,_0x450391,_0x3d76db){var _0x38803a=_0x1a7aa5['body'][_0x8957('0x71')];return db[_0x8957('0x6e')][_0x8957('0x64')]({'where':{'id':_0x38803a},'attributes':['id'],'include':[{'model':db[_0x8957('0x65')],'as':_0x8957('0x72'),'attributes':['id',_0x8957('0x36'),_0x8957('0x73'),'voicePause',_0x8957('0x74')],'raw':!![]}]})[_0x8957('0x32')](function(_0x46d875){if(_0x46d875){var _0x24bcfc=_[_0x8957('0x75')](_0x46d875,function(_0x34a486){var _0x3c8a21=_0x34a486['get']({'plain':!![]});return _0x3c8a21[_0x8957('0x72')];});return db['ChatQueue'][_0x8957('0x54')]({'where':{'id':_0x1a7aa5['params']['id']}})[_0x8957('0x32')](function(_0x5bd011){return db[_0x8957('0x76')][_0x8957('0x77')](function(_0x411eb5){return _0x5bd011[_0x8957('0x70')](_0x38803a,{'transaction':_0x411eb5})[_0x8957('0x32')](function(){return BPromise[_0x8957('0x78')](_0x24bcfc,function(_0x22bad1){return db['UserChatQueue'][_0x8957('0x79')]({'where':{'UserId':_0x22bad1['id'],'ChatQueueId':_0x1a7aa5['params']['id']},'transaction':_0x411eb5});});})['then'](function(){_0x24bcfc[_0x8957('0x7a')](function(_0x22c0e8){socket[_0x8957('0x7b')](_0x8957('0x7c'),{'UserId':_0x22c0e8['id'],'ChatQueueId':_0x5bd011['id']});});});});});}})['then'](respondWithStatusCode(_0x450391,null))['catch'](handleError(_0x450391,null));};exports['removeTeams']=function(_0x170738,_0x429006,_0x48be85){return db[_0x8957('0x6e')][_0x8957('0x64')]({'where':{'id':_0x170738[_0x8957('0x40')][_0x8957('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8957('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8957('0x32')](handleEntityNotFound(_0x429006,null))[_0x8957('0x32')](function(_0x5ea1cb){var _0x183903=_[_0x8957('0x3f')](_0x5ea1cb,'id');var _0x2c0b8a=[];var _0x29ede0=[];var _0x592131=squel[_0x8957('0x7d')]();_0x592131[_0x8957('0x7e')]('tq.TeamId')[_0x8957('0x7f')](_0x8957('0x80'),'tq')[_0x8957('0x81')](_0x8957('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x170738[_0x8957('0x51')]['id']);for(var _0x45dd75=0x0;_0x45dd75<_0x5ea1cb[_0x8957('0x53')];_0x45dd75+=0x1){let _0xd7d0e7=_0x5ea1cb[_0x45dd75];for(var _0x4db31a=0x0;_0x4db31a<_0xd7d0e7[_0x8957('0x72')][_0x8957('0x53')];_0x4db31a+=0x1){let _0x5f0180=_0xd7d0e7[_0x8957('0x72')][_0x4db31a];var _0x27de4c=_0x592131[_0x8957('0x83')]();_0x27de4c[_0x8957('0x49')](_0x8957('0x84'),_0x5f0180['id']);_0x29ede0[_0x8957('0x85')](db[_0x8957('0x76')][_0x8957('0x40')](_0x27de4c[_0x8957('0x86')](),{'type':db[_0x8957('0x76')][_0x8957('0x87')][_0x8957('0x88')]})[_0x8957('0x32')](function(_0x28f973){if(_0x28f973[_0x8957('0x53')]===0x1){return _0x5f0180['id'];}else{var _0x9bdcb8=_[_0x8957('0x89')](_[_0x8957('0x3f')](_0x28f973,_0x8957('0x8a')),function(_0x3858c3){return _[_0x8957('0x8b')](_0x183903,_0x3858c3);});if(_0x9bdcb8){return _0x5f0180['id'];}}}));}}return BPromise[_0x8957('0x8c')](_0x29ede0)['then'](function(_0x3bf7d3){_0x2c0b8a=_(_0x2c0b8a)['union'](_0x3bf7d3)[_0x8957('0x8d')]()[_0x8957('0x8e')]();return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x170738[_0x8957('0x51')]['id']}})[_0x8957('0x32')](function(_0xf31a63){return db[_0x8957('0x76')][_0x8957('0x77')](function(_0x7155e5){return _0xf31a63['removeTeams'](_0x170738['query'][_0x8957('0x71')],{'transaction':_0x7155e5})['then'](function(){if(!_[_0x8957('0x8f')](_0x2c0b8a)){return _0xf31a63[_0x8957('0x90')](_0x2c0b8a,{'transaction':_0x7155e5});}})['then'](function(){_0x2c0b8a[_0x8957('0x7a')](function(_0x299eae){socket[_0x8957('0x7b')](_0x8957('0x91'),{'UserId':_0x299eae,'ChatQueueId':_0xf31a63['id']});});});});});});})[_0x8957('0x32')](respondWithStatusCode(_0x429006,null))['catch'](handleError(_0x429006,null));};exports[_0x8957('0x92')]=function(_0x41c583,_0xa28514,_0x1f5221){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x41c583[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0xa28514,null))[_0x8957('0x32')](function(_0x5e9eea){if(_0x5e9eea){return _0x5e9eea[_0x8957('0x92')](_0x41c583[_0x8957('0x56')][_0x8957('0x71')],_['omit'](_0x41c583[_0x8957('0x56')],[_0x8957('0x71'),'id'])||{})[_0x8957('0x93')](function(_0x51982d){for(var _0x15889a=0x0;_0x15889a<_0x41c583['body'][_0x8957('0x71')][_0x8957('0x53')];_0x15889a+=0x1){socket[_0x8957('0x7b')]('userChatQueue:save',{'UserId':Number(_0x41c583[_0x8957('0x56')][_0x8957('0x71')][_0x15889a]),'ChatQueueId':Number(_0x41c583['params']['id'])});}return _0x51982d;});}})['then'](respondWithResult(_0xa28514,null))[_0x8957('0x28')](handleError(_0xa28514,null));};exports[_0x8957('0x90')]=function(_0x36bea4,_0x4658f5,_0x312f48){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x36bea4[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x4658f5,null))[_0x8957('0x32')](function(_0x5e2c66){if(_0x5e2c66){return _0x5e2c66[_0x8957('0x90')](_0x36bea4[_0x8957('0x40')]['ids'])[_0x8957('0x32')](function(){if(_[_0x8957('0x94')](_0x36bea4[_0x8957('0x40')][_0x8957('0x71')])){for(var _0x1d0292=0x0;_0x1d0292<_0x36bea4[_0x8957('0x40')][_0x8957('0x71')]['length'];_0x1d0292+=0x1){socket[_0x8957('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x36bea4['query'][_0x8957('0x71')][_0x1d0292]),'ChatQueueId':Number(_0x36bea4[_0x8957('0x51')]['id'])});}}else{socket[_0x8957('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x36bea4['query'][_0x8957('0x71')]),'ChatQueueId':Number(_0x36bea4[_0x8957('0x51')]['id'])});}});}})[_0x8957('0x32')](respondWithStatusCode(_0x4658f5,null))['catch'](handleError(_0x4658f5,null));};exports[_0x8957('0x95')]=function(_0x537298,_0x49fcbc,_0x24979e){var _0xcf80c0={};var _0x99bc8a={};var _0x7c9fe7;var _0x4251e0;return db[_0x8957('0x39')][_0x8957('0x61')]({'where':{'id':_0x537298[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x49fcbc,null))[_0x8957('0x32')](function(_0x4bb36a){if(_0x4bb36a){_0x7c9fe7=_0x4bb36a;_0x99bc8a[_0x8957('0x3e')]=_[_0x8957('0x41')](db[_0x8957('0x65')]['rawAttributes']);_0x99bc8a[_0x8957('0x40')]=_[_0x8957('0x41')](_0x537298['query']);_0x99bc8a[_0x8957('0x42')]=_[_0x8957('0x43')](_0x99bc8a[_0x8957('0x3e')],_0x99bc8a[_0x8957('0x40')]);_0xcf80c0[_0x8957('0x44')]=_[_0x8957('0x43')](_0x99bc8a[_0x8957('0x3e')],qs[_0x8957('0x52')](_0x537298[_0x8957('0x40')][_0x8957('0x52')]));_0xcf80c0[_0x8957('0x44')]=_0xcf80c0[_0x8957('0x44')][_0x8957('0x53')]?_0xcf80c0[_0x8957('0x44')]:_0x99bc8a[_0x8957('0x3e')];_0xcf80c0[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x537298[_0x8957('0x40')][_0x8957('0x48')]);_0xcf80c0[_0x8957('0x49')]=qs[_0x8957('0x42')](_['pick'](_0x537298['query'],_0x99bc8a[_0x8957('0x42')]));if(_0x537298[_0x8957('0x40')][_0x8957('0x4c')]){_0xcf80c0[_0x8957('0x49')]=_['merge'](_0xcf80c0['where'],{'$or':_[_0x8957('0x3f')](_0xcf80c0[_0x8957('0x44')],function(_0x2a9da6){var _0xf06866={};_0xf06866[_0x2a9da6]={'$like':'%'+_0x537298[_0x8957('0x40')]['filter']+'%'};return _0xf06866;})});}_0xcf80c0=_[_0x8957('0x4a')]({},_0xcf80c0,_0x537298[_0x8957('0x4d')]);return _0x7c9fe7[_0x8957('0x95')](_0xcf80c0);}})[_0x8957('0x32')](function(_0x513be4){if(_0x513be4){_0x4251e0=_0x513be4['length'];if(!_0x537298[_0x8957('0x40')]['hasOwnProperty'](_0x8957('0x46'))){_0xcf80c0[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0x537298['query']['limit']);_0xcf80c0[_0x8957('0x2c')]=qs[_0x8957('0x2c')](_0x537298[_0x8957('0x40')][_0x8957('0x2c')]);}return _0x7c9fe7[_0x8957('0x95')](_0xcf80c0);}})[_0x8957('0x32')](function(_0x2eb43d){if(_0x2eb43d){return _0x2eb43d?{'count':_0x4251e0,'rows':_0x2eb43d}:null;}})['then'](respondWithResult(_0x49fcbc,null))[_0x8957('0x28')](handleError(_0x49fcbc,null));};
\ No newline at end of file
+var _0xcda8=['ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','then','info','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','end','name','send','index','map','ChatQueue','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','Agents','online','flatMap','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcda8,0xae));var _0x8cda=function(_0x44db0b,_0xa3ed2b){_0x44db0b=_0x44db0b-0x0;var _0x41e3c1=_0xcda8[_0x44db0b];return _0x41e3c1;};'use strict';var emlformat=require(_0x8cda('0x0'));var rimraf=require(_0x8cda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cda('0x2'));var rp=require(_0x8cda('0x3'));var moment=require(_0x8cda('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8cda('0x5'));var util=require(_0x8cda('0x6'));var path=require(_0x8cda('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8cda('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cda('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8cda('0xa'));var deskjs=require(_0x8cda('0xb'));var toCsv=require(_0x8cda('0xc'));var querystring=require('querystring');var Papa=require(_0x8cda('0xd'));var Redis=require(_0x8cda('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8cda('0xf'));var as=require(_0x8cda('0x10'));var hardwareService=require(_0x8cda('0x11'));var logger=require(_0x8cda('0x12'))(_0x8cda('0x13'));var utils=require(_0x8cda('0x14'));var config=require(_0x8cda('0x15'));var licenseUtil=require(_0x8cda('0x16'));var db=require(_0x8cda('0x17'))['db'];config[_0x8cda('0x18')]=_[_0x8cda('0x19')](config['redis'],{'host':_0x8cda('0x1a'),'port':0x18eb});var socket=require(_0x8cda('0x1b'))(new Redis(config['redis']));require(_0x8cda('0x1c'))[_0x8cda('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8cda('0x1e')][_0x8cda('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3d6774,_0x23cbf2,_0x2de49e,_0x350393){return new BPromise(function(_0x1c69bb,_0x5a79bf){var _0x33a9c0=_0x350393||client;return _0x33a9c0['request'](_0x3d6774,_0x2de49e)[_0x8cda('0x20')](function(_0x4dc95b){logger[_0x8cda('0x21')]('ChatQueue,\x20%s,\x20%s',_0x23cbf2,'request\x20sent');logger['debug'](_0x8cda('0x22'),_0x23cbf2,'request\x20sent',JSON[_0x8cda('0x23')](_0x4dc95b));if(_0x4dc95b[_0x8cda('0x24')]){if(_0x4dc95b['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x23cbf2,_0x4dc95b['error']['message']);return _0x5a79bf(_0x4dc95b['error'][_0x8cda('0x25')]);}logger[_0x8cda('0x24')](_0x8cda('0x26'),_0x23cbf2,_0x4dc95b[_0x8cda('0x24')]['message']);return _0x1c69bb(_0x4dc95b[_0x8cda('0x24')][_0x8cda('0x25')]);}else{logger[_0x8cda('0x21')](_0x8cda('0x26'),_0x23cbf2,'request\x20sent');_0x1c69bb(_0x4dc95b[_0x8cda('0x27')][_0x8cda('0x25')]);}})[_0x8cda('0x28')](function(_0x16c6f4){logger[_0x8cda('0x24')]('ChatQueue,\x20%s,\x20%s',_0x23cbf2,_0x16c6f4);_0x5a79bf(_0x16c6f4);});});}function respondWithStatusCode(_0x317ae5,_0x37a196){_0x37a196=_0x37a196||0xcc;return function(_0x414f6f){if(_0x414f6f){return _0x317ae5[_0x8cda('0x29')](_0x37a196);}return _0x317ae5[_0x8cda('0x2a')](_0x37a196)['end']();};}function respondWithResult(_0x197186,_0x4b7c41){_0x4b7c41=_0x4b7c41||0xc8;return function(_0x4da37d){if(_0x4da37d){return _0x197186[_0x8cda('0x2a')](_0x4b7c41)[_0x8cda('0x2b')](_0x4da37d);}};}function respondWithFilteredResult(_0x370945,_0x38c810){return function(_0x1977f4){if(_0x1977f4){var _0x13bdc0=typeof _0x38c810[_0x8cda('0x2c')]==='undefined'&&typeof _0x38c810[_0x8cda('0x2d')]===_0x8cda('0x2e');var _0x560514=_0x1977f4[_0x8cda('0x2f')];var _0x5dc0b5=_0x13bdc0?0x0:_0x38c810['offset'];var _0x4be0bc=_0x13bdc0?_0x1977f4[_0x8cda('0x2f')]:_0x38c810['offset']+_0x38c810[_0x8cda('0x2d')];var _0x55bd8e;if(_0x4be0bc>=_0x560514){_0x4be0bc=_0x560514;_0x55bd8e=0xc8;}else{_0x55bd8e=0xce;}_0x370945[_0x8cda('0x2a')](_0x55bd8e);return _0x370945[_0x8cda('0x30')](_0x8cda('0x31'),_0x5dc0b5+'-'+_0x4be0bc+'/'+_0x560514)[_0x8cda('0x2b')](_0x1977f4);}return null;};}function patchUpdates(_0x23117d){return function(_0x47de89){try{jsonpatch[_0x8cda('0x32')](_0x47de89,_0x23117d,!![]);}catch(_0x4c45db){return BPromise[_0x8cda('0x33')](_0x4c45db);}return _0x47de89[_0x8cda('0x34')]();};}function saveUpdates(_0x2bf076,_0x34ca95){return function(_0x167de5){if(_0x167de5){return _0x167de5['update'](_0x2bf076)[_0x8cda('0x20')](function(_0x546deb){return _0x546deb;});}return null;};}function removeEntity(_0x39402f,_0xa6ec07){return function(_0x3f1722){if(_0x3f1722){return _0x3f1722[_0x8cda('0x35')]()[_0x8cda('0x20')](function(){var _0x3689a0=_0x3f1722[_0x8cda('0x36')]({'plain':!![]});var _0x11df3e='ChatQueues';return db['UserProfileResource'][_0x8cda('0x35')]({'where':{'type':_0x11df3e,'resourceId':_0x3689a0['id']}})[_0x8cda('0x20')](function(){return _0x3f1722;});})['then'](function(){_0x39402f['status'](0xcc)[_0x8cda('0x37')]();});}};}function handleEntityNotFound(_0x3a383f,_0x5614dc){return function(_0x4af9d3){if(!_0x4af9d3){_0x3a383f['sendStatus'](0x194);}return _0x4af9d3;};}function handleError(_0x77ef49,_0x17e0f9){_0x17e0f9=_0x17e0f9||0x1f4;return function(_0x136ef7){logger['error'](_0x136ef7['stack']);if(_0x136ef7[_0x8cda('0x38')]){delete _0x136ef7[_0x8cda('0x38')];}_0x77ef49[_0x8cda('0x2a')](_0x17e0f9)[_0x8cda('0x39')](_0x136ef7);};}exports[_0x8cda('0x3a')]=function(_0x2ab9bc,_0x5da9cd){var _0x2464f5={},_0x2b7dbe={},_0x12a4a6={'count':0x0,'rows':[]};var _0x28d854=_[_0x8cda('0x3b')](db[_0x8cda('0x3c')][_0x8cda('0x3d')],function(_0x8adf09){return{'name':_0x8adf09['fieldName'],'type':_0x8adf09[_0x8cda('0x3e')][_0x8cda('0x3f')]};});_0x2b7dbe[_0x8cda('0x40')]=_[_0x8cda('0x3b')](_0x28d854,_0x8cda('0x38'));_0x2b7dbe['query']=_[_0x8cda('0x41')](_0x2ab9bc[_0x8cda('0x42')]);_0x2b7dbe[_0x8cda('0x43')]=_[_0x8cda('0x44')](_0x2b7dbe['model'],_0x2b7dbe['query']);_0x2464f5['attributes']=_['intersection'](_0x2b7dbe[_0x8cda('0x40')],qs[_0x8cda('0x45')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x45')]));_0x2464f5['attributes']=_0x2464f5['attributes']['length']?_0x2464f5[_0x8cda('0x46')]:_0x2b7dbe[_0x8cda('0x40')];if(!_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x47')](_0x8cda('0x48'))){_0x2464f5[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x2464f5['offset']=qs['offset'](_0x2ab9bc['query'][_0x8cda('0x2c')]);}_0x2464f5[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x2464f5[_0x8cda('0x4b')]=qs[_0x8cda('0x43')](_[_0x8cda('0x4c')](_0x2ab9bc[_0x8cda('0x42')],_0x2b7dbe['filters']),_0x28d854);if(_0x2ab9bc['query'][_0x8cda('0x4d')]){_0x2464f5[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x2464f5['where'],{'$or':_[_0x8cda('0x3b')](_0x28d854,function(_0x27287e){if(_0x27287e[_0x8cda('0x3e')]!==_0x8cda('0x4f')){var _0x323e33={};_0x323e33[_0x27287e[_0x8cda('0x38')]]={'$like':'%'+_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x323e33;}})});}_0x2464f5=_['merge']({},_0x2464f5,_0x2ab9bc['options']);var _0x317d18={'where':_0x2464f5[_0x8cda('0x4b')]};return db[_0x8cda('0x3c')][_0x8cda('0x2f')](_0x317d18)['then'](function(_0x3441d9){_0x12a4a6[_0x8cda('0x2f')]=_0x3441d9;if(_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x50')]){_0x2464f5[_0x8cda('0x51')]=[{'all':!![]}];}return db[_0x8cda('0x3c')]['findAll'](_0x2464f5);})[_0x8cda('0x20')](function(_0x2759a2){_0x12a4a6[_0x8cda('0x52')]=_0x2759a2;return _0x12a4a6;})['then'](respondWithFilteredResult(_0x5da9cd,_0x2464f5))[_0x8cda('0x28')](handleError(_0x5da9cd,null));};exports[_0x8cda('0x53')]=function(_0x3e20f6,_0x30cbad){var _0x21c676={'raw':!![],'where':{'id':_0x3e20f6[_0x8cda('0x54')]['id']}},_0x15ce5b={};_0x15ce5b[_0x8cda('0x40')]=_[_0x8cda('0x41')](db[_0x8cda('0x3c')][_0x8cda('0x3d')]);_0x15ce5b[_0x8cda('0x42')]=_[_0x8cda('0x41')](_0x3e20f6['query']);_0x15ce5b['filters']=_[_0x8cda('0x44')](_0x15ce5b[_0x8cda('0x40')],_0x15ce5b[_0x8cda('0x42')]);_0x21c676['attributes']=_[_0x8cda('0x44')](_0x15ce5b[_0x8cda('0x40')],qs[_0x8cda('0x45')](_0x3e20f6[_0x8cda('0x42')][_0x8cda('0x45')]));_0x21c676[_0x8cda('0x46')]=_0x21c676['attributes'][_0x8cda('0x55')]?_0x21c676['attributes']:_0x15ce5b['model'];if(_0x3e20f6[_0x8cda('0x42')][_0x8cda('0x50')]){_0x21c676['include']=[{'all':!![]}];}_0x21c676=_['merge']({},_0x21c676,_0x3e20f6[_0x8cda('0x56')]);return db[_0x8cda('0x3c')]['find'](_0x21c676)[_0x8cda('0x20')](handleEntityNotFound(_0x30cbad,null))[_0x8cda('0x20')](respondWithResult(_0x30cbad,null))[_0x8cda('0x28')](handleError(_0x30cbad,null));};exports[_0x8cda('0x57')]=function(_0x3d623c,_0x583b1e){return db[_0x8cda('0x3c')]['create'](_0x3d623c[_0x8cda('0x58')],{})[_0x8cda('0x20')](function(_0x4d110e){var _0x437613=_0x3d623c[_0x8cda('0x59')][_0x8cda('0x36')]({'plain':!![]});if(!_0x437613)throw new Error(_0x8cda('0x5a'));if(_0x437613[_0x8cda('0x5b')]===_0x8cda('0x59')){var _0x431598=_0x4d110e[_0x8cda('0x36')]({'plain':!![]});var _0x5f29af='ChatQueues';return db['UserProfileSection'][_0x8cda('0x5c')]({'where':{'name':_0x5f29af,'userProfileId':_0x437613['userProfileId']},'raw':!![]})[_0x8cda('0x20')](function(_0x5c97cd){if(_0x5c97cd&&_0x5c97cd[_0x8cda('0x5d')]===0x0){return db[_0x8cda('0x5e')][_0x8cda('0x57')]({'name':_0x431598['name'],'resourceId':_0x431598['id'],'type':_0x5c97cd[_0x8cda('0x38')],'sectionId':_0x5c97cd['id']},{})['then'](function(){return _0x4d110e;});}else{return _0x4d110e;}})['catch'](function(_0x270054){logger[_0x8cda('0x24')](_0x8cda('0x5f'),_0x270054);throw _0x270054;});}return _0x4d110e;})[_0x8cda('0x20')](respondWithResult(_0x583b1e,0xc9))[_0x8cda('0x28')](handleError(_0x583b1e,null));};exports[_0x8cda('0x60')]=function(_0x859e1e,_0x10bdd8){if(_0x859e1e[_0x8cda('0x58')]['id']){delete _0x859e1e[_0x8cda('0x58')]['id'];}return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x859e1e[_0x8cda('0x54')]['id']}})['then'](handleEntityNotFound(_0x10bdd8,null))[_0x8cda('0x20')](saveUpdates(_0x859e1e[_0x8cda('0x58')],null))[_0x8cda('0x20')](respondWithResult(_0x10bdd8,null))['catch'](handleError(_0x10bdd8,null));};exports[_0x8cda('0x35')]=function(_0x526987,_0x4839a0){return db[_0x8cda('0x3c')]['find']({'where':{'id':_0x526987[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x4839a0,null))[_0x8cda('0x20')](removeEntity(_0x4839a0,null))['catch'](handleError(_0x4839a0,null));};exports[_0x8cda('0x61')]=function(_0x32adef,_0x50c686){return db[_0x8cda('0x3c')][_0x8cda('0x61')]()['then'](respondWithResult(_0x50c686,null))[_0x8cda('0x28')](handleError(_0x50c686,null));};exports['getMembers']=function(_0x4a86e7,_0x5bbf4c,_0x2471a0){var _0x152d02={'raw':!![],'where':{}},_0x1986b2={},_0x5d3f96;return db['ChatQueue'][_0x8cda('0x62')]({'where':{'id':_0x4a86e7[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x5bbf4c,null))[_0x8cda('0x20')](function(_0x5a00f8){if(_0x5a00f8){_0x5d3f96=_0x5a00f8[_0x8cda('0x36')]({'plain':!![]});_0x1986b2[_0x8cda('0x40')]=_['keys'](db[_0x8cda('0x63')][_0x8cda('0x3d')]);_0x1986b2[_0x8cda('0x42')]=_[_0x8cda('0x41')](_0x4a86e7[_0x8cda('0x42')]);_0x1986b2[_0x8cda('0x43')]=_['intersection'](_0x1986b2[_0x8cda('0x40')],_0x1986b2[_0x8cda('0x42')]);_0x152d02[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x1986b2['model'],qs['fields'](_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x45')]));_0x152d02[_0x8cda('0x46')]=_0x152d02[_0x8cda('0x46')][_0x8cda('0x55')]?_0x152d02[_0x8cda('0x46')]:_0x1986b2[_0x8cda('0x40')];if(!_0x4a86e7[_0x8cda('0x42')]['hasOwnProperty'](_0x8cda('0x48'))){_0x152d02[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x152d02[_0x8cda('0x2c')]=qs[_0x8cda('0x2c')](_0x4a86e7['query']['offset']);}_0x152d02['order']=qs['sort'](_0x4a86e7['query']['sort']);_0x152d02[_0x8cda('0x4b')]=qs['filters'](_[_0x8cda('0x4c')](_0x4a86e7[_0x8cda('0x42')],_0x1986b2['filters']));_0x152d02[_0x8cda('0x4b')][_0x8cda('0x64')]=_0x5a00f8['id'];if(_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x4d')]){_0x152d02[_0x8cda('0x4b')]=_['merge'](_0x152d02[_0x8cda('0x4b')],{'$or':_['map'](_0x152d02['attributes'],function(_0x4e8fba){var _0x20590e={};_0x20590e[_0x4e8fba]={'$like':'%'+_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x20590e;})});}_0x152d02=_['merge']({},_0x152d02,_0x4a86e7[_0x8cda('0x56')]);return db[_0x8cda('0x63')][_0x8cda('0x65')](_0x152d02);}})[_0x8cda('0x20')](function(_0x57130f){if(_0x57130f){return db[_0x8cda('0x66')][_0x8cda('0x67')]({'where':{'id':_[_0x8cda('0x3b')](_0x57130f,'UserId'),'role':_0x8cda('0x68')},'attributes':['id',_0x8cda('0x38'),'chatPause',_0x8cda('0x69'),'createdAt']});}})[_0x8cda('0x20')](function(_0x35536d){if(_0x35536d){return{'count':_0x35536d[_0x8cda('0x2f')],'rows':_[_0x8cda('0x3b')](_0x35536d[_0x8cda('0x52')],function(_0x3f1c28){return{'membername':_0x3f1c28['name'],'UserId':_0x3f1c28['id'],'queue_name':_0x5d3f96[_0x8cda('0x38')],'ChatQueueId':_0x5d3f96['id'],'interface':util[_0x8cda('0x6a')](_0x8cda('0x6b'),_0x8cda('0x6c'),_0x3f1c28['name']),'penalty':0x0,'paused':_0x3f1c28[_0x8cda('0x6d')],'createdAt':_0x3f1c28['createdAt'],'updatedAt':_0x3f1c28['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8cda('0x20')](respondWithFilteredResult(_0x5bbf4c,_0x152d02))[_0x8cda('0x28')](handleError(_0x5bbf4c,null));};exports[_0x8cda('0x6e')]=function(_0x56cc53,_0x18d251,_0x174d67){var _0x524284={};var _0x5ca26b={};var _0x4c5726;var _0x2d6f40;return db[_0x8cda('0x3c')][_0x8cda('0x62')]({'where':{'id':_0x56cc53['params']['id']}})['then'](handleEntityNotFound(_0x18d251,null))['then'](function(_0x23d4b2){if(_0x23d4b2){_0x4c5726=_0x23d4b2;_0x5ca26b[_0x8cda('0x40')]=_['keys'](db[_0x8cda('0x6f')][_0x8cda('0x3d')]);_0x5ca26b['query']=_['keys'](_0x56cc53[_0x8cda('0x42')]);_0x5ca26b[_0x8cda('0x43')]=_[_0x8cda('0x44')](_0x5ca26b[_0x8cda('0x40')],_0x5ca26b[_0x8cda('0x42')]);_0x524284[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x5ca26b[_0x8cda('0x40')],qs['fields'](_0x56cc53[_0x8cda('0x42')]['fields']));_0x524284[_0x8cda('0x46')]=_0x524284[_0x8cda('0x46')][_0x8cda('0x55')]?_0x524284[_0x8cda('0x46')]:_0x5ca26b[_0x8cda('0x40')];_0x524284[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x524284['where']=qs['filters'](_[_0x8cda('0x4c')](_0x56cc53[_0x8cda('0x42')],_0x5ca26b[_0x8cda('0x43')]));if(_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4d')]){_0x524284[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x524284[_0x8cda('0x4b')],{'$or':_['map'](_0x524284[_0x8cda('0x46')],function(_0x33dfd1){var _0x5c21b0={};_0x5c21b0[_0x33dfd1]={'$like':'%'+_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x5c21b0;})});}_0x524284=_['merge']({},_0x524284,_0x56cc53['options']);return _0x4c5726[_0x8cda('0x6e')](_0x524284);}})['then'](function(_0x12a87b){if(_0x12a87b){_0x2d6f40=_0x12a87b[_0x8cda('0x55')];if(!_0x56cc53[_0x8cda('0x42')]['hasOwnProperty'](_0x8cda('0x48'))){_0x524284['limit']=qs[_0x8cda('0x2d')](_0x56cc53[_0x8cda('0x42')]['limit']);_0x524284[_0x8cda('0x2c')]=qs['offset'](_0x56cc53['query'][_0x8cda('0x2c')]);}return _0x4c5726[_0x8cda('0x6e')](_0x524284);}})['then'](function(_0x4eecb7){if(_0x4eecb7){return _0x4eecb7?{'count':_0x2d6f40,'rows':_0x4eecb7}:null;}})[_0x8cda('0x20')](respondWithResult(_0x18d251,null))[_0x8cda('0x28')](handleError(_0x18d251,null));};exports[_0x8cda('0x70')]=function(_0x1f4c0a,_0x20a183,_0x1b6b62){var _0x4c07cb=_0x1f4c0a[_0x8cda('0x58')]['ids'];return db[_0x8cda('0x6f')][_0x8cda('0x65')]({'where':{'id':_0x4c07cb},'attributes':['id'],'include':[{'model':db[_0x8cda('0x66')],'as':_0x8cda('0x71'),'attributes':['id',_0x8cda('0x38'),_0x8cda('0x72'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x4e09fb){if(_0x4e09fb){var _0x503922=_[_0x8cda('0x73')](_0x4e09fb,function(_0x4c3c83){var _0x242933=_0x4c3c83[_0x8cda('0x36')]({'plain':!![]});return _0x242933[_0x8cda('0x71')];});return db[_0x8cda('0x3c')]['find']({'where':{'id':_0x1f4c0a[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](function(_0x42403c){return db['sequelize'][_0x8cda('0x74')](function(_0x51c87b){return _0x42403c[_0x8cda('0x70')](_0x4c07cb,{'transaction':_0x51c87b})[_0x8cda('0x20')](function(){return BPromise['each'](_0x503922,function(_0xe9aef){return db[_0x8cda('0x63')][_0x8cda('0x75')]({'where':{'UserId':_0xe9aef['id'],'ChatQueueId':_0x1f4c0a[_0x8cda('0x54')]['id']},'transaction':_0x51c87b});});})[_0x8cda('0x20')](function(){_0x503922['forEach'](function(_0x108553){socket[_0x8cda('0x76')](_0x8cda('0x77'),{'UserId':_0x108553['id'],'ChatQueueId':_0x42403c['id']});});});});});}})['then'](respondWithStatusCode(_0x20a183,null))[_0x8cda('0x28')](handleError(_0x20a183,null));};exports[_0x8cda('0x78')]=function(_0x235bd1,_0x586f64,_0x2147fd){return db['Team']['findAll']({'where':{'id':_0x235bd1[_0x8cda('0x42')][_0x8cda('0x79')]},'attributes':['id'],'include':[{'model':db[_0x8cda('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8cda('0x20')](handleEntityNotFound(_0x586f64,null))['then'](function(_0x45c3d7){var _0x3caab0=_[_0x8cda('0x3b')](_0x45c3d7,'id');var _0x5cbe9a=[];var _0x12d5bd=[];var _0x57b0ba=squel[_0x8cda('0x7a')]();_0x57b0ba[_0x8cda('0x7b')](_0x8cda('0x7c'))[_0x8cda('0x7d')](_0x8cda('0x7e'),'tq')[_0x8cda('0x7f')](_0x8cda('0x80'),'ut',_0x8cda('0x81'))[_0x8cda('0x4b')](_0x8cda('0x82'),_0x235bd1[_0x8cda('0x54')]['id']);for(var _0x235fb7=0x0;_0x235fb7<_0x45c3d7[_0x8cda('0x55')];_0x235fb7+=0x1){let _0x2d581c=_0x45c3d7[_0x235fb7];for(var _0xd46336=0x0;_0xd46336<_0x2d581c['Agents'][_0x8cda('0x55')];_0xd46336+=0x1){let _0x39cdcd=_0x2d581c[_0x8cda('0x71')][_0xd46336];var _0x444b76=_0x57b0ba[_0x8cda('0x83')]();_0x444b76[_0x8cda('0x4b')](_0x8cda('0x84'),_0x39cdcd['id']);_0x12d5bd[_0x8cda('0x85')](db[_0x8cda('0x86')]['query'](_0x444b76[_0x8cda('0x87')](),{'type':db['sequelize'][_0x8cda('0x88')][_0x8cda('0x89')]})['then'](function(_0x3f1249){if(_0x3f1249['length']===0x1){return _0x39cdcd['id'];}else{var _0x508ef2=_[_0x8cda('0x8a')](_[_0x8cda('0x3b')](_0x3f1249,_0x8cda('0x8b')),function(_0x44dd2d){return _['includes'](_0x3caab0,_0x44dd2d);});if(_0x508ef2){return _0x39cdcd['id'];}}}));}}return BPromise[_0x8cda('0x8c')](_0x12d5bd)[_0x8cda('0x20')](function(_0x38d1cc){_0x5cbe9a=_(_0x5cbe9a)[_0x8cda('0x8d')](_0x38d1cc)[_0x8cda('0x8e')]()[_0x8cda('0x8f')]();return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x235bd1[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](function(_0x3c38da){return db[_0x8cda('0x86')][_0x8cda('0x74')](function(_0x15489a){return _0x3c38da[_0x8cda('0x78')](_0x235bd1[_0x8cda('0x42')][_0x8cda('0x79')],{'transaction':_0x15489a})['then'](function(){if(!_[_0x8cda('0x90')](_0x5cbe9a)){return _0x3c38da[_0x8cda('0x91')](_0x5cbe9a,{'transaction':_0x15489a});}})[_0x8cda('0x20')](function(){_0x5cbe9a[_0x8cda('0x92')](function(_0x313dd5){socket['emit'](_0x8cda('0x93'),{'UserId':_0x313dd5,'ChatQueueId':_0x3c38da['id']});});});});});});})[_0x8cda('0x20')](respondWithStatusCode(_0x586f64,null))[_0x8cda('0x28')](handleError(_0x586f64,null));};exports[_0x8cda('0x94')]=function(_0x7dcb63,_0x5c996b,_0x1ec324){return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x7dcb63[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x5c996b,null))[_0x8cda('0x20')](function(_0x248fd7){if(_0x248fd7){return _0x248fd7[_0x8cda('0x94')](_0x7dcb63['body'][_0x8cda('0x79')],_[_0x8cda('0x95')](_0x7dcb63[_0x8cda('0x58')],[_0x8cda('0x79'),'id'])||{})[_0x8cda('0x96')](function(_0x3c14bd){for(var _0x325b9d=0x0;_0x325b9d<_0x7dcb63['body'][_0x8cda('0x79')][_0x8cda('0x55')];_0x325b9d+=0x1){socket[_0x8cda('0x76')]('userChatQueue:save',{'UserId':Number(_0x7dcb63[_0x8cda('0x58')][_0x8cda('0x79')][_0x325b9d]),'ChatQueueId':Number(_0x7dcb63[_0x8cda('0x54')]['id'])});}return _0x3c14bd;});}})['then'](respondWithResult(_0x5c996b,null))[_0x8cda('0x28')](handleError(_0x5c996b,null));};exports[_0x8cda('0x91')]=function(_0x5dc255,_0x3476b8,_0x4b52f4){return db['ChatQueue']['find']({'where':{'id':_0x5dc255['params']['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x3476b8,null))['then'](function(_0x281422){if(_0x281422){return _0x281422[_0x8cda('0x91')](_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')])[_0x8cda('0x20')](function(){if(_[_0x8cda('0x97')](_0x5dc255[_0x8cda('0x42')]['ids'])){for(var _0x2e80ce=0x0;_0x2e80ce<_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')][_0x8cda('0x55')];_0x2e80ce+=0x1){socket[_0x8cda('0x76')](_0x8cda('0x93'),{'UserId':Number(_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')][_0x2e80ce]),'ChatQueueId':Number(_0x5dc255[_0x8cda('0x54')]['id'])});}}else{socket[_0x8cda('0x76')]('userChatQueue:remove',{'UserId':Number(_0x5dc255[_0x8cda('0x42')]['ids']),'ChatQueueId':Number(_0x5dc255[_0x8cda('0x54')]['id'])});}});}})[_0x8cda('0x20')](respondWithStatusCode(_0x3476b8,null))[_0x8cda('0x28')](handleError(_0x3476b8,null));};exports[_0x8cda('0x98')]=function(_0x276352,_0x458192,_0x507977){var _0x5e886a={};var _0x5e92b5={};var _0x138cf6;var _0x263684;return db[_0x8cda('0x3c')][_0x8cda('0x62')]({'where':{'id':_0x276352[_0x8cda('0x54')]['id']}})['then'](handleEntityNotFound(_0x458192,null))[_0x8cda('0x20')](function(_0x455926){if(_0x455926){_0x138cf6=_0x455926;_0x5e92b5[_0x8cda('0x40')]=_[_0x8cda('0x41')](db[_0x8cda('0x66')]['rawAttributes']);_0x5e92b5['query']=_[_0x8cda('0x41')](_0x276352[_0x8cda('0x42')]);_0x5e92b5['filters']=_[_0x8cda('0x44')](_0x5e92b5[_0x8cda('0x40')],_0x5e92b5[_0x8cda('0x42')]);_0x5e886a[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x5e92b5[_0x8cda('0x40')],qs['fields'](_0x276352[_0x8cda('0x42')]['fields']));_0x5e886a[_0x8cda('0x46')]=_0x5e886a[_0x8cda('0x46')][_0x8cda('0x55')]?_0x5e886a[_0x8cda('0x46')]:_0x5e92b5[_0x8cda('0x40')];_0x5e886a[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x276352[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x5e886a['where']=qs[_0x8cda('0x43')](_[_0x8cda('0x4c')](_0x276352[_0x8cda('0x42')],_0x5e92b5['filters']));if(_0x276352[_0x8cda('0x42')]['filter']){_0x5e886a[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x5e886a[_0x8cda('0x4b')],{'$or':_[_0x8cda('0x3b')](_0x5e886a['attributes'],function(_0x30bc88){var _0x1b65a7={};_0x1b65a7[_0x30bc88]={'$like':'%'+_0x276352[_0x8cda('0x42')]['filter']+'%'};return _0x1b65a7;})});}_0x5e886a=_[_0x8cda('0x4e')]({},_0x5e886a,_0x276352['options']);return _0x138cf6[_0x8cda('0x98')](_0x5e886a);}})['then'](function(_0x97d7c6){if(_0x97d7c6){_0x263684=_0x97d7c6['length'];if(!_0x276352[_0x8cda('0x42')][_0x8cda('0x47')](_0x8cda('0x48'))){_0x5e886a[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x276352[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x5e886a[_0x8cda('0x2c')]=qs[_0x8cda('0x2c')](_0x276352[_0x8cda('0x42')][_0x8cda('0x2c')]);}return _0x138cf6['getAgents'](_0x5e886a);}})[_0x8cda('0x20')](function(_0x3dd673){if(_0x3dd673){return _0x3dd673?{'count':_0x263684,'rows':_0x3dd673}:null;}})[_0x8cda('0x20')](respondWithResult(_0x458192,null))[_0x8cda('0x28')](handleError(_0x458192,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 876b194..ba5ffe2 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 _0x79c6=['hook','events','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xaedb4b,_0x21f783){var _0xcea7e=function(_0x25f015){while(--_0x25f015){_0xaedb4b['push'](_0xaedb4b['shift']());}};_0xcea7e(++_0x21f783);}(_0x79c6,0x81));var _0x679c=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x79c6[_0x176329];return _0x31997c;};'use strict';var EventEmitter=require(_0x679c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x679c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x679c('0x2')](0x0);var events={'afterCreate':_0x679c('0x3'),'afterUpdate':_0x679c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56d9bf){return function(_0x596e9c,_0x3e24f6,_0x1b87a5){ChatQueueEvents[_0x679c('0x5')](_0x56d9bf+':'+_0x596e9c['id'],_0x596e9c);ChatQueueEvents[_0x679c('0x5')](_0x56d9bf,_0x596e9c);_0x1b87a5(null);};}for(var e in events){if(events[_0x679c('0x6')](e)){var event=events[e];ChatQueue[_0x679c('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xdb78=['setMaxListeners','update','remove','emit','exports','events','../../mysqldb','ChatQueue'];(function(_0x2614bc,_0x4ef1ec){var _0x5a1655=function(_0x6bfabc){while(--_0x6bfabc){_0x2614bc['push'](_0x2614bc['shift']());}};_0x5a1655(++_0x4ef1ec);}(_0xdb78,0x1ed));var _0x8db7=function(_0x2bfbf1,_0x24600e){_0x2bfbf1=_0x2bfbf1-0x0;var _0x3d8538=_0xdb78[_0x2bfbf1];return _0x3d8538;};'use strict';var EventEmitter=require(_0x8db7('0x0'));var ChatQueue=require(_0x8db7('0x1'))['db'][_0x8db7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8db7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db7('0x4'),'afterDestroy':_0x8db7('0x5')};function emitEvent(_0x22cb52){return function(_0x1eedb4,_0x81742d,_0x5b75da){ChatQueueEvents[_0x8db7('0x6')](_0x22cb52+':'+_0x1eedb4['id'],_0x1eedb4);ChatQueueEvents[_0x8db7('0x6')](_0x22cb52,_0x1eedb4);_0x5b75da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x8db7('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 278df53..4fae10b 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 _0x65f4=['../../config/logger','moment','request-promise','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash','util'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x65f4,0x166));var _0x465f=function(_0x192c75,_0x1b53a1){_0x192c75=_0x192c75-0x0;var _0x28647a=_0x65f4[_0x192c75];return _0x28647a;};'use strict';var _=require(_0x465f('0x0'));var util=require(_0x465f('0x1'));var logger=require(_0x465f('0x2'))('api');var moment=require(_0x465f('0x3'));var BPromise=require('bluebird');var rp=require(_0x465f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x465f('0x5'));var attributes=require(_0x465f('0x6'));module['exports']=function(_0xe552ad,_0x3d1f75){return _0xe552ad[_0x465f('0x7')]('ChatQueue',attributes,{'tableName':_0x465f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x461b=['api','moment','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x92171f,_0x4d4647){var _0x1331af=function(_0x413fea){while(--_0x413fea){_0x92171f['push'](_0x92171f['shift']());}};_0x1331af(++_0x4d4647);}(_0x461b,0x189));var _0xb461=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x461b[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xb461('0x0'));var util=require(_0xb461('0x1'));var logger=require(_0xb461('0x2'))(_0xb461('0x3'));var moment=require(_0xb461('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb461('0x5'));var rimraf=require(_0xb461('0x6'));var config=require(_0xb461('0x7'));var attributes=require('./chatQueue.attributes');module[_0xb461('0x8')]=function(_0x44871,_0x4f321f){return _0x44871[_0xb461('0x9')](_0xb461('0xa'),attributes,{'tableName':_0xb461('0xb'),'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 7b04b55..c1487ac 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 _0xffe1=['client','http','redis','defaults','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','include','model','attributes','map','debug','ShowChatQueue','find','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1cb4dd,_0x14f8f8){var _0x2a11ce=function(_0x523005){while(--_0x523005){_0x1cb4dd['push'](_0x1cb4dd['shift']());}};_0x2a11ce(++_0x14f8f8);}(_0xffe1,0x187));var _0x1ffe=function(_0x293a23,_0x4f5e44){_0x293a23=_0x293a23-0x0;var _0xd8ec7e=_0xffe1[_0x293a23];return _0xd8ec7e;};'use strict';var _=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var moment=require('moment');var BPromise=require(_0x1ffe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ffe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ffe('0x4'));var logger=require(_0x1ffe('0x5'))(_0x1ffe('0x6'));var config=require(_0x1ffe('0x7'));var jayson=require(_0x1ffe('0x8'));var client=jayson[_0x1ffe('0x9')][_0x1ffe('0xa')]({'port':0x232a});config[_0x1ffe('0xb')]=_[_0x1ffe('0xc')](config['redis'],{'host':_0x1ffe('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ffe('0xb')]));require('./chatQueue.socket')[_0x1ffe('0xe')](socket);function respondWithRpcPromise(_0x5b21eb,_0x3acf97,_0x1fc0b9){return new BPromise(function(_0x51be1e,_0x45bfb9){return client[_0x1ffe('0xf')](_0x5b21eb,_0x1fc0b9)[_0x1ffe('0x10')](function(_0x2aa80b){logger[_0x1ffe('0x11')](_0x1ffe('0x12'),_0x3acf97,'request\x20sent');logger['debug'](_0x1ffe('0x13'),_0x3acf97,_0x1ffe('0x14'),JSON[_0x1ffe('0x15')](_0x2aa80b));if(_0x2aa80b[_0x1ffe('0x16')]){if(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x17')]===0x1f4){logger[_0x1ffe('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);return _0x45bfb9(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);}logger[_0x1ffe('0x16')](_0x1ffe('0x12'),_0x3acf97,_0x2aa80b[_0x1ffe('0x16')]['message']);return _0x51be1e(_0x2aa80b['error']['message']);}else{logger[_0x1ffe('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x1ffe('0x14'));_0x51be1e(_0x2aa80b[_0x1ffe('0x19')][_0x1ffe('0x18')]);}})[_0x1ffe('0x1a')](function(_0x1cc248){logger['error'](_0x1ffe('0x12'),_0x3acf97,_0x1cc248);_0x45bfb9(_0x1cc248);});});}exports[_0x1ffe('0x1b')]=function(_0x473018){var _0x3f6ff4=this;return new Promise(function(_0x237695,_0x280598){return db[_0x1ffe('0x1c')][_0x1ffe('0x1d')]({'raw':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['raw']===undefined?!![]:![]:!![],'where':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')][_0x1ffe('0x1f')]||null:null,'attributes':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['attributes']||null:null,'limit':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['limit']||null:null,'include':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')]['include']?_['map'](_0x473018['options'][_0x1ffe('0x20')],function(_0x145259){return{'model':db[_0x145259[_0x1ffe('0x21')]],'as':_0x145259['as'],'attributes':_0x145259[_0x1ffe('0x22')],'include':_0x145259['include']?_[_0x1ffe('0x23')](_0x145259['include'],function(_0x266304){return{'model':db[_0x266304['model']],'as':_0x266304['as'],'attributes':_0x266304[_0x1ffe('0x22')],'include':_0x266304[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x266304[_0x1ffe('0x20')],function(_0x56bee3){return{'model':db[_0x56bee3[_0x1ffe('0x21')]],'as':_0x56bee3['as'],'attributes':_0x56bee3[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x14a0bb){logger[_0x1ffe('0x11')](_0x1ffe('0x1b'),_0x473018);logger[_0x1ffe('0x24')](_0x1ffe('0x1b'),_0x473018,JSON[_0x1ffe('0x15')](_0x14a0bb));_0x237695(_0x14a0bb);})[_0x1ffe('0x1a')](function(_0x1e697f){logger[_0x1ffe('0x16')]('GetChatQueue',_0x1e697f[_0x1ffe('0x18')],_0x473018);_0x280598(_0x3f6ff4[_0x1ffe('0x16')](0x1f4,_0x1e697f[_0x1ffe('0x18')]));});});};exports[_0x1ffe('0x25')]=function(_0x9d6faa){var _0x2dccb1=this;return new Promise(function(_0xf5417e,_0x200669){return db[_0x1ffe('0x1c')][_0x1ffe('0x26')]({'raw':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')][_0x1ffe('0x27')]===undefined?!![]:![]:!![],'where':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['where']||null:null,'attributes':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['attributes']||null:null,'include':_0x9d6faa['options']?_0x9d6faa['options'][_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x9d6faa[_0x1ffe('0x1e')]['include'],function(_0x35bfd2){return{'model':db[_0x35bfd2[_0x1ffe('0x21')]],'as':_0x35bfd2['as'],'attributes':_0x35bfd2[_0x1ffe('0x22')],'include':_0x35bfd2[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x35bfd2[_0x1ffe('0x20')],function(_0x3c6723){return{'model':db[_0x3c6723[_0x1ffe('0x21')]],'as':_0x3c6723['as'],'attributes':_0x3c6723['attributes'],'include':_0x3c6723[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x3c6723['include'],function(_0x232db2){return{'model':db[_0x232db2[_0x1ffe('0x21')]],'as':_0x232db2['as'],'attributes':_0x232db2[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x254255){logger['info'](_0x1ffe('0x25'),_0x9d6faa);logger[_0x1ffe('0x24')](_0x1ffe('0x25'),_0x9d6faa,JSON[_0x1ffe('0x15')](_0x254255));_0xf5417e(_0x254255);})[_0x1ffe('0x1a')](function(_0x530673){logger[_0x1ffe('0x16')](_0x1ffe('0x25'),_0x530673[_0x1ffe('0x18')],_0x9d6faa);_0x200669(_0x2dccb1[_0x1ffe('0x16')](0x1f4,_0x530673[_0x1ffe('0x18')]));});});};
\ No newline at end of file
+var _0xb0ca=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','where','limit','include','model','attributes','map','GetChatQueue','ShowChatQueue','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x3ca784,_0x23816d){_0x3ca784=_0x3ca784-0x0;var _0x6f8e7=_0xb0ca[_0x3ca784];return _0x6f8e7;};'use strict';var _=require('lodash');var util=require(_0xab0c('0x0'));var moment=require('moment');var BPromise=require(_0xab0c('0x1'));var rs=require(_0xab0c('0x2'));var fs=require('fs');var Redis=require(_0xab0c('0x3'));var db=require(_0xab0c('0x4'))['db'];var utils=require(_0xab0c('0x5'));var logger=require(_0xab0c('0x6'))(_0xab0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xab0c('0x8'));var client=jayson[_0xab0c('0x9')][_0xab0c('0xa')]({'port':0x232a});config[_0xab0c('0xb')]=_[_0xab0c('0xc')](config[_0xab0c('0xb')],{'host':_0xab0c('0xd'),'port':0x18eb});var socket=require(_0xab0c('0xe'))(new Redis(config[_0xab0c('0xb')]));require('./chatQueue.socket')[_0xab0c('0xf')](socket);function respondWithRpcPromise(_0x15db71,_0x52df38,_0xb79b41){return new BPromise(function(_0x17bff7,_0x11a4ae){return client['request'](_0x15db71,_0xb79b41)[_0xab0c('0x10')](function(_0x53a944){logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));logger[_0xab0c('0x14')](_0xab0c('0x15'),_0x52df38,_0xab0c('0x13'),JSON[_0xab0c('0x16')](_0x53a944));if(_0x53a944[_0xab0c('0x17')]){if(_0x53a944[_0xab0c('0x17')][_0xab0c('0x18')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x11a4ae(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x17bff7(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}else{logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));_0x17bff7(_0x53a944[_0xab0c('0x1a')][_0xab0c('0x19')]);}})[_0xab0c('0x1b')](function(_0x44c6f4){logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x44c6f4);_0x11a4ae(_0x44c6f4);});});}exports['GetChatQueue']=function(_0x29b873){var _0x4ad10e=this;return new Promise(function(_0x36794d,_0x870902){return db[_0xab0c('0x1c')][_0xab0c('0x1d')]({'raw':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')]['attributes']||null:null,'limit':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x20')]||null:null,'include':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0xfe7099){return{'model':db[_0xfe7099[_0xab0c('0x22')]],'as':_0xfe7099['as'],'attributes':_0xfe7099[_0xab0c('0x23')],'include':_0xfe7099[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0xfe7099[_0xab0c('0x21')],function(_0x3ce281){return{'model':db[_0x3ce281[_0xab0c('0x22')]],'as':_0x3ce281['as'],'attributes':_0x3ce281[_0xab0c('0x23')],'include':_0x3ce281[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0x3ce281['include'],function(_0x70f07f){return{'model':db[_0x70f07f[_0xab0c('0x22')]],'as':_0x70f07f['as'],'attributes':_0x70f07f[_0xab0c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x47a239){logger['info']('GetChatQueue',_0x29b873);logger['debug'](_0xab0c('0x25'),_0x29b873,JSON[_0xab0c('0x16')](_0x47a239));_0x36794d(_0x47a239);})[_0xab0c('0x1b')](function(_0x3e6b6e){logger[_0xab0c('0x17')]('GetChatQueue',_0x3e6b6e['message'],_0x29b873);_0x870902(_0x4ad10e[_0xab0c('0x17')](0x1f4,_0x3e6b6e[_0xab0c('0x19')]));});});};exports[_0xab0c('0x26')]=function(_0xe36cea){var _0x2bccdb=this;return new Promise(function(_0x577c31,_0x582536){return db['ChatQueue'][_0xab0c('0x27')]({'raw':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x28')]===undefined?!![]:![]:!![],'where':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x23')]||null:null,'include':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0x366ade){return{'model':db[_0x366ade[_0xab0c('0x22')]],'as':_0x366ade['as'],'attributes':_0x366ade[_0xab0c('0x23')],'include':_0x366ade['include']?_['map'](_0x366ade['include'],function(_0x4c5f21){return{'model':db[_0x4c5f21[_0xab0c('0x22')]],'as':_0x4c5f21['as'],'attributes':_0x4c5f21['attributes'],'include':_0x4c5f21['include']?_[_0xab0c('0x24')](_0x4c5f21[_0xab0c('0x21')],function(_0xd1a5fb){return{'model':db[_0xd1a5fb[_0xab0c('0x22')]],'as':_0xd1a5fb['as'],'attributes':_0xd1a5fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x16048c){logger[_0xab0c('0x11')](_0xab0c('0x26'),_0xe36cea);logger['debug'](_0xab0c('0x26'),_0xe36cea,JSON[_0xab0c('0x16')](_0x16048c));_0x577c31(_0x16048c);})[_0xab0c('0x1b')](function(_0x2dbd55){logger[_0xab0c('0x17')](_0xab0c('0x26'),_0x2dbd55[_0xab0c('0x19')],_0xe36cea);_0x582536(_0x2bccdb['error'](0x1f4,_0x2dbd55[_0xab0c('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 87b1efc..445f43c 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x72b1,0x16e));var _0x172b=function(_0x28e366,_0x478cf6){_0x28e366=_0x28e366-0x0;var _0x9ff0da=_0x72b1[_0x28e366];return _0x9ff0da;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
+var _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x56cf67,_0x375d15){var _0x117fb6=function(_0x5e84ae){while(--_0x5e84ae){_0x56cf67['push'](_0x56cf67['shift']());}};_0x117fb6(++_0x375d15);}(_0x032e,0x124));var _0xe032=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x032e[_0x29b609];return _0x54c952;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 1f9883b..d6c529a 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xee1fc0,_0x43572c){var _0x4f9676=function(_0x44ad3c){while(--_0x44ad3c){_0xee1fc0['push'](_0xee1fc0['shift']());}};_0x4f9676(++_0x43572c);}(_0x008c,0x188));var _0xc008=function(_0x2e561f,_0x1b1660){_0x2e561f=_0x2e561f-0x0;var _0x4160ea=_0x008c[_0x2e561f];return _0x4160ea;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5555e3,_0x2fb654){var _0x120341=function(_0x435663){while(--_0x435663){_0x5555e3['push'](_0x5555e3['shift']());}};_0x120341(++_0x2fb654);}(_0xe14b,0x93));var _0xbe14=function(_0x45ab94,_0x1927ea){_0x45ab94=_0x45ab94-0x0;var _0x3985ad=_0xe14b[_0x45ab94];return _0x3985ad;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index ba35808..4bd7e9b 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 _0xabe0=['DATE','moment','sequelize','exports','STRING'];(function(_0x1af5b0,_0x37a477){var _0x3d9fe7=function(_0x2b021e){while(--_0x2b021e){_0x1af5b0['push'](_0x1af5b0['shift']());}};_0x3d9fe7(++_0x37a477);}(_0xabe0,0x182));var _0x0abe=function(_0x179794,_0x2fe676){_0x179794=_0x179794-0x0;var _0x264065=_0xabe0[_0x179794];return _0x264065;};'use strict';var moment=require(_0x0abe('0x0'));var Sequelize=require(_0x0abe('0x1'));module[_0x0abe('0x2')]={'uniqueid':{'type':Sequelize[_0x0abe('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0abe('0x3')]},'joinAt':{'type':Sequelize[_0x0abe('0x4')]},'leaveAt':{'type':Sequelize[_0x0abe('0x4')]},'acceptAt':{'type':Sequelize[_0x0abe('0x4')]},'exitAt':{'type':Sequelize[_0x0abe('0x4')]},'reason':{'type':Sequelize[_0x0abe('0x3')]}};
\ No newline at end of file
+var _0x514f=['sequelize','exports','STRING','DATE','moment'];(function(_0x299efe,_0x5e1129){var _0x53c2b8=function(_0x983907){while(--_0x983907){_0x299efe['push'](_0x299efe['shift']());}};_0x53c2b8(++_0x5e1129);}(_0x514f,0x167));var _0xf514=function(_0xe66452,_0x57a652){_0xe66452=_0xe66452-0x0;var _0x4ac5c6=_0x514f[_0xe66452];return _0x4ac5c6;};'use strict';var moment=require(_0xf514('0x0'));var Sequelize=require(_0xf514('0x1'));module[_0xf514('0x2')]={'uniqueid':{'type':Sequelize[_0xf514('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf514('0x3')]},'joinAt':{'type':Sequelize[_0xf514('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf514('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c163daf..e423831 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 _0xf8bb=['apply','then','destroy','sendStatus','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','count','include','findAll','catch','show','params','length','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range'];(function(_0xfba9b5,_0x3873d8){var _0x328a52=function(_0x2e5d74){while(--_0x2e5d74){_0xfba9b5['push'](_0xfba9b5['shift']());}};_0x328a52(++_0x3873d8);}(_0xf8bb,0x111));var _0xbf8b=function(_0x160e01,_0x1bbb9f){_0x160e01=_0x160e01-0x0;var _0x39a2b3=_0xf8bb[_0x160e01];return _0x39a2b3;};'use strict';var emlformat=require(_0xbf8b('0x0'));var rimraf=require(_0xbf8b('0x1'));var zipdir=require(_0xbf8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf8b('0x3'));var moment=require(_0xbf8b('0x4'));var BPromise=require(_0xbf8b('0x5'));var Mustache=require(_0xbf8b('0x6'));var util=require(_0xbf8b('0x7'));var path=require(_0xbf8b('0x8'));var sox=require(_0xbf8b('0x9'));var csv=require(_0xbf8b('0xa'));var ejs=require(_0xbf8b('0xb'));var fs=require('fs');var fs_extra=require(_0xbf8b('0xc'));var _=require(_0xbf8b('0xd'));var squel=require(_0xbf8b('0xe'));var crypto=require(_0xbf8b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbf8b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf8b('0x11'));var Redis=require('ioredis');var authService=require(_0xbf8b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbf8b('0x13'));var hardwareService=require(_0xbf8b('0x14'));var logger=require(_0xbf8b('0x15'))(_0xbf8b('0x16'));var utils=require(_0xbf8b('0x17'));var config=require(_0xbf8b('0x18'));var licenseUtil=require(_0xbf8b('0x19'));var db=require(_0xbf8b('0x1a'))['db'];function respondWithStatusCode(_0x59055d,_0x3e3bfb){_0x3e3bfb=_0x3e3bfb||0xcc;return function(_0xeffd6d){if(_0xeffd6d){return _0x59055d['sendStatus'](_0x3e3bfb);}return _0x59055d[_0xbf8b('0x1b')](_0x3e3bfb)[_0xbf8b('0x1c')]();};}function respondWithResult(_0x19f654,_0x1ed0d1){_0x1ed0d1=_0x1ed0d1||0xc8;return function(_0x2b7daf){if(_0x2b7daf){return _0x19f654[_0xbf8b('0x1b')](_0x1ed0d1)[_0xbf8b('0x1d')](_0x2b7daf);}};}function respondWithFilteredResult(_0x2709a7,_0x36875d){return function(_0x3b4e5b){if(_0x3b4e5b){var _0x56cb78=typeof _0x36875d[_0xbf8b('0x1e')]===_0xbf8b('0x1f')&&typeof _0x36875d[_0xbf8b('0x20')]===_0xbf8b('0x1f');var _0x3c09f4=_0x3b4e5b['count'];var _0x3bab93=_0x56cb78?0x0:_0x36875d[_0xbf8b('0x1e')];var _0x460f3d=_0x56cb78?_0x3b4e5b['count']:_0x36875d[_0xbf8b('0x1e')]+_0x36875d[_0xbf8b('0x20')];var _0x2d6bda;if(_0x460f3d>=_0x3c09f4){_0x460f3d=_0x3c09f4;_0x2d6bda=0xc8;}else{_0x2d6bda=0xce;}_0x2709a7['status'](_0x2d6bda);return _0x2709a7[_0xbf8b('0x21')](_0xbf8b('0x22'),_0x3bab93+'-'+_0x460f3d+'/'+_0x3c09f4)[_0xbf8b('0x1d')](_0x3b4e5b);}return null;};}function patchUpdates(_0x461bb8){return function(_0x2ba7e4){try{jsonpatch[_0xbf8b('0x23')](_0x2ba7e4,_0x461bb8,!![]);}catch(_0x4b7209){return BPromise['reject'](_0x4b7209);}return _0x2ba7e4['save']();};}function saveUpdates(_0x153c19,_0x4f36e5){return function(_0x3d4b1a){if(_0x3d4b1a){return _0x3d4b1a['update'](_0x153c19)[_0xbf8b('0x24')](function(_0x4dbb2b){return _0x4dbb2b;});}return null;};}function removeEntity(_0x5dc254,_0x3be6ef){return function(_0x35e83f){if(_0x35e83f){return _0x35e83f[_0xbf8b('0x25')]()[_0xbf8b('0x24')](function(){_0x5dc254[_0xbf8b('0x1b')](0xcc)[_0xbf8b('0x1c')]();});}};}function handleEntityNotFound(_0x34089d,_0xd6f4d0){return function(_0x4cc565){if(!_0x4cc565){_0x34089d[_0xbf8b('0x26')](0x194);}return _0x4cc565;};}function handleError(_0x8d94fb,_0x346914){_0x346914=_0x346914||0x1f4;return function(_0x18d1d5){logger['error'](_0x18d1d5[_0xbf8b('0x27')]);if(_0x18d1d5[_0xbf8b('0x28')]){delete _0x18d1d5['name'];}_0x8d94fb[_0xbf8b('0x1b')](_0x346914)[_0xbf8b('0x29')](_0x18d1d5);};}exports[_0xbf8b('0x2a')]=function(_0x276048,_0x1af553){var _0x2ffc94={},_0xc14007={},_0x36722e={'count':0x0,'rows':[]};var _0x3b9275=_[_0xbf8b('0x2b')](db[_0xbf8b('0x2c')][_0xbf8b('0x2d')],function(_0x456269){return{'name':_0x456269['fieldName'],'type':_0x456269[_0xbf8b('0x2e')][_0xbf8b('0x2f')]};});_0xc14007[_0xbf8b('0x30')]=_[_0xbf8b('0x2b')](_0x3b9275,'name');_0xc14007[_0xbf8b('0x31')]=_[_0xbf8b('0x32')](_0x276048[_0xbf8b('0x31')]);_0xc14007[_0xbf8b('0x33')]=_[_0xbf8b('0x34')](_0xc14007[_0xbf8b('0x30')],_0xc14007[_0xbf8b('0x31')]);_0x2ffc94[_0xbf8b('0x35')]=_[_0xbf8b('0x34')](_0xc14007[_0xbf8b('0x30')],qs[_0xbf8b('0x36')](_0x276048[_0xbf8b('0x31')]['fields']));_0x2ffc94[_0xbf8b('0x35')]=_0x2ffc94['attributes']['length']?_0x2ffc94[_0xbf8b('0x35')]:_0xc14007[_0xbf8b('0x30')];if(!_0x276048[_0xbf8b('0x31')][_0xbf8b('0x37')](_0xbf8b('0x38'))){_0x2ffc94['limit']=qs['limit'](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x20')]);_0x2ffc94[_0xbf8b('0x1e')]=qs[_0xbf8b('0x1e')](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x1e')]);}_0x2ffc94[_0xbf8b('0x39')]=qs[_0xbf8b('0x3a')](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3a')]);_0x2ffc94['where']=qs[_0xbf8b('0x33')](_[_0xbf8b('0x3b')](_0x276048['query'],_0xc14007[_0xbf8b('0x33')]),_0x3b9275);if(_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3c')]){_0x2ffc94[_0xbf8b('0x3d')]=_[_0xbf8b('0x3e')](_0x2ffc94['where'],{'$or':_[_0xbf8b('0x2b')](_0x3b9275,function(_0x4685e1){if(_0x4685e1[_0xbf8b('0x2e')]!==_0xbf8b('0x3f')){var _0x1bdf87={};_0x1bdf87[_0x4685e1[_0xbf8b('0x28')]]={'$like':'%'+_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3c')]+'%'};return _0x1bdf87;}})});}_0x2ffc94=_[_0xbf8b('0x3e')]({},_0x2ffc94,_0x276048['options']);var _0x39eeff={'where':_0x2ffc94[_0xbf8b('0x3d')]};return db[_0xbf8b('0x2c')][_0xbf8b('0x40')](_0x39eeff)[_0xbf8b('0x24')](function(_0x1f0e25){_0x36722e[_0xbf8b('0x40')]=_0x1f0e25;if(_0x276048[_0xbf8b('0x31')]['includeAll']){_0x2ffc94[_0xbf8b('0x41')]=[{'all':!![]}];}return db[_0xbf8b('0x2c')][_0xbf8b('0x42')](_0x2ffc94);})[_0xbf8b('0x24')](function(_0x238df1){_0x36722e['rows']=_0x238df1;return _0x36722e;})['then'](respondWithFilteredResult(_0x1af553,_0x2ffc94))[_0xbf8b('0x43')](handleError(_0x1af553,null));};exports[_0xbf8b('0x44')]=function(_0x5cbe86,_0x4d6a45){var _0x42b1e1={'raw':!![],'where':{'id':_0x5cbe86[_0xbf8b('0x45')]['id']}},_0x263e0c={};_0x263e0c[_0xbf8b('0x30')]=_[_0xbf8b('0x32')](db['ChatQueueReport'][_0xbf8b('0x2d')]);_0x263e0c[_0xbf8b('0x31')]=_[_0xbf8b('0x32')](_0x5cbe86[_0xbf8b('0x31')]);_0x263e0c[_0xbf8b('0x33')]=_['intersection'](_0x263e0c[_0xbf8b('0x30')],_0x263e0c[_0xbf8b('0x31')]);_0x42b1e1[_0xbf8b('0x35')]=_['intersection'](_0x263e0c['model'],qs['fields'](_0x5cbe86[_0xbf8b('0x31')][_0xbf8b('0x36')]));_0x42b1e1[_0xbf8b('0x35')]=_0x42b1e1[_0xbf8b('0x35')][_0xbf8b('0x46')]?_0x42b1e1[_0xbf8b('0x35')]:_0x263e0c[_0xbf8b('0x30')];if(_0x5cbe86[_0xbf8b('0x31')][_0xbf8b('0x47')]){_0x42b1e1[_0xbf8b('0x41')]=[{'all':!![]}];}_0x42b1e1=_[_0xbf8b('0x3e')]({},_0x42b1e1,_0x5cbe86[_0xbf8b('0x48')]);return db[_0xbf8b('0x2c')][_0xbf8b('0x49')](_0x42b1e1)[_0xbf8b('0x24')](handleEntityNotFound(_0x4d6a45,null))[_0xbf8b('0x24')](respondWithResult(_0x4d6a45,null))['catch'](handleError(_0x4d6a45,null));};exports[_0xbf8b('0x4a')]=function(_0x355644,_0x1e3076){return db[_0xbf8b('0x2c')]['create'](_0x355644[_0xbf8b('0x4b')],{})[_0xbf8b('0x24')](respondWithResult(_0x1e3076,0xc9))[_0xbf8b('0x43')](handleError(_0x1e3076,null));};exports['update']=function(_0x3c22d0,_0x2ee446){if(_0x3c22d0[_0xbf8b('0x4b')]['id']){delete _0x3c22d0[_0xbf8b('0x4b')]['id'];}return db[_0xbf8b('0x2c')][_0xbf8b('0x49')]({'where':{'id':_0x3c22d0['params']['id']}})['then'](handleEntityNotFound(_0x2ee446,null))['then'](saveUpdates(_0x3c22d0[_0xbf8b('0x4b')],null))[_0xbf8b('0x24')](respondWithResult(_0x2ee446,null))[_0xbf8b('0x43')](handleError(_0x2ee446,null));};exports['destroy']=function(_0x4da94e,_0x395ea1){return db[_0xbf8b('0x2c')]['find']({'where':{'id':_0x4da94e[_0xbf8b('0x45')]['id']}})[_0xbf8b('0x24')](handleEntityNotFound(_0x395ea1,null))[_0xbf8b('0x24')](removeEntity(_0x395ea1,null))[_0xbf8b('0x43')](handleError(_0x395ea1,null));};exports[_0xbf8b('0x4c')]=function(_0x83800,_0x501215){return db['ChatQueueReport'][_0xbf8b('0x4c')]()['then'](respondWithResult(_0x501215,null))[_0xbf8b('0x43')](handleError(_0x501215,null));};
\ No newline at end of file
+var _0x0967=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','index','map','ChatQueueReport','rawAttributes'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x0967,0x100));var _0x7096=function(_0xe88e51,_0x40daaf){_0xe88e51=_0xe88e51-0x0;var _0x1e0a56=_0x0967[_0xe88e51];return _0x1e0a56;};'use strict';var emlformat=require(_0x7096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7096('0x1'));var jsonpatch=require(_0x7096('0x2'));var rp=require(_0x7096('0x3'));var moment=require(_0x7096('0x4'));var BPromise=require(_0x7096('0x5'));var Mustache=require(_0x7096('0x6'));var util=require(_0x7096('0x7'));var path=require(_0x7096('0x8'));var sox=require('sox');var csv=require(_0x7096('0x9'));var ejs=require(_0x7096('0xa'));var fs=require('fs');var fs_extra=require(_0x7096('0xb'));var _=require(_0x7096('0xc'));var squel=require(_0x7096('0xd'));var crypto=require(_0x7096('0xe'));var jsforce=require(_0x7096('0xf'));var deskjs=require(_0x7096('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7096('0x11'));var Redis=require(_0x7096('0x12'));var authService=require(_0x7096('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7096('0x14'));var logger=require(_0x7096('0x15'))(_0x7096('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7096('0x17'));var db=require(_0x7096('0x18'))['db'];function respondWithStatusCode(_0x56774c,_0x38274d){_0x38274d=_0x38274d||0xcc;return function(_0x5be71d){if(_0x5be71d){return _0x56774c[_0x7096('0x19')](_0x38274d);}return _0x56774c[_0x7096('0x1a')](_0x38274d)['end']();};}function respondWithResult(_0x2d8ed4,_0x182c05){_0x182c05=_0x182c05||0xc8;return function(_0x15a620){if(_0x15a620){return _0x2d8ed4[_0x7096('0x1a')](_0x182c05)[_0x7096('0x1b')](_0x15a620);}};}function respondWithFilteredResult(_0x40116c,_0x479057){return function(_0x240010){if(_0x240010){var _0x2c02ce=typeof _0x479057[_0x7096('0x1c')]===_0x7096('0x1d')&&typeof _0x479057[_0x7096('0x1e')]==='undefined';var _0x41bc1b=_0x240010[_0x7096('0x1f')];var _0x1ff404=_0x2c02ce?0x0:_0x479057['offset'];var _0x5079e6=_0x2c02ce?_0x240010[_0x7096('0x1f')]:_0x479057['offset']+_0x479057['limit'];var _0x4a0859;if(_0x5079e6>=_0x41bc1b){_0x5079e6=_0x41bc1b;_0x4a0859=0xc8;}else{_0x4a0859=0xce;}_0x40116c[_0x7096('0x1a')](_0x4a0859);return _0x40116c[_0x7096('0x20')](_0x7096('0x21'),_0x1ff404+'-'+_0x5079e6+'/'+_0x41bc1b)[_0x7096('0x1b')](_0x240010);}return null;};}function patchUpdates(_0xbd59a9){return function(_0x221090){try{jsonpatch[_0x7096('0x22')](_0x221090,_0xbd59a9,!![]);}catch(_0x248301){return BPromise['reject'](_0x248301);}return _0x221090[_0x7096('0x23')]();};}function saveUpdates(_0x13390a,_0x41db64){return function(_0x5ab797){if(_0x5ab797){return _0x5ab797[_0x7096('0x24')](_0x13390a)['then'](function(_0x5a0fce){return _0x5a0fce;});}return null;};}function removeEntity(_0x270d61,_0x48849a){return function(_0x5d3146){if(_0x5d3146){return _0x5d3146[_0x7096('0x25')]()['then'](function(){_0x270d61[_0x7096('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f14f9,_0x2bd8ed){return function(_0x4a6423){if(!_0x4a6423){_0x4f14f9[_0x7096('0x19')](0x194);}return _0x4a6423;};}function handleError(_0x4e0f0a,_0x4152d1){_0x4152d1=_0x4152d1||0x1f4;return function(_0xd83be3){logger['error'](_0xd83be3[_0x7096('0x26')]);if(_0xd83be3[_0x7096('0x27')]){delete _0xd83be3['name'];}_0x4e0f0a['status'](_0x4152d1)['send'](_0xd83be3);};}exports[_0x7096('0x28')]=function(_0x2a6126,_0x404697){var _0xc4153a={},_0x5b4531={},_0x433e67={'count':0x0,'rows':[]};var _0x2ee31b=_[_0x7096('0x29')](db[_0x7096('0x2a')][_0x7096('0x2b')],function(_0x474966){return{'name':_0x474966[_0x7096('0x2c')],'type':_0x474966[_0x7096('0x2d')][_0x7096('0x2e')]};});_0x5b4531[_0x7096('0x2f')]=_['map'](_0x2ee31b,'name');_0x5b4531[_0x7096('0x30')]=_[_0x7096('0x31')](_0x2a6126[_0x7096('0x30')]);_0x5b4531['filters']=_[_0x7096('0x32')](_0x5b4531[_0x7096('0x2f')],_0x5b4531[_0x7096('0x30')]);_0xc4153a[_0x7096('0x33')]=_['intersection'](_0x5b4531[_0x7096('0x2f')],qs['fields'](_0x2a6126['query'][_0x7096('0x34')]));_0xc4153a[_0x7096('0x33')]=_0xc4153a[_0x7096('0x33')][_0x7096('0x35')]?_0xc4153a[_0x7096('0x33')]:_0x5b4531['model'];if(!_0x2a6126[_0x7096('0x30')]['hasOwnProperty'](_0x7096('0x36'))){_0xc4153a['limit']=qs[_0x7096('0x1e')](_0x2a6126[_0x7096('0x30')][_0x7096('0x1e')]);_0xc4153a[_0x7096('0x1c')]=qs['offset'](_0x2a6126[_0x7096('0x30')][_0x7096('0x1c')]);}_0xc4153a[_0x7096('0x37')]=qs[_0x7096('0x38')](_0x2a6126[_0x7096('0x30')][_0x7096('0x38')]);_0xc4153a['where']=qs[_0x7096('0x39')](_[_0x7096('0x3a')](_0x2a6126[_0x7096('0x30')],_0x5b4531[_0x7096('0x39')]),_0x2ee31b);if(_0x2a6126[_0x7096('0x30')]['filter']){_0xc4153a['where']=_[_0x7096('0x3b')](_0xc4153a[_0x7096('0x3c')],{'$or':_['map'](_0x2ee31b,function(_0x3a3f89){if(_0x3a3f89[_0x7096('0x2d')]!==_0x7096('0x3d')){var _0x534386={};_0x534386[_0x3a3f89[_0x7096('0x27')]]={'$like':'%'+_0x2a6126[_0x7096('0x30')][_0x7096('0x3e')]+'%'};return _0x534386;}})});}_0xc4153a=_[_0x7096('0x3b')]({},_0xc4153a,_0x2a6126[_0x7096('0x3f')]);var _0x3db223={'where':_0xc4153a['where']};return db[_0x7096('0x2a')]['count'](_0x3db223)[_0x7096('0x40')](function(_0x240ad4){_0x433e67[_0x7096('0x1f')]=_0x240ad4;if(_0x2a6126[_0x7096('0x30')][_0x7096('0x41')]){_0xc4153a[_0x7096('0x42')]=[{'all':!![]}];}return db[_0x7096('0x2a')][_0x7096('0x43')](_0xc4153a);})[_0x7096('0x40')](function(_0xd17348){_0x433e67[_0x7096('0x44')]=_0xd17348;return _0x433e67;})[_0x7096('0x40')](respondWithFilteredResult(_0x404697,_0xc4153a))['catch'](handleError(_0x404697,null));};exports['show']=function(_0x57ee0b,_0x525101){var _0x1d3f20={'raw':!![],'where':{'id':_0x57ee0b['params']['id']}},_0x1778c2={};_0x1778c2[_0x7096('0x2f')]=_[_0x7096('0x31')](db[_0x7096('0x2a')][_0x7096('0x2b')]);_0x1778c2[_0x7096('0x30')]=_['keys'](_0x57ee0b[_0x7096('0x30')]);_0x1778c2['filters']=_[_0x7096('0x32')](_0x1778c2[_0x7096('0x2f')],_0x1778c2[_0x7096('0x30')]);_0x1d3f20[_0x7096('0x33')]=_['intersection'](_0x1778c2['model'],qs['fields'](_0x57ee0b[_0x7096('0x30')][_0x7096('0x34')]));_0x1d3f20['attributes']=_0x1d3f20[_0x7096('0x33')][_0x7096('0x35')]?_0x1d3f20[_0x7096('0x33')]:_0x1778c2[_0x7096('0x2f')];if(_0x57ee0b['query'][_0x7096('0x41')]){_0x1d3f20[_0x7096('0x42')]=[{'all':!![]}];}_0x1d3f20=_['merge']({},_0x1d3f20,_0x57ee0b[_0x7096('0x3f')]);return db['ChatQueueReport'][_0x7096('0x45')](_0x1d3f20)['then'](handleEntityNotFound(_0x525101,null))[_0x7096('0x40')](respondWithResult(_0x525101,null))[_0x7096('0x46')](handleError(_0x525101,null));};exports[_0x7096('0x47')]=function(_0x2cc7e2,_0x1ac3d1){return db[_0x7096('0x2a')][_0x7096('0x47')](_0x2cc7e2[_0x7096('0x48')],{})['then'](respondWithResult(_0x1ac3d1,0xc9))[_0x7096('0x46')](handleError(_0x1ac3d1,null));};exports[_0x7096('0x24')]=function(_0x446c7b,_0x97cbef){if(_0x446c7b['body']['id']){delete _0x446c7b['body']['id'];}return db[_0x7096('0x2a')][_0x7096('0x45')]({'where':{'id':_0x446c7b[_0x7096('0x49')]['id']}})[_0x7096('0x40')](handleEntityNotFound(_0x97cbef,null))[_0x7096('0x40')](saveUpdates(_0x446c7b[_0x7096('0x48')],null))[_0x7096('0x40')](respondWithResult(_0x97cbef,null))[_0x7096('0x46')](handleError(_0x97cbef,null));};exports[_0x7096('0x25')]=function(_0x439646,_0x32c7a8){return db[_0x7096('0x2a')][_0x7096('0x45')]({'where':{'id':_0x439646[_0x7096('0x49')]['id']}})['then'](handleEntityNotFound(_0x32c7a8,null))[_0x7096('0x40')](removeEntity(_0x32c7a8,null))[_0x7096('0x46')](handleError(_0x32c7a8,null));};exports[_0x7096('0x4a')]=function(_0x54616c,_0x3de0bf){return db[_0x7096('0x2a')][_0x7096('0x4a')]()[_0x7096('0x40')](respondWithResult(_0x3de0bf,null))['catch'](handleError(_0x3de0bf,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 154a04b..987ec24 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x12f4fc,_0x47ff54){var _0x297cb8=function(_0x5a680c){while(--_0x5a680c){_0x12f4fc['push'](_0x12f4fc['shift']());}};_0x297cb8(++_0x47ff54);}(_0x757a,0xde));var _0xa757=function(_0xbfeba3,_0x215f24){_0xbfeba3=_0xbfeba3-0x0;var _0xf1962a=_0x757a[_0xbfeba3];return _0xf1962a;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 62e5ba2..742c5f8 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 _0x3f40=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','create','body','options','raw','CreateChatQueueReport','ChatQueueReport','update','attributes','limit','UpdateChatQueueReport'];(function(_0x51e8e1,_0x80ed5d){var _0x4b11f3=function(_0x1e5a5d){while(--_0x1e5a5d){_0x51e8e1['push'](_0x51e8e1['shift']());}};_0x4b11f3(++_0x80ed5d);}(_0x3f40,0xe0));var _0x03f4=function(_0x39cbe5,_0x3df7cf){_0x39cbe5=_0x39cbe5-0x0;var _0x3478ed=_0x3f40[_0x39cbe5];return _0x3478ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03f4('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03f4('0x1'))['db'];var utils=require(_0x03f4('0x2'));var logger=require(_0x03f4('0x3'))(_0x03f4('0x4'));var config=require('../../config/environment');var jayson=require(_0x03f4('0x5'));var client=jayson[_0x03f4('0x6')][_0x03f4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ddee9,_0x4ee188,_0x357327){return new BPromise(function(_0x1f8843,_0x155e57){return client['request'](_0x4ddee9,_0x357327)[_0x03f4('0x8')](function(_0x309c4a){logger['info'](_0x03f4('0x9'),_0x4ee188,_0x03f4('0xa'));logger[_0x03f4('0xb')](_0x03f4('0xc'),_0x4ee188,_0x03f4('0xa'),JSON[_0x03f4('0xd')](_0x309c4a));if(_0x309c4a[_0x03f4('0xe')]){if(_0x309c4a['error']['code']===0x1f4){logger[_0x03f4('0xe')](_0x03f4('0x9'),_0x4ee188,_0x309c4a['error'][_0x03f4('0xf')]);return _0x155e57(_0x309c4a[_0x03f4('0xe')]['message']);}logger[_0x03f4('0xe')](_0x03f4('0x9'),_0x4ee188,_0x309c4a[_0x03f4('0xe')][_0x03f4('0xf')]);return _0x1f8843(_0x309c4a['error'][_0x03f4('0xf')]);}else{logger[_0x03f4('0x10')](_0x03f4('0x9'),_0x4ee188,_0x03f4('0xa'));_0x1f8843(_0x309c4a['result']['message']);}})[_0x03f4('0x11')](function(_0xdbc993){logger['error'](_0x03f4('0x9'),_0x4ee188,_0xdbc993);_0x155e57(_0xdbc993);});});}exports['CreateChatQueueReport']=function(_0x48e6ae){var _0x46ee0f=this;return new Promise(function(_0x4a7e6d,_0x59b388){return db['ChatQueueReport'][_0x03f4('0x12')](_0x48e6ae[_0x03f4('0x13')],{'raw':_0x48e6ae['options']?_0x48e6ae[_0x03f4('0x14')][_0x03f4('0x15')]===undefined?!![]:![]:!![]})[_0x03f4('0x8')](function(_0x5e57c9){logger[_0x03f4('0x10')](_0x03f4('0x16'),_0x48e6ae);logger[_0x03f4('0xb')](_0x03f4('0x16'),_0x48e6ae,JSON[_0x03f4('0xd')](_0x5e57c9));_0x4a7e6d(_0x5e57c9);})['catch'](function(_0x458135){logger[_0x03f4('0xe')](_0x03f4('0x16'),_0x458135[_0x03f4('0xf')],_0x48e6ae);_0x59b388(_0x46ee0f[_0x03f4('0xe')](0x1f4,_0x458135[_0x03f4('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x11fb91){var _0x1a1d10=this;return new Promise(function(_0x4a2b19,_0x3edef1){return db[_0x03f4('0x17')][_0x03f4('0x18')](_0x11fb91[_0x03f4('0x13')],{'raw':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')][_0x03f4('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')]['where']||null:null,'attributes':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')][_0x03f4('0x19')]||null:null,'limit':_0x11fb91[_0x03f4('0x14')]?_0x11fb91['options'][_0x03f4('0x1a')]||null:null})[_0x03f4('0x8')](function(_0x535279){logger['info'](_0x03f4('0x1b'),_0x11fb91);logger[_0x03f4('0xb')](_0x03f4('0x1b'),_0x11fb91,JSON[_0x03f4('0xd')](_0x535279));_0x4a2b19(_0x535279);})[_0x03f4('0x11')](function(_0x453e88){logger['error']('UpdateChatQueueReport',_0x453e88[_0x03f4('0xf')],_0x11fb91);_0x3edef1(_0x1a1d10[_0x03f4('0xe')](0x1f4,_0x453e88[_0x03f4('0xf')]));});});};
\ No newline at end of file
+var _0x5066=['client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','options','where','attributes','UpdateChatQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30b8d5,_0x390f2a){var _0x47fc21=function(_0x4cbb1a){while(--_0x4cbb1a){_0x30b8d5['push'](_0x30b8d5['shift']());}};_0x47fc21(++_0x390f2a);}(_0x5066,0x1a3));var _0x6506=function(_0x5b0f89,_0x303a8b){_0x5b0f89=_0x5b0f89-0x0;var _0x21ae25=_0x5066[_0x5b0f89];return _0x21ae25;};'use strict';var _=require(_0x6506('0x0'));var util=require(_0x6506('0x1'));var moment=require('moment');var BPromise=require(_0x6506('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6506('0x3'));var db=require(_0x6506('0x4'))['db'];var utils=require(_0x6506('0x5'));var logger=require(_0x6506('0x6'))(_0x6506('0x7'));var config=require(_0x6506('0x8'));var jayson=require(_0x6506('0x9'));var client=jayson[_0x6506('0xa')][_0x6506('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ddced,_0x4a3191,_0x4cc9ab){return new BPromise(function(_0x5ca913,_0x374718){return client[_0x6506('0xc')](_0x1ddced,_0x4cc9ab)[_0x6506('0xd')](function(_0x276d86){logger[_0x6506('0xe')](_0x6506('0xf'),_0x4a3191,_0x6506('0x10'));logger[_0x6506('0x11')](_0x6506('0x12'),_0x4a3191,_0x6506('0x10'),JSON[_0x6506('0x13')](_0x276d86));if(_0x276d86[_0x6506('0x14')]){if(_0x276d86[_0x6506('0x14')]['code']===0x1f4){logger['error'](_0x6506('0xf'),_0x4a3191,_0x276d86[_0x6506('0x14')][_0x6506('0x15')]);return _0x374718(_0x276d86['error'][_0x6506('0x15')]);}logger['error'](_0x6506('0xf'),_0x4a3191,_0x276d86[_0x6506('0x14')]['message']);return _0x5ca913(_0x276d86[_0x6506('0x14')][_0x6506('0x15')]);}else{logger[_0x6506('0xe')](_0x6506('0xf'),_0x4a3191,_0x6506('0x10'));_0x5ca913(_0x276d86[_0x6506('0x16')][_0x6506('0x15')]);}})[_0x6506('0x17')](function(_0x2b59fd){logger[_0x6506('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x4a3191,_0x2b59fd);_0x374718(_0x2b59fd);});});}exports[_0x6506('0x18')]=function(_0x429396){var _0x2dc91b=this;return new Promise(function(_0x59f433,_0x5517d3){return db[_0x6506('0x19')][_0x6506('0x1a')](_0x429396[_0x6506('0x1b')],{'raw':_0x429396['options']?_0x429396['options'][_0x6506('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x51572c){logger[_0x6506('0xe')](_0x6506('0x18'),_0x429396);logger[_0x6506('0x11')](_0x6506('0x18'),_0x429396,JSON[_0x6506('0x13')](_0x51572c));_0x59f433(_0x51572c);})[_0x6506('0x17')](function(_0x1c37fa){logger[_0x6506('0x14')](_0x6506('0x18'),_0x1c37fa[_0x6506('0x15')],_0x429396);_0x5517d3(_0x2dc91b[_0x6506('0x14')](0x1f4,_0x1c37fa[_0x6506('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x3bc6b5){var _0x2b4437=this;return new Promise(function(_0x477805,_0x3e6d7a){return db[_0x6506('0x19')]['update'](_0x3bc6b5[_0x6506('0x1b')],{'raw':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1e')]||null:null,'attributes':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1f')]||null:null,'limit':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')]['limit']||null:null})[_0x6506('0xd')](function(_0x5986b6){logger['info'](_0x6506('0x20'),_0x3bc6b5);logger[_0x6506('0x11')](_0x6506('0x20'),_0x3bc6b5,JSON[_0x6506('0x13')](_0x5986b6));_0x477805(_0x5986b6);})[_0x6506('0x17')](function(_0xed9a88){logger[_0x6506('0x14')](_0x6506('0x20'),_0xed9a88['message'],_0x3bc6b5);_0x3e6d7a(_0x2b4437['error'](0x1f4,_0xed9a88[_0x6506('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 3090869..e1336c1 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 _0xde76=['update','delete','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x52d797,_0x4d28b2){var _0x147d12=function(_0x5a11ac){while(--_0x5a11ac){_0x52d797['push'](_0x52d797['shift']());}};_0x147d12(++_0x4d28b2);}(_0xde76,0x112));var _0x6de7=function(_0x208ef0,_0x3d81b4){_0x208ef0=_0x208ef0-0x0;var _0x4422e6=_0xde76[_0x208ef0];return _0x4422e6;};'use strict';var multer=require('multer');var util=require(_0x6de7('0x0'));var path=require('path');var timeout=require(_0x6de7('0x1'));var express=require(_0x6de7('0x2'));var router=express[_0x6de7('0x3')]();var fs_extra=require(_0x6de7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6de7('0x5'));var controller=require('./chatQueueReport.controller');router[_0x6de7('0x6')]('/',auth[_0x6de7('0x7')](),controller[_0x6de7('0x8')]);router[_0x6de7('0x6')](_0x6de7('0x9'),auth[_0x6de7('0x7')](),controller[_0x6de7('0xa')]);router[_0x6de7('0x6')](_0x6de7('0xb'),auth[_0x6de7('0x7')](),controller['show']);router[_0x6de7('0xc')]('/',auth['isAuthenticated'](),controller[_0x6de7('0xd')]);router[_0x6de7('0xe')]('/:id',auth[_0x6de7('0x7')](),controller[_0x6de7('0xf')]);router[_0x6de7('0x10')](_0x6de7('0xb'),auth[_0x6de7('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbe44=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x579e76,_0x13b9fe){var _0x532e25=function(_0x42cd6d){while(--_0x42cd6d){_0x579e76['push'](_0x579e76['shift']());}};_0x532e25(++_0x13b9fe);}(_0xbe44,0x175));var _0x4be4=function(_0x511d5c,_0x4d44a0){_0x511d5c=_0x511d5c-0x0;var _0x128d3b=_0xbe44[_0x511d5c];return _0x128d3b;};'use strict';var multer=require(_0x4be4('0x0'));var util=require('util');var path=require(_0x4be4('0x1'));var timeout=require(_0x4be4('0x2'));var express=require(_0x4be4('0x3'));var router=express[_0x4be4('0x4')]();var fs_extra=require(_0x4be4('0x5'));var auth=require(_0x4be4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4be4('0x7'));var controller=require(_0x4be4('0x8'));router[_0x4be4('0x9')]('/',auth['isAuthenticated'](),controller[_0x4be4('0xa')]);router[_0x4be4('0x9')](_0x4be4('0xb'),auth[_0x4be4('0xc')](),controller['describe']);router[_0x4be4('0x9')](_0x4be4('0xd'),auth[_0x4be4('0xc')](),controller[_0x4be4('0xe')]);router[_0x4be4('0xf')]('/',auth[_0x4be4('0xc')](),controller[_0x4be4('0x10')]);router[_0x4be4('0x11')](_0x4be4('0xd'),auth['isAuthenticated'](),controller[_0x4be4('0x12')]);router[_0x4be4('0x13')](_0x4be4('0xd'),auth[_0x4be4('0xc')](),controller[_0x4be4('0x14')]);module[_0x4be4('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 862ef7b..ee3e7d5 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x50e872,_0x4735f9){var _0x9acdac=function(_0xc845c0){while(--_0xc845c0){_0x50e872['push'](_0x50e872['shift']());}};_0x9acdac(++_0x4735f9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x00bb[_0x134c2e];return _0x2825db;};'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
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xf3d3d,_0x18c710){var _0x1e5511=function(_0x2b25e9){while(--_0x2b25e9){_0xf3d3d['push'](_0xf3d3d['shift']());}};_0x1e5511(++_0x18c710);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index cc4f873..af981bb 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 _0x88ee=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','ChatTransferReport','fieldName','type','key','keys','query','filters','model','attributes','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88ee,0x1d2));var _0xe88e=function(_0x3a206c,_0x16eee5){_0x3a206c=_0x3a206c-0x0;var _0x8e1108=_0x88ee[_0x3a206c];return _0x8e1108;};'use strict';var emlformat=require(_0xe88e('0x0'));var rimraf=require(_0xe88e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe88e('0x2'));var moment=require('moment');var BPromise=require(_0xe88e('0x3'));var Mustache=require(_0xe88e('0x4'));var util=require(_0xe88e('0x5'));var path=require('path');var sox=require(_0xe88e('0x6'));var csv=require('to-csv');var ejs=require(_0xe88e('0x7'));var fs=require('fs');var fs_extra=require(_0xe88e('0x8'));var _=require('lodash');var squel=require(_0xe88e('0x9'));var crypto=require(_0xe88e('0xa'));var jsforce=require(_0xe88e('0xb'));var deskjs=require(_0xe88e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe88e('0xd'));var Papa=require('papaparse');var Redis=require(_0xe88e('0xe'));var authService=require(_0xe88e('0xf'));var qs=require(_0xe88e('0x10'));var as=require(_0xe88e('0x11'));var hardwareService=require(_0xe88e('0x12'));var logger=require('../../config/logger')(_0xe88e('0x13'));var utils=require(_0xe88e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe88e('0x15'));var db=require(_0xe88e('0x16'))['db'];function respondWithStatusCode(_0x30d80c,_0xeb450e){_0xeb450e=_0xeb450e||0xcc;return function(_0x2dd02f){if(_0x2dd02f){return _0x30d80c[_0xe88e('0x17')](_0xeb450e);}return _0x30d80c[_0xe88e('0x18')](_0xeb450e)[_0xe88e('0x19')]();};}function respondWithResult(_0x21968e,_0x56fef8){_0x56fef8=_0x56fef8||0xc8;return function(_0x42d715){if(_0x42d715){return _0x21968e[_0xe88e('0x18')](_0x56fef8)[_0xe88e('0x1a')](_0x42d715);}};}function respondWithFilteredResult(_0x23138d,_0x22fbc2){return function(_0x552b89){if(_0x552b89){var _0xf40036=typeof _0x22fbc2[_0xe88e('0x1b')]===_0xe88e('0x1c')&&typeof _0x22fbc2[_0xe88e('0x1d')]===_0xe88e('0x1c');var _0x6ba0ae=_0x552b89[_0xe88e('0x1e')];var _0x1e1af8=_0xf40036?0x0:_0x22fbc2['offset'];var _0x331e9b=_0xf40036?_0x552b89[_0xe88e('0x1e')]:_0x22fbc2[_0xe88e('0x1b')]+_0x22fbc2[_0xe88e('0x1d')];var _0x1546ff;if(_0x331e9b>=_0x6ba0ae){_0x331e9b=_0x6ba0ae;_0x1546ff=0xc8;}else{_0x1546ff=0xce;}_0x23138d[_0xe88e('0x18')](_0x1546ff);return _0x23138d[_0xe88e('0x1f')](_0xe88e('0x20'),_0x1e1af8+'-'+_0x331e9b+'/'+_0x6ba0ae)[_0xe88e('0x1a')](_0x552b89);}return null;};}function patchUpdates(_0x3fe5cb){return function(_0x2b76d3){try{jsonpatch['apply'](_0x2b76d3,_0x3fe5cb,!![]);}catch(_0x78cb38){return BPromise[_0xe88e('0x21')](_0x78cb38);}return _0x2b76d3[_0xe88e('0x22')]();};}function saveUpdates(_0xcb4593,_0xf42e3c){return function(_0x1f4629){if(_0x1f4629){return _0x1f4629[_0xe88e('0x23')](_0xcb4593)[_0xe88e('0x24')](function(_0x370283){return _0x370283;});}return null;};}function removeEntity(_0x495c05,_0xe3d5f8){return function(_0xdad268){if(_0xdad268){return _0xdad268[_0xe88e('0x25')]()['then'](function(){_0x495c05[_0xe88e('0x18')](0xcc)[_0xe88e('0x19')]();});}};}function handleEntityNotFound(_0x11eecb,_0x7203bb){return function(_0x513c4d){if(!_0x513c4d){_0x11eecb[_0xe88e('0x17')](0x194);}return _0x513c4d;};}function handleError(_0x4c98b7,_0x3b2504){_0x3b2504=_0x3b2504||0x1f4;return function(_0xa7ee2a){logger[_0xe88e('0x26')](_0xa7ee2a[_0xe88e('0x27')]);if(_0xa7ee2a[_0xe88e('0x28')]){delete _0xa7ee2a['name'];}_0x4c98b7[_0xe88e('0x18')](_0x3b2504)['send'](_0xa7ee2a);};}exports['index']=function(_0x2f3526,_0x343759){var _0x4d8560={},_0x577aae={},_0x2b5872={'count':0x0,'rows':[]};var _0x3bbc97=_[_0xe88e('0x29')](db[_0xe88e('0x2a')]['rawAttributes'],function(_0x260d89){return{'name':_0x260d89[_0xe88e('0x2b')],'type':_0x260d89[_0xe88e('0x2c')][_0xe88e('0x2d')]};});_0x577aae['model']=_[_0xe88e('0x29')](_0x3bbc97,_0xe88e('0x28'));_0x577aae['query']=_[_0xe88e('0x2e')](_0x2f3526[_0xe88e('0x2f')]);_0x577aae[_0xe88e('0x30')]=_['intersection'](_0x577aae[_0xe88e('0x31')],_0x577aae[_0xe88e('0x2f')]);_0x4d8560[_0xe88e('0x32')]=_[_0xe88e('0x33')](_0x577aae[_0xe88e('0x31')],qs['fields'](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x34')]));_0x4d8560[_0xe88e('0x32')]=_0x4d8560[_0xe88e('0x32')]['length']?_0x4d8560[_0xe88e('0x32')]:_0x577aae[_0xe88e('0x31')];if(!_0x2f3526['query']['hasOwnProperty'](_0xe88e('0x35'))){_0x4d8560[_0xe88e('0x1d')]=qs[_0xe88e('0x1d')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x1d')]);_0x4d8560[_0xe88e('0x1b')]=qs[_0xe88e('0x1b')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x1b')]);}_0x4d8560[_0xe88e('0x36')]=qs[_0xe88e('0x37')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x37')]);_0x4d8560[_0xe88e('0x38')]=qs['filters'](_[_0xe88e('0x39')](_0x2f3526[_0xe88e('0x2f')],_0x577aae['filters']),_0x3bbc97);if(_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x3a')]){_0x4d8560[_0xe88e('0x38')]=_[_0xe88e('0x3b')](_0x4d8560[_0xe88e('0x38')],{'$or':_['map'](_0x3bbc97,function(_0x49bca7){if(_0x49bca7[_0xe88e('0x2c')]!==_0xe88e('0x3c')){var _0x1cc035={};_0x1cc035[_0x49bca7['name']]={'$like':'%'+_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x3a')]+'%'};return _0x1cc035;}})});}_0x4d8560=_[_0xe88e('0x3b')]({},_0x4d8560,_0x2f3526['options']);var _0x65b88e={'where':_0x4d8560['where']};return db[_0xe88e('0x2a')][_0xe88e('0x1e')](_0x65b88e)['then'](function(_0x105b84){_0x2b5872['count']=_0x105b84;if(_0x2f3526['query'][_0xe88e('0x3d')]){_0x4d8560[_0xe88e('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe88e('0x3f')](_0x4d8560);})[_0xe88e('0x24')](function(_0x5190c5){_0x2b5872[_0xe88e('0x40')]=_0x5190c5;return _0x2b5872;})[_0xe88e('0x24')](respondWithFilteredResult(_0x343759,_0x4d8560))[_0xe88e('0x41')](handleError(_0x343759,null));};exports[_0xe88e('0x42')]=function(_0x11e561,_0x4fd6ff){var _0x585a11={'raw':!![],'where':{'id':_0x11e561['params']['id']}},_0x46504c={};_0x46504c[_0xe88e('0x31')]=_[_0xe88e('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x46504c[_0xe88e('0x2f')]=_[_0xe88e('0x2e')](_0x11e561[_0xe88e('0x2f')]);_0x46504c[_0xe88e('0x30')]=_[_0xe88e('0x33')](_0x46504c[_0xe88e('0x31')],_0x46504c[_0xe88e('0x2f')]);_0x585a11[_0xe88e('0x32')]=_[_0xe88e('0x33')](_0x46504c[_0xe88e('0x31')],qs['fields'](_0x11e561['query']['fields']));_0x585a11[_0xe88e('0x32')]=_0x585a11[_0xe88e('0x32')][_0xe88e('0x43')]?_0x585a11[_0xe88e('0x32')]:_0x46504c[_0xe88e('0x31')];if(_0x11e561[_0xe88e('0x2f')][_0xe88e('0x3d')]){_0x585a11['include']=[{'all':!![]}];}_0x585a11=_['merge']({},_0x585a11,_0x11e561[_0xe88e('0x44')]);return db[_0xe88e('0x2a')][_0xe88e('0x45')](_0x585a11)[_0xe88e('0x24')](handleEntityNotFound(_0x4fd6ff,null))[_0xe88e('0x24')](respondWithResult(_0x4fd6ff,null))['catch'](handleError(_0x4fd6ff,null));};exports['create']=function(_0x599f32,_0x518e1b){return db[_0xe88e('0x2a')][_0xe88e('0x46')](_0x599f32[_0xe88e('0x47')],{})[_0xe88e('0x24')](respondWithResult(_0x518e1b,0xc9))['catch'](handleError(_0x518e1b,null));};exports[_0xe88e('0x23')]=function(_0x21ce71,_0xcf43e7){if(_0x21ce71[_0xe88e('0x47')]['id']){delete _0x21ce71[_0xe88e('0x47')]['id'];}return db[_0xe88e('0x2a')][_0xe88e('0x45')]({'where':{'id':_0x21ce71['params']['id']}})['then'](handleEntityNotFound(_0xcf43e7,null))[_0xe88e('0x24')](saveUpdates(_0x21ce71['body'],null))['then'](respondWithResult(_0xcf43e7,null))['catch'](handleError(_0xcf43e7,null));};exports[_0xe88e('0x25')]=function(_0xba84c,_0x176517){return db['ChatTransferReport'][_0xe88e('0x45')]({'where':{'id':_0xba84c[_0xe88e('0x48')]['id']}})['then'](handleEntityNotFound(_0x176517,null))['then'](removeEntity(_0x176517,null))[_0xe88e('0x41')](handleError(_0x176517,null));};exports['describe']=function(_0x4f4b8f,_0x375b06){return db[_0xe88e('0x2a')][_0xe88e('0x49')]()['then'](respondWithResult(_0x375b06,null))['catch'](handleError(_0x375b06,null));};
\ No newline at end of file
+var _0x7f07=['model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','count','offset','limit','status','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7f07,0x1d0));var _0x77f0=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0x7f07[_0x32f6b9];return _0x267d52;};'use strict';var emlformat=require(_0x77f0('0x0'));var rimraf=require(_0x77f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77f0('0x2'));var rp=require(_0x77f0('0x3'));var moment=require(_0x77f0('0x4'));var BPromise=require(_0x77f0('0x5'));var Mustache=require(_0x77f0('0x6'));var util=require(_0x77f0('0x7'));var path=require('path');var sox=require(_0x77f0('0x8'));var csv=require(_0x77f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77f0('0xa'));var _=require(_0x77f0('0xb'));var squel=require(_0x77f0('0xc'));var crypto=require(_0x77f0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x77f0('0x9'));var querystring=require(_0x77f0('0xe'));var Papa=require(_0x77f0('0xf'));var Redis=require(_0x77f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77f0('0x11'));var as=require(_0x77f0('0x12'));var hardwareService=require(_0x77f0('0x13'));var logger=require(_0x77f0('0x14'))(_0x77f0('0x15'));var utils=require(_0x77f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x77f0('0x17'));var db=require(_0x77f0('0x18'))['db'];function respondWithStatusCode(_0xe6402c,_0x55cec6){_0x55cec6=_0x55cec6||0xcc;return function(_0xb8a810){if(_0xb8a810){return _0xe6402c['sendStatus'](_0x55cec6);}return _0xe6402c['status'](_0x55cec6)[_0x77f0('0x19')]();};}function respondWithResult(_0x27329b,_0x335e53){_0x335e53=_0x335e53||0xc8;return function(_0x20de43){if(_0x20de43){return _0x27329b['status'](_0x335e53)[_0x77f0('0x1a')](_0x20de43);}};}function respondWithFilteredResult(_0x2474b5,_0xf74c3){return function(_0x281ea2){if(_0x281ea2){var _0xfc507=typeof _0xf74c3['offset']==='undefined'&&typeof _0xf74c3['limit']===_0x77f0('0x1b');var _0x313fd8=_0x281ea2[_0x77f0('0x1c')];var _0x4b4053=_0xfc507?0x0:_0xf74c3[_0x77f0('0x1d')];var _0x4759a4=_0xfc507?_0x281ea2['count']:_0xf74c3[_0x77f0('0x1d')]+_0xf74c3[_0x77f0('0x1e')];var _0x44d9f3;if(_0x4759a4>=_0x313fd8){_0x4759a4=_0x313fd8;_0x44d9f3=0xc8;}else{_0x44d9f3=0xce;}_0x2474b5[_0x77f0('0x1f')](_0x44d9f3);return _0x2474b5['set'](_0x77f0('0x20'),_0x4b4053+'-'+_0x4759a4+'/'+_0x313fd8)[_0x77f0('0x1a')](_0x281ea2);}return null;};}function patchUpdates(_0x39b252){return function(_0x1d9142){try{jsonpatch['apply'](_0x1d9142,_0x39b252,!![]);}catch(_0xffb21f){return BPromise[_0x77f0('0x21')](_0xffb21f);}return _0x1d9142[_0x77f0('0x22')]();};}function saveUpdates(_0x202c3e,_0x5acb54){return function(_0x42930b){if(_0x42930b){return _0x42930b[_0x77f0('0x23')](_0x202c3e)['then'](function(_0x25e23e){return _0x25e23e;});}return null;};}function removeEntity(_0x5d0223,_0x14dbec){return function(_0x5e3b1f){if(_0x5e3b1f){return _0x5e3b1f[_0x77f0('0x24')]()[_0x77f0('0x25')](function(){_0x5d0223[_0x77f0('0x1f')](0xcc)[_0x77f0('0x19')]();});}};}function handleEntityNotFound(_0x57f4e2,_0x373fea){return function(_0x3cc93e){if(!_0x3cc93e){_0x57f4e2[_0x77f0('0x26')](0x194);}return _0x3cc93e;};}function handleError(_0x91400f,_0xa4629){_0xa4629=_0xa4629||0x1f4;return function(_0x5ec4b3){logger['error'](_0x5ec4b3[_0x77f0('0x27')]);if(_0x5ec4b3[_0x77f0('0x28')]){delete _0x5ec4b3['name'];}_0x91400f['status'](_0xa4629)[_0x77f0('0x29')](_0x5ec4b3);};}exports[_0x77f0('0x2a')]=function(_0x4bc0ce,_0x132221){var _0x1c3713={},_0x1a1668={},_0x448a20={'count':0x0,'rows':[]};var _0x1d6ce6=_[_0x77f0('0x2b')](db[_0x77f0('0x2c')][_0x77f0('0x2d')],function(_0x55df40){return{'name':_0x55df40[_0x77f0('0x2e')],'type':_0x55df40['type']['key']};});_0x1a1668[_0x77f0('0x2f')]=_['map'](_0x1d6ce6,'name');_0x1a1668[_0x77f0('0x30')]=_[_0x77f0('0x31')](_0x4bc0ce[_0x77f0('0x30')]);_0x1a1668[_0x77f0('0x32')]=_[_0x77f0('0x33')](_0x1a1668[_0x77f0('0x2f')],_0x1a1668[_0x77f0('0x30')]);_0x1c3713[_0x77f0('0x34')]=_[_0x77f0('0x33')](_0x1a1668[_0x77f0('0x2f')],qs['fields'](_0x4bc0ce[_0x77f0('0x30')]['fields']));_0x1c3713['attributes']=_0x1c3713[_0x77f0('0x34')][_0x77f0('0x35')]?_0x1c3713['attributes']:_0x1a1668['model'];if(!_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x36')](_0x77f0('0x37'))){_0x1c3713[_0x77f0('0x1e')]=qs['limit'](_0x4bc0ce[_0x77f0('0x30')]['limit']);_0x1c3713[_0x77f0('0x1d')]=qs['offset'](_0x4bc0ce[_0x77f0('0x30')]['offset']);}_0x1c3713[_0x77f0('0x38')]=qs[_0x77f0('0x39')](_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x39')]);_0x1c3713[_0x77f0('0x3a')]=qs['filters'](_['pick'](_0x4bc0ce[_0x77f0('0x30')],_0x1a1668['filters']),_0x1d6ce6);if(_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3b')]){_0x1c3713[_0x77f0('0x3a')]=_[_0x77f0('0x3c')](_0x1c3713[_0x77f0('0x3a')],{'$or':_[_0x77f0('0x2b')](_0x1d6ce6,function(_0x532907){if(_0x532907[_0x77f0('0x3d')]!==_0x77f0('0x3e')){var _0x190fd5={};_0x190fd5[_0x532907['name']]={'$like':'%'+_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3b')]+'%'};return _0x190fd5;}})});}_0x1c3713=_[_0x77f0('0x3c')]({},_0x1c3713,_0x4bc0ce['options']);var _0x42b81a={'where':_0x1c3713[_0x77f0('0x3a')]};return db[_0x77f0('0x2c')]['count'](_0x42b81a)['then'](function(_0x4e93e4){_0x448a20[_0x77f0('0x1c')]=_0x4e93e4;if(_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3f')]){_0x1c3713['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x77f0('0x40')](_0x1c3713);})[_0x77f0('0x25')](function(_0x104289){_0x448a20['rows']=_0x104289;return _0x448a20;})[_0x77f0('0x25')](respondWithFilteredResult(_0x132221,_0x1c3713))[_0x77f0('0x41')](handleError(_0x132221,null));};exports['show']=function(_0x362341,_0x2b03d){var _0x5815ed={'raw':!![],'where':{'id':_0x362341[_0x77f0('0x42')]['id']}},_0x27082c={};_0x27082c['model']=_['keys'](db[_0x77f0('0x2c')][_0x77f0('0x2d')]);_0x27082c[_0x77f0('0x30')]=_[_0x77f0('0x31')](_0x362341['query']);_0x27082c['filters']=_['intersection'](_0x27082c[_0x77f0('0x2f')],_0x27082c[_0x77f0('0x30')]);_0x5815ed[_0x77f0('0x34')]=_[_0x77f0('0x33')](_0x27082c[_0x77f0('0x2f')],qs['fields'](_0x362341[_0x77f0('0x30')][_0x77f0('0x43')]));_0x5815ed['attributes']=_0x5815ed[_0x77f0('0x34')][_0x77f0('0x35')]?_0x5815ed[_0x77f0('0x34')]:_0x27082c[_0x77f0('0x2f')];if(_0x362341['query'][_0x77f0('0x3f')]){_0x5815ed['include']=[{'all':!![]}];}_0x5815ed=_[_0x77f0('0x3c')]({},_0x5815ed,_0x362341[_0x77f0('0x44')]);return db[_0x77f0('0x2c')][_0x77f0('0x45')](_0x5815ed)[_0x77f0('0x25')](handleEntityNotFound(_0x2b03d,null))[_0x77f0('0x25')](respondWithResult(_0x2b03d,null))[_0x77f0('0x41')](handleError(_0x2b03d,null));};exports[_0x77f0('0x46')]=function(_0x253f68,_0x18588c){return db[_0x77f0('0x2c')][_0x77f0('0x46')](_0x253f68[_0x77f0('0x47')],{})['then'](respondWithResult(_0x18588c,0xc9))[_0x77f0('0x41')](handleError(_0x18588c,null));};exports[_0x77f0('0x23')]=function(_0x9a1a76,_0x3413aa){if(_0x9a1a76[_0x77f0('0x47')]['id']){delete _0x9a1a76[_0x77f0('0x47')]['id'];}return db['ChatTransferReport'][_0x77f0('0x45')]({'where':{'id':_0x9a1a76[_0x77f0('0x42')]['id']}})[_0x77f0('0x25')](handleEntityNotFound(_0x3413aa,null))['then'](saveUpdates(_0x9a1a76[_0x77f0('0x47')],null))[_0x77f0('0x25')](respondWithResult(_0x3413aa,null))[_0x77f0('0x41')](handleError(_0x3413aa,null));};exports[_0x77f0('0x24')]=function(_0x40ffdd,_0x5e8979){return db['ChatTransferReport']['find']({'where':{'id':_0x40ffdd[_0x77f0('0x42')]['id']}})[_0x77f0('0x25')](handleEntityNotFound(_0x5e8979,null))['then'](removeEntity(_0x5e8979,null))[_0x77f0('0x41')](handleError(_0x5e8979,null));};exports[_0x77f0('0x48')]=function(_0x5bd32a,_0x22001c){return db[_0x77f0('0x2c')][_0x77f0('0x48')]()['then'](respondWithResult(_0x22001c,null))['catch'](handleError(_0x22001c,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 685fe41..aca0446 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 _0x66f6=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x267d23,_0x5deabf){var _0x1005ed=function(_0x569fcc){while(--_0x569fcc){_0x267d23['push'](_0x267d23['shift']());}};_0x1005ed(++_0x5deabf);}(_0x66f6,0x1b1));var _0x666f=function(_0x18653b,_0x4b27b2){_0x18653b=_0x18653b-0x0;var _0x3b5498=_0x66f6[_0x18653b];return _0x3b5498;};'use strict';var _=require(_0x666f('0x0'));var util=require(_0x666f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x666f('0x2'));var BPromise=require('bluebird');var rp=require(_0x666f('0x3'));var fs=require('fs');var path=require(_0x666f('0x4'));var rimraf=require(_0x666f('0x5'));var config=require(_0x666f('0x6'));var attributes=require(_0x666f('0x7'));module[_0x666f('0x8')]=function(_0x5eae52,_0x2bba3a){return _0x5eae52[_0x666f('0x9')](_0x666f('0xa'),attributes,{'tableName':_0x666f('0xb'),'paranoid':![],'indexes':[{'name':_0x666f('0xc'),'fields':[_0x666f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe76d=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x307d9f,_0x231547){var _0x59dac4=function(_0x4f50c8){while(--_0x4f50c8){_0x307d9f['push'](_0x307d9f['shift']());}};_0x59dac4(++_0x231547);}(_0xe76d,0x1cb));var _0xde76=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xe76d[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xde76('0x0'));var util=require('util');var logger=require(_0xde76('0x1'))('api');var moment=require(_0xde76('0x2'));var BPromise=require(_0xde76('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde76('0x4'));var rimraf=require(_0xde76('0x5'));var config=require(_0xde76('0x6'));var attributes=require(_0xde76('0x7'));module[_0xde76('0x8')]=function(_0x4dc7aa,_0x39d111){return _0x4dc7aa[_0xde76('0x9')](_0xde76('0xa'),attributes,{'tableName':_0xde76('0xb'),'paranoid':![],'indexes':[{'name':_0xde76('0xc'),'fields':[_0xde76('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 791e36b..f2b7be9 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 _0x6c89=['../../config/environment','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','ioredis','../../config/logger','rpc'];(function(_0x1f8469,_0x457bc7){var _0x450377=function(_0x34fc81){while(--_0x34fc81){_0x1f8469['push'](_0x1f8469['shift']());}};_0x450377(++_0x457bc7);}(_0x6c89,0x118));var _0x96c8=function(_0x2e9bbb,_0x2d4412){_0x2e9bbb=_0x2e9bbb-0x0;var _0x464295=_0x6c89[_0x2e9bbb];return _0x464295;};'use strict';var _=require('lodash');var util=require(_0x96c8('0x0'));var moment=require(_0x96c8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96c8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x96c8('0x3'))(_0x96c8('0x4'));var config=require(_0x96c8('0x5'));var jayson=require(_0x96c8('0x6'));var client=jayson[_0x96c8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e7ed,_0x4e0b7c,_0x51ae0c){return new BPromise(function(_0x389518,_0x48156a){return client[_0x96c8('0x8')](_0x39e7ed,_0x51ae0c)['then'](function(_0x41f41c){logger[_0x96c8('0x9')](_0x96c8('0xa'),_0x4e0b7c,'request\x20sent');logger[_0x96c8('0xb')](_0x96c8('0xc'),_0x4e0b7c,_0x96c8('0xd'),JSON[_0x96c8('0xe')](_0x41f41c));if(_0x41f41c[_0x96c8('0xf')]){if(_0x41f41c[_0x96c8('0xf')][_0x96c8('0x10')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4e0b7c,_0x41f41c[_0x96c8('0xf')]['message']);return _0x48156a(_0x41f41c['error'][_0x96c8('0x11')]);}logger['error'](_0x96c8('0xa'),_0x4e0b7c,_0x41f41c[_0x96c8('0xf')][_0x96c8('0x11')]);return _0x389518(_0x41f41c[_0x96c8('0xf')][_0x96c8('0x11')]);}else{logger[_0x96c8('0x9')](_0x96c8('0xa'),_0x4e0b7c,_0x96c8('0xd'));_0x389518(_0x41f41c[_0x96c8('0x12')][_0x96c8('0x11')]);}})['catch'](function(_0x4743d2){logger[_0x96c8('0xf')](_0x96c8('0xa'),_0x4e0b7c,_0x4743d2);_0x48156a(_0x4743d2);});});}
\ No newline at end of file
+var _0xa61d=['jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x119739,_0x250ebb){var _0x1fc8e5=function(_0x34eaef){while(--_0x34eaef){_0x119739['push'](_0x119739['shift']());}};_0x1fc8e5(++_0x250ebb);}(_0xa61d,0xfe));var _0xda61=function(_0x8f4ca2,_0xc4ac52){_0x8f4ca2=_0x8f4ca2-0x0;var _0x126663=_0xa61d[_0x8f4ca2];return _0x126663;};'use strict';var _=require(_0xda61('0x0'));var util=require(_0xda61('0x1'));var moment=require(_0xda61('0x2'));var BPromise=require(_0xda61('0x3'));var rs=require(_0xda61('0x4'));var fs=require('fs');var Redis=require(_0xda61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda61('0x6'));var logger=require(_0xda61('0x7'))(_0xda61('0x8'));var config=require(_0xda61('0x9'));var jayson=require(_0xda61('0xa'));var client=jayson['client'][_0xda61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fd5d3,_0x2555bf,_0x7de2b3){return new BPromise(function(_0x2024af,_0x13e822){return client[_0xda61('0xc')](_0x3fd5d3,_0x7de2b3)[_0xda61('0xd')](function(_0x3a1d44){logger[_0xda61('0xe')](_0xda61('0xf'),_0x2555bf,_0xda61('0x10'));logger[_0xda61('0x11')](_0xda61('0x12'),_0x2555bf,_0xda61('0x10'),JSON[_0xda61('0x13')](_0x3a1d44));if(_0x3a1d44[_0xda61('0x14')]){if(_0x3a1d44[_0xda61('0x14')][_0xda61('0x15')]===0x1f4){logger[_0xda61('0x14')](_0xda61('0xf'),_0x2555bf,_0x3a1d44['error'][_0xda61('0x16')]);return _0x13e822(_0x3a1d44[_0xda61('0x14')][_0xda61('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2555bf,_0x3a1d44['error'][_0xda61('0x16')]);return _0x2024af(_0x3a1d44[_0xda61('0x14')][_0xda61('0x16')]);}else{logger[_0xda61('0xe')](_0xda61('0xf'),_0x2555bf,_0xda61('0x10'));_0x2024af(_0x3a1d44['result'][_0xda61('0x16')]);}})[_0xda61('0x17')](function(_0x3c9597){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2555bf,_0x3c9597);_0x13e822(_0x3c9597);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 3a6a4a3..77e338e 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 _0x8fdd=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x1bd155,_0xab1239){var _0x3b67e9=function(_0x299967){while(--_0x299967){_0x1bd155['push'](_0x1bd155['shift']());}};_0x3b67e9(++_0xab1239);}(_0x8fdd,0x177));var _0xd8fd=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x8fdd[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0xd8fd('0x0'));var util=require('util');var path=require(_0xd8fd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd8fd('0x2')]();var fs_extra=require(_0xd8fd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd8fd('0x4'));var config=require(_0xd8fd('0x5'));var controller=require(_0xd8fd('0x6'));router[_0xd8fd('0x7')]('/',auth[_0xd8fd('0x8')](),controller[_0xd8fd('0x9')]);router[_0xd8fd('0x7')](_0xd8fd('0xa'),auth['isAuthenticated'](),controller[_0xd8fd('0xb')]);router[_0xd8fd('0x7')](_0xd8fd('0xc'),auth[_0xd8fd('0x8')](),controller[_0xd8fd('0xd')]);router['post']('/',auth[_0xd8fd('0x8')](),controller[_0xd8fd('0xe')]);router[_0xd8fd('0xf')](_0xd8fd('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd8fd('0x10')](_0xd8fd('0xc'),auth['isAuthenticated'](),controller[_0xd8fd('0x11')]);module[_0xd8fd('0x12')]=router;
\ No newline at end of file
+var _0x4865=['/describe','/:id','create','put','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x3f6e77,_0x443be1){var _0x3b8ef1=function(_0xbdbf95){while(--_0xbdbf95){_0x3f6e77['push'](_0x3f6e77['shift']());}};_0x3b8ef1(++_0x443be1);}(_0x4865,0x1c1));var _0x5486=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4865[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x5486('0x0'));var util=require(_0x5486('0x1'));var path=require(_0x5486('0x2'));var timeout=require('connect-timeout');var express=require(_0x5486('0x3'));var router=express[_0x5486('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5486('0x5'));var controller=require(_0x5486('0x6'));router[_0x5486('0x7')]('/',auth[_0x5486('0x8')](),controller[_0x5486('0x9')]);router[_0x5486('0x7')](_0x5486('0xa'),auth[_0x5486('0x8')](),controller['describe']);router[_0x5486('0x7')](_0x5486('0xb'),auth[_0x5486('0x8')](),controller['show']);router['post']('/',auth[_0x5486('0x8')](),controller[_0x5486('0xc')]);router[_0x5486('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5486('0xe')](_0x5486('0xb'),auth['isAuthenticated'](),controller[_0x5486('0xf')]);module[_0x5486('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index e4d1229..b66f8a4 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 _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x4a7ab0,_0x5b4374){var _0x2ba110=function(_0x51a6da){while(--_0x51a6da){_0x4a7ab0['push'](_0x4a7ab0['shift']());}};_0x2ba110(++_0x5b4374);}(_0xee5b,0x1f4));var _0xbee5=function(_0x259d3c,_0x3bfd6b){_0x259d3c=_0x259d3c-0x0;var _0x933304=_0xee5b[_0x259d3c];return _0x933304;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}};
\ No newline at end of file
+var _0x750a=['System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','ENUM','thumb','TEXT','input','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','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.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa'];(function(_0x4724ce,_0x57ea91){var _0x5dbb37=function(_0x4bac24){while(--_0x4bac24){_0x4724ce['push'](_0x4724ce['shift']());}};_0x5dbb37(++_0x57ea91);}(_0x750a,0x140));var _0xa750=function(_0x11eca0,_0x466916){_0x11eca0=_0x11eca0-0x0;var _0xf706a=_0x750a[_0x11eca0];return _0xf706a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa750('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'unique':_0xa750('0x2')},'description':{'type':Sequelize[_0xa750('0x1')]},'mapKey':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x3')},'key':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x4')},'customerAlias':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa750('0x1')]},'animation':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xa750('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x9')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xa')},'offline_chat_button':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xc')},'download_transcript':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa750('0x12')]('star',_0xa750('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa750('0x14')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa750('0x15'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xa750('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xa750('0x3'),'type':_0xa750('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa750('0x16')](_0xa750('0x17'))?JSON[_0xa750('0x18')](this[_0xa750('0x16')](_0xa750('0x17'))):{};},'set':function(_0x3d52b3){return this[_0xa750('0x19')](_0xa750('0x17'),JSON[_0xa750('0x1a')](_0x3d52b3));}},'offlineForm':{'type':Sequelize[_0xa750('0x14')],'defaultValue':function(){return JSON[_0xa750('0x1a')]({'items':[{'type':_0xa750('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa750('0x3'),'type':_0xa750('0x3')},'variable':null},{'type':_0xa750('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':_0xa750('0x1c'),'helpText':_0xa750('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0xa750('0x16')](_0xa750('0x1e'))?JSON['parse'](this[_0xa750('0x16')](_0xa750('0x1e'))):{};},'set':function(_0x449bb7){return this[_0xa750('0x19')](_0xa750('0x1e'),JSON['stringify'](_0x449bb7));}},'token':{'type':Sequelize[_0xa750('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa750('0x1')]},'forwardOffline':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa750('0x1')]},'waitingTitle':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x1f')},'waitingMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x21')},'skipUnmanaged':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xb')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa750('0x14')]},'showAgentAvatar':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa750('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa750('0x22');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x23')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x24')},'verticalAlignment':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0x25')},'messagesAlignment':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xa750('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa750('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa750('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0x28')},'systemAvatar':{'type':Sequelize[_0xa750('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa750('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![],'comment':_0xa750('0x2a'),'set':function(_0x1166ff){if(!_0x1166ff)this[_0xa750('0x19')]('mandatoryDispositionPauseId',null);this[_0xa750('0x19')](_0xa750('0x2b'),_0x1166ff);}},'vidaooEscalation':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa750('0x1')]},'vidaooTopic':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x2c')},'vidaooNote':{'type':Sequelize[_0xa750('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa750('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa750('0x14')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 2635b66..ffb204a 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 _0x9c52=['mandatoryDispositionPause','map','ChatWebsite','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','show','params','fields','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rawAttributes','merge','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','join','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','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','headers','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','includes','mapKeyOffline','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','findOne','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','lastName','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','Tag','Tags','color','tag','rows','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','push','all','server/files/chat/iframe.ejs','3.1.0','remote','connection','replace','alignment','verticalAlignment','textColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','get','ChatWebsites','UserProfileResource','name','Pause'];(function(_0x413112,_0x5efc73){var _0x452ff8=function(_0x341515){while(--_0x341515){_0x413112['push'](_0x413112['shift']());}};_0x452ff8(++_0x5efc73);}(_0x9c52,0xfd));var _0x29c5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9c52[_0x397e5f];return _0x5302b8;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x29c5('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x29c5('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x29c5('0x2'));var Redis=require(_0x29c5('0x3'));var qs=require(_0x29c5('0x4'));var logger=require(_0x29c5('0x5'))(_0x29c5('0x6'));var config=require(_0x29c5('0x7'));var url=require('url');var db=require(_0x29c5('0x8'))['db'];config[_0x29c5('0x9')]=_[_0x29c5('0xa')](config[_0x29c5('0x9')],{'host':_0x29c5('0xb'),'port':0x18eb});var socket=require(_0x29c5('0xc'))(new Redis(config['redis']));require(_0x29c5('0xd'))['register'](socket);var htmlToText=require(_0x29c5('0xe'));var jayson=require(_0x29c5('0xf'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x29c5('0x10')][_0x29c5('0x11')]({'port':0x232a});var client9003=jayson[_0x29c5('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x29c5('0x10')][_0x29c5('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x242f0e,_0x2b3cac,_0x444ca4,_0x161a77){return new BPromise(function(_0x9e6c4e,_0x56ccee){var _0x10290a=_0x161a77||client;return _0x10290a[_0x29c5('0x12')](_0x242f0e,_0x444ca4)[_0x29c5('0x13')](function(_0x4842c4){logger[_0x29c5('0x14')](_0x29c5('0x15'),_0x2b3cac,_0x29c5('0x16'));logger[_0x29c5('0x17')](_0x29c5('0x18'),_0x2b3cac,'request\x20sent',JSON['stringify'](_0x4842c4));if(_0x4842c4['error']){if(_0x4842c4['error'][_0x29c5('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2b3cac,_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);return _0x56ccee(_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);}logger['error'](_0x29c5('0x15'),_0x2b3cac,_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);return _0x9e6c4e(_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);}else{logger[_0x29c5('0x14')](_0x29c5('0x15'),_0x2b3cac,'request\x20sent');_0x9e6c4e(_0x4842c4[_0x29c5('0x1c')][_0x29c5('0x1b')]);}})['catch'](function(_0xddd2db){logger[_0x29c5('0x1a')](_0x29c5('0x15'),_0x2b3cac,_0xddd2db);_0x56ccee(_0xddd2db);});});}function respondWithStatusCode(_0x45168e,_0x4b958a){_0x4b958a=_0x4b958a||0xcc;return function(_0x2808a6){if(_0x2808a6){return _0x45168e[_0x29c5('0x1d')](_0x4b958a);}return _0x45168e[_0x29c5('0x1e')](_0x4b958a)[_0x29c5('0x1f')]();};}function respondWithResult(_0xc12cc4,_0x537d30){_0x537d30=_0x537d30||0xc8;return function(_0x3e0f86){if(_0x3e0f86){return _0xc12cc4[_0x29c5('0x1e')](_0x537d30)[_0x29c5('0x20')](_0x3e0f86);}};}function respondWithFilteredResult(_0x53b74,_0x212b0f){return function(_0x1e2bca){if(_0x1e2bca){var _0x3fc204=typeof _0x212b0f['offset']===_0x29c5('0x21')&&typeof _0x212b0f[_0x29c5('0x22')]==='undefined';var _0x23ef8c=_0x1e2bca[_0x29c5('0x23')];var _0x19a535=_0x3fc204?0x0:_0x212b0f[_0x29c5('0x24')];var _0x549a20=_0x3fc204?_0x1e2bca[_0x29c5('0x23')]:_0x212b0f['offset']+_0x212b0f[_0x29c5('0x22')];var _0x37b484;if(_0x549a20>=_0x23ef8c){_0x549a20=_0x23ef8c;_0x37b484=0xc8;}else{_0x37b484=0xce;}_0x53b74[_0x29c5('0x1e')](_0x37b484);return _0x53b74[_0x29c5('0x25')]('Content-Range',_0x19a535+'-'+_0x549a20+'/'+_0x23ef8c)['json'](_0x1e2bca);}return null;};}function saveUpdates(_0x32421b){return function(_0x3ed2fc){if(_0x3ed2fc){return _0x3ed2fc[_0x29c5('0x26')](_0x32421b)[_0x29c5('0x13')](function(_0x8fe861){return _0x8fe861;});}return null;};}function removeEntity(_0x4aa20b){return function(_0x40893e){if(_0x40893e){return _0x40893e[_0x29c5('0x27')]()['then'](function(){var _0x25b500=_0x40893e[_0x29c5('0x28')]({'plain':!![]});var _0x30798b=_0x29c5('0x29');return db[_0x29c5('0x2a')][_0x29c5('0x27')]({'where':{'type':_0x30798b,'resourceId':_0x25b500['id']}})['then'](function(){return _0x40893e;});})[_0x29c5('0x13')](function(){_0x4aa20b['status'](0xcc)[_0x29c5('0x1f')]();});}};}function handleEntityNotFound(_0xe13dac){return function(_0x3e30a8){if(!_0x3e30a8){_0xe13dac['sendStatus'](0x194);}return _0x3e30a8;};}function handleError(_0x30a2e8,_0xb31a6c){_0xb31a6c=_0xb31a6c||0x1f4;return function(_0x61db41){logger[_0x29c5('0x1a')](_0x61db41['stack']);if(_0x61db41[_0x29c5('0x2b')]){delete _0x61db41['name'];}_0x30a2e8[_0x29c5('0x1e')](_0xb31a6c)['send'](_0x61db41);};}exports['index']=function(_0x16aabc,_0x4c7969){var _0x347f2a={'include':[{'model':db[_0x29c5('0x2c')],'as':_0x29c5('0x2d')}]},_0x38322f={},_0x2131a3={'count':0x0,'rows':[]};var _0x5aa3b1=_[_0x29c5('0x2e')](db[_0x29c5('0x2f')]['rawAttributes'],function(_0x4a7ace){return{'name':_0x4a7ace['fieldName'],'type':_0x4a7ace[_0x29c5('0x30')][_0x29c5('0x31')]};});_0x38322f[_0x29c5('0x32')]=_[_0x29c5('0x2e')](_0x5aa3b1,_0x29c5('0x2b'));_0x38322f[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x16aabc[_0x29c5('0x33')]);_0x38322f[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x38322f[_0x29c5('0x32')],_0x38322f[_0x29c5('0x33')]);_0x347f2a[_0x29c5('0x37')]=_['intersection'](_0x38322f[_0x29c5('0x32')],qs['fields'](_0x16aabc['query']['fields']));_0x347f2a[_0x29c5('0x37')]=_0x347f2a[_0x29c5('0x37')][_0x29c5('0x38')]?_0x347f2a[_0x29c5('0x37')]:_0x38322f['model'];if(!_0x16aabc[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x347f2a['limit']=qs[_0x29c5('0x22')](_0x16aabc[_0x29c5('0x33')][_0x29c5('0x22')]);_0x347f2a[_0x29c5('0x24')]=qs['offset'](_0x16aabc[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x347f2a[_0x29c5('0x3b')]=qs['sort'](_0x16aabc['query'][_0x29c5('0x3c')]);_0x347f2a[_0x29c5('0x3d')]=qs['filters'](_[_0x29c5('0x3e')](_0x16aabc[_0x29c5('0x33')],_0x38322f[_0x29c5('0x35')]),_0x5aa3b1);if(_0x16aabc['query'][_0x29c5('0x3f')]){_0x347f2a['where']=_['merge'](_0x347f2a['where'],{'$or':_[_0x29c5('0x2e')](_0x5aa3b1,function(_0x24a800){if(_0x24a800[_0x29c5('0x30')]!==_0x29c5('0x40')){var _0x17167a={};_0x17167a[_0x24a800['name']]={'$like':'%'+_0x16aabc[_0x29c5('0x33')]['filter']+'%'};return _0x17167a;}})});}_0x347f2a=_['merge']({},_0x347f2a,_0x16aabc['options']);var _0x26dc1c={'where':_0x347f2a[_0x29c5('0x3d')]};return db[_0x29c5('0x2f')][_0x29c5('0x23')](_0x26dc1c)[_0x29c5('0x13')](function(_0xc3eb62){_0x2131a3[_0x29c5('0x23')]=_0xc3eb62;if(_0x16aabc[_0x29c5('0x33')]['includeAll']){_0x347f2a[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x2f')][_0x29c5('0x42')](_0x347f2a);})[_0x29c5('0x13')](function(_0x59e66d){_0x2131a3['rows']=_0x59e66d;return _0x2131a3;})[_0x29c5('0x13')](respondWithFilteredResult(_0x4c7969,_0x347f2a))['catch'](handleError(_0x4c7969,null));};exports[_0x29c5('0x43')]=function(_0x419597,_0x5ec51c){var _0x564704={'raw':![],'where':{'id':_0x419597[_0x29c5('0x44')]['id']},'include':[{'model':db['Pause'],'as':_0x29c5('0x2d')}]},_0x254755={};_0x254755[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0x2f')]['rawAttributes']);_0x254755[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x419597[_0x29c5('0x33')]);_0x254755[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x254755[_0x29c5('0x32')],_0x254755[_0x29c5('0x33')]);_0x564704[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x254755[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x419597[_0x29c5('0x33')][_0x29c5('0x45')]));_0x564704['attributes']=_0x564704[_0x29c5('0x37')][_0x29c5('0x38')]?_0x564704['attributes']:_0x254755[_0x29c5('0x32')];if(_0x419597[_0x29c5('0x33')][_0x29c5('0x46')]){_0x564704[_0x29c5('0x41')]=[{'all':!![]}];}_0x564704=_['merge']({},_0x564704,_0x419597[_0x29c5('0x47')]);return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x564704)['then'](handleEntityNotFound(_0x5ec51c,null))[_0x29c5('0x13')](respondWithResult(_0x5ec51c,null))[_0x29c5('0x49')](handleError(_0x5ec51c,null));};exports[_0x29c5('0x4a')]=function(_0x2ec422,_0x5a0a26){return db[_0x29c5('0x2f')]['create'](_0x2ec422[_0x29c5('0x4b')],{})[_0x29c5('0x13')](function(_0x35a61a){var _0x2dd2ba=_0x2ec422[_0x29c5('0x4c')][_0x29c5('0x28')]({'plain':!![]});if(!_0x2dd2ba)throw new Error(_0x29c5('0x4d'));if(_0x2dd2ba[_0x29c5('0x4e')]===_0x29c5('0x4c')){var _0x5a3799=_0x35a61a[_0x29c5('0x28')]({'plain':!![]});var _0x356820=_0x29c5('0x29');return db['UserProfileSection'][_0x29c5('0x48')]({'where':{'name':_0x356820,'userProfileId':_0x2dd2ba[_0x29c5('0x4f')]},'raw':!![]})['then'](function(_0x33b6d1){if(_0x33b6d1&&_0x33b6d1[_0x29c5('0x50')]===0x0){return db[_0x29c5('0x2a')][_0x29c5('0x4a')]({'name':_0x5a3799[_0x29c5('0x2b')],'resourceId':_0x5a3799['id'],'type':_0x33b6d1['name'],'sectionId':_0x33b6d1['id']},{})[_0x29c5('0x13')](function(){return _0x35a61a;});}else{return _0x35a61a;}})[_0x29c5('0x49')](function(_0x559a9d){logger[_0x29c5('0x1a')](_0x29c5('0x51'),_0x559a9d);throw _0x559a9d;});}return _0x35a61a;})[_0x29c5('0x13')](respondWithResult(_0x5a0a26,0xc9))[_0x29c5('0x49')](handleError(_0x5a0a26,null));};exports[_0x29c5('0x26')]=function(_0x5858b1,_0x126d82){if(_0x5858b1[_0x29c5('0x4b')]['id']){delete _0x5858b1[_0x29c5('0x4b')]['id'];}return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x5858b1[_0x29c5('0x44')]['id']},'include':[{'model':db[_0x29c5('0x2c')],'as':_0x29c5('0x2d')}]})[_0x29c5('0x13')](handleEntityNotFound(_0x126d82,null))[_0x29c5('0x13')](saveUpdates(_0x5858b1[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x126d82,null))[_0x29c5('0x49')](handleError(_0x126d82,null));};exports[_0x29c5('0x27')]=function(_0x2e7633,_0x1989c4){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x2e7633['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x1989c4,null))[_0x29c5('0x13')](removeEntity(_0x1989c4,null))[_0x29c5('0x49')](handleError(_0x1989c4,null));};exports[_0x29c5('0x52')]=function(_0x5c830e,_0x33d4cc){return db[_0x29c5('0x2f')][_0x29c5('0x52')]()['then'](respondWithResult(_0x33d4cc,null))[_0x29c5('0x49')](handleError(_0x33d4cc,null));};exports[_0x29c5('0x53')]=function(_0x25bd28,_0x206123){if(_0x25bd28['body']['id']){delete _0x25bd28[_0x29c5('0x4b')]['id'];}return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x25bd28[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x206123,null))[_0x29c5('0x13')](function(_0x433b59){if(_0x433b59){_0x25bd28[_0x29c5('0x4b')][_0x29c5('0x54')]=_0x433b59['id'];return db[_0x29c5('0x55')][_0x29c5('0x4a')](_0x25bd28[_0x29c5('0x4b')]);}})[_0x29c5('0x13')](respondWithResult(_0x206123,null))['catch'](handleError(_0x206123,null));};exports[_0x29c5('0x56')]=function(_0x5f35d0,_0x55a0b2){var _0x1b1d5b={'raw':![],'where':{}};var _0x32468d={};var _0x513f58={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')]['findOne']({'where':{'id':_0x5f35d0[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x55a0b2,null))[_0x29c5('0x13')](function(_0x4d7b94){if(_0x4d7b94){_0x32468d[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0x55')][_0x29c5('0x57')]);_0x32468d[_0x29c5('0x33')]=_['keys'](_0x5f35d0[_0x29c5('0x33')]);_0x32468d[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x32468d['model'],_0x32468d[_0x29c5('0x33')]);_0x1b1d5b['attributes']=_[_0x29c5('0x36')](_0x32468d[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x45')]));_0x1b1d5b[_0x29c5('0x37')]=_0x1b1d5b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x1b1d5b[_0x29c5('0x37')]:_0x32468d['model'];if(!_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x1b1d5b['limit']=qs[_0x29c5('0x22')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x22')]);_0x1b1d5b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x5f35d0[_0x29c5('0x33')]['offset']);}_0x1b1d5b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x1b1d5b[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x5f35d0[_0x29c5('0x33')],_0x32468d[_0x29c5('0x35')]));_0x1b1d5b[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x4d7b94['id'];if(_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x1b1d5b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x1b1d5b[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x1b1d5b['attributes'],function(_0x4265f3){var _0x1d5b4d={};_0x1d5b4d[_0x4265f3]={'$like':'%'+_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3f')]+'%'};return _0x1d5b4d;})});}_0x1b1d5b=_[_0x29c5('0x58')]({},_0x1b1d5b,_0x5f35d0[_0x29c5('0x47')]);return db[_0x29c5('0x55')]['count']({'where':_0x1b1d5b[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x1a1b55){_0x513f58[_0x29c5('0x23')]=_0x1a1b55;if(_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x46')]){_0x1b1d5b[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x55')][_0x29c5('0x42')](_0x1b1d5b);})[_0x29c5('0x13')](function(_0x1cf6d5){_0x513f58['rows']=_0x1cf6d5;return _0x513f58;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x55a0b2,_0x1b1d5b))[_0x29c5('0x49')](handleError(_0x55a0b2,null));};exports['removeDispositions']=function(_0x2a576f,_0x52dcd6){return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x2a576f[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x52dcd6,null))['then'](function(_0x1a1d4b){if(_0x1a1d4b){return _0x1a1d4b[_0x29c5('0x59')](_0x2a576f[_0x29c5('0x33')][_0x29c5('0x5a')]);}})[_0x29c5('0x13')](respondWithStatusCode(_0x52dcd6,null))[_0x29c5('0x49')](handleError(_0x52dcd6,null));};exports[_0x29c5('0x5b')]=function(_0x1d48b0,_0x20ea7b){if(_0x1d48b0[_0x29c5('0x4b')]['id']){delete _0x1d48b0[_0x29c5('0x4b')]['id'];}return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x1d48b0['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x20ea7b,null))[_0x29c5('0x13')](function(_0x22860c){if(_0x22860c){_0x1d48b0[_0x29c5('0x4b')]['ChatWebsiteId']=_0x22860c['id'];return db[_0x29c5('0x5c')][_0x29c5('0x4a')](_0x1d48b0[_0x29c5('0x4b')]);}})['then'](respondWithResult(_0x20ea7b,null))['catch'](handleError(_0x20ea7b,null));};exports['getAnswers']=function(_0x2c6a7b,_0x10c816){var _0x5c6a58={'raw':![],'where':{}};var _0xf87c9e={};var _0x4405d4={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')]['findOne']({'where':{'id':_0x2c6a7b[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x10c816,null))[_0x29c5('0x13')](function(_0x5aba45){if(_0x5aba45){_0xf87c9e[_0x29c5('0x32')]=_['keys'](db['CannedAnswer'][_0x29c5('0x57')]);_0xf87c9e['query']=_['keys'](_0x2c6a7b['query']);_0xf87c9e[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0xf87c9e[_0x29c5('0x32')],_0xf87c9e['query']);_0x5c6a58[_0x29c5('0x37')]=_['intersection'](_0xf87c9e['model'],qs['fields'](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x45')]));_0x5c6a58[_0x29c5('0x37')]=_0x5c6a58[_0x29c5('0x37')][_0x29c5('0x38')]?_0x5c6a58['attributes']:_0xf87c9e['model'];if(!_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x39')]('nolimit')){_0x5c6a58[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x22')]);_0x5c6a58[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x2c6a7b['query'][_0x29c5('0x24')]);}_0x5c6a58[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x5c6a58[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_['pick'](_0x2c6a7b[_0x29c5('0x33')],_0xf87c9e[_0x29c5('0x35')]));_0x5c6a58[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x5aba45['id'];if(_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x5c6a58[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x5c6a58[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x5c6a58[_0x29c5('0x37')],function(_0x1f37b0){var _0x31e01e={};_0x31e01e[_0x1f37b0]={'$like':'%'+_0x2c6a7b['query'][_0x29c5('0x3f')]+'%'};return _0x31e01e;})});}_0x5c6a58=_['merge']({},_0x5c6a58,_0x2c6a7b[_0x29c5('0x47')]);return db[_0x29c5('0x5c')][_0x29c5('0x23')]({'where':_0x5c6a58[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x351d5d){_0x4405d4['count']=_0x351d5d;if(_0x2c6a7b['query'][_0x29c5('0x46')]){_0x5c6a58[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x5c')][_0x29c5('0x42')](_0x5c6a58);})['then'](function(_0x1e2b11){_0x4405d4['rows']=_0x1e2b11;return _0x4405d4;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x10c816,_0x5c6a58))['catch'](handleError(_0x10c816,null));};exports[_0x29c5('0x5d')]=function(_0x525c27,_0xd657f2){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x525c27['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0xd657f2,null))[_0x29c5('0x13')](function(_0x4b94fd){if(_0x4b94fd){return _0x4b94fd[_0x29c5('0x5d')](_0x525c27[_0x29c5('0x33')]['ids']);}})[_0x29c5('0x13')](respondWithStatusCode(_0xd657f2,null))[_0x29c5('0x49')](handleError(_0xd657f2,null));};exports[_0x29c5('0x5e')]=function(_0x511e19,_0x219af5){_0x511e19[_0x29c5('0x4b')][_0x29c5('0x5f')]=_0x511e19['file']['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x511e19[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x219af5,null))[_0x29c5('0x13')](saveUpdates(_0x511e19[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x219af5,null))[_0x29c5('0x49')](handleError(_0x219af5,null));};exports[_0x29c5('0x60')]=function(_0x584a6d,_0x523480){_0x584a6d[_0x29c5('0x4b')][_0x29c5('0x61')]=_0x584a6d[_0x29c5('0x62')]['filename'];return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x584a6d[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x523480,null))[_0x29c5('0x13')](saveUpdates(_0x584a6d[_0x29c5('0x4b')],null))['then'](respondWithResult(_0x523480,null))['catch'](handleError(_0x523480,null));};exports[_0x29c5('0x63')]=function(_0x5e3db2,_0x37fae4){_0x5e3db2[_0x29c5('0x4b')][_0x29c5('0x64')]=_0x5e3db2[_0x29c5('0x62')][_0x29c5('0x65')];return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x5e3db2[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x37fae4,null))[_0x29c5('0x13')](saveUpdates(_0x5e3db2[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x37fae4,null))[_0x29c5('0x49')](handleError(_0x37fae4,null));};exports['addSystemAvatar']=function(_0xb108fe,_0x1a3cfb){_0xb108fe[_0x29c5('0x4b')][_0x29c5('0x66')]=_0xb108fe[_0x29c5('0x62')]['filename'];return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0xb108fe[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x1a3cfb,null))['then'](saveUpdates(_0xb108fe['body'],null))[_0x29c5('0x13')](respondWithResult(_0x1a3cfb,null))[_0x29c5('0x49')](handleError(_0x1a3cfb,null));};exports[_0x29c5('0x67')]=function(_0x2989b6,_0x252a09){var _0x38a380=path['join'](config[_0x29c5('0x68')],'server/files/images/logos/default_logo.svg');var _0x58d201={'where':{'id':_0x2989b6[_0x29c5('0x44')]['id']},'attributes':['id',_0x29c5('0x5f')],'raw':!![]};var _0x5b90d3=![];return require(_0x29c5('0x69'))[_0x29c5('0x6a')]()[_0x29c5('0x13')](function(_0x560626){if(_0x560626){_0x5b90d3=_0x560626[_0x29c5('0x6b')];}})[_0x29c5('0x13')](function(){return db['ChatWebsite']['find'](_0x58d201);})[_0x29c5('0x13')](handleEntityNotFound(_0x252a09,null))[_0x29c5('0x13')](function(_0x20955c){if(_0x20955c){if(!_[_0x29c5('0x6c')](_0x20955c[_0x29c5('0x5f')])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config['root'],_0x29c5('0x6f'),_0x20955c[_0x29c5('0x5f')]))&&_0x5b90d3){_0x38a380=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x6f'),_0x20955c[_0x29c5('0x5f')]);}}return _0x252a09[_0x29c5('0x70')](_0x38a380);}})[_0x29c5('0x49')](handleError(_0x252a09,null));};exports[_0x29c5('0x71')]=function(_0x40700a,_0x1d97e5){var _0x583223=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x72'));var _0x24e9cf={'where':{'id':_0x40700a[_0x29c5('0x44')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x29c5('0x2f')]['find'](_0x24e9cf)[_0x29c5('0x13')](handleEntityNotFound(_0x1d97e5,null))['then'](function(_0x5bc160){if(_0x5bc160){if(!_['isNil'](_0x5bc160[_0x29c5('0x61')])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x5bc160[_0x29c5('0x61')]))){_0x583223=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x73'),_0x5bc160[_0x29c5('0x61')]);}}return _0x1d97e5[_0x29c5('0x70')](_0x583223);}})['catch'](handleError(_0x1d97e5,null));};exports[_0x29c5('0x74')]=function(_0x1e919a,_0x3ff159){var _0x482b01=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x75'));var _0x2be66a={'where':{'id':_0x1e919a[_0x29c5('0x44')]['id']},'attributes':['id',_0x29c5('0x64'),_0x29c5('0x76')],'raw':!![]};return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x2be66a)[_0x29c5('0x13')](handleEntityNotFound(_0x3ff159,null))[_0x29c5('0x13')](function(_0x416f3a){if(_0x416f3a){if(!_['isNil'](_0x416f3a[_0x29c5('0x64')])){if(fs[_0x29c5('0x6d')](path['join'](config['root'],_0x29c5('0x73'),_0x416f3a[_0x29c5('0x64')]))&&_0x416f3a[_0x29c5('0x76')]){_0x482b01=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],'server/files/images/avatars/',_0x416f3a['customerAvatar']);}}return _0x3ff159[_0x29c5('0x70')](_0x482b01);}})[_0x29c5('0x49')](handleError(_0x3ff159,null));};exports[_0x29c5('0x77')]=function(_0xe0686e,_0x5c5f7a){var _0x45e6e0=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x78'));var _0x429693={'where':{'id':_0xe0686e['params']['id']},'attributes':['id',_0x29c5('0x66')],'raw':!![]};return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x429693)['then'](handleEntityNotFound(_0x5c5f7a,null))['then'](function(_0x41918c){if(_0x41918c){if(!_[_0x29c5('0x6c')](_0x41918c['systemAvatar'])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x41918c[_0x29c5('0x66')]))){_0x45e6e0=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x41918c['systemAvatar']);}}return _0x5c5f7a['download'](_0x45e6e0);}})['catch'](handleError(_0x5c5f7a,null));};exports[_0x29c5('0x79')]=function(_0x5f2ff2,_0x53a312){var _0x21b74f=require(_0x29c5('0x7a'));var _0x49dae7=new _0x21b74f();var _0x3f5dd5=_0x49dae7[_0x29c5('0x7b')](_0x5f2ff2['headers'][_0x29c5('0x7c')])[_0x29c5('0x7d')]();var _0x182569={'body':_0x5f2ff2[_0x29c5('0x4b')],'channel':_0x29c5('0x7e')};var _0x351051=[];var _0x29e5cd=[];var _0x14cd28={};var _0x3e1d73=![];return db[_0x29c5('0x7f')][_0x29c5('0x52')]()[_0x29c5('0x13')](function(_0x472d45){if(!_0x472d45){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x81'));}_0x351051=_[_0x29c5('0x82')](_['keys'](_0x472d45),[_0x29c5('0x83'),_0x29c5('0x84')]);_0x29e5cd=_['difference'](_['keys'](_0x472d45),[_0x29c5('0x83'),_0x29c5('0x84'),_0x29c5('0x85'),_0x29c5('0x86')]);if(_0x5f2ff2[_0x29c5('0x4b')]['id']){delete _0x5f2ff2[_0x29c5('0x4b')]['id'];}if(_['isNil'](_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x87')])){throw new db['Sequelize'][(_0x29c5('0x88'))](_0x29c5('0x89'));}if(_['isNil'](_0x5f2ff2[_0x29c5('0x4b')]['body'])||_0x5f2ff2['body'][_0x29c5('0x4b')]===''){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x8a'));}if(_[_0x29c5('0x6c')](_0x5f2ff2['body'][_0x29c5('0x8b')])){throw new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x8c')+_0x29e5cd);}if(!_['includes'](_0x29e5cd,_0x5f2ff2['body'][_0x29c5('0x8b')])){throw new db['Sequelize'][(_0x29c5('0x88'))](_0x29c5('0x8d')+_0x29e5cd);}_0x14cd28[_0x5f2ff2['body']['mapKey']]=_0x5f2ff2[_0x29c5('0x4b')]['from'];})[_0x29c5('0x13')](function(){return db[_0x29c5('0x2f')]['find']({'where':{'id':_0x5f2ff2['params']['id']},'include':[{'model':db[_0x29c5('0x8e')],'as':_0x29c5('0x8f'),'include':[{'model':db['CmContact'],'as':_0x29c5('0x90'),'where':_0x14cd28,'limit':0x1,'order':[[_0x29c5('0x84'),_0x29c5('0x91')]]}]},{'model':db[_0x29c5('0x92')],'as':'Applications'}]});})[_0x29c5('0x13')](handleEntityNotFound(_0x53a312,null))[_0x29c5('0x13')](function(_0x1794ba){if(_0x1794ba&&_0x1794ba[_0x29c5('0x8f')]){_0x182569[_0x29c5('0x93')]=_0x1794ba;_0x182569[_0x29c5('0x94')]=_0x1794ba[_0x29c5('0x95')];_0x182569[_0x29c5('0x96')]=_0x1794ba['List'];_0x182569[_0x29c5('0x94')]=_[_0x29c5('0x97')](_0x182569['applications'],[_0x29c5('0x98')],[_0x29c5('0x99')]);if(_0x182569[_0x29c5('0x93')][_0x29c5('0x95')]){delete _0x182569[_0x29c5('0x93')][_0x29c5('0x95')];}if(_0x182569[_0x29c5('0x93')][_0x29c5('0x8f')]&&_0x182569[_0x29c5('0x93')][_0x29c5('0x8f')][_0x29c5('0x90')][_0x29c5('0x38')]){return _0x182569['account']['List'][_0x29c5('0x90')][0x0];}var _0x2fbfc8=_[_0x29c5('0xa')](_0x5f2ff2[_0x29c5('0x4b')],{'firstName':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x87')],'ListId':_0x1794ba[_0x29c5('0x86')]});_0x2fbfc8[_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x8b')]]=_0x5f2ff2['body'][_0x29c5('0x87')];return db[_0x29c5('0x7f')][_0x29c5('0x4a')](_0x2fbfc8,{'fields':_0x351051,'raw':!![]});}})[_0x29c5('0x13')](handleEntityNotFound(_0x53a312,null))[_0x29c5('0x13')](function(_0x29c084){_0x182569[_0x29c5('0x9a')]=_0x29c084;var _0x16722e=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x9b')];if(_0x5f2ff2[_0x29c5('0x9c')]['cf-connecting-ip']){_0x16722e=_0x5f2ff2[_0x29c5('0x9c')]['cf-connecting-ip'];}else if(_0x5f2ff2[_0x29c5('0x9c')][_0x29c5('0x9d')]){_0x16722e=_[_0x29c5('0x9e')](_0x5f2ff2['headers'][_0x29c5('0x9d')][_0x29c5('0x9f')](','));}if(_0x29c084){var _0x1fbd00={'ContactId':_0x29c084['id'],'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'from':(_0x29c084[_0x29c5('0xa0')]||'')+'\x20'+(_0x29c084['lastName']||''),'customerIp':_0x16722e,'customerPort':_0x5f2ff2[_0x29c5('0x9c')][_0x29c5('0xa1')]?_0x5f2ff2['headers'][_0x29c5('0xa1')]:null,'referer':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xa2')],'browserName':_0x3f5dd5['browser'][_0x29c5('0x2b')]&&_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0xa4')]?util[_0x29c5('0xa5')](_0x29c5('0xa6'),_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0x2b')],_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0xa4')]):'unknown','browserVersion':_0x3f5dd5['browser'][_0x29c5('0xa4')]||'unknown','osName':util[_0x29c5('0xa5')](_0x29c5('0xa6'),_0x3f5dd5['os'][_0x29c5('0x2b')],_0x3f5dd5['os'][_0x29c5('0xa4')]),'osVersion':_0x3f5dd5['os'][_0x29c5('0xa4')],'deviceModel':_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x32')]&&_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0xa8')]?util[_0x29c5('0xa5')](_0x29c5('0xa9'),_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x32')],_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0xa8')],_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x30')]):null,'deviceVendor':_0x3f5dd5['device'][_0x29c5('0xa8')],'deviceType':_0x3f5dd5['device'][_0x29c5('0x30')],'formData':JSON[_0x29c5('0xaa')](_0x5f2ff2[_0x29c5('0x4b')])};var _0x726c20={'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'closed':![]};if(_0x5f2ff2['body'][_0x29c5('0xab')]){_0x726c20[_0x29c5('0xab')]=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')];return db[_0x29c5('0xac')]['find']({'where':_0x726c20})[_0x29c5('0x13')](function(_0x131a79){if(_0x131a79){return[_0x131a79,![]];}_0x1fbd00[_0x29c5('0xab')]=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')];_0x1fbd00[_0x29c5('0xad')]=_0x5f2ff2[_0x29c5('0x4b')]['externalUrl'];return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)[_0x29c5('0x13')](function(_0x5e98fe){return[_0x5e98fe,!![]];});});}_0x726c20['ContactId']=_0x29c084['id'];if(_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]['id']){_0x726c20['id']=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]['id'];return db[_0x29c5('0xac')]['find']({'where':_0x726c20})['then'](function(_0x11866f){if(_0x11866f){return[_0x11866f,![]];}return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)['then'](function(_0x1d0d7a){return[_0x1d0d7a,!![]];});});}return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)[_0x29c5('0x13')](function(_0x396e16){return[_0x396e16,!![]];});}})[_0x29c5('0xaf')](function(_0x38b9ef,_0x9243a5){if(_0x38b9ef){_0x3e1d73=_0x9243a5;if(!_0x9243a5){var _0x3c9a1c={'from':(_0x182569[_0x29c5('0x9a')][_0x29c5('0xa0')]||'')+'\x20'+(_0x182569[_0x29c5('0x9a')]['lastName']||'')};if(_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xb0')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')]!=_0x5f2ff2['body'][_0x29c5('0xb0')]){_0x3c9a1c[_0x29c5('0xab')]=_0x5f2ff2['body']['messageId'];}return _0x38b9ef[_0x29c5('0x26')](_0x3c9a1c);}else{return _0x38b9ef;}}})[_0x29c5('0x13')](function(_0x4b2154){_0x182569[_0x29c5('0xae')]=_0x4b2154[_0x29c5('0x28')]({'plain':!![]});_0x182569['interaction']['created']=_0x3e1d73;if(_0x182569[_0x29c5('0xae')][_0x29c5('0xb1')]){if(_0x182569[_0x29c5('0x93')][_0x29c5('0xb2')]){_0x182569[_0x29c5('0x94')]['push']({'id':0x0,'priority':_0x182569[_0x29c5('0x94')][_0x29c5('0x38')]+0x1,'app':_0x29c5('0xb3'),'appdata':_0x29c5('0xb4'),'interval':_0x29c5('0xb5')});}}return db[_0x29c5('0xb6')][_0x29c5('0x4a')]({'body':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x4b')],'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'ChatInteractionId':_0x4b2154['id'],'direction':'in','ContactId':_0x182569[_0x29c5('0x9a')]['id'],'AttachmentId':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xb7')]});})['then'](function(_0x5a79e8){_0x182569['message']=_0x5a79e8;if(_0x182569[_0x29c5('0xae')][_0x29c5('0xb8')]){return db[_0x29c5('0xb9')][_0x29c5('0x48')]({'attributes':['id',_0x29c5('0x2b')],'where':{'id':_0x182569[_0x29c5('0xae')]['UserId']}})[_0x29c5('0x13')](function(_0x1e9d4e){if(_0x1e9d4e){_0x182569[_0x29c5('0x94')][_0x29c5('0xba')]({'id':0x0,'priority':0x0,'app':_0x29c5('0xbb'),'appdata':_0x1e9d4e[_0x29c5('0x2b')]+','+(_0x182569[_0x29c5('0x93')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x182569[_0x29c5('0xbc')]=!![];}return respondWithRpcPromise(_0x29c5('0xbd'),_0x29c5('0xbe'),_0x182569);});}return respondWithRpcPromise('Start',_0x29c5('0xbe'),_0x182569);})[_0x29c5('0x13')](function(_0x3e7235){respondWithRpcPromise(_0x29c5('0xbf'),_0x29c5('0xbf'),{'event':_0x29c5('0x79'),'message':_0x3e7235},client9002);return _0x3e7235;})[_0x29c5('0x13')](respondWithResult(_0x53a312,null))[_0x29c5('0x49')](handleError(_0x53a312,null));};exports[_0x29c5('0xc0')]=function(_0x1967bb,_0x70c814){var _0x5ab5f3,_0x5a9218,_0x38d4a5;var _0x2091ea=[];var _0x205d2c={};var _0x5e3cde=_0x1967bb[_0x29c5('0xc1')]||[];var _0x55ae34=[];var _0x5144e3;return db['CmContact'][_0x29c5('0x52')]()[_0x29c5('0x13')](function(_0x39bd70){if(!_0x39bd70){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x81'));}_0x2091ea=_[_0x29c5('0x82')](_[_0x29c5('0x34')](_0x39bd70),[_0x29c5('0x83'),_0x29c5('0x84'),_0x29c5('0x85'),_0x29c5('0x86')]);if(_0x1967bb[_0x29c5('0x4b')]['id']){delete _0x1967bb[_0x29c5('0x4b')]['id'];}if(_['isNil'](_0x1967bb[_0x29c5('0x4b')]['from'])){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x89')));}if(_[_0x29c5('0x6c')](_0x1967bb[_0x29c5('0x4b')]['body'])||_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x4b')]===''){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x8a')));}if(_[_0x29c5('0x6c')](_0x1967bb[_0x29c5('0x4b')]['mapKeyOffline'])){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2091ea));}if(!_[_0x29c5('0xc3')](_0x2091ea,_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')])){throw _0x70c814['status'](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2091ea));}_0x205d2c[_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')]]=_0x1967bb['body'][_0x29c5('0x87')];})[_0x29c5('0x13')](function(){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x1967bb[_0x29c5('0x44')]['id']},'include':[{'model':db[_0x29c5('0x8e')],'as':_0x29c5('0x8f')},{'model':db[_0x29c5('0xc5')],'as':_0x29c5('0xc5')}]});})[_0x29c5('0x13')](handleEntityNotFound(_0x70c814,null))[_0x29c5('0x13')](function(_0x212473){if(_0x212473&&_0x212473[_0x29c5('0x8f')]){_0x5a9218=_0x212473;var _0x1bde6d=_[_0x29c5('0xa')](_0x1967bb[_0x29c5('0x4b')],{'firstName':_0x1967bb['body'][_0x29c5('0x87')],'phone':_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x87')],'ListId':_0x212473['ListId']});_0x1bde6d[_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')]]=_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x87')];return db['CmContact']['findOrCreate']({'where':_0x205d2c,'defaults':_0x1bde6d});}})[_0x29c5('0xaf')](function(_0x1d03b3){if(_0x1d03b3){_0x38d4a5=_0x1d03b3;var _0xc2b998=fs[_0x29c5('0xc6')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0xc7')),_0x29c5('0xc8'));var _0x29020e=ejs[_0x29c5('0xc9')](_0xc2b998,{'body':_['toPairs'](_0x1967bb[_0x29c5('0x4b')]['body']),'bodyTitle':_0x5a9218['offlineMessageBody']});return db[_0x29c5('0xca')]['create']({'body':_0x29020e,'plainBody':htmlToText[_0x29c5('0xcb')](_0x29020e),'ContactId':_0x1d03b3['id'],'ChatWebsiteId':_0x5a9218['id']});}})['then'](function(_0x2167e1){_0x5144e3=_0x2167e1;if(_0x5e3cde[_0x29c5('0x38')]){var _0x5b8e36=_0x5e3cde['map'](function(_0x4d40d1){return{'name':_0x4d40d1[_0x29c5('0xcc')],'basename':_0x4d40d1[_0x29c5('0x65')],'type':_0x4d40d1['mimetype'],'ChatOfflineMessageId':_0x2167e1['id']};});_0x55ae34=_0x5b8e36['map'](_0x3950ad=>{var _0x24248d={'filename':_0x3950ad[_0x29c5('0x2b')],'path':path['join'](config[_0x29c5('0x68')],_0x29c5('0xcd'),_0x29c5('0xc1'),_0x29c5('0xce'),_0x29c5('0xcf'),_0x3950ad[_0x29c5('0xd0')])};return _0x24248d;});if(!_0x5a9218['openNewInteraction']){return db[_0x29c5('0xd1')][_0x29c5('0xd2')](function(_0x2a1631){return db['Attachment'][_0x29c5('0xd3')](_0x5b8e36,{'transaction':_0x2a1631});});}}})['then'](function(){if(_0x5144e3){_0x5ab5f3=_0x5144e3;return db[_0x29c5('0xc5')][_0x29c5('0xd4')]({'where':{'service':!![]},'include':[{'model':db[_0x29c5('0xd5')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x29c5('0xd6')],'as':_0x29c5('0xd6'),'raw':!![]}]}]});}})[_0x29c5('0x13')](function(_0xd6189d){if(_0xd6189d&&_0xd6189d[_0x29c5('0xd7')]&&_0x5a9218[_0x29c5('0xd8')]&&_0x5a9218[_0x29c5('0xd9')]){var _0x3bdc20=_0xd6189d[_0x29c5('0xda')]();return respondWithRpcPromise(_0x29c5('0xdb'),_0x29c5('0xdc'),{'account':_0x3bdc20,'message':{'from':util['format'](_0x29c5('0xdd'),_0xd6189d['name'],_0xd6189d[_0x29c5('0xde')]||_0xd6189d[_0x29c5('0xd7')][_0x29c5('0x4c')]),'to':_0x5a9218['forwardOfflineAddress'],'subject':_0x5a9218[_0x29c5('0xdf')],'html':_0x5ab5f3[_0x29c5('0x4b')],'attachments':_0x55ae34}},client9003)[_0x29c5('0x13')](function(){return _0x5ab5f3;})[_0x29c5('0x49')](function(_0x28ec64){logger['error'](_0x28ec64);});}})[_0x29c5('0x13')](function(){if(_0x5a9218&&_0x5a9218[_0x29c5('0xe0')]&&_0x5a9218[_0x29c5('0xe1')]){var _0x17253f=[];if(_0x5e3cde[_0x29c5('0x38')]){_0x17253f=_0x5e3cde[_0x29c5('0x2e')](function(_0x250581){return{'name':_0x250581[_0x29c5('0xcc')],'basename':_0x250581['filename'],'type':_0x250581[_0x29c5('0xe2')],'ChatOfflineMessageId':_0x5144e3['id']};});}var _0xfb7b96;if(!_['isNil'](_0x5a9218[_0x29c5('0xe3')])){var _0x5e56d9=_[_0x29c5('0x2e')](_0x1967bb[_0x29c5('0x4b')],function(_0x4570cd){return _0x4570cd;});var _0x378cbe=_[_0x29c5('0xe4')](_0x5e56d9)[0x0];var _0x597fd8=_[_0x29c5('0xe5')](_0x378cbe,function(_0x9ca865){return _0x9ca865;});_0xfb7b96=_0x597fd8[0x1][_0x5a9218[_0x29c5('0xe3')]];}var _0x1d3db8={'from':_0x38d4a5['email'],'firstName':_0x38d4a5[_0x29c5('0xa0')],'lastName':_0x38d4a5[_0x29c5('0xe6')],'mapKey':_0x29c5('0xde'),'message':{'from':_0x38d4a5[_0x29c5('0xde')],'to':_0x5a9218['MailAccount'][_0x29c5('0xde')],'cc':'','subject':_[_0x29c5('0x6c')](_0xfb7b96)?_0x5a9218[_0x29c5('0xdf')]:_0xfb7b96,'messageId':'','sentAt':new Date(),'attach':_0x17253f['length'],'attachments':_0x17253f,'originChannel':_0x29c5('0xe7'),'ChatWebsiteId':_0x5a9218['id'],'ChatOfflineMessageId':_0x5ab5f3['id'],'originTo':_0x5a9218[_0x29c5('0xc5')]['email']},'body':_0x5ab5f3[_0x29c5('0x4b')]};var _0x87b45f={'account':{'id':_0x5a9218['MailAccountId']},'body':_0x1d3db8,'log':_0x29c5('0xe8')};return respondWithRpcPromise(_0x29c5('0xe8'),_0x29c5('0xe9'),_0x87b45f,client9001)[_0x29c5('0x13')](function(){return _0x5ab5f3;})[_0x29c5('0x49')](function(_0x343503){logger[_0x29c5('0x1a')](_0x343503);});}return;})['then'](function(){if(_0x5ab5f3){return _0x5ab5f3;}})[_0x29c5('0x13')](respondWithResult(_0x70c814,null))[_0x29c5('0x49')](function(_0x163978){logger[_0x29c5('0x1a')](_0x29c5('0x49'),_0x163978);for(var _0x207de6 of _0x5e3cde){var _0x53cc6=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0xcd'),_0x29c5('0xc1'),'attachments',_0x29c5('0xcf'),_0x207de6['filename']);fs_extra[_0x29c5('0xea')](_0x53cc6)[_0x29c5('0x49')](function(_0x4f5c5a){logger['error'](_0x29c5('0xeb'),_0x53cc6,_0x4f5c5a);});}});};exports[_0x29c5('0xec')]=function(_0x4a8274,_0xe88a13){return db[_0x29c5('0xac')][_0x29c5('0x48')]({'where':{'id':_0x4a8274[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0xe88a13,null))[_0x29c5('0x13')](function(_0x4368f1){if(_0x4368f1){return _0x4368f1[_0x29c5('0xec')](_0x4a8274[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x4a8274[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{});}})[_0x29c5('0x13')](respondWithResult(_0xe88a13,null))[_0x29c5('0x49')](handleError(_0xe88a13,null));};exports['getInteractions']=function(_0x217034,_0x463058){var _0x5e56f0={'raw':![],'where':{}};var _0x57af12={};var _0x2fb78a={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x217034['params']['id']}})['then'](handleEntityNotFound(_0x463058,null))[_0x29c5('0x13')](function(_0x53bef2){if(_0x53bef2){_0x57af12[_0x29c5('0x32')]=_['keys'](db[_0x29c5('0xac')][_0x29c5('0x57')]);_0x57af12[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x217034[_0x29c5('0x33')]);_0x57af12['filters']=_[_0x29c5('0x36')](_0x57af12[_0x29c5('0x32')],_0x57af12['query']);_0x5e56f0[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x57af12[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x217034[_0x29c5('0x33')][_0x29c5('0x45')]));_0x5e56f0[_0x29c5('0x37')]=_0x5e56f0[_0x29c5('0x37')][_0x29c5('0x38')]?_0x5e56f0[_0x29c5('0x37')]:_0x57af12[_0x29c5('0x32')];if(!_0x217034[_0x29c5('0x33')][_0x29c5('0x39')]('nolimit')){_0x5e56f0[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x217034[_0x29c5('0x33')][_0x29c5('0x22')]);_0x5e56f0[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x217034[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x5e56f0[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x217034[_0x29c5('0x33')]['sort']);_0x5e56f0['where']=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x217034[_0x29c5('0x33')],_0x57af12[_0x29c5('0x35')]));_0x5e56f0[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x53bef2['id'];if(_0x217034[_0x29c5('0x33')]['filter']){_0x5e56f0['where']=_[_0x29c5('0x58')](_0x5e56f0['where'],{'$or':_[_0x29c5('0x2e')](_0x5e56f0[_0x29c5('0x37')],function(_0x40c0c2){var _0x4e97bb={};_0x4e97bb[_0x40c0c2]={'$like':'%'+_0x217034['query']['filter']+'%'};return _0x4e97bb;})});}_0x5e56f0=_[_0x29c5('0x58')]({},_0x5e56f0,_0x217034[_0x29c5('0x47')]);return db[_0x29c5('0xac')][_0x29c5('0x23')]({'where':_0x5e56f0[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x4eaf4d){_0x2fb78a[_0x29c5('0x23')]=_0x4eaf4d;if(_0x217034[_0x29c5('0x33')][_0x29c5('0x46')]){_0x5e56f0['include']=[{'model':db[_0x29c5('0x7f')],'as':_0x29c5('0xee'),'required':![]},{'model':db[_0x29c5('0xb9')],'as':_0x29c5('0xef'),'attributes':[_0x29c5('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0x29c5('0xf0')],'as':_0x29c5('0xf1'),'attributes':['id','name',_0x29c5('0xf2')],'where':_0x217034[_0x29c5('0x33')][_0x29c5('0xf3')]?{'id':_0x217034[_0x29c5('0x33')][_0x29c5('0xf3')]}:undefined,'required':_0x217034[_0x29c5('0x33')]['tag']?!![]:![]}];}return db[_0x29c5('0xac')][_0x29c5('0x42')](_0x5e56f0);})[_0x29c5('0x13')](function(_0x187d3c){_0x2fb78a[_0x29c5('0xf4')]=_0x187d3c;return _0x2fb78a;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x463058,_0x5e56f0))['catch'](handleError(_0x463058,null));};function iftimePromise(_0x18eb85,_0x4c778f){return respondWithRpcPromise(_0x29c5('0xf5'),_0x29c5('0xf6'),{'command':_0x4c778f[_0x29c5('0xf7')]?util[_0x29c5('0xa5')](_0x29c5('0xf8'),_0x18eb85['interval'],_0x4c778f['timezone']):util[_0x29c5('0xa5')](_0x29c5('0xf9'),_0x18eb85['interval'])},client9002)[_0x29c5('0x13')](function(_0x439278){var _0x447be2=_0x439278&&_0x439278['indexOf'](_0x29c5('0xfa'))>=0x0?!![]:![];logger[_0x29c5('0x14')](_0x29c5('0xfb'),_0x4c778f['id'],_0x18eb85['id'],_0x18eb85[_0x29c5('0xfc')],_0x447be2?'ONLINE':_0x29c5('0xfd'),_0x4c778f[_0x29c5('0xf7')]?_0x4c778f['timezone']:_0x29c5('0xfe'));return _0x447be2;})[_0x29c5('0x49')](function(_0x35a081){logger['error'](_0x29c5('0xfb'),_0x4c778f['id'],_0x18eb85['id'],_0x18eb85['interval'],util[_0x29c5('0xff')](_0x35a081,{'showHidden':![],'depth':null}),_0x4c778f[_0x29c5('0xf7')]?_0x4c778f[_0x29c5('0xf7')]:_0x29c5('0xfe'));return![];});}exports[_0x29c5('0xf6')]=function(_0x149fbc,_0x383f7c){var _0x55d274=0x0;var _0xfe70d3=0x0;var _0x34b662=![];var _0x178209;var _0x4f67ed;return db[_0x29c5('0x2f')]['find']({'where':{'id':_0x149fbc[_0x29c5('0x44')]['id']},'include':[{'model':db['Interval'],'as':_0x29c5('0x100'),'include':[{'model':db[_0x29c5('0x100')],'as':_0x29c5('0x101'),'attributes':['id',_0x29c5('0xfc')],'raw':!![]}]}]})[_0x29c5('0x13')](handleEntityNotFound(_0x383f7c,null))['then'](function(_0x3ac6cd){if(_0x3ac6cd){_0x178209=_0x3ac6cd;return _0x3ac6cd[_0x29c5('0x102')]({'raw':!![]});}})['then'](function(_0xfa693e){if(_0x178209){if(_0xfa693e){_0x4f67ed=_0xfa693e;}}return require(_0x29c5('0x69'))[_0x29c5('0x6a')]();})[_0x29c5('0x13')](function(_0x51f4a6){if(_0x51f4a6){_0xfe70d3=_0x51f4a6[_0x29c5('0x103')];_0x34b662=_0x51f4a6[_0x29c5('0x6b')];}})[_0x29c5('0x13')](function(){return db[_0x29c5('0xac')]['count']({'where':{'closed':![]}});})[_0x29c5('0x13')](function(_0x135ce2){_0x55d274=_0x135ce2;if(_0xfe70d3&&_0x135ce2>_0xfe70d3){return db[_0x29c5('0x104')][_0x29c5('0xd4')]({'where':{'id':0x1}})[_0x29c5('0x13')](function(_0xd02839){if(_0xd02839){_0xd02839[_0x29c5('0x105')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x178209[_0x29c5('0x100')]&&_0x178209[_0x29c5('0x100')]['Intervals']){var _0x216cb1=[];for(var _0x6c5005=0x0;_0x6c5005<_0x178209[_0x29c5('0x100')][_0x29c5('0x101')][_0x29c5('0x38')];_0x6c5005++){var _0x4bc8e1=_0x178209['Interval']['Intervals'][_0x6c5005][_0x29c5('0x28')]({'plain':!![]});_0x216cb1[_0x29c5('0x106')](iftimePromise(_0x4bc8e1,_0x178209));}return BPromise[_0x29c5('0x107')](_0x216cb1)[_0x29c5('0x13')](function(_0x3d624e){return _['some'](_0x3d624e);});}else{return!![];}})[_0x29c5('0x13')](function(_0x80b541){var _0x3a761d=fs[_0x29c5('0xc6')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x108')),_0x29c5('0xc8'));var _0x193f51=new url['URL'](_0x178209['address'])['origin'];var _0x270441=_0x29c5('0x109');var _0x195484=![];var _0x387a43={'chatVersion':_0x270441,'chatWebsiteAddressOrigin':_0x193f51,'remote':_0x178209[_0x29c5('0x10a')],'query':querystring['stringify'](_[_0x29c5('0x58')](_0x178209[_0x29c5('0x28')]({'plain':!![]}),{'customerIp':_0x149fbc[_0x29c5('0x9c')][_0x29c5('0x9d')]||_0x149fbc[_0x29c5('0x9c')]['x-real-ip']||_0x149fbc[_0x29c5('0x10b')]['remoteAddress']||_0x149fbc['ip'],'referer':_0x149fbc[_0x29c5('0x9c')][_0x29c5('0xa2')],'openedInteractions':_0x55d274,'maxInteractions':_0xfe70d3,'virtual':_0x34b662[_0x29c5('0x103')],'online':_0x80b541,'custom':_0x34b662}))[_0x29c5('0x10c')](/'/g,'\x5c\x27')};_0x383f7c[_0x29c5('0xc2')](ejs['render'](Mustache[_0x29c5('0xc9')](_0x3a761d,_0x387a43),{'proactiveActions':_0x4f67ed,'alignment':_0x178209[_0x29c5('0x10d')],'verticalAlignment':_0x178209[_0x29c5('0x10e')],'div_color':_0x178209[_0x29c5('0xf2')],'labelText':_0x178209['labelText'],'text_color':_0x178209[_0x29c5('0x10f')],'text_button_color':_0x178209['textButtonColor'],'button_color':_0x178209[_0x29c5('0x110')],'background_color':_0x178209['backgroundColor'],'hideWhenOffline':_0x178209[_0x29c5('0x111')],'intervalId':_0x178209[_0x29c5('0x112')],'isDevelopment':_0x195484,'chatVersion':_0x270441}));})['catch'](handleError(_0x383f7c,null));};exports[_0x29c5('0x113')]=function(_0x5b123c,_0x4352d7){var _0x9e2e02=_0x5b123c['params']['id'];var _0x36d19b=_0x5b123c[_0x29c5('0x4b')];var _0x3b4b02=0xc8;var _0x58ec10=null;return db['sequelize'][_0x29c5('0xd2')]({'isolationLevel':db['sequelize'][_0x29c5('0x114')]['ISOLATION_LEVELS'][_0x29c5('0x115')]},function(_0x2ef734){return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x9e2e02},'transaction':_0x2ef734})[_0x29c5('0x13')](function(_0xf9cd4a){if(_0xf9cd4a){return db[_0x29c5('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x9e2e02},'transaction':_0x2ef734})[_0x29c5('0x13')](function(){var _0x36cc79=_[_0x29c5('0x2e')](_0x36d19b,function(_0x9b81eb){_0x9b81eb['ChatWebsiteId']=_0x9e2e02;return _0x9b81eb;});return db[_0x29c5('0x92')][_0x29c5('0xd3')](_0x36cc79,{'transaction':_0x2ef734});});}else{_0x3b4b02=0x194;_0x58ec10=[];}});})[_0x29c5('0x13')](function(){if(_0x3b4b02!==0x194){return db[_0x29c5('0x92')][_0x29c5('0x116')]({'where':{'ChatWebsiteId':_0x9e2e02},'order':_0x29c5('0x98')})['then'](function(_0x99c41a){_0x58ec10=_0x99c41a;});}})[_0x29c5('0x49')](function(_0x2247ff){_0x3b4b02=0x1f4;logger[_0x29c5('0x1a')](_0x2247ff[_0x29c5('0x117')]);if(_0x2247ff[_0x29c5('0x2b')]){delete _0x2247ff[_0x29c5('0x2b')];}_0x58ec10=_0x2247ff;})[_0x29c5('0x118')](function(){if(_0x58ec10===null){_0x4352d7[_0x29c5('0x1d')](_0x3b4b02);}else{if(_0x3b4b02===0x1f4){_0x4352d7['status'](_0x3b4b02)[_0x29c5('0xc2')](_0x58ec10);}else{_0x4352d7['status'](_0x3b4b02)[_0x29c5('0x20')](_0x58ec10);}}});};exports['getApplications']=function(_0x26913e,_0x5cdf81){var _0x38931b={};var _0x21ec3c={};var _0x54e820;var _0x49dddd;return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x26913e[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x5cdf81,null))[_0x29c5('0x13')](function(_0x3482a7){if(_0x3482a7){_0x54e820=_0x3482a7;_0x21ec3c[_0x29c5('0x32')]=_[_0x29c5('0x34')](db['ChatApplication'][_0x29c5('0x57')]);_0x21ec3c[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x26913e['query']);_0x21ec3c[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x21ec3c[_0x29c5('0x32')],_0x21ec3c[_0x29c5('0x33')]);_0x38931b[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x21ec3c[_0x29c5('0x32')],qs['fields'](_0x26913e[_0x29c5('0x33')][_0x29c5('0x45')]));_0x38931b[_0x29c5('0x37')]=_0x38931b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x38931b['attributes']:_0x21ec3c[_0x29c5('0x32')];_0x38931b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x26913e[_0x29c5('0x33')]['sort']);_0x38931b[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x26913e[_0x29c5('0x33')],_0x21ec3c[_0x29c5('0x35')]));if(_0x26913e[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x38931b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x38931b['where'],{'$or':_['map'](_0x38931b[_0x29c5('0x37')],function(_0x4c3d14){var _0x5ee6a4={};_0x5ee6a4[_0x4c3d14]={'$like':'%'+_0x26913e['query'][_0x29c5('0x3f')]+'%'};return _0x5ee6a4;})});}_0x38931b=_[_0x29c5('0x58')]({},_0x38931b,_0x26913e['options']);return _0x54e820[_0x29c5('0x119')](_0x38931b);}})[_0x29c5('0x13')](function(_0x313918){if(_0x313918){_0x49dddd=_0x313918['length'];if(!_0x26913e[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x38931b['limit']=qs[_0x29c5('0x22')](_0x26913e[_0x29c5('0x33')][_0x29c5('0x22')]);_0x38931b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x26913e[_0x29c5('0x33')][_0x29c5('0x24')]);}return _0x54e820[_0x29c5('0x119')](_0x38931b);}})[_0x29c5('0x13')](function(_0x38a480){if(_0x38a480){return _0x38a480?{'count':_0x49dddd,'rows':_0x38a480}:null;}})[_0x29c5('0x13')](respondWithResult(_0x5cdf81,null))[_0x29c5('0x49')](handleError(_0x5cdf81,null));};exports[_0x29c5('0x11a')]=function(_0x4d94b0,_0x1a3281){return db['chatProactiveAction']['find']({'where':{'id':_0x4d94b0[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a3281,null))[_0x29c5('0x13')](function(_0x5da452){if(_0x5da452){return _0x5da452[_0x29c5('0x11a')](_0x4d94b0[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x4d94b0[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{});}})[_0x29c5('0x13')](respondWithResult(_0x1a3281,null))['catch'](handleError(_0x1a3281,null));};exports['getProactiveActions']=function(_0xd82b90,_0x150dd2){var _0x43070c={};var _0x308f10={};var _0x2029b7;var _0x26997d;return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0xd82b90['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x150dd2,null))[_0x29c5('0x13')](function(_0x44cb19){if(_0x44cb19){_0x2029b7=_0x44cb19;_0x308f10[_0x29c5('0x32')]=_['keys'](db[_0x29c5('0x11b')][_0x29c5('0x57')]);_0x308f10[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0xd82b90[_0x29c5('0x33')]);_0x308f10[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x308f10[_0x29c5('0x32')],_0x308f10[_0x29c5('0x33')]);_0x43070c[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x308f10[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x45')]));_0x43070c[_0x29c5('0x37')]=_0x43070c[_0x29c5('0x37')][_0x29c5('0x38')]?_0x43070c[_0x29c5('0x37')]:_0x308f10[_0x29c5('0x32')];_0x43070c[_0x29c5('0x3b')]=qs['sort'](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x43070c[_0x29c5('0x3d')]=qs['filters'](_[_0x29c5('0x3e')](_0xd82b90[_0x29c5('0x33')],_0x308f10[_0x29c5('0x35')]));if(_0xd82b90[_0x29c5('0x33')]['filter']){_0x43070c[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x43070c[_0x29c5('0x3d')],{'$or':_['map'](_0x43070c[_0x29c5('0x37')],function(_0x555374){var _0xdd9a7b={};_0xdd9a7b[_0x555374]={'$like':'%'+_0xd82b90[_0x29c5('0x33')][_0x29c5('0x3f')]+'%'};return _0xdd9a7b;})});}_0x43070c=_[_0x29c5('0x58')]({},_0x43070c,_0xd82b90[_0x29c5('0x47')]);return _0x2029b7[_0x29c5('0x102')](_0x43070c);}})[_0x29c5('0x13')](function(_0x1d1842){if(_0x1d1842){_0x26997d=_0x1d1842[_0x29c5('0x38')];if(!_0xd82b90['query'][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x43070c['limit']=qs[_0x29c5('0x22')](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x22')]);_0x43070c[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0xd82b90['query'][_0x29c5('0x24')]);}return _0x2029b7[_0x29c5('0x102')](_0x43070c);}})[_0x29c5('0x13')](function(_0x4f0f82){if(_0x4f0f82){return _0x4f0f82?{'count':_0x26997d,'rows':_0x4f0f82}:null;}})[_0x29c5('0x13')](respondWithResult(_0x150dd2,null))['catch'](handleError(_0x150dd2,null));};exports[_0x29c5('0x11c')]=function(_0x4d9c87,_0x3f3686){var _0x58913a=_0x4d9c87[_0x29c5('0x33')][_0x29c5('0x11d')]===_0x29c5('0x11e')?_0x29c5('0x11f'):_0x29c5('0x120');return db['ChatWebsite']['find']({'attributes':['id',_0x58913a],'where':{'id':_0x4d9c87[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x3f3686,null))['then'](function(_0x37d4b9){if(_0x37d4b9){var _0x380833=_0x37d4b9[_0x58913a];var _0x3d439f=_0x380833&&_0x380833[_0x29c5('0x121')]?_0x380833[_0x29c5('0x121')]:[];_0x3f3686[_0x29c5('0xc2')]({'fromKey':_[_0x29c5('0x6c')](_0x380833[_0x29c5('0x122')])?undefined:_0x380833[_0x29c5('0x122')],'count':_0x3d439f[_0x29c5('0x38')],'rows':_0x3d439f});}})[_0x29c5('0x49')](handleError(_0x3f3686,null));};exports['getOfflineMessages']=function(_0x4c0564,_0x22877e){var _0x38f789={'raw':![],'where':{}};var _0x2c9c19={};var _0x2af551={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x4c0564[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x22877e,null))['then'](function(_0x3e863a){if(_0x3e863a){_0x2c9c19[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0xca')][_0x29c5('0x57')]);_0x2c9c19[_0x29c5('0x33')]=_['keys'](_0x4c0564[_0x29c5('0x33')]);_0x2c9c19[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x2c9c19[_0x29c5('0x32')],_0x2c9c19[_0x29c5('0x33')]);_0x38f789[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x2c9c19[_0x29c5('0x32')],qs['fields'](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x45')]));_0x38f789[_0x29c5('0x37')]=_0x38f789['attributes'][_0x29c5('0x38')]?_0x38f789[_0x29c5('0x37')]:_0x2c9c19[_0x29c5('0x32')];if(!_0x4c0564[_0x29c5('0x33')]['hasOwnProperty'](_0x29c5('0x3a'))){_0x38f789[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x22')]);_0x38f789[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x38f789['order']=qs['sort'](_0x4c0564['query'][_0x29c5('0x3c')]);_0x38f789[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x4c0564[_0x29c5('0x33')],_0x2c9c19[_0x29c5('0x35')]));_0x38f789[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x3e863a['id'];if(_0x4c0564[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x38f789[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x38f789[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x38f789[_0x29c5('0x37')],function(_0x1dbd59){var _0x13915c={};_0x13915c[_0x1dbd59]={'$like':'%'+_0x4c0564['query'][_0x29c5('0x3f')]+'%'};return _0x13915c;})});}_0x38f789=_[_0x29c5('0x58')]({},_0x38f789,_0x4c0564['options']);return db['ChatOfflineMessage'][_0x29c5('0x23')]({'where':_0x38f789[_0x29c5('0x3d')]})['then'](function(_0x19d57f){_0x2af551[_0x29c5('0x23')]=_0x19d57f;if(_0x4c0564['query'][_0x29c5('0x46')]){_0x38f789[_0x29c5('0x41')]=[{'all':!![]}];}else{_0x38f789[_0x29c5('0x41')]=[{'model':db[_0x29c5('0x7f')],'as':_0x29c5('0xee'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x29c5('0xca')][_0x29c5('0x42')](_0x38f789);})[_0x29c5('0x13')](function(_0x5cb948){_0x2af551['rows']=_0x5cb948;return _0x2af551;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x22877e,_0x38f789))[_0x29c5('0x49')](handleError(_0x22877e,null));};exports[_0x29c5('0x123')]=function(_0x5a73ea,_0x3eeba3){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x5a73ea[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x3eeba3,null))[_0x29c5('0x13')](function(_0x5dedb4){if(_0x5dedb4){return _0x5dedb4[_0x29c5('0x123')](_0x5a73ea[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x5a73ea[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{})[_0x29c5('0xaf')](function(_0x4609b4){for(var _0xb396d=0x0;_0xb396d<_0x5a73ea[_0x29c5('0x4b')]['ids']['length'];_0xb396d+=0x1){socket[_0x29c5('0x124')](_0x29c5('0x125'),{'UserId':Number(_0x5a73ea['body'][_0x29c5('0x5a')][_0xb396d]),'ChatWebsiteId':Number(_0x5a73ea[_0x29c5('0x44')]['id'])});}return _0x4609b4;});}})[_0x29c5('0x13')](respondWithResult(_0x3eeba3,null))[_0x29c5('0x49')](handleError(_0x3eeba3,null));};exports[_0x29c5('0x126')]=function(_0x1fc9fb,_0x2c6bd6){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x1fc9fb[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x2c6bd6,null))[_0x29c5('0x13')](function(_0x1a72fb){if(_0x1a72fb){return _0x1a72fb[_0x29c5('0x126')](_0x1fc9fb[_0x29c5('0x33')]['ids'])['then'](function(){if(_[_0x29c5('0x127')](_0x1fc9fb['query'][_0x29c5('0x5a')])){for(var _0x1bc7c3=0x0;_0x1bc7c3<_0x1fc9fb[_0x29c5('0x33')][_0x29c5('0x5a')][_0x29c5('0x38')];_0x1bc7c3+=0x1){socket[_0x29c5('0x124')](_0x29c5('0x128'),{'UserId':Number(_0x1fc9fb[_0x29c5('0x33')][_0x29c5('0x5a')][_0x1bc7c3]),'ChatWebsiteId':Number(_0x1fc9fb[_0x29c5('0x44')]['id'])});}}else{socket[_0x29c5('0x124')](_0x29c5('0x128'),{'UserId':Number(_0x1fc9fb['query'][_0x29c5('0x5a')]),'ChatWebsiteId':Number(_0x1fc9fb[_0x29c5('0x44')]['id'])});}});}})[_0x29c5('0x13')](respondWithStatusCode(_0x2c6bd6,null))[_0x29c5('0x49')](handleError(_0x2c6bd6,null));};exports['getAgents']=function(_0xbeb7f9,_0x3a3f65){var _0x47801b={};var _0x3228ff={};var _0x107054;var _0x44fc78;return db['ChatWebsite']['findOne']({'where':{'id':_0xbeb7f9[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a3f65,null))[_0x29c5('0x13')](function(_0x232569){if(_0x232569){_0x107054=_0x232569;_0x3228ff[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0xb9')]['rawAttributes']);_0x3228ff[_0x29c5('0x33')]=_['keys'](_0xbeb7f9['query']);_0x3228ff[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x3228ff[_0x29c5('0x32')],_0x3228ff[_0x29c5('0x33')]);_0x47801b[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x3228ff['model'],qs['fields'](_0xbeb7f9[_0x29c5('0x33')]['fields']));_0x47801b[_0x29c5('0x37')]=_0x47801b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x47801b[_0x29c5('0x37')]:_0x3228ff[_0x29c5('0x32')];_0x47801b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0xbeb7f9['query']['sort']);_0x47801b['where']=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0xbeb7f9[_0x29c5('0x33')],_0x3228ff[_0x29c5('0x35')]));if(_0xbeb7f9[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x47801b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x47801b[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x47801b['attributes'],function(_0x50803c){var _0x4b0bb1={};_0x4b0bb1[_0x50803c]={'$like':'%'+_0xbeb7f9['query']['filter']+'%'};return _0x4b0bb1;})});}_0x47801b=_[_0x29c5('0x58')]({},_0x47801b,_0xbeb7f9[_0x29c5('0x47')]);return _0x107054['getAgents'](_0x47801b);}})[_0x29c5('0x13')](function(_0x116b0c){if(_0x116b0c){_0x44fc78=_0x116b0c[_0x29c5('0x38')];if(!_0xbeb7f9[_0x29c5('0x33')]['hasOwnProperty'](_0x29c5('0x3a'))){_0x47801b['limit']=qs[_0x29c5('0x22')](_0xbeb7f9[_0x29c5('0x33')]['limit']);_0x47801b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0xbeb7f9[_0x29c5('0x33')][_0x29c5('0x24')]);}return _0x107054[_0x29c5('0x129')](_0x47801b);}})[_0x29c5('0x13')](function(_0x3745cf){if(_0x3745cf){return _0x3745cf?{'count':_0x44fc78,'rows':_0x3745cf}:null;}})[_0x29c5('0x13')](respondWithResult(_0x3a3f65,null))['catch'](handleError(_0x3a3f65,null));};
\ No newline at end of file
+var _0x9baf=['Applications','account','applications','priority','contact','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','remoteAddress','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','stack','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','querystring','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','UserProfileResource','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','CmContact','Contacts'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9baf,0x9d));var _0xf9ba=function(_0x4979f7,_0x334536){_0x4979f7=_0x4979f7-0x0;var _0x219cff=_0x9baf[_0x4979f7];return _0x219cff;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xf9ba('0x0'));var util=require(_0xf9ba('0x1'));var path=require('path');var ejs=require(_0xf9ba('0x2'));var fs=require('fs');var fs_extra=require(_0xf9ba('0x3'));var _=require(_0xf9ba('0x4'));var querystring=require(_0xf9ba('0x5'));var Redis=require(_0xf9ba('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf9ba('0x7'));var config=require(_0xf9ba('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config[_0xf9ba('0x9')]=_[_0xf9ba('0xa')](config[_0xf9ba('0x9')],{'host':_0xf9ba('0xb'),'port':0x18eb});var socket=require(_0xf9ba('0xc'))(new Redis(config[_0xf9ba('0x9')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0xf9ba('0xd'));var jayson=require(_0xf9ba('0xe'));var client=jayson[_0xf9ba('0xf')][_0xf9ba('0x10')]({'port':0x232c});var client9002=jayson['client'][_0xf9ba('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xf9ba('0x10')]({'port':0x232b});var client9001=jayson[_0xf9ba('0xf')][_0xf9ba('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x231b5d,_0x49d1e7,_0x75e3cd,_0x5b4b3d){return new BPromise(function(_0xceade5,_0x3453cb){var _0x186d26=_0x5b4b3d||client;return _0x186d26[_0xf9ba('0x11')](_0x231b5d,_0x75e3cd)[_0xf9ba('0x12')](function(_0x5a61c4){logger[_0xf9ba('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x49d1e7,_0xf9ba('0x14'));logger[_0xf9ba('0x15')](_0xf9ba('0x16'),_0x49d1e7,_0xf9ba('0x14'),JSON['stringify'](_0x5a61c4));if(_0x5a61c4['error']){if(_0x5a61c4[_0xf9ba('0x17')][_0xf9ba('0x18')]===0x1f4){logger['error'](_0xf9ba('0x19'),_0x49d1e7,_0x5a61c4[_0xf9ba('0x17')]['message']);return _0x3453cb(_0x5a61c4[_0xf9ba('0x17')]['message']);}logger[_0xf9ba('0x17')](_0xf9ba('0x19'),_0x49d1e7,_0x5a61c4[_0xf9ba('0x17')][_0xf9ba('0x1a')]);return _0xceade5(_0x5a61c4['error'][_0xf9ba('0x1a')]);}else{logger['info'](_0xf9ba('0x19'),_0x49d1e7,_0xf9ba('0x14'));_0xceade5(_0x5a61c4[_0xf9ba('0x1b')][_0xf9ba('0x1a')]);}})[_0xf9ba('0x1c')](function(_0x563eac){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x49d1e7,_0x563eac);_0x3453cb(_0x563eac);});});}function respondWithStatusCode(_0x17e6b4,_0x21df90){_0x21df90=_0x21df90||0xcc;return function(_0x112f10){if(_0x112f10){return _0x17e6b4[_0xf9ba('0x1d')](_0x21df90);}return _0x17e6b4[_0xf9ba('0x1e')](_0x21df90)[_0xf9ba('0x1f')]();};}function respondWithResult(_0x3be76f,_0x536d36){_0x536d36=_0x536d36||0xc8;return function(_0xbc737d){if(_0xbc737d){return _0x3be76f[_0xf9ba('0x1e')](_0x536d36)['json'](_0xbc737d);}};}function respondWithFilteredResult(_0x106429,_0x2cf78e){return function(_0x45f99a){if(_0x45f99a){var _0x39cae0=typeof _0x2cf78e[_0xf9ba('0x20')]===_0xf9ba('0x21')&&typeof _0x2cf78e[_0xf9ba('0x22')]==='undefined';var _0x1c032a=_0x45f99a[_0xf9ba('0x23')];var _0x234f7a=_0x39cae0?0x0:_0x2cf78e['offset'];var _0x437b30=_0x39cae0?_0x45f99a['count']:_0x2cf78e['offset']+_0x2cf78e[_0xf9ba('0x22')];var _0x2636f6;if(_0x437b30>=_0x1c032a){_0x437b30=_0x1c032a;_0x2636f6=0xc8;}else{_0x2636f6=0xce;}_0x106429['status'](_0x2636f6);return _0x106429[_0xf9ba('0x24')](_0xf9ba('0x25'),_0x234f7a+'-'+_0x437b30+'/'+_0x1c032a)['json'](_0x45f99a);}return null;};}function saveUpdates(_0x21362d){return function(_0x419ec8){if(_0x419ec8){return _0x419ec8[_0xf9ba('0x26')](_0x21362d)[_0xf9ba('0x12')](function(_0x55b2e2){return _0x55b2e2;});}return null;};}function removeEntity(_0x37fb50){return function(_0x4576ec){if(_0x4576ec){return _0x4576ec['destroy']()[_0xf9ba('0x12')](function(){var _0x5f9cf2=_0x4576ec['get']({'plain':!![]});var _0x14e18a='ChatWebsites';return db[_0xf9ba('0x27')]['destroy']({'where':{'type':_0x14e18a,'resourceId':_0x5f9cf2['id']}})[_0xf9ba('0x12')](function(){return _0x4576ec;});})[_0xf9ba('0x12')](function(){_0x37fb50['status'](0xcc)[_0xf9ba('0x1f')]();});}};}function handleEntityNotFound(_0x1800f2){return function(_0x4a6e20){if(!_0x4a6e20){_0x1800f2[_0xf9ba('0x1d')](0x194);}return _0x4a6e20;};}function handleError(_0x8c3eb2,_0x56d7ea){_0x56d7ea=_0x56d7ea||0x1f4;return function(_0x5748f3){logger[_0xf9ba('0x17')](_0x5748f3['stack']);if(_0x5748f3[_0xf9ba('0x28')]){delete _0x5748f3[_0xf9ba('0x28')];}_0x8c3eb2[_0xf9ba('0x1e')](_0x56d7ea)['send'](_0x5748f3);};}exports[_0xf9ba('0x29')]=function(_0xd3b95,_0x3c602d){var _0x107b97={'include':[{'model':db[_0xf9ba('0x2a')],'as':_0xf9ba('0x2b')}]},_0x10aa01={},_0x3337f2={'count':0x0,'rows':[]};var _0x5c0307=_['map'](db[_0xf9ba('0x2c')][_0xf9ba('0x2d')],function(_0x4eff39){return{'name':_0x4eff39['fieldName'],'type':_0x4eff39[_0xf9ba('0x2e')]['key']};});_0x10aa01[_0xf9ba('0x2f')]=_[_0xf9ba('0x30')](_0x5c0307,'name');_0x10aa01[_0xf9ba('0x31')]=_['keys'](_0xd3b95['query']);_0x10aa01[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x10aa01[_0xf9ba('0x2f')],_0x10aa01[_0xf9ba('0x31')]);_0x107b97[_0xf9ba('0x34')]=_['intersection'](_0x10aa01[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x107b97[_0xf9ba('0x34')]=_0x107b97[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x107b97[_0xf9ba('0x34')]:_0x10aa01[_0xf9ba('0x2f')];if(!_0xd3b95[_0xf9ba('0x31')]['hasOwnProperty'](_0xf9ba('0x37'))){_0x107b97['limit']=qs[_0xf9ba('0x22')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x107b97[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0xd3b95['query']['offset']);}_0x107b97[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x107b97['where']=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0xd3b95[_0xf9ba('0x31')],_0x10aa01[_0xf9ba('0x32')]),_0x5c0307);if(_0xd3b95[_0xf9ba('0x31')]['filter']){_0x107b97['where']=_['merge'](_0x107b97[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x5c0307,function(_0x5bd6d2){if(_0x5bd6d2[_0xf9ba('0x2e')]!==_0xf9ba('0x3c')){var _0x13d45a={};_0x13d45a[_0x5bd6d2['name']]={'$like':'%'+_0xd3b95['query'][_0xf9ba('0x3d')]+'%'};return _0x13d45a;}})});}_0x107b97=_[_0xf9ba('0x3e')]({},_0x107b97,_0xd3b95['options']);var _0x412a37={'where':_0x107b97[_0xf9ba('0x3b')]};return db[_0xf9ba('0x2c')][_0xf9ba('0x23')](_0x412a37)['then'](function(_0x377b0f){_0x3337f2[_0xf9ba('0x23')]=_0x377b0f;if(_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x107b97[_0xf9ba('0x40')]=[{'all':!![]}];}return db[_0xf9ba('0x2c')][_0xf9ba('0x41')](_0x107b97);})[_0xf9ba('0x12')](function(_0x14c45d){_0x3337f2[_0xf9ba('0x42')]=_0x14c45d;return _0x3337f2;})['then'](respondWithFilteredResult(_0x3c602d,_0x107b97))[_0xf9ba('0x1c')](handleError(_0x3c602d,null));};exports[_0xf9ba('0x43')]=function(_0x3b78e3,_0x11e06b){var _0xbe6d0c={'raw':![],'where':{'id':_0x3b78e3[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x2a')],'as':_0xf9ba('0x2b')}]},_0x3bcf2d={};_0x3bcf2d['model']=_[_0xf9ba('0x45')](db['ChatWebsite']['rawAttributes']);_0x3bcf2d['query']=_['keys'](_0x3b78e3[_0xf9ba('0x31')]);_0x3bcf2d[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x3bcf2d[_0xf9ba('0x2f')],_0x3bcf2d[_0xf9ba('0x31')]);_0xbe6d0c[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3bcf2d[_0xf9ba('0x2f')],qs['fields'](_0x3b78e3['query']['fields']));_0xbe6d0c[_0xf9ba('0x34')]=_0xbe6d0c[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0xbe6d0c['attributes']:_0x3bcf2d[_0xf9ba('0x2f')];if(_0x3b78e3[_0xf9ba('0x31')]['includeAll']){_0xbe6d0c[_0xf9ba('0x40')]=[{'all':!![]}];}_0xbe6d0c=_[_0xf9ba('0x3e')]({},_0xbe6d0c,_0x3b78e3[_0xf9ba('0x46')]);return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0xbe6d0c)[_0xf9ba('0x12')](handleEntityNotFound(_0x11e06b,null))['then'](respondWithResult(_0x11e06b,null))['catch'](handleError(_0x11e06b,null));};exports['create']=function(_0x5de5c4,_0x3ae30e){return db[_0xf9ba('0x2c')][_0xf9ba('0x48')](_0x5de5c4[_0xf9ba('0x49')],{})['then'](function(_0x3fe343){var _0x1f0bf6=_0x5de5c4[_0xf9ba('0x4a')]['get']({'plain':!![]});if(!_0x1f0bf6)throw new Error(_0xf9ba('0x4b'));if(_0x1f0bf6[_0xf9ba('0x4c')]===_0xf9ba('0x4a')){var _0x48e2ca=_0x3fe343[_0xf9ba('0x4d')]({'plain':!![]});var _0x3eff77=_0xf9ba('0x4e');return db[_0xf9ba('0x4f')][_0xf9ba('0x47')]({'where':{'name':_0x3eff77,'userProfileId':_0x1f0bf6['userProfileId']},'raw':!![]})[_0xf9ba('0x12')](function(_0x325b94){if(_0x325b94&&_0x325b94[_0xf9ba('0x50')]===0x0){return db[_0xf9ba('0x27')][_0xf9ba('0x48')]({'name':_0x48e2ca[_0xf9ba('0x28')],'resourceId':_0x48e2ca['id'],'type':_0x325b94['name'],'sectionId':_0x325b94['id']},{})[_0xf9ba('0x12')](function(){return _0x3fe343;});}else{return _0x3fe343;}})[_0xf9ba('0x1c')](function(_0x21cdac){logger['error'](_0xf9ba('0x51'),_0x21cdac);throw _0x21cdac;});}return _0x3fe343;})[_0xf9ba('0x12')](respondWithResult(_0x3ae30e,0xc9))[_0xf9ba('0x1c')](handleError(_0x3ae30e,null));};exports[_0xf9ba('0x26')]=function(_0x6a7a7c,_0x498c3b){if(_0x6a7a7c[_0xf9ba('0x49')]['id']){delete _0x6a7a7c[_0xf9ba('0x49')]['id'];}return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x6a7a7c['params']['id']},'include':[{'model':db[_0xf9ba('0x2a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x498c3b,null))[_0xf9ba('0x12')](saveUpdates(_0x6a7a7c[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x498c3b,null))['catch'](handleError(_0x498c3b,null));};exports[_0xf9ba('0x52')]=function(_0x6df306,_0x12482f){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x6df306[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x12482f,null))[_0xf9ba('0x12')](removeEntity(_0x12482f,null))[_0xf9ba('0x1c')](handleError(_0x12482f,null));};exports[_0xf9ba('0x53')]=function(_0x2ab4cb,_0x2e8f9f){return db[_0xf9ba('0x2c')]['describe']()[_0xf9ba('0x12')](respondWithResult(_0x2e8f9f,null))[_0xf9ba('0x1c')](handleError(_0x2e8f9f,null));};exports[_0xf9ba('0x54')]=function(_0x4b8525,_0x25af88){if(_0x4b8525[_0xf9ba('0x49')]['id']){delete _0x4b8525['body']['id'];}return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x4b8525[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x25af88,null))[_0xf9ba('0x12')](function(_0x161267){if(_0x161267){_0x4b8525[_0xf9ba('0x49')][_0xf9ba('0x55')]=_0x161267['id'];return db[_0xf9ba('0x56')][_0xf9ba('0x48')](_0x4b8525[_0xf9ba('0x49')]);}})[_0xf9ba('0x12')](respondWithResult(_0x25af88,null))[_0xf9ba('0x1c')](handleError(_0x25af88,null));};exports[_0xf9ba('0x57')]=function(_0x1de30d,_0x3c1015){var _0x3ea210={'raw':![],'where':{}};var _0x322ae1={};var _0xe52863={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x1de30d[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x3c1015,null))[_0xf9ba('0x12')](function(_0x1a23ca){if(_0x1a23ca){_0x322ae1[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x56')][_0xf9ba('0x2d')]);_0x322ae1[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x1de30d[_0xf9ba('0x31')]);_0x322ae1['filters']=_[_0xf9ba('0x33')](_0x322ae1['model'],_0x322ae1[_0xf9ba('0x31')]);_0x3ea210[_0xf9ba('0x34')]=_['intersection'](_0x322ae1['model'],qs[_0xf9ba('0x35')](_0x1de30d[_0xf9ba('0x31')]['fields']));_0x3ea210[_0xf9ba('0x34')]=_0x3ea210[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x3ea210[_0xf9ba('0x34')]:_0x322ae1[_0xf9ba('0x2f')];if(!_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x3ea210[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x3ea210['offset']=qs[_0xf9ba('0x20')](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x3ea210[_0xf9ba('0x38')]=qs['sort'](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x3ea210[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_['pick'](_0x1de30d[_0xf9ba('0x31')],_0x322ae1[_0xf9ba('0x32')]));_0x3ea210['where'][_0xf9ba('0x55')]=_0x1a23ca['id'];if(_0x1de30d['query']['filter']){_0x3ea210['where']=_['merge'](_0x3ea210[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x3ea210['attributes'],function(_0x4d2272){var _0x589cae={};_0x589cae[_0x4d2272]={'$like':'%'+_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x589cae;})});}_0x3ea210=_[_0xf9ba('0x3e')]({},_0x3ea210,_0x1de30d['options']);return db['Disposition'][_0xf9ba('0x23')]({'where':_0x3ea210['where']})[_0xf9ba('0x12')](function(_0xc44237){_0xe52863[_0xf9ba('0x23')]=_0xc44237;if(_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x3ea210[_0xf9ba('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xf9ba('0x41')](_0x3ea210);})[_0xf9ba('0x12')](function(_0x364312){_0xe52863[_0xf9ba('0x42')]=_0x364312;return _0xe52863;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3c1015,_0x3ea210))[_0xf9ba('0x1c')](handleError(_0x3c1015,null));};exports[_0xf9ba('0x5a')]=function(_0x311e5d,_0x546935){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x311e5d['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x546935,null))['then'](function(_0x10b705){if(_0x10b705){return _0x10b705['removeDispositions'](_0x311e5d[_0xf9ba('0x31')]['ids']);}})[_0xf9ba('0x12')](respondWithStatusCode(_0x546935,null))[_0xf9ba('0x1c')](handleError(_0x546935,null));};exports[_0xf9ba('0x5b')]=function(_0x738efb,_0x5d2588){if(_0x738efb[_0xf9ba('0x49')]['id']){delete _0x738efb[_0xf9ba('0x49')]['id'];}return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x738efb[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x5d2588,null))['then'](function(_0x14ea94){if(_0x14ea94){_0x738efb['body'][_0xf9ba('0x55')]=_0x14ea94['id'];return db['CannedAnswer']['create'](_0x738efb['body']);}})[_0xf9ba('0x12')](respondWithResult(_0x5d2588,null))[_0xf9ba('0x1c')](handleError(_0x5d2588,null));};exports[_0xf9ba('0x5c')]=function(_0x33d7c3,_0x3c7b61){var _0x3219a6={'raw':![],'where':{}};var _0xbae3df={};var _0x1cdd92={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')]['findOne']({'where':{'id':_0x33d7c3['params']['id']}})['then'](handleEntityNotFound(_0x3c7b61,null))[_0xf9ba('0x12')](function(_0x326e4f){if(_0x326e4f){_0xbae3df[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x5d')][_0xf9ba('0x2d')]);_0xbae3df[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x33d7c3[_0xf9ba('0x31')]);_0xbae3df[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0xbae3df[_0xf9ba('0x2f')],_0xbae3df[_0xf9ba('0x31')]);_0x3219a6['attributes']=_['intersection'](_0xbae3df['model'],qs[_0xf9ba('0x35')](_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x3219a6[_0xf9ba('0x34')]=_0x3219a6[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x3219a6[_0xf9ba('0x34')]:_0xbae3df[_0xf9ba('0x2f')];if(!_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x3219a6[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x33d7c3['query']['limit']);_0x3219a6[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x3219a6['order']=qs['sort'](_0x33d7c3[_0xf9ba('0x31')]['sort']);_0x3219a6[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x33d7c3['query'],_0xbae3df[_0xf9ba('0x32')]));_0x3219a6[_0xf9ba('0x3b')][_0xf9ba('0x55')]=_0x326e4f['id'];if(_0x33d7c3[_0xf9ba('0x31')]['filter']){_0x3219a6[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x3219a6[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x3219a6[_0xf9ba('0x34')],function(_0x1fe93a){var _0x7c2f66={};_0x7c2f66[_0x1fe93a]={'$like':'%'+_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x7c2f66;})});}_0x3219a6=_[_0xf9ba('0x3e')]({},_0x3219a6,_0x33d7c3[_0xf9ba('0x46')]);return db[_0xf9ba('0x5d')][_0xf9ba('0x23')]({'where':_0x3219a6[_0xf9ba('0x3b')]})[_0xf9ba('0x12')](function(_0x2f7be9){_0x1cdd92['count']=_0x2f7be9;if(_0x33d7c3['query']['includeAll']){_0x3219a6[_0xf9ba('0x40')]=[{'all':!![]}];}return db[_0xf9ba('0x5d')][_0xf9ba('0x41')](_0x3219a6);})['then'](function(_0x10fa81){_0x1cdd92[_0xf9ba('0x42')]=_0x10fa81;return _0x1cdd92;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3c7b61,_0x3219a6))[_0xf9ba('0x1c')](handleError(_0x3c7b61,null));};exports['removeAnswers']=function(_0x3107c1,_0x2202f0){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x3107c1[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x2202f0,null))['then'](function(_0x168987){if(_0x168987){return _0x168987[_0xf9ba('0x5e')](_0x3107c1[_0xf9ba('0x31')][_0xf9ba('0x5f')]);}})[_0xf9ba('0x12')](respondWithStatusCode(_0x2202f0,null))[_0xf9ba('0x1c')](handleError(_0x2202f0,null));};exports['addLogo']=function(_0x39c630,_0xe231ae){_0x39c630['body'][_0xf9ba('0x60')]=_0x39c630[_0xf9ba('0x61')]['filename'];return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x39c630[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0xe231ae,null))[_0xf9ba('0x12')](saveUpdates(_0x39c630[_0xf9ba('0x49')],null))['then'](respondWithResult(_0xe231ae,null))['catch'](handleError(_0xe231ae,null));};exports[_0xf9ba('0x62')]=function(_0xefa5cf,_0x221a90){_0xefa5cf['body'][_0xf9ba('0x63')]=_0xefa5cf[_0xf9ba('0x61')][_0xf9ba('0x64')];return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0xefa5cf[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x221a90,null))['then'](saveUpdates(_0xefa5cf[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x221a90,null))[_0xf9ba('0x1c')](handleError(_0x221a90,null));};exports[_0xf9ba('0x65')]=function(_0x41036a,_0x848339){_0x41036a[_0xf9ba('0x49')][_0xf9ba('0x66')]=_0x41036a[_0xf9ba('0x61')][_0xf9ba('0x64')];return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x41036a[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x848339,null))[_0xf9ba('0x12')](saveUpdates(_0x41036a[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x848339,null))[_0xf9ba('0x1c')](handleError(_0x848339,null));};exports[_0xf9ba('0x67')]=function(_0x23091f,_0x36b0f8){_0x23091f['body']['systemAvatar']=_0x23091f[_0xf9ba('0x61')][_0xf9ba('0x64')];return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x23091f[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x36b0f8,null))[_0xf9ba('0x12')](saveUpdates(_0x23091f[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x36b0f8,null))[_0xf9ba('0x1c')](handleError(_0x36b0f8,null));};exports['getLogo']=function(_0x1da392,_0x27fbc3){var _0x47c4cf=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x6a'));var _0x8f4a13={'where':{'id':_0x1da392[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x60')],'raw':!![]};var _0x229aa1=![];return require(_0xf9ba('0x6b'))[_0xf9ba('0x6c')]()[_0xf9ba('0x12')](function(_0x338c89){if(_0x338c89){_0x229aa1=_0x338c89[_0xf9ba('0x6d')];}})[_0xf9ba('0x12')](function(){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x8f4a13);})[_0xf9ba('0x12')](handleEntityNotFound(_0x27fbc3,null))['then'](function(_0x17e421){if(_0x17e421){if(!_[_0xf9ba('0x6e')](_0x17e421[_0xf9ba('0x60')])){if(fs[_0xf9ba('0x6f')](path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x70'),_0x17e421[_0xf9ba('0x60')]))&&_0x229aa1){_0x47c4cf=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x70'),_0x17e421[_0xf9ba('0x60')]);}}return _0x27fbc3['download'](_0x47c4cf);}})['catch'](handleError(_0x27fbc3,null));};exports[_0xf9ba('0x71')]=function(_0x48e656,_0x2d5815){var _0x59898a=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x72'));var _0x2706e7={'where':{'id':_0x48e656['params']['id']},'attributes':['id',_0xf9ba('0x63')],'raw':!![]};return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x2706e7)['then'](handleEntityNotFound(_0x2d5815,null))[_0xf9ba('0x12')](function(_0x447b5c){if(_0x447b5c){if(!_['isNil'](_0x447b5c[_0xf9ba('0x63')])){if(fs['existsSync'](path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x447b5c[_0xf9ba('0x63')]))){_0x59898a=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x447b5c[_0xf9ba('0x63')]);}}return _0x2d5815['download'](_0x59898a);}})['catch'](handleError(_0x2d5815,null));};exports[_0xf9ba('0x74')]=function(_0x404649,_0x13ddf1){var _0x3685cc=path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x75'));var _0x31b78f={'where':{'id':_0x404649[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x66'),_0xf9ba('0x76')],'raw':!![]};return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x31b78f)[_0xf9ba('0x12')](handleEntityNotFound(_0x13ddf1,null))[_0xf9ba('0x12')](function(_0x275609){if(_0x275609){if(!_[_0xf9ba('0x6e')](_0x275609[_0xf9ba('0x66')])){if(fs[_0xf9ba('0x6f')](path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x275609['customerAvatar']))&&_0x275609[_0xf9ba('0x76')]){_0x3685cc=path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x275609['customerAvatar']);}}return _0x13ddf1[_0xf9ba('0x77')](_0x3685cc);}})['catch'](handleError(_0x13ddf1,null));};exports[_0xf9ba('0x78')]=function(_0x33f99d,_0x47c217){var _0x1c5739=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x79'));var _0x2a902b={'where':{'id':_0x33f99d[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x7a')],'raw':!![]};return db[_0xf9ba('0x2c')]['find'](_0x2a902b)[_0xf9ba('0x12')](handleEntityNotFound(_0x47c217,null))[_0xf9ba('0x12')](function(_0x4e9713){if(_0x4e9713){if(!_[_0xf9ba('0x6e')](_0x4e9713['systemAvatar'])){if(fs[_0xf9ba('0x6f')](path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x4e9713['systemAvatar']))){_0x1c5739=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x4e9713[_0xf9ba('0x7a')]);}}return _0x47c217[_0xf9ba('0x77')](_0x1c5739);}})[_0xf9ba('0x1c')](handleError(_0x47c217,null));};exports['notify']=function(_0x33c7fd,_0x37f86d){var _0x3af379=require('user-agent-parser');var _0x304bfd=new _0x3af379();var _0x358b60=_0x304bfd[_0xf9ba('0x7b')](_0x33c7fd['headers']['user-agent'])['getResult']();var _0x18c15d={'body':_0x33c7fd[_0xf9ba('0x49')],'channel':'chat'};var _0x2f3930=[];var _0x2974af=[];var _0x311c58={};var _0x2d55a1=![];return db['CmContact']['describe']()['then'](function(_0x52396b){if(!_0x52396b){throw new db['Sequelize']['ValidationError'](_0xf9ba('0x7c'));}_0x2f3930=_[_0xf9ba('0x7d')](_['keys'](_0x52396b),[_0xf9ba('0x7e'),_0xf9ba('0x7f')]);_0x2974af=_[_0xf9ba('0x7d')](_[_0xf9ba('0x45')](_0x52396b),[_0xf9ba('0x7e'),_0xf9ba('0x7f'),_0xf9ba('0x80'),_0xf9ba('0x81')]);if(_0x33c7fd[_0xf9ba('0x49')]['id']){delete _0x33c7fd['body']['id'];}if(_['isNil'](_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0x85'));}if(_[_0xf9ba('0x6e')](_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x49')])||_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x49')]===''){throw new db[(_0xf9ba('0x83'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x33c7fd['body']['mapKey'])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0x86')+_0x2974af);}if(!_[_0xf9ba('0x87')](_0x2974af,_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2974af);}_0x311c58[_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')]]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')];})[_0xf9ba('0x12')](function(){return db[_0xf9ba('0x2c')]['find']({'where':{'id':_0x33c7fd[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x89')],'as':_0xf9ba('0x8a'),'include':[{'model':db[_0xf9ba('0x8b')],'as':_0xf9ba('0x8c'),'where':_0x311c58,'limit':0x1,'order':[[_0xf9ba('0x7f'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xf9ba('0x8d')}]});})[_0xf9ba('0x12')](handleEntityNotFound(_0x37f86d,null))['then'](function(_0x3a6d36){if(_0x3a6d36&&_0x3a6d36[_0xf9ba('0x8a')]){_0x18c15d[_0xf9ba('0x8e')]=_0x3a6d36;_0x18c15d[_0xf9ba('0x8f')]=_0x3a6d36[_0xf9ba('0x8d')];_0x18c15d['list']=_0x3a6d36[_0xf9ba('0x8a')];_0x18c15d['applications']=_['orderBy'](_0x18c15d[_0xf9ba('0x8f')],[_0xf9ba('0x90')],['asc']);if(_0x18c15d['account']['Applications']){delete _0x18c15d[_0xf9ba('0x8e')][_0xf9ba('0x8d')];}if(_0x18c15d[_0xf9ba('0x8e')]['List']&&_0x18c15d[_0xf9ba('0x8e')]['List']['Contacts'][_0xf9ba('0x36')]){return _0x18c15d[_0xf9ba('0x8e')]['List']['Contacts'][0x0];}var _0x175782=_['defaults'](_0x33c7fd[_0xf9ba('0x49')],{'firstName':_0x33c7fd[_0xf9ba('0x49')]['from'],'ListId':_0x3a6d36[_0xf9ba('0x81')]});_0x175782[_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')]]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')];return db[_0xf9ba('0x8b')][_0xf9ba('0x48')](_0x175782,{'fields':_0x2f3930,'raw':!![]});}})['then'](handleEntityNotFound(_0x37f86d,null))[_0xf9ba('0x12')](function(_0x19625a){_0x18c15d[_0xf9ba('0x91')]=_0x19625a;var _0x2d1ff6=_0x33c7fd['body']['customerIp'];if(_0x33c7fd['headers']['cf-connecting-ip']){_0x2d1ff6=_0x33c7fd['headers'][_0xf9ba('0x92')];}else if(_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x94')]){_0x2d1ff6=_[_0xf9ba('0x95')](_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x94')][_0xf9ba('0x96')](','));}if(_0x19625a){var _0x3d16f1={'ContactId':_0x19625a['id'],'ChatWebsiteId':_0x33c7fd[_0xf9ba('0x44')]['id'],'from':(_0x19625a[_0xf9ba('0x97')]||'')+'\x20'+(_0x19625a[_0xf9ba('0x98')]||''),'customerIp':_0x2d1ff6,'customerPort':_0x33c7fd[_0xf9ba('0x93')]['x-real-port']?_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x99')]:null,'referer':_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x9a')],'browserName':_0x358b60[_0xf9ba('0x9b')][_0xf9ba('0x28')]&&_0x358b60['browser'][_0xf9ba('0x9c')]?util[_0xf9ba('0x9d')](_0xf9ba('0x9e'),_0x358b60[_0xf9ba('0x9b')][_0xf9ba('0x28')],_0x358b60['browser']['version']):_0xf9ba('0x9f'),'browserVersion':_0x358b60['browser'][_0xf9ba('0x9c')]||_0xf9ba('0x9f'),'osName':util[_0xf9ba('0x9d')]('%s\x20%s',_0x358b60['os'][_0xf9ba('0x28')],_0x358b60['os'][_0xf9ba('0x9c')]),'osVersion':_0x358b60['os'][_0xf9ba('0x9c')],'deviceModel':_0x358b60['device']['model']&&_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')]?util['format'](_0xf9ba('0xa2'),_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0x2f')],_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')],_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0x2e')]):null,'deviceVendor':_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')],'deviceType':_0x358b60[_0xf9ba('0xa0')]['type'],'formData':JSON[_0xf9ba('0xa3')](_0x33c7fd['body'])};var _0x4d056c={'ChatWebsiteId':_0x33c7fd['params']['id'],'closed':![]};if(_0x33c7fd[_0xf9ba('0x49')]['threadId']){_0x4d056c[_0xf9ba('0xa4')]=_0x33c7fd['body'][_0xf9ba('0xa4')];return db[_0xf9ba('0xa5')]['find']({'where':_0x4d056c})[_0xf9ba('0x12')](function(_0x4a65ca){if(_0x4a65ca){return[_0x4a65ca,![]];}_0x3d16f1['threadId']=_0x33c7fd['body'][_0xf9ba('0xa4')];_0x3d16f1[_0xf9ba('0xa6')]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa6')];return db[_0xf9ba('0xa5')][_0xf9ba('0x48')](_0x3d16f1)['then'](function(_0x1c4da5){return[_0x1c4da5,!![]];});});}_0x4d056c[_0xf9ba('0xa7')]=_0x19625a['id'];if(_0x33c7fd['body'][_0xf9ba('0xa8')]&&_0x33c7fd[_0xf9ba('0x49')]['interaction']['id']){_0x4d056c['id']=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa8')]['id'];return db[_0xf9ba('0xa5')][_0xf9ba('0x47')]({'where':_0x4d056c})[_0xf9ba('0x12')](function(_0x1d4067){if(_0x1d4067){return[_0x1d4067,![]];}return db['ChatInteraction'][_0xf9ba('0x48')](_0x3d16f1)[_0xf9ba('0x12')](function(_0x2c9999){return[_0x2c9999,!![]];});});}return db[_0xf9ba('0xa5')][_0xf9ba('0x48')](_0x3d16f1)[_0xf9ba('0x12')](function(_0x72c433){return[_0x72c433,!![]];});}})[_0xf9ba('0xa9')](function(_0x4e06c8,_0xcb950d){if(_0x4e06c8){_0x2d55a1=_0xcb950d;if(!_0xcb950d){var _0x515714={'from':(_0x18c15d[_0xf9ba('0x91')][_0xf9ba('0x97')]||'')+'\x20'+(_0x18c15d[_0xf9ba('0x91')][_0xf9ba('0x98')]||'')};if(_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa4')]&&_0x33c7fd[_0xf9ba('0x49')]['messageId']&&_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa4')]!=_0x33c7fd[_0xf9ba('0x49')]['messageId']){_0x515714[_0xf9ba('0xa4')]=_0x33c7fd['body'][_0xf9ba('0xaa')];}return _0x4e06c8[_0xf9ba('0x26')](_0x515714);}else{return _0x4e06c8;}}})['then'](function(_0x110a08){_0x18c15d[_0xf9ba('0xa8')]=_0x110a08[_0xf9ba('0x4d')]({'plain':!![]});_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xab')]=_0x2d55a1;if(_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xab')]){if(_0x18c15d[_0xf9ba('0x8e')][_0xf9ba('0xac')]){_0x18c15d[_0xf9ba('0x8f')][_0xf9ba('0xad')]({'id':0x0,'priority':_0x18c15d[_0xf9ba('0x8f')][_0xf9ba('0x36')]+0x1,'app':_0xf9ba('0xae'),'appdata':_0xf9ba('0xaf'),'interval':_0xf9ba('0xb0')});}}return db[_0xf9ba('0xb1')][_0xf9ba('0x48')]({'body':_0x33c7fd['body']['body'],'ChatWebsiteId':_0x33c7fd[_0xf9ba('0x44')]['id'],'ChatInteractionId':_0x110a08['id'],'direction':'in','ContactId':_0x18c15d[_0xf9ba('0x91')]['id'],'AttachmentId':_0x33c7fd['body'][_0xf9ba('0xb2')]});})[_0xf9ba('0x12')](function(_0x104f98){_0x18c15d[_0xf9ba('0x1a')]=_0x104f98;if(_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xb3')]){return db[_0xf9ba('0xb4')][_0xf9ba('0x47')]({'attributes':['id',_0xf9ba('0x28')],'where':{'id':_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xb3')]}})['then'](function(_0x1da9cf){if(_0x1da9cf){_0x18c15d[_0xf9ba('0x8f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf9ba('0xb5'),'appdata':_0x1da9cf[_0xf9ba('0x28')]+','+(_0x18c15d['account'][_0xf9ba('0xb6')]||0xa),'interval':_0xf9ba('0xb0')});_0x18c15d[_0xf9ba('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x18c15d);});}return respondWithRpcPromise(_0xf9ba('0xb8'),'startRouting',_0x18c15d);})[_0xf9ba('0x12')](function(_0x11518d){respondWithRpcPromise(_0xf9ba('0xb9'),_0xf9ba('0xb9'),{'event':'notify','message':_0x11518d},client9002);return _0x11518d;})[_0xf9ba('0x12')](respondWithResult(_0x37f86d,null))[_0xf9ba('0x1c')](handleError(_0x37f86d,null));};exports[_0xf9ba('0xba')]=function(_0x5b21d6,_0x1138a4){var _0x12e0e6,_0x54deb4,_0xadfb83;var _0x63731d=[];var _0x4ffcf7={};var _0x1a355a=_0x5b21d6[_0xf9ba('0xbb')]||[];var _0x4b148b=[];var _0x5461fa;return db[_0xf9ba('0x8b')]['describe']()[_0xf9ba('0x12')](function(_0x52aa26){if(!_0x52aa26){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))]('no\x20available\x20attributes');}_0x63731d=_[_0xf9ba('0x7d')](_['keys'](_0x52aa26),['createdAt',_0xf9ba('0x7f'),_0xf9ba('0x80'),'ListId']);if(_0x5b21d6[_0xf9ba('0x49')]['id']){delete _0x5b21d6['body']['id'];}if(_[_0xf9ba('0x6e')](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x82')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xf9ba('0x6e')](_0x5b21d6['body'][_0xf9ba('0x49')])||_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x49')]===''){throw _0x1138a4['status'](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0xbd')));}if(_['isNil'](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0xbe')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0xbf')+_0x63731d));}if(!_['includes'](_0x63731d,_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0xbe')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db['Sequelize'][(_0xf9ba('0x84'))](_0xf9ba('0xc0')+_0x63731d));}_0x4ffcf7[_0x5b21d6[_0xf9ba('0x49')]['mapKeyOffline']]=_0x5b21d6['body'][_0xf9ba('0x82')];})[_0xf9ba('0x12')](function(){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x5b21d6[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x89')],'as':_0xf9ba('0x8a')},{'model':db[_0xf9ba('0xc1')],'as':'MailAccount'}]});})[_0xf9ba('0x12')](handleEntityNotFound(_0x1138a4,null))['then'](function(_0x1fda0a){if(_0x1fda0a&&_0x1fda0a[_0xf9ba('0x8a')]){_0x54deb4=_0x1fda0a;var _0x6d3f12=_[_0xf9ba('0xa')](_0x5b21d6[_0xf9ba('0x49')],{'firstName':_0x5b21d6[_0xf9ba('0x49')]['from'],'phone':_0x5b21d6['body']['from'],'ListId':_0x1fda0a['ListId']});_0x6d3f12[_0x5b21d6['body'][_0xf9ba('0xbe')]]=_0x5b21d6[_0xf9ba('0x49')]['from'];return db[_0xf9ba('0x8b')][_0xf9ba('0xc2')]({'where':_0x4ffcf7,'defaults':_0x6d3f12});}})[_0xf9ba('0xa9')](function(_0x387dd0){if(_0x387dd0){_0xadfb83=_0x387dd0;var _0x585aee=fs['readFileSync'](path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0xc3')),_0xf9ba('0xc4'));var _0x3e67c5=ejs[_0xf9ba('0xc5')](_0x585aee,{'body':_['toPairs'](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x49')]),'bodyTitle':_0x54deb4['offlineMessageBody']});return db[_0xf9ba('0xc6')][_0xf9ba('0x48')]({'body':_0x3e67c5,'plainBody':htmlToText[_0xf9ba('0xc7')](_0x3e67c5),'ContactId':_0x387dd0['id'],'ChatWebsiteId':_0x54deb4['id']});}})[_0xf9ba('0x12')](function(_0x3fd2f1){_0x5461fa=_0x3fd2f1;if(_0x1a355a[_0xf9ba('0x36')]){var _0x5b88bb=_0x1a355a[_0xf9ba('0x30')](function(_0x1a2646){return{'name':_0x1a2646[_0xf9ba('0xc8')],'basename':_0x1a2646[_0xf9ba('0x64')],'type':_0x1a2646[_0xf9ba('0xc9')],'ChatOfflineMessageId':_0x3fd2f1['id']};});_0x4b148b=_0x5b88bb[_0xf9ba('0x30')](_0x1321c1=>{var _0x1d0204={'filename':_0x1321c1[_0xf9ba('0x28')],'path':path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0xca'),'files',_0xf9ba('0xcb'),_0xf9ba('0xcc'),_0x1321c1[_0xf9ba('0xcd')])};return _0x1d0204;});if(!_0x54deb4[_0xf9ba('0xce')]){return db['sequelize']['transaction'](function(_0x13f146){return db[_0xf9ba('0xcf')][_0xf9ba('0xd0')](_0x5b88bb,{'transaction':_0x13f146});});}}})[_0xf9ba('0x12')](function(){if(_0x5461fa){_0x12e0e6=_0x5461fa;return db[_0xf9ba('0xc1')][_0xf9ba('0x58')]({'where':{'service':!![]},'include':[{'model':db[_0xf9ba('0xd1')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf9ba('0xd2')],'as':_0xf9ba('0xd2'),'raw':!![]}]}]});}})[_0xf9ba('0x12')](function(_0x3ced1b){if(_0x3ced1b&&_0x3ced1b[_0xf9ba('0xd3')]&&_0x54deb4[_0xf9ba('0xd4')]&&_0x54deb4[_0xf9ba('0xd5')]){var _0x39d10a=_0x3ced1b[_0xf9ba('0xd6')]();return respondWithRpcPromise('SendMail',_0xf9ba('0xd7'),{'account':_0x39d10a,'message':{'from':util[_0xf9ba('0x9d')](_0xf9ba('0xd8'),_0x3ced1b[_0xf9ba('0x28')],_0x3ced1b['email']||_0x3ced1b['Smtp'][_0xf9ba('0x4a')]),'to':_0x54deb4['forwardOfflineAddress'],'subject':_0x54deb4[_0xf9ba('0xd9')],'html':_0x12e0e6[_0xf9ba('0x49')],'attachments':_0x4b148b}},client9003)[_0xf9ba('0x12')](function(){return _0x12e0e6;})[_0xf9ba('0x1c')](function(_0x160385){logger[_0xf9ba('0x17')](_0x160385);});}})[_0xf9ba('0x12')](function(){if(_0x54deb4&&_0x54deb4[_0xf9ba('0xce')]&&_0x54deb4[_0xf9ba('0xda')]){var _0x1f79bd=[];if(_0x1a355a[_0xf9ba('0x36')]){_0x1f79bd=_0x1a355a['map'](function(_0x31bf88){return{'name':_0x31bf88[_0xf9ba('0xc8')],'basename':_0x31bf88[_0xf9ba('0x64')],'type':_0x31bf88[_0xf9ba('0xc9')],'ChatOfflineMessageId':_0x5461fa['id']};});}var _0x124504;if(!_[_0xf9ba('0x6e')](_0x54deb4[_0xf9ba('0xdb')])){var _0x54b885=_[_0xf9ba('0x30')](_0x5b21d6[_0xf9ba('0x49')],function(_0x55068a){return _0x55068a;});var _0x51cce3=_[_0xf9ba('0xdc')](_0x54b885)[0x0];var _0x9835b6=_[_0xf9ba('0xdd')](_0x51cce3,function(_0x28a22a){return _0x28a22a;});_0x124504=_0x9835b6[0x1][_0x54deb4[_0xf9ba('0xdb')]];}var _0x5d1045={'from':_0xadfb83[_0xf9ba('0xde')],'firstName':_0xadfb83[_0xf9ba('0x97')],'lastName':_0xadfb83[_0xf9ba('0x98')],'mapKey':_0xf9ba('0xde'),'message':{'from':_0xadfb83[_0xf9ba('0xde')],'to':_0x54deb4['MailAccount']['email'],'cc':'','subject':_[_0xf9ba('0x6e')](_0x124504)?_0x54deb4['offlineMessageSubject']:_0x124504,'messageId':'','sentAt':new Date(),'attach':_0x1f79bd[_0xf9ba('0x36')],'attachments':_0x1f79bd,'originChannel':_0xf9ba('0xdf'),'ChatWebsiteId':_0x54deb4['id'],'ChatOfflineMessageId':_0x12e0e6['id'],'originTo':_0x54deb4[_0xf9ba('0xc1')][_0xf9ba('0xde')]},'body':_0x12e0e6[_0xf9ba('0x49')]};var _0x16aca1={'account':{'id':_0x54deb4['MailAccountId']},'body':_0x5d1045,'log':_0xf9ba('0xe0')};return respondWithRpcPromise(_0xf9ba('0xe0'),_0xf9ba('0xe1'),_0x16aca1,client9001)[_0xf9ba('0x12')](function(){return _0x12e0e6;})[_0xf9ba('0x1c')](function(_0x375821){logger[_0xf9ba('0x17')](_0x375821);});}return;})[_0xf9ba('0x12')](function(){if(_0x12e0e6){return _0x12e0e6;}})[_0xf9ba('0x12')](respondWithResult(_0x1138a4,null))[_0xf9ba('0x1c')](function(_0x33a178){logger[_0xf9ba('0x17')](_0xf9ba('0x1c'),_0x33a178);for(var _0xe5cca9 of _0x1a355a){var _0x358b5c=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],'server',_0xf9ba('0xbb'),_0xf9ba('0xcb'),_0xf9ba('0xcc'),_0xe5cca9['filename']);fs_extra[_0xf9ba('0xe2')](_0x358b5c)[_0xf9ba('0x1c')](function(_0x48ca4d){logger[_0xf9ba('0x17')](_0xf9ba('0xe3'),_0x358b5c,_0x48ca4d);});}});};exports[_0xf9ba('0xe4')]=function(_0x10111d,_0x3a9743){return db[_0xf9ba('0xa5')][_0xf9ba('0x47')]({'where':{'id':_0x10111d[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x3a9743,null))[_0xf9ba('0x12')](function(_0x27e21d){if(_0x27e21d){return _0x27e21d[_0xf9ba('0xe4')](_0x10111d['body'][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0x10111d[_0xf9ba('0x49')],[_0xf9ba('0x5f'),'id'])||{});}})[_0xf9ba('0x12')](respondWithResult(_0x3a9743,null))[_0xf9ba('0x1c')](handleError(_0x3a9743,null));};exports[_0xf9ba('0xe6')]=function(_0x1a71d5,_0x3f71da){var _0x5077f5={'raw':![],'where':{}};var _0x3b0f9e={};var _0x5c6842={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')]['findOne']({'where':{'id':_0x1a71d5[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f71da,null))['then'](function(_0x17a798){if(_0x17a798){_0x3b0f9e[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0xa5')][_0xf9ba('0x2d')]);_0x3b0f9e[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x1a71d5['query']);_0x3b0f9e[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x3b0f9e['model'],_0x3b0f9e[_0xf9ba('0x31')]);_0x5077f5[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3b0f9e[_0xf9ba('0x2f')],qs['fields'](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x5077f5[_0xf9ba('0x34')]=_0x5077f5[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x5077f5[_0xf9ba('0x34')]:_0x3b0f9e[_0xf9ba('0x2f')];if(!_0x1a71d5['query'][_0xf9ba('0x59')]('nolimit')){_0x5077f5[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x5077f5['offset']=qs[_0xf9ba('0x20')](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x5077f5[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x1a71d5['query'][_0xf9ba('0x39')]);_0x5077f5[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x1a71d5[_0xf9ba('0x31')],_0x3b0f9e[_0xf9ba('0x32')]));_0x5077f5[_0xf9ba('0x3b')]['ChatWebsiteId']=_0x17a798['id'];if(_0x1a71d5['query']['filter']){_0x5077f5['where']=_[_0xf9ba('0x3e')](_0x5077f5['where'],{'$or':_[_0xf9ba('0x30')](_0x5077f5[_0xf9ba('0x34')],function(_0x395bb2){var _0x15487f={};_0x15487f[_0x395bb2]={'$like':'%'+_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x15487f;})});}_0x5077f5=_[_0xf9ba('0x3e')]({},_0x5077f5,_0x1a71d5['options']);return db[_0xf9ba('0xa5')][_0xf9ba('0x23')]({'where':_0x5077f5[_0xf9ba('0x3b')]})[_0xf9ba('0x12')](function(_0x273c14){_0x5c6842[_0xf9ba('0x23')]=_0x273c14;if(_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x5077f5['include']=[{'model':db[_0xf9ba('0x8b')],'as':_0xf9ba('0xe7'),'required':![]},{'model':db['User'],'as':_0xf9ba('0xe8'),'attributes':[_0xf9ba('0x28'),_0xf9ba('0xe9'),_0xf9ba('0xea')],'required':![]},{'model':db[_0xf9ba('0xeb')],'as':_0xf9ba('0xec'),'attributes':['id',_0xf9ba('0x28'),_0xf9ba('0xed')],'where':_0x1a71d5[_0xf9ba('0x31')]['tag']?{'id':_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0xee')]}:undefined,'required':_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0xee')]?!![]:![]}];}return db[_0xf9ba('0xa5')][_0xf9ba('0x41')](_0x5077f5);})[_0xf9ba('0x12')](function(_0x3bc494){_0x5c6842[_0xf9ba('0x42')]=_0x3bc494;return _0x5c6842;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3f71da,_0x5077f5))[_0xf9ba('0x1c')](handleError(_0x3f71da,null));};function iftimePromise(_0x3ff5f6,_0x1c1175){return respondWithRpcPromise(_0xf9ba('0xef'),_0xf9ba('0xf0'),{'command':_0x1c1175[_0xf9ba('0xf1')]?util[_0xf9ba('0x9d')](_0xf9ba('0xf2'),_0x3ff5f6['interval'],_0x1c1175[_0xf9ba('0xf1')]):util[_0xf9ba('0x9d')](_0xf9ba('0xf3'),_0x3ff5f6[_0xf9ba('0xf4')])},client9002)[_0xf9ba('0x12')](function(_0x3dd1f2){var _0x1759db=_0x3dd1f2&&_0x3dd1f2[_0xf9ba('0xf5')](_0xf9ba('0xf6'))>=0x0?!![]:![];logger[_0xf9ba('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1c1175['id'],_0x3ff5f6['id'],_0x3ff5f6[_0xf9ba('0xf4')],_0x1759db?_0xf9ba('0xf7'):_0xf9ba('0xf8'),_0x1c1175['timezone']?_0x1c1175[_0xf9ba('0xf1')]:_0xf9ba('0xf9'));return _0x1759db;})[_0xf9ba('0x1c')](function(_0x2edf1f){logger[_0xf9ba('0x17')](_0xf9ba('0xfa'),_0x1c1175['id'],_0x3ff5f6['id'],_0x3ff5f6['interval'],util['inspect'](_0x2edf1f,{'showHidden':![],'depth':null}),_0x1c1175['timezone']?_0x1c1175[_0xf9ba('0xf1')]:_0xf9ba('0xf9'));return![];});}exports[_0xf9ba('0xf0')]=function(_0xbd5e6d,_0xf03974){var _0x556c21=0x0;var _0x318caa=0x0;var _0x1b6382=![];var _0x2d1c55;var _0x799d84;return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0xbd5e6d[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0xfb')],'as':_0xf9ba('0xfb'),'include':[{'model':db[_0xf9ba('0xfb')],'as':_0xf9ba('0xfc'),'attributes':['id',_0xf9ba('0xf4')],'raw':!![]}]}]})[_0xf9ba('0x12')](handleEntityNotFound(_0xf03974,null))[_0xf9ba('0x12')](function(_0x4eedfb){if(_0x4eedfb){_0x2d1c55=_0x4eedfb;return _0x4eedfb[_0xf9ba('0xfd')]({'raw':!![]});}})[_0xf9ba('0x12')](function(_0x5351cd){if(_0x2d1c55){if(_0x5351cd){_0x799d84=_0x5351cd;}}return require(_0xf9ba('0x6b'))[_0xf9ba('0x6c')]();})[_0xf9ba('0x12')](function(_0xc7f42f){if(_0xc7f42f){_0x318caa=_0xc7f42f[_0xf9ba('0xfe')];_0x1b6382=_0xc7f42f[_0xf9ba('0x6d')];}})['then'](function(){return db[_0xf9ba('0xa5')]['count']({'where':{'closed':![]}});})[_0xf9ba('0x12')](function(_0x5e1279){_0x556c21=_0x5e1279;if(_0x318caa&&_0x5e1279>_0x318caa){return db['License'][_0xf9ba('0x58')]({'where':{'id':0x1}})[_0xf9ba('0x12')](function(_0x5bce55){if(_0x5bce55){_0x5bce55[_0xf9ba('0xff')](_0xf9ba('0x100'));}});}})[_0xf9ba('0x12')](function(){if(_0x2d1c55[_0xf9ba('0xfb')]&&_0x2d1c55[_0xf9ba('0xfb')]['Intervals']){var _0xbba012=[];for(var _0x1f0e78=0x0;_0x1f0e78<_0x2d1c55['Interval'][_0xf9ba('0xfc')][_0xf9ba('0x36')];_0x1f0e78++){var _0x4ee213=_0x2d1c55[_0xf9ba('0xfb')][_0xf9ba('0xfc')][_0x1f0e78][_0xf9ba('0x4d')]({'plain':!![]});_0xbba012[_0xf9ba('0xad')](iftimePromise(_0x4ee213,_0x2d1c55));}return BPromise[_0xf9ba('0x101')](_0xbba012)[_0xf9ba('0x12')](function(_0x2b6aed){return _[_0xf9ba('0x102')](_0x2b6aed);});}else{return!![];}})['then'](function(_0x37f444){var _0x58aa31=fs[_0xf9ba('0x103')](path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x104')),'utf8');var _0x15b951=new url[(_0xf9ba('0x105'))](_0x2d1c55[_0xf9ba('0x106')])[_0xf9ba('0x107')];var _0x3cd632=_0xf9ba('0x108');var _0x7e6c0e=![];var _0x25f99f={'chatVersion':_0x3cd632,'chatWebsiteAddressOrigin':_0x15b951,'remote':_0x2d1c55[_0xf9ba('0x109')],'query':querystring[_0xf9ba('0xa3')](_['merge'](_0x2d1c55[_0xf9ba('0x4d')]({'plain':!![]}),{'customerIp':_0xbd5e6d[_0xf9ba('0x93')][_0xf9ba('0x94')]||_0xbd5e6d[_0xf9ba('0x93')]['x-real-ip']||_0xbd5e6d['connection'][_0xf9ba('0x10a')]||_0xbd5e6d['ip'],'referer':_0xbd5e6d[_0xf9ba('0x93')][_0xf9ba('0x9a')],'openedInteractions':_0x556c21,'maxInteractions':_0x318caa,'virtual':_0x1b6382['virtual'],'online':_0x37f444,'custom':_0x1b6382}))['replace'](/'/g,'\x5c\x27')};_0xf03974[_0xf9ba('0xbc')](ejs['render'](Mustache[_0xf9ba('0xc5')](_0x58aa31,_0x25f99f),{'proactiveActions':_0x799d84,'alignment':_0x2d1c55[_0xf9ba('0x10b')],'verticalAlignment':_0x2d1c55[_0xf9ba('0x10c')],'div_color':_0x2d1c55[_0xf9ba('0xed')],'labelText':_0x2d1c55[_0xf9ba('0x10d')],'text_color':_0x2d1c55['textColor'],'text_button_color':_0x2d1c55[_0xf9ba('0x10e')],'button_color':_0x2d1c55['color_button'],'background_color':_0x2d1c55[_0xf9ba('0x10f')],'hideWhenOffline':_0x2d1c55['hideWhenOffline'],'intervalId':_0x2d1c55['IntervalId'],'isDevelopment':_0x7e6c0e,'chatVersion':_0x3cd632}));})['catch'](handleError(_0xf03974,null));};exports[_0xf9ba('0x110')]=function(_0x55deb2,_0x58e8ae){var _0x136338=_0x55deb2['params']['id'];var _0x1dec8f=_0x55deb2[_0xf9ba('0x49')];var _0x2a321e=0xc8;var _0x116d31=null;return db[_0xf9ba('0x111')][_0xf9ba('0x112')]({'isolationLevel':db[_0xf9ba('0x111')][_0xf9ba('0x113')][_0xf9ba('0x114')]['READ_COMMITTED']},function(_0x31b987){return db['ChatWebsite'][_0xf9ba('0x58')]({'where':{'id':_0x136338},'transaction':_0x31b987})['then'](function(_0x75371a){if(_0x75371a){return db[_0xf9ba('0x115')][_0xf9ba('0x52')]({'where':{'ChatWebsiteId':_0x136338},'transaction':_0x31b987})[_0xf9ba('0x12')](function(){var _0x403275=_[_0xf9ba('0x30')](_0x1dec8f,function(_0x2d3de4){_0x2d3de4[_0xf9ba('0x55')]=_0x136338;return _0x2d3de4;});return db[_0xf9ba('0x115')][_0xf9ba('0xd0')](_0x403275,{'transaction':_0x31b987});});}else{_0x2a321e=0x194;_0x116d31=[];}});})[_0xf9ba('0x12')](function(){if(_0x2a321e!==0x194){return db[_0xf9ba('0x115')][_0xf9ba('0x116')]({'where':{'ChatWebsiteId':_0x136338},'order':_0xf9ba('0x90')})[_0xf9ba('0x12')](function(_0xf2cecc){_0x116d31=_0xf2cecc;});}})[_0xf9ba('0x1c')](function(_0x1fd7eb){_0x2a321e=0x1f4;logger['error'](_0x1fd7eb[_0xf9ba('0x117')]);if(_0x1fd7eb[_0xf9ba('0x28')]){delete _0x1fd7eb[_0xf9ba('0x28')];}_0x116d31=_0x1fd7eb;})['finally'](function(){if(_0x116d31===null){_0x58e8ae[_0xf9ba('0x1d')](_0x2a321e);}else{if(_0x2a321e===0x1f4){_0x58e8ae[_0xf9ba('0x1e')](_0x2a321e)['send'](_0x116d31);}else{_0x58e8ae['status'](_0x2a321e)['json'](_0x116d31);}}});};exports[_0xf9ba('0x118')]=function(_0x165d68,_0x58b4af){var _0x5e08a6={};var _0x5b4119={};var _0x3c8bd9;var _0x2210c8;return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x165d68[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x58b4af,null))[_0xf9ba('0x12')](function(_0x3a7739){if(_0x3a7739){_0x3c8bd9=_0x3a7739;_0x5b4119[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x115')][_0xf9ba('0x2d')]);_0x5b4119['query']=_[_0xf9ba('0x45')](_0x165d68['query']);_0x5b4119[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x5b4119[_0xf9ba('0x2f')],_0x5b4119[_0xf9ba('0x31')]);_0x5e08a6[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x5b4119[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0x165d68['query']['fields']));_0x5e08a6[_0xf9ba('0x34')]=_0x5e08a6[_0xf9ba('0x34')]['length']?_0x5e08a6[_0xf9ba('0x34')]:_0x5b4119['model'];_0x5e08a6[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x165d68['query']['sort']);_0x5e08a6[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x165d68[_0xf9ba('0x31')],_0x5b4119[_0xf9ba('0x32')]));if(_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x5e08a6['where']=_[_0xf9ba('0x3e')](_0x5e08a6[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x5e08a6[_0xf9ba('0x34')],function(_0x23892d){var _0x7b0dc6={};_0x7b0dc6[_0x23892d]={'$like':'%'+_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x7b0dc6;})});}_0x5e08a6=_[_0xf9ba('0x3e')]({},_0x5e08a6,_0x165d68[_0xf9ba('0x46')]);return _0x3c8bd9[_0xf9ba('0x118')](_0x5e08a6);}})['then'](function(_0x29b566){if(_0x29b566){_0x2210c8=_0x29b566['length'];if(!_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x59')]('nolimit')){_0x5e08a6['limit']=qs['limit'](_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x5e08a6[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x20')]);}return _0x3c8bd9['getApplications'](_0x5e08a6);}})[_0xf9ba('0x12')](function(_0x3fbfb7){if(_0x3fbfb7){return _0x3fbfb7?{'count':_0x2210c8,'rows':_0x3fbfb7}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x58b4af,null))['catch'](handleError(_0x58b4af,null));};exports[_0xf9ba('0x119')]=function(_0x2baa12,_0xcb19ca){return db['chatProactiveAction'][_0xf9ba('0x47')]({'where':{'id':_0x2baa12['params']['id']}})['then'](handleEntityNotFound(_0xcb19ca,null))[_0xf9ba('0x12')](function(_0x5cdfbe){if(_0x5cdfbe){return _0x5cdfbe[_0xf9ba('0x119')](_0x2baa12[_0xf9ba('0x49')][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0x2baa12[_0xf9ba('0x49')],[_0xf9ba('0x5f'),'id'])||{});}})['then'](respondWithResult(_0xcb19ca,null))['catch'](handleError(_0xcb19ca,null));};exports[_0xf9ba('0xfd')]=function(_0x53c0e9,_0x13f46d){var _0x50817f={};var _0x313227={};var _0x1c546b;var _0x8608e9;return db['ChatWebsite'][_0xf9ba('0x58')]({'where':{'id':_0x53c0e9['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x13f46d,null))[_0xf9ba('0x12')](function(_0x31e0e9){if(_0x31e0e9){_0x1c546b=_0x31e0e9;_0x313227[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0x11a')][_0xf9ba('0x2d')]);_0x313227[_0xf9ba('0x31')]=_['keys'](_0x53c0e9['query']);_0x313227[_0xf9ba('0x32')]=_['intersection'](_0x313227[_0xf9ba('0x2f')],_0x313227['query']);_0x50817f[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x313227[_0xf9ba('0x2f')],qs['fields'](_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x50817f['attributes']=_0x50817f[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x50817f[_0xf9ba('0x34')]:_0x313227[_0xf9ba('0x2f')];_0x50817f[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x53c0e9[_0xf9ba('0x31')]['sort']);_0x50817f[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x53c0e9[_0xf9ba('0x31')],_0x313227['filters']));if(_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x50817f[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x50817f[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x50817f[_0xf9ba('0x34')],function(_0x45042c){var _0x1ae822={};_0x1ae822[_0x45042c]={'$like':'%'+_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x1ae822;})});}_0x50817f=_['merge']({},_0x50817f,_0x53c0e9[_0xf9ba('0x46')]);return _0x1c546b[_0xf9ba('0xfd')](_0x50817f);}})[_0xf9ba('0x12')](function(_0x38a9cf){if(_0x38a9cf){_0x8608e9=_0x38a9cf[_0xf9ba('0x36')];if(!_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x50817f[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x53c0e9[_0xf9ba('0x31')]['limit']);_0x50817f[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x53c0e9['query'][_0xf9ba('0x20')]);}return _0x1c546b[_0xf9ba('0xfd')](_0x50817f);}})['then'](function(_0x461791){if(_0x461791){return _0x461791?{'count':_0x8608e9,'rows':_0x461791}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x13f46d,null))[_0xf9ba('0x1c')](handleError(_0x13f46d,null));};exports[_0xf9ba('0x11b')]=function(_0x507c40,_0x1837a6){var _0x47120a=_0x507c40['query'][_0xf9ba('0x11c')]===_0xf9ba('0x11d')?_0xf9ba('0x11e'):_0xf9ba('0x11f');return db['ChatWebsite'][_0xf9ba('0x47')]({'attributes':['id',_0x47120a],'where':{'id':_0x507c40[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x1837a6,null))[_0xf9ba('0x12')](function(_0x1f2457){if(_0x1f2457){var _0x12e201=_0x1f2457[_0x47120a];var _0x46a453=_0x12e201&&_0x12e201[_0xf9ba('0x120')]?_0x12e201[_0xf9ba('0x120')]:[];_0x1837a6['send']({'fromKey':_[_0xf9ba('0x6e')](_0x12e201[_0xf9ba('0x121')])?undefined:_0x12e201[_0xf9ba('0x121')],'count':_0x46a453[_0xf9ba('0x36')],'rows':_0x46a453});}})[_0xf9ba('0x1c')](handleError(_0x1837a6,null));};exports[_0xf9ba('0x122')]=function(_0x310516,_0x4293e9){var _0x405013={'raw':![],'where':{}};var _0x457094={};var _0x53978b={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x310516[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x4293e9,null))[_0xf9ba('0x12')](function(_0x4f0a4e){if(_0x4f0a4e){_0x457094[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0xc6')][_0xf9ba('0x2d')]);_0x457094[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x310516[_0xf9ba('0x31')]);_0x457094[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x457094['model'],_0x457094['query']);_0x405013[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x457094[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0x310516['query'][_0xf9ba('0x35')]));_0x405013[_0xf9ba('0x34')]=_0x405013[_0xf9ba('0x34')]['length']?_0x405013[_0xf9ba('0x34')]:_0x457094[_0xf9ba('0x2f')];if(!_0x310516[_0xf9ba('0x31')]['hasOwnProperty']('nolimit')){_0x405013[_0xf9ba('0x22')]=qs['limit'](_0x310516['query'][_0xf9ba('0x22')]);_0x405013[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x310516[_0xf9ba('0x31')]['offset']);}_0x405013[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x310516[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x405013['where']=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x310516[_0xf9ba('0x31')],_0x457094[_0xf9ba('0x32')]));_0x405013[_0xf9ba('0x3b')]['ChatWebsiteId']=_0x4f0a4e['id'];if(_0x310516[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x405013[_0xf9ba('0x3b')]=_['merge'](_0x405013[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x405013[_0xf9ba('0x34')],function(_0x54f76e){var _0x143828={};_0x143828[_0x54f76e]={'$like':'%'+_0x310516['query'][_0xf9ba('0x3d')]+'%'};return _0x143828;})});}_0x405013=_[_0xf9ba('0x3e')]({},_0x405013,_0x310516[_0xf9ba('0x46')]);return db[_0xf9ba('0xc6')][_0xf9ba('0x23')]({'where':_0x405013['where']})[_0xf9ba('0x12')](function(_0x310b7c){_0x53978b['count']=_0x310b7c;if(_0x310516[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x405013[_0xf9ba('0x40')]=[{'all':!![]}];}else{_0x405013[_0xf9ba('0x40')]=[{'model':db['CmContact'],'as':_0xf9ba('0xe7'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xf9ba('0xc6')][_0xf9ba('0x41')](_0x405013);})[_0xf9ba('0x12')](function(_0x17c2b4){_0x53978b[_0xf9ba('0x42')]=_0x17c2b4;return _0x53978b;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x4293e9,_0x405013))[_0xf9ba('0x1c')](handleError(_0x4293e9,null));};exports[_0xf9ba('0x123')]=function(_0xd52a03,_0x4b4c99){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0xd52a03[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x4b4c99,null))[_0xf9ba('0x12')](function(_0x5a7b9b){if(_0x5a7b9b){return _0x5a7b9b[_0xf9ba('0x123')](_0xd52a03[_0xf9ba('0x49')][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0xd52a03[_0xf9ba('0x49')],['ids','id'])||{})[_0xf9ba('0xa9')](function(_0x118cbe){for(var _0x22fcf2=0x0;_0x22fcf2<_0xd52a03['body'][_0xf9ba('0x5f')][_0xf9ba('0x36')];_0x22fcf2+=0x1){socket['emit'](_0xf9ba('0x124'),{'UserId':Number(_0xd52a03[_0xf9ba('0x49')][_0xf9ba('0x5f')][_0x22fcf2]),'ChatWebsiteId':Number(_0xd52a03[_0xf9ba('0x44')]['id'])});}return _0x118cbe;});}})[_0xf9ba('0x12')](respondWithResult(_0x4b4c99,null))[_0xf9ba('0x1c')](handleError(_0x4b4c99,null));};exports['removeAgents']=function(_0x48add1,_0x1bfd5e){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x48add1[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x1bfd5e,null))[_0xf9ba('0x12')](function(_0x24263c){if(_0x24263c){return _0x24263c[_0xf9ba('0x125')](_0x48add1['query'][_0xf9ba('0x5f')])[_0xf9ba('0x12')](function(){if(_[_0xf9ba('0x126')](_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')])){for(var _0x3b88f0=0x0;_0x3b88f0<_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')][_0xf9ba('0x36')];_0x3b88f0+=0x1){socket[_0xf9ba('0x127')](_0xf9ba('0x128'),{'UserId':Number(_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')][_0x3b88f0]),'ChatWebsiteId':Number(_0x48add1[_0xf9ba('0x44')]['id'])});}}else{socket[_0xf9ba('0x127')](_0xf9ba('0x128'),{'UserId':Number(_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')]),'ChatWebsiteId':Number(_0x48add1[_0xf9ba('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bfd5e,null))[_0xf9ba('0x1c')](handleError(_0x1bfd5e,null));};exports[_0xf9ba('0x129')]=function(_0x1140e4,_0x5ebcf7){var _0x12b50d={};var _0x19e632={};var _0x37bb7b;var _0x403553;return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x1140e4['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x5ebcf7,null))['then'](function(_0xed6935){if(_0xed6935){_0x37bb7b=_0xed6935;_0x19e632[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0xb4')]['rawAttributes']);_0x19e632[_0xf9ba('0x31')]=_['keys'](_0x1140e4[_0xf9ba('0x31')]);_0x19e632[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x19e632[_0xf9ba('0x2f')],_0x19e632[_0xf9ba('0x31')]);_0x12b50d[_0xf9ba('0x34')]=_['intersection'](_0x19e632[_0xf9ba('0x2f')],qs['fields'](_0x1140e4[_0xf9ba('0x31')]['fields']));_0x12b50d[_0xf9ba('0x34')]=_0x12b50d[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x12b50d[_0xf9ba('0x34')]:_0x19e632['model'];_0x12b50d[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x12b50d[_0xf9ba('0x3b')]=qs['filters'](_[_0xf9ba('0x3a')](_0x1140e4[_0xf9ba('0x31')],_0x19e632[_0xf9ba('0x32')]));if(_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x12b50d[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x12b50d[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x12b50d[_0xf9ba('0x34')],function(_0x256764){var _0x252e7e={};_0x252e7e[_0x256764]={'$like':'%'+_0x1140e4[_0xf9ba('0x31')]['filter']+'%'};return _0x252e7e;})});}_0x12b50d=_[_0xf9ba('0x3e')]({},_0x12b50d,_0x1140e4['options']);return _0x37bb7b[_0xf9ba('0x129')](_0x12b50d);}})[_0xf9ba('0x12')](function(_0xa15996){if(_0xa15996){_0x403553=_0xa15996[_0xf9ba('0x36')];if(!_0x1140e4[_0xf9ba('0x31')]['hasOwnProperty'](_0xf9ba('0x37'))){_0x12b50d[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x12b50d[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x20')]);}return _0x37bb7b[_0xf9ba('0x129')](_0x12b50d);}})[_0xf9ba('0x12')](function(_0x37e4d6){if(_0x37e4d6){return _0x37e4d6?{'count':_0x403553,'rows':_0x37e4d6}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x5ebcf7,null))[_0xf9ba('0x1c')](handleError(_0x5ebcf7,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 0bc20cf..ba3f166 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 _0x8e94=['emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x8e94,0xf8));var _0x48e9=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0x8e94[_0xdd2348];return _0x2e0a02;};'use strict';var EventEmitter=require(_0x48e9('0x0'));var ChatWebsite=require(_0x48e9('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x48e9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x48e9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x127cbf){return function(_0x5f4f1a,_0x506fa6,_0x479c2c){ChatWebsiteEvents[_0x48e9('0x4')](_0x127cbf+':'+_0x5f4f1a['id'],_0x5f4f1a);ChatWebsiteEvents[_0x48e9('0x4')](_0x127cbf,_0x5f4f1a);_0x479c2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x48e9('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x379e=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x390259,_0x338589){var _0x17bec9=function(_0x498c7d){while(--_0x498c7d){_0x390259['push'](_0x390259['shift']());}};_0x17bec9(++_0x338589);}(_0x379e,0x104));var _0xe379=function(_0x287829,_0x39e938){_0x287829=_0x287829-0x0;var _0x293992=_0x379e[_0x287829];return _0x293992;};'use strict';var EventEmitter=require(_0xe379('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe379('0x1'),'afterUpdate':_0xe379('0x2'),'afterDestroy':_0xe379('0x3')};function emitEvent(_0x4387fd){return function(_0x3db31a,_0x475418,_0x3ed6c8){ChatWebsiteEvents['emit'](_0x4387fd+':'+_0x3db31a['id'],_0x3db31a);ChatWebsiteEvents[_0xe379('0x4')](_0x4387fd,_0x3db31a);_0x3ed6c8(null);};}for(var e in events){if(events[_0xe379('0x5')](e)){var event=events[e];ChatWebsite[_0xe379('0x6')](e,emitEvent(event));}}module[_0xe379('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9ecb660..94ee362 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 _0x14a8=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x14a8,0x95));var _0x814a=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x14a8[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x814a('0x0'));var util=require(_0x814a('0x1'));var logger=require(_0x814a('0x2'))(_0x814a('0x3'));var moment=require('moment');var BPromise=require(_0x814a('0x4'));var rp=require(_0x814a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x814a('0x6'));var config=require(_0x814a('0x7'));var attributes=require(_0x814a('0x8'));module['exports']=function(_0x5e0e99,_0x28d6b0){return _0x5e0e99[_0x814a('0x9')](_0x814a('0xa'),attributes,{'tableName':_0x814a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5b0=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x221443,_0x597dc0){var _0x260530=function(_0x28b5aa){while(--_0x28b5aa){_0x221443['push'](_0x221443['shift']());}};_0x260530(++_0x597dc0);}(_0xc5b0,0x119));var _0x0c5b=function(_0x38eb86,_0x247e47){_0x38eb86=_0x38eb86-0x0;var _0x1f2581=_0xc5b0[_0x38eb86];return _0x1f2581;};'use strict';var _=require(_0x0c5b('0x0'));var util=require('util');var logger=require(_0x0c5b('0x1'))(_0x0c5b('0x2'));var moment=require('moment');var BPromise=require(_0x0c5b('0x3'));var rp=require(_0x0c5b('0x4'));var fs=require('fs');var path=require(_0x0c5b('0x5'));var rimraf=require(_0x0c5b('0x6'));var config=require(_0x0c5b('0x7'));var attributes=require(_0x0c5b('0x8'));module[_0x0c5b('0x9')]=function(_0x567026,_0x319115){return _0x567026[_0x0c5b('0xa')](_0x0c5b('0xb'),attributes,{'tableName':_0x0c5b('0xc'),'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 98435d9..347cae7 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 _0x939e=['message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x170db8,_0x1d7713){var _0x2482fc=function(_0x44bbfd){while(--_0x44bbfd){_0x170db8['push'](_0x170db8['shift']());}};_0x2482fc(++_0x1d7713);}(_0x939e,0x161));var _0xe939=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0x939e[_0x4287b6];return _0x5a4f7e;};'use strict';var _=require(_0xe939('0x0'));var util=require(_0xe939('0x1'));var moment=require(_0xe939('0x2'));var BPromise=require('bluebird');var rs=require(_0xe939('0x3'));var fs=require('fs');var Redis=require(_0xe939('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe939('0x5'));var logger=require(_0xe939('0x6'))(_0xe939('0x7'));var config=require(_0xe939('0x8'));var jayson=require(_0xe939('0x9'));var client=jayson['client'][_0xe939('0xa')]({'port':0x232a});config[_0xe939('0xb')]=_[_0xe939('0xc')](config[_0xe939('0xb')],{'host':_0xe939('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe939('0xb')]));require(_0xe939('0xe'))[_0xe939('0xf')](socket);function respondWithRpcPromise(_0x23783a,_0x2c88a7,_0x588595){return new BPromise(function(_0x1bdb75,_0x2e8965){return client[_0xe939('0x10')](_0x23783a,_0x588595)[_0xe939('0x11')](function(_0x24b9c1){logger[_0xe939('0x12')](_0xe939('0x13'),_0x2c88a7,_0xe939('0x14'));logger[_0xe939('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2c88a7,'request\x20sent',JSON[_0xe939('0x16')](_0x24b9c1));if(_0x24b9c1[_0xe939('0x17')]){if(_0x24b9c1[_0xe939('0x17')][_0xe939('0x18')]===0x1f4){logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);return _0x2e8965(_0x24b9c1['error'][_0xe939('0x19')]);}logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);return _0x1bdb75(_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);}else{logger[_0xe939('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2c88a7,_0xe939('0x14'));_0x1bdb75(_0x24b9c1['result'][_0xe939('0x19')]);}})[_0xe939('0x1a')](function(_0x5a7f10){logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x5a7f10);_0x2e8965(_0x5a7f10);});});}
\ No newline at end of file
+var _0xdd38=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3e94d1,_0x2d264e){var _0x5b4d1e=function(_0x2b0e06){while(--_0x2b0e06){_0x3e94d1['push'](_0x3e94d1['shift']());}};_0x5b4d1e(++_0x2d264e);}(_0xdd38,0x180));var _0x8dd3=function(_0x2c6805,_0x46f0c5){_0x2c6805=_0x2c6805-0x0;var _0x523793=_0xdd38[_0x2c6805];return _0x523793;};'use strict';var _=require(_0x8dd3('0x0'));var util=require(_0x8dd3('0x1'));var moment=require(_0x8dd3('0x2'));var BPromise=require(_0x8dd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8dd3('0x4'));var db=require(_0x8dd3('0x5'))['db'];var utils=require(_0x8dd3('0x6'));var logger=require('../../config/logger')(_0x8dd3('0x7'));var config=require(_0x8dd3('0x8'));var jayson=require(_0x8dd3('0x9'));var client=jayson[_0x8dd3('0xa')][_0x8dd3('0xb')]({'port':0x232a});config[_0x8dd3('0xc')]=_['defaults'](config[_0x8dd3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dd3('0xd'))(new Redis(config['redis']));require(_0x8dd3('0xe'))['register'](socket);function respondWithRpcPromise(_0xcfdd9,_0x18daa4,_0x615a79){return new BPromise(function(_0x5dcc82,_0x440293){return client['request'](_0xcfdd9,_0x615a79)[_0x8dd3('0xf')](function(_0x2b71d4){logger[_0x8dd3('0x10')](_0x8dd3('0x11'),_0x18daa4,_0x8dd3('0x12'));logger[_0x8dd3('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x18daa4,'request\x20sent',JSON[_0x8dd3('0x14')](_0x2b71d4));if(_0x2b71d4[_0x8dd3('0x15')]){if(_0x2b71d4[_0x8dd3('0x15')][_0x8dd3('0x16')]===0x1f4){logger[_0x8dd3('0x15')](_0x8dd3('0x11'),_0x18daa4,_0x2b71d4['error'][_0x8dd3('0x17')]);return _0x440293(_0x2b71d4[_0x8dd3('0x15')][_0x8dd3('0x17')]);}logger[_0x8dd3('0x15')](_0x8dd3('0x11'),_0x18daa4,_0x2b71d4['error'][_0x8dd3('0x17')]);return _0x5dcc82(_0x2b71d4['error'][_0x8dd3('0x17')]);}else{logger['info'](_0x8dd3('0x11'),_0x18daa4,'request\x20sent');_0x5dcc82(_0x2b71d4[_0x8dd3('0x18')][_0x8dd3('0x17')]);}})[_0x8dd3('0x19')](function(_0x1655b9){logger['error'](_0x8dd3('0x11'),_0x18daa4,_0x1655b9);_0x440293(_0x1655b9);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e8f64e6..4fa3630 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 _0xc594=['remove','update','emit','register','chatWebsite:','./chatWebsite.events','save'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0xc594,0x1cc));var _0x4c59=function(_0xb0c760,_0x276f35){_0xb0c760=_0xb0c760-0x0;var _0x40a475=_0xc594[_0xb0c760];return _0x40a475;};'use strict';var ChatWebsiteEvents=require(_0x4c59('0x0'));var events=[_0x4c59('0x1'),_0x4c59('0x2'),_0x4c59('0x3')];function createListener(_0x43b411,_0x28db2b){return function(_0x3590ea){_0x28db2b[_0x4c59('0x4')](_0x43b411,_0x3590ea);};}function removeListener(_0x5e22f9,_0xadf9b5){return function(){ChatWebsiteEvents['removeListener'](_0x5e22f9,_0xadf9b5);};}exports[_0x4c59('0x5')]=function(_0x3a6581){for(var _0x368a8f=0x0,_0x343796=events['length'];_0x368a8f<_0x343796;_0x368a8f++){var _0x551126=events[_0x368a8f];var _0x37f30e=createListener(_0x4c59('0x6')+_0x551126,_0x3a6581);ChatWebsiteEvents['on'](_0x551126,_0x37f30e);}};
\ No newline at end of file
+var _0x4ef8=['length','chatWebsite:','save','update','emit','removeListener','register'];(function(_0x100f72,_0x1fb228){var _0x3b376c=function(_0x30ce91){while(--_0x30ce91){_0x100f72['push'](_0x100f72['shift']());}};_0x3b376c(++_0x1fb228);}(_0x4ef8,0x16e));var _0x84ef=function(_0x4770b5,_0x4ad6c3){_0x4770b5=_0x4770b5-0x0;var _0x331de2=_0x4ef8[_0x4770b5];return _0x331de2;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x84ef('0x0'),'remove',_0x84ef('0x1')];function createListener(_0x51af75,_0x5d32a9){return function(_0x294a44){_0x5d32a9[_0x84ef('0x2')](_0x51af75,_0x294a44);};}function removeListener(_0x3debae,_0x31d4e8){return function(){ChatWebsiteEvents[_0x84ef('0x3')](_0x3debae,_0x31d4e8);};}exports[_0x84ef('0x4')]=function(_0xb6c9a2){for(var _0x2b050a=0x0,_0x33fbc4=events[_0x84ef('0x5')];_0x2b050a<_0x33fbc4;_0x2b050a++){var _0x17596d=events[_0x2b050a];var _0x55e40b=createListener(_0x84ef('0x6')+_0x17596d,_0xb6c9a2);ChatWebsiteEvents['on'](_0x17596d,_0x55e40b);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 1e46a15..73be8e7 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 _0x13c1=['addSystemAvatar','notify','attachments','offline-chat','replace','/:id/offline','any','offline','addInteraction','/:id/applications','addAgents','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar'];(function(_0x53b253,_0x5d9ea5){var _0xde3bc5=function(_0x5c2a29){while(--_0x5c2a29){_0x53b253['push'](_0x53b253['shift']());}};_0xde3bc5(++_0x5d9ea5);}(_0x13c1,0xdf));var _0x113c=function(_0x34e799,_0x416e7f){_0x34e799=_0x34e799-0x0;var _0x17eeca=_0x13c1[_0x34e799];return _0x17eeca;};'use strict';var multer=require(_0x113c('0x0'));var util=require(_0x113c('0x1'));var path=require(_0x113c('0x2'));var timeout=require(_0x113c('0x3'));var express=require(_0x113c('0x4'));var router=express[_0x113c('0x5')]();var fs_extra=require(_0x113c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x113c('0x7'));var config=require(_0x113c('0x8'));var controller=require(_0x113c('0x9'));router[_0x113c('0xa')]('/',auth[_0x113c('0xb')](),controller[_0x113c('0xc')]);router[_0x113c('0xa')](_0x113c('0xd'),auth[_0x113c('0xb')](),controller[_0x113c('0xe')]);router['get'](_0x113c('0xf'),auth[_0x113c('0xb')](),controller[_0x113c('0x10')]);router['get'](_0x113c('0x11'),auth['isAuthenticated'](),controller[_0x113c('0x12')]);router[_0x113c('0xa')](_0x113c('0x13'),auth['isAuthenticated'](),controller[_0x113c('0x14')]);router[_0x113c('0xa')](_0x113c('0x15'),controller['getLogo']);router[_0x113c('0xa')](_0x113c('0x16'),controller[_0x113c('0x17')]);router[_0x113c('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x113c('0xa')]('/:id/system_avatar',controller[_0x113c('0x18')]);router[_0x113c('0xa')](_0x113c('0x19'),auth['isAuthenticated'](),controller[_0x113c('0x1a')]);router[_0x113c('0xa')](_0x113c('0x1b'),controller[_0x113c('0x1c')]);router[_0x113c('0xa')]('/:id/applications',auth[_0x113c('0xb')](),controller[_0x113c('0x1d')]);router[_0x113c('0xa')]('/:id/proactive_actions',auth[_0x113c('0xb')](),controller[_0x113c('0x1e')]);router[_0x113c('0xa')](_0x113c('0x1f'),controller[_0x113c('0x20')]);router[_0x113c('0xa')](_0x113c('0x21'),auth[_0x113c('0xb')](),controller[_0x113c('0x22')]);router['get'](_0x113c('0x23'),auth[_0x113c('0xb')](),controller['getAgents']);router[_0x113c('0x24')]('/',auth[_0x113c('0xb')](),controller[_0x113c('0x25')]);router[_0x113c('0x24')](_0x113c('0x11'),auth['isAuthenticated'](),controller[_0x113c('0x26')]);router[_0x113c('0x24')](_0x113c('0x13'),auth['isAuthenticated'](),controller[_0x113c('0x27')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x47303b,_0x5e3269,_0x5348cf){_0x5348cf(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],'server/files/images/logos/'));},'filename':function(_0x565cb2,_0x55f3c0,_0x5e5b81){_0x5e5b81(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date[_0x113c('0x2d')](),_0x55f3c0[_0x113c('0x2e')]));}})});router[_0x113c('0x24')](_0x113c('0x15'),upload[_0x113c('0x2f')](_0x113c('0x30')),controller[_0x113c('0x31')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x518506,_0x249e2e,_0x107f58){_0x107f58(null,path['join'](config['root'],_0x113c('0x32')));},'filename':function(_0x37bbb1,_0x39f888,_0x20be3f){_0x20be3f(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date['now'](),_0x39f888[_0x113c('0x2e')]));}})});router[_0x113c('0x24')]('/:id/avatar',upload[_0x113c('0x2f')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x3f30e5,_0x289a35,_0x25db44){_0x25db44(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],_0x113c('0x32')));},'filename':function(_0x28141d,_0x2d72de,_0x25981c){_0x25981c(null,util['format']('%s-%s',Date[_0x113c('0x2d')](),_0x2d72de[_0x113c('0x2e')]));}})});router[_0x113c('0x24')]('/:id/customer_avatar',upload['single'](_0x113c('0x30')),controller[_0x113c('0x33')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x5bb173,_0xea3349,_0x29711e){_0x29711e(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],_0x113c('0x32')));},'filename':function(_0x1758de,_0x43cf56,_0x5e3ea5){_0x5e3ea5(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date[_0x113c('0x2d')](),_0x43cf56[_0x113c('0x2e')]));}})});router[_0x113c('0x24')](_0x113c('0x34'),upload['single'](_0x113c('0x30')),controller[_0x113c('0x35')]);router[_0x113c('0x24')]('/:id/notify',controller[_0x113c('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x118950,_0x5022f0,_0x790c7f){const _0x45629a=path[_0x113c('0x29')](config[_0x113c('0x2a')],'server/files',_0x113c('0x37'),_0x113c('0x38'));fs_extra['ensureDir'](_0x45629a,function(){_0x790c7f(null,_0x45629a);});},'filename':function(_0x1d3bf0,_0x5dbdb6,_0x1afa69){const _0x5cd09b=_0x5dbdb6['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1da472=path['extname'](_0x5cd09b);const _0x214e0e=Date[_0x113c('0x2d')]()+'-'+_0x5cd09b[_0x113c('0x39')](_0x1da472,'')+_0x1da472;_0x1afa69(null,_0x214e0e);}})});router[_0x113c('0x24')](_0x113c('0x3a'),offlineUploadMulter[_0x113c('0x3b')](),controller[_0x113c('0x3c')]);router[_0x113c('0x24')](_0x113c('0x19'),auth[_0x113c('0xb')](),controller[_0x113c('0x3d')]);router['post'](_0x113c('0x3e'),auth[_0x113c('0xb')](),controller['addApplications']);router[_0x113c('0x24')]('/:id/proactive_actions',auth[_0x113c('0xb')](),controller['addProactiveActions']);router[_0x113c('0x24')]('/:id/users',auth[_0x113c('0xb')](),controller[_0x113c('0x3f')]);router['put'](_0x113c('0xf'),auth[_0x113c('0xb')](),controller['update']);router['delete'](_0x113c('0xf'),auth['isAuthenticated'](),controller[_0x113c('0x40')]);router[_0x113c('0x41')](_0x113c('0x11'),auth[_0x113c('0xb')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x113c('0xb')](),controller[_0x113c('0x42')]);router[_0x113c('0x41')](_0x113c('0x23'),auth[_0x113c('0xb')](),controller[_0x113c('0x43')]);module[_0x113c('0x44')]=router;
\ No newline at end of file
+var _0x2c06=['server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','put','/:id','update','destroy','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','now','addAvatar'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x2c06,0x1b1));var _0x62c0=function(_0x30a5f2,_0x48c746){_0x30a5f2=_0x30a5f2-0x0;var _0x4f9ab9=_0x2c06[_0x30a5f2];return _0x4f9ab9;};'use strict';var multer=require('multer');var util=require(_0x62c0('0x0'));var path=require(_0x62c0('0x1'));var timeout=require(_0x62c0('0x2'));var express=require(_0x62c0('0x3'));var router=express[_0x62c0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x62c0('0x5'));var config=require(_0x62c0('0x6'));var controller=require(_0x62c0('0x7'));router[_0x62c0('0x8')]('/',auth[_0x62c0('0x9')](),controller[_0x62c0('0xa')]);router[_0x62c0('0x8')](_0x62c0('0xb'),auth[_0x62c0('0x9')](),controller['describe']);router[_0x62c0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x62c0('0xc')]);router['get'](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller[_0x62c0('0xe')]);router[_0x62c0('0x8')](_0x62c0('0xf'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x10')]);router[_0x62c0('0x8')](_0x62c0('0x11'),controller[_0x62c0('0x12')]);router[_0x62c0('0x8')](_0x62c0('0x13'),controller['getAvatar']);router[_0x62c0('0x8')](_0x62c0('0x14'),controller[_0x62c0('0x15')]);router['get'](_0x62c0('0x16'),controller[_0x62c0('0x17')]);router[_0x62c0('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x62c0('0x8')](_0x62c0('0x18'),controller['getSnippet']);router[_0x62c0('0x8')](_0x62c0('0x19'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x1a')]);router[_0x62c0('0x8')](_0x62c0('0x1b'),auth['isAuthenticated'](),controller[_0x62c0('0x1c')]);router[_0x62c0('0x8')](_0x62c0('0x1d'),controller['getFields']);router[_0x62c0('0x8')](_0x62c0('0x1e'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x1f')]);router['get'](_0x62c0('0x20'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x21')]);router[_0x62c0('0x22')]('/',auth['isAuthenticated'](),controller[_0x62c0('0x23')]);router[_0x62c0('0x22')](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x24')]);router['post']('/:id/canned_answers',auth[_0x62c0('0x9')](),controller[_0x62c0('0x25')]);var upload=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x4e7960,_0x56b23e,_0x3cc1ea){_0x3cc1ea(null,path[_0x62c0('0x27')](config[_0x62c0('0x28')],_0x62c0('0x29')));},'filename':function(_0x47a90e,_0x532125,_0x35ac78){_0x35ac78(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date['now'](),_0x532125[_0x62c0('0x2c')]));}})});router['post'](_0x62c0('0x11'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159bc7,_0x209f0d,_0x33dd3b){_0x33dd3b(null,path['join'](config[_0x62c0('0x28')],'server/files/images/avatars/'));},'filename':function(_0x32255b,_0x48870d,_0x1b6cb7){_0x1b6cb7(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date[_0x62c0('0x30')](),_0x48870d['originalname']));}})});router[_0x62c0('0x22')](_0x62c0('0x13'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ff74d,_0x29f27c,_0x188b76){_0x188b76(null,path[_0x62c0('0x27')](config[_0x62c0('0x28')],_0x62c0('0x32')));},'filename':function(_0xb10f3b,_0x2be7e9,_0x59bd55){_0x59bd55(null,util[_0x62c0('0x2a')]('%s-%s',Date['now'](),_0x2be7e9[_0x62c0('0x2c')]));}})});router[_0x62c0('0x22')](_0x62c0('0x14'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x33')]);var upload=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x198385,_0x5b9493,_0x20aca0){_0x20aca0(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x47aabf,_0x4b2ec4,_0x27fc5e){_0x27fc5e(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date['now'](),_0x4b2ec4[_0x62c0('0x2c')]));}})});router[_0x62c0('0x22')]('/:id/system_avatar',upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x34')]);router['post'](_0x62c0('0x35'),controller[_0x62c0('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x5b04a0,_0x22eeea,_0x47c228){const _0x578bed=path['join'](config['root'],'server/files','attachments','offline-chat');fs_extra['ensureDir'](_0x578bed,function(){_0x47c228(null,_0x578bed);});},'filename':function(_0x5008e7,_0x389823,_0x4cfc88){const _0x36179d=_0x389823[_0x62c0('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x275a0b=path[_0x62c0('0x37')](_0x36179d);const _0x4d21b4=Date[_0x62c0('0x30')]()+'-'+_0x36179d[_0x62c0('0x38')](_0x275a0b,'')+_0x275a0b;_0x4cfc88(null,_0x4d21b4);}})});router[_0x62c0('0x22')](_0x62c0('0x39'),offlineUploadMulter[_0x62c0('0x3a')](),controller[_0x62c0('0x3b')]);router['post'](_0x62c0('0x3c'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3d')]);router[_0x62c0('0x22')](_0x62c0('0x19'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3e')]);router[_0x62c0('0x22')](_0x62c0('0x1b'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3f')]);router[_0x62c0('0x22')](_0x62c0('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x62c0('0x40')](_0x62c0('0x41'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x42')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x62c0('0x43')]);router[_0x62c0('0x44')](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller['removeDispositions']);router[_0x62c0('0x44')](_0x62c0('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x62c0('0x20'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 2f6f57a..f7cc4dd 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 _0xa653=['get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','express','../config/environment','Router','env','production','app'];(function(_0x5f1431,_0x49bea0){var _0x165500=function(_0xdb081a){while(--_0xdb081a){_0x5f1431['push'](_0x5f1431['shift']());}};_0x165500(++_0x49bea0);}(_0xa653,0x15a));var _0x3a65=function(_0xf943eb,_0xa77db5){_0xf943eb=_0xf943eb-0x0;var _0x1f4ba7=_0xa653[_0xf943eb];return _0x1f4ba7;};var beaverLogger=require('beaver-logger/server');var express=require(_0x3a65('0x0'));var auth=require('../components/auth/service');var config=require(_0x3a65('0x1'));var router=express[_0x3a65('0x2')]();var isProduction=config[_0x3a65('0x3')]===_0x3a65('0x4')||![];function clientSideLogs(_0x92ca2f,_0x268748,_0x6bd0fc){var _0x474a76=_0x92ca2f[_0x3a65('0x5')][_0x3a65('0x6')]('client-side-logger');if(!_0x474a76){throw new Error(_0x3a65('0x7'));}return beaverLogger[_0x3a65('0x8')]({'uri':'/client-logs','logger':_0x474a76,'enableCors':!isProduction})(_0x92ca2f,_0x268748,_0x6bd0fc);}router[_0x3a65('0x9')](auth[_0x3a65('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x6a57=['../components/auth/service','../config/environment','Router','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server'];(function(_0x114c74,_0x188e59){var _0x465157=function(_0x3b70ad){while(--_0x3b70ad){_0x114c74['push'](_0x114c74['shift']());}};_0x465157(++_0x188e59);}(_0x6a57,0x197));var _0x76a5=function(_0x4bdab6,_0xe86f11){_0x4bdab6=_0x4bdab6-0x0;var _0x5e1c1a=_0x6a57[_0x4bdab6];return _0x5e1c1a;};var beaverLogger=require(_0x76a5('0x0'));var express=require('express');var auth=require(_0x76a5('0x1'));var config=require(_0x76a5('0x2'));var router=express[_0x76a5('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x342f99,_0x1c1749,_0x85dfac){var _0x20a73f=_0x342f99[_0x76a5('0x4')][_0x76a5('0x5')](_0x76a5('0x6'));if(!_0x20a73f){throw new Error(_0x76a5('0x7'));}return beaverLogger[_0x76a5('0x8')]({'uri':'/client-logs','logger':_0x20a73f,'enableCors':!isProduction})(_0x342f99,_0x1c1749,_0x85dfac);}router[_0x76a5('0x9')](auth[_0x76a5('0xa')](),clientSideLogs);module[_0x76a5('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 edab9d8..9559bd9 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 _0x094f=['exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0xbe59fa,_0x530be0){var _0x135e7e=function(_0x42b33e){while(--_0x42b33e){_0xbe59fa['push'](_0xbe59fa['shift']());}};_0x135e7e(++_0x530be0);}(_0x094f,0x6f));var _0xf094=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x094f[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require(_0xf094('0x0'));module[_0xf094('0x1')]={'name':{'type':Sequelize[_0xf094('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf094('0x3')](_0xf094('0x4'),_0xf094('0x5'),_0xf094('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf094('0x3')](_0xf094('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0x8')},'data2':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0x9')},'data3':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0xa')},'data4':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0xb')},'data5':{'type':Sequelize[_0xf094('0xc')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf094('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf094('0xc')],'comment':_0xf094('0xd')}};
\ No newline at end of file
+var _0x7898=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x7dc834,_0x2ea838){var _0x2b3946=function(_0x133ebf){while(--_0x133ebf){_0x7dc834['push'](_0x7dc834['shift']());}};_0x2b3946(++_0x2ea838);}(_0x7898,0xa0));var _0x8789=function(_0x4639d2,_0x41bf0a){_0x4639d2=_0x4639d2-0x0;var _0x5c1f9d=_0x7898[_0x4639d2];return _0x5c1f9d;};'use strict';var Sequelize=require(_0x8789('0x0'));module[_0x8789('0x1')]={'name':{'type':Sequelize[_0x8789('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x8789('0x3'),_0x8789('0x4'),_0x8789('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8789('0x6')](_0x8789('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x8789('0x8')},'data2':{'type':Sequelize[_0x8789('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x8789('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x8789('0x2')],'comment':_0x8789('0x9')},'data5':{'type':Sequelize[_0x8789('0xa')],'comment':_0x8789('0xb')},'data6':{'type':Sequelize[_0x8789('0xa')],'comment':_0x8789('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ef8c3a2..7cef634 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 _0x2317=['defaults','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','keys','includeAll','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','encryptString','create','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis'];(function(_0x2d0fff,_0x128adc){var _0x40c5b1=function(_0x2bbb86){while(--_0x2bbb86){_0x2d0fff['push'](_0x2d0fff['shift']());}};_0x40c5b1(++_0x128adc);}(_0x2317,0x11c));var _0x7231=function(_0xf5b1aa,_0x369a5b){_0xf5b1aa=_0xf5b1aa-0x0;var _0x433e1b=_0x2317[_0xf5b1aa];return _0x433e1b;};'use strict';var _=require(_0x7231('0x0'));var Redis=require(_0x7231('0x1'));var qs=require(_0x7231('0x2'));var encryptor=require(_0x7231('0x3'));var config=require(_0x7231('0x4'));var logger=require(_0x7231('0x5'))(_0x7231('0x6'));var db=require(_0x7231('0x7'))['db'];var oauth=require(_0x7231('0x8'));config[_0x7231('0x9')]=_[_0x7231('0xa')](config[_0x7231('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7231('0x9')]));var redis=new Redis(config[_0x7231('0x9')]);function respondWithStatusCode(_0x1be196,_0x2cdb48){_0x2cdb48=_0x2cdb48||0xcc;return function(_0x2f4f69){if(_0x2f4f69){return _0x1be196[_0x7231('0xb')](_0x2cdb48);}return _0x1be196[_0x7231('0xc')](_0x2cdb48)[_0x7231('0xd')]();};}function respondWithResult(_0x207bd9,_0x1d95cf){_0x1d95cf=_0x1d95cf||0xc8;return function(_0x2b4c49){if(_0x2b4c49){return _0x207bd9[_0x7231('0xc')](_0x1d95cf)[_0x7231('0xe')](_0x2b4c49);}};}function respondWithFilteredResult(_0x17a3c7,_0x243b98){return function(_0x55cb80){if(_0x55cb80){var _0xb4b0e7=typeof _0x243b98[_0x7231('0xf')]===_0x7231('0x10')&&typeof _0x243b98[_0x7231('0x11')]===_0x7231('0x10');var _0x2d5244=_0x55cb80[_0x7231('0x12')];var _0x4ae810=_0xb4b0e7?0x0:_0x243b98[_0x7231('0xf')];var _0x5bccf2=_0xb4b0e7?_0x55cb80[_0x7231('0x12')]:_0x243b98[_0x7231('0xf')]+_0x243b98[_0x7231('0x11')];var _0x16ecc1;if(_0x5bccf2>=_0x2d5244){_0x5bccf2=_0x2d5244;_0x16ecc1=0xc8;}else{_0x16ecc1=0xce;}_0x17a3c7['status'](_0x16ecc1);return _0x17a3c7[_0x7231('0x13')](_0x7231('0x14'),_0x4ae810+'-'+_0x5bccf2+'/'+_0x2d5244)[_0x7231('0xe')](_0x55cb80);}return null;};}function saveUpdates(_0x11c337){return function(_0x2b334a){if(_0x2b334a){return _0x2b334a[_0x7231('0x15')](_0x11c337)['then'](function(_0x518775){return _0x518775;});}return null;};}function removeEntity(_0x5da8aa){return function(_0x4b7327){if(_0x4b7327){return _0x4b7327[_0x7231('0x16')]()[_0x7231('0x17')](function(){_0x5da8aa[_0x7231('0xc')](0xcc)[_0x7231('0xd')]();});}};}function handleEntityNotFound(_0x4799c6){return function(_0x5691b0){if(!_0x5691b0){_0x4799c6['sendStatus'](0x194);}return _0x5691b0;};}function handleError(_0x4ed1bc,_0x482c5c){_0x482c5c=_0x482c5c||0x1f4;return function(_0x144d01){logger[_0x7231('0x18')](_0x144d01[_0x7231('0x19')]);if(_0x144d01['name']){delete _0x144d01[_0x7231('0x1a')];}_0x4ed1bc[_0x7231('0xc')](_0x482c5c)[_0x7231('0x1b')](_0x144d01);};}function maskClientSecret(_0x8c7853){return _[_0x7231('0x1c')](_0x8c7853[_0x7231('0x1d')](0x0,0x3),0x14,'*');}exports[_0x7231('0x1e')]=function(_0x1082df,_0x2799ce){var _0x1ae204={},_0x21dd1d={},_0x342032={'count':0x0,'rows':[]};var _0x1d9116=_[_0x7231('0x1f')](db[_0x7231('0x20')][_0x7231('0x21')],function(_0x47ab1b){return{'name':_0x47ab1b[_0x7231('0x22')],'type':_0x47ab1b[_0x7231('0x23')][_0x7231('0x24')]};});_0x21dd1d[_0x7231('0x25')]=_['map'](_0x1d9116,_0x7231('0x1a'));_0x21dd1d[_0x7231('0x26')]=_['keys'](_0x1082df['query']);_0x21dd1d[_0x7231('0x27')]=_[_0x7231('0x28')](_0x21dd1d[_0x7231('0x25')],_0x21dd1d[_0x7231('0x26')]);_0x1ae204[_0x7231('0x29')]=_['intersection'](_0x21dd1d[_0x7231('0x25')],qs[_0x7231('0x2a')](_0x1082df[_0x7231('0x26')]['fields']));_0x1ae204['attributes']=_0x1ae204[_0x7231('0x29')][_0x7231('0x2b')]?_0x1ae204[_0x7231('0x29')]:_0x21dd1d[_0x7231('0x25')];if(!_0x1082df[_0x7231('0x26')]['hasOwnProperty'](_0x7231('0x2c'))){_0x1ae204[_0x7231('0x11')]=qs[_0x7231('0x11')](_0x1082df[_0x7231('0x26')][_0x7231('0x11')]);_0x1ae204[_0x7231('0xf')]=qs[_0x7231('0xf')](_0x1082df[_0x7231('0x26')][_0x7231('0xf')]);}_0x1ae204[_0x7231('0x2d')]=qs[_0x7231('0x2e')](_0x1082df[_0x7231('0x26')][_0x7231('0x2e')]);_0x1ae204[_0x7231('0x2f')]=qs['filters'](_['pick'](_0x1082df[_0x7231('0x26')],_0x21dd1d['filters']),_0x1d9116);if(_0x1082df[_0x7231('0x26')][_0x7231('0x30')]){_0x1ae204[_0x7231('0x2f')]=_['merge'](_0x1ae204[_0x7231('0x2f')],{'$or':_[_0x7231('0x1f')](_0x1d9116,function(_0xbd9259){if(_0xbd9259[_0x7231('0x23')]!==_0x7231('0x31')){var _0x52570b={};_0x52570b[_0xbd9259[_0x7231('0x1a')]]={'$like':'%'+_0x1082df[_0x7231('0x26')][_0x7231('0x30')]+'%'};return _0x52570b;}})});}_0x1ae204=_[_0x7231('0x32')]({},_0x1ae204,_0x1082df[_0x7231('0x33')]);var _0x925f85={'where':_0x1ae204[_0x7231('0x2f')]};return db[_0x7231('0x20')]['count'](_0x925f85)[_0x7231('0x17')](function(_0xb9f64){_0x342032['count']=_0xb9f64;if(_0x1082df[_0x7231('0x26')]['includeAll']){_0x1ae204[_0x7231('0x34')]=[{'all':!![]}];}return db[_0x7231('0x20')][_0x7231('0x35')](_0x1ae204);})[_0x7231('0x17')](function(_0x4ee66e){_0x342032[_0x7231('0x36')]=_[_0x7231('0x1f')](_0x4ee66e,function(_0xd34e37){if(_0xd34e37[_0x7231('0x37')]===_0x7231('0x38')){var _0x1ee97d=encryptor['decryptString'](_0xd34e37[_0x7231('0x39')]);_0xd34e37[_0x7231('0x39')]=maskClientSecret(_0x1ee97d);}return _0xd34e37;});return _0x342032;})[_0x7231('0x17')](respondWithFilteredResult(_0x2799ce,_0x1ae204))[_0x7231('0x3a')](handleError(_0x2799ce,null));};exports[_0x7231('0x3b')]=function(_0x19ed45,_0x7bf722){var _0x37614c={'raw':!![],'where':{'id':_0x19ed45[_0x7231('0x3c')]['id']}},_0x26835e={};_0x26835e[_0x7231('0x25')]=_[_0x7231('0x3d')](db['CloudProvider']['rawAttributes']);_0x26835e['query']=_['keys'](_0x19ed45['query']);_0x26835e[_0x7231('0x27')]=_[_0x7231('0x28')](_0x26835e[_0x7231('0x25')],_0x26835e[_0x7231('0x26')]);_0x37614c[_0x7231('0x29')]=_[_0x7231('0x28')](_0x26835e['model'],qs[_0x7231('0x2a')](_0x19ed45['query'][_0x7231('0x2a')]));_0x37614c[_0x7231('0x29')]=_0x37614c[_0x7231('0x29')][_0x7231('0x2b')]?_0x37614c[_0x7231('0x29')]:_0x26835e[_0x7231('0x25')];if(_0x19ed45['query'][_0x7231('0x3e')]){_0x37614c[_0x7231('0x34')]=[{'all':!![]}];}_0x37614c=_[_0x7231('0x32')]({},_0x37614c,_0x19ed45['options']);return db[_0x7231('0x20')][_0x7231('0x3f')](_0x37614c)[_0x7231('0x17')](handleEntityNotFound(_0x7bf722,null))['then'](function(_0x4d4ba3){if(_0x4d4ba3[_0x7231('0x37')]===_0x7231('0x38')){var _0x463723=encryptor[_0x7231('0x40')](_0x4d4ba3[_0x7231('0x39')]);_0x4d4ba3[_0x7231('0x39')]=maskClientSecret(_0x463723);}return _0x4d4ba3;})[_0x7231('0x17')](respondWithResult(_0x7bf722,null))['catch'](handleError(_0x7bf722,null));};exports['create']=function(_0x53924b,_0x45495f){if(!_0x53924b[_0x7231('0x41')][_0x7231('0x1a')])throw new Error(_0x7231('0x42'));if(!_0x53924b[_0x7231('0x41')][_0x7231('0x37')])throw new Error(_0x7231('0x43'));var _0x58c635=db[_0x7231('0x20')][_0x7231('0x21')][_0x7231('0x37')][_0x7231('0x44')];if(!_0x58c635[_0x7231('0x45')](_0x53924b[_0x7231('0x41')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x58c635['join'](',\x20'));if(_0x53924b[_0x7231('0x41')][_0x7231('0x37')]===_0x7231('0x38')&&_0x53924b[_0x7231('0x41')][_0x7231('0x39')]){_0x53924b[_0x7231('0x41')]['data3']=encryptor[_0x7231('0x46')](_0x53924b['body'][_0x7231('0x39')]);}return db['CloudProvider'][_0x7231('0x47')](_0x53924b[_0x7231('0x41')],{})[_0x7231('0x17')](respondWithResult(_0x45495f,0xc9))[_0x7231('0x3a')](handleError(_0x45495f,null));};exports['update']=function(_0x137130,_0x30025a){if(_0x137130[_0x7231('0x41')]['id']){delete _0x137130[_0x7231('0x41')]['id'];}return db[_0x7231('0x20')][_0x7231('0x3f')]({'where':{'id':_0x137130[_0x7231('0x3c')]['id']}})['then'](handleEntityNotFound(_0x30025a,null))['then'](function(_0x1b095c){if(_0x1b095c['service']===_0x7231('0x38')&&_0x137130[_0x7231('0x41')][_0x7231('0x39')]){_0x137130[_0x7231('0x41')][_0x7231('0x39')]=encryptor[_0x7231('0x46')](_0x137130['body'][_0x7231('0x39')]);}return _0x1b095c;})[_0x7231('0x17')](saveUpdates(_0x137130['body'],null))[_0x7231('0x17')](respondWithResult(_0x30025a,null))[_0x7231('0x3a')](handleError(_0x30025a,null));};exports['destroy']=function(_0x12b9fc,_0xddc985){return db[_0x7231('0x20')][_0x7231('0x3f')]({'where':{'id':_0x12b9fc['params']['id']}})[_0x7231('0x17')](handleEntityNotFound(_0xddc985,null))[_0x7231('0x17')](removeEntity(_0xddc985,null))[_0x7231('0x3a')](handleError(_0xddc985,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5e7f7e,_0x19c5c4){return db[_0x7231('0x20')]['findOne']({'where':{'id':_0x5e7f7e[_0x7231('0x3c')]['id']},'raw':!![]})[_0x7231('0x17')](function(_0x27c079){if(!_0x27c079)return _0x19c5c4[_0x7231('0xb')](0x194);return{'url':oauth[_0x7231('0x48')](_0x27c079,_0x5e7f7e['user']['id'])};})['then'](respondWithResult(_0x19c5c4,null))[_0x7231('0x3a')](handleError(_0x19c5c4,null));};exports[_0x7231('0x49')]=function(_0x507798,_0x17ea72){var _0x2d4db1=_0x507798['body'];var _0x148dd3;var _0xd5c60c;if(_0x2d4db1[_0x7231('0x18')])throw _0x2d4db1;redis[_0x7231('0x4a')](_0x2d4db1[_0x7231('0x4b')])['then'](function(_0x327503){if(!_0x327503)throw new Error(_0x7231('0x4c'));_0x148dd3=JSON[_0x7231('0x4d')](_0x327503);var _0x42388c=Buffer[_0x7231('0x4e')](_0x2d4db1[_0x7231('0x4b')],_0x7231('0x4f'))[_0x7231('0x50')](_0x7231('0x51'));_0xd5c60c=JSON[_0x7231('0x4d')](_0x42388c);if(!oauth[_0x7231('0x52')](_0x2d4db1[_0x7231('0x53')],_0x148dd3[_0x7231('0x54')]))throw new Error(_0x7231('0x55'));redis[_0x7231('0x56')](_0x2d4db1[_0x7231('0x4b')]);return oauth[_0x7231('0x57')](_0x2d4db1['code'],_0x148dd3);})['then'](function(_0x4e5fc1){_0x148dd3[_0x7231('0x58')]=_0x4e5fc1[_0x7231('0x59')];_0x148dd3[_0x7231('0x5a')]=_0x4e5fc1[_0x7231('0x5b')];return db[_0x7231('0x20')][_0x7231('0x15')]({'data5':_0x148dd3[_0x7231('0x58')],'data6':_0x148dd3['data6']},{'where':{'id':_0x148dd3['id']}});})[_0x7231('0x17')](function(){oauth['startRefreshInterval'](_0x148dd3);socket[_0x7231('0x5c')](_0x7231('0x5d'),{'id':_0xd5c60c['id']});return;})[_0x7231('0x17')](respondWithStatusCode(_0x17ea72,null))[_0x7231('0x3a')](function(_0x4e1082){if(_0xd5c60c){socket[_0x7231('0x5c')](_0x7231('0x5e'),{'id':_0xd5c60c['id']});}if(!_0x148dd3){logger[_0x7231('0x18')](_0x7231('0x5f'),_0x4e1082);return _0x17ea72[_0x7231('0xc')](0x1f4)[_0x7231('0x1b')](_0x4e1082[_0x7231('0x60')]);}logger[_0x7231('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x148dd3['id'],JSON[_0x7231('0x61')](_0x4e1082));});};
\ No newline at end of file
+var _0x586e=['index','map','CloudProvider','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','state','toString','ascii','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','then','end','name','send','padEnd','slice'];(function(_0x44dc86,_0x5d33da){var _0x22b4b7=function(_0x420804){while(--_0x420804){_0x44dc86['push'](_0x44dc86['shift']());}};_0x22b4b7(++_0x5d33da);}(_0x586e,0xa5));var _0xe586=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x586e[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0xe586('0x0'));var Redis=require(_0xe586('0x1'));var qs=require(_0xe586('0x2'));var encryptor=require(_0xe586('0x3'));var config=require(_0xe586('0x4'));var logger=require(_0xe586('0x5'))(_0xe586('0x6'));var db=require(_0xe586('0x7'))['db'];var oauth=require(_0xe586('0x8'));config['redis']=_[_0xe586('0x9')](config[_0xe586('0xa')],{'host':_0xe586('0xb'),'port':0x18eb});var socket=require(_0xe586('0xc'))(new Redis(config[_0xe586('0xa')]));var redis=new Redis(config[_0xe586('0xa')]);function respondWithStatusCode(_0x49bc22,_0x46d5bd){_0x46d5bd=_0x46d5bd||0xcc;return function(_0x13576c){if(_0x13576c){return _0x49bc22[_0xe586('0xd')](_0x46d5bd);}return _0x49bc22[_0xe586('0xe')](_0x46d5bd)['end']();};}function respondWithResult(_0x3d449f,_0x4c4125){_0x4c4125=_0x4c4125||0xc8;return function(_0xcb0cc5){if(_0xcb0cc5){return _0x3d449f[_0xe586('0xe')](_0x4c4125)['json'](_0xcb0cc5);}};}function respondWithFilteredResult(_0x36e265,_0x50de8c){return function(_0x4f530f){if(_0x4f530f){var _0x3705c4=typeof _0x50de8c[_0xe586('0xf')]==='undefined'&&typeof _0x50de8c['limit']===_0xe586('0x10');var _0x3e8b5a=_0x4f530f[_0xe586('0x11')];var _0x1651e8=_0x3705c4?0x0:_0x50de8c['offset'];var _0x10e2b5=_0x3705c4?_0x4f530f[_0xe586('0x11')]:_0x50de8c['offset']+_0x50de8c[_0xe586('0x12')];var _0x4afa74;if(_0x10e2b5>=_0x3e8b5a){_0x10e2b5=_0x3e8b5a;_0x4afa74=0xc8;}else{_0x4afa74=0xce;}_0x36e265[_0xe586('0xe')](_0x4afa74);return _0x36e265[_0xe586('0x13')](_0xe586('0x14'),_0x1651e8+'-'+_0x10e2b5+'/'+_0x3e8b5a)[_0xe586('0x15')](_0x4f530f);}return null;};}function saveUpdates(_0x748f3){return function(_0x28c2cd){if(_0x28c2cd){return _0x28c2cd[_0xe586('0x16')](_0x748f3)['then'](function(_0xa557c2){return _0xa557c2;});}return null;};}function removeEntity(_0x4a401c){return function(_0x340471){if(_0x340471){return _0x340471['destroy']()[_0xe586('0x17')](function(){_0x4a401c[_0xe586('0xe')](0xcc)[_0xe586('0x18')]();});}};}function handleEntityNotFound(_0x8782c3){return function(_0x4114dc){if(!_0x4114dc){_0x8782c3['sendStatus'](0x194);}return _0x4114dc;};}function handleError(_0x497df1,_0x1ed1b8){_0x1ed1b8=_0x1ed1b8||0x1f4;return function(_0x1ba2cc){logger['error'](_0x1ba2cc['stack']);if(_0x1ba2cc[_0xe586('0x19')]){delete _0x1ba2cc[_0xe586('0x19')];}_0x497df1[_0xe586('0xe')](_0x1ed1b8)[_0xe586('0x1a')](_0x1ba2cc);};}function maskClientSecret(_0x111a77){return _[_0xe586('0x1b')](_0x111a77[_0xe586('0x1c')](0x0,0x3),0x14,'*');}exports[_0xe586('0x1d')]=function(_0x54d164,_0x4df6c8){var _0x5590f3={},_0x50f9be={},_0x254e38={'count':0x0,'rows':[]};var _0x250de9=_[_0xe586('0x1e')](db[_0xe586('0x1f')][_0xe586('0x20')],function(_0x5d7463){return{'name':_0x5d7463[_0xe586('0x21')],'type':_0x5d7463[_0xe586('0x22')][_0xe586('0x23')]};});_0x50f9be['model']=_[_0xe586('0x1e')](_0x250de9,_0xe586('0x19'));_0x50f9be['query']=_[_0xe586('0x24')](_0x54d164[_0xe586('0x25')]);_0x50f9be[_0xe586('0x26')]=_[_0xe586('0x27')](_0x50f9be[_0xe586('0x28')],_0x50f9be[_0xe586('0x25')]);_0x5590f3[_0xe586('0x29')]=_[_0xe586('0x27')](_0x50f9be['model'],qs[_0xe586('0x2a')](_0x54d164[_0xe586('0x25')]['fields']));_0x5590f3[_0xe586('0x29')]=_0x5590f3['attributes'][_0xe586('0x2b')]?_0x5590f3[_0xe586('0x29')]:_0x50f9be[_0xe586('0x28')];if(!_0x54d164[_0xe586('0x25')][_0xe586('0x2c')]('nolimit')){_0x5590f3[_0xe586('0x12')]=qs[_0xe586('0x12')](_0x54d164[_0xe586('0x25')][_0xe586('0x12')]);_0x5590f3[_0xe586('0xf')]=qs[_0xe586('0xf')](_0x54d164[_0xe586('0x25')]['offset']);}_0x5590f3['order']=qs['sort'](_0x54d164[_0xe586('0x25')]['sort']);_0x5590f3[_0xe586('0x2d')]=qs['filters'](_[_0xe586('0x2e')](_0x54d164['query'],_0x50f9be[_0xe586('0x26')]),_0x250de9);if(_0x54d164[_0xe586('0x25')][_0xe586('0x2f')]){_0x5590f3[_0xe586('0x2d')]=_['merge'](_0x5590f3[_0xe586('0x2d')],{'$or':_[_0xe586('0x1e')](_0x250de9,function(_0x4651b3){if(_0x4651b3['type']!=='VIRTUAL'){var _0x9b38fa={};_0x9b38fa[_0x4651b3[_0xe586('0x19')]]={'$like':'%'+_0x54d164[_0xe586('0x25')][_0xe586('0x2f')]+'%'};return _0x9b38fa;}})});}_0x5590f3=_[_0xe586('0x30')]({},_0x5590f3,_0x54d164[_0xe586('0x31')]);var _0x338baa={'where':_0x5590f3[_0xe586('0x2d')]};return db[_0xe586('0x1f')][_0xe586('0x11')](_0x338baa)['then'](function(_0x3b1d5f){_0x254e38['count']=_0x3b1d5f;if(_0x54d164[_0xe586('0x25')][_0xe586('0x32')]){_0x5590f3[_0xe586('0x33')]=[{'all':!![]}];}return db[_0xe586('0x1f')]['findAll'](_0x5590f3);})[_0xe586('0x17')](function(_0x4a4cd4){_0x254e38[_0xe586('0x34')]=_[_0xe586('0x1e')](_0x4a4cd4,function(_0x27bc47){if(_0x27bc47[_0xe586('0x35')]===_0xe586('0x36')){var _0x1f0a54=encryptor[_0xe586('0x37')](_0x27bc47[_0xe586('0x38')]);_0x27bc47[_0xe586('0x38')]=maskClientSecret(_0x1f0a54);}return _0x27bc47;});return _0x254e38;})['then'](respondWithFilteredResult(_0x4df6c8,_0x5590f3))[_0xe586('0x39')](handleError(_0x4df6c8,null));};exports['show']=function(_0x173365,_0x5eb080){var _0x44cead={'raw':!![],'where':{'id':_0x173365['params']['id']}},_0x30c3c5={};_0x30c3c5['model']=_['keys'](db[_0xe586('0x1f')][_0xe586('0x20')]);_0x30c3c5['query']=_[_0xe586('0x24')](_0x173365['query']);_0x30c3c5[_0xe586('0x26')]=_[_0xe586('0x27')](_0x30c3c5[_0xe586('0x28')],_0x30c3c5[_0xe586('0x25')]);_0x44cead[_0xe586('0x29')]=_[_0xe586('0x27')](_0x30c3c5[_0xe586('0x28')],qs[_0xe586('0x2a')](_0x173365['query'][_0xe586('0x2a')]));_0x44cead['attributes']=_0x44cead[_0xe586('0x29')][_0xe586('0x2b')]?_0x44cead[_0xe586('0x29')]:_0x30c3c5[_0xe586('0x28')];if(_0x173365['query'][_0xe586('0x32')]){_0x44cead['include']=[{'all':!![]}];}_0x44cead=_[_0xe586('0x30')]({},_0x44cead,_0x173365[_0xe586('0x31')]);return db[_0xe586('0x1f')][_0xe586('0x3a')](_0x44cead)[_0xe586('0x17')](handleEntityNotFound(_0x5eb080,null))[_0xe586('0x17')](function(_0x55a27d){if(_0x55a27d[_0xe586('0x35')]==='MicrosoftAzure'){var _0x4999ba=encryptor[_0xe586('0x37')](_0x55a27d[_0xe586('0x38')]);_0x55a27d[_0xe586('0x38')]=maskClientSecret(_0x4999ba);}return _0x55a27d;})[_0xe586('0x17')](respondWithResult(_0x5eb080,null))[_0xe586('0x39')](handleError(_0x5eb080,null));};exports[_0xe586('0x3b')]=function(_0x332c3f,_0x1c172a){if(!_0x332c3f[_0xe586('0x3c')][_0xe586('0x19')])throw new Error(_0xe586('0x3d'));if(!_0x332c3f['body'][_0xe586('0x35')])throw new Error(_0xe586('0x3e'));var _0x581f74=db[_0xe586('0x1f')][_0xe586('0x20')][_0xe586('0x35')][_0xe586('0x3f')];if(!_0x581f74[_0xe586('0x40')](_0x332c3f[_0xe586('0x3c')][_0xe586('0x35')]))throw new Error(_0xe586('0x41')+_0x581f74[_0xe586('0x42')](',\x20'));if(_0x332c3f[_0xe586('0x3c')]['service']==='MicrosoftAzure'&&_0x332c3f[_0xe586('0x3c')][_0xe586('0x38')]){_0x332c3f[_0xe586('0x3c')]['data3']=encryptor[_0xe586('0x43')](_0x332c3f[_0xe586('0x3c')][_0xe586('0x38')]);}return db[_0xe586('0x1f')]['create'](_0x332c3f[_0xe586('0x3c')],{})[_0xe586('0x17')](respondWithResult(_0x1c172a,0xc9))['catch'](handleError(_0x1c172a,null));};exports[_0xe586('0x16')]=function(_0x5afe38,_0x3a8658){if(_0x5afe38[_0xe586('0x3c')]['id']){delete _0x5afe38['body']['id'];}return db[_0xe586('0x1f')][_0xe586('0x3a')]({'where':{'id':_0x5afe38[_0xe586('0x44')]['id']}})[_0xe586('0x17')](handleEntityNotFound(_0x3a8658,null))[_0xe586('0x17')](function(_0x4f8738){if(_0x4f8738['service']==='MicrosoftAzure'&&_0x5afe38[_0xe586('0x3c')][_0xe586('0x38')]){_0x5afe38[_0xe586('0x3c')][_0xe586('0x38')]=encryptor['encryptString'](_0x5afe38['body']['data3']);}return _0x4f8738;})['then'](saveUpdates(_0x5afe38['body'],null))[_0xe586('0x17')](respondWithResult(_0x3a8658,null))[_0xe586('0x39')](handleError(_0x3a8658,null));};exports[_0xe586('0x45')]=function(_0x137e0e,_0x1547bc){return db[_0xe586('0x1f')][_0xe586('0x3a')]({'where':{'id':_0x137e0e[_0xe586('0x44')]['id']}})[_0xe586('0x17')](handleEntityNotFound(_0x1547bc,null))[_0xe586('0x17')](removeEntity(_0x1547bc,null))[_0xe586('0x39')](handleError(_0x1547bc,null));};exports[_0xe586('0x46')]=function(_0xd9652e,_0x2740e8){return db[_0xe586('0x1f')]['findOne']({'where':{'id':_0xd9652e[_0xe586('0x44')]['id']},'raw':!![]})['then'](function(_0x563f91){if(!_0x563f91)return _0x2740e8[_0xe586('0xd')](0x194);return{'url':oauth[_0xe586('0x47')](_0x563f91,_0xd9652e[_0xe586('0x48')]['id'])};})[_0xe586('0x17')](respondWithResult(_0x2740e8,null))[_0xe586('0x39')](handleError(_0x2740e8,null));};exports[_0xe586('0x49')]=function(_0x189e2c,_0x2d0965){var _0x46a805=_0x189e2c[_0xe586('0x3c')];var _0x4c23ce;var _0x4c557f;if(_0x46a805['error'])throw _0x46a805;redis['get'](_0x46a805['state'])[_0xe586('0x17')](function(_0xa8bb7a){if(!_0xa8bb7a)throw new Error(_0xe586('0x4a'));_0x4c23ce=JSON[_0xe586('0x4b')](_0xa8bb7a);var _0x52ae30=Buffer['from'](_0x46a805[_0xe586('0x4c')],'base64')[_0xe586('0x4d')](_0xe586('0x4e'));_0x4c557f=JSON['parse'](_0x52ae30);if(!oauth[_0xe586('0x4f')](_0x46a805[_0xe586('0x50')],_0x4c23ce['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xe586('0x51')](_0x46a805['state']);return oauth[_0xe586('0x52')](_0x46a805[_0xe586('0x53')],_0x4c23ce);})[_0xe586('0x17')](function(_0x2de782){_0x4c23ce[_0xe586('0x54')]=_0x2de782[_0xe586('0x55')];_0x4c23ce['data6']=_0x2de782[_0xe586('0x56')];return db[_0xe586('0x1f')][_0xe586('0x16')]({'data5':_0x4c23ce[_0xe586('0x54')],'data6':_0x4c23ce[_0xe586('0x57')]},{'where':{'id':_0x4c23ce['id']}});})[_0xe586('0x17')](function(){oauth[_0xe586('0x58')](_0x4c23ce);socket[_0xe586('0x59')](_0xe586('0x5a'),{'id':_0x4c557f['id']});return;})[_0xe586('0x17')](respondWithStatusCode(_0x2d0965,null))[_0xe586('0x39')](function(_0x49897e){if(_0x4c557f){socket[_0xe586('0x59')](_0xe586('0x5b'),{'id':_0x4c557f['id']});}if(!_0x4c23ce){logger[_0xe586('0x5c')](_0xe586('0x5d'),_0x49897e);return _0x2d0965[_0xe586('0xe')](0x1f4)[_0xe586('0x1a')](_0x49897e[_0xe586('0x5e')]);}logger['error'](_0xe586('0x5f'),_0x4c23ce['id'],JSON[_0xe586('0x60')](_0x49897e));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7521094..a24e894 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 _0x784c=['../../config/environment','./cloudProvider.attributes','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x338891,_0x397a05){var _0x4410e5=function(_0x5469ea){while(--_0x5469ea){_0x338891['push'](_0x338891['shift']());}};_0x4410e5(++_0x397a05);}(_0x784c,0x1bb));var _0xc784=function(_0x53ebee,_0x4d7e07){_0x53ebee=_0x53ebee-0x0;var _0x149fe1=_0x784c[_0x53ebee];return _0x149fe1;};'use strict';var _=require(_0xc784('0x0'));var util=require(_0xc784('0x1'));var logger=require('../../config/logger')(_0xc784('0x2'));var moment=require(_0xc784('0x3'));var BPromise=require(_0xc784('0x4'));var rp=require(_0xc784('0x5'));var fs=require('fs');var path=require(_0xc784('0x6'));var rimraf=require(_0xc784('0x7'));var config=require(_0xc784('0x8'));var attributes=require(_0xc784('0x9'));module['exports']=function(_0x48fa7e,_0x3d6da2){return _0x48fa7e[_0xc784('0xa')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6ed=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x4e97df,_0x38deba){var _0x2f132e=function(_0x1fb46f){while(--_0x1fb46f){_0x4e97df['push'](_0x4e97df['shift']());}};_0x2f132e(++_0x38deba);}(_0xc6ed,0x161));var _0xdc6e=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc6ed[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xdc6e('0x0'));var util=require(_0xdc6e('0x1'));var logger=require(_0xdc6e('0x2'))(_0xdc6e('0x3'));var moment=require('moment');var BPromise=require(_0xdc6e('0x4'));var rp=require(_0xdc6e('0x5'));var fs=require('fs');var path=require(_0xdc6e('0x6'));var rimraf=require('rimraf');var config=require(_0xdc6e('0x7'));var attributes=require(_0xdc6e('0x8'));module[_0xdc6e('0x9')]=function(_0x307def,_0x49ae37){return _0x307def[_0xdc6e('0xa')](_0xdc6e('0xb'),attributes,{'tableName':_0xdc6e('0xc'),'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 a33ecd9..1fae493 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 _0x9992=['findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','join','Outlook365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','client_id','response_type','response_mode','state','prompt','key','value','oauth2/','data1','stringify','decode','payload','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data3','access_token','update','data5','catch','error','authorization_code','POST','bind','intervals'];(function(_0xf74a9f,_0x483e3b){var _0x53b807=function(_0x6f8aec){while(--_0x6f8aec){_0xf74a9f['push'](_0xf74a9f['shift']());}};_0x53b807(++_0x483e3b);}(_0x9992,0x1c1));var _0x2999=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x9992[_0x36909d];return _0x1fd29d;};'use strict';var _=require(_0x2999('0x0'));var crypto=require(_0x2999('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x2999('0x2'));var Redis=require('ioredis');var rp=require(_0x2999('0x3'));var util=require(_0x2999('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0x2999('0x5'));var logger=require(_0x2999('0x6'))(_0x2999('0x7'));var schedule=require(_0x2999('0x8'));var db=require(_0x2999('0x9'))['db'];config['redis']=_[_0x2999('0xa')](config[_0x2999('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x2999('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x2999('0xc'),'email',_0x2999('0xd'),_0x2999('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0x2999('0xf')],'Dynamics365':[_0x2999('0x10'),_0x2999('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x2999('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3b0b20){var _0x1c4829=_[_0x2999('0x12')](AZURE_AUTH_SCOPES[_0x3b0b20['type']]);if(_0x3b0b20[_0x2999('0x13')]==='Dynamics365')_0x1c4829['push'](_0x3b0b20['data7']+'/.default');return _0x1c4829[_0x2999('0x14')]('\x20');}function getAccessTokenScope(_0x25d7d4){if(_0x25d7d4[_0x2999('0x13')]===_0x2999('0x15'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x25d7d4[_0x2999('0x13')]==='Dynamics365')return _0x25d7d4[_0x2999('0x16')]+_0x2999('0x17');}function generateMicrosoftAuthorizationUrl(_0x13846a,_0x4970c9){var _0x3845c1=MICROSOFT_AUTH_URL[_0x2999('0x18')](_0x2999('0x19'),_0x13846a[_0x2999('0x1a')]);var _0x22f9c1=[_0x2999('0x1b'),_0x2999('0x1c')];var _0x5d1059=Buffer[_0x2999('0x1d')](JSON['stringify']({'id':_0x4970c9}))[_0x2999('0x1e')](_0x2999('0x1f'));var _0x43917b=crypto['randomBytes'](0x10)[_0x2999('0x1e')]('hex');var _0x51f2c2=getAuthorizationScopes(_0x13846a);var _0x2b1214=[{'key':_0x2999('0x20'),'value':_0x13846a['data1']},{'key':_0x2999('0x21'),'value':encodeURIComponent(_0x22f9c1[_0x2999('0x14')]('\x20'))},{'key':'redirect_uri','value':_0x13846a['data4']},{'key':_0x2999('0x22'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x51f2c2)},{'key':_0x2999('0x23'),'value':_0x5d1059},{'key':'nonce','value':_0x43917b},{'key':_0x2999('0x24'),'value':'login'}];var _0xfc1fe8=_0x3845c1+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2b1214,function(_0x54733a){return _0x54733a[_0x2999('0x25')]+'='+_0x54733a[_0x2999('0x26')];})[_0x2999('0x14')]('&');_0x13846a['oauth2Claims']={'issuer':_0x3845c1[_0x2999('0x18')](_0x2999('0x27'),''),'audience':_0x13846a[_0x2999('0x28')],'state':_0x5d1059,'nonce':_0x43917b};redis['set'](_0x5d1059,JSON[_0x2999('0x29')](_0x13846a));return _0xfc1fe8;}function isValidIdToken(_0x361d54,_0x476040){try{var _0x249fbd=jwt[_0x2999('0x2a')](_0x361d54,{'complete':!![]});var _0x50a7bc=_0x249fbd[_0x2999('0x2b')];if(_0x50a7bc['iss']!==_0x476040[_0x2999('0x2c')])return![];if(_0x50a7bc[_0x2999('0x2d')]!==_0x476040[_0x2999('0x2e')])return![];if(_0x50a7bc['nonce']!==_0x476040[_0x2999('0x2f')])return![];if(moment()[_0x2999('0x30')](moment[_0x2999('0x31')](_0x50a7bc[_0x2999('0x32')])))return![];return!![];}catch(_0x5d8437){throw _0x5d8437;}}function refreshOauth2MicrosoftAccessToken(_0x5da605){return Promise[_0x2999('0x33')]()[_0x2999('0x34')](function(){if(_0x5da605['data3'])return _0x5da605;return db[_0x2999('0x35')][_0x2999('0x36')]({'where':{'id':_0x5da605['id']},'raw':!![]});})['then'](function(_0x1c1acd){var _0x55fcd8={'grant_type':_0x2999('0x37'),'refresh_token':_0x1c1acd[_0x2999('0x38')],'scope':getAccessTokenScope(_0x1c1acd),'redirect_uri':_0x1c1acd[_0x2999('0x39')],'client_id':_0x1c1acd[_0x2999('0x28')],'client_secret':encryptor[_0x2999('0x3a')](_0x1c1acd[_0x2999('0x3b')])};var _0x2e5902={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x1c1acd['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55fcd8,'json':!![]};return rp(_0x2e5902);})[_0x2999('0x34')](function(_0x31d4a7){_0x5da605['data5']=_0x31d4a7[_0x2999('0x3c')];_0x5da605['data6']=_0x31d4a7['refresh_token'];return db[_0x2999('0x35')][_0x2999('0x3d')]({'data5':_0x5da605[_0x2999('0x3e')],'data6':_0x5da605[_0x2999('0x38')]},{'where':{'id':_0x5da605['id']}});})[_0x2999('0x34')](function(){return _0x5da605;})[_0x2999('0x3f')](function(_0x31ce9d){logger[_0x2999('0x40')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5da605['id'],_0x31ce9d);});}function getOauth2MicrosoftAccessToken(_0x367183,_0x10439a){var _0x4656a5={'grant_type':_0x2999('0x41'),'code':_0x367183,'scope':getAccessTokenScope(_0x10439a),'redirect_uri':_0x10439a[_0x2999('0x39')],'client_id':_0x10439a[_0x2999('0x28')],'client_secret':encryptor['decryptString'](_0x10439a[_0x2999('0x3b')])};var _0x57fa32={'method':_0x2999('0x42'),'uri':MICROSOFT_AUTH_URL[_0x2999('0x18')](_0x2999('0x19'),_0x10439a[_0x2999('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4656a5,'json':!![]};return rp(_0x57fa32);}function startRefreshInterval(_0x7222ec){var _0x1198e8=schedule['intervals'];if(_0x1198e8[_0x7222ec['id']])clearInterval(_0x1198e8[_0x7222ec['id']]);_0x1198e8[_0x7222ec['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2999('0x43')](this,{'id':_0x7222ec['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2999('0x44')]=_0x1198e8;}function startAllRefreshIntervals(){return db[_0x2999('0x35')][_0x2999('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4983b7){var _0x575a08=_0x4983b7[_0x2999('0x12')](function(_0x31d555){return refreshOauth2MicrosoftAccessToken(_0x31d555)[_0x2999('0x34')](function(_0x275250){startRefreshInterval(_0x275250);});});return Promise[_0x2999('0x46')](_0x575a08);})[_0x2999('0x3f')](function(_0x3169b8){var _0x362374=_0x3169b8?util[_0x2999('0x47')](_0x3169b8,{'showHidden':![],'depth':null}):'';logger[_0x2999('0x40')](_0x2999('0x48'),_0x362374);});}module[_0x2999('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1542=['../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','push','data7','/.default','Outlook365','Dynamics365','data2','code','id_token','from','stringify','base64','randomBytes','toString','data1','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','isAfter','unix','then','data3','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','replace','intervals','bind','map','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','ioredis','request-promise','util','../../components/encryptor'];(function(_0x49ec8d,_0x4804a9){var _0x1d6db3=function(_0x18b3a5){while(--_0x18b3a5){_0x49ec8d['push'](_0x49ec8d['shift']());}};_0x1d6db3(++_0x4804a9);}(_0x1542,0x92));var _0x2154=function(_0x3feb60,_0x2f532d){_0x3feb60=_0x3feb60-0x0;var _0x5d69b9=_0x1542[_0x3feb60];return _0x5d69b9;};'use strict';var _=require(_0x2154('0x0'));var crypto=require(_0x2154('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x2154('0x2'));var rp=require(_0x2154('0x3'));var util=require(_0x2154('0x4'));var encryptor=require(_0x2154('0x5'));var config=require(_0x2154('0x6'));var logger=require(_0x2154('0x7'))(_0x2154('0x8'));var schedule=require(_0x2154('0x9'));var db=require(_0x2154('0xa'))['db'];config[_0x2154('0xb')]=_['defaults'](config[_0x2154('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x2154('0xb')]);var MICROSOFT_AUTH_URL=_0x2154('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2154('0xd'),'profile','email',_0x2154('0xe'),_0x2154('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0x2154('0x10')],'Dynamics365':['openid',_0x2154('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x2154('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x2154('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x27e050){var _0x45e802=_['map'](AZURE_AUTH_SCOPES[_0x27e050[_0x2154('0x13')]]);if(_0x27e050[_0x2154('0x13')]==='Dynamics365')_0x45e802[_0x2154('0x14')](_0x27e050[_0x2154('0x15')]+_0x2154('0x16'));return _0x45e802['join']('\x20');}function getAccessTokenScope(_0x47f4d2){if(_0x47f4d2['type']===_0x2154('0x17'))return _0x2154('0xf');if(_0x47f4d2[_0x2154('0x13')]===_0x2154('0x18'))return _0x47f4d2[_0x2154('0x15')]+_0x2154('0x16');}function generateMicrosoftAuthorizationUrl(_0x3123b2,_0xe19dc8){var _0x3eea36=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3123b2[_0x2154('0x19')]);var _0x795a94=[_0x2154('0x1a'),_0x2154('0x1b')];var _0x20a04b=Buffer[_0x2154('0x1c')](JSON[_0x2154('0x1d')]({'id':_0xe19dc8}))['toString'](_0x2154('0x1e'));var _0x141ba0=crypto[_0x2154('0x1f')](0x10)[_0x2154('0x20')]('hex');var _0x58d16a=getAuthorizationScopes(_0x3123b2);var _0x3dee0a=[{'key':'client_id','value':_0x3123b2[_0x2154('0x21')]},{'key':'response_type','value':encodeURIComponent(_0x795a94[_0x2154('0x22')]('\x20'))},{'key':_0x2154('0x23'),'value':_0x3123b2[_0x2154('0x24')]},{'key':_0x2154('0x25'),'value':_0x2154('0x26')},{'key':_0x2154('0x27'),'value':encodeURIComponent(_0x58d16a)},{'key':'state','value':_0x20a04b},{'key':_0x2154('0x28'),'value':_0x141ba0},{'key':_0x2154('0x29'),'value':_0x2154('0x2a')}];var _0xf367b5=_0x3eea36+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x3dee0a,function(_0x5ba770){return _0x5ba770[_0x2154('0x2b')]+'='+_0x5ba770[_0x2154('0x2c')];})['join']('&');_0x3123b2[_0x2154('0x2d')]={'issuer':_0x3eea36['replace'](_0x2154('0x2e'),''),'audience':_0x3123b2[_0x2154('0x21')],'state':_0x20a04b,'nonce':_0x141ba0};redis['set'](_0x20a04b,JSON[_0x2154('0x1d')](_0x3123b2));return _0xf367b5;}function isValidIdToken(_0x3eae87,_0x356500){try{var _0x2c5f5b=jwt[_0x2154('0x2f')](_0x3eae87,{'complete':!![]});var _0x451a72=_0x2c5f5b[_0x2154('0x30')];if(_0x451a72[_0x2154('0x31')]!==_0x356500[_0x2154('0x32')])return![];if(_0x451a72[_0x2154('0x33')]!==_0x356500['audience'])return![];if(_0x451a72[_0x2154('0x28')]!==_0x356500['nonce'])return![];if(moment()[_0x2154('0x34')](moment[_0x2154('0x35')](_0x451a72['exp'])))return![];return!![];}catch(_0x32b66a){throw _0x32b66a;}}function refreshOauth2MicrosoftAccessToken(_0x213f24){return Promise['resolve']()[_0x2154('0x36')](function(){if(_0x213f24[_0x2154('0x37')])return _0x213f24;return db['CloudProvider'][_0x2154('0x38')]({'where':{'id':_0x213f24['id']},'raw':!![]});})['then'](function(_0x2c8d37){var _0x17e4bd={'grant_type':_0x2154('0x39'),'refresh_token':_0x2c8d37[_0x2154('0x3a')],'scope':getAccessTokenScope(_0x2c8d37),'redirect_uri':_0x2c8d37[_0x2154('0x24')],'client_id':_0x2c8d37[_0x2154('0x21')],'client_secret':encryptor[_0x2154('0x3b')](_0x2c8d37[_0x2154('0x37')])};var _0x358cb5={'method':_0x2154('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0x2154('0x3d'),_0x2c8d37[_0x2154('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x17e4bd,'json':!![]};return rp(_0x358cb5);})[_0x2154('0x36')](function(_0x7ecb24){_0x213f24[_0x2154('0x3e')]=_0x7ecb24[_0x2154('0x3f')];_0x213f24['data6']=_0x7ecb24[_0x2154('0x39')];return db['CloudProvider'][_0x2154('0x40')]({'data5':_0x213f24['data5'],'data6':_0x213f24[_0x2154('0x3a')]},{'where':{'id':_0x213f24['id']}});})[_0x2154('0x36')](function(){return _0x213f24;})[_0x2154('0x41')](function(_0x446cdc){logger['error'](_0x2154('0x42'),_0x213f24['id'],_0x446cdc);});}function getOauth2MicrosoftAccessToken(_0x422bd8,_0x4ae370){var _0x227c26={'grant_type':'authorization_code','code':_0x422bd8,'scope':getAccessTokenScope(_0x4ae370),'redirect_uri':_0x4ae370[_0x2154('0x24')],'client_id':_0x4ae370[_0x2154('0x21')],'client_secret':encryptor['decryptString'](_0x4ae370['data3'])};var _0x1a9a7d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x2154('0x43')](_0x2154('0x3d'),_0x4ae370[_0x2154('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x227c26,'json':!![]};return rp(_0x1a9a7d);}function startRefreshInterval(_0x188c45){var _0x21a661=schedule[_0x2154('0x44')];if(_0x21a661[_0x188c45['id']])clearInterval(_0x21a661[_0x188c45['id']]);_0x21a661[_0x188c45['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2154('0x45')](this,{'id':_0x188c45['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x21a661;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2154('0x36')](function(_0x198bb1){var _0x2f8ee1=_0x198bb1[_0x2154('0x46')](function(_0x28bf8b){return refreshOauth2MicrosoftAccessToken(_0x28bf8b)['then'](function(_0x4439cb){startRefreshInterval(_0x4439cb);});});return Promise[_0x2154('0x47')](_0x2f8ee1);})[_0x2154('0x41')](function(_0x21f5a4){var _0x1b943e=_0x21f5a4?util[_0x2154('0x48')](_0x21f5a4,{'showHidden':![],'depth':null}):'';logger[_0x2154('0x49')](_0x2154('0x4a'),_0x1b943e);});}module[_0x2154('0x4b')]={'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 61fe1e5..5398f82 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 _0xbca0=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd3b0ac,_0x2f5065){var _0x3d773e=function(_0x2e10d1){while(--_0x2e10d1){_0xd3b0ac['push'](_0xd3b0ac['shift']());}};_0x3d773e(++_0x2f5065);}(_0xbca0,0x8b));var _0x0bca=function(_0x406a19,_0xb75dd7){_0x406a19=_0x406a19-0x0;var _0x254870=_0xbca0[_0x406a19];return _0x254870;};'use strict';var _=require(_0x0bca('0x0'));var util=require(_0x0bca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bca('0x2'));var db=require(_0x0bca('0x3'))['db'];var utils=require(_0x0bca('0x4'));var logger=require(_0x0bca('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0bca('0x6'));var client=jayson[_0x0bca('0x7')][_0x0bca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x454627,_0x4dcba6,_0x48260c){return new BPromise(function(_0x55fbf0,_0x241ca5){return client[_0x0bca('0x9')](_0x454627,_0x48260c)[_0x0bca('0xa')](function(_0x206194){logger[_0x0bca('0xb')]('CloudProvider,\x20%s,\x20%s',_0x4dcba6,'request\x20sent');logger[_0x0bca('0xc')](_0x0bca('0xd'),_0x4dcba6,_0x0bca('0xe'),JSON[_0x0bca('0xf')](_0x206194));if(_0x206194[_0x0bca('0x10')]){if(_0x206194[_0x0bca('0x10')][_0x0bca('0x11')]===0x1f4){logger[_0x0bca('0x10')](_0x0bca('0x12'),_0x4dcba6,_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);return _0x241ca5(_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);}logger[_0x0bca('0x10')](_0x0bca('0x12'),_0x4dcba6,_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);return _0x55fbf0(_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);}else{logger['info'](_0x0bca('0x12'),_0x4dcba6,_0x0bca('0xe'));_0x55fbf0(_0x206194[_0x0bca('0x14')][_0x0bca('0x13')]);}})[_0x0bca('0x15')](function(_0x2ed970){logger[_0x0bca('0x10')]('CloudProvider,\x20%s,\x20%s',_0x4dcba6,_0x2ed970);_0x241ca5(_0x2ed970);});});}
\ No newline at end of file
+var _0xe056=['code','message','info','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x428d9a,_0x4e724d){var _0x50da90=function(_0x283946){while(--_0x283946){_0x428d9a['push'](_0x428d9a['shift']());}};_0x50da90(++_0x4e724d);}(_0xe056,0xdb));var _0x6e05=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xe056[_0x555069];return _0x100af7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e05('0x0'));var BPromise=require(_0x6e05('0x1'));var rs=require(_0x6e05('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e05('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e05('0x4'))(_0x6e05('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e05('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x390bb6,_0x1c78eb,_0x5dacb2){return new BPromise(function(_0x1a54b7,_0x177b2c){return client[_0x6e05('0x7')](_0x390bb6,_0x5dacb2)[_0x6e05('0x8')](function(_0x13af56){logger['info'](_0x6e05('0x9'),_0x1c78eb,_0x6e05('0xa'));logger[_0x6e05('0xb')](_0x6e05('0xc'),_0x1c78eb,_0x6e05('0xa'),JSON[_0x6e05('0xd')](_0x13af56));if(_0x13af56['error']){if(_0x13af56[_0x6e05('0xe')][_0x6e05('0xf')]===0x1f4){logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);return _0x177b2c(_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);}logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);return _0x1a54b7(_0x13af56['error']['message']);}else{logger[_0x6e05('0x11')](_0x6e05('0x9'),_0x1c78eb,_0x6e05('0xa'));_0x1a54b7(_0x13af56['result'][_0x6e05('0x10')]);}})['catch'](function(_0x3c3ef0){logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x3c3ef0);_0x177b2c(_0x3c3ef0);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5d5f5e4..deb08f4 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x3831dd,_0x47a03b){var _0x20f1f3=function(_0x1103fa){while(--_0x1103fa){_0x3831dd['push'](_0x3831dd['shift']());}};_0x20f1f3(++_0x47a03b);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d31d7,_0x257edd){_0x5d31d7=_0x5d31d7-0x0;var _0x25eecc=_0x2ef3[_0x5d31d7];return _0x25eecc;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x1261,0x144));var _0x1126=function(_0x2703cf,_0x526b31){_0x2703cf=_0x2703cf-0x0;var _0x28f18a=_0x1261[_0x2703cf];return _0x28f18a;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 851c767..3d5c217 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 _0x1e9c=['name','STRING','sequelize'];(function(_0x257d79,_0x2861ec){var _0x349ebc=function(_0x8e9bb3){while(--_0x8e9bb3){_0x257d79['push'](_0x257d79['shift']());}};_0x349ebc(++_0x2861ec);}(_0x1e9c,0xec));var _0xc1e9=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1e9c[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0xc1e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc1e9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc1e9('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc1e9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc1e9('0x2')]},'type':{'type':Sequelize[_0xc1e9('0x2')]},'street':{'type':Sequelize[_0xc1e9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc1e9('0x2')]},'country':{'type':Sequelize[_0xc1e9('0x2')]},'email':{'type':Sequelize[_0xc1e9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc1e9('0x2')]},'sStreet':{'type':Sequelize[_0xc1e9('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc1e9('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7b51=['name','sequelize','exports','STRING'];(function(_0x59c556,_0x3e3be8){var _0x53079b=function(_0x1e1fd3){while(--_0x1e1fd3){_0x59c556['push'](_0x59c556['shift']());}};_0x53079b(++_0x3e3be8);}(_0x7b51,0x1bd));var _0x17b5=function(_0x345e4c,_0x3e73ba){_0x345e4c=_0x345e4c-0x0;var _0x40c41c=_0x7b51[_0x345e4c];return _0x40c41c;};'use strict';var Sequelize=require(_0x17b5('0x0'));module[_0x17b5('0x1')]={'name':{'type':Sequelize[_0x17b5('0x2')],'unique':_0x17b5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x17b5('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x17b5('0x2')]},'fax':{'type':Sequelize[_0x17b5('0x2')]},'type':{'type':Sequelize[_0x17b5('0x2')]},'street':{'type':Sequelize[_0x17b5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x17b5('0x2')]},'country':{'type':Sequelize[_0x17b5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index dfff5b4..0391fd1 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 _0x354e=['name','send','index','CmCompany','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','filter','includeAll','findAll','catch','params','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','ids','omit','getContacts','CmContact','map','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x354e,0x80));var _0xe354=function(_0x3afa20,_0x555693){_0x3afa20=_0x3afa20-0x0;var _0x2b7f2c=_0x354e[_0x3afa20];return _0x2b7f2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe354('0x0'));var zipdir=require(_0xe354('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe354('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe354('0x3'));var util=require(_0xe354('0x4'));var path=require('path');var sox=require(_0xe354('0x5'));var csv=require('to-csv');var ejs=require(_0xe354('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe354('0x7'));var crypto=require(_0xe354('0x8'));var jsforce=require(_0xe354('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe354('0xa'));var querystring=require(_0xe354('0xb'));var Papa=require('papaparse');var Redis=require(_0xe354('0xc'));var authService=require(_0xe354('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe354('0xe'));var hardwareService=require(_0xe354('0xf'));var logger=require('../../config/logger')(_0xe354('0x10'));var utils=require('../../config/utils');var config=require(_0xe354('0x11'));var licenseUtil=require(_0xe354('0x12'));var db=require(_0xe354('0x13'))['db'];function respondWithStatusCode(_0x24bec2,_0x2ec843){_0x2ec843=_0x2ec843||0xcc;return function(_0xcb9ff){if(_0xcb9ff){return _0x24bec2['sendStatus'](_0x2ec843);}return _0x24bec2['status'](_0x2ec843)[_0xe354('0x14')]();};}function respondWithResult(_0x3359bd,_0x1c0787){_0x1c0787=_0x1c0787||0xc8;return function(_0x514f44){if(_0x514f44){return _0x3359bd[_0xe354('0x15')](_0x1c0787)[_0xe354('0x16')](_0x514f44);}};}function respondWithFilteredResult(_0x325c3c,_0x2ac4f4){return function(_0x1a6356){if(_0x1a6356){var _0x3cadac=typeof _0x2ac4f4[_0xe354('0x17')]==='undefined'&&typeof _0x2ac4f4[_0xe354('0x18')]===_0xe354('0x19');var _0x4ebab9=_0x1a6356[_0xe354('0x1a')];var _0x58f5ac=_0x3cadac?0x0:_0x2ac4f4[_0xe354('0x17')];var _0x1bb833=_0x3cadac?_0x1a6356[_0xe354('0x1a')]:_0x2ac4f4[_0xe354('0x17')]+_0x2ac4f4[_0xe354('0x18')];var _0x1abf71;if(_0x1bb833>=_0x4ebab9){_0x1bb833=_0x4ebab9;_0x1abf71=0xc8;}else{_0x1abf71=0xce;}_0x325c3c['status'](_0x1abf71);return _0x325c3c[_0xe354('0x1b')](_0xe354('0x1c'),_0x58f5ac+'-'+_0x1bb833+'/'+_0x4ebab9)[_0xe354('0x16')](_0x1a6356);}return null;};}function patchUpdates(_0xda949c){return function(_0x188433){try{jsonpatch[_0xe354('0x1d')](_0x188433,_0xda949c,!![]);}catch(_0x13aef3){return BPromise[_0xe354('0x1e')](_0x13aef3);}return _0x188433[_0xe354('0x1f')]();};}function saveUpdates(_0x52d5e9,_0x2165b){return function(_0x302b0d){if(_0x302b0d){return _0x302b0d[_0xe354('0x20')](_0x52d5e9)[_0xe354('0x21')](function(_0xeaf344){return _0xeaf344;});}return null;};}function removeEntity(_0x2cff81,_0x5eb3b5){return function(_0x6549e1){if(_0x6549e1){return _0x6549e1['destroy']()[_0xe354('0x21')](function(){var _0x390574=_0x6549e1[_0xe354('0x22')]({'plain':!![]});var _0x577104='Companies';return db[_0xe354('0x23')][_0xe354('0x24')]({'where':{'type':_0x577104,'resourceId':_0x390574['id']}})[_0xe354('0x21')](function(){return _0x6549e1;});})[_0xe354('0x21')](function(){_0x2cff81[_0xe354('0x15')](0xcc)[_0xe354('0x14')]();});}};}function handleEntityNotFound(_0x4b3c85,_0x415328){return function(_0x5cbebb){if(!_0x5cbebb){_0x4b3c85[_0xe354('0x25')](0x194);}return _0x5cbebb;};}function handleError(_0x13da12,_0x3fb164){_0x3fb164=_0x3fb164||0x1f4;return function(_0x3daf3b){logger[_0xe354('0x26')](_0x3daf3b[_0xe354('0x27')]);if(_0x3daf3b[_0xe354('0x28')]){delete _0x3daf3b[_0xe354('0x28')];}_0x13da12['status'](_0x3fb164)[_0xe354('0x29')](_0x3daf3b);};}exports[_0xe354('0x2a')]=function(_0xa75263,_0x331220){var _0x34824a={},_0x18dba8={},_0x2eb53d={'count':0x0,'rows':[]};return db[_0xe354('0x2b')]['describe']()[_0xe354('0x21')](function(_0x58ba67){_0x18dba8[_0xe354('0x2c')]=_[_0xe354('0x2d')](_0x58ba67);_0x18dba8[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0xa75263['query']);_0x18dba8['filters']=_['intersection'](_0x18dba8[_0xe354('0x2c')],_0x18dba8[_0xe354('0x2e')]);_0x34824a[_0xe354('0x2f')]=_[_0xe354('0x30')](_0x18dba8[_0xe354('0x2c')],qs[_0xe354('0x31')](_0xa75263[_0xe354('0x2e')][_0xe354('0x31')]));_0x34824a['attributes']=_0x34824a[_0xe354('0x2f')][_0xe354('0x32')]?_0x34824a[_0xe354('0x2f')]:_0x18dba8[_0xe354('0x2c')];if(!_0xa75263[_0xe354('0x2e')][_0xe354('0x33')](_0xe354('0x34'))){_0x34824a[_0xe354('0x18')]=qs[_0xe354('0x18')](_0xa75263['query']['limit']);_0x34824a[_0xe354('0x17')]=qs[_0xe354('0x17')](_0xa75263[_0xe354('0x2e')][_0xe354('0x17')]);}_0x34824a[_0xe354('0x35')]=qs[_0xe354('0x36')](_0xa75263[_0xe354('0x2e')][_0xe354('0x36')]);_0x34824a['where']=qs[_0xe354('0x37')](_[_0xe354('0x38')](_0xa75263[_0xe354('0x2e')],_0x18dba8[_0xe354('0x37')]),_0x58ba67);if(_0xa75263['query']['filter']){_0x34824a['where']=_[_0xe354('0x39')](_0x34824a[_0xe354('0x3a')],{'$or':_['map'](_0x34824a['attributes'],function(_0x34f237){var _0x86b963={};_0x86b963[_0x34f237]={'$like':'%'+_0xa75263[_0xe354('0x2e')][_0xe354('0x3b')]+'%'};return _0x86b963;})});}_0x34824a=_[_0xe354('0x39')]({},_0x34824a,_0xa75263['options']);var _0x2e261a={'where':_0x34824a[_0xe354('0x3a')]};return db['CmCompany'][_0xe354('0x1a')](_0x2e261a)[_0xe354('0x21')](function(_0x5da392){_0x2eb53d[_0xe354('0x1a')]=_0x5da392;if(_0xa75263[_0xe354('0x2e')][_0xe354('0x3c')]){_0x34824a['include']=[{'all':!![]}];}return db[_0xe354('0x2b')][_0xe354('0x3d')](_0x34824a);})[_0xe354('0x21')](function(_0x262fb4){_0x2eb53d['rows']=_0x262fb4;return _0x2eb53d;})['then'](respondWithFilteredResult(_0x331220,_0x34824a))[_0xe354('0x3e')](handleError(_0x331220,null));})[_0xe354('0x3e')](handleError(_0x331220,null));};exports['show']=function(_0x3b91dc,_0x517f60){var _0x24f2f3={'raw':![],'where':{'id':_0x3b91dc[_0xe354('0x3f')]['id']}},_0xc91818={};_0xc91818[_0xe354('0x2c')]=_['keys'](db[_0xe354('0x2b')][_0xe354('0x40')]);_0xc91818[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0x3b91dc['query']);_0xc91818[_0xe354('0x37')]=_[_0xe354('0x30')](_0xc91818[_0xe354('0x2c')],_0xc91818[_0xe354('0x2e')]);_0x24f2f3[_0xe354('0x2f')]=_['intersection'](_0xc91818[_0xe354('0x2c')],qs[_0xe354('0x31')](_0x3b91dc[_0xe354('0x2e')][_0xe354('0x31')]));_0x24f2f3[_0xe354('0x2f')]=_0x24f2f3['attributes'][_0xe354('0x32')]?_0x24f2f3['attributes']:_0xc91818[_0xe354('0x2c')];if(_0x3b91dc['query']['includeAll']){_0x24f2f3[_0xe354('0x41')]=[{'all':!![]}];}_0x24f2f3=_[_0xe354('0x39')]({},_0x24f2f3,_0x3b91dc[_0xe354('0x42')]);return db[_0xe354('0x2b')]['find'](_0x24f2f3)[_0xe354('0x21')](handleEntityNotFound(_0x517f60,null))['then'](respondWithResult(_0x517f60,null))[_0xe354('0x3e')](handleError(_0x517f60,null));};exports[_0xe354('0x43')]=function(_0x436d61,_0x1203a8){return db['CmCompany'][_0xe354('0x43')](_0x436d61[_0xe354('0x44')],{})['then'](function(_0x32cc51){var _0x42a584=_0x436d61[_0xe354('0x45')][_0xe354('0x22')]({'plain':!![]});if(!_0x42a584)throw new Error(_0xe354('0x46'));if(_0x42a584['role']===_0xe354('0x45')){var _0x2cde27=_0x32cc51[_0xe354('0x22')]({'plain':!![]});var _0xc105ac=_0xe354('0x47');return db[_0xe354('0x48')]['find']({'where':{'name':_0xc105ac,'userProfileId':_0x42a584[_0xe354('0x49')]},'raw':!![]})[_0xe354('0x21')](function(_0x4625db){if(_0x4625db&&_0x4625db[_0xe354('0x4a')]===0x0){return db[_0xe354('0x23')]['create']({'name':_0x2cde27[_0xe354('0x28')],'resourceId':_0x2cde27['id'],'type':_0x4625db[_0xe354('0x28')],'sectionId':_0x4625db['id']},{})['then'](function(){return _0x32cc51;});}else{return _0x32cc51;}})[_0xe354('0x3e')](function(_0x21f8d2){logger[_0xe354('0x26')](_0xe354('0x4b'),_0x21f8d2);throw _0x21f8d2;});}return _0x32cc51;})['then'](respondWithResult(_0x1203a8,0xc9))[_0xe354('0x3e')](handleError(_0x1203a8,null));};exports[_0xe354('0x20')]=function(_0x26c18b,_0x1efe9c){if(_0x26c18b[_0xe354('0x44')]['id']){delete _0x26c18b['body']['id'];}return db[_0xe354('0x2b')][_0xe354('0x4c')]({'where':{'id':_0x26c18b['params']['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x1efe9c,null))[_0xe354('0x21')](saveUpdates(_0x26c18b[_0xe354('0x44')],null))[_0xe354('0x21')](respondWithResult(_0x1efe9c,null))[_0xe354('0x3e')](handleError(_0x1efe9c,null));};exports[_0xe354('0x24')]=function(_0x1df35c,_0x67664){return db[_0xe354('0x2b')]['find']({'where':{'id':_0x1df35c[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x67664,null))[_0xe354('0x21')](removeEntity(_0x67664,null))[_0xe354('0x3e')](handleError(_0x67664,null));};exports[_0xe354('0x4d')]=function(_0x3c09d6,_0x806cd0){return db[_0xe354('0x2b')][_0xe354('0x4d')]()[_0xe354('0x21')](respondWithResult(_0x806cd0,null))[_0xe354('0x3e')](handleError(_0x806cd0,null));};exports[_0xe354('0x4e')]=function(_0xa75fb5,_0x5374fa,_0x4fa0ba){return db['CmContact'][_0xe354('0x4c')]({'where':{'id':_0xa75fb5[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x5374fa,null))[_0xe354('0x21')](function(_0x27271c){if(_0x27271c){return _0x27271c[_0xe354('0x4e')](_0xa75fb5[_0xe354('0x44')][_0xe354('0x4f')],_[_0xe354('0x50')](_0xa75fb5[_0xe354('0x44')],[_0xe354('0x4f'),'id'])||{});}})[_0xe354('0x21')](respondWithResult(_0x5374fa,null))[_0xe354('0x3e')](handleError(_0x5374fa,null));};exports[_0xe354('0x51')]=function(_0x2a47f3,_0xf93e45,_0x45055d){var _0x4d87a0={};var _0x3083b5={};var _0x48f690;var _0x2f2783;return db[_0xe354('0x2b')]['findOne']({'where':{'id':_0x2a47f3[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0xf93e45,null))[_0xe354('0x21')](function(_0x1cf2fa){if(_0x1cf2fa){_0x48f690=_0x1cf2fa;_0x3083b5[_0xe354('0x2c')]=_[_0xe354('0x2d')](db[_0xe354('0x52')][_0xe354('0x40')]);_0x3083b5[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0x2a47f3[_0xe354('0x2e')]);_0x3083b5['filters']=_['intersection'](_0x3083b5[_0xe354('0x2c')],_0x3083b5[_0xe354('0x2e')]);_0x4d87a0[_0xe354('0x2f')]=_[_0xe354('0x30')](_0x3083b5[_0xe354('0x2c')],qs['fields'](_0x2a47f3['query'][_0xe354('0x31')]));_0x4d87a0['attributes']=_0x4d87a0[_0xe354('0x2f')]['length']?_0x4d87a0[_0xe354('0x2f')]:_0x3083b5['model'];_0x4d87a0[_0xe354('0x35')]=qs['sort'](_0x2a47f3[_0xe354('0x2e')]['sort']);_0x4d87a0[_0xe354('0x3a')]=qs[_0xe354('0x37')](_[_0xe354('0x38')](_0x2a47f3['query'],_0x3083b5['filters']));if(_0x2a47f3['query'][_0xe354('0x3b')]){_0x4d87a0[_0xe354('0x3a')]=_[_0xe354('0x39')](_0x4d87a0[_0xe354('0x3a')],{'$or':_[_0xe354('0x53')](_0x4d87a0[_0xe354('0x2f')],function(_0x282379){var _0x38253a={};_0x38253a[_0x282379]={'$like':'%'+_0x2a47f3[_0xe354('0x2e')][_0xe354('0x3b')]+'%'};return _0x38253a;})});}_0x4d87a0=_[_0xe354('0x39')]({},_0x4d87a0,_0x2a47f3[_0xe354('0x42')]);return _0x48f690[_0xe354('0x51')](_0x4d87a0);}})[_0xe354('0x21')](function(_0x189541){if(_0x189541){_0x2f2783=_0x189541[_0xe354('0x32')];if(!_0x2a47f3[_0xe354('0x2e')][_0xe354('0x33')]('nolimit')){_0x4d87a0['limit']=qs[_0xe354('0x18')](_0x2a47f3[_0xe354('0x2e')][_0xe354('0x18')]);_0x4d87a0['offset']=qs['offset'](_0x2a47f3[_0xe354('0x2e')][_0xe354('0x17')]);}return _0x48f690[_0xe354('0x51')](_0x4d87a0);}})['then'](function(_0x20d136){if(_0x20d136){return _0x20d136?{'count':_0x2f2783,'rows':_0x20d136}:null;}})['then'](respondWithResult(_0xf93e45,null))[_0xe354('0x3e')](handleError(_0xf93e45,null));};
\ No newline at end of file
+var _0xb6f5=['options','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','create','user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','ids','findOne','length','pick','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','order','sort','where','filter','merge','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f5,0x12b));var _0x5b6f=function(_0x591d44,_0x2b43a3){_0x591d44=_0x591d44-0x0;var _0x41dd26=_0xb6f5[_0x591d44];return _0x41dd26;};'use strict';var emlformat=require(_0x5b6f('0x0'));var rimraf=require(_0x5b6f('0x1'));var zipdir=require(_0x5b6f('0x2'));var jsonpatch=require(_0x5b6f('0x3'));var rp=require('request-promise');var moment=require(_0x5b6f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b6f('0x5'));var util=require(_0x5b6f('0x6'));var path=require(_0x5b6f('0x7'));var sox=require(_0x5b6f('0x8'));var csv=require(_0x5b6f('0x9'));var ejs=require(_0x5b6f('0xa'));var fs=require('fs');var fs_extra=require(_0x5b6f('0xb'));var _=require(_0x5b6f('0xc'));var squel=require(_0x5b6f('0xd'));var crypto=require(_0x5b6f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5b6f('0xf'));var toCsv=require(_0x5b6f('0x9'));var querystring=require(_0x5b6f('0x10'));var Papa=require(_0x5b6f('0x11'));var Redis=require(_0x5b6f('0x12'));var authService=require(_0x5b6f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5b6f('0x14'));var hardwareService=require(_0x5b6f('0x15'));var logger=require(_0x5b6f('0x16'))('api');var utils=require(_0x5b6f('0x17'));var config=require(_0x5b6f('0x18'));var licenseUtil=require(_0x5b6f('0x19'));var db=require(_0x5b6f('0x1a'))['db'];function respondWithStatusCode(_0x40e793,_0x3c5416){_0x3c5416=_0x3c5416||0xcc;return function(_0x5656a8){if(_0x5656a8){return _0x40e793[_0x5b6f('0x1b')](_0x3c5416);}return _0x40e793[_0x5b6f('0x1c')](_0x3c5416)[_0x5b6f('0x1d')]();};}function respondWithResult(_0xad2576,_0x11dc90){_0x11dc90=_0x11dc90||0xc8;return function(_0x48ef5d){if(_0x48ef5d){return _0xad2576[_0x5b6f('0x1c')](_0x11dc90)[_0x5b6f('0x1e')](_0x48ef5d);}};}function respondWithFilteredResult(_0x15727f,_0x3bb22e){return function(_0x37a666){if(_0x37a666){var _0x32a91a=typeof _0x3bb22e['offset']==='undefined'&&typeof _0x3bb22e['limit']==='undefined';var _0x10753c=_0x37a666[_0x5b6f('0x1f')];var _0x2d47db=_0x32a91a?0x0:_0x3bb22e[_0x5b6f('0x20')];var _0x56fb33=_0x32a91a?_0x37a666[_0x5b6f('0x1f')]:_0x3bb22e['offset']+_0x3bb22e[_0x5b6f('0x21')];var _0x1ccd32;if(_0x56fb33>=_0x10753c){_0x56fb33=_0x10753c;_0x1ccd32=0xc8;}else{_0x1ccd32=0xce;}_0x15727f['status'](_0x1ccd32);return _0x15727f[_0x5b6f('0x22')]('Content-Range',_0x2d47db+'-'+_0x56fb33+'/'+_0x10753c)[_0x5b6f('0x1e')](_0x37a666);}return null;};}function patchUpdates(_0x3bedb4){return function(_0x5b6a38){try{jsonpatch[_0x5b6f('0x23')](_0x5b6a38,_0x3bedb4,!![]);}catch(_0x1b35f4){return BPromise[_0x5b6f('0x24')](_0x1b35f4);}return _0x5b6a38[_0x5b6f('0x25')]();};}function saveUpdates(_0x321a46,_0x3bc5d3){return function(_0xfc45a9){if(_0xfc45a9){return _0xfc45a9['update'](_0x321a46)[_0x5b6f('0x26')](function(_0x3b7cac){return _0x3b7cac;});}return null;};}function removeEntity(_0x1815d6,_0x2cc439){return function(_0x1ab1ff){if(_0x1ab1ff){return _0x1ab1ff[_0x5b6f('0x27')]()[_0x5b6f('0x26')](function(){var _0x3dc244=_0x1ab1ff[_0x5b6f('0x28')]({'plain':!![]});var _0x56d0cf='Companies';return db[_0x5b6f('0x29')][_0x5b6f('0x27')]({'where':{'type':_0x56d0cf,'resourceId':_0x3dc244['id']}})[_0x5b6f('0x26')](function(){return _0x1ab1ff;});})[_0x5b6f('0x26')](function(){_0x1815d6[_0x5b6f('0x1c')](0xcc)[_0x5b6f('0x1d')]();});}};}function handleEntityNotFound(_0x2f85f8,_0x185f2a){return function(_0x1da9a3){if(!_0x1da9a3){_0x2f85f8[_0x5b6f('0x1b')](0x194);}return _0x1da9a3;};}function handleError(_0x586aae,_0x5321d5){_0x5321d5=_0x5321d5||0x1f4;return function(_0x8a07bb){logger[_0x5b6f('0x2a')](_0x8a07bb[_0x5b6f('0x2b')]);if(_0x8a07bb[_0x5b6f('0x2c')]){delete _0x8a07bb[_0x5b6f('0x2c')];}_0x586aae[_0x5b6f('0x1c')](_0x5321d5)[_0x5b6f('0x2d')](_0x8a07bb);};}exports[_0x5b6f('0x2e')]=function(_0x37b9b4,_0x2c6829){var _0x164452={},_0xeb6bfd={},_0x36b213={'count':0x0,'rows':[]};return db[_0x5b6f('0x2f')][_0x5b6f('0x30')]()['then'](function(_0x5be31e){_0xeb6bfd[_0x5b6f('0x31')]=_[_0x5b6f('0x32')](_0x5be31e);_0xeb6bfd['query']=_['keys'](_0x37b9b4[_0x5b6f('0x33')]);_0xeb6bfd[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0xeb6bfd[_0x5b6f('0x31')],_0xeb6bfd['query']);_0x164452['attributes']=_[_0x5b6f('0x35')](_0xeb6bfd[_0x5b6f('0x31')],qs['fields'](_0x37b9b4[_0x5b6f('0x33')]['fields']));_0x164452[_0x5b6f('0x36')]=_0x164452[_0x5b6f('0x36')]['length']?_0x164452[_0x5b6f('0x36')]:_0xeb6bfd['model'];if(!_0x37b9b4[_0x5b6f('0x33')]['hasOwnProperty']('nolimit')){_0x164452[_0x5b6f('0x21')]=qs[_0x5b6f('0x21')](_0x37b9b4['query'][_0x5b6f('0x21')]);_0x164452[_0x5b6f('0x20')]=qs[_0x5b6f('0x20')](_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x20')]);}_0x164452[_0x5b6f('0x37')]=qs[_0x5b6f('0x38')](_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x38')]);_0x164452[_0x5b6f('0x39')]=qs[_0x5b6f('0x34')](_['pick'](_0x37b9b4[_0x5b6f('0x33')],_0xeb6bfd[_0x5b6f('0x34')]),_0x5be31e);if(_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x3a')]){_0x164452['where']=_[_0x5b6f('0x3b')](_0x164452['where'],{'$or':_[_0x5b6f('0x3c')](_0x164452['attributes'],function(_0x5ce9b1){var _0x4ae3b4={};_0x4ae3b4[_0x5ce9b1]={'$like':'%'+_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x3a')]+'%'};return _0x4ae3b4;})});}_0x164452=_[_0x5b6f('0x3b')]({},_0x164452,_0x37b9b4[_0x5b6f('0x3d')]);var _0x501ddf={'where':_0x164452[_0x5b6f('0x39')]};return db['CmCompany'][_0x5b6f('0x1f')](_0x501ddf)[_0x5b6f('0x26')](function(_0x5863af){_0x36b213[_0x5b6f('0x1f')]=_0x5863af;if(_0x37b9b4[_0x5b6f('0x33')]['includeAll']){_0x164452[_0x5b6f('0x3e')]=[{'all':!![]}];}return db[_0x5b6f('0x2f')][_0x5b6f('0x3f')](_0x164452);})[_0x5b6f('0x26')](function(_0x3886e6){_0x36b213[_0x5b6f('0x40')]=_0x3886e6;return _0x36b213;})[_0x5b6f('0x26')](respondWithFilteredResult(_0x2c6829,_0x164452))[_0x5b6f('0x41')](handleError(_0x2c6829,null));})[_0x5b6f('0x41')](handleError(_0x2c6829,null));};exports[_0x5b6f('0x42')]=function(_0x32b610,_0x375257){var _0x20f284={'raw':![],'where':{'id':_0x32b610['params']['id']}},_0xa83134={};_0xa83134['model']=_[_0x5b6f('0x32')](db[_0x5b6f('0x2f')][_0x5b6f('0x43')]);_0xa83134[_0x5b6f('0x33')]=_['keys'](_0x32b610[_0x5b6f('0x33')]);_0xa83134[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0xa83134[_0x5b6f('0x31')],_0xa83134[_0x5b6f('0x33')]);_0x20f284['attributes']=_[_0x5b6f('0x35')](_0xa83134[_0x5b6f('0x31')],qs['fields'](_0x32b610[_0x5b6f('0x33')][_0x5b6f('0x44')]));_0x20f284[_0x5b6f('0x36')]=_0x20f284['attributes']['length']?_0x20f284[_0x5b6f('0x36')]:_0xa83134[_0x5b6f('0x31')];if(_0x32b610[_0x5b6f('0x33')][_0x5b6f('0x45')]){_0x20f284['include']=[{'all':!![]}];}_0x20f284=_[_0x5b6f('0x3b')]({},_0x20f284,_0x32b610[_0x5b6f('0x3d')]);return db[_0x5b6f('0x2f')][_0x5b6f('0x46')](_0x20f284)[_0x5b6f('0x26')](handleEntityNotFound(_0x375257,null))[_0x5b6f('0x26')](respondWithResult(_0x375257,null))[_0x5b6f('0x41')](handleError(_0x375257,null));};exports[_0x5b6f('0x47')]=function(_0x11b256,_0x154419){return db[_0x5b6f('0x2f')]['create'](_0x11b256['body'],{})[_0x5b6f('0x26')](function(_0x3c097c){var _0x3c7f45=_0x11b256[_0x5b6f('0x48')][_0x5b6f('0x28')]({'plain':!![]});if(!_0x3c7f45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c7f45[_0x5b6f('0x49')]===_0x5b6f('0x48')){var _0x57a04e=_0x3c097c[_0x5b6f('0x28')]({'plain':!![]});var _0x2f178c=_0x5b6f('0x4a');return db[_0x5b6f('0x4b')][_0x5b6f('0x46')]({'where':{'name':_0x2f178c,'userProfileId':_0x3c7f45[_0x5b6f('0x4c')]},'raw':!![]})[_0x5b6f('0x26')](function(_0x3faadc){if(_0x3faadc&&_0x3faadc[_0x5b6f('0x4d')]===0x0){return db[_0x5b6f('0x29')][_0x5b6f('0x47')]({'name':_0x57a04e['name'],'resourceId':_0x57a04e['id'],'type':_0x3faadc[_0x5b6f('0x2c')],'sectionId':_0x3faadc['id']},{})[_0x5b6f('0x26')](function(){return _0x3c097c;});}else{return _0x3c097c;}})[_0x5b6f('0x41')](function(_0x1708ec){logger[_0x5b6f('0x2a')](_0x5b6f('0x4e'),_0x1708ec);throw _0x1708ec;});}return _0x3c097c;})['then'](respondWithResult(_0x154419,0xc9))[_0x5b6f('0x41')](handleError(_0x154419,null));};exports['update']=function(_0x5f9a99,_0x2fa6ff){if(_0x5f9a99[_0x5b6f('0x4f')]['id']){delete _0x5f9a99['body']['id'];}return db[_0x5b6f('0x2f')][_0x5b6f('0x46')]({'where':{'id':_0x5f9a99['params']['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x2fa6ff,null))[_0x5b6f('0x26')](saveUpdates(_0x5f9a99[_0x5b6f('0x4f')],null))[_0x5b6f('0x26')](respondWithResult(_0x2fa6ff,null))['catch'](handleError(_0x2fa6ff,null));};exports[_0x5b6f('0x27')]=function(_0x5a4675,_0x1cbc74){return db[_0x5b6f('0x2f')][_0x5b6f('0x46')]({'where':{'id':_0x5a4675[_0x5b6f('0x50')]['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x1cbc74,null))[_0x5b6f('0x26')](removeEntity(_0x1cbc74,null))[_0x5b6f('0x41')](handleError(_0x1cbc74,null));};exports['describe']=function(_0x2db212,_0x2f3169){return db['CmCompany'][_0x5b6f('0x30')]()['then'](respondWithResult(_0x2f3169,null))[_0x5b6f('0x41')](handleError(_0x2f3169,null));};exports[_0x5b6f('0x51')]=function(_0x51fce3,_0x18305c,_0x40a330){return db[_0x5b6f('0x52')]['find']({'where':{'id':_0x51fce3[_0x5b6f('0x50')]['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x18305c,null))[_0x5b6f('0x26')](function(_0x38676a){if(_0x38676a){return _0x38676a['addContacts'](_0x51fce3[_0x5b6f('0x4f')]['ids'],_[_0x5b6f('0x53')](_0x51fce3[_0x5b6f('0x4f')],[_0x5b6f('0x54'),'id'])||{});}})[_0x5b6f('0x26')](respondWithResult(_0x18305c,null))['catch'](handleError(_0x18305c,null));};exports['getContacts']=function(_0x2c78f4,_0x3995d3,_0x5ee756){var _0x203d4f={};var _0x29ce74={};var _0x11f0ab;var _0x53c24e;return db['CmCompany'][_0x5b6f('0x55')]({'where':{'id':_0x2c78f4[_0x5b6f('0x50')]['id']}})['then'](handleEntityNotFound(_0x3995d3,null))[_0x5b6f('0x26')](function(_0x1eb29f){if(_0x1eb29f){_0x11f0ab=_0x1eb29f;_0x29ce74[_0x5b6f('0x31')]=_[_0x5b6f('0x32')](db[_0x5b6f('0x52')][_0x5b6f('0x43')]);_0x29ce74[_0x5b6f('0x33')]=_[_0x5b6f('0x32')](_0x2c78f4[_0x5b6f('0x33')]);_0x29ce74[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0x29ce74[_0x5b6f('0x31')],_0x29ce74['query']);_0x203d4f['attributes']=_[_0x5b6f('0x35')](_0x29ce74['model'],qs['fields'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x44')]));_0x203d4f['attributes']=_0x203d4f[_0x5b6f('0x36')][_0x5b6f('0x56')]?_0x203d4f[_0x5b6f('0x36')]:_0x29ce74[_0x5b6f('0x31')];_0x203d4f['order']=qs['sort'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x38')]);_0x203d4f['where']=qs[_0x5b6f('0x34')](_[_0x5b6f('0x57')](_0x2c78f4['query'],_0x29ce74[_0x5b6f('0x34')]));if(_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x3a')]){_0x203d4f[_0x5b6f('0x39')]=_[_0x5b6f('0x3b')](_0x203d4f[_0x5b6f('0x39')],{'$or':_[_0x5b6f('0x3c')](_0x203d4f[_0x5b6f('0x36')],function(_0x34ecd6){var _0x30a6c4={};_0x30a6c4[_0x34ecd6]={'$like':'%'+_0x2c78f4[_0x5b6f('0x33')]['filter']+'%'};return _0x30a6c4;})});}_0x203d4f=_[_0x5b6f('0x3b')]({},_0x203d4f,_0x2c78f4['options']);return _0x11f0ab[_0x5b6f('0x58')](_0x203d4f);}})[_0x5b6f('0x26')](function(_0x1dc34a){if(_0x1dc34a){_0x53c24e=_0x1dc34a[_0x5b6f('0x56')];if(!_0x2c78f4['query']['hasOwnProperty'](_0x5b6f('0x59'))){_0x203d4f[_0x5b6f('0x21')]=qs[_0x5b6f('0x21')](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x21')]);_0x203d4f[_0x5b6f('0x20')]=qs['offset'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x20')]);}return _0x11f0ab[_0x5b6f('0x58')](_0x203d4f);}})[_0x5b6f('0x26')](function(_0x1d255d){if(_0x1d255d){return _0x1d255d?{'count':_0x53c24e,'rows':_0x1d255d}:null;}})['then'](respondWithResult(_0x3995d3,null))[_0x5b6f('0x41')](handleError(_0x3995d3,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e1fd95b..20c6c57 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 _0x2200=['define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x51f06a,_0x469aa1){var _0x596469=function(_0x54a32f){while(--_0x54a32f){_0x51f06a['push'](_0x51f06a['shift']());}};_0x596469(++_0x469aa1);}(_0x2200,0x11b));var _0x0220=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x2200[_0x5a2d3f];return _0x5c65d8;};'use strict';var _=require(_0x0220('0x0'));var util=require(_0x0220('0x1'));var logger=require(_0x0220('0x2'))(_0x0220('0x3'));var moment=require(_0x0220('0x4'));var BPromise=require(_0x0220('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0220('0x6'));var rimraf=require(_0x0220('0x7'));var config=require(_0x0220('0x8'));var attributes=require(_0x0220('0x9'));module[_0x0220('0xa')]=function(_0xe7a548,_0x3843f6){return _0xe7a548[_0x0220('0xb')](_0x0220('0xc'),attributes,{'tableName':_0x0220('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0615=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','define'];(function(_0x516a73,_0x40da9f){var _0x2c4543=function(_0x1509f7){while(--_0x1509f7){_0x516a73['push'](_0x516a73['shift']());}};_0x2c4543(++_0x40da9f);}(_0x0615,0x1b2));var _0x5061=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0615[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x5061('0x0'));var util=require(_0x5061('0x1'));var logger=require(_0x5061('0x2'))(_0x5061('0x3'));var moment=require(_0x5061('0x4'));var BPromise=require(_0x5061('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5061('0x6'));var config=require(_0x5061('0x7'));var attributes=require(_0x5061('0x8'));module['exports']=function(_0x393e30,_0x59233f){return _0x393e30[_0x5061('0x9')](_0x5061('0xa'),attributes,{'tableName':_0x5061('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 25ab88d..1093b6a 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 _0xbaa3=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash'];(function(_0x28294a,_0x542642){var _0x3bef7d=function(_0x2229f4){while(--_0x2229f4){_0x28294a['push'](_0x28294a['shift']());}};_0x3bef7d(++_0x542642);}(_0xbaa3,0x1b4));var _0x3baa=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0xbaa3[_0x1635fe];return _0x3c512a;};'use strict';var _=require(_0x3baa('0x0'));var util=require(_0x3baa('0x1'));var moment=require('moment');var BPromise=require(_0x3baa('0x2'));var rs=require(_0x3baa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3baa('0x4'))['db'];var utils=require(_0x3baa('0x5'));var logger=require(_0x3baa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3baa('0x7'));var client=jayson[_0x3baa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf2d,_0x2e8439,_0x4b476c){return new BPromise(function(_0x1c9217,_0x30fa77){return client['request'](_0x32bf2d,_0x4b476c)[_0x3baa('0x9')](function(_0x5e6b4b){logger['info'](_0x3baa('0xa'),_0x2e8439,_0x3baa('0xb'));logger[_0x3baa('0xc')](_0x3baa('0xd'),_0x2e8439,_0x3baa('0xb'),JSON[_0x3baa('0xe')](_0x5e6b4b));if(_0x5e6b4b['error']){if(_0x5e6b4b[_0x3baa('0xf')]['code']===0x1f4){logger['error'](_0x3baa('0xa'),_0x2e8439,_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);return _0x30fa77(_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);}logger[_0x3baa('0xf')](_0x3baa('0xa'),_0x2e8439,_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);return _0x1c9217(_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);}else{logger[_0x3baa('0x11')]('CmCompany,\x20%s,\x20%s',_0x2e8439,_0x3baa('0xb'));_0x1c9217(_0x5e6b4b[_0x3baa('0x12')][_0x3baa('0x10')]);}})['catch'](function(_0x16a36a){logger[_0x3baa('0xf')]('CmCompany,\x20%s,\x20%s',_0x2e8439,_0x16a36a);_0x30fa77(_0x16a36a);});});}
\ No newline at end of file
+var _0x61d3=['rpc','../../config/environment','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x61d3,0x124));var _0x361d=function(_0x3e3d12,_0x5d8c29){_0x3e3d12=_0x3e3d12-0x0;var _0x2685a8=_0x61d3[_0x3e3d12];return _0x2685a8;};'use strict';var _=require('lodash');var util=require(_0x361d('0x0'));var moment=require(_0x361d('0x1'));var BPromise=require(_0x361d('0x2'));var rs=require(_0x361d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x361d('0x4'))['db'];var utils=require(_0x361d('0x5'));var logger=require(_0x361d('0x6'))(_0x361d('0x7'));var config=require(_0x361d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x361d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13ecc7,_0x477d92,_0x58b83e){return new BPromise(function(_0x397b94,_0x2641b5){return client[_0x361d('0xa')](_0x13ecc7,_0x58b83e)[_0x361d('0xb')](function(_0x50c9c6){logger[_0x361d('0xc')]('CmCompany,\x20%s,\x20%s',_0x477d92,_0x361d('0xd'));logger[_0x361d('0xe')](_0x361d('0xf'),_0x477d92,'request\x20sent',JSON[_0x361d('0x10')](_0x50c9c6));if(_0x50c9c6['error']){if(_0x50c9c6[_0x361d('0x11')][_0x361d('0x12')]===0x1f4){logger['error'](_0x361d('0x13'),_0x477d92,_0x50c9c6[_0x361d('0x11')]['message']);return _0x2641b5(_0x50c9c6[_0x361d('0x11')][_0x361d('0x14')]);}logger[_0x361d('0x11')]('CmCompany,\x20%s,\x20%s',_0x477d92,_0x50c9c6[_0x361d('0x11')]['message']);return _0x397b94(_0x50c9c6[_0x361d('0x11')][_0x361d('0x14')]);}else{logger[_0x361d('0xc')](_0x361d('0x13'),_0x477d92,_0x361d('0xd'));_0x397b94(_0x50c9c6[_0x361d('0x15')][_0x361d('0x14')]);}})[_0x361d('0x16')](function(_0x4582d1){logger[_0x361d('0x11')](_0x361d('0x13'),_0x477d92,_0x4582d1);_0x2641b5(_0x4582d1);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index c8a2bc4..66b5ce1 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 _0x5fba=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x1a78a5,_0xdbaec1){var _0x4f9141=function(_0x4b06a0){while(--_0x4b06a0){_0x1a78a5['push'](_0x1a78a5['shift']());}};_0x4f9141(++_0xdbaec1);}(_0x5fba,0x128));var _0xa5fb=function(_0x3a8bcb,_0x130205){_0x3a8bcb=_0x3a8bcb-0x0;var _0xa9e3b0=_0x5fba[_0x3a8bcb];return _0xa9e3b0;};'use strict';var multer=require(_0xa5fb('0x0'));var util=require(_0xa5fb('0x1'));var path=require(_0xa5fb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa5fb('0x3')]();var fs_extra=require(_0xa5fb('0x4'));var auth=require(_0xa5fb('0x5'));var interaction=require(_0xa5fb('0x6'));var config=require(_0xa5fb('0x7'));var controller=require('./cmCompany.controller');router[_0xa5fb('0x8')]('/',auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xa')]);router[_0xa5fb('0x8')](_0xa5fb('0xb'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xc')]);router['get'](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xe')]);router[_0xa5fb('0x8')](_0xa5fb('0xf'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x10')]);router[_0xa5fb('0x11')]('/',auth['isAuthenticated'](),controller[_0xa5fb('0x12')]);router[_0xa5fb('0x11')](_0xa5fb('0xf'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x13')]);router[_0xa5fb('0x14')](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x15')]);router[_0xa5fb('0x16')](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x17')]);module[_0xa5fb('0x18')]=router;
\ No newline at end of file
+var _0xfa41=['create','addContacts','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x118a97,_0x143f67){var _0x1b20c8=function(_0x240fdd){while(--_0x240fdd){_0x118a97['push'](_0x118a97['shift']());}};_0x1b20c8(++_0x143f67);}(_0xfa41,0xeb));var _0x1fa4=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xfa41[_0xb99421];return _0x4b3ec7;};'use strict';var multer=require(_0x1fa4('0x0'));var util=require('util');var path=require(_0x1fa4('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fa4('0x2'));var router=express[_0x1fa4('0x3')]();var fs_extra=require(_0x1fa4('0x4'));var auth=require(_0x1fa4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa4('0x6'));var controller=require(_0x1fa4('0x7'));router[_0x1fa4('0x8')]('/',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xa')]);router[_0x1fa4('0x8')](_0x1fa4('0xb'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xc')]);router[_0x1fa4('0x8')](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xe')]);router[_0x1fa4('0x8')](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x10')]);router[_0x1fa4('0x11')]('/',auth['isAuthenticated'](),controller[_0x1fa4('0x12')]);router['post'](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x13')]);router[_0x1fa4('0x14')]('/:id',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x15')]);router['delete'](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6c22913..7784312 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 _0x1ba3=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x3430bb,_0x3a84af){var _0x5855bb=function(_0x1cfc71){while(--_0x1cfc71){_0x3430bb['push'](_0x3430bb['shift']());}};_0x5855bb(++_0x3a84af);}(_0x1ba3,0x1c0));var _0x31ba=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x1ba3[_0x1793de];return _0x4f0309;};'use strict';var _=require('lodash');var Sequelize=require(_0x31ba('0x0'));module[_0x31ba('0x1')]={'firstName':{'type':Sequelize[_0x31ba('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x31ba('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x31ba('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x31ba('0x2')]},'description':{'type':Sequelize[_0x31ba('0x3')]},'phone':{'type':Sequelize[_0x31ba('0x2')]},'mobile':{'type':Sequelize[_0x31ba('0x2')]},'fax':{'type':Sequelize[_0x31ba('0x2')]},'email':{'type':Sequelize[_0x31ba('0x2')]},'url':{'type':Sequelize[_0x31ba('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x31ba('0x2')]},'twitter':{'type':Sequelize[_0x31ba('0x2')]},'skype':{'type':Sequelize[_0x31ba('0x2')]},'teams':{'type':Sequelize[_0x31ba('0x2')]},'viber':{'type':Sequelize[_0x31ba('0x2')]},'line':{'type':Sequelize[_0x31ba('0x2')]},'wechat':{'type':Sequelize[_0x31ba('0x2')]},'telegram':{'type':Sequelize[_0x31ba('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x31ba('0x2')]},'priority':{'type':Sequelize[_0x31ba('0x4')](0x2)[_0x31ba('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x31ba('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x31ba('0x2')]},'utcOffset':{'type':Sequelize[_0x31ba('0x4')]}};
\ No newline at end of file
+var _0xdcd8=['TEXT','UNSIGNED','NOW','INTEGER','lodash','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdcd8,0xdd));var _0x8dcd=function(_0x184d15,_0x156b5d){_0x184d15=_0x184d15-0x0;var _0x4989da=_0xdcd8[_0x184d15];return _0x4989da;};'use strict';var _=require(_0x8dcd('0x0'));var Sequelize=require(_0x8dcd('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8dcd('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8dcd('0x2')]},'street':{'type':Sequelize[_0x8dcd('0x2')]},'postalCode':{'type':Sequelize[_0x8dcd('0x2')]},'city':{'type':Sequelize[_0x8dcd('0x2')]},'country':{'type':Sequelize[_0x8dcd('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8dcd('0x2')]},'description':{'type':Sequelize[_0x8dcd('0x3')]},'phone':{'type':Sequelize[_0x8dcd('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8dcd('0x2')]},'url':{'type':Sequelize[_0x8dcd('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8dcd('0x2')]},'teams':{'type':Sequelize[_0x8dcd('0x2')]},'viber':{'type':Sequelize[_0x8dcd('0x2')]},'line':{'type':Sequelize[_0x8dcd('0x2')]},'wechat':{'type':Sequelize[_0x8dcd('0x2')]},'telegram':{'type':Sequelize[_0x8dcd('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x8dcd('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8dcd('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8dcd('0x5')]},'dialTimezone':{'type':Sequelize[_0x8dcd('0x2')]},'utcOffset':{'type':Sequelize[_0x8dcd('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index fba7d38..7b13b37 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','randomstring','path','../../../config/logger','email','head'];(function(_0x184ea9,_0x261b66){var _0x1ee0d=function(_0x16f4a2){while(--_0x16f4a2){_0x184ea9['push'](_0x184ea9['shift']());}};_0x1ee0d(++_0x261b66);}(_0xcdba,0x84));var _0xacdb=function(_0x3141b3,_0xfb6bd5){_0x3141b3=_0x3141b3-0x0;var _0x8b3ec1=_0xcdba[_0x3141b3];return _0x8b3ec1;};'use strict';var _=require(_0xacdb('0x0'));var moment=require('moment');var random=require(_0xacdb('0x1'));var fs=require('fs');var path=require(_0xacdb('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xacdb('0x3'))(_0xacdb('0x4'));var config=require('../../../config/environment');function getAddress(_0x409026){var _0x4a786f=_[_0xacdb('0x5')](_0x409026[_0xacdb('0x6')]);return _0x4a786f&&_0x4a786f['address']?_0x4a786f[_0xacdb('0x7')]:_0xacdb('0x8')+random[_0xacdb('0x9')](0x6)+_0xacdb('0xa');}function getFirstName(_0x15e281){var _0x4c876c=_[_0xacdb('0x5')](_0x15e281[_0xacdb('0x6')]);if(_0x4c876c&&_0x4c876c['name']){if(_0x4c876c[_0xacdb('0xb')]==_0x4c876c[_0xacdb('0x7')]){return _0x4c876c['name'][_0xacdb('0xc')](0x0,_0x4c876c['name']['indexOf']('@'));}var _0xc51924=_0x4c876c[_0xacdb('0xb')][_0xacdb('0xd')](/\s+/);return _0xc51924[_0xacdb('0xe')]>0x1?_0xc51924[_0xacdb('0xf')](0x0,-0x1)['join']('\x20'):_0x4c876c['name'];}return _0xacdb('0x10');}function getLastName(_0x339fc8){var _0x5b3a2d=_[_0xacdb('0x5')](_0x339fc8[_0xacdb('0x6')]);if(_0x5b3a2d&&_0x5b3a2d[_0xacdb('0xb')]){var _0x2c8d83=_0x5b3a2d[_0xacdb('0xb')][_0xacdb('0xd')](/\s+/);return _0x2c8d83[_0xacdb('0xe')]>0x1?_0x2c8d83[_0xacdb('0x11')]():'';}return'';}function getMails(_0x26c899,_0x55cf50){var _0x51c47a='';for(var _0x28cce1=0x0;_0x28cce1<_0x55cf50[_0xacdb('0x6')][_0xacdb('0xe')];_0x28cce1+=0x1){if(_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]!==_0x26c899){if(!_[_0xacdb('0x12')](_0x51c47a)){_0x51c47a+=',';}_0x51c47a+=_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0xb')]||_0x55cf50['value'][_0x28cce1][_0xacdb('0x7')]||'';_0x51c47a+='\x20<';_0x51c47a+=_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]?_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]:'anonymous'+random['generate'](0x6)+_0xacdb('0xa');_0x51c47a+='>';}}return _0x51c47a;}function parseEmail(_0x9f2d67,_0x1a6f3a,_0xc0b57a){if(_0x1a6f3a['html']){var _0x1c7705=/