From: support
Date: Mon, 21 Nov 2022 15:55:45 +0000 (+0000)
Subject: Built motion from commit 22695764.|2.6.22
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22%7B%7Blicense.openchannel?a=commitdiff_plain;h=bd0a5b30f79c8608fb95663dda159844f444848d;p=motion2.git
Built motion from commit 22695764.|2.6.22
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 691e9c0..6ef4e82 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-21T08:43:43.389Z",
+ "time": "2022-11-21T15:47:29.376Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9c29ac5..c2f3e7b 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-11-21T08:43:43.389Z",
+ "time": "2022-11-21T15:47:29.376Z",
"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 ddbec26..dfc966c 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 _0x1eba=['TEXT','urlForward[body]','sequelize','VIRTUAL','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x381372,_0xf0a5a){var _0x4e959a=function(_0x25a897){while(--_0x25a897){_0x381372['push'](_0x381372['shift']());}};_0x4e959a(++_0xf0a5a);}(_0x1eba,0xda));var _0xa1eb=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x1eba[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1eb('0x1')],'get':function(_0x114b71){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xa1eb('0x3'),_0xa1eb('0x4'),_0xa1eb('0x5'),_0xa1eb('0x6'),_0xa1eb('0x7'),_0xa1eb('0x8'),_0xa1eb('0x9')]],'msg':_0xa1eb('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xa1eb('0x2')](0x1000),'comment':_0xa1eb('0xb')},'data3':{'type':Sequelize[_0xa1eb('0x2')](0x1000),'comment':_0xa1eb('0xc')},'data4':{'type':Sequelize[_0xa1eb('0x2')](0x1000),'comments':_0xa1eb('0xd')},'data5':{'type':Sequelize[_0xa1eb('0x2')](0x1000),'comments':_0xa1eb('0xe')},'data6':{'type':Sequelize[_0xa1eb('0x2')],'comments':_0xa1eb('0xf')},'data7':{'type':Sequelize[_0xa1eb('0x10')],'comments':_0xa1eb('0x11')}};
\ No newline at end of file
+var _0x4fef=['TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','contactManager','integration','motionbar','jscripty','browser','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x2f70b6,_0x4b7db6){var _0x77a5b0=function(_0x3778e0){while(--_0x3778e0){_0x2f70b6['push'](_0x2f70b6['shift']());}};_0x77a5b0(++_0x4b7db6);}(_0x4fef,0x1dd));var _0xf4fe=function(_0x4bdc99,_0xa77058){_0x4bdc99=_0x4bdc99-0x0;var _0xc320f7=_0x4fef[_0x4bdc99];return _0xc320f7;};'use strict';var Sequelize=require(_0xf4fe('0x0'));module[_0xf4fe('0x1')]={'name':{'type':Sequelize[_0xf4fe('0x2')],'get':function(_0x3ce3eb){return this['getDataValue'](_0xf4fe('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xf4fe('0x4'),_0xf4fe('0x5'),_0xf4fe('0x6'),_0xf4fe('0x7'),'urlForward',_0xf4fe('0x8'),'bot',_0xf4fe('0x9')]],'msg':_0xf4fe('0xa')}},'comment':_0xf4fe('0xa')},'data1':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comment':_0xf4fe('0xc')},'data2':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comment':_0xf4fe('0xd')},'data3':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comment':_0xf4fe('0xe')},'data4':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xf4fe('0xb')](0x1000),'comments':_0xf4fe('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0xf4fe('0x10')},'data7':{'type':Sequelize[_0xf4fe('0x11')],'comments':_0xf4fe('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 2f99bb3..c56623b 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 _0xbd24=['send','body','Action','find','params','catch','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','destroy','then','stack','name'];(function(_0x14d97c,_0x4a7140){var _0x1e011f=function(_0x4ce24e){while(--_0x4ce24e){_0x14d97c['push'](_0x14d97c['shift']());}};_0x1e011f(++_0x4a7140);}(_0xbd24,0x1ce));var _0x4bd2=function(_0x4413cf,_0x3f70e8){_0x4413cf=_0x4413cf-0x0;var _0x9a1479=_0xbd24[_0x4413cf];return _0x9a1479;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4bd2('0x0'));var rp=require(_0x4bd2('0x1'));var moment=require(_0x4bd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4bd2('0x3'));var util=require(_0x4bd2('0x4'));var path=require(_0x4bd2('0x5'));var sox=require(_0x4bd2('0x6'));var csv=require(_0x4bd2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bd2('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4bd2('0x9'));var authService=require('../../components/auth/service');var qs=require(_0x4bd2('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4bd2('0xb'))(_0x4bd2('0xc'));var utils=require(_0x4bd2('0xd'));var config=require(_0x4bd2('0xe'));var licenseUtil=require(_0x4bd2('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x360c89,_0xa4ca4a){_0xa4ca4a=_0xa4ca4a||0xcc;return function(_0xaeab7a){if(_0xaeab7a){return _0x360c89['sendStatus'](_0xa4ca4a);}return _0x360c89['status'](_0xa4ca4a)[_0x4bd2('0x10')]();};}function respondWithResult(_0x1e1ef4,_0xcf2506){_0xcf2506=_0xcf2506||0xc8;return function(_0x598779){if(_0x598779){return _0x1e1ef4['status'](_0xcf2506)[_0x4bd2('0x11')](_0x598779);}};}function respondWithFilteredResult(_0x2b63be,_0x574309){return function(_0xef35f2){if(_0xef35f2){var _0x2dda66=typeof _0x574309['offset']===_0x4bd2('0x12')&&typeof _0x574309[_0x4bd2('0x13')]===_0x4bd2('0x12');var _0x13ad24=_0xef35f2[_0x4bd2('0x14')];var _0x30d408=_0x2dda66?0x0:_0x574309[_0x4bd2('0x15')];var _0x47ee32=_0x2dda66?_0xef35f2['count']:_0x574309[_0x4bd2('0x15')]+_0x574309[_0x4bd2('0x13')];var _0x4b58c5;if(_0x47ee32>=_0x13ad24){_0x47ee32=_0x13ad24;_0x4b58c5=0xc8;}else{_0x4b58c5=0xce;}_0x2b63be[_0x4bd2('0x16')](_0x4b58c5);return _0x2b63be[_0x4bd2('0x17')](_0x4bd2('0x18'),_0x30d408+'-'+_0x47ee32+'/'+_0x13ad24)[_0x4bd2('0x11')](_0xef35f2);}return null;};}function patchUpdates(_0x179213){return function(_0x74a4fb){try{jsonpatch['apply'](_0x74a4fb,_0x179213,!![]);}catch(_0x337d3c){return BPromise[_0x4bd2('0x19')](_0x337d3c);}return _0x74a4fb[_0x4bd2('0x1a')]();};}function saveUpdates(_0x49ff9e,_0x2f0b90){return function(_0x26c7d5){if(_0x26c7d5){return _0x26c7d5[_0x4bd2('0x1b')](_0x49ff9e)['then'](function(_0x4539cd){return _0x4539cd;});}return null;};}function removeEntity(_0x2468f1,_0x1d18a1){return function(_0x59b8c4){if(_0x59b8c4){return _0x59b8c4[_0x4bd2('0x1c')]()[_0x4bd2('0x1d')](function(){_0x2468f1[_0x4bd2('0x16')](0xcc)[_0x4bd2('0x10')]();});}};}function handleEntityNotFound(_0x1994ca,_0x47d5b0){return function(_0x1e6e82){if(!_0x1e6e82){_0x1994ca['sendStatus'](0x194);}return _0x1e6e82;};}function handleError(_0x1d513b,_0x2bc6c0){_0x2bc6c0=_0x2bc6c0||0x1f4;return function(_0x4d0bbb){logger['error'](_0x4d0bbb[_0x4bd2('0x1e')]);if(_0x4d0bbb[_0x4bd2('0x1f')]){delete _0x4d0bbb[_0x4bd2('0x1f')];}_0x1d513b[_0x4bd2('0x16')](_0x2bc6c0)[_0x4bd2('0x20')](_0x4d0bbb);};}exports['update']=function(_0x18e015,_0x53b134){if(_0x18e015[_0x4bd2('0x21')]['id']){delete _0x18e015[_0x4bd2('0x21')]['id'];}return db[_0x4bd2('0x22')][_0x4bd2('0x23')]({'where':{'id':_0x18e015[_0x4bd2('0x24')]['id']}})['then'](handleEntityNotFound(_0x53b134,null))[_0x4bd2('0x1d')](saveUpdates(_0x18e015[_0x4bd2('0x21')],null))[_0x4bd2('0x1d')](respondWithResult(_0x53b134,null))[_0x4bd2('0x25')](handleError(_0x53b134,null));};exports[_0x4bd2('0x1c')]=function(_0x58f4fb,_0x1c9ad8){return db[_0x4bd2('0x22')][_0x4bd2('0x23')]({'where':{'id':_0x58f4fb['params']['id']}})[_0x4bd2('0x1d')](handleEntityNotFound(_0x1c9ad8,null))[_0x4bd2('0x1d')](removeEntity(_0x1c9ad8,null))[_0x4bd2('0x25')](handleError(_0x1c9ad8,null));};
\ No newline at end of file
+var _0x034f=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','body','Action'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x034f,0x179));var _0xf034=function(_0x45dd9b,_0x35fa24){_0x45dd9b=_0x45dd9b-0x0;var _0x410941=_0x034f[_0x45dd9b];return _0x410941;};'use strict';var emlformat=require(_0xf034('0x0'));var rimraf=require(_0xf034('0x1'));var zipdir=require(_0xf034('0x2'));var jsonpatch=require(_0xf034('0x3'));var rp=require(_0xf034('0x4'));var moment=require('moment');var BPromise=require(_0xf034('0x5'));var Mustache=require(_0xf034('0x6'));var util=require(_0xf034('0x7'));var path=require(_0xf034('0x8'));var sox=require(_0xf034('0x9'));var csv=require('to-csv');var ejs=require(_0xf034('0xa'));var fs=require('fs');var fs_extra=require(_0xf034('0xb'));var _=require(_0xf034('0xc'));var squel=require(_0xf034('0xd'));var crypto=require(_0xf034('0xe'));var jsforce=require(_0xf034('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf034('0x10'));var querystring=require(_0xf034('0x11'));var Papa=require(_0xf034('0x12'));var Redis=require(_0xf034('0x13'));var authService=require(_0xf034('0x14'));var qs=require(_0xf034('0x15'));var as=require(_0xf034('0x16'));var hardwareService=require(_0xf034('0x17'));var logger=require('../../config/logger')(_0xf034('0x18'));var utils=require(_0xf034('0x19'));var config=require(_0xf034('0x1a'));var licenseUtil=require(_0xf034('0x1b'));var db=require(_0xf034('0x1c'))['db'];function respondWithStatusCode(_0x4631c2,_0xd4f5d){_0xd4f5d=_0xd4f5d||0xcc;return function(_0x14c563){if(_0x14c563){return _0x4631c2[_0xf034('0x1d')](_0xd4f5d);}return _0x4631c2['status'](_0xd4f5d)[_0xf034('0x1e')]();};}function respondWithResult(_0x446aae,_0x1fc133){_0x1fc133=_0x1fc133||0xc8;return function(_0x40df00){if(_0x40df00){return _0x446aae[_0xf034('0x1f')](_0x1fc133)[_0xf034('0x20')](_0x40df00);}};}function respondWithFilteredResult(_0x5d20b8,_0x4e5044){return function(_0x113a32){if(_0x113a32){var _0x33cd3d=typeof _0x4e5044[_0xf034('0x21')]==='undefined'&&typeof _0x4e5044[_0xf034('0x22')]==='undefined';var _0x2b1f7e=_0x113a32[_0xf034('0x23')];var _0x194eb7=_0x33cd3d?0x0:_0x4e5044[_0xf034('0x21')];var _0x50e8e3=_0x33cd3d?_0x113a32[_0xf034('0x23')]:_0x4e5044['offset']+_0x4e5044['limit'];var _0x2bd3bc;if(_0x50e8e3>=_0x2b1f7e){_0x50e8e3=_0x2b1f7e;_0x2bd3bc=0xc8;}else{_0x2bd3bc=0xce;}_0x5d20b8[_0xf034('0x1f')](_0x2bd3bc);return _0x5d20b8[_0xf034('0x24')](_0xf034('0x25'),_0x194eb7+'-'+_0x50e8e3+'/'+_0x2b1f7e)[_0xf034('0x20')](_0x113a32);}return null;};}function patchUpdates(_0x1be8a9){return function(_0x38f93a){try{jsonpatch[_0xf034('0x26')](_0x38f93a,_0x1be8a9,!![]);}catch(_0x5126e0){return BPromise[_0xf034('0x27')](_0x5126e0);}return _0x38f93a[_0xf034('0x28')]();};}function saveUpdates(_0x111e32,_0x57fd78){return function(_0x21b8b1){if(_0x21b8b1){return _0x21b8b1[_0xf034('0x29')](_0x111e32)[_0xf034('0x2a')](function(_0x1ddccc){return _0x1ddccc;});}return null;};}function removeEntity(_0x2990da,_0x323349){return function(_0x296940){if(_0x296940){return _0x296940['destroy']()[_0xf034('0x2a')](function(){_0x2990da['status'](0xcc)[_0xf034('0x1e')]();});}};}function handleEntityNotFound(_0x3ccb9,_0xad0cbb){return function(_0x17ac34){if(!_0x17ac34){_0x3ccb9[_0xf034('0x1d')](0x194);}return _0x17ac34;};}function handleError(_0x443122,_0x378a2d){_0x378a2d=_0x378a2d||0x1f4;return function(_0x332f91){logger['error'](_0x332f91[_0xf034('0x2b')]);if(_0x332f91['name']){delete _0x332f91['name'];}_0x443122[_0xf034('0x1f')](_0x378a2d)['send'](_0x332f91);};}exports[_0xf034('0x29')]=function(_0x2764c6,_0x350b91){if(_0x2764c6[_0xf034('0x2c')]['id']){delete _0x2764c6[_0xf034('0x2c')]['id'];}return db[_0xf034('0x2d')][_0xf034('0x2e')]({'where':{'id':_0x2764c6['params']['id']}})['then'](handleEntityNotFound(_0x350b91,null))[_0xf034('0x2a')](saveUpdates(_0x2764c6[_0xf034('0x2c')],null))[_0xf034('0x2a')](respondWithResult(_0x350b91,null))['catch'](handleError(_0x350b91,null));};exports['destroy']=function(_0x7ddbe,_0x10b4d8){return db[_0xf034('0x2d')][_0xf034('0x2e')]({'where':{'id':_0x7ddbe['params']['id']}})['then'](handleEntityNotFound(_0x10b4d8,null))['then'](removeEntity(_0x10b4d8,null))['catch'](handleError(_0x10b4d8,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 6916601..da0be4a 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 _0x5e03=['rimraf','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x4a8905,_0xb02e55){var _0x23d1f7=function(_0x525cf8){while(--_0x525cf8){_0x4a8905['push'](_0x4a8905['shift']());}};_0x23d1f7(++_0xb02e55);}(_0x5e03,0x192));var _0x35e0=function(_0x11b5b4,_0x26c396){_0x11b5b4=_0x11b5b4-0x0;var _0x4424e8=_0x5e03[_0x11b5b4];return _0x4424e8;};'use strict';var _=require('lodash');var util=require(_0x35e0('0x0'));var logger=require(_0x35e0('0x1'))(_0x35e0('0x2'));var moment=require(_0x35e0('0x3'));var BPromise=require(_0x35e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x35e0('0x6'));module[_0x35e0('0x7')]=function(_0x1a0687,_0x982db6){return _0x1a0687[_0x35e0('0x8')](_0x35e0('0x9'),attributes,{'tableName':_0x35e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaeff=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','../../config/logger','api','moment'];(function(_0x992a7a,_0x47c106){var _0x16b3bf=function(_0x1064d0){while(--_0x1064d0){_0x992a7a['push'](_0x992a7a['shift']());}};_0x16b3bf(++_0x47c106);}(_0xaeff,0x71));var _0xfaef=function(_0x44a56b,_0x40cab5){_0x44a56b=_0x44a56b-0x0;var _0x3eba36=_0xaeff[_0x44a56b];return _0x3eba36;};'use strict';var _=require(_0xfaef('0x0'));var util=require('util');var logger=require(_0xfaef('0x1'))(_0xfaef('0x2'));var moment=require(_0xfaef('0x3'));var BPromise=require(_0xfaef('0x4'));var rp=require(_0xfaef('0x5'));var fs=require('fs');var path=require(_0xfaef('0x6'));var rimraf=require(_0xfaef('0x7'));var config=require(_0xfaef('0x8'));var attributes=require('./action.attributes');module[_0xfaef('0x9')]=function(_0x13850f,_0x493beb){return _0x13850f[_0xfaef('0xa')](_0xfaef('0xb'),attributes,{'tableName':_0xfaef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index af2a50c..941102e 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x5fab,0x177));var _0xb5fa=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x5fab[_0x2c5255];return _0x30d0ea;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x413e23,_0x4c8289){var _0x5cab0c=function(_0x97dc9c){while(--_0x97dc9c){_0x413e23['push'](_0x413e23['shift']());}};_0x5cab0c(++_0x4c8289);}(_0x326f,0xd1));var _0xf326=function(_0x5bcd71,_0x2c7c7f){_0x5bcd71=_0x5bcd71-0x0;var _0x60b542=_0x326f[_0x5bcd71];return _0x60b542;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 4e8f6cf..ce5dc5f 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 _0x5e38=['isAuthenticated','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id'];(function(_0x2d4ebd,_0x4d8b0d){var _0x399d0f=function(_0x588728){while(--_0x588728){_0x2d4ebd['push'](_0x2d4ebd['shift']());}};_0x399d0f(++_0x4d8b0d);}(_0x5e38,0x1b2));var _0x85e3=function(_0x443605,_0x17c563){_0x443605=_0x443605-0x0;var _0x252c9e=_0x5e38[_0x443605];return _0x252c9e;};'use strict';var multer=require('multer');var util=require(_0x85e3('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x85e3('0x1'));var router=express['Router']();var fs_extra=require(_0x85e3('0x2'));var auth=require(_0x85e3('0x3'));var interaction=require(_0x85e3('0x4'));var config=require(_0x85e3('0x5'));var controller=require(_0x85e3('0x6'));router['put'](_0x85e3('0x7'),auth[_0x85e3('0x8')](),controller[_0x85e3('0x9')]);router[_0x85e3('0xa')](_0x85e3('0x7'),auth[_0x85e3('0x8')](),controller[_0x85e3('0xb')]);module[_0x85e3('0xc')]=router;
\ No newline at end of file
+var _0x5ae4=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x5a37f2,_0x41611a){var _0x28ab89=function(_0x138f5c){while(--_0x138f5c){_0x5a37f2['push'](_0x5a37f2['shift']());}};_0x28ab89(++_0x41611a);}(_0x5ae4,0xb1));var _0x45ae=function(_0x362f26,_0x5ce460){_0x362f26=_0x362f26-0x0;var _0x324fb7=_0x5ae4[_0x362f26];return _0x324fb7;};'use strict';var multer=require('multer');var util=require(_0x45ae('0x0'));var path=require(_0x45ae('0x1'));var timeout=require(_0x45ae('0x2'));var express=require('express');var router=express[_0x45ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x45ae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x45ae('0x5'));var controller=require(_0x45ae('0x6'));router[_0x45ae('0x7')](_0x45ae('0x8'),auth[_0x45ae('0x9')](),controller['update']);router['delete'](_0x45ae('0x8'),auth[_0x45ae('0x9')](),controller['destroy']);module[_0x45ae('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index c18fc5d..0d57528 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x2ef644,_0x2ab0ff){var _0x11f00e=function(_0x32983a){while(--_0x32983a){_0x2ef644['push'](_0x2ef644['shift']());}};_0x11f00e(++_0x2ab0ff);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2eb2[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x49887f,_0x5a025e){var _0x289ab8=function(_0xe6de34){while(--_0xe6de34){_0x49887f['push'](_0x49887f['shift']());}};_0x289ab8(++_0x5a025e);}(_0xeec6,0x1c2));var _0x6eec=function(_0x39f097,_0x17116b){_0x39f097=_0x39f097-0x0;var _0x544f6a=_0xeec6[_0x39f097];return _0x544f6a;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 03a20a2..1b279da 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 _0xbcfc=['COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','operator','Please\x20insert\x20at\x20least\x20one\x20field','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','save','get','UserProfileResource','destroy','then','end','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','limit','order','where','filters','pick','filter','merge','options','include','findAll','catch','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join'];(function(_0x1e9b13,_0x78c34b){var _0x27254f=function(_0x3aa64d){while(--_0x3aa64d){_0x1e9b13['push'](_0x1e9b13['shift']());}};_0x27254f(++_0x78c34b);}(_0xbcfc,0x162));var _0xcbcf=function(_0x2ea71a,_0x4988d0){_0x2ea71a=_0x2ea71a-0x0;var _0xf4729a=_0xbcfc[_0x2ea71a];return _0xf4729a;};'use strict';var emlformat=require(_0xcbcf('0x0'));var rimraf=require(_0xcbcf('0x1'));var zipdir=require(_0xcbcf('0x2'));var jsonpatch=require(_0xcbcf('0x3'));var rp=require('request-promise');var moment=require(_0xcbcf('0x4'));var BPromise=require(_0xcbcf('0x5'));var Mustache=require(_0xcbcf('0x6'));var util=require(_0xcbcf('0x7'));var path=require(_0xcbcf('0x8'));var sox=require('sox');var csv=require(_0xcbcf('0x9'));var ejs=require(_0xcbcf('0xa'));var fs=require('fs');var fs_extra=require(_0xcbcf('0xb'));var _=require(_0xcbcf('0xc'));var squel=require('squel');var crypto=require(_0xcbcf('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcbcf('0x9'));var querystring=require(_0xcbcf('0xe'));var Papa=require(_0xcbcf('0xf'));var Redis=require(_0xcbcf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcbcf('0x11'));var as=require(_0xcbcf('0x12'));var hardwareService=require(_0xcbcf('0x13'));var logger=require('../../config/logger')(_0xcbcf('0x14'));var utils=require(_0xcbcf('0x15'));var config=require(_0xcbcf('0x16'));var licenseUtil=require(_0xcbcf('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0xcbcf('0x18'))['dbH'];function respondWithStatusCode(_0x1988d4,_0x364e75){_0x364e75=_0x364e75||0xcc;return function(_0x360687){if(_0x360687){return _0x1988d4[_0xcbcf('0x19')](_0x364e75);}return _0x1988d4[_0xcbcf('0x1a')](_0x364e75)['end']();};}function respondWithResult(_0x5a1d44,_0xb2aaa5){_0xb2aaa5=_0xb2aaa5||0xc8;return function(_0x3a9bd3){if(_0x3a9bd3){return _0x5a1d44[_0xcbcf('0x1a')](_0xb2aaa5)['json'](_0x3a9bd3);}};}function respondWithFilteredResult(_0x2d7ca5,_0x9bef50){return function(_0xc2a7e9){if(_0xc2a7e9){var _0x4a6a15=typeof _0x9bef50[_0xcbcf('0x1b')]===_0xcbcf('0x1c')&&typeof _0x9bef50['limit']===_0xcbcf('0x1c');var _0x263d4f=_0xc2a7e9[_0xcbcf('0x1d')];var _0x487749=_0x4a6a15?0x0:_0x9bef50[_0xcbcf('0x1b')];var _0x283292=_0x4a6a15?_0xc2a7e9['count']:_0x9bef50[_0xcbcf('0x1b')]+_0x9bef50['limit'];var _0x536dbc;if(_0x283292>=_0x263d4f){_0x283292=_0x263d4f;_0x536dbc=0xc8;}else{_0x536dbc=0xce;}_0x2d7ca5['status'](_0x536dbc);return _0x2d7ca5['set'](_0xcbcf('0x1e'),_0x487749+'-'+_0x283292+'/'+_0x263d4f)[_0xcbcf('0x1f')](_0xc2a7e9);}return null;};}function patchUpdates(_0x37b661){return function(_0x1d0b96){try{jsonpatch[_0xcbcf('0x20')](_0x1d0b96,_0x37b661,!![]);}catch(_0xb8511e){return BPromise['reject'](_0xb8511e);}return _0x1d0b96[_0xcbcf('0x21')]();};}function saveUpdates(_0x49cf2f,_0x33f0b1){return function(_0x53843c){if(_0x53843c){return _0x53843c['update'](_0x49cf2f)['then'](function(_0x3c371f){return _0x3c371f;});}return null;};}function removeEntity(_0x14372b,_0x13c442){return function(_0x148eec){if(_0x148eec){return _0x148eec['destroy']()['then'](function(){var _0x1463d1=_0x148eec[_0xcbcf('0x22')]({'plain':!![]});var _0xb0fbc1='CustomReports';return db[_0xcbcf('0x23')][_0xcbcf('0x24')]({'where':{'type':_0xb0fbc1,'resourceId':_0x1463d1['id']}})[_0xcbcf('0x25')](function(){return _0x148eec;});})['then'](function(){_0x14372b['status'](0xcc)[_0xcbcf('0x26')]();});}};}function handleEntityNotFound(_0x1c251f,_0x171655){return function(_0x4818aa){if(!_0x4818aa){_0x1c251f[_0xcbcf('0x19')](0x194);}return _0x4818aa;};}function handleError(_0x2b7ee2,_0x29009c){_0x29009c=_0x29009c||0x1f4;return function(_0x92a7b4){logger[_0xcbcf('0x27')](_0x92a7b4[_0xcbcf('0x28')]);if(_0x92a7b4[_0xcbcf('0x29')]){delete _0x92a7b4[_0xcbcf('0x29')];}_0x2b7ee2[_0xcbcf('0x1a')](_0x29009c)[_0xcbcf('0x2a')](_0x92a7b4);};}exports['index']=function(_0x3dd650,_0x304227){var _0x2d5546={},_0xe6179e={},_0x333f2f={'count':0x0,'rows':[]};var _0x3de8b0=_['map'](db[_0xcbcf('0x2b')][_0xcbcf('0x2c')],function(_0x3304af){return{'name':_0x3304af[_0xcbcf('0x2d')],'type':_0x3304af[_0xcbcf('0x2e')][_0xcbcf('0x2f')]};});_0xe6179e['model']=_[_0xcbcf('0x30')](_0x3de8b0,_0xcbcf('0x29'));_0xe6179e['query']=_['keys'](_0x3dd650[_0xcbcf('0x31')]);_0xe6179e['filters']=_[_0xcbcf('0x32')](_0xe6179e[_0xcbcf('0x33')],_0xe6179e[_0xcbcf('0x31')]);_0x2d5546[_0xcbcf('0x34')]=_['intersection'](_0xe6179e[_0xcbcf('0x33')],qs['fields'](_0x3dd650[_0xcbcf('0x31')][_0xcbcf('0x35')]));_0x2d5546[_0xcbcf('0x34')]=_0x2d5546[_0xcbcf('0x34')][_0xcbcf('0x36')]?_0x2d5546[_0xcbcf('0x34')]:_0xe6179e[_0xcbcf('0x33')];if(!_0x3dd650[_0xcbcf('0x31')]['hasOwnProperty']('nolimit')){_0x2d5546['limit']=qs[_0xcbcf('0x37')](_0x3dd650['query'][_0xcbcf('0x37')]);_0x2d5546['offset']=qs[_0xcbcf('0x1b')](_0x3dd650[_0xcbcf('0x31')]['offset']);}_0x2d5546[_0xcbcf('0x38')]=qs['sort'](_0x3dd650[_0xcbcf('0x31')]['sort']);_0x2d5546[_0xcbcf('0x39')]=qs[_0xcbcf('0x3a')](_[_0xcbcf('0x3b')](_0x3dd650[_0xcbcf('0x31')],_0xe6179e[_0xcbcf('0x3a')]),_0x3de8b0);if(_0x3dd650[_0xcbcf('0x31')][_0xcbcf('0x3c')]){_0x2d5546[_0xcbcf('0x39')]=_[_0xcbcf('0x3d')](_0x2d5546['where'],{'$or':_[_0xcbcf('0x30')](_0x3de8b0,function(_0x37a51e){if(_0x37a51e['type']!=='VIRTUAL'){var _0x44c27f={};_0x44c27f[_0x37a51e[_0xcbcf('0x29')]]={'$like':'%'+_0x3dd650[_0xcbcf('0x31')][_0xcbcf('0x3c')]+'%'};return _0x44c27f;}})});}_0x2d5546=_[_0xcbcf('0x3d')]({},_0x2d5546,_0x3dd650[_0xcbcf('0x3e')]);var _0x4914e3={'where':_0x2d5546[_0xcbcf('0x39')]};return db['AnalyticCustomReport'][_0xcbcf('0x1d')](_0x4914e3)['then'](function(_0x3c6ba5){_0x333f2f[_0xcbcf('0x1d')]=_0x3c6ba5;if(_0x3dd650[_0xcbcf('0x31')]['includeAll']){_0x2d5546[_0xcbcf('0x3f')]=[{'all':!![]}];}return db[_0xcbcf('0x2b')][_0xcbcf('0x40')](_0x2d5546);})[_0xcbcf('0x25')](function(_0x24c5f2){_0x333f2f['rows']=_0x24c5f2;return _0x333f2f;})[_0xcbcf('0x25')](respondWithFilteredResult(_0x304227,_0x2d5546))[_0xcbcf('0x41')](handleError(_0x304227,null));};exports[_0xcbcf('0x42')]=function(_0xb5a613,_0x44e1d0){var _0x10bd81={'raw':![],'where':{'id':_0xb5a613[_0xcbcf('0x43')]['id']}},_0x331751={};_0x331751['model']=_[_0xcbcf('0x44')](db['AnalyticCustomReport'][_0xcbcf('0x2c')]);_0x331751[_0xcbcf('0x31')]=_[_0xcbcf('0x44')](_0xb5a613[_0xcbcf('0x31')]);_0x331751[_0xcbcf('0x3a')]=_[_0xcbcf('0x32')](_0x331751[_0xcbcf('0x33')],_0x331751['query']);_0x10bd81['attributes']=_[_0xcbcf('0x32')](_0x331751[_0xcbcf('0x33')],qs[_0xcbcf('0x35')](_0xb5a613[_0xcbcf('0x31')][_0xcbcf('0x35')]));_0x10bd81[_0xcbcf('0x34')]=_0x10bd81['attributes'][_0xcbcf('0x36')]?_0x10bd81[_0xcbcf('0x34')]:_0x331751[_0xcbcf('0x33')];if(_0xb5a613[_0xcbcf('0x31')][_0xcbcf('0x45')]){_0x10bd81[_0xcbcf('0x3f')]=[{'all':!![]}];}_0x10bd81=_['merge']({},_0x10bd81,_0xb5a613[_0xcbcf('0x3e')]);return db['AnalyticCustomReport']['find'](_0x10bd81)[_0xcbcf('0x25')](handleEntityNotFound(_0x44e1d0,null))[_0xcbcf('0x25')](respondWithResult(_0x44e1d0,null))[_0xcbcf('0x41')](handleError(_0x44e1d0,null));};exports[_0xcbcf('0x46')]=function(_0xf6902c,_0x2f663d){return db[_0xcbcf('0x2b')]['create'](_0xf6902c[_0xcbcf('0x47')],{})[_0xcbcf('0x25')](function(_0x1bc5ca){var _0x431d7a=_0xf6902c[_0xcbcf('0x48')][_0xcbcf('0x22')]({'plain':!![]});if(!_0x431d7a)throw new Error(_0xcbcf('0x49'));if(_0x431d7a[_0xcbcf('0x4a')]==='user'){var _0x1b7f97=_0x1bc5ca[_0xcbcf('0x22')]({'plain':!![]});var _0x3bce80=_0xcbcf('0x4b');return db[_0xcbcf('0x4c')][_0xcbcf('0x4d')]({'where':{'name':_0x3bce80,'userProfileId':_0x431d7a[_0xcbcf('0x4e')]},'raw':!![]})[_0xcbcf('0x25')](function(_0x3a4f01){if(_0x3a4f01&&_0x3a4f01[_0xcbcf('0x4f')]===0x0){return db[_0xcbcf('0x23')][_0xcbcf('0x46')]({'name':_0x1b7f97[_0xcbcf('0x29')],'resourceId':_0x1b7f97['id'],'type':_0xcbcf('0x50'),'sectionId':_0x3a4f01['id']},{})[_0xcbcf('0x25')](function(){return _0x1bc5ca;});}else{return _0x1bc5ca;}})[_0xcbcf('0x41')](function(_0x9d0027){logger['error'](_0xcbcf('0x51'),_0x9d0027);throw _0x9d0027;});}return _0x1bc5ca;})[_0xcbcf('0x25')](respondWithResult(_0x2f663d,0xc9))[_0xcbcf('0x41')](handleError(_0x2f663d,null));};exports[_0xcbcf('0x52')]=function(_0x359354,_0x381b91){if(_0x359354[_0xcbcf('0x47')]['id']){delete _0x359354[_0xcbcf('0x47')]['id'];}return db['AnalyticCustomReport'][_0xcbcf('0x4d')]({'where':{'id':_0x359354['params']['id']}})['then'](handleEntityNotFound(_0x381b91,null))[_0xcbcf('0x25')](saveUpdates(_0x359354[_0xcbcf('0x47')],null))[_0xcbcf('0x25')](respondWithResult(_0x381b91,null))[_0xcbcf('0x41')](handleError(_0x381b91,null));};exports['destroy']=function(_0x40cf6b,_0xe94123){return db[_0xcbcf('0x2b')][_0xcbcf('0x4d')]({'where':{'id':_0x40cf6b['params']['id']}})['then'](handleEntityNotFound(_0xe94123,null))[_0xcbcf('0x25')](removeEntity(_0xe94123,null))[_0xcbcf('0x41')](handleError(_0xe94123,null));};exports[_0xcbcf('0x53')]=function(_0xe8760e,_0x57fc84){var _0x4c0226=0xa;var _0x5d2558=[_0xcbcf('0x54'),_0xcbcf('0x55'),'right_join',_0xcbcf('0x56')];var _0xe58dd2={'SUM':_0xcbcf('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcbcf('0x58'),'MAX':'MAX(%s)','MIN':_0xcbcf('0x59'),'AVG':_0xcbcf('0x5a'),'GROUP_CONCAT':_0xcbcf('0x5b'),'GROUP_CONCAT ASC':_0xcbcf('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c446c={'SEC_TO_TIME':_0xcbcf('0x5d'),'DATE':_0xcbcf('0x5e'),'HOUR':_0xcbcf('0x5f'),'ROUND':_0xcbcf('0x60'),'UNIX_TIMESTAMP':_0xcbcf('0x61')};var _0x363cae=function(_0x532b1d){return!_[_0xcbcf('0x62')]([_0xcbcf('0x63'),_0xcbcf('0x64'),_0xcbcf('0x65'),_0xcbcf('0x66')],_0x532b1d);};var _0x5b8cec=function(_0x584eb9){if(!_0x584eb9||!_0x584eb9[_0xcbcf('0x67')][_0xcbcf('0x36')]){return'';}for(var _0x25f7da='(',_0x8370fb=0x0;_0x8370fb<_0x584eb9[_0xcbcf('0x67')][_0xcbcf('0x36')];_0x8370fb+=0x1){_0x8370fb>0x0&&(_0x25f7da+='\x20'+_0x584eb9['operator']+'\x20');_0x25f7da+=_0x584eb9[_0xcbcf('0x67')][_0x8370fb]['group']?_0x5b8cec(_0x584eb9[_0xcbcf('0x67')][_0x8370fb][_0xcbcf('0x68')]):_0x584eb9[_0xcbcf('0x67')][_0x8370fb][_0xcbcf('0x69')]+'\x20'+_0x584eb9[_0xcbcf('0x67')][_0x8370fb]['condition']+(_0x363cae(_0x584eb9[_0xcbcf('0x67')][_0x8370fb][_0xcbcf('0x6a')])?'\x20'+_0x584eb9['rules'][_0x8370fb][_0xcbcf('0x6b')]:'');}return _0x25f7da+')';};var _0x3b116e={'where':{'id':_0xe8760e[_0xcbcf('0x43')]['id']}},_0x5b90f5,_0xcaa541,_0x3dc1f2,_0x843c8c,_0x4f06ae;_0x3b116e=_['merge']({},_0x3b116e,_0xe8760e[_0xcbcf('0x3e')]);return db[_0xcbcf('0x2b')][_0xcbcf('0x4d')](_0x3b116e)[_0xcbcf('0x25')](function(_0x227087){if(_0x227087){_0x5b90f5=_0x227087;return _0x227087[_0xcbcf('0x6c')]();}return null;})[_0xcbcf('0x25')](function(_0xd25c66){if(_0xd25c66){if(!_0xd25c66[_0xcbcf('0x36')]){throw new db[(_0xcbcf('0x6d'))][(_0xcbcf('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xcaa541=_0xd25c66;return db[_0xcbcf('0x6f')][_0xcbcf('0x40')]({'raw':!![]});}return null;})[_0xcbcf('0x25')](function(_0x178045){if(_0x178045){_0x3dc1f2=_[_0xcbcf('0x70')](_0x178045,'id');var _0x458759;var _0x4a589a=squel[_0xcbcf('0x71')]();_0x4a589a[_0xcbcf('0x72')](_0x5b90f5[_0xcbcf('0x73')]);for(var _0x316052=0x0;_0x316052<_0xcaa541[_0xcbcf('0x36')];_0x316052+=0x1){_0x458759=_0xcaa541[_0x316052][_0xcbcf('0x74')]?_0x3dc1f2[_0xcaa541[_0x316052][_0xcbcf('0x74')]]['metric']:_0xcaa541[_0x316052][_0xcbcf('0x69')];_0x458759=_0xcaa541[_0x316052][_0xcbcf('0x75')]?_[_0xcbcf('0x76')](_0xe58dd2[_0xcaa541[_0x316052]['function']],'%s',_0x458759):_0x458759;_0x458759=_0xcaa541[_0x316052]['format']?_[_0xcbcf('0x76')](_0x3c446c[_0xcaa541[_0x316052][_0xcbcf('0x77')]],'%s',_0x458759):_0x458759;if(_0xcaa541[_0x316052][_0xcbcf('0x78')]){_0x4a589a[_0xcbcf('0x68')](_0x458759);}_0xcaa541[_0x316052]['orderBy']&&_0x4a589a['order'](_0x458759,_0xcaa541[_0x316052][_0xcbcf('0x79')]===_0xcbcf('0x7a')?![]:!![]);_0x4a589a['field'](_0x458759,_0xcaa541[_0x316052][_0xcbcf('0x7b')]||_0x458759);}if(_0x5b90f5[_0xcbcf('0x7c')]){_0x5b90f5[_0xcbcf('0x7c')]=JSON['parse'](_0x5b90f5['joins']);for(var _0x17edad=0x0;_0x17edad<_0x5b90f5[_0xcbcf('0x7c')]['length'];_0x17edad+=0x1){if(_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x2e')]&&_[_0xcbcf('0x62')](_0x5d2558,_0x5b90f5[_0xcbcf('0x7c')][_0x17edad]['type'])&&_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7d')]&&_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7e')]&&_0x5b90f5[_0xcbcf('0x7c')][_0x17edad]['foreignKey']){_0x4a589a[_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x2e')]](_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7e')],null,util[_0xcbcf('0x77')](_0xcbcf('0x7f'),_0x5b90f5[_0xcbcf('0x73')],_0x5b90f5['joins'][_0x17edad]['parentKey'],_0x5b90f5[_0xcbcf('0x7c')][_0x17edad][_0xcbcf('0x7e')],_0x5b90f5['joins'][_0x17edad][_0xcbcf('0x80')]));}}}if(_0x5b90f5[_0xcbcf('0x81')]){_0x5b90f5['conditions']=JSON[_0xcbcf('0x82')](_0x5b90f5[_0xcbcf('0x81')]);_0x4a589a[_0xcbcf('0x39')](_0x5b8cec(_0x5b90f5[_0xcbcf('0x81')][_0xcbcf('0x68')]));}_0x4f06ae=_0x4a589a[_0xcbcf('0x83')]();_0x4a589a['limit'](_0x4c0226);_0x4a589a[_0xcbcf('0x1b')](0x0);logger[_0xcbcf('0x84')]('Limited\x20Query:',_0x4a589a[_0xcbcf('0x85')]());return dbH['sequelize'][_0xcbcf('0x31')](_0x4a589a['toString'](),{'type':dbH[_0xcbcf('0x86')][_0xcbcf('0x87')][_0xcbcf('0x88')]});}})[_0xcbcf('0x25')](respondWithResult(_0x57fc84,null))[_0xcbcf('0x41')](handleError(_0x57fc84,null));};function runReport(_0xc67c30,_0x45e27c,_0x561b34){var _0x3e2dec=_0x45e27c[_0xcbcf('0x29')];var _0x2503b2=0xa;var _0x25d7e6=[_0xcbcf('0x54'),_0xcbcf('0x55'),_0xcbcf('0x89'),_0xcbcf('0x56')];var _0x4214a1={'SUM':_0xcbcf('0x57'),'COUNT':_0xcbcf('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcbcf('0x8b'),'MIN':_0xcbcf('0x59'),'AVG':_0xcbcf('0x5a'),'GROUP_CONCAT':_0xcbcf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcbcf('0x8c')};var _0x4b2712={'SEC_TO_TIME':_0xcbcf('0x5d'),'DATE':_0xcbcf('0x5e'),'HOUR':_0xcbcf('0x5f'),'ROUND':_0xcbcf('0x60'),'UNIX_TIMESTAMP':_0xcbcf('0x61')};var _0x13722e=function(_0x3cab3f){return!_[_0xcbcf('0x62')]([_0xcbcf('0x63'),_0xcbcf('0x64'),_0xcbcf('0x65'),_0xcbcf('0x66')],_0x3cab3f);};var _0xfb4d5b=function(_0x4d06c1){if(!_0x4d06c1||!_0x4d06c1[_0xcbcf('0x67')][_0xcbcf('0x36')]){return'';}for(var _0x1134a8='(',_0x509826=0x0;_0x509826<_0x4d06c1['rules'][_0xcbcf('0x36')];_0x509826+=0x1){_0x509826>0x0&&(_0x1134a8+='\x20'+_0x4d06c1[_0xcbcf('0x8d')]+'\x20');_0x1134a8+=_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x68')]?_0xfb4d5b(_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x68')]):_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x69')]+'\x20'+_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x6a')]+(_0x13722e(_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x6a')])?'\x20'+_0x4d06c1[_0xcbcf('0x67')][_0x509826][_0xcbcf('0x6b')]:'');}return _0x1134a8+')';};var _0x1b9241={'where':{'id':_0xc67c30['id']}},_0x48779f,_0x49e878,_0x3c512c,_0x5b7502,_0x4ba1fa;_0x1b9241=_[_0xcbcf('0x3d')]({},_0x1b9241,_0x561b34);return db[_0xcbcf('0x2b')][_0xcbcf('0x4d')](_0x1b9241)['then'](function(_0xa822e9){if(_0xa822e9){_0x48779f=_0xa822e9;return _0xa822e9[_0xcbcf('0x6c')]();}return null;})[_0xcbcf('0x25')](function(_0x27e3c6){if(_0x27e3c6){if(!_0x27e3c6[_0xcbcf('0x36')]){throw new db[(_0xcbcf('0x6d'))][(_0xcbcf('0x6e'))](_0xcbcf('0x8e'),0x193);}_0x49e878=_0x27e3c6;return db[_0xcbcf('0x6f')][_0xcbcf('0x40')]({'raw':!![]});}return null;})[_0xcbcf('0x25')](function(_0x359c02){if(_0x359c02){_0x3c512c=_[_0xcbcf('0x70')](_0x359c02,'id');var _0x5696f0;var _0x44e4e0=squel['select']();_0x44e4e0['from'](_0x48779f[_0xcbcf('0x73')]);for(var _0x105106=0x0;_0x105106<_0x49e878[_0xcbcf('0x36')];_0x105106+=0x1){_0x5696f0=_0x49e878[_0x105106][_0xcbcf('0x74')]?_0x3c512c[_0x49e878[_0x105106][_0xcbcf('0x74')]]['metric']:_0x49e878[_0x105106][_0xcbcf('0x69')];_0x5696f0=_0x49e878[_0x105106][_0xcbcf('0x75')]?_[_0xcbcf('0x76')](_0x4214a1[_0x49e878[_0x105106]['function']],'%s',_0x5696f0):_0x5696f0;_0x5696f0=_0x49e878[_0x105106]['format']?_[_0xcbcf('0x76')](_0x4b2712[_0x49e878[_0x105106][_0xcbcf('0x77')]],'%s',_0x5696f0):_0x5696f0;if(_0x49e878[_0x105106][_0xcbcf('0x78')]){_0x44e4e0[_0xcbcf('0x68')](_0x5696f0);}_0x49e878[_0x105106][_0xcbcf('0x79')]&&_0x44e4e0['order'](_0x5696f0,_0x49e878[_0x105106]['orderBy']===_0xcbcf('0x7a')?![]:!![]);_0x44e4e0[_0xcbcf('0x69')](_0x5696f0,_0x49e878[_0x105106]['alias']||_0x5696f0);}if(_0x48779f[_0xcbcf('0x7c')]){_0x48779f['joins']=JSON[_0xcbcf('0x82')](_0x48779f[_0xcbcf('0x7c')]);for(var _0x1b41e4=0x0;_0x1b41e4<_0x48779f['joins'][_0xcbcf('0x36')];_0x1b41e4+=0x1){if(_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x2e')]&&_[_0xcbcf('0x62')](_0x25d7e6,_0x48779f['joins'][_0x1b41e4]['type'])&&_0x48779f['joins'][_0x1b41e4][_0xcbcf('0x7d')]&&_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x7e')]&&_0x48779f['joins'][_0x1b41e4]['foreignKey']){_0x44e4e0[_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x2e')]](_0x48779f['joins'][_0x1b41e4][_0xcbcf('0x7e')],null,util[_0xcbcf('0x77')](_0xcbcf('0x7f'),_0x48779f['table'],_0x48779f[_0xcbcf('0x7c')][_0x1b41e4]['parentKey'],_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x7e')],_0x48779f[_0xcbcf('0x7c')][_0x1b41e4][_0xcbcf('0x80')]));}}}if(_0x48779f[_0xcbcf('0x81')]){_0x48779f[_0xcbcf('0x81')]=JSON[_0xcbcf('0x82')](_0x48779f[_0xcbcf('0x81')]);_0x44e4e0[_0xcbcf('0x39')](_0xfb4d5b(_0x48779f['conditions']['group']));}_0x4ba1fa=_0x44e4e0[_0xcbcf('0x83')]();_0x44e4e0[_0xcbcf('0x37')](_0x2503b2);_0x44e4e0[_0xcbcf('0x1b')](0x0);return;}})[_0xcbcf('0x25')](function(){if(_0x45e27c[_0xcbcf('0x8f')]===_0xcbcf('0x90')){return null;}var _0x150388=_[_0xcbcf('0x3d')](_0x45e27c,{'name':_0x45e27c['fullPath']||_0x45e27c[_0xcbcf('0x29')]||_0x48779f[_0xcbcf('0x29')],'basename':_0x3e2dec,'savename':util['format']('%s-%s.%s',_0x45e27c['name']||_0x48779f['name'],require(_0xcbcf('0x91'))[_0xcbcf('0x92')](0x4),_0x45e27c[_0xcbcf('0x8f')]||_0xcbcf('0x93')),'reportId':_0x48779f['id'],'reportType':_0xcbcf('0x94')});return db[_0xcbcf('0x95')][_0xcbcf('0x46')](_0x150388,{'raw':!![]});})[_0xcbcf('0x25')](function(_0x506510){if(_0x48779f['table']===_0xcbcf('0x96')){_0x4ba1fa['where'](_0x48779f['table']+_0xcbcf('0x97'),_0x45e27c[_0xcbcf('0x98')],_0x45e27c[_0xcbcf('0x99')]);}else{_0x4ba1fa[_0xcbcf('0x39')](_0x48779f[_0xcbcf('0x73')]+_0xcbcf('0x9a'),_0x45e27c[_0xcbcf('0x98')],_0x45e27c[_0xcbcf('0x99')]);}if(_0x506510){logger['info'](_0xcbcf('0x9b'),_0x4ba1fa[_0xcbcf('0x85')]());require(_0xcbcf('0x9c'))[_0xcbcf('0x9d')](path[_0xcbcf('0x54')](__dirname,_0xcbcf('0x9e'),_0x506510[_0xcbcf('0x8f')]),[_0x506510['id'],_0x4ba1fa[_0xcbcf('0x85')](),path['join'](__dirname,_0xcbcf('0x9f'),_0x506510['savename']),_0x3e2dec]);return _0x506510;}else{var _0x41de32=squel[_0xcbcf('0x71')]();_0x41de32[_0xcbcf('0x72')]('('+_0x4ba1fa[_0xcbcf('0x85')]()+')',_0xcbcf('0xa0'));_0x41de32[_0xcbcf('0x69')]('COUNT(*)','count');_0x4ba1fa[_0xcbcf('0x37')](_0x45e27c['limit']||_0x2503b2);_0x4ba1fa['offset'](_0x45e27c[_0xcbcf('0x1b')]||0x0);return dbH[_0xcbcf('0x86')]['query'](_0x41de32[_0xcbcf('0x85')](),{'type':dbH['sequelize'][_0xcbcf('0x87')]['SELECT']})['then'](function(_0x3cc2a7){if(!_0x3cc2a7['length']){_0x5b7502=0x0;}else{_0x5b7502=_0x3cc2a7[0x0][_0xcbcf('0x1d')]||0x0;}return dbH['sequelize'][_0xcbcf('0x31')](_0x4ba1fa['toString'](),{'type':dbH[_0xcbcf('0x86')]['QueryTypes'][_0xcbcf('0x88')]});})[_0xcbcf('0x25')](function(_0xf09f40){return{'rows':_0xf09f40||[],'count':_0x5b7502};});}});}exports[_0xcbcf('0xa1')]=function(_0x1c6127,_0x49e778){return runReport(_0x1c6127['params'],_0x1c6127[_0xcbcf('0x31')],_0x1c6127[_0xcbcf('0x3e')])[_0xcbcf('0x25')](respondWithResult(_0x49e778,null))['catch'](handleError(_0x49e778,null));};exports[_0xcbcf('0xa2')]=runReport;exports['query']=function(_0x5155bb,_0x1837d7){var _0x4117d6=0xa;var _0xe8c040=['join','left_join',_0xcbcf('0x89'),_0xcbcf('0x56')];var _0x25704e={'SUM':_0xcbcf('0x57'),'COUNT':_0xcbcf('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcbcf('0x8b'),'MIN':_0xcbcf('0x59'),'AVG':_0xcbcf('0x5a'),'GROUP_CONCAT':_0xcbcf('0x5b'),'GROUP_CONCAT ASC':_0xcbcf('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2fc2a9={'SEC_TO_TIME':_0xcbcf('0x5d'),'DATE':_0xcbcf('0x5e'),'HOUR':_0xcbcf('0x5f'),'ROUND':_0xcbcf('0x60'),'UNIX_TIMESTAMP':_0xcbcf('0x61')};var _0x33d2e7=function(_0x2bf2a3){return!_['includes']([_0xcbcf('0x63'),_0xcbcf('0x64'),_0xcbcf('0x65'),_0xcbcf('0x66')],_0x2bf2a3);};var _0x45da11=function(_0x51f4c1){if(!_0x51f4c1||!_0x51f4c1[_0xcbcf('0x67')][_0xcbcf('0x36')]){return'';}for(var _0x705612='(',_0x44402d=0x0;_0x44402d<_0x51f4c1[_0xcbcf('0x67')][_0xcbcf('0x36')];_0x44402d+=0x1){_0x44402d>0x0&&(_0x705612+='\x20'+_0x51f4c1[_0xcbcf('0x8d')]+'\x20');_0x705612+=_0x51f4c1[_0xcbcf('0x67')][_0x44402d][_0xcbcf('0x68')]?_0x45da11(_0x51f4c1[_0xcbcf('0x67')][_0x44402d]['group']):_0x51f4c1[_0xcbcf('0x67')][_0x44402d][_0xcbcf('0x69')]+'\x20'+_0x51f4c1[_0xcbcf('0x67')][_0x44402d][_0xcbcf('0x6a')]+(_0x33d2e7(_0x51f4c1[_0xcbcf('0x67')][_0x44402d]['condition'])?'\x20'+_0x51f4c1[_0xcbcf('0x67')][_0x44402d]['value']:'');}return _0x705612+')';};var _0x58590c={'where':{'id':_0x5155bb[_0xcbcf('0x43')]['id']}},_0x33b957,_0x5c20df,_0x217ff1,_0x2c4e10,_0x4a5ec8;_0x58590c=_[_0xcbcf('0x3d')]({},_0x58590c,_0x5155bb['options']);return db[_0xcbcf('0x2b')]['find'](_0x58590c)['then'](function(_0x2cf0f8){if(_0x2cf0f8){_0x33b957=_0x2cf0f8;return _0x2cf0f8[_0xcbcf('0x6c')]();}return null;})[_0xcbcf('0x25')](function(_0x195794){if(_0x195794){if(!_0x195794[_0xcbcf('0x36')]){throw new db[(_0xcbcf('0x6d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5c20df=_0x195794;return db[_0xcbcf('0x6f')][_0xcbcf('0x40')]({'raw':!![]});}return null;})[_0xcbcf('0x25')](function(_0x5354cd){if(_0x5354cd){_0x217ff1=_[_0xcbcf('0x70')](_0x5354cd,'id');var _0x43eea6;var _0x560414=squel[_0xcbcf('0x71')]();_0x560414[_0xcbcf('0x72')](_0x33b957['table']);for(var _0x2dcd80=0x0;_0x2dcd80<_0x5c20df['length'];_0x2dcd80+=0x1){_0x43eea6=_0x5c20df[_0x2dcd80][_0xcbcf('0x74')]?_0x217ff1[_0x5c20df[_0x2dcd80][_0xcbcf('0x74')]]['metric']:_0x5c20df[_0x2dcd80][_0xcbcf('0x69')];_0x43eea6=_0x5c20df[_0x2dcd80][_0xcbcf('0x75')]?_[_0xcbcf('0x76')](_0x25704e[_0x5c20df[_0x2dcd80]['function']],'%s',_0x43eea6):_0x43eea6;_0x43eea6=_0x5c20df[_0x2dcd80][_0xcbcf('0x77')]?_[_0xcbcf('0x76')](_0x2fc2a9[_0x5c20df[_0x2dcd80][_0xcbcf('0x77')]],'%s',_0x43eea6):_0x43eea6;if(_0x5c20df[_0x2dcd80][_0xcbcf('0x78')]){_0x560414[_0xcbcf('0x68')](_0x43eea6);}_0x5c20df[_0x2dcd80][_0xcbcf('0x79')]&&_0x560414['order'](_0x43eea6,_0x5c20df[_0x2dcd80][_0xcbcf('0x79')]===_0xcbcf('0x7a')?![]:!![]);_0x560414['field'](_0x43eea6,_0x5c20df[_0x2dcd80]['alias']||_0x43eea6);}if(_0x33b957[_0xcbcf('0x7c')]){_0x33b957[_0xcbcf('0x7c')]=JSON[_0xcbcf('0x82')](_0x33b957[_0xcbcf('0x7c')]);for(var _0x363542=0x0;_0x363542<_0x33b957[_0xcbcf('0x7c')]['length'];_0x363542+=0x1){if(_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x2e')]&&_[_0xcbcf('0x62')](_0xe8c040,_0x33b957['joins'][_0x363542][_0xcbcf('0x2e')])&&_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x7d')]&&_0x33b957['joins'][_0x363542][_0xcbcf('0x7e')]&&_0x33b957[_0xcbcf('0x7c')][_0x363542]['foreignKey']){_0x560414[_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x2e')]](_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x7e')],null,util[_0xcbcf('0x77')](_0xcbcf('0x7f'),_0x33b957[_0xcbcf('0x73')],_0x33b957['joins'][_0x363542][_0xcbcf('0x7d')],_0x33b957[_0xcbcf('0x7c')][_0x363542][_0xcbcf('0x7e')],_0x33b957['joins'][_0x363542][_0xcbcf('0x80')]));}}}if(_0x33b957[_0xcbcf('0x81')]){_0x33b957['conditions']=JSON['parse'](_0x33b957[_0xcbcf('0x81')]);_0x560414[_0xcbcf('0x39')](_0x45da11(_0x33b957[_0xcbcf('0x81')][_0xcbcf('0x68')]));}_0x4a5ec8=_0x560414['clone']();_0x560414[_0xcbcf('0x37')](_0x4117d6);_0x560414[_0xcbcf('0x1b')](0x0);logger['debug'](_0xcbcf('0xa3'),_0x560414[_0xcbcf('0x85')]());return dbH[_0xcbcf('0x86')]['query'](_0x560414[_0xcbcf('0x85')](),{'type':dbH[_0xcbcf('0x86')][_0xcbcf('0x87')][_0xcbcf('0x88')]});}})[_0xcbcf('0x25')](function(){return{'sql':_0x4a5ec8['toString']()};})[_0xcbcf('0x25')](respondWithResult(_0x1837d7,null))[_0xcbcf('0x41')](handleError(_0x1837d7,null));};
\ No newline at end of file
+var _0xbd7b=['filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','rows','intersection','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','AVG(%s)','DATE(%s)','IS\x20NOT\x20EMPTY','operator','value','getFields','metric','%s.%s\x20=\x20%s.%s','clone','output','fullPath','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','replace','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x918995,_0x26561a){var _0x49c093=function(_0x238807){while(--_0x238807){_0x918995['push'](_0x918995['shift']());}};_0x49c093(++_0x26561a);}(_0xbd7b,0x10c));var _0xbbd7=function(_0x1e8bea,_0x47bde9){_0x1e8bea=_0x1e8bea-0x0;var _0x29f756=_0xbd7b[_0x1e8bea];return _0x29f756;};'use strict';var emlformat=require(_0xbbd7('0x0'));var rimraf=require(_0xbbd7('0x1'));var zipdir=require(_0xbbd7('0x2'));var jsonpatch=require(_0xbbd7('0x3'));var rp=require(_0xbbd7('0x4'));var moment=require(_0xbbd7('0x5'));var BPromise=require(_0xbbd7('0x6'));var Mustache=require(_0xbbd7('0x7'));var util=require(_0xbbd7('0x8'));var path=require('path');var sox=require(_0xbbd7('0x9'));var csv=require(_0xbbd7('0xa'));var ejs=require(_0xbbd7('0xb'));var fs=require('fs');var fs_extra=require(_0xbbd7('0xc'));var _=require(_0xbbd7('0xd'));var squel=require(_0xbbd7('0xe'));var crypto=require('crypto');var jsforce=require(_0xbbd7('0xf'));var deskjs=require(_0xbbd7('0x10'));var toCsv=require(_0xbbd7('0xa'));var querystring=require(_0xbbd7('0x11'));var Papa=require('papaparse');var Redis=require(_0xbbd7('0x12'));var authService=require(_0xbbd7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbbd7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbd7('0x15'))(_0xbbd7('0x16'));var utils=require(_0xbbd7('0x17'));var config=require(_0xbbd7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbbd7('0x19'))['db'];var dbH=require(_0xbbd7('0x19'))[_0xbbd7('0x1a')];function respondWithStatusCode(_0x22a0a9,_0x269617){_0x269617=_0x269617||0xcc;return function(_0x2f5045){if(_0x2f5045){return _0x22a0a9[_0xbbd7('0x1b')](_0x269617);}return _0x22a0a9[_0xbbd7('0x1c')](_0x269617)[_0xbbd7('0x1d')]();};}function respondWithResult(_0x242e47,_0x475acf){_0x475acf=_0x475acf||0xc8;return function(_0x32ad90){if(_0x32ad90){return _0x242e47[_0xbbd7('0x1c')](_0x475acf)['json'](_0x32ad90);}};}function respondWithFilteredResult(_0x36a1df,_0x3e2a90){return function(_0x2c2ff0){if(_0x2c2ff0){var _0x572217=typeof _0x3e2a90['offset']==='undefined'&&typeof _0x3e2a90['limit']===_0xbbd7('0x1e');var _0x2afbd4=_0x2c2ff0[_0xbbd7('0x1f')];var _0xf9634=_0x572217?0x0:_0x3e2a90[_0xbbd7('0x20')];var _0x45cdbb=_0x572217?_0x2c2ff0[_0xbbd7('0x1f')]:_0x3e2a90[_0xbbd7('0x20')]+_0x3e2a90[_0xbbd7('0x21')];var _0xa76ebe;if(_0x45cdbb>=_0x2afbd4){_0x45cdbb=_0x2afbd4;_0xa76ebe=0xc8;}else{_0xa76ebe=0xce;}_0x36a1df[_0xbbd7('0x1c')](_0xa76ebe);return _0x36a1df[_0xbbd7('0x22')](_0xbbd7('0x23'),_0xf9634+'-'+_0x45cdbb+'/'+_0x2afbd4)[_0xbbd7('0x24')](_0x2c2ff0);}return null;};}function patchUpdates(_0x5ac496){return function(_0x2ceaf3){try{jsonpatch[_0xbbd7('0x25')](_0x2ceaf3,_0x5ac496,!![]);}catch(_0x12621a){return BPromise[_0xbbd7('0x26')](_0x12621a);}return _0x2ceaf3[_0xbbd7('0x27')]();};}function saveUpdates(_0x2cb62a,_0x5ea98a){return function(_0x3ac08e){if(_0x3ac08e){return _0x3ac08e[_0xbbd7('0x28')](_0x2cb62a)[_0xbbd7('0x29')](function(_0x1842e5){return _0x1842e5;});}return null;};}function removeEntity(_0x49bf26,_0x5217a0){return function(_0x8e7e64){if(_0x8e7e64){return _0x8e7e64[_0xbbd7('0x2a')]()[_0xbbd7('0x29')](function(){var _0x4badff=_0x8e7e64['get']({'plain':!![]});var _0x30de='CustomReports';return db['UserProfileResource'][_0xbbd7('0x2a')]({'where':{'type':_0x30de,'resourceId':_0x4badff['id']}})[_0xbbd7('0x29')](function(){return _0x8e7e64;});})['then'](function(){_0x49bf26[_0xbbd7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e05e,_0x3e8e6a){return function(_0x1f1ac2){if(!_0x1f1ac2){_0x51e05e[_0xbbd7('0x1b')](0x194);}return _0x1f1ac2;};}function handleError(_0x2073de,_0x4e7dca){_0x4e7dca=_0x4e7dca||0x1f4;return function(_0x36cd6d){logger['error'](_0x36cd6d[_0xbbd7('0x2b')]);if(_0x36cd6d[_0xbbd7('0x2c')]){delete _0x36cd6d[_0xbbd7('0x2c')];}_0x2073de['status'](_0x4e7dca)['send'](_0x36cd6d);};}exports['index']=function(_0x27b6b2,_0x1d5ae9){var _0x5eeddb={},_0x1974fa={},_0xb1bb78={'count':0x0,'rows':[]};var _0xc3fbbe=_[_0xbbd7('0x2d')](db['AnalyticCustomReport'][_0xbbd7('0x2e')],function(_0x5414fe){return{'name':_0x5414fe[_0xbbd7('0x2f')],'type':_0x5414fe[_0xbbd7('0x30')][_0xbbd7('0x31')]};});_0x1974fa[_0xbbd7('0x32')]=_['map'](_0xc3fbbe,_0xbbd7('0x2c'));_0x1974fa[_0xbbd7('0x33')]=_[_0xbbd7('0x34')](_0x27b6b2[_0xbbd7('0x33')]);_0x1974fa[_0xbbd7('0x35')]=_['intersection'](_0x1974fa['model'],_0x1974fa['query']);_0x5eeddb[_0xbbd7('0x36')]=_['intersection'](_0x1974fa['model'],qs[_0xbbd7('0x37')](_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x37')]));_0x5eeddb[_0xbbd7('0x36')]=_0x5eeddb[_0xbbd7('0x36')][_0xbbd7('0x38')]?_0x5eeddb[_0xbbd7('0x36')]:_0x1974fa['model'];if(!_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x39')]('nolimit')){_0x5eeddb[_0xbbd7('0x21')]=qs['limit'](_0x27b6b2['query'][_0xbbd7('0x21')]);_0x5eeddb['offset']=qs[_0xbbd7('0x20')](_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x20')]);}_0x5eeddb[_0xbbd7('0x3a')]=qs[_0xbbd7('0x3b')](_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x3b')]);_0x5eeddb[_0xbbd7('0x3c')]=qs[_0xbbd7('0x35')](_[_0xbbd7('0x3d')](_0x27b6b2[_0xbbd7('0x33')],_0x1974fa[_0xbbd7('0x35')]),_0xc3fbbe);if(_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x3e')]){_0x5eeddb[_0xbbd7('0x3c')]=_[_0xbbd7('0x3f')](_0x5eeddb[_0xbbd7('0x3c')],{'$or':_[_0xbbd7('0x2d')](_0xc3fbbe,function(_0xa7ed39){if(_0xa7ed39[_0xbbd7('0x30')]!==_0xbbd7('0x40')){var _0x543eb7={};_0x543eb7[_0xa7ed39[_0xbbd7('0x2c')]]={'$like':'%'+_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x3e')]+'%'};return _0x543eb7;}})});}_0x5eeddb=_[_0xbbd7('0x3f')]({},_0x5eeddb,_0x27b6b2[_0xbbd7('0x41')]);var _0x59d02b={'where':_0x5eeddb[_0xbbd7('0x3c')]};return db[_0xbbd7('0x42')][_0xbbd7('0x1f')](_0x59d02b)[_0xbbd7('0x29')](function(_0x3b622b){_0xb1bb78[_0xbbd7('0x1f')]=_0x3b622b;if(_0x27b6b2[_0xbbd7('0x33')][_0xbbd7('0x43')]){_0x5eeddb[_0xbbd7('0x44')]=[{'all':!![]}];}return db[_0xbbd7('0x42')][_0xbbd7('0x45')](_0x5eeddb);})['then'](function(_0x38dc1b){_0xb1bb78[_0xbbd7('0x46')]=_0x38dc1b;return _0xb1bb78;})[_0xbbd7('0x29')](respondWithFilteredResult(_0x1d5ae9,_0x5eeddb))['catch'](handleError(_0x1d5ae9,null));};exports['show']=function(_0x135e41,_0x2c01ad){var _0x3042d1={'raw':![],'where':{'id':_0x135e41['params']['id']}},_0x63bd9b={};_0x63bd9b[_0xbbd7('0x32')]=_[_0xbbd7('0x34')](db[_0xbbd7('0x42')][_0xbbd7('0x2e')]);_0x63bd9b[_0xbbd7('0x33')]=_[_0xbbd7('0x34')](_0x135e41[_0xbbd7('0x33')]);_0x63bd9b['filters']=_['intersection'](_0x63bd9b[_0xbbd7('0x32')],_0x63bd9b[_0xbbd7('0x33')]);_0x3042d1[_0xbbd7('0x36')]=_[_0xbbd7('0x47')](_0x63bd9b[_0xbbd7('0x32')],qs[_0xbbd7('0x37')](_0x135e41[_0xbbd7('0x33')][_0xbbd7('0x37')]));_0x3042d1[_0xbbd7('0x36')]=_0x3042d1[_0xbbd7('0x36')][_0xbbd7('0x38')]?_0x3042d1[_0xbbd7('0x36')]:_0x63bd9b[_0xbbd7('0x32')];if(_0x135e41[_0xbbd7('0x33')][_0xbbd7('0x43')]){_0x3042d1[_0xbbd7('0x44')]=[{'all':!![]}];}_0x3042d1=_[_0xbbd7('0x3f')]({},_0x3042d1,_0x135e41['options']);return db['AnalyticCustomReport'][_0xbbd7('0x48')](_0x3042d1)[_0xbbd7('0x29')](handleEntityNotFound(_0x2c01ad,null))[_0xbbd7('0x29')](respondWithResult(_0x2c01ad,null))[_0xbbd7('0x49')](handleError(_0x2c01ad,null));};exports[_0xbbd7('0x4a')]=function(_0x864056,_0x5c6f28){return db['AnalyticCustomReport'][_0xbbd7('0x4a')](_0x864056['body'],{})[_0xbbd7('0x29')](function(_0x87f316){var _0x4a04e1=_0x864056['user'][_0xbbd7('0x4b')]({'plain':!![]});if(!_0x4a04e1)throw new Error(_0xbbd7('0x4c'));if(_0x4a04e1[_0xbbd7('0x4d')]==='user'){var _0x2334ad=_0x87f316[_0xbbd7('0x4b')]({'plain':!![]});var _0x5cf40a=_0xbbd7('0x4e');return db['UserProfileSection'][_0xbbd7('0x48')]({'where':{'name':_0x5cf40a,'userProfileId':_0x4a04e1[_0xbbd7('0x4f')]},'raw':!![]})[_0xbbd7('0x29')](function(_0x30d05d){if(_0x30d05d&&_0x30d05d[_0xbbd7('0x50')]===0x0){return db[_0xbbd7('0x51')][_0xbbd7('0x4a')]({'name':_0x2334ad[_0xbbd7('0x2c')],'resourceId':_0x2334ad['id'],'type':_0xbbd7('0x52'),'sectionId':_0x30d05d['id']},{})[_0xbbd7('0x29')](function(){return _0x87f316;});}else{return _0x87f316;}})[_0xbbd7('0x49')](function(_0x597481){logger['error'](_0xbbd7('0x53'),_0x597481);throw _0x597481;});}return _0x87f316;})[_0xbbd7('0x29')](respondWithResult(_0x5c6f28,0xc9))[_0xbbd7('0x49')](handleError(_0x5c6f28,null));};exports[_0xbbd7('0x28')]=function(_0x412b08,_0x4f6c82){if(_0x412b08[_0xbbd7('0x54')]['id']){delete _0x412b08[_0xbbd7('0x54')]['id'];}return db['AnalyticCustomReport'][_0xbbd7('0x48')]({'where':{'id':_0x412b08['params']['id']}})[_0xbbd7('0x29')](handleEntityNotFound(_0x4f6c82,null))['then'](saveUpdates(_0x412b08[_0xbbd7('0x54')],null))[_0xbbd7('0x29')](respondWithResult(_0x4f6c82,null))[_0xbbd7('0x49')](handleError(_0x4f6c82,null));};exports[_0xbbd7('0x2a')]=function(_0x47eabd,_0xe8c16e){return db['AnalyticCustomReport']['find']({'where':{'id':_0x47eabd[_0xbbd7('0x55')]['id']}})[_0xbbd7('0x29')](handleEntityNotFound(_0xe8c16e,null))[_0xbbd7('0x29')](removeEntity(_0xe8c16e,null))[_0xbbd7('0x49')](handleError(_0xe8c16e,null));};exports[_0xbbd7('0x56')]=function(_0x4976c8,_0x3f8b60){var _0x33bd6f=0xa;var _0xb109bf=[_0xbbd7('0x57'),_0xbbd7('0x58'),'right_join','cross_join'];var _0x4c8ab4={'SUM':_0xbbd7('0x59'),'COUNT':_0xbbd7('0x5a'),'COUNT DISTINCT':_0xbbd7('0x5b'),'MAX':'MAX(%s)','MIN':_0xbbd7('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbbd7('0x5d'),'GROUP_CONCAT ASC':_0xbbd7('0x5e'),'GROUP_CONCAT DESC':_0xbbd7('0x5f')};var _0x177abb={'SEC_TO_TIME':_0xbbd7('0x60'),'DATE':'DATE(%s)','HOUR':_0xbbd7('0x61'),'ROUND':_0xbbd7('0x62'),'UNIX_TIMESTAMP':_0xbbd7('0x63')};var _0x4b9314=function(_0x3de454){return!_['includes']([_0xbbd7('0x64'),_0xbbd7('0x65'),_0xbbd7('0x66'),'IS\x20NOT\x20EMPTY'],_0x3de454);};var _0x4331ab=function(_0x20f41b){if(!_0x20f41b||!_0x20f41b[_0xbbd7('0x67')][_0xbbd7('0x38')]){return'';}for(var _0x19265f='(',_0x46edbb=0x0;_0x46edbb<_0x20f41b[_0xbbd7('0x67')][_0xbbd7('0x38')];_0x46edbb+=0x1){_0x46edbb>0x0&&(_0x19265f+='\x20'+_0x20f41b['operator']+'\x20');_0x19265f+=_0x20f41b[_0xbbd7('0x67')][_0x46edbb][_0xbbd7('0x68')]?_0x4331ab(_0x20f41b[_0xbbd7('0x67')][_0x46edbb]['group']):_0x20f41b['rules'][_0x46edbb]['field']+'\x20'+_0x20f41b[_0xbbd7('0x67')][_0x46edbb][_0xbbd7('0x69')]+(_0x4b9314(_0x20f41b[_0xbbd7('0x67')][_0x46edbb][_0xbbd7('0x69')])?'\x20'+_0x20f41b['rules'][_0x46edbb]['value']:'');}return _0x19265f+')';};var _0x1cf366={'where':{'id':_0x4976c8[_0xbbd7('0x55')]['id']}},_0x5e471c,_0x1e640b,_0x1d39e0,_0x4c5c05,_0x5de3b6;_0x1cf366=_[_0xbbd7('0x3f')]({},_0x1cf366,_0x4976c8[_0xbbd7('0x41')]);return db[_0xbbd7('0x42')][_0xbbd7('0x48')](_0x1cf366)[_0xbbd7('0x29')](function(_0x306444){if(_0x306444){_0x5e471c=_0x306444;return _0x306444['getFields']();}return null;})['then'](function(_0xb0e1a3){if(_0xb0e1a3){if(!_0xb0e1a3['length']){throw new db[(_0xbbd7('0x6a'))][(_0xbbd7('0x6b'))](_0xbbd7('0x6c'),0x193);}_0x1e640b=_0xb0e1a3;return db[_0xbbd7('0x6d')][_0xbbd7('0x45')]({'raw':!![]});}return null;})[_0xbbd7('0x29')](function(_0x41f6bd){if(_0x41f6bd){_0x1d39e0=_[_0xbbd7('0x6e')](_0x41f6bd,'id');var _0x3fca93;var _0x30c361=squel[_0xbbd7('0x6f')]();_0x30c361[_0xbbd7('0x70')](_0x5e471c[_0xbbd7('0x71')]);for(var _0x1954b5=0x0;_0x1954b5<_0x1e640b[_0xbbd7('0x38')];_0x1954b5+=0x1){_0x3fca93=_0x1e640b[_0x1954b5]['MetricId']?_0x1d39e0[_0x1e640b[_0x1954b5][_0xbbd7('0x72')]]['metric']:_0x1e640b[_0x1954b5][_0xbbd7('0x73')];_0x3fca93=_0x1e640b[_0x1954b5][_0xbbd7('0x74')]?_['replace'](_0x4c8ab4[_0x1e640b[_0x1954b5][_0xbbd7('0x74')]],'%s',_0x3fca93):_0x3fca93;_0x3fca93=_0x1e640b[_0x1954b5][_0xbbd7('0x75')]?_['replace'](_0x177abb[_0x1e640b[_0x1954b5][_0xbbd7('0x75')]],'%s',_0x3fca93):_0x3fca93;if(_0x1e640b[_0x1954b5][_0xbbd7('0x76')]){_0x30c361['group'](_0x3fca93);}_0x1e640b[_0x1954b5][_0xbbd7('0x77')]&&_0x30c361[_0xbbd7('0x3a')](_0x3fca93,_0x1e640b[_0x1954b5]['orderBy']===_0xbbd7('0x78')?![]:!![]);_0x30c361[_0xbbd7('0x73')](_0x3fca93,_0x1e640b[_0x1954b5][_0xbbd7('0x79')]||_0x3fca93);}if(_0x5e471c[_0xbbd7('0x7a')]){_0x5e471c[_0xbbd7('0x7a')]=JSON[_0xbbd7('0x7b')](_0x5e471c[_0xbbd7('0x7a')]);for(var _0x4496d4=0x0;_0x4496d4<_0x5e471c[_0xbbd7('0x7a')][_0xbbd7('0x38')];_0x4496d4+=0x1){if(_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x30')]&&_[_0xbbd7('0x7c')](_0xb109bf,_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x30')])&&_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7d')]&&_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7e')]&&_0x5e471c[_0xbbd7('0x7a')][_0x4496d4]['foreignKey']){_0x30c361[_0x5e471c['joins'][_0x4496d4][_0xbbd7('0x30')]](_0x5e471c['joins'][_0x4496d4][_0xbbd7('0x7e')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5e471c[_0xbbd7('0x71')],_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7d')],_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7e')],_0x5e471c[_0xbbd7('0x7a')][_0x4496d4][_0xbbd7('0x7f')]));}}}if(_0x5e471c[_0xbbd7('0x80')]){_0x5e471c[_0xbbd7('0x80')]=JSON[_0xbbd7('0x7b')](_0x5e471c[_0xbbd7('0x80')]);_0x30c361[_0xbbd7('0x3c')](_0x4331ab(_0x5e471c[_0xbbd7('0x80')][_0xbbd7('0x68')]));}_0x5de3b6=_0x30c361['clone']();_0x30c361[_0xbbd7('0x21')](_0x33bd6f);_0x30c361[_0xbbd7('0x20')](0x0);logger[_0xbbd7('0x81')]('Limited\x20Query:',_0x30c361[_0xbbd7('0x82')]());return dbH[_0xbbd7('0x83')]['query'](_0x30c361[_0xbbd7('0x82')](),{'type':dbH[_0xbbd7('0x83')][_0xbbd7('0x84')][_0xbbd7('0x85')]});}})[_0xbbd7('0x29')](respondWithResult(_0x3f8b60,null))[_0xbbd7('0x49')](handleError(_0x3f8b60,null));};function runReport(_0x37b528,_0x5f0206,_0x3b3f44){var _0x116a95=_0x5f0206[_0xbbd7('0x2c')];var _0x1333aa=0xa;var _0x52124b=[_0xbbd7('0x57'),_0xbbd7('0x58'),'right_join',_0xbbd7('0x86')];var _0xa387cf={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbbd7('0x5b'),'MAX':_0xbbd7('0x87'),'MIN':_0xbbd7('0x5c'),'AVG':_0xbbd7('0x88'),'GROUP_CONCAT':_0xbbd7('0x5d'),'GROUP_CONCAT ASC':_0xbbd7('0x5e'),'GROUP_CONCAT DESC':_0xbbd7('0x5f')};var _0x1ea571={'SEC_TO_TIME':_0xbbd7('0x60'),'DATE':_0xbbd7('0x89'),'HOUR':_0xbbd7('0x61'),'ROUND':_0xbbd7('0x62'),'UNIX_TIMESTAMP':_0xbbd7('0x63')};var _0x2b45ac=function(_0x139f99){return!_[_0xbbd7('0x7c')]([_0xbbd7('0x64'),_0xbbd7('0x65'),_0xbbd7('0x66'),_0xbbd7('0x8a')],_0x139f99);};var _0x48e49e=function(_0x1bde48){if(!_0x1bde48||!_0x1bde48[_0xbbd7('0x67')][_0xbbd7('0x38')]){return'';}for(var _0x2947c2='(',_0x5a217d=0x0;_0x5a217d<_0x1bde48[_0xbbd7('0x67')]['length'];_0x5a217d+=0x1){_0x5a217d>0x0&&(_0x2947c2+='\x20'+_0x1bde48[_0xbbd7('0x8b')]+'\x20');_0x2947c2+=_0x1bde48[_0xbbd7('0x67')][_0x5a217d]['group']?_0x48e49e(_0x1bde48['rules'][_0x5a217d]['group']):_0x1bde48[_0xbbd7('0x67')][_0x5a217d]['field']+'\x20'+_0x1bde48[_0xbbd7('0x67')][_0x5a217d][_0xbbd7('0x69')]+(_0x2b45ac(_0x1bde48[_0xbbd7('0x67')][_0x5a217d]['condition'])?'\x20'+_0x1bde48[_0xbbd7('0x67')][_0x5a217d][_0xbbd7('0x8c')]:'');}return _0x2947c2+')';};var _0x5d303d={'where':{'id':_0x37b528['id']}},_0x4de02d,_0x1869c2,_0x3ed0c8,_0xb47b5b,_0xdcef54;_0x5d303d=_['merge']({},_0x5d303d,_0x3b3f44);return db[_0xbbd7('0x42')][_0xbbd7('0x48')](_0x5d303d)[_0xbbd7('0x29')](function(_0x4d2a8f){if(_0x4d2a8f){_0x4de02d=_0x4d2a8f;return _0x4d2a8f[_0xbbd7('0x8d')]();}return null;})['then'](function(_0x44abc9){if(_0x44abc9){if(!_0x44abc9['length']){throw new db['Sequelize'][(_0xbbd7('0x6b'))](_0xbbd7('0x6c'),0x193);}_0x1869c2=_0x44abc9;return db[_0xbbd7('0x6d')][_0xbbd7('0x45')]({'raw':!![]});}return null;})[_0xbbd7('0x29')](function(_0x1ee357){if(_0x1ee357){_0x3ed0c8=_[_0xbbd7('0x6e')](_0x1ee357,'id');var _0x385665;var _0x225e60=squel['select']();_0x225e60['from'](_0x4de02d['table']);for(var _0x3725c5=0x0;_0x3725c5<_0x1869c2[_0xbbd7('0x38')];_0x3725c5+=0x1){_0x385665=_0x1869c2[_0x3725c5]['MetricId']?_0x3ed0c8[_0x1869c2[_0x3725c5][_0xbbd7('0x72')]][_0xbbd7('0x8e')]:_0x1869c2[_0x3725c5]['field'];_0x385665=_0x1869c2[_0x3725c5][_0xbbd7('0x74')]?_['replace'](_0xa387cf[_0x1869c2[_0x3725c5][_0xbbd7('0x74')]],'%s',_0x385665):_0x385665;_0x385665=_0x1869c2[_0x3725c5]['format']?_['replace'](_0x1ea571[_0x1869c2[_0x3725c5][_0xbbd7('0x75')]],'%s',_0x385665):_0x385665;if(_0x1869c2[_0x3725c5][_0xbbd7('0x76')]){_0x225e60[_0xbbd7('0x68')](_0x385665);}_0x1869c2[_0x3725c5]['orderBy']&&_0x225e60['order'](_0x385665,_0x1869c2[_0x3725c5][_0xbbd7('0x77')]===_0xbbd7('0x78')?![]:!![]);_0x225e60['field'](_0x385665,_0x1869c2[_0x3725c5][_0xbbd7('0x79')]||_0x385665);}if(_0x4de02d['joins']){_0x4de02d[_0xbbd7('0x7a')]=JSON[_0xbbd7('0x7b')](_0x4de02d[_0xbbd7('0x7a')]);for(var _0x32c132=0x0;_0x32c132<_0x4de02d['joins'][_0xbbd7('0x38')];_0x32c132+=0x1){if(_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x30')]&&_[_0xbbd7('0x7c')](_0x52124b,_0x4de02d['joins'][_0x32c132][_0xbbd7('0x30')])&&_0x4de02d['joins'][_0x32c132][_0xbbd7('0x7d')]&&_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x7e')]&&_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x7f')]){_0x225e60[_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x30')]](_0x4de02d[_0xbbd7('0x7a')][_0x32c132][_0xbbd7('0x7e')],null,util[_0xbbd7('0x75')](_0xbbd7('0x8f'),_0x4de02d[_0xbbd7('0x71')],_0x4de02d[_0xbbd7('0x7a')][_0x32c132]['parentKey'],_0x4de02d['joins'][_0x32c132][_0xbbd7('0x7e')],_0x4de02d['joins'][_0x32c132]['foreignKey']));}}}if(_0x4de02d[_0xbbd7('0x80')]){_0x4de02d[_0xbbd7('0x80')]=JSON[_0xbbd7('0x7b')](_0x4de02d['conditions']);_0x225e60[_0xbbd7('0x3c')](_0x48e49e(_0x4de02d['conditions'][_0xbbd7('0x68')]));}_0xdcef54=_0x225e60[_0xbbd7('0x90')]();_0x225e60[_0xbbd7('0x21')](_0x1333aa);_0x225e60[_0xbbd7('0x20')](0x0);return;}})[_0xbbd7('0x29')](function(){if(_0x5f0206[_0xbbd7('0x91')]==='web'){return null;}var _0x30a060=_[_0xbbd7('0x3f')](_0x5f0206,{'name':_0x5f0206[_0xbbd7('0x92')]||_0x5f0206[_0xbbd7('0x2c')]||_0x4de02d[_0xbbd7('0x2c')],'basename':_0x116a95,'savename':util[_0xbbd7('0x75')](_0xbbd7('0x93'),_0x5f0206[_0xbbd7('0x2c')]||_0x4de02d[_0xbbd7('0x2c')],require(_0xbbd7('0x94'))[_0xbbd7('0x95')](0x4),_0x5f0206[_0xbbd7('0x91')]||'csv'),'reportId':_0x4de02d['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xbbd7('0x4a')](_0x30a060,{'raw':!![]});})[_0xbbd7('0x29')](function(_0xc11665){if(_0x4de02d[_0xbbd7('0x71')]===_0xbbd7('0x96')){_0xdcef54[_0xbbd7('0x3c')](_0x4de02d['table']+_0xbbd7('0x97'),_0x5f0206[_0xbbd7('0x98')],_0x5f0206[_0xbbd7('0x99')]);}else{_0xdcef54[_0xbbd7('0x3c')](_0x4de02d[_0xbbd7('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f0206[_0xbbd7('0x98')],_0x5f0206[_0xbbd7('0x99')]);}if(_0xc11665){logger[_0xbbd7('0x9a')]('Run\x20Query:',_0xdcef54['toString']());require(_0xbbd7('0x9b'))[_0xbbd7('0x9c')](path[_0xbbd7('0x57')](__dirname,_0xbbd7('0x9d'),_0xc11665[_0xbbd7('0x91')]),[_0xc11665['id'],_0xdcef54['toString'](),path[_0xbbd7('0x57')](__dirname,_0xbbd7('0x9e'),_0xc11665['savename']),_0x116a95]);return _0xc11665;}else{var _0x256a5a=squel[_0xbbd7('0x6f')]();_0x256a5a[_0xbbd7('0x70')]('('+_0xdcef54[_0xbbd7('0x82')]()+')',_0xbbd7('0x9f'));_0x256a5a[_0xbbd7('0x73')](_0xbbd7('0xa0'),'count');_0xdcef54[_0xbbd7('0x21')](_0x5f0206[_0xbbd7('0x21')]||_0x1333aa);_0xdcef54[_0xbbd7('0x20')](_0x5f0206[_0xbbd7('0x20')]||0x0);return dbH[_0xbbd7('0x83')]['query'](_0x256a5a['toString'](),{'type':dbH[_0xbbd7('0x83')][_0xbbd7('0x84')]['SELECT']})['then'](function(_0x13a456){if(!_0x13a456['length']){_0xb47b5b=0x0;}else{_0xb47b5b=_0x13a456[0x0][_0xbbd7('0x1f')]||0x0;}return dbH[_0xbbd7('0x83')]['query'](_0xdcef54[_0xbbd7('0x82')](),{'type':dbH[_0xbbd7('0x83')][_0xbbd7('0x84')][_0xbbd7('0x85')]});})[_0xbbd7('0x29')](function(_0x6d6049){return{'rows':_0x6d6049||[],'count':_0xb47b5b};});}});}exports[_0xbbd7('0xa1')]=function(_0x479b55,_0x232db1){return runReport(_0x479b55[_0xbbd7('0x55')],_0x479b55[_0xbbd7('0x33')],_0x479b55[_0xbbd7('0x41')])[_0xbbd7('0x29')](respondWithResult(_0x232db1,null))[_0xbbd7('0x49')](handleError(_0x232db1,null));};exports[_0xbbd7('0xa2')]=runReport;exports[_0xbbd7('0x33')]=function(_0x41eef0,_0xbf2320){var _0x5daabd=0xa;var _0x231020=['join',_0xbbd7('0x58'),'right_join',_0xbbd7('0x86')];var _0x905401={'SUM':_0xbbd7('0x59'),'COUNT':_0xbbd7('0x5a'),'COUNT DISTINCT':_0xbbd7('0x5b'),'MAX':_0xbbd7('0x87'),'MIN':_0xbbd7('0x5c'),'AVG':_0xbbd7('0x88'),'GROUP_CONCAT':_0xbbd7('0x5d'),'GROUP_CONCAT ASC':_0xbbd7('0x5e'),'GROUP_CONCAT DESC':_0xbbd7('0x5f')};var _0xe7710d={'SEC_TO_TIME':_0xbbd7('0x60'),'DATE':'DATE(%s)','HOUR':_0xbbd7('0x61'),'ROUND':_0xbbd7('0x62'),'UNIX_TIMESTAMP':_0xbbd7('0x63')};var _0x59c0c0=function(_0x4b525f){return!_[_0xbbd7('0x7c')]([_0xbbd7('0x64'),_0xbbd7('0x65'),_0xbbd7('0x66'),'IS\x20NOT\x20EMPTY'],_0x4b525f);};var _0x572724=function(_0x24215b){if(!_0x24215b||!_0x24215b[_0xbbd7('0x67')][_0xbbd7('0x38')]){return'';}for(var _0x14cce9='(',_0x2d23d9=0x0;_0x2d23d9<_0x24215b['rules'][_0xbbd7('0x38')];_0x2d23d9+=0x1){_0x2d23d9>0x0&&(_0x14cce9+='\x20'+_0x24215b[_0xbbd7('0x8b')]+'\x20');_0x14cce9+=_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x68')]?_0x572724(_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x68')]):_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x73')]+'\x20'+_0x24215b['rules'][_0x2d23d9][_0xbbd7('0x69')]+(_0x59c0c0(_0x24215b[_0xbbd7('0x67')][_0x2d23d9][_0xbbd7('0x69')])?'\x20'+_0x24215b['rules'][_0x2d23d9][_0xbbd7('0x8c')]:'');}return _0x14cce9+')';};var _0x185b27={'where':{'id':_0x41eef0[_0xbbd7('0x55')]['id']}},_0x46a097,_0x42a282,_0x544701,_0x3f0252,_0x12335c;_0x185b27=_[_0xbbd7('0x3f')]({},_0x185b27,_0x41eef0[_0xbbd7('0x41')]);return db[_0xbbd7('0x42')][_0xbbd7('0x48')](_0x185b27)[_0xbbd7('0x29')](function(_0x308ede){if(_0x308ede){_0x46a097=_0x308ede;return _0x308ede[_0xbbd7('0x8d')]();}return null;})['then'](function(_0x4f470c){if(_0x4f470c){if(!_0x4f470c[_0xbbd7('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xbbd7('0x6c'),0x193);}_0x42a282=_0x4f470c;return db[_0xbbd7('0x6d')][_0xbbd7('0x45')]({'raw':!![]});}return null;})['then'](function(_0x522fdd){if(_0x522fdd){_0x544701=_[_0xbbd7('0x6e')](_0x522fdd,'id');var _0x42ff51;var _0x2c8dff=squel['select']();_0x2c8dff[_0xbbd7('0x70')](_0x46a097[_0xbbd7('0x71')]);for(var _0x44ea21=0x0;_0x44ea21<_0x42a282[_0xbbd7('0x38')];_0x44ea21+=0x1){_0x42ff51=_0x42a282[_0x44ea21]['MetricId']?_0x544701[_0x42a282[_0x44ea21]['MetricId']][_0xbbd7('0x8e')]:_0x42a282[_0x44ea21]['field'];_0x42ff51=_0x42a282[_0x44ea21][_0xbbd7('0x74')]?_[_0xbbd7('0xa3')](_0x905401[_0x42a282[_0x44ea21][_0xbbd7('0x74')]],'%s',_0x42ff51):_0x42ff51;_0x42ff51=_0x42a282[_0x44ea21][_0xbbd7('0x75')]?_[_0xbbd7('0xa3')](_0xe7710d[_0x42a282[_0x44ea21][_0xbbd7('0x75')]],'%s',_0x42ff51):_0x42ff51;if(_0x42a282[_0x44ea21]['groupBy']){_0x2c8dff[_0xbbd7('0x68')](_0x42ff51);}_0x42a282[_0x44ea21]['orderBy']&&_0x2c8dff['order'](_0x42ff51,_0x42a282[_0x44ea21][_0xbbd7('0x77')]===_0xbbd7('0x78')?![]:!![]);_0x2c8dff[_0xbbd7('0x73')](_0x42ff51,_0x42a282[_0x44ea21][_0xbbd7('0x79')]||_0x42ff51);}if(_0x46a097[_0xbbd7('0x7a')]){_0x46a097[_0xbbd7('0x7a')]=JSON[_0xbbd7('0x7b')](_0x46a097[_0xbbd7('0x7a')]);for(var _0x54082f=0x0;_0x54082f<_0x46a097[_0xbbd7('0x7a')]['length'];_0x54082f+=0x1){if(_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x30')]&&_[_0xbbd7('0x7c')](_0x231020,_0x46a097[_0xbbd7('0x7a')][_0x54082f]['type'])&&_0x46a097[_0xbbd7('0x7a')][_0x54082f]['parentKey']&&_0x46a097['joins'][_0x54082f][_0xbbd7('0x7e')]&&_0x46a097[_0xbbd7('0x7a')][_0x54082f]['foreignKey']){_0x2c8dff[_0x46a097['joins'][_0x54082f][_0xbbd7('0x30')]](_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7e')],null,util[_0xbbd7('0x75')]('%s.%s\x20=\x20%s.%s',_0x46a097[_0xbbd7('0x71')],_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7d')],_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7e')],_0x46a097[_0xbbd7('0x7a')][_0x54082f][_0xbbd7('0x7f')]));}}}if(_0x46a097[_0xbbd7('0x80')]){_0x46a097[_0xbbd7('0x80')]=JSON['parse'](_0x46a097[_0xbbd7('0x80')]);_0x2c8dff[_0xbbd7('0x3c')](_0x572724(_0x46a097[_0xbbd7('0x80')][_0xbbd7('0x68')]));}_0x12335c=_0x2c8dff[_0xbbd7('0x90')]();_0x2c8dff[_0xbbd7('0x21')](_0x5daabd);_0x2c8dff[_0xbbd7('0x20')](0x0);logger[_0xbbd7('0x81')](_0xbbd7('0xa4'),_0x2c8dff[_0xbbd7('0x82')]());return dbH[_0xbbd7('0x83')]['query'](_0x2c8dff[_0xbbd7('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0xbbd7('0x85')]});}})[_0xbbd7('0x29')](function(){return{'sql':_0x12335c['toString']()};})[_0xbbd7('0x29')](respondWithResult(_0xbf2320,null))[_0xbbd7('0x49')](handleError(_0xbf2320,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 6b414e9..47f1bf9 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 _0xd7a7=['analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport'];(function(_0x290789,_0x4a3d87){var _0x566fa4=function(_0x22e909){while(--_0x22e909){_0x290789['push'](_0x290789['shift']());}};_0x566fa4(++_0x4a3d87);}(_0xd7a7,0x199));var _0x7d7a=function(_0x557a54,_0x1e8558){_0x557a54=_0x557a54-0x0;var _0x111e38=_0xd7a7[_0x557a54];return _0x111e38;};'use strict';var _=require(_0x7d7a('0x0'));var util=require(_0x7d7a('0x1'));var logger=require(_0x7d7a('0x2'))('api');var moment=require(_0x7d7a('0x3'));var BPromise=require(_0x7d7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d7a('0x5'));var rimraf=require(_0x7d7a('0x6'));var config=require(_0x7d7a('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x7d7a('0x8')]=function(_0x218c54,_0x44b365){return _0x218c54[_0x7d7a('0x9')](_0x7d7a('0xa'),attributes,{'tableName':_0x7d7a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a1c=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6a1c,0xb0));var _0xc6a1=function(_0x50c7e1,_0x3e134a){_0x50c7e1=_0x50c7e1-0x0;var _0x48fbd6=_0x6a1c[_0x50c7e1];return _0x48fbd6;};'use strict';var _=require(_0xc6a1('0x0'));var util=require(_0xc6a1('0x1'));var logger=require('../../config/logger')(_0xc6a1('0x2'));var moment=require(_0xc6a1('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6a1('0x4'));var fs=require('fs');var path=require(_0xc6a1('0x5'));var rimraf=require(_0xc6a1('0x6'));var config=require(_0xc6a1('0x7'));var attributes=require(_0xc6a1('0x8'));module['exports']=function(_0x1d5114,_0x411f9b){return _0x1d5114[_0xc6a1('0x9')](_0xc6a1('0xa'),attributes,{'tableName':_0xc6a1('0xb'),'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 653825b..70d4c1f 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 _0xda49=['jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x57ba2d,_0x1dce7d){var _0x168847=function(_0x5b1c1a){while(--_0x5b1c1a){_0x57ba2d['push'](_0x57ba2d['shift']());}};_0x168847(++_0x1dce7d);}(_0xda49,0x1d7));var _0x9da4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xda49[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9da4('0x0'));var util=require(_0x9da4('0x1'));var moment=require(_0x9da4('0x2'));var BPromise=require('bluebird');var rs=require(_0x9da4('0x3'));var fs=require('fs');var Redis=require(_0x9da4('0x4'));var db=require(_0x9da4('0x5'))['db'];var utils=require(_0x9da4('0x6'));var logger=require('../../config/logger')(_0x9da4('0x7'));var config=require(_0x9da4('0x8'));var jayson=require(_0x9da4('0x9'));var client=jayson['client'][_0x9da4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x73751b,_0x4a9826,_0xe79e1b){return new BPromise(function(_0x119ad5,_0x39a422){return client['request'](_0x73751b,_0xe79e1b)[_0x9da4('0xb')](function(_0x36d9f6){logger['info'](_0x9da4('0xc'),_0x4a9826,_0x9da4('0xd'));logger['debug'](_0x9da4('0xe'),_0x4a9826,_0x9da4('0xd'),JSON[_0x9da4('0xf')](_0x36d9f6));if(_0x36d9f6[_0x9da4('0x10')]){if(_0x36d9f6[_0x9da4('0x10')]['code']===0x1f4){logger[_0x9da4('0x10')](_0x9da4('0xc'),_0x4a9826,_0x36d9f6[_0x9da4('0x10')][_0x9da4('0x11')]);return _0x39a422(_0x36d9f6[_0x9da4('0x10')][_0x9da4('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4a9826,_0x36d9f6[_0x9da4('0x10')]['message']);return _0x119ad5(_0x36d9f6[_0x9da4('0x10')][_0x9da4('0x11')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4a9826,'request\x20sent');_0x119ad5(_0x36d9f6[_0x9da4('0x12')][_0x9da4('0x11')]);}})[_0x9da4('0x13')](function(_0x24ec88){logger[_0x9da4('0x10')](_0x9da4('0xc'),_0x4a9826,_0x24ec88);_0x39a422(_0x24ec88);});});}
\ No newline at end of file
+var _0xafb6=['code','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c4b99,_0xe8bf48){var _0x171ccb=function(_0x88db28){while(--_0x88db28){_0x5c4b99['push'](_0x5c4b99['shift']());}};_0x171ccb(++_0xe8bf48);}(_0xafb6,0x156));var _0x6afb=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xafb6[_0x57975f];return _0x4793b8;};'use strict';var _=require(_0x6afb('0x0'));var util=require(_0x6afb('0x1'));var moment=require(_0x6afb('0x2'));var BPromise=require('bluebird');var rs=require(_0x6afb('0x3'));var fs=require('fs');var Redis=require(_0x6afb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6afb('0x5'));var logger=require(_0x6afb('0x6'))(_0x6afb('0x7'));var config=require(_0x6afb('0x8'));var jayson=require(_0x6afb('0x9'));var client=jayson['client'][_0x6afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ccaf3,_0x44730a,_0x5d7b4b){return new BPromise(function(_0x282aa2,_0x414340){return client[_0x6afb('0xb')](_0x5ccaf3,_0x5d7b4b)[_0x6afb('0xc')](function(_0x26aa52){logger['info'](_0x6afb('0xd'),_0x44730a,_0x6afb('0xe'));logger[_0x6afb('0xf')](_0x6afb('0x10'),_0x44730a,_0x6afb('0xe'),JSON[_0x6afb('0x11')](_0x26aa52));if(_0x26aa52['error']){if(_0x26aa52['error'][_0x6afb('0x12')]===0x1f4){logger[_0x6afb('0x13')](_0x6afb('0xd'),_0x44730a,_0x26aa52[_0x6afb('0x13')][_0x6afb('0x14')]);return _0x414340(_0x26aa52[_0x6afb('0x13')][_0x6afb('0x14')]);}logger[_0x6afb('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44730a,_0x26aa52[_0x6afb('0x13')]['message']);return _0x282aa2(_0x26aa52[_0x6afb('0x13')][_0x6afb('0x14')]);}else{logger[_0x6afb('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x44730a,'request\x20sent');_0x282aa2(_0x26aa52[_0x6afb('0x16')][_0x6afb('0x14')]);}})[_0x6afb('0x17')](function(_0x4561d2){logger[_0x6afb('0x13')](_0x6afb('0xd'),_0x44730a,_0x4561d2);_0x414340(_0x4561d2);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 869bbe2..974c48f 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 _0x4c06=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete'];(function(_0x7ce68d,_0x17ece7){var _0x2dd767=function(_0x2a7418){while(--_0x2a7418){_0x7ce68d['push'](_0x7ce68d['shift']());}};_0x2dd767(++_0x17ece7);}(_0x4c06,0x89));var _0x64c0=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x4c06[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0x64c0('0x0'));var util=require(_0x64c0('0x1'));var path=require(_0x64c0('0x2'));var timeout=require(_0x64c0('0x3'));var express=require(_0x64c0('0x4'));var router=express[_0x64c0('0x5')]();var fs_extra=require(_0x64c0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x64c0('0x7'));var config=require(_0x64c0('0x8'));var controller=require(_0x64c0('0x9'));router[_0x64c0('0xa')]('/',auth[_0x64c0('0xb')](),controller[_0x64c0('0xc')]);router[_0x64c0('0xa')](_0x64c0('0xd'),auth[_0x64c0('0xb')](),controller[_0x64c0('0xe')]);router[_0x64c0('0xa')](_0x64c0('0xf'),auth[_0x64c0('0xb')](),controller[_0x64c0('0x10')]);router[_0x64c0('0xa')]('/:id/run',auth[_0x64c0('0xb')](),controller[_0x64c0('0x11')]);router[_0x64c0('0xa')](_0x64c0('0x12'),auth[_0x64c0('0xb')](),controller[_0x64c0('0x13')]);router[_0x64c0('0x14')]('/',auth['isAuthenticated'](),controller[_0x64c0('0x15')]);router[_0x64c0('0x16')](_0x64c0('0xd'),auth['isAuthenticated'](),controller[_0x64c0('0x17')]);router[_0x64c0('0x18')](_0x64c0('0xd'),auth[_0x64c0('0xb')](),controller[_0x64c0('0x19')]);module[_0x64c0('0x1a')]=router;
\ No newline at end of file
+var _0xea11=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','post','create','put','update','delete'];(function(_0x48c387,_0x55baa6){var _0x379f28=function(_0x2f7d79){while(--_0x2f7d79){_0x48c387['push'](_0x48c387['shift']());}};_0x379f28(++_0x55baa6);}(_0xea11,0x6f));var _0x1ea1=function(_0x30c66b,_0x3e10e9){_0x30c66b=_0x30c66b-0x0;var _0x54f719=_0xea11[_0x30c66b];return _0x54f719;};'use strict';var multer=require(_0x1ea1('0x0'));var util=require(_0x1ea1('0x1'));var path=require(_0x1ea1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ea1('0x3')]();var fs_extra=require(_0x1ea1('0x4'));var auth=require(_0x1ea1('0x5'));var interaction=require(_0x1ea1('0x6'));var config=require(_0x1ea1('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1ea1('0x8')]);router[_0x1ea1('0x9')](_0x1ea1('0xa'),auth[_0x1ea1('0xb')](),controller['show']);router[_0x1ea1('0x9')](_0x1ea1('0xc'),auth[_0x1ea1('0xb')](),controller[_0x1ea1('0xd')]);router[_0x1ea1('0x9')](_0x1ea1('0xe'),auth[_0x1ea1('0xb')](),controller['run']);router[_0x1ea1('0x9')](_0x1ea1('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x1ea1('0x10')]('/',auth['isAuthenticated'](),controller[_0x1ea1('0x11')]);router[_0x1ea1('0x12')](_0x1ea1('0xa'),auth[_0x1ea1('0xb')](),controller[_0x1ea1('0x13')]);router[_0x1ea1('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1ea1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 44a7851..2a50101 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 _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x1ce393,_0x201902){var _0x4a1978=function(_0x2564e4){while(--_0x2564e4){_0x1ce393['push'](_0x1ce393['shift']());}};_0x4a1978(++_0x201902);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0x5fc3[_0x4914ad];return _0x3cd61f;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x2675,0x75));var _0x5267=function(_0x316fb3,_0x57ac35){_0x316fb3=_0x316fb3-0x0;var _0x24b833=_0x2675[_0x316fb3];return _0x24b833;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index a4cd85a..a8bc421 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1dd78b,_0x213fd9){var _0x2d9bf6=function(_0x2c749a){while(--_0x2c749a){_0x1dd78b['push'](_0x1dd78b['shift']());}};_0x2d9bf6(++_0x213fd9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
+var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x5361dd,_0x56dfb2){var _0x4f4077=function(_0x15819f){while(--_0x15819f){_0x5361dd['push'](_0x5361dd['shift']());}};_0x4f4077(++_0x56dfb2);}(_0xba34,0x119));var _0x4ba3=function(_0x468502,_0x202602){_0x468502=_0x468502-0x0;var _0x39901c=_0xba34[_0x468502];return _0x39901c;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index baba481..fa35968 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 _0xa700=['exports','define','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa700,0x1ca));var _0x0a70=function(_0x4ce260,_0x2a5e2d){_0x4ce260=_0x4ce260-0x0;var _0x110812=_0xa700[_0x4ce260];return _0x110812;};'use strict';var _=require(_0x0a70('0x0'));var util=require(_0x0a70('0x1'));var logger=require('../../config/logger')(_0x0a70('0x2'));var moment=require(_0x0a70('0x3'));var BPromise=require(_0x0a70('0x4'));var rp=require(_0x0a70('0x5'));var fs=require('fs');var path=require(_0x0a70('0x6'));var rimraf=require(_0x0a70('0x7'));var config=require(_0x0a70('0x8'));var attributes=require(_0x0a70('0x9'));module[_0x0a70('0xa')]=function(_0x361898,_0x1135d3){return _0x361898[_0x0a70('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x0a70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb238=['bluebird','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment'];(function(_0x4b2ed7,_0x5b3100){var _0x55a953=function(_0x4b7abd){while(--_0x4b7abd){_0x4b2ed7['push'](_0x4b2ed7['shift']());}};_0x55a953(++_0x5b3100);}(_0xb238,0x17e));var _0x8b23=function(_0x591ec5,_0x2c94c5){_0x591ec5=_0x591ec5-0x0;var _0x56ed11=_0xb238[_0x591ec5];return _0x56ed11;};'use strict';var _=require(_0x8b23('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8b23('0x1'));var moment=require(_0x8b23('0x2'));var BPromise=require(_0x8b23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b23('0x4'));var rimraf=require(_0x8b23('0x5'));var config=require(_0x8b23('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x8b23('0x7')]=function(_0x20acf8,_0x539487){return _0x20acf8[_0x8b23('0x8')](_0x8b23('0x9'),attributes,{'tableName':_0x8b23('0xa'),'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 c2d9899..ba0af79 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 _0x808c=['request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x12b838,_0x140461){var _0x4d0115=function(_0xf9839b){while(--_0xf9839b){_0x12b838['push'](_0x12b838['shift']());}};_0x4d0115(++_0x140461);}(_0x808c,0x13e));var _0xc808=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x808c[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xc808('0x0'));var util=require(_0xc808('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc808('0x2'));var fs=require('fs');var Redis=require(_0xc808('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc808('0x4'));var logger=require('../../config/logger')(_0xc808('0x5'));var config=require(_0xc808('0x6'));var jayson=require(_0xc808('0x7'));var client=jayson[_0xc808('0x8')][_0xc808('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e9d06,_0x511f63,_0x3e701b){return new BPromise(function(_0x46d357,_0xad0bd){return client[_0xc808('0xa')](_0x5e9d06,_0x3e701b)[_0xc808('0xb')](function(_0x4cdcf1){logger[_0xc808('0xc')](_0xc808('0xd'),_0x511f63,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x511f63,'request\x20sent',JSON[_0xc808('0xe')](_0x4cdcf1));if(_0x4cdcf1[_0xc808('0xf')]){if(_0x4cdcf1[_0xc808('0xf')][_0xc808('0x10')]===0x1f4){logger[_0xc808('0xf')](_0xc808('0xd'),_0x511f63,_0x4cdcf1[_0xc808('0xf')][_0xc808('0x11')]);return _0xad0bd(_0x4cdcf1['error'][_0xc808('0x11')]);}logger[_0xc808('0xf')](_0xc808('0xd'),_0x511f63,_0x4cdcf1[_0xc808('0xf')][_0xc808('0x11')]);return _0x46d357(_0x4cdcf1[_0xc808('0xf')]['message']);}else{logger[_0xc808('0xc')](_0xc808('0xd'),_0x511f63,_0xc808('0x12'));_0x46d357(_0x4cdcf1[_0xc808('0x13')][_0xc808('0x11')]);}})[_0xc808('0x14')](function(_0x3618dc){logger[_0xc808('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x511f63,_0x3618dc);_0xad0bd(_0x3618dc);});});}
\ No newline at end of file
+var _0xb2b5=['request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','client'];(function(_0x596e98,_0xc326c9){var _0x1c09ac=function(_0x3d839d){while(--_0x3d839d){_0x596e98['push'](_0x596e98['shift']());}};_0x1c09ac(++_0xc326c9);}(_0xb2b5,0xc0));var _0x5b2b=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xb2b5[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x5b2b('0x0'));var util=require(_0x5b2b('0x1'));var moment=require(_0x5b2b('0x2'));var BPromise=require(_0x5b2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5b2b('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4236bc,_0x30a670,_0x5d1f93){return new BPromise(function(_0x504f75,_0x1a5ea9){return client[_0x5b2b('0x6')](_0x4236bc,_0x5d1f93)[_0x5b2b('0x7')](function(_0x430c04){logger['info'](_0x5b2b('0x8'),_0x30a670,_0x5b2b('0x9'));logger['debug'](_0x5b2b('0xa'),_0x30a670,_0x5b2b('0x9'),JSON[_0x5b2b('0xb')](_0x430c04));if(_0x430c04[_0x5b2b('0xc')]){if(_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xd')]===0x1f4){logger[_0x5b2b('0xc')](_0x5b2b('0x8'),_0x30a670,_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);return _0x1a5ea9(_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);}logger[_0x5b2b('0xc')](_0x5b2b('0x8'),_0x30a670,_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);return _0x504f75(_0x430c04[_0x5b2b('0xc')][_0x5b2b('0xe')]);}else{logger[_0x5b2b('0xf')](_0x5b2b('0x8'),_0x30a670,_0x5b2b('0x9'));_0x504f75(_0x430c04[_0x5b2b('0x10')][_0x5b2b('0xe')]);}})[_0x5b2b('0x11')](function(_0x57d35b){logger[_0x5b2b('0xc')](_0x5b2b('0x8'),_0x30a670,_0x57d35b);_0x1a5ea9(_0x57d35b);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 91b858c..19daa54 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 _0xd662=['delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','run','/:id/query','query','post','put','update'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0xd662,0x85));var _0x2d66=function(_0x159638,_0x554a3a){_0x159638=_0x159638-0x0;var _0x2160f7=_0xd662[_0x159638];return _0x2160f7;};'use strict';var multer=require(_0x2d66('0x0'));var util=require(_0x2d66('0x1'));var path=require(_0x2d66('0x2'));var timeout=require(_0x2d66('0x3'));var express=require('express');var router=express[_0x2d66('0x4')]();var fs_extra=require(_0x2d66('0x5'));var auth=require(_0x2d66('0x6'));var interaction=require(_0x2d66('0x7'));var config=require(_0x2d66('0x8'));var controller=require(_0x2d66('0x9'));router[_0x2d66('0xa')]('/',auth[_0x2d66('0xb')](),controller[_0x2d66('0xc')]);router['get'](_0x2d66('0xd'),auth[_0x2d66('0xb')](),controller['show']);router[_0x2d66('0xa')](_0x2d66('0xe'),auth[_0x2d66('0xb')](),controller['preview']);router['get']('/:id/run',auth[_0x2d66('0xb')](),controller[_0x2d66('0xf')]);router[_0x2d66('0xa')](_0x2d66('0x10'),auth[_0x2d66('0xb')](),controller[_0x2d66('0x11')]);router[_0x2d66('0x12')]('/',auth[_0x2d66('0xb')](),controller['create']);router[_0x2d66('0x13')](_0x2d66('0xd'),auth[_0x2d66('0xb')](),controller[_0x2d66('0x14')]);router[_0x2d66('0x15')](_0x2d66('0xd'),auth[_0x2d66('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x37f8=['update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','create'];(function(_0x48adc5,_0x3f2723){var _0x1e532f=function(_0x360bd9){while(--_0x360bd9){_0x48adc5['push'](_0x48adc5['shift']());}};_0x1e532f(++_0x3f2723);}(_0x37f8,0xb3));var _0x837f=function(_0x2da707,_0x20ca44){_0x2da707=_0x2da707-0x0;var _0x211651=_0x37f8[_0x2da707];return _0x211651;};'use strict';var multer=require('multer');var util=require(_0x837f('0x0'));var path=require(_0x837f('0x1'));var timeout=require(_0x837f('0x2'));var express=require('express');var router=express[_0x837f('0x3')]();var fs_extra=require(_0x837f('0x4'));var auth=require(_0x837f('0x5'));var interaction=require(_0x837f('0x6'));var config=require(_0x837f('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x837f('0x8')]('/',auth[_0x837f('0x9')](),controller[_0x837f('0xa')]);router[_0x837f('0x8')](_0x837f('0xb'),auth['isAuthenticated'](),controller[_0x837f('0xc')]);router['get'](_0x837f('0xd'),auth[_0x837f('0x9')](),controller['preview']);router[_0x837f('0x8')](_0x837f('0xe'),auth['isAuthenticated'](),controller[_0x837f('0xf')]);router[_0x837f('0x8')](_0x837f('0x10'),auth[_0x837f('0x9')](),controller['query']);router[_0x837f('0x11')]('/',auth[_0x837f('0x9')](),controller[_0x837f('0x12')]);router['put']('/:id',auth[_0x837f('0x9')](),controller[_0x837f('0x13')]);router[_0x837f('0x14')](_0x837f('0xb'),auth[_0x837f('0x9')](),controller['destroy']);module[_0x837f('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 039ccd2..f00d0e6 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 _0xe1d8=['pdf','xlsx','csv','DATE','manual','scheduled','INTEGER','UNSIGNED','exports','STRING','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1d8,0x168));var _0x8e1d=function(_0x242619,_0x44c6e2){_0x242619=_0x242619-0x0;var _0x577883=_0xe1d8[_0x242619];return _0x577883;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x8e1d('0x0')]={'name':{'type':Sequelize[_0x8e1d('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x8e1d('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x8e1d('0x2')]('csv',_0x8e1d('0x3'),_0x8e1d('0x4')),'allowNull':![],'defaultValue':_0x8e1d('0x5')},'savename':{'type':Sequelize[_0x8e1d('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8e1d('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8e1d('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x8e1d('0x7'),_0x8e1d('0x8')),'allowNull':![],'defaultValue':_0x8e1d('0x7')},'reportId':{'type':Sequelize[_0x8e1d('0x9')](0xb)[_0x8e1d('0xa')]},'reportType':{'type':Sequelize[_0x8e1d('0x1')]}};
\ No newline at end of file
+var _0x4356=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','UNSIGNED','sequelize','moment'];(function(_0x5cfb92,_0x5797e6){var _0x1cd7c2=function(_0x1bb452){while(--_0x1bb452){_0x5cfb92['push'](_0x5cfb92['shift']());}};_0x1cd7c2(++_0x5797e6);}(_0x4356,0xe2));var _0x6435=function(_0x4bcc2a,_0x2528a7){_0x4bcc2a=_0x4bcc2a-0x0;var _0x20eaab=_0x4356[_0x4bcc2a];return _0x20eaab;};'use strict';var Sequelize=require(_0x6435('0x0'));var moment=require(_0x6435('0x1'));module[_0x6435('0x2')]={'name':{'type':Sequelize[_0x6435('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x6435('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x6435('0x4')](_0x6435('0x5'),_0x6435('0x6'),_0x6435('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x6435('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6435('0x8')]},'endDate':{'type':Sequelize[_0x6435('0x8')]},'status':{'type':Sequelize[_0x6435('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x6435('0x9'),_0x6435('0xa')),'allowNull':![],'defaultValue':_0x6435('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x6435('0xb')]},'reportType':{'type':Sequelize[_0x6435('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 6a2c61e..bc23e83 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 _0x2f91=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','limit','order','sort','where'];(function(_0xac5506,_0x7a1e38){var _0x180df6=function(_0x54eb82){while(--_0x54eb82){_0xac5506['push'](_0xac5506['shift']());}};_0x180df6(++_0x7a1e38);}(_0x2f91,0x134));var _0x12f9=function(_0x211fad,_0x19a959){_0x211fad=_0x211fad-0x0;var _0x1a6c85=_0x2f91[_0x211fad];return _0x1a6c85;};'use strict';var emlformat=require(_0x12f9('0x0'));var rimraf=require(_0x12f9('0x1'));var zipdir=require(_0x12f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12f9('0x3'));var moment=require(_0x12f9('0x4'));var BPromise=require(_0x12f9('0x5'));var Mustache=require(_0x12f9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x12f9('0x7'));var csv=require(_0x12f9('0x8'));var ejs=require(_0x12f9('0x9'));var fs=require('fs');var fs_extra=require(_0x12f9('0xa'));var _=require(_0x12f9('0xb'));var squel=require(_0x12f9('0xc'));var crypto=require(_0x12f9('0xd'));var jsforce=require(_0x12f9('0xe'));var deskjs=require(_0x12f9('0xf'));var toCsv=require(_0x12f9('0x8'));var querystring=require(_0x12f9('0x10'));var Papa=require(_0x12f9('0x11'));var Redis=require(_0x12f9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x12f9('0x13'));var as=require(_0x12f9('0x14'));var hardwareService=require(_0x12f9('0x15'));var logger=require('../../config/logger')(_0x12f9('0x16'));var utils=require(_0x12f9('0x17'));var config=require(_0x12f9('0x18'));var licenseUtil=require(_0x12f9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce2226,_0x489283){_0x489283=_0x489283||0xcc;return function(_0x20bfaa){if(_0x20bfaa){return _0xce2226['sendStatus'](_0x489283);}return _0xce2226[_0x12f9('0x1a')](_0x489283)['end']();};}function respondWithResult(_0x49f81f,_0x4f132c){_0x4f132c=_0x4f132c||0xc8;return function(_0x226ced){if(_0x226ced){return _0x49f81f[_0x12f9('0x1a')](_0x4f132c)['json'](_0x226ced);}};}function respondWithFilteredResult(_0x17123e,_0x288935){return function(_0x572052){if(_0x572052){var _0x2b56f1=typeof _0x288935[_0x12f9('0x1b')]===_0x12f9('0x1c')&&typeof _0x288935['limit']===_0x12f9('0x1c');var _0x45eb10=_0x572052[_0x12f9('0x1d')];var _0x21d5a9=_0x2b56f1?0x0:_0x288935[_0x12f9('0x1b')];var _0x662d96=_0x2b56f1?_0x572052[_0x12f9('0x1d')]:_0x288935[_0x12f9('0x1b')]+_0x288935['limit'];var _0x2cf215;if(_0x662d96>=_0x45eb10){_0x662d96=_0x45eb10;_0x2cf215=0xc8;}else{_0x2cf215=0xce;}_0x17123e[_0x12f9('0x1a')](_0x2cf215);return _0x17123e[_0x12f9('0x1e')](_0x12f9('0x1f'),_0x21d5a9+'-'+_0x662d96+'/'+_0x45eb10)['json'](_0x572052);}return null;};}function patchUpdates(_0x20b2c6){return function(_0x5d86a4){try{jsonpatch[_0x12f9('0x20')](_0x5d86a4,_0x20b2c6,!![]);}catch(_0x53c72a){return BPromise[_0x12f9('0x21')](_0x53c72a);}return _0x5d86a4[_0x12f9('0x22')]();};}function saveUpdates(_0x4aee03,_0x43cbea){return function(_0x2875e9){if(_0x2875e9){return _0x2875e9[_0x12f9('0x23')](_0x4aee03)[_0x12f9('0x24')](function(_0x15b0ca){return _0x15b0ca;});}return null;};}function removeEntity(_0x3e02ab,_0x3adecb){return function(_0xe567ad){if(_0xe567ad){return _0xe567ad[_0x12f9('0x25')]()[_0x12f9('0x24')](function(){var _0x5b49de=_0xe567ad[_0x12f9('0x26')]({'plain':!![]});var _0xea1edb=_0x12f9('0x27');return db[_0x12f9('0x28')][_0x12f9('0x25')]({'where':{'type':_0xea1edb,'resourceId':_0x5b49de['id']}})[_0x12f9('0x24')](function(){return _0xe567ad;});})['then'](function(){_0x3e02ab['status'](0xcc)[_0x12f9('0x29')]();});}};}function handleEntityNotFound(_0x3204ea,_0x1b1d22){return function(_0xbc0130){if(!_0xbc0130){_0x3204ea[_0x12f9('0x2a')](0x194);}return _0xbc0130;};}function handleError(_0x19d7ca,_0x2a844f){_0x2a844f=_0x2a844f||0x1f4;return function(_0x40489f){logger[_0x12f9('0x2b')](_0x40489f[_0x12f9('0x2c')]);if(_0x40489f['name']){delete _0x40489f[_0x12f9('0x2d')];}_0x19d7ca['status'](_0x2a844f)['send'](_0x40489f);};}exports['index']=function(_0x5b5a58,_0x1d9f2c){var _0x4b73cd={},_0x5632ea={},_0x36a54c={'count':0x0,'rows':[]};var _0x4d24cc=_[_0x12f9('0x2e')](db[_0x12f9('0x2f')][_0x12f9('0x30')],function(_0x5c311d){return{'name':_0x5c311d[_0x12f9('0x31')],'type':_0x5c311d[_0x12f9('0x32')][_0x12f9('0x33')]};});_0x5632ea[_0x12f9('0x34')]=_[_0x12f9('0x2e')](_0x4d24cc,'name');_0x5632ea['query']=_[_0x12f9('0x35')](_0x5b5a58['query']);_0x5632ea[_0x12f9('0x36')]=_[_0x12f9('0x37')](_0x5632ea['model'],_0x5632ea[_0x12f9('0x38')]);_0x4b73cd[_0x12f9('0x39')]=_['intersection'](_0x5632ea['model'],qs[_0x12f9('0x3a')](_0x5b5a58['query']['fields']));_0x4b73cd[_0x12f9('0x39')]=_0x4b73cd[_0x12f9('0x39')]['length']?_0x4b73cd[_0x12f9('0x39')]:_0x5632ea['model'];if(!_0x5b5a58['query'][_0x12f9('0x3b')]('nolimit')){_0x4b73cd[_0x12f9('0x3c')]=qs[_0x12f9('0x3c')](_0x5b5a58[_0x12f9('0x38')][_0x12f9('0x3c')]);_0x4b73cd['offset']=qs[_0x12f9('0x1b')](_0x5b5a58['query'][_0x12f9('0x1b')]);}_0x4b73cd[_0x12f9('0x3d')]=qs[_0x12f9('0x3e')](_0x5b5a58[_0x12f9('0x38')]['sort']);_0x4b73cd[_0x12f9('0x3f')]=qs[_0x12f9('0x36')](_[_0x12f9('0x40')](_0x5b5a58[_0x12f9('0x38')],_0x5632ea[_0x12f9('0x36')]),_0x4d24cc);if(_0x5b5a58[_0x12f9('0x38')][_0x12f9('0x41')]){_0x4b73cd[_0x12f9('0x3f')]=_[_0x12f9('0x42')](_0x4b73cd[_0x12f9('0x3f')],{'$or':_['map'](_0x4d24cc,function(_0x5420f7){if(_0x5420f7[_0x12f9('0x32')]!==_0x12f9('0x43')){var _0x4b6d7f={};_0x4b6d7f[_0x5420f7['name']]={'$like':'%'+_0x5b5a58[_0x12f9('0x38')]['filter']+'%'};return _0x4b6d7f;}})});}_0x4b73cd=_[_0x12f9('0x42')]({},_0x4b73cd,_0x5b5a58['options']);var _0xdd8ee9={'where':_0x4b73cd[_0x12f9('0x3f')]};return db['AnalyticExtractedReport']['count'](_0xdd8ee9)[_0x12f9('0x24')](function(_0x5e9235){_0x36a54c[_0x12f9('0x1d')]=_0x5e9235;if(_0x5b5a58[_0x12f9('0x38')][_0x12f9('0x44')]){_0x4b73cd[_0x12f9('0x45')]=[{'all':!![]}];}return db[_0x12f9('0x2f')][_0x12f9('0x46')](_0x4b73cd);})['then'](function(_0x11a8d7){_0x36a54c['rows']=_0x11a8d7;return _0x36a54c;})['then'](respondWithFilteredResult(_0x1d9f2c,_0x4b73cd))[_0x12f9('0x47')](handleError(_0x1d9f2c,null));};exports['show']=function(_0x19e36d,_0x29bc04){var _0x363c73={'raw':!![],'where':{'id':_0x19e36d['params']['id']}},_0x117d75={};_0x117d75[_0x12f9('0x34')]=_['keys'](db[_0x12f9('0x2f')][_0x12f9('0x30')]);_0x117d75[_0x12f9('0x38')]=_[_0x12f9('0x35')](_0x19e36d[_0x12f9('0x38')]);_0x117d75[_0x12f9('0x36')]=_[_0x12f9('0x37')](_0x117d75[_0x12f9('0x34')],_0x117d75[_0x12f9('0x38')]);_0x363c73[_0x12f9('0x39')]=_[_0x12f9('0x37')](_0x117d75[_0x12f9('0x34')],qs[_0x12f9('0x3a')](_0x19e36d[_0x12f9('0x38')][_0x12f9('0x3a')]));_0x363c73[_0x12f9('0x39')]=_0x363c73[_0x12f9('0x39')]['length']?_0x363c73[_0x12f9('0x39')]:_0x117d75[_0x12f9('0x34')];if(_0x19e36d[_0x12f9('0x38')][_0x12f9('0x44')]){_0x363c73[_0x12f9('0x45')]=[{'all':!![]}];}_0x363c73=_['merge']({},_0x363c73,_0x19e36d[_0x12f9('0x48')]);return db[_0x12f9('0x2f')]['find'](_0x363c73)[_0x12f9('0x24')](handleEntityNotFound(_0x29bc04,null))[_0x12f9('0x24')](respondWithResult(_0x29bc04,null))[_0x12f9('0x47')](handleError(_0x29bc04,null));};exports[_0x12f9('0x49')]=function(_0x2ba999,_0x2174e2){return db['AnalyticExtractedReport'][_0x12f9('0x49')](_0x2ba999[_0x12f9('0x4a')],{})[_0x12f9('0x24')](function(_0x4bd158){var _0x6074c8=_0x2ba999[_0x12f9('0x4b')][_0x12f9('0x26')]({'plain':!![]});if(!_0x6074c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6074c8[_0x12f9('0x4c')]===_0x12f9('0x4b')){var _0x590609=_0x4bd158[_0x12f9('0x26')]({'plain':!![]});var _0x58934d=_0x12f9('0x27');return db[_0x12f9('0x4d')][_0x12f9('0x4e')]({'where':{'name':_0x58934d,'userProfileId':_0x6074c8[_0x12f9('0x4f')]},'raw':!![]})[_0x12f9('0x24')](function(_0x486fea){if(_0x486fea&&_0x486fea[_0x12f9('0x50')]===0x0){return db[_0x12f9('0x28')][_0x12f9('0x49')]({'name':_0x590609[_0x12f9('0x2d')],'resourceId':_0x590609['id'],'type':_0x486fea[_0x12f9('0x2d')],'sectionId':_0x486fea['id']},{})[_0x12f9('0x24')](function(){return _0x4bd158;});}else{return _0x4bd158;}})[_0x12f9('0x47')](function(_0x49bf65){logger[_0x12f9('0x2b')](_0x12f9('0x51'),_0x49bf65);throw _0x49bf65;});}return _0x4bd158;})['then'](respondWithResult(_0x2174e2,0xc9))[_0x12f9('0x47')](handleError(_0x2174e2,null));};exports[_0x12f9('0x23')]=function(_0xfdff3f,_0x2b4502){if(_0xfdff3f[_0x12f9('0x4a')]['id']){delete _0xfdff3f[_0x12f9('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x12f9('0x4e')]({'where':{'id':_0xfdff3f[_0x12f9('0x52')]['id']}})[_0x12f9('0x24')](handleEntityNotFound(_0x2b4502,null))[_0x12f9('0x24')](saveUpdates(_0xfdff3f[_0x12f9('0x4a')],null))['then'](respondWithResult(_0x2b4502,null))[_0x12f9('0x47')](handleError(_0x2b4502,null));};exports['destroy']=function(_0x2c68dc,_0x28cf7a){return db[_0x12f9('0x2f')][_0x12f9('0x4e')]({'where':{'id':_0x2c68dc[_0x12f9('0x52')]['id']}})[_0x12f9('0x24')](handleEntityNotFound(_0x28cf7a,null))[_0x12f9('0x24')](removeEntity(_0x28cf7a,null))[_0x12f9('0x47')](handleError(_0x28cf7a,null));};exports[_0x12f9('0x53')]=function(_0x6f7532,_0x3e0b38,_0x4bc6e2){return db['AnalyticExtractedReport'][_0x12f9('0x4e')]({'where':{'id':_0x6f7532[_0x12f9('0x52')]['id']},'attributes':[_0x12f9('0x2d'),_0x12f9('0x54'),_0x12f9('0x55'),'output'],'raw':!![]})[_0x12f9('0x24')](handleEntityNotFound(_0x3e0b38,null))[_0x12f9('0x24')](function(_0x11e467){if(_0x11e467){if(!fs[_0x12f9('0x56')](path[_0x12f9('0x57')](config['root'],_0x12f9('0x58'),_0x11e467['savename']))){throw new db[(_0x12f9('0x59'))][(_0x12f9('0x5a'))](_0x12f9('0x5b'));}if(_0x6f7532[_0x12f9('0x38')]['exists']){return _0x3e0b38[_0x12f9('0x2a')](0xc8);}return _0x3e0b38['download'](path[_0x12f9('0x57')](config[_0x12f9('0x5c')],'server/files/reports',_0x11e467[_0x12f9('0x55')]),util['format']('%s.%s',_0x11e467['basename']||_0x11e467['name'],_0x11e467['output']['toLowerCase']()));}})['catch'](handleError(_0x3e0b38,null));};
\ No newline at end of file
+var _0xb4e4=['model','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','rows','catch','params','length','includeAll','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','map','query','keys','filters'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0xb4e4,0x89));var _0x4b4e=function(_0x36afc3,_0x4956c9){_0x36afc3=_0x36afc3-0x0;var _0x405cb9=_0xb4e4[_0x36afc3];return _0x405cb9;};'use strict';var emlformat=require(_0x4b4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4b4e('0x1'));var rp=require(_0x4b4e('0x2'));var moment=require('moment');var BPromise=require(_0x4b4e('0x3'));var Mustache=require(_0x4b4e('0x4'));var util=require(_0x4b4e('0x5'));var path=require(_0x4b4e('0x6'));var sox=require('sox');var csv=require(_0x4b4e('0x7'));var ejs=require(_0x4b4e('0x8'));var fs=require('fs');var fs_extra=require(_0x4b4e('0x9'));var _=require(_0x4b4e('0xa'));var squel=require(_0x4b4e('0xb'));var crypto=require(_0x4b4e('0xc'));var jsforce=require(_0x4b4e('0xd'));var deskjs=require(_0x4b4e('0xe'));var toCsv=require(_0x4b4e('0x7'));var querystring=require(_0x4b4e('0xf'));var Papa=require(_0x4b4e('0x10'));var Redis=require('ioredis');var authService=require(_0x4b4e('0x11'));var qs=require(_0x4b4e('0x12'));var as=require(_0x4b4e('0x13'));var hardwareService=require(_0x4b4e('0x14'));var logger=require(_0x4b4e('0x15'))(_0x4b4e('0x16'));var utils=require(_0x4b4e('0x17'));var config=require(_0x4b4e('0x18'));var licenseUtil=require(_0x4b4e('0x19'));var db=require(_0x4b4e('0x1a'))['db'];function respondWithStatusCode(_0x26d8fa,_0x2c3dd6){_0x2c3dd6=_0x2c3dd6||0xcc;return function(_0x53c83d){if(_0x53c83d){return _0x26d8fa['sendStatus'](_0x2c3dd6);}return _0x26d8fa[_0x4b4e('0x1b')](_0x2c3dd6)[_0x4b4e('0x1c')]();};}function respondWithResult(_0x2ec170,_0x1ff8d8){_0x1ff8d8=_0x1ff8d8||0xc8;return function(_0x3bf9db){if(_0x3bf9db){return _0x2ec170['status'](_0x1ff8d8)[_0x4b4e('0x1d')](_0x3bf9db);}};}function respondWithFilteredResult(_0x186083,_0x5716ae){return function(_0x553845){if(_0x553845){var _0x13ddb3=typeof _0x5716ae[_0x4b4e('0x1e')]===_0x4b4e('0x1f')&&typeof _0x5716ae[_0x4b4e('0x20')]===_0x4b4e('0x1f');var _0x4b6c21=_0x553845[_0x4b4e('0x21')];var _0xe4f17a=_0x13ddb3?0x0:_0x5716ae[_0x4b4e('0x1e')];var _0x510d7a=_0x13ddb3?_0x553845[_0x4b4e('0x21')]:_0x5716ae[_0x4b4e('0x1e')]+_0x5716ae[_0x4b4e('0x20')];var _0x4bb061;if(_0x510d7a>=_0x4b6c21){_0x510d7a=_0x4b6c21;_0x4bb061=0xc8;}else{_0x4bb061=0xce;}_0x186083['status'](_0x4bb061);return _0x186083[_0x4b4e('0x22')](_0x4b4e('0x23'),_0xe4f17a+'-'+_0x510d7a+'/'+_0x4b6c21)[_0x4b4e('0x1d')](_0x553845);}return null;};}function patchUpdates(_0x236a09){return function(_0x329d4b){try{jsonpatch['apply'](_0x329d4b,_0x236a09,!![]);}catch(_0x8fea27){return BPromise[_0x4b4e('0x24')](_0x8fea27);}return _0x329d4b[_0x4b4e('0x25')]();};}function saveUpdates(_0x577870,_0x286fb0){return function(_0x5711b5){if(_0x5711b5){return _0x5711b5[_0x4b4e('0x26')](_0x577870)[_0x4b4e('0x27')](function(_0x3c4fff){return _0x3c4fff;});}return null;};}function removeEntity(_0x9d5fb2,_0x1a0ae3){return function(_0x4cd308){if(_0x4cd308){return _0x4cd308[_0x4b4e('0x28')]()[_0x4b4e('0x27')](function(){var _0xa4063b=_0x4cd308[_0x4b4e('0x29')]({'plain':!![]});var _0x12bf37='ExtractedReports';return db['UserProfileResource'][_0x4b4e('0x28')]({'where':{'type':_0x12bf37,'resourceId':_0xa4063b['id']}})[_0x4b4e('0x27')](function(){return _0x4cd308;});})['then'](function(){_0x9d5fb2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26acae,_0x2f0a93){return function(_0x25ecd1){if(!_0x25ecd1){_0x26acae[_0x4b4e('0x2a')](0x194);}return _0x25ecd1;};}function handleError(_0x3a3ecc,_0x47c22d){_0x47c22d=_0x47c22d||0x1f4;return function(_0x5846ba){logger[_0x4b4e('0x2b')](_0x5846ba[_0x4b4e('0x2c')]);if(_0x5846ba[_0x4b4e('0x2d')]){delete _0x5846ba['name'];}_0x3a3ecc[_0x4b4e('0x1b')](_0x47c22d)[_0x4b4e('0x2e')](_0x5846ba);};}exports[_0x4b4e('0x2f')]=function(_0x3fdc23,_0x36efef){var _0x1751bb={},_0x12ad6a={},_0xabeb5c={'count':0x0,'rows':[]};var _0x4d635b=_['map'](db[_0x4b4e('0x30')][_0x4b4e('0x31')],function(_0x2f6284){return{'name':_0x2f6284[_0x4b4e('0x32')],'type':_0x2f6284[_0x4b4e('0x33')][_0x4b4e('0x34')]};});_0x12ad6a['model']=_[_0x4b4e('0x35')](_0x4d635b,_0x4b4e('0x2d'));_0x12ad6a[_0x4b4e('0x36')]=_[_0x4b4e('0x37')](_0x3fdc23[_0x4b4e('0x36')]);_0x12ad6a[_0x4b4e('0x38')]=_['intersection'](_0x12ad6a['model'],_0x12ad6a[_0x4b4e('0x36')]);_0x1751bb['attributes']=_['intersection'](_0x12ad6a[_0x4b4e('0x39')],qs[_0x4b4e('0x3a')](_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x3a')]));_0x1751bb[_0x4b4e('0x3b')]=_0x1751bb[_0x4b4e('0x3b')]['length']?_0x1751bb['attributes']:_0x12ad6a['model'];if(!_0x3fdc23[_0x4b4e('0x36')]['hasOwnProperty'](_0x4b4e('0x3c'))){_0x1751bb['limit']=qs[_0x4b4e('0x20')](_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x20')]);_0x1751bb[_0x4b4e('0x1e')]=qs[_0x4b4e('0x1e')](_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x1e')]);}_0x1751bb[_0x4b4e('0x3d')]=qs[_0x4b4e('0x3e')](_0x3fdc23['query'][_0x4b4e('0x3e')]);_0x1751bb[_0x4b4e('0x3f')]=qs[_0x4b4e('0x38')](_[_0x4b4e('0x40')](_0x3fdc23[_0x4b4e('0x36')],_0x12ad6a[_0x4b4e('0x38')]),_0x4d635b);if(_0x3fdc23[_0x4b4e('0x36')][_0x4b4e('0x41')]){_0x1751bb[_0x4b4e('0x3f')]=_['merge'](_0x1751bb[_0x4b4e('0x3f')],{'$or':_[_0x4b4e('0x35')](_0x4d635b,function(_0x14b06b){if(_0x14b06b['type']!==_0x4b4e('0x42')){var _0x2b12ff={};_0x2b12ff[_0x14b06b[_0x4b4e('0x2d')]]={'$like':'%'+_0x3fdc23[_0x4b4e('0x36')]['filter']+'%'};return _0x2b12ff;}})});}_0x1751bb=_[_0x4b4e('0x43')]({},_0x1751bb,_0x3fdc23['options']);var _0x5c82ef={'where':_0x1751bb[_0x4b4e('0x3f')]};return db['AnalyticExtractedReport'][_0x4b4e('0x21')](_0x5c82ef)[_0x4b4e('0x27')](function(_0x12fe18){_0xabeb5c['count']=_0x12fe18;if(_0x3fdc23[_0x4b4e('0x36')]['includeAll']){_0x1751bb['include']=[{'all':!![]}];}return db[_0x4b4e('0x30')]['findAll'](_0x1751bb);})['then'](function(_0x35a304){_0xabeb5c[_0x4b4e('0x44')]=_0x35a304;return _0xabeb5c;})[_0x4b4e('0x27')](respondWithFilteredResult(_0x36efef,_0x1751bb))[_0x4b4e('0x45')](handleError(_0x36efef,null));};exports['show']=function(_0x147c79,_0x89c59a){var _0x1c97d5={'raw':!![],'where':{'id':_0x147c79[_0x4b4e('0x46')]['id']}},_0x323798={};_0x323798['model']=_[_0x4b4e('0x37')](db[_0x4b4e('0x30')]['rawAttributes']);_0x323798[_0x4b4e('0x36')]=_['keys'](_0x147c79[_0x4b4e('0x36')]);_0x323798[_0x4b4e('0x38')]=_['intersection'](_0x323798[_0x4b4e('0x39')],_0x323798[_0x4b4e('0x36')]);_0x1c97d5[_0x4b4e('0x3b')]=_['intersection'](_0x323798[_0x4b4e('0x39')],qs[_0x4b4e('0x3a')](_0x147c79[_0x4b4e('0x36')][_0x4b4e('0x3a')]));_0x1c97d5[_0x4b4e('0x3b')]=_0x1c97d5[_0x4b4e('0x3b')][_0x4b4e('0x47')]?_0x1c97d5['attributes']:_0x323798[_0x4b4e('0x39')];if(_0x147c79[_0x4b4e('0x36')][_0x4b4e('0x48')]){_0x1c97d5[_0x4b4e('0x49')]=[{'all':!![]}];}_0x1c97d5=_['merge']({},_0x1c97d5,_0x147c79[_0x4b4e('0x4a')]);return db[_0x4b4e('0x30')]['find'](_0x1c97d5)['then'](handleEntityNotFound(_0x89c59a,null))[_0x4b4e('0x27')](respondWithResult(_0x89c59a,null))[_0x4b4e('0x45')](handleError(_0x89c59a,null));};exports[_0x4b4e('0x4b')]=function(_0x12338,_0x1bd553){return db[_0x4b4e('0x30')][_0x4b4e('0x4b')](_0x12338['body'],{})[_0x4b4e('0x27')](function(_0x5a7104){var _0x261e00=_0x12338[_0x4b4e('0x4c')]['get']({'plain':!![]});if(!_0x261e00)throw new Error(_0x4b4e('0x4d'));if(_0x261e00[_0x4b4e('0x4e')]===_0x4b4e('0x4c')){var _0x53e5ea=_0x5a7104[_0x4b4e('0x29')]({'plain':!![]});var _0xb48917='ExtractedReports';return db[_0x4b4e('0x4f')][_0x4b4e('0x50')]({'where':{'name':_0xb48917,'userProfileId':_0x261e00['userProfileId']},'raw':!![]})['then'](function(_0x352cb4){if(_0x352cb4&&_0x352cb4[_0x4b4e('0x51')]===0x0){return db[_0x4b4e('0x52')][_0x4b4e('0x4b')]({'name':_0x53e5ea['name'],'resourceId':_0x53e5ea['id'],'type':_0x352cb4[_0x4b4e('0x2d')],'sectionId':_0x352cb4['id']},{})['then'](function(){return _0x5a7104;});}else{return _0x5a7104;}})[_0x4b4e('0x45')](function(_0x52b178){logger[_0x4b4e('0x2b')](_0x4b4e('0x53'),_0x52b178);throw _0x52b178;});}return _0x5a7104;})['then'](respondWithResult(_0x1bd553,0xc9))['catch'](handleError(_0x1bd553,null));};exports[_0x4b4e('0x26')]=function(_0x6f45f7,_0x4dd592){if(_0x6f45f7['body']['id']){delete _0x6f45f7['body']['id'];}return db[_0x4b4e('0x30')][_0x4b4e('0x50')]({'where':{'id':_0x6f45f7[_0x4b4e('0x46')]['id']}})[_0x4b4e('0x27')](handleEntityNotFound(_0x4dd592,null))[_0x4b4e('0x27')](saveUpdates(_0x6f45f7[_0x4b4e('0x54')],null))['then'](respondWithResult(_0x4dd592,null))[_0x4b4e('0x45')](handleError(_0x4dd592,null));};exports[_0x4b4e('0x28')]=function(_0x483b29,_0x98eb3d){return db['AnalyticExtractedReport'][_0x4b4e('0x50')]({'where':{'id':_0x483b29['params']['id']}})[_0x4b4e('0x27')](handleEntityNotFound(_0x98eb3d,null))['then'](removeEntity(_0x98eb3d,null))[_0x4b4e('0x45')](handleError(_0x98eb3d,null));};exports[_0x4b4e('0x55')]=function(_0x457477,_0x20372e,_0x24536e){return db[_0x4b4e('0x30')][_0x4b4e('0x50')]({'where':{'id':_0x457477[_0x4b4e('0x46')]['id']},'attributes':['name',_0x4b4e('0x56'),_0x4b4e('0x57'),_0x4b4e('0x58')],'raw':!![]})[_0x4b4e('0x27')](handleEntityNotFound(_0x20372e,null))['then'](function(_0x4a5c2d){if(_0x4a5c2d){if(!fs['existsSync'](path[_0x4b4e('0x59')](config[_0x4b4e('0x5a')],_0x4b4e('0x5b'),_0x4a5c2d['savename']))){throw new db[(_0x4b4e('0x5c'))][(_0x4b4e('0x5d'))](_0x4b4e('0x5e'));}if(_0x457477[_0x4b4e('0x36')][_0x4b4e('0x5f')]){return _0x20372e[_0x4b4e('0x2a')](0xc8);}return _0x20372e['download'](path[_0x4b4e('0x59')](config[_0x4b4e('0x5a')],'server/files/reports',_0x4a5c2d['savename']),util['format']('%s.%s',_0x4a5c2d['basename']||_0x4a5c2d[_0x4b4e('0x2d')],_0x4a5c2d['output'][_0x4b4e('0x60')]()));}})[_0x4b4e('0x45')](handleError(_0x20372e,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 4965cac..d86257e 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 _0xd528=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x51d22e,_0x276640){var _0x275be3=function(_0x52d368){while(--_0x52d368){_0x51d22e['push'](_0x51d22e['shift']());}};_0x275be3(++_0x276640);}(_0xd528,0xc3));var _0x8d52=function(_0x380914,_0x5b90a1){_0x380914=_0x380914-0x0;var _0x23f34e=_0xd528[_0x380914];return _0x23f34e;};'use strict';var _=require(_0x8d52('0x0'));var util=require(_0x8d52('0x1'));var logger=require(_0x8d52('0x2'))(_0x8d52('0x3'));var moment=require(_0x8d52('0x4'));var BPromise=require(_0x8d52('0x5'));var rp=require(_0x8d52('0x6'));var fs=require('fs');var path=require(_0x8d52('0x7'));var rimraf=require(_0x8d52('0x8'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x8d52('0x9')]=function(_0x96cf3c,_0x19ff49){return _0x96cf3c[_0x8d52('0xa')](_0x8d52('0xb'),attributes,{'tableName':_0x8d52('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4702=['moment','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x2a1d58,_0x130e30){var _0x231fdf=function(_0x33b191){while(--_0x33b191){_0x2a1d58['push'](_0x2a1d58['shift']());}};_0x231fdf(++_0x130e30);}(_0x4702,0xd9));var _0x2470=function(_0x3b178d,_0x225115){_0x3b178d=_0x3b178d-0x0;var _0x1d4a81=_0x4702[_0x3b178d];return _0x1d4a81;};'use strict';var _=require(_0x2470('0x0'));var util=require(_0x2470('0x1'));var logger=require(_0x2470('0x2'))(_0x2470('0x3'));var moment=require(_0x2470('0x4'));var BPromise=require(_0x2470('0x5'));var rp=require(_0x2470('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2470('0x7'));var config=require('../../config/environment');var attributes=require(_0x2470('0x8'));module[_0x2470('0x9')]=function(_0x367651,_0x5c405f){return _0x367651[_0x2470('0xa')](_0x2470('0xb'),attributes,{'tableName':_0x2470('0xc'),'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 10e3460..11a8329 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 _0x4c58=['then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request'];(function(_0x3a39a5,_0x1e508c){var _0x5b035a=function(_0x187b81){while(--_0x187b81){_0x3a39a5['push'](_0x3a39a5['shift']());}};_0x5b035a(++_0x1e508c);}(_0x4c58,0x113));var _0x84c5=function(_0x25e70f,_0x845be6){_0x25e70f=_0x25e70f-0x0;var _0x1b262e=_0x4c58[_0x25e70f];return _0x1b262e;};'use strict';var _=require(_0x84c5('0x0'));var util=require(_0x84c5('0x1'));var moment=require(_0x84c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x84c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84c5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84c5('0x5'));var config=require('../../config/environment');var jayson=require(_0x84c5('0x6'));var client=jayson[_0x84c5('0x7')][_0x84c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x218a67,_0x495a9c,_0x5a5fa0){return new BPromise(function(_0x559f6e,_0x69ecb0){return client[_0x84c5('0x9')](_0x218a67,_0x5a5fa0)[_0x84c5('0xa')](function(_0x33dce4){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x495a9c,_0x84c5('0xb'));logger[_0x84c5('0xc')](_0x84c5('0xd'),_0x495a9c,'request\x20sent',JSON[_0x84c5('0xe')](_0x33dce4));if(_0x33dce4[_0x84c5('0xf')]){if(_0x33dce4[_0x84c5('0xf')][_0x84c5('0x10')]===0x1f4){logger[_0x84c5('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x495a9c,_0x33dce4[_0x84c5('0xf')][_0x84c5('0x11')]);return _0x69ecb0(_0x33dce4[_0x84c5('0xf')]['message']);}logger[_0x84c5('0xf')](_0x84c5('0x12'),_0x495a9c,_0x33dce4[_0x84c5('0xf')][_0x84c5('0x11')]);return _0x559f6e(_0x33dce4[_0x84c5('0xf')][_0x84c5('0x11')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x495a9c,_0x84c5('0xb'));_0x559f6e(_0x33dce4['result'][_0x84c5('0x11')]);}})['catch'](function(_0x120d05){logger[_0x84c5('0xf')](_0x84c5('0x12'),_0x495a9c,_0x120d05);_0x69ecb0(_0x120d05);});});}
\ No newline at end of file
+var _0xf729=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis'];(function(_0x47794f,_0x3a0baf){var _0x423604=function(_0x379cd6){while(--_0x379cd6){_0x47794f['push'](_0x47794f['shift']());}};_0x423604(++_0x3a0baf);}(_0xf729,0x1b4));var _0x9f72=function(_0x4765c6,_0x47036e){_0x4765c6=_0x4765c6-0x0;var _0x28f9bd=_0xf729[_0x4765c6];return _0x28f9bd;};'use strict';var _=require(_0x9f72('0x0'));var util=require(_0x9f72('0x1'));var moment=require(_0x9f72('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f72('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f72('0x4'));var logger=require(_0x9f72('0x5'))(_0x9f72('0x6'));var config=require(_0x9f72('0x7'));var jayson=require(_0x9f72('0x8'));var client=jayson[_0x9f72('0x9')][_0x9f72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x287d43,_0x4c545a,_0x4a8d2d){return new BPromise(function(_0x236c1c,_0x45453e){return client['request'](_0x287d43,_0x4a8d2d)[_0x9f72('0xb')](function(_0x9771c3){logger[_0x9f72('0xc')](_0x9f72('0xd'),_0x4c545a,_0x9f72('0xe'));logger[_0x9f72('0xf')](_0x9f72('0x10'),_0x4c545a,_0x9f72('0xe'),JSON[_0x9f72('0x11')](_0x9771c3));if(_0x9771c3[_0x9f72('0x12')]){if(_0x9771c3[_0x9f72('0x12')][_0x9f72('0x13')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c545a,_0x9771c3[_0x9f72('0x12')]['message']);return _0x45453e(_0x9771c3[_0x9f72('0x12')][_0x9f72('0x14')]);}logger[_0x9f72('0x12')](_0x9f72('0xd'),_0x4c545a,_0x9771c3[_0x9f72('0x12')][_0x9f72('0x14')]);return _0x236c1c(_0x9771c3[_0x9f72('0x12')][_0x9f72('0x14')]);}else{logger[_0x9f72('0xc')](_0x9f72('0xd'),_0x4c545a,_0x9f72('0xe'));_0x236c1c(_0x9771c3['result']['message']);}})[_0x9f72('0x15')](function(_0x5c73ed){logger[_0x9f72('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4c545a,_0x5c73ed);_0x45453e(_0x5c73ed);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 9f5690e..60ea4b6 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 _0x8d05=['create','put','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','/:id/download','download'];(function(_0x364ed4,_0xea6d7a){var _0x4f43f7=function(_0xb2e113){while(--_0xb2e113){_0x364ed4['push'](_0x364ed4['shift']());}};_0x4f43f7(++_0xea6d7a);}(_0x8d05,0x125));var _0x58d0=function(_0x40b87,_0x209a34){_0x40b87=_0x40b87-0x0;var _0x5dfad8=_0x8d05[_0x40b87];return _0x5dfad8;};'use strict';var multer=require(_0x58d0('0x0'));var util=require('util');var path=require(_0x58d0('0x1'));var timeout=require(_0x58d0('0x2'));var express=require(_0x58d0('0x3'));var router=express[_0x58d0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x58d0('0x5'));var config=require(_0x58d0('0x6'));var controller=require(_0x58d0('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x58d0('0x8')](_0x58d0('0x9'),auth[_0x58d0('0xa')](),controller['show']);router[_0x58d0('0x8')](_0x58d0('0xb'),auth['isAuthenticated'](),controller[_0x58d0('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x58d0('0xd')]);router[_0x58d0('0xe')](_0x58d0('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x58d0('0x9'),auth[_0x58d0('0xa')](),controller[_0x58d0('0xf')]);module[_0x58d0('0x10')]=router;
\ No newline at end of file
+var _0xd633=['./analyticExtractedReport.controller','get','isAuthenticated','index','download','create','/:id','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a8130,_0x2b7f50){var _0x55931f=function(_0x5340bb){while(--_0x5340bb){_0x5a8130['push'](_0x5a8130['shift']());}};_0x55931f(++_0x2b7f50);}(_0xd633,0x15b));var _0x3d63=function(_0x371b87,_0x177b5f){_0x371b87=_0x371b87-0x0;var _0x2aca85=_0xd633[_0x371b87];return _0x2aca85;};'use strict';var multer=require(_0x3d63('0x0'));var util=require(_0x3d63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3d63('0x2'));var auth=require(_0x3d63('0x3'));var interaction=require(_0x3d63('0x4'));var config=require('../../config/environment');var controller=require(_0x3d63('0x5'));router[_0x3d63('0x6')]('/',auth[_0x3d63('0x7')](),controller[_0x3d63('0x8')]);router['get']('/:id',auth[_0x3d63('0x7')](),controller['show']);router['get']('/:id/download',auth[_0x3d63('0x7')](),controller[_0x3d63('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3d63('0xa')]);router['put'](_0x3d63('0xb'),auth[_0x3d63('0x7')](),controller[_0x3d63('0xc')]);router[_0x3d63('0xd')]('/:id',auth[_0x3d63('0x7')](),controller[_0x3d63('0xe')]);module[_0x3d63('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 82d2532..f97dab5 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 _0x4604=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x137383,_0x46486f){var _0x5d7bfb=function(_0x27045f){while(--_0x27045f){_0x137383['push'](_0x137383['shift']());}};_0x5d7bfb(++_0x46486f);}(_0x4604,0xf8));var _0x4460=function(_0x592526,_0x46353d){_0x592526=_0x592526-0x0;var _0x4363f4=_0x4604[_0x592526];return _0x4363f4;};'use strict';var Sequelize=require(_0x4460('0x0'));module['exports']={'field':{'type':Sequelize[_0x4460('0x1')]},'alias':{'type':Sequelize[_0x4460('0x2')]},'function':{'type':Sequelize[_0x4460('0x2')]},'format':{'type':Sequelize[_0x4460('0x2')]},'groupBy':{'type':Sequelize[_0x4460('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4460('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xc7e0=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x4d3a9b,_0x20b47d){var _0x1b5471=function(_0x51bf57){while(--_0x51bf57){_0x4d3a9b['push'](_0x4d3a9b['shift']());}};_0x1b5471(++_0x20b47d);}(_0xc7e0,0x1e3));var _0x0c7e=function(_0xfb8dec,_0x436634){_0xfb8dec=_0xfb8dec-0x0;var _0x3c4114=_0xc7e0[_0xfb8dec];return _0x3c4114;};'use strict';var Sequelize=require(_0x0c7e('0x0'));module[_0x0c7e('0x1')]={'field':{'type':Sequelize[_0x0c7e('0x2')]},'alias':{'type':Sequelize[_0x0c7e('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x0c7e('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0c7e('0x3')]},'custom':{'type':Sequelize[_0x0c7e('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 efc9d2e..81c7fcc 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 _0x1d32=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','create','catch','bulkCreate','body','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5a61be,_0x2b240a){var _0x52d35e=function(_0x3bc428){while(--_0x3bc428){_0x5a61be['push'](_0x5a61be['shift']());}};_0x52d35e(++_0x2b240a);}(_0x1d32,0x1e3));var _0x21d3=function(_0x383059,_0x11764a){_0x383059=_0x383059-0x0;var _0x18ffde=_0x1d32[_0x383059];return _0x18ffde;};'use strict';var emlformat=require(_0x21d3('0x0'));var rimraf=require(_0x21d3('0x1'));var zipdir=require(_0x21d3('0x2'));var jsonpatch=require(_0x21d3('0x3'));var rp=require(_0x21d3('0x4'));var moment=require(_0x21d3('0x5'));var BPromise=require(_0x21d3('0x6'));var Mustache=require(_0x21d3('0x7'));var util=require(_0x21d3('0x8'));var path=require(_0x21d3('0x9'));var sox=require(_0x21d3('0xa'));var csv=require(_0x21d3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21d3('0xc'));var _=require('lodash');var squel=require(_0x21d3('0xd'));var crypto=require(_0x21d3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x21d3('0xf'));var toCsv=require(_0x21d3('0xb'));var querystring=require(_0x21d3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x21d3('0x11'));var qs=require(_0x21d3('0x12'));var as=require(_0x21d3('0x13'));var hardwareService=require(_0x21d3('0x14'));var logger=require(_0x21d3('0x15'))(_0x21d3('0x16'));var utils=require(_0x21d3('0x17'));var config=require(_0x21d3('0x18'));var licenseUtil=require(_0x21d3('0x19'));var db=require(_0x21d3('0x1a'))['db'];function respondWithStatusCode(_0x55ce71,_0x5bfaec){_0x5bfaec=_0x5bfaec||0xcc;return function(_0x4bbc01){if(_0x4bbc01){return _0x55ce71['sendStatus'](_0x5bfaec);}return _0x55ce71[_0x21d3('0x1b')](_0x5bfaec)[_0x21d3('0x1c')]();};}function respondWithResult(_0x32e383,_0x2ea15a){_0x2ea15a=_0x2ea15a||0xc8;return function(_0x398db3){if(_0x398db3){return _0x32e383[_0x21d3('0x1b')](_0x2ea15a)[_0x21d3('0x1d')](_0x398db3);}};}function respondWithFilteredResult(_0xfc3a5d,_0x27c409){return function(_0x12b0c9){if(_0x12b0c9){var _0x5e0edd=typeof _0x27c409[_0x21d3('0x1e')]===_0x21d3('0x1f')&&typeof _0x27c409[_0x21d3('0x20')]==='undefined';var _0x50360d=_0x12b0c9[_0x21d3('0x21')];var _0x58d6d1=_0x5e0edd?0x0:_0x27c409['offset'];var _0x36f74f=_0x5e0edd?_0x12b0c9[_0x21d3('0x21')]:_0x27c409[_0x21d3('0x1e')]+_0x27c409[_0x21d3('0x20')];var _0x1d9517;if(_0x36f74f>=_0x50360d){_0x36f74f=_0x50360d;_0x1d9517=0xc8;}else{_0x1d9517=0xce;}_0xfc3a5d[_0x21d3('0x1b')](_0x1d9517);return _0xfc3a5d[_0x21d3('0x22')](_0x21d3('0x23'),_0x58d6d1+'-'+_0x36f74f+'/'+_0x50360d)[_0x21d3('0x1d')](_0x12b0c9);}return null;};}function patchUpdates(_0x464298){return function(_0x3ed10b){try{jsonpatch['apply'](_0x3ed10b,_0x464298,!![]);}catch(_0x15eacf){return BPromise[_0x21d3('0x24')](_0x15eacf);}return _0x3ed10b['save']();};}function saveUpdates(_0x5c8935,_0x19b697){return function(_0x1f406a){if(_0x1f406a){return _0x1f406a[_0x21d3('0x25')](_0x5c8935)[_0x21d3('0x26')](function(_0x348f24){return _0x348f24;});}return null;};}function removeEntity(_0x32466d,_0x59b128){return function(_0x57373c){if(_0x57373c){return _0x57373c[_0x21d3('0x27')]()['then'](function(){_0x32466d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35fec5,_0x173208){return function(_0x4a3b3e){if(!_0x4a3b3e){_0x35fec5['sendStatus'](0x194);}return _0x4a3b3e;};}function handleError(_0x1cbc07,_0x36a309){_0x36a309=_0x36a309||0x1f4;return function(_0x140f20){logger[_0x21d3('0x28')](_0x140f20[_0x21d3('0x29')]);if(_0x140f20[_0x21d3('0x2a')]){delete _0x140f20[_0x21d3('0x2a')];}_0x1cbc07[_0x21d3('0x1b')](_0x36a309)[_0x21d3('0x2b')](_0x140f20);};}exports[_0x21d3('0x2c')]=function(_0x388f2c,_0x2aca48){var _0x5406ca={},_0x2ef3a3={},_0x597e7b={'count':0x0,'rows':[]};var _0x49fe80=_[_0x21d3('0x2d')](db[_0x21d3('0x2e')][_0x21d3('0x2f')],function(_0x4459d2){return{'name':_0x4459d2['fieldName'],'type':_0x4459d2['type'][_0x21d3('0x30')]};});_0x2ef3a3[_0x21d3('0x31')]=_[_0x21d3('0x2d')](_0x49fe80,_0x21d3('0x2a'));_0x2ef3a3[_0x21d3('0x32')]=_[_0x21d3('0x33')](_0x388f2c['query']);_0x2ef3a3[_0x21d3('0x34')]=_[_0x21d3('0x35')](_0x2ef3a3[_0x21d3('0x31')],_0x2ef3a3[_0x21d3('0x32')]);_0x5406ca[_0x21d3('0x36')]=_[_0x21d3('0x35')](_0x2ef3a3[_0x21d3('0x31')],qs[_0x21d3('0x37')](_0x388f2c[_0x21d3('0x32')][_0x21d3('0x37')]));_0x5406ca['attributes']=_0x5406ca[_0x21d3('0x36')]['length']?_0x5406ca['attributes']:_0x2ef3a3[_0x21d3('0x31')];if(!_0x388f2c[_0x21d3('0x32')][_0x21d3('0x38')](_0x21d3('0x39'))){_0x5406ca['limit']=qs[_0x21d3('0x20')](_0x388f2c[_0x21d3('0x32')]['limit']);_0x5406ca[_0x21d3('0x1e')]=qs[_0x21d3('0x1e')](_0x388f2c[_0x21d3('0x32')][_0x21d3('0x1e')]);}_0x5406ca[_0x21d3('0x3a')]=qs[_0x21d3('0x3b')](_0x388f2c[_0x21d3('0x32')][_0x21d3('0x3b')]);_0x5406ca[_0x21d3('0x3c')]=qs[_0x21d3('0x34')](_[_0x21d3('0x3d')](_0x388f2c[_0x21d3('0x32')],_0x2ef3a3[_0x21d3('0x34')]),_0x49fe80);if(_0x388f2c[_0x21d3('0x32')]['filter']){_0x5406ca['where']=_[_0x21d3('0x3e')](_0x5406ca[_0x21d3('0x3c')],{'$or':_[_0x21d3('0x2d')](_0x49fe80,function(_0x40cc4c){if(_0x40cc4c[_0x21d3('0x3f')]!==_0x21d3('0x40')){var _0x46a698={};_0x46a698[_0x40cc4c['name']]={'$like':'%'+_0x388f2c[_0x21d3('0x32')]['filter']+'%'};return _0x46a698;}})});}_0x5406ca=_[_0x21d3('0x3e')]({},_0x5406ca,_0x388f2c[_0x21d3('0x41')]);var _0x6652f6={'where':_0x5406ca[_0x21d3('0x3c')]};return db[_0x21d3('0x2e')][_0x21d3('0x21')](_0x6652f6)[_0x21d3('0x26')](function(_0x45ccfe){_0x597e7b[_0x21d3('0x21')]=_0x45ccfe;if(_0x388f2c[_0x21d3('0x32')][_0x21d3('0x42')]){_0x5406ca[_0x21d3('0x43')]=[{'all':!![]}];}return db[_0x21d3('0x2e')][_0x21d3('0x44')](_0x5406ca);})[_0x21d3('0x26')](function(_0xf3aca1){_0x597e7b[_0x21d3('0x45')]=_0xf3aca1;return _0x597e7b;})[_0x21d3('0x26')](respondWithFilteredResult(_0x2aca48,_0x5406ca))['catch'](handleError(_0x2aca48,null));};exports[_0x21d3('0x46')]=function(_0x2d6965,_0x9c2dd7){var _0x358e03={'raw':![],'where':{'id':_0x2d6965['params']['id']}},_0x54571b={};_0x54571b['model']=_[_0x21d3('0x33')](db[_0x21d3('0x2e')][_0x21d3('0x2f')]);_0x54571b['query']=_['keys'](_0x2d6965['query']);_0x54571b['filters']=_[_0x21d3('0x35')](_0x54571b[_0x21d3('0x31')],_0x54571b[_0x21d3('0x32')]);_0x358e03[_0x21d3('0x36')]=_[_0x21d3('0x35')](_0x54571b[_0x21d3('0x31')],qs[_0x21d3('0x37')](_0x2d6965[_0x21d3('0x32')][_0x21d3('0x37')]));_0x358e03[_0x21d3('0x36')]=_0x358e03[_0x21d3('0x36')][_0x21d3('0x47')]?_0x358e03[_0x21d3('0x36')]:_0x54571b[_0x21d3('0x31')];if(_0x2d6965['query'][_0x21d3('0x42')]){_0x358e03[_0x21d3('0x43')]=[{'all':!![]}];}_0x358e03=_[_0x21d3('0x3e')]({},_0x358e03,_0x2d6965['options']);return db[_0x21d3('0x2e')]['find'](_0x358e03)[_0x21d3('0x26')](handleEntityNotFound(_0x9c2dd7,null))[_0x21d3('0x26')](respondWithResult(_0x9c2dd7,null))['catch'](handleError(_0x9c2dd7,null));};exports[_0x21d3('0x48')]=function(_0x298d40,_0x2f39af){return db['AnalyticFieldReport'][_0x21d3('0x48')](_0x298d40['body'],{})[_0x21d3('0x26')](respondWithResult(_0x2f39af,0xc9))[_0x21d3('0x49')](handleError(_0x2f39af,null));};exports[_0x21d3('0x4a')]=function(_0x5051b9,_0x12e561){return db[_0x21d3('0x2e')]['bulkCreate'](_0x5051b9[_0x21d3('0x4b')],{'raw':![],'individualHooks':!![]})[_0x21d3('0x26')](respondWithResult(_0x12e561,0xc9))[_0x21d3('0x49')](handleError(_0x12e561,null));};exports[_0x21d3('0x25')]=function(_0x1046a5,_0x5499ac){if(_0x1046a5[_0x21d3('0x4b')]['id']){delete _0x1046a5[_0x21d3('0x4b')]['id'];}return db[_0x21d3('0x2e')][_0x21d3('0x4c')]({'where':{'id':_0x1046a5[_0x21d3('0x4d')]['id']}})[_0x21d3('0x26')](handleEntityNotFound(_0x5499ac,null))[_0x21d3('0x26')](saveUpdates(_0x1046a5[_0x21d3('0x4b')],null))[_0x21d3('0x26')](respondWithResult(_0x5499ac,null))[_0x21d3('0x49')](handleError(_0x5499ac,null));};exports[_0x21d3('0x27')]=function(_0x1c719c,_0x35edb1){return db[_0x21d3('0x2e')]['find']({'where':{'id':_0x1c719c[_0x21d3('0x4d')]['id']}})[_0x21d3('0x26')](handleEntityNotFound(_0x35edb1,null))[_0x21d3('0x26')](removeEntity(_0x35edb1,null))['catch'](handleError(_0x35edb1,null));};exports[_0x21d3('0x4e')]=function(_0x3eb5e5,_0x3fca63){return db[_0x21d3('0x2e')][_0x21d3('0x27')]({'where':{'id':_0x3eb5e5[_0x21d3('0x32')][_0x21d3('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x21d3('0x26')](respondWithResult(_0x3fca63,0xcc))['catch'](handleError(_0x3fca63,null));};exports[_0x21d3('0x50')]=function(_0x8f77ce,_0x207cd1,_0x21d3a0){return db[_0x21d3('0x51')]['findOne']({'where':{'id':_0x8f77ce[_0x21d3('0x4d')]['id']}})[_0x21d3('0x26')](handleEntityNotFound(_0x207cd1,null))[_0x21d3('0x26')](function(_0x146767){if(_0x146767){return db[_0x21d3('0x52')][_0x21d3('0x53')](function(_0x42515c){return db['AnalyticFieldReport'][_0x21d3('0x27')]({'where':{'CustomReportId':_0x8f77ce[_0x21d3('0x4d')]['id']},'transaction':_0x42515c})[_0x21d3('0x26')](function(_0x431fc6){var _0x47ef8a=_[_0x21d3('0x2d')](_0x8f77ce[_0x21d3('0x4b')],function(_0x283293){delete _0x283293['id'];_0x283293[_0x21d3('0x54')]=_0x8f77ce[_0x21d3('0x4d')]['id'];return _0x283293;});return db[_0x21d3('0x2e')][_0x21d3('0x4a')](_0x47ef8a,{'transaction':_0x42515c});});})['then'](function(){return db[_0x21d3('0x2e')][_0x21d3('0x44')]({'where':{'CustomReportId':_0x8f77ce[_0x21d3('0x4d')]['id']}});});}})[_0x21d3('0x26')](respondWithResult(_0x207cd1,null))[_0x21d3('0x49')](handleError(_0x207cd1,null));};
\ No newline at end of file
+var _0x43de=['name','send','map','AnalyticFieldReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','filter','includeAll','include','findAll','rows','params','rawAttributes','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','save','update','then','destroy','stack'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x43de,0x163));var _0xe43d=function(_0x53e8c1,_0x1a6586){_0x53e8c1=_0x53e8c1-0x0;var _0x416748=_0x43de[_0x53e8c1];return _0x416748;};'use strict';var emlformat=require(_0xe43d('0x0'));var rimraf=require(_0xe43d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe43d('0x2'));var rp=require('request-promise');var moment=require(_0xe43d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe43d('0x4'));var util=require(_0xe43d('0x5'));var path=require(_0xe43d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe43d('0x7'));var fs=require('fs');var fs_extra=require(_0xe43d('0x8'));var _=require(_0xe43d('0x9'));var squel=require(_0xe43d('0xa'));var crypto=require(_0xe43d('0xb'));var jsforce=require(_0xe43d('0xc'));var deskjs=require(_0xe43d('0xd'));var toCsv=require(_0xe43d('0xe'));var querystring=require(_0xe43d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe43d('0x10'));var qs=require(_0xe43d('0x11'));var as=require(_0xe43d('0x12'));var hardwareService=require(_0xe43d('0x13'));var logger=require(_0xe43d('0x14'))(_0xe43d('0x15'));var utils=require(_0xe43d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe43d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ec0b,_0x28ee70){_0x28ee70=_0x28ee70||0xcc;return function(_0x32c3b9){if(_0x32c3b9){return _0x49ec0b[_0xe43d('0x18')](_0x28ee70);}return _0x49ec0b['status'](_0x28ee70)[_0xe43d('0x19')]();};}function respondWithResult(_0x4e1af2,_0x2f3ccf){_0x2f3ccf=_0x2f3ccf||0xc8;return function(_0x55f9b5){if(_0x55f9b5){return _0x4e1af2['status'](_0x2f3ccf)['json'](_0x55f9b5);}};}function respondWithFilteredResult(_0x2ea3d8,_0x1d7b40){return function(_0x1491cd){if(_0x1491cd){var _0xc221d8=typeof _0x1d7b40[_0xe43d('0x1a')]===_0xe43d('0x1b')&&typeof _0x1d7b40['limit']===_0xe43d('0x1b');var _0x258752=_0x1491cd[_0xe43d('0x1c')];var _0x712a1c=_0xc221d8?0x0:_0x1d7b40[_0xe43d('0x1a')];var _0x3fe86a=_0xc221d8?_0x1491cd['count']:_0x1d7b40[_0xe43d('0x1a')]+_0x1d7b40[_0xe43d('0x1d')];var _0x2cb1c8;if(_0x3fe86a>=_0x258752){_0x3fe86a=_0x258752;_0x2cb1c8=0xc8;}else{_0x2cb1c8=0xce;}_0x2ea3d8[_0xe43d('0x1e')](_0x2cb1c8);return _0x2ea3d8[_0xe43d('0x1f')](_0xe43d('0x20'),_0x712a1c+'-'+_0x3fe86a+'/'+_0x258752)[_0xe43d('0x21')](_0x1491cd);}return null;};}function patchUpdates(_0x4d338a){return function(_0x1f9967){try{jsonpatch[_0xe43d('0x22')](_0x1f9967,_0x4d338a,!![]);}catch(_0x271ab9){return BPromise['reject'](_0x271ab9);}return _0x1f9967[_0xe43d('0x23')]();};}function saveUpdates(_0x2c33cd,_0x2e34f1){return function(_0x4fa4f1){if(_0x4fa4f1){return _0x4fa4f1[_0xe43d('0x24')](_0x2c33cd)[_0xe43d('0x25')](function(_0x866a14){return _0x866a14;});}return null;};}function removeEntity(_0x3af291,_0x2bf1fa){return function(_0x3f40b6){if(_0x3f40b6){return _0x3f40b6[_0xe43d('0x26')]()['then'](function(){_0x3af291[_0xe43d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453a8b,_0x243d83){return function(_0x37cac2){if(!_0x37cac2){_0x453a8b[_0xe43d('0x18')](0x194);}return _0x37cac2;};}function handleError(_0x4a173e,_0x27c765){_0x27c765=_0x27c765||0x1f4;return function(_0x228300){logger['error'](_0x228300[_0xe43d('0x27')]);if(_0x228300[_0xe43d('0x28')]){delete _0x228300['name'];}_0x4a173e[_0xe43d('0x1e')](_0x27c765)[_0xe43d('0x29')](_0x228300);};}exports['index']=function(_0x41ef33,_0x2053c3){var _0x3b8e38={},_0x16d999={},_0x407f03={'count':0x0,'rows':[]};var _0x441f34=_[_0xe43d('0x2a')](db[_0xe43d('0x2b')]['rawAttributes'],function(_0x3af35f){return{'name':_0x3af35f[_0xe43d('0x2c')],'type':_0x3af35f[_0xe43d('0x2d')]['key']};});_0x16d999[_0xe43d('0x2e')]=_[_0xe43d('0x2a')](_0x441f34,'name');_0x16d999[_0xe43d('0x2f')]=_[_0xe43d('0x30')](_0x41ef33[_0xe43d('0x2f')]);_0x16d999[_0xe43d('0x31')]=_[_0xe43d('0x32')](_0x16d999[_0xe43d('0x2e')],_0x16d999[_0xe43d('0x2f')]);_0x3b8e38['attributes']=_[_0xe43d('0x32')](_0x16d999[_0xe43d('0x2e')],qs['fields'](_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x33')]));_0x3b8e38[_0xe43d('0x34')]=_0x3b8e38[_0xe43d('0x34')][_0xe43d('0x35')]?_0x3b8e38[_0xe43d('0x34')]:_0x16d999[_0xe43d('0x2e')];if(!_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x36')]('nolimit')){_0x3b8e38[_0xe43d('0x1d')]=qs['limit'](_0x41ef33[_0xe43d('0x2f')]['limit']);_0x3b8e38[_0xe43d('0x1a')]=qs[_0xe43d('0x1a')](_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x1a')]);}_0x3b8e38[_0xe43d('0x37')]=qs['sort'](_0x41ef33[_0xe43d('0x2f')][_0xe43d('0x38')]);_0x3b8e38['where']=qs['filters'](_[_0xe43d('0x39')](_0x41ef33['query'],_0x16d999[_0xe43d('0x31')]),_0x441f34);if(_0x41ef33[_0xe43d('0x2f')]['filter']){_0x3b8e38[_0xe43d('0x3a')]=_[_0xe43d('0x3b')](_0x3b8e38[_0xe43d('0x3a')],{'$or':_[_0xe43d('0x2a')](_0x441f34,function(_0x2bf985){if(_0x2bf985[_0xe43d('0x2d')]!=='VIRTUAL'){var _0x30b0b6={};_0x30b0b6[_0x2bf985[_0xe43d('0x28')]]={'$like':'%'+_0x41ef33['query'][_0xe43d('0x3c')]+'%'};return _0x30b0b6;}})});}_0x3b8e38=_[_0xe43d('0x3b')]({},_0x3b8e38,_0x41ef33['options']);var _0x205c28={'where':_0x3b8e38[_0xe43d('0x3a')]};return db[_0xe43d('0x2b')]['count'](_0x205c28)['then'](function(_0x4a3cd8){_0x407f03[_0xe43d('0x1c')]=_0x4a3cd8;if(_0x41ef33['query'][_0xe43d('0x3d')]){_0x3b8e38[_0xe43d('0x3e')]=[{'all':!![]}];}return db[_0xe43d('0x2b')][_0xe43d('0x3f')](_0x3b8e38);})['then'](function(_0x230257){_0x407f03[_0xe43d('0x40')]=_0x230257;return _0x407f03;})[_0xe43d('0x25')](respondWithFilteredResult(_0x2053c3,_0x3b8e38))['catch'](handleError(_0x2053c3,null));};exports['show']=function(_0x528bb2,_0x932821){var _0x3d2770={'raw':![],'where':{'id':_0x528bb2[_0xe43d('0x41')]['id']}},_0x414b56={};_0x414b56['model']=_[_0xe43d('0x30')](db[_0xe43d('0x2b')][_0xe43d('0x42')]);_0x414b56['query']=_[_0xe43d('0x30')](_0x528bb2[_0xe43d('0x2f')]);_0x414b56['filters']=_[_0xe43d('0x32')](_0x414b56[_0xe43d('0x2e')],_0x414b56[_0xe43d('0x2f')]);_0x3d2770['attributes']=_[_0xe43d('0x32')](_0x414b56['model'],qs[_0xe43d('0x33')](_0x528bb2[_0xe43d('0x2f')][_0xe43d('0x33')]));_0x3d2770[_0xe43d('0x34')]=_0x3d2770['attributes'][_0xe43d('0x35')]?_0x3d2770[_0xe43d('0x34')]:_0x414b56[_0xe43d('0x2e')];if(_0x528bb2[_0xe43d('0x2f')][_0xe43d('0x3d')]){_0x3d2770['include']=[{'all':!![]}];}_0x3d2770=_[_0xe43d('0x3b')]({},_0x3d2770,_0x528bb2[_0xe43d('0x43')]);return db[_0xe43d('0x2b')][_0xe43d('0x44')](_0x3d2770)[_0xe43d('0x25')](handleEntityNotFound(_0x932821,null))[_0xe43d('0x25')](respondWithResult(_0x932821,null))[_0xe43d('0x45')](handleError(_0x932821,null));};exports[_0xe43d('0x46')]=function(_0x5e6cd4,_0x3f805f){return db['AnalyticFieldReport'][_0xe43d('0x46')](_0x5e6cd4[_0xe43d('0x47')],{})[_0xe43d('0x25')](respondWithResult(_0x3f805f,0xc9))[_0xe43d('0x45')](handleError(_0x3f805f,null));};exports['bulkCreate']=function(_0xc1836,_0x181693){return db['AnalyticFieldReport'][_0xe43d('0x48')](_0xc1836['body'],{'raw':![],'individualHooks':!![]})[_0xe43d('0x25')](respondWithResult(_0x181693,0xc9))[_0xe43d('0x45')](handleError(_0x181693,null));};exports['update']=function(_0xfacc7,_0x2d4f0b){if(_0xfacc7['body']['id']){delete _0xfacc7[_0xe43d('0x47')]['id'];}return db[_0xe43d('0x2b')][_0xe43d('0x44')]({'where':{'id':_0xfacc7['params']['id']}})[_0xe43d('0x25')](handleEntityNotFound(_0x2d4f0b,null))[_0xe43d('0x25')](saveUpdates(_0xfacc7['body'],null))[_0xe43d('0x25')](respondWithResult(_0x2d4f0b,null))[_0xe43d('0x45')](handleError(_0x2d4f0b,null));};exports[_0xe43d('0x26')]=function(_0x282bc7,_0x3e174f){return db[_0xe43d('0x2b')][_0xe43d('0x44')]({'where':{'id':_0x282bc7[_0xe43d('0x41')]['id']}})[_0xe43d('0x25')](handleEntityNotFound(_0x3e174f,null))[_0xe43d('0x25')](removeEntity(_0x3e174f,null))[_0xe43d('0x45')](handleError(_0x3e174f,null));};exports[_0xe43d('0x49')]=function(_0x9c54a8,_0x1a62ac){return db[_0xe43d('0x2b')][_0xe43d('0x26')]({'where':{'id':_0x9c54a8[_0xe43d('0x2f')][_0xe43d('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1a62ac,0xcc))['catch'](handleError(_0x1a62ac,null));};exports[_0xe43d('0x4b')]=function(_0x1bb592,_0x6f22b7,_0x29b0cc){return db[_0xe43d('0x4c')][_0xe43d('0x4d')]({'where':{'id':_0x1bb592[_0xe43d('0x41')]['id']}})[_0xe43d('0x25')](handleEntityNotFound(_0x6f22b7,null))[_0xe43d('0x25')](function(_0x51193c){if(_0x51193c){return db[_0xe43d('0x4e')]['transaction'](function(_0x310bbe){return db[_0xe43d('0x2b')][_0xe43d('0x26')]({'where':{'CustomReportId':_0x1bb592['params']['id']},'transaction':_0x310bbe})['then'](function(_0x5e4a46){var _0x5b288c=_[_0xe43d('0x2a')](_0x1bb592['body'],function(_0x2af97a){delete _0x2af97a['id'];_0x2af97a['CustomReportId']=_0x1bb592['params']['id'];return _0x2af97a;});return db[_0xe43d('0x2b')][_0xe43d('0x48')](_0x5b288c,{'transaction':_0x310bbe});});})[_0xe43d('0x25')](function(){return db[_0xe43d('0x2b')][_0xe43d('0x3f')]({'where':{'CustomReportId':_0x1bb592[_0xe43d('0x41')]['id']}});});}})[_0xe43d('0x25')](respondWithResult(_0x6f22b7,null))[_0xe43d('0x45')](handleError(_0x6f22b7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 2efae7c..ce7ae0a 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 _0xa6b9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x37d517,_0x30d866){var _0x1bce32=function(_0x455700){while(--_0x455700){_0x37d517['push'](_0x37d517['shift']());}};_0x1bce32(++_0x30d866);}(_0xa6b9,0x1a0));var _0x9a6b=function(_0xfe2d5b,_0x4f6148){_0xfe2d5b=_0xfe2d5b-0x0;var _0x2f2f6b=_0xa6b9[_0xfe2d5b];return _0x2f2f6b;};'use strict';var _=require(_0x9a6b('0x0'));var util=require(_0x9a6b('0x1'));var logger=require('../../config/logger')(_0x9a6b('0x2'));var moment=require(_0x9a6b('0x3'));var BPromise=require(_0x9a6b('0x4'));var rp=require(_0x9a6b('0x5'));var fs=require('fs');var path=require(_0x9a6b('0x6'));var rimraf=require(_0x9a6b('0x7'));var config=require(_0x9a6b('0x8'));var attributes=require(_0x9a6b('0x9'));module[_0x9a6b('0xa')]=function(_0xadacb3,_0xb91593){return _0xadacb3[_0x9a6b('0xb')](_0x9a6b('0xc'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d74=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api'];(function(_0x1bebb5,_0x550e89){var _0x22c83d=function(_0x1a9ed2){while(--_0x1a9ed2){_0x1bebb5['push'](_0x1bebb5['shift']());}};_0x22c83d(++_0x550e89);}(_0x6d74,0x182));var _0x46d7=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x6d74[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x46d7('0x0'));var util=require(_0x46d7('0x1'));var logger=require(_0x46d7('0x2'))(_0x46d7('0x3'));var moment=require(_0x46d7('0x4'));var BPromise=require(_0x46d7('0x5'));var rp=require(_0x46d7('0x6'));var fs=require('fs');var path=require(_0x46d7('0x7'));var rimraf=require(_0x46d7('0x8'));var config=require(_0x46d7('0x9'));var attributes=require(_0x46d7('0xa'));module[_0x46d7('0xb')]=function(_0x306f39,_0x3255a3){return _0x306f39[_0x46d7('0xc')](_0x46d7('0xd'),attributes,{'tableName':_0x46d7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index ec45dc3..70280a0 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 _0x9618=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9618,0x1b9));var _0x8961=function(_0x4b4aa0,_0x353a65){_0x4b4aa0=_0x4b4aa0-0x0;var _0x331b16=_0x9618[_0x4b4aa0];return _0x331b16;};'use strict';var _=require(_0x8961('0x0'));var util=require(_0x8961('0x1'));var moment=require(_0x8961('0x2'));var BPromise=require(_0x8961('0x3'));var rs=require(_0x8961('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8961('0x5'))['db'];var utils=require(_0x8961('0x6'));var logger=require(_0x8961('0x7'))(_0x8961('0x8'));var config=require(_0x8961('0x9'));var jayson=require(_0x8961('0xa'));var client=jayson[_0x8961('0xb')][_0x8961('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b3ff8,_0x4cfbca,_0x3dd4b4){return new BPromise(function(_0xe1d457,_0x1270bb){return client[_0x8961('0xd')](_0x1b3ff8,_0x3dd4b4)['then'](function(_0x1a7705){logger[_0x8961('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4cfbca,'request\x20sent');logger[_0x8961('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4cfbca,_0x8961('0x10'),JSON[_0x8961('0x11')](_0x1a7705));if(_0x1a7705[_0x8961('0x12')]){if(_0x1a7705[_0x8961('0x12')]['code']===0x1f4){logger[_0x8961('0x12')](_0x8961('0x13'),_0x4cfbca,_0x1a7705[_0x8961('0x12')]['message']);return _0x1270bb(_0x1a7705[_0x8961('0x12')][_0x8961('0x14')]);}logger[_0x8961('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4cfbca,_0x1a7705[_0x8961('0x12')][_0x8961('0x14')]);return _0xe1d457(_0x1a7705['error'][_0x8961('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4cfbca,_0x8961('0x10'));_0xe1d457(_0x1a7705['result'][_0x8961('0x14')]);}})[_0x8961('0x15')](function(_0xd2cc68){logger[_0x8961('0x12')](_0x8961('0x13'),_0x4cfbca,_0xd2cc68);_0x1270bb(_0xd2cc68);});});}
\ No newline at end of file
+var _0x2196=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x300f86,_0x356a2f){var _0x1e9ac4=function(_0x549f9f){while(--_0x549f9f){_0x300f86['push'](_0x300f86['shift']());}};_0x1e9ac4(++_0x356a2f);}(_0x2196,0x197));var _0x6219=function(_0x3765ff,_0x16916e){_0x3765ff=_0x3765ff-0x0;var _0x333f28=_0x2196[_0x3765ff];return _0x333f28;};'use strict';var _=require(_0x6219('0x0'));var util=require(_0x6219('0x1'));var moment=require(_0x6219('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6219('0x3'));var db=require(_0x6219('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6219('0x5'))(_0x6219('0x6'));var config=require(_0x6219('0x7'));var jayson=require(_0x6219('0x8'));var client=jayson[_0x6219('0x9')][_0x6219('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3aeefb,_0x375f16,_0x324c64){return new BPromise(function(_0x53358e,_0x39b784){return client[_0x6219('0xb')](_0x3aeefb,_0x324c64)[_0x6219('0xc')](function(_0x1de215){logger[_0x6219('0xd')](_0x6219('0xe'),_0x375f16,'request\x20sent');logger['debug'](_0x6219('0xf'),_0x375f16,_0x6219('0x10'),JSON['stringify'](_0x1de215));if(_0x1de215['error']){if(_0x1de215[_0x6219('0x11')]['code']===0x1f4){logger[_0x6219('0x11')](_0x6219('0xe'),_0x375f16,_0x1de215[_0x6219('0x11')]['message']);return _0x39b784(_0x1de215[_0x6219('0x11')][_0x6219('0x12')]);}logger[_0x6219('0x11')](_0x6219('0xe'),_0x375f16,_0x1de215[_0x6219('0x11')][_0x6219('0x12')]);return _0x53358e(_0x1de215['error']['message']);}else{logger[_0x6219('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x375f16,_0x6219('0x10'));_0x53358e(_0x1de215['result'][_0x6219('0x12')]);}})['catch'](function(_0x5424ba){logger['error'](_0x6219('0xe'),_0x375f16,_0x5424ba);_0x39b784(_0x5424ba);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 333bdd5..55ec5e2 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(_0x3b4254,_0x3a6d5c){var _0x3a4dde=function(_0x17b618){while(--_0x17b618){_0x3b4254['push'](_0x3b4254['shift']());}};_0x3a4dde(++_0x3a6d5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x1f92c7,_0x351ccb){var _0x564e90=function(_0x5d6770){while(--_0x5d6770){_0x1f92c7['push'](_0x1f92c7['shift']());}};_0x564e90(++_0x351ccb);}(_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
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index e98b606..5a9774b 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 _0xaa88=['TEXT','sequelize','exports','STRING','name'];(function(_0x103448,_0x482583){var _0x267e4f=function(_0x57c5e9){while(--_0x57c5e9){_0x103448['push'](_0x103448['shift']());}};_0x267e4f(++_0x482583);}(_0xaa88,0x137));var _0x8aa8=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xaa88[_0x47a12a];return _0x30cd40;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![],'unique':_0x8aa8('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x8aa8('0x4')]},'description':{'type':Sequelize[_0x8aa8('0x2')]}};
\ No newline at end of file
+var _0xffda=['sequelize','exports','STRING','name','TEXT'];(function(_0x31bb9e,_0x218f3f){var _0xa50bb8=function(_0x54e9c3){while(--_0x54e9c3){_0x31bb9e['push'](_0x31bb9e['shift']());}};_0xa50bb8(++_0x218f3f);}(_0xffda,0x73));var _0xaffd=function(_0x6ad3bf,_0x1418d7){_0x6ad3bf=_0x6ad3bf-0x0;var _0xe332e8=_0xffda[_0x6ad3bf];return _0xe332e8;};'use strict';var Sequelize=require(_0xaffd('0x0'));module[_0xaffd('0x1')]={'name':{'type':Sequelize[_0xaffd('0x2')],'allowNull':![],'unique':_0xaffd('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xaffd('0x4')]},'description':{'type':Sequelize[_0xaffd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index f56ed56..7a42df5 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x547d1f,_0x1a3598){var _0x33149d=function(_0x47f77a){while(--_0x47f77a){_0x547d1f['push'](_0x547d1f['shift']());}};_0x33149d(++_0x1a3598);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0x24ca[_0x4f1da5];return _0xe972a8;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));};
\ No newline at end of file
+var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x205a6e,_0x571a14){var _0x43adb6=function(_0xb71d8b){while(--_0xb71d8b){_0x205a6e['push'](_0x205a6e['shift']());}};_0x43adb6(++_0x571a14);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3334cb,_0x38c266){_0x3334cb=_0x3334cb-0x0;var _0x60be26=_0x9c5a[_0x3334cb];return _0x60be26;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index ef389a1..5d45338 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 _0x972c=['api','bluebird','request-promise','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','../../config/logger'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x972c,0xf2));var _0xc972=function(_0xc7c23,_0x1901b8){_0xc7c23=_0xc7c23-0x0;var _0x3f8daa=_0x972c[_0xc7c23];return _0x3f8daa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc972('0x0'))(_0xc972('0x1'));var moment=require('moment');var BPromise=require(_0xc972('0x2'));var rp=require(_0xc972('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc972('0x4'));var attributes=require(_0xc972('0x5'));module[_0xc972('0x6')]=function(_0x5dd2c8,_0xd70261){return _0x5dd2c8['define'](_0xc972('0x7'),attributes,{'tableName':_0xc972('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed08=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1f8fee,_0x1a0bff){var _0x51643b=function(_0x414bd5){while(--_0x414bd5){_0x1f8fee['push'](_0x1f8fee['shift']());}};_0x51643b(++_0x1a0bff);}(_0xed08,0x67));var _0x8ed0=function(_0x85a9bf,_0x111dcd){_0x85a9bf=_0x85a9bf-0x0;var _0x6d94aa=_0xed08[_0x85a9bf];return _0x6d94aa;};'use strict';var _=require('lodash');var util=require(_0x8ed0('0x0'));var logger=require(_0x8ed0('0x1'))(_0x8ed0('0x2'));var moment=require(_0x8ed0('0x3'));var BPromise=require(_0x8ed0('0x4'));var rp=require(_0x8ed0('0x5'));var fs=require('fs');var path=require(_0x8ed0('0x6'));var rimraf=require(_0x8ed0('0x7'));var config=require(_0x8ed0('0x8'));var attributes=require(_0x8ed0('0x9'));module[_0x8ed0('0xa')]=function(_0x43ca60,_0x5c1343){return _0x43ca60[_0x8ed0('0xb')](_0x8ed0('0xc'),attributes,{'tableName':_0x8ed0('0xd'),'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 c307231..c2a79b5 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 _0xa235=['info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xa235,0x129));var _0x5a23=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xa235[_0x397cfb];return _0x15fed9;};'use strict';var _=require('lodash');var util=require(_0x5a23('0x0'));var moment=require(_0x5a23('0x1'));var BPromise=require(_0x5a23('0x2'));var rs=require(_0x5a23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a23('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a23('0x5'));var jayson=require(_0x5a23('0x6'));var client=jayson['client'][_0x5a23('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x99b608,_0x249270,_0x150547){return new BPromise(function(_0x3db6ef,_0x539af4){return client[_0x5a23('0x8')](_0x99b608,_0x150547)['then'](function(_0x4c77c8){logger[_0x5a23('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x249270,_0x5a23('0xa'));logger['debug'](_0x5a23('0xb'),_0x249270,_0x5a23('0xa'),JSON['stringify'](_0x4c77c8));if(_0x4c77c8[_0x5a23('0xc')]){if(_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xd')]===0x1f4){logger[_0x5a23('0xc')](_0x5a23('0xe'),_0x249270,_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);return _0x539af4(_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);}logger['error'](_0x5a23('0xe'),_0x249270,_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);return _0x3db6ef(_0x4c77c8[_0x5a23('0xc')][_0x5a23('0xf')]);}else{logger['info'](_0x5a23('0xe'),_0x249270,_0x5a23('0xa'));_0x3db6ef(_0x4c77c8[_0x5a23('0x10')]['message']);}})[_0x5a23('0x11')](function(_0x32bd46){logger['error'](_0x5a23('0xe'),_0x249270,_0x32bd46);_0x539af4(_0x32bd46);});});}
\ No newline at end of file
+var _0xb9e3=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5528c3,_0x35a416){var _0x47ec1b=function(_0x54a18e){while(--_0x54a18e){_0x5528c3['push'](_0x5528c3['shift']());}};_0x47ec1b(++_0x35a416);}(_0xb9e3,0x150));var _0x3b9e=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xb9e3[_0x3712e2];return _0x1faff4;};'use strict';var _=require(_0x3b9e('0x0'));var util=require(_0x3b9e('0x1'));var moment=require(_0x3b9e('0x2'));var BPromise=require(_0x3b9e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b9e('0x5'));var logger=require(_0x3b9e('0x6'))(_0x3b9e('0x7'));var config=require(_0x3b9e('0x8'));var jayson=require(_0x3b9e('0x9'));var client=jayson[_0x3b9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3430cd,_0x3d828a,_0x20452d){return new BPromise(function(_0x413d31,_0x5d03b2){return client[_0x3b9e('0xb')](_0x3430cd,_0x20452d)[_0x3b9e('0xc')](function(_0x121d85){logger[_0x3b9e('0xd')](_0x3b9e('0xe'),_0x3d828a,'request\x20sent');logger[_0x3b9e('0xf')](_0x3b9e('0x10'),_0x3d828a,_0x3b9e('0x11'),JSON[_0x3b9e('0x12')](_0x121d85));if(_0x121d85[_0x3b9e('0x13')]){if(_0x121d85[_0x3b9e('0x13')][_0x3b9e('0x14')]===0x1f4){logger['error'](_0x3b9e('0xe'),_0x3d828a,_0x121d85[_0x3b9e('0x13')][_0x3b9e('0x15')]);return _0x5d03b2(_0x121d85['error'][_0x3b9e('0x15')]);}logger[_0x3b9e('0x13')](_0x3b9e('0xe'),_0x3d828a,_0x121d85['error']['message']);return _0x413d31(_0x121d85[_0x3b9e('0x13')]['message']);}else{logger['info'](_0x3b9e('0xe'),_0x3d828a,_0x3b9e('0x11'));_0x413d31(_0x121d85[_0x3b9e('0x16')]['message']);}})[_0x3b9e('0x17')](function(_0x4edbff){logger[_0x3b9e('0x13')](_0x3b9e('0xe'),_0x3d828a,_0x4edbff);_0x5d03b2(_0x4edbff);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index bdbfcb6..1de9ff0 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 _0xe0c3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x16de4c,_0x507b95){var _0x5f3b42=function(_0x1d4aa4){while(--_0x1d4aa4){_0x16de4c['push'](_0x16de4c['shift']());}};_0x5f3b42(++_0x507b95);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xf')]('/',auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller['update']);router['delete'](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);module[_0x3e0c('0x13')]=router;
\ No newline at end of file
+var _0xce1a=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','get','/:id','put','update','exports','multer','express','Router','fs-extra'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xce1a,0xbf));var _0xace1=function(_0x1be143,_0x2f58ed){_0x1be143=_0x1be143-0x0;var _0xaa3f65=_0xce1a[_0x1be143];return _0xaa3f65;};'use strict';var multer=require(_0xace1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xace1('0x1'));var router=express[_0xace1('0x2')]();var fs_extra=require(_0xace1('0x3'));var auth=require(_0xace1('0x4'));var interaction=require(_0xace1('0x5'));var config=require('../../config/environment');var controller=require(_0xace1('0x6'));router['get']('/',auth[_0xace1('0x7')](),controller['index']);router[_0xace1('0x8')](_0xace1('0x9'),auth[_0xace1('0x7')](),controller['show']);router['post']('/',auth[_0xace1('0x7')](),controller['create']);router[_0xace1('0xa')](_0xace1('0x9'),auth[_0xace1('0x7')](),controller[_0xace1('0xb')]);router['delete'](_0xace1('0x9'),auth[_0xace1('0x7')](),controller['destroy']);module[_0xace1('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index e16d11a..341506e 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 _0xf7cb=['TEXT','exports'];(function(_0x167113,_0x2b659b){var _0x1cdd7c=function(_0x5419ec){while(--_0x5419ec){_0x167113['push'](_0x167113['shift']());}};_0x1cdd7c(++_0x2b659b);}(_0xf7cb,0x1a9));var _0xbf7c=function(_0x323e80,_0x283088){_0x323e80=_0x323e80-0x0;var _0x3c5a0d=_0xf7cb[_0x323e80];return _0x3c5a0d;};'use strict';var Sequelize=require('sequelize');module[_0xbf7c('0x0')]={'tree':{'type':Sequelize[_0xbf7c('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xa4ba=['TEXT','exports'];(function(_0x265793,_0x1184c5){var _0x1fbad1=function(_0x420cb8){while(--_0x420cb8){_0x265793['push'](_0x265793['shift']());}};_0x1fbad1(++_0x1184c5);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa4ba[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require('sequelize');module[_0xaa4b('0x0')]={'tree':{'type':Sequelize[_0xaa4b('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 124cf61..7fdd74d 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 _0xbd50=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','AnalyticTreeReport','includeAll','include','rows','show','params','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x5b78fe,_0x44542c){var _0x24ac3c=function(_0x552b51){while(--_0x552b51){_0x5b78fe['push'](_0x5b78fe['shift']());}};_0x24ac3c(++_0x44542c);}(_0xbd50,0x19a));var _0x0bd5=function(_0x570572,_0x1ec498){_0x570572=_0x570572-0x0;var _0x2584c9=_0xbd50[_0x570572];return _0x2584c9;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require(_0x0bd5('0x3'));var rp=require(_0x0bd5('0x4'));var moment=require(_0x0bd5('0x5'));var BPromise=require(_0x0bd5('0x6'));var Mustache=require(_0x0bd5('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0bd5('0x8'));var csv=require(_0x0bd5('0x9'));var ejs=require(_0x0bd5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bd5('0xb'));var squel=require(_0x0bd5('0xc'));var crypto=require(_0x0bd5('0xd'));var jsforce=require(_0x0bd5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0x9'));var querystring=require('querystring');var Papa=require(_0x0bd5('0xf'));var Redis=require(_0x0bd5('0x10'));var authService=require(_0x0bd5('0x11'));var qs=require(_0x0bd5('0x12'));var as=require(_0x0bd5('0x13'));var hardwareService=require(_0x0bd5('0x14'));var logger=require(_0x0bd5('0x15'))(_0x0bd5('0x16'));var utils=require(_0x0bd5('0x17'));var config=require(_0x0bd5('0x18'));var licenseUtil=require(_0x0bd5('0x19'));var db=require(_0x0bd5('0x1a'))['db'];function respondWithStatusCode(_0x25bc6c,_0x1dcc60){_0x1dcc60=_0x1dcc60||0xcc;return function(_0x12406d){if(_0x12406d){return _0x25bc6c[_0x0bd5('0x1b')](_0x1dcc60);}return _0x25bc6c[_0x0bd5('0x1c')](_0x1dcc60)[_0x0bd5('0x1d')]();};}function respondWithResult(_0x2f7308,_0x197212){_0x197212=_0x197212||0xc8;return function(_0x2d8150){if(_0x2d8150){return _0x2f7308[_0x0bd5('0x1c')](_0x197212)[_0x0bd5('0x1e')](_0x2d8150);}};}function respondWithFilteredResult(_0x3fb937,_0x4a5299){return function(_0x4cbcbd){if(_0x4cbcbd){var _0x49f770=typeof _0x4a5299[_0x0bd5('0x1f')]===_0x0bd5('0x20')&&typeof _0x4a5299[_0x0bd5('0x21')]===_0x0bd5('0x20');var _0x35cef5=_0x4cbcbd[_0x0bd5('0x22')];var _0x5bf789=_0x49f770?0x0:_0x4a5299[_0x0bd5('0x1f')];var _0x190cf4=_0x49f770?_0x4cbcbd['count']:_0x4a5299['offset']+_0x4a5299[_0x0bd5('0x21')];var _0x2be435;if(_0x190cf4>=_0x35cef5){_0x190cf4=_0x35cef5;_0x2be435=0xc8;}else{_0x2be435=0xce;}_0x3fb937[_0x0bd5('0x1c')](_0x2be435);return _0x3fb937['set'](_0x0bd5('0x23'),_0x5bf789+'-'+_0x190cf4+'/'+_0x35cef5)[_0x0bd5('0x1e')](_0x4cbcbd);}return null;};}function patchUpdates(_0x13483b){return function(_0x587566){try{jsonpatch['apply'](_0x587566,_0x13483b,!![]);}catch(_0x284fe2){return BPromise[_0x0bd5('0x24')](_0x284fe2);}return _0x587566[_0x0bd5('0x25')]();};}function saveUpdates(_0x12f688,_0x3cffc7){return function(_0x56c5d3){if(_0x56c5d3){return _0x56c5d3[_0x0bd5('0x26')](_0x12f688)[_0x0bd5('0x27')](function(_0x13c126){return _0x13c126;});}return null;};}function removeEntity(_0x51a3a0,_0x569ee3){return function(_0xdd9bc){if(_0xdd9bc){return _0xdd9bc[_0x0bd5('0x28')]()[_0x0bd5('0x27')](function(){_0x51a3a0[_0x0bd5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x78328d,_0x333fbe){return function(_0x42c78a){if(!_0x42c78a){_0x78328d[_0x0bd5('0x1b')](0x194);}return _0x42c78a;};}function handleError(_0x1dee6b,_0x265b25){_0x265b25=_0x265b25||0x1f4;return function(_0x5d09cc){logger[_0x0bd5('0x29')](_0x5d09cc[_0x0bd5('0x2a')]);if(_0x5d09cc[_0x0bd5('0x2b')]){delete _0x5d09cc['name'];}_0x1dee6b[_0x0bd5('0x1c')](_0x265b25)[_0x0bd5('0x2c')](_0x5d09cc);};}exports[_0x0bd5('0x2d')]=function(_0x3e19ae,_0x5ee9da){var _0x232d4d={},_0x542cbc={},_0x4d12c4={'count':0x0,'rows':[]};var _0x4d5b74=_[_0x0bd5('0x2e')](db['AnalyticTreeReport'][_0x0bd5('0x2f')],function(_0x392767){return{'name':_0x392767[_0x0bd5('0x30')],'type':_0x392767['type'][_0x0bd5('0x31')]};});_0x542cbc[_0x0bd5('0x32')]=_[_0x0bd5('0x2e')](_0x4d5b74,'name');_0x542cbc['query']=_[_0x0bd5('0x33')](_0x3e19ae[_0x0bd5('0x34')]);_0x542cbc[_0x0bd5('0x35')]=_[_0x0bd5('0x36')](_0x542cbc[_0x0bd5('0x32')],_0x542cbc[_0x0bd5('0x34')]);_0x232d4d[_0x0bd5('0x37')]=_[_0x0bd5('0x36')](_0x542cbc[_0x0bd5('0x32')],qs[_0x0bd5('0x38')](_0x3e19ae[_0x0bd5('0x34')]['fields']));_0x232d4d['attributes']=_0x232d4d[_0x0bd5('0x37')][_0x0bd5('0x39')]?_0x232d4d[_0x0bd5('0x37')]:_0x542cbc[_0x0bd5('0x32')];if(!_0x3e19ae['query'][_0x0bd5('0x3a')](_0x0bd5('0x3b'))){_0x232d4d[_0x0bd5('0x21')]=qs[_0x0bd5('0x21')](_0x3e19ae[_0x0bd5('0x34')]['limit']);_0x232d4d[_0x0bd5('0x1f')]=qs[_0x0bd5('0x1f')](_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x1f')]);}_0x232d4d[_0x0bd5('0x3c')]=qs[_0x0bd5('0x3d')](_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x3d')]);_0x232d4d[_0x0bd5('0x3e')]=qs['filters'](_[_0x0bd5('0x3f')](_0x3e19ae[_0x0bd5('0x34')],_0x542cbc['filters']),_0x4d5b74);if(_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x40')]){_0x232d4d['where']=_[_0x0bd5('0x41')](_0x232d4d[_0x0bd5('0x3e')],{'$or':_[_0x0bd5('0x2e')](_0x4d5b74,function(_0x55719c){if(_0x55719c['type']!==_0x0bd5('0x42')){var _0xa5ad8c={};_0xa5ad8c[_0x55719c['name']]={'$like':'%'+_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x40')]+'%'};return _0xa5ad8c;}})});}_0x232d4d=_['merge']({},_0x232d4d,_0x3e19ae['options']);var _0x6b319e={'where':_0x232d4d[_0x0bd5('0x3e')]};return db[_0x0bd5('0x43')][_0x0bd5('0x22')](_0x6b319e)[_0x0bd5('0x27')](function(_0x341512){_0x4d12c4['count']=_0x341512;if(_0x3e19ae[_0x0bd5('0x34')][_0x0bd5('0x44')]){_0x232d4d[_0x0bd5('0x45')]=[{'all':!![]}];}return db[_0x0bd5('0x43')]['findAll'](_0x232d4d);})[_0x0bd5('0x27')](function(_0x2990d2){_0x4d12c4[_0x0bd5('0x46')]=_0x2990d2;return _0x4d12c4;})[_0x0bd5('0x27')](respondWithFilteredResult(_0x5ee9da,_0x232d4d))['catch'](handleError(_0x5ee9da,null));};exports[_0x0bd5('0x47')]=function(_0x3bc322,_0x2c2ad3){var _0x3f59bc={'raw':!![],'where':{'id':_0x3bc322[_0x0bd5('0x48')]['id']}},_0x2a2311={};_0x2a2311[_0x0bd5('0x32')]=_[_0x0bd5('0x33')](db[_0x0bd5('0x43')][_0x0bd5('0x2f')]);_0x2a2311[_0x0bd5('0x34')]=_[_0x0bd5('0x33')](_0x3bc322[_0x0bd5('0x34')]);_0x2a2311['filters']=_['intersection'](_0x2a2311[_0x0bd5('0x32')],_0x2a2311[_0x0bd5('0x34')]);_0x3f59bc['attributes']=_[_0x0bd5('0x36')](_0x2a2311[_0x0bd5('0x32')],qs['fields'](_0x3bc322[_0x0bd5('0x34')]['fields']));_0x3f59bc[_0x0bd5('0x37')]=_0x3f59bc[_0x0bd5('0x37')][_0x0bd5('0x39')]?_0x3f59bc['attributes']:_0x2a2311['model'];if(_0x3bc322['query'][_0x0bd5('0x44')]){_0x3f59bc[_0x0bd5('0x45')]=[{'all':!![]}];}_0x3f59bc=_[_0x0bd5('0x41')]({},_0x3f59bc,_0x3bc322[_0x0bd5('0x49')]);return db['AnalyticTreeReport'][_0x0bd5('0x4a')](_0x3f59bc)[_0x0bd5('0x27')](handleEntityNotFound(_0x2c2ad3,null))[_0x0bd5('0x27')](respondWithResult(_0x2c2ad3,null))['catch'](handleError(_0x2c2ad3,null));};exports[_0x0bd5('0x4b')]=function(_0x57942c,_0x311a16){return db[_0x0bd5('0x43')]['create'](_0x57942c[_0x0bd5('0x4c')],{})['then'](respondWithResult(_0x311a16,0xc9))[_0x0bd5('0x4d')](handleError(_0x311a16,null));};exports[_0x0bd5('0x26')]=function(_0x579383,_0x2de922){if(_0x579383[_0x0bd5('0x4c')]['id']){delete _0x579383['body']['id'];}return db['AnalyticTreeReport'][_0x0bd5('0x4a')]({'where':{'id':_0x579383['params']['id']}})[_0x0bd5('0x27')](handleEntityNotFound(_0x2de922,null))['then'](saveUpdates(_0x579383[_0x0bd5('0x4c')],null))[_0x0bd5('0x27')](respondWithResult(_0x2de922,null))[_0x0bd5('0x4d')](handleError(_0x2de922,null));};exports['destroy']=function(_0x26f9b0,_0x11fad4){return db[_0x0bd5('0x43')][_0x0bd5('0x4a')]({'where':{'id':_0x26f9b0['params']['id']}})[_0x0bd5('0x27')](handleEntityNotFound(_0x11fad4,null))[_0x0bd5('0x27')](removeEntity(_0x11fad4,null))[_0x0bd5('0x4d')](handleError(_0x11fad4,null));};
\ No newline at end of file
+var _0x0e84=['offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','options','AnalyticTreeReport','includeAll','include','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x2dca3e,_0x4bf28c){var _0x3f1878=function(_0x798aab){while(--_0x798aab){_0x2dca3e['push'](_0x2dca3e['shift']());}};_0x3f1878(++_0x4bf28c);}(_0x0e84,0xb6));var _0x40e8=function(_0x1c7639,_0x2280c6){_0x1c7639=_0x1c7639-0x0;var _0x3229aa=_0x0e84[_0x1c7639];return _0x3229aa;};'use strict';var emlformat=require(_0x40e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40e8('0x1'));var jsonpatch=require(_0x40e8('0x2'));var rp=require(_0x40e8('0x3'));var moment=require(_0x40e8('0x4'));var BPromise=require(_0x40e8('0x5'));var Mustache=require('mustache');var util=require(_0x40e8('0x6'));var path=require(_0x40e8('0x7'));var sox=require(_0x40e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40e8('0x9'));var _=require(_0x40e8('0xa'));var squel=require(_0x40e8('0xb'));var crypto=require(_0x40e8('0xc'));var jsforce=require(_0x40e8('0xd'));var deskjs=require(_0x40e8('0xe'));var toCsv=require(_0x40e8('0xf'));var querystring=require(_0x40e8('0x10'));var Papa=require(_0x40e8('0x11'));var Redis=require(_0x40e8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x40e8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x40e8('0x14'))(_0x40e8('0x15'));var utils=require(_0x40e8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x40e8('0x17'))['db'];function respondWithStatusCode(_0x1bcf80,_0x1e9d20){_0x1e9d20=_0x1e9d20||0xcc;return function(_0x294737){if(_0x294737){return _0x1bcf80[_0x40e8('0x18')](_0x1e9d20);}return _0x1bcf80[_0x40e8('0x19')](_0x1e9d20)[_0x40e8('0x1a')]();};}function respondWithResult(_0x2a0cf5,_0x49d193){_0x49d193=_0x49d193||0xc8;return function(_0x48b53a){if(_0x48b53a){return _0x2a0cf5['status'](_0x49d193)[_0x40e8('0x1b')](_0x48b53a);}};}function respondWithFilteredResult(_0x543f8f,_0x1fae1d){return function(_0x55104d){if(_0x55104d){var _0x8af40b=typeof _0x1fae1d['offset']===_0x40e8('0x1c')&&typeof _0x1fae1d[_0x40e8('0x1d')]===_0x40e8('0x1c');var _0x25a3dc=_0x55104d[_0x40e8('0x1e')];var _0x5a04df=_0x8af40b?0x0:_0x1fae1d[_0x40e8('0x1f')];var _0x1c264c=_0x8af40b?_0x55104d['count']:_0x1fae1d[_0x40e8('0x1f')]+_0x1fae1d['limit'];var _0x1fbb10;if(_0x1c264c>=_0x25a3dc){_0x1c264c=_0x25a3dc;_0x1fbb10=0xc8;}else{_0x1fbb10=0xce;}_0x543f8f[_0x40e8('0x19')](_0x1fbb10);return _0x543f8f[_0x40e8('0x20')](_0x40e8('0x21'),_0x5a04df+'-'+_0x1c264c+'/'+_0x25a3dc)[_0x40e8('0x1b')](_0x55104d);}return null;};}function patchUpdates(_0x4ce9f7){return function(_0x404a2c){try{jsonpatch['apply'](_0x404a2c,_0x4ce9f7,!![]);}catch(_0x411e94){return BPromise['reject'](_0x411e94);}return _0x404a2c['save']();};}function saveUpdates(_0x524333,_0x14e91b){return function(_0x5532e9){if(_0x5532e9){return _0x5532e9[_0x40e8('0x22')](_0x524333)[_0x40e8('0x23')](function(_0x124845){return _0x124845;});}return null;};}function removeEntity(_0x10eabc,_0x526106){return function(_0x4bec02){if(_0x4bec02){return _0x4bec02[_0x40e8('0x24')]()[_0x40e8('0x23')](function(){_0x10eabc['status'](0xcc)[_0x40e8('0x1a')]();});}};}function handleEntityNotFound(_0x1f672d,_0xb4b807){return function(_0x13126e){if(!_0x13126e){_0x1f672d[_0x40e8('0x18')](0x194);}return _0x13126e;};}function handleError(_0x25c9dd,_0x10eda7){_0x10eda7=_0x10eda7||0x1f4;return function(_0x120958){logger[_0x40e8('0x25')](_0x120958[_0x40e8('0x26')]);if(_0x120958[_0x40e8('0x27')]){delete _0x120958[_0x40e8('0x27')];}_0x25c9dd[_0x40e8('0x19')](_0x10eda7)[_0x40e8('0x28')](_0x120958);};}exports[_0x40e8('0x29')]=function(_0x5d248d,_0x3cdb61){var _0x10bed3={},_0x27ad15={},_0x12f994={'count':0x0,'rows':[]};var _0x45d926=_[_0x40e8('0x2a')](db['AnalyticTreeReport'][_0x40e8('0x2b')],function(_0x34b22a){return{'name':_0x34b22a[_0x40e8('0x2c')],'type':_0x34b22a['type'][_0x40e8('0x2d')]};});_0x27ad15[_0x40e8('0x2e')]=_['map'](_0x45d926,_0x40e8('0x27'));_0x27ad15[_0x40e8('0x2f')]=_['keys'](_0x5d248d[_0x40e8('0x2f')]);_0x27ad15[_0x40e8('0x30')]=_[_0x40e8('0x31')](_0x27ad15[_0x40e8('0x2e')],_0x27ad15[_0x40e8('0x2f')]);_0x10bed3['attributes']=_['intersection'](_0x27ad15[_0x40e8('0x2e')],qs[_0x40e8('0x32')](_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x32')]));_0x10bed3[_0x40e8('0x33')]=_0x10bed3['attributes'][_0x40e8('0x34')]?_0x10bed3[_0x40e8('0x33')]:_0x27ad15[_0x40e8('0x2e')];if(!_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x35')](_0x40e8('0x36'))){_0x10bed3[_0x40e8('0x1d')]=qs[_0x40e8('0x1d')](_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x1d')]);_0x10bed3['offset']=qs[_0x40e8('0x1f')](_0x5d248d[_0x40e8('0x2f')][_0x40e8('0x1f')]);}_0x10bed3[_0x40e8('0x37')]=qs['sort'](_0x5d248d['query']['sort']);_0x10bed3[_0x40e8('0x38')]=qs['filters'](_['pick'](_0x5d248d[_0x40e8('0x2f')],_0x27ad15[_0x40e8('0x30')]),_0x45d926);if(_0x5d248d['query'][_0x40e8('0x39')]){_0x10bed3[_0x40e8('0x38')]=_[_0x40e8('0x3a')](_0x10bed3['where'],{'$or':_[_0x40e8('0x2a')](_0x45d926,function(_0x43e2f9){if(_0x43e2f9[_0x40e8('0x3b')]!=='VIRTUAL'){var _0x15fea2={};_0x15fea2[_0x43e2f9[_0x40e8('0x27')]]={'$like':'%'+_0x5d248d['query'][_0x40e8('0x39')]+'%'};return _0x15fea2;}})});}_0x10bed3=_['merge']({},_0x10bed3,_0x5d248d[_0x40e8('0x3c')]);var _0x517a98={'where':_0x10bed3['where']};return db[_0x40e8('0x3d')]['count'](_0x517a98)[_0x40e8('0x23')](function(_0x2494bb){_0x12f994[_0x40e8('0x1e')]=_0x2494bb;if(_0x5d248d['query'][_0x40e8('0x3e')]){_0x10bed3[_0x40e8('0x3f')]=[{'all':!![]}];}return db[_0x40e8('0x3d')]['findAll'](_0x10bed3);})[_0x40e8('0x23')](function(_0x4a78e8){_0x12f994[_0x40e8('0x40')]=_0x4a78e8;return _0x12f994;})[_0x40e8('0x23')](respondWithFilteredResult(_0x3cdb61,_0x10bed3))[_0x40e8('0x41')](handleError(_0x3cdb61,null));};exports[_0x40e8('0x42')]=function(_0x144165,_0x2b0fb2){var _0x49abd4={'raw':!![],'where':{'id':_0x144165[_0x40e8('0x43')]['id']}},_0x67f8cc={};_0x67f8cc[_0x40e8('0x2e')]=_['keys'](db[_0x40e8('0x3d')]['rawAttributes']);_0x67f8cc[_0x40e8('0x2f')]=_['keys'](_0x144165[_0x40e8('0x2f')]);_0x67f8cc['filters']=_[_0x40e8('0x31')](_0x67f8cc[_0x40e8('0x2e')],_0x67f8cc[_0x40e8('0x2f')]);_0x49abd4['attributes']=_[_0x40e8('0x31')](_0x67f8cc[_0x40e8('0x2e')],qs[_0x40e8('0x32')](_0x144165['query']['fields']));_0x49abd4[_0x40e8('0x33')]=_0x49abd4[_0x40e8('0x33')]['length']?_0x49abd4['attributes']:_0x67f8cc[_0x40e8('0x2e')];if(_0x144165[_0x40e8('0x2f')][_0x40e8('0x3e')]){_0x49abd4[_0x40e8('0x3f')]=[{'all':!![]}];}_0x49abd4=_[_0x40e8('0x3a')]({},_0x49abd4,_0x144165[_0x40e8('0x3c')]);return db[_0x40e8('0x3d')]['find'](_0x49abd4)['then'](handleEntityNotFound(_0x2b0fb2,null))['then'](respondWithResult(_0x2b0fb2,null))[_0x40e8('0x41')](handleError(_0x2b0fb2,null));};exports[_0x40e8('0x44')]=function(_0x39dc3d,_0x1e95f5){return db[_0x40e8('0x3d')][_0x40e8('0x44')](_0x39dc3d[_0x40e8('0x45')],{})[_0x40e8('0x23')](respondWithResult(_0x1e95f5,0xc9))[_0x40e8('0x41')](handleError(_0x1e95f5,null));};exports['update']=function(_0x3a6bcb,_0x4f23b8){if(_0x3a6bcb[_0x40e8('0x45')]['id']){delete _0x3a6bcb[_0x40e8('0x45')]['id'];}return db[_0x40e8('0x3d')]['find']({'where':{'id':_0x3a6bcb['params']['id']}})[_0x40e8('0x23')](handleEntityNotFound(_0x4f23b8,null))[_0x40e8('0x23')](saveUpdates(_0x3a6bcb[_0x40e8('0x45')],null))[_0x40e8('0x23')](respondWithResult(_0x4f23b8,null))['catch'](handleError(_0x4f23b8,null));};exports[_0x40e8('0x24')]=function(_0x1c1faa,_0x53c800){return db['AnalyticTreeReport'][_0x40e8('0x46')]({'where':{'id':_0x1c1faa[_0x40e8('0x43')]['id']}})[_0x40e8('0x23')](handleEntityNotFound(_0x53c800,null))['then'](removeEntity(_0x53c800,null))[_0x40e8('0x41')](handleError(_0x53c800,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index f2fde64..fe868af 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 _0x32bd=['../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x32bd,0x142));var _0xd32b=function(_0x46e793,_0x1dc52d){_0x46e793=_0x46e793-0x0;var _0x25cb99=_0x32bd[_0x46e793];return _0x25cb99;};'use strict';var _=require(_0xd32b('0x0'));var util=require('util');var logger=require(_0xd32b('0x1'))(_0xd32b('0x2'));var moment=require(_0xd32b('0x3'));var BPromise=require(_0xd32b('0x4'));var rp=require(_0xd32b('0x5'));var fs=require('fs');var path=require(_0xd32b('0x6'));var rimraf=require(_0xd32b('0x7'));var config=require(_0xd32b('0x8'));var attributes=require(_0xd32b('0x9'));module['exports']=function(_0x5b0184,_0x213413){return _0x5b0184['define'](_0xd32b('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8d8=['api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util'];(function(_0x2859bb,_0x3dd473){var _0x477110=function(_0xe4e169){while(--_0xe4e169){_0x2859bb['push'](_0x2859bb['shift']());}};_0x477110(++_0x3dd473);}(_0xd8d8,0xdb));var _0x8d8d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd8d8[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x8d8d('0x0'));var logger=require('../../config/logger')(_0x8d8d('0x1'));var moment=require('moment');var BPromise=require(_0x8d8d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d8d('0x3'));var rimraf=require(_0x8d8d('0x4'));var config=require(_0x8d8d('0x5'));var attributes=require(_0x8d8d('0x6'));module[_0x8d8d('0x7')]=function(_0x52c823,_0x23d8d4){return _0x52c823[_0x8d8d('0x8')](_0x8d8d('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 5a4efba..040b6ee 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x336f04,_0x270d81){var _0x5e6335=function(_0x49fc5d){while(--_0x49fc5d){_0x336f04['push'](_0x336f04['shift']());}};_0x5e6335(++_0x270d81);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4247e5,_0x30b7bb){var _0x5ee3d5=function(_0x5056cd){while(--_0x5056cd){_0x4247e5['push'](_0x4247e5['shift']());}};_0x5ee3d5(++_0x30b7bb);}(_0xadb5,0xad));var _0x5adb=function(_0x5e1029,_0xc7cc71){_0x5e1029=_0x5e1029-0x0;var _0xb06136=_0xadb5[_0x5e1029];return _0xb06136;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 64532ed..2ee1ada 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 _0x816f=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x816f,0x1e5));var _0xf816=function(_0x496b7a,_0x55d817){_0x496b7a=_0x496b7a-0x0;var _0x33e87a=_0x816f[_0x496b7a];return _0x33e87a;};'use strict';var multer=require(_0xf816('0x0'));var util=require(_0xf816('0x1'));var path=require(_0xf816('0x2'));var timeout=require(_0xf816('0x3'));var express=require('express');var router=express[_0xf816('0x4')]();var fs_extra=require(_0xf816('0x5'));var auth=require(_0xf816('0x6'));var interaction=require(_0xf816('0x7'));var config=require('../../config/environment');var controller=require(_0xf816('0x8'));router[_0xf816('0x9')]('/',auth[_0xf816('0xa')](),controller[_0xf816('0xb')]);router['get'](_0xf816('0xc'),auth[_0xf816('0xa')](),controller[_0xf816('0xd')]);router[_0xf816('0xe')]('/',auth['isAuthenticated'](),controller[_0xf816('0xf')]);router[_0xf816('0x10')](_0xf816('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf816('0x11')]('/:id',auth[_0xf816('0xa')](),controller[_0xf816('0x12')]);module[_0xf816('0x13')]=router;
\ No newline at end of file
+var _0xb64f=['isAuthenticated','index','show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3cfc96,_0x4a9b0b){var _0x3b5b7c=function(_0x54e966){while(--_0x54e966){_0x3cfc96['push'](_0x3cfc96['shift']());}};_0x3b5b7c(++_0x4a9b0b);}(_0xb64f,0x1a6));var _0xfb64=function(_0x2077be,_0x26136a){_0x2077be=_0x2077be-0x0;var _0x198bbf=_0xb64f[_0x2077be];return _0x198bbf;};'use strict';var multer=require('multer');var util=require(_0xfb64('0x0'));var path=require(_0xfb64('0x1'));var timeout=require(_0xfb64('0x2'));var express=require(_0xfb64('0x3'));var router=express[_0xfb64('0x4')]();var fs_extra=require(_0xfb64('0x5'));var auth=require(_0xfb64('0x6'));var interaction=require(_0xfb64('0x7'));var config=require(_0xfb64('0x8'));var controller=require('./analyticTreeReport.controller');router[_0xfb64('0x9')]('/',auth[_0xfb64('0xa')](),controller[_0xfb64('0xb')]);router[_0xfb64('0x9')]('/:id',auth[_0xfb64('0xa')](),controller[_0xfb64('0xc')]);router['post']('/',auth[_0xfb64('0xa')](),controller[_0xfb64('0xd')]);router[_0xfb64('0xe')](_0xfb64('0xf'),auth[_0xfb64('0xa')](),controller[_0xfb64('0x10')]);router[_0xfb64('0x11')](_0xfb64('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 6fddffe..84ba3e6 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 _0xf9bc=['exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x351274,_0xa3dc98){_0x351274=_0x351274-0x0;var _0x2c388a=_0xf9bc[_0x351274];return _0x2c388a;};'use strict';var Sequelize=require('sequelize');module[_0xcf9b('0x0')]={'name':{'type':Sequelize[_0xcf9b('0x1')]},'basename':{'type':Sequelize[_0xcf9b('0x1')]},'type':{'type':Sequelize[_0xcf9b('0x1')]}};
\ No newline at end of file
+var _0xbed7=['STRING','sequelize','exports'];(function(_0x312cdb,_0x181ba2){var _0x2e1e2e=function(_0x1e8115){while(--_0x1e8115){_0x312cdb['push'](_0x312cdb['shift']());}};_0x2e1e2e(++_0x181ba2);}(_0xbed7,0x14b));var _0x7bed=function(_0x5e096c,_0x2ebcb9){_0x5e096c=_0x5e096c-0x0;var _0x78ab6c=_0xbed7[_0x5e096c];return _0x78ab6c;};'use strict';var Sequelize=require(_0x7bed('0x0'));module[_0x7bed('0x1')]={'name':{'type':Sequelize[_0x7bed('0x2')]},'basename':{'type':Sequelize[_0x7bed('0x2')]},'type':{'type':Sequelize[_0x7bed('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 2ca96a9..1c1ec97 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 _0xd519=['create','download','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Attachment','rawAttributes','keys','clone','find','get','omit','createdAt','updatedAt','body','file','originalname','basename','filename','mimetype'];(function(_0x2430f7,_0x4842db){var _0x37dc5f=function(_0x55bf7c){while(--_0x55bf7c){_0x2430f7['push'](_0x2430f7['shift']());}};_0x37dc5f(++_0x4842db);}(_0xd519,0x1c7));var _0x9d51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd519[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9d51('0x0'));var rimraf=require(_0x9d51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d51('0x2'));var rp=require(_0x9d51('0x3'));var moment=require(_0x9d51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9d51('0x5'));var util=require(_0x9d51('0x6'));var path=require('path');var sox=require(_0x9d51('0x7'));var csv=require(_0x9d51('0x8'));var ejs=require(_0x9d51('0x9'));var fs=require('fs');var fs_extra=require(_0x9d51('0xa'));var _=require(_0x9d51('0xb'));var squel=require(_0x9d51('0xc'));var crypto=require(_0x9d51('0xd'));var jsforce=require(_0x9d51('0xe'));var deskjs=require(_0x9d51('0xf'));var toCsv=require(_0x9d51('0x8'));var querystring=require(_0x9d51('0x10'));var Papa=require(_0x9d51('0x11'));var Redis=require('ioredis');var authService=require(_0x9d51('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9d51('0x13'));var hardwareService=require(_0x9d51('0x14'));var logger=require('../../config/logger')(_0x9d51('0x15'));var utils=require(_0x9d51('0x16'));var config=require(_0x9d51('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d51('0x18'))['db'];function respondWithStatusCode(_0x456a18,_0x3fedef){_0x3fedef=_0x3fedef||0xcc;return function(_0x58b62b){if(_0x58b62b){return _0x456a18[_0x9d51('0x19')](_0x3fedef);}return _0x456a18['status'](_0x3fedef)['end']();};}function respondWithResult(_0x41ca02,_0x270cd2){_0x270cd2=_0x270cd2||0xc8;return function(_0x4d9a73){if(_0x4d9a73){return _0x41ca02[_0x9d51('0x1a')](_0x270cd2)[_0x9d51('0x1b')](_0x4d9a73);}};}function respondWithFilteredResult(_0xa39c6b,_0x488a2e){return function(_0x292677){if(_0x292677){var _0x224516=typeof _0x488a2e['offset']===_0x9d51('0x1c')&&typeof _0x488a2e[_0x9d51('0x1d')]==='undefined';var _0x33afa2=_0x292677[_0x9d51('0x1e')];var _0x24cc13=_0x224516?0x0:_0x488a2e[_0x9d51('0x1f')];var _0x5c1f79=_0x224516?_0x292677[_0x9d51('0x1e')]:_0x488a2e[_0x9d51('0x1f')]+_0x488a2e[_0x9d51('0x1d')];var _0x17e463;if(_0x5c1f79>=_0x33afa2){_0x5c1f79=_0x33afa2;_0x17e463=0xc8;}else{_0x17e463=0xce;}_0xa39c6b['status'](_0x17e463);return _0xa39c6b[_0x9d51('0x20')](_0x9d51('0x21'),_0x24cc13+'-'+_0x5c1f79+'/'+_0x33afa2)[_0x9d51('0x1b')](_0x292677);}return null;};}function patchUpdates(_0xcd2a12){return function(_0x5eb62b){try{jsonpatch[_0x9d51('0x22')](_0x5eb62b,_0xcd2a12,!![]);}catch(_0x177502){return BPromise['reject'](_0x177502);}return _0x5eb62b[_0x9d51('0x23')]();};}function saveUpdates(_0x334fc4,_0x1335e4){return function(_0x7ea2ae){if(_0x7ea2ae){return _0x7ea2ae[_0x9d51('0x24')](_0x334fc4)[_0x9d51('0x25')](function(_0x49891e){return _0x49891e;});}return null;};}function removeEntity(_0x2b09dd,_0x533448){return function(_0x527fd0){if(_0x527fd0){return _0x527fd0[_0x9d51('0x26')]()[_0x9d51('0x25')](function(){_0x2b09dd[_0x9d51('0x1a')](0xcc)[_0x9d51('0x27')]();});}};}function handleEntityNotFound(_0x9b2f26,_0x2869ce){return function(_0x365025){if(!_0x365025){_0x9b2f26['sendStatus'](0x194);}return _0x365025;};}function handleError(_0x5a273e,_0x7a8a06){_0x7a8a06=_0x7a8a06||0x1f4;return function(_0x1c275f){logger[_0x9d51('0x28')](_0x1c275f[_0x9d51('0x29')]);if(_0x1c275f[_0x9d51('0x2a')]){delete _0x1c275f[_0x9d51('0x2a')];}_0x5a273e[_0x9d51('0x1a')](_0x7a8a06)[_0x9d51('0x2b')](_0x1c275f);};}exports['index']=function(_0x1414b5,_0x5885f8){var _0x1b08c1={},_0x55c015={},_0x348a8f={'count':0x0,'rows':[]};var _0x5eb8ec=_[_0x9d51('0x2c')](db['Attachment']['rawAttributes'],function(_0x44d686){return{'name':_0x44d686[_0x9d51('0x2d')],'type':_0x44d686[_0x9d51('0x2e')]['key']};});_0x55c015[_0x9d51('0x2f')]=_[_0x9d51('0x2c')](_0x5eb8ec,'name');_0x55c015[_0x9d51('0x30')]=_['keys'](_0x1414b5[_0x9d51('0x30')]);_0x55c015['filters']=_[_0x9d51('0x31')](_0x55c015[_0x9d51('0x2f')],_0x55c015[_0x9d51('0x30')]);_0x1b08c1['attributes']=_[_0x9d51('0x31')](_0x55c015[_0x9d51('0x2f')],qs['fields'](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x32')]));_0x1b08c1[_0x9d51('0x33')]=_0x1b08c1['attributes']['length']?_0x1b08c1['attributes']:_0x55c015[_0x9d51('0x2f')];if(!_0x1414b5[_0x9d51('0x30')][_0x9d51('0x34')](_0x9d51('0x35'))){_0x1b08c1[_0x9d51('0x1d')]=qs['limit'](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x1d')]);_0x1b08c1[_0x9d51('0x1f')]=qs[_0x9d51('0x1f')](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x1f')]);}_0x1b08c1[_0x9d51('0x36')]=qs[_0x9d51('0x37')](_0x1414b5[_0x9d51('0x30')][_0x9d51('0x37')]);_0x1b08c1[_0x9d51('0x38')]=qs[_0x9d51('0x39')](_[_0x9d51('0x3a')](_0x1414b5[_0x9d51('0x30')],_0x55c015[_0x9d51('0x39')]),_0x5eb8ec);if(_0x1414b5['query'][_0x9d51('0x3b')]){_0x1b08c1[_0x9d51('0x38')]=_[_0x9d51('0x3c')](_0x1b08c1[_0x9d51('0x38')],{'$or':_['map'](_0x5eb8ec,function(_0x19b53d){if(_0x19b53d[_0x9d51('0x2e')]!==_0x9d51('0x3d')){var _0x1bf853={};_0x1bf853[_0x19b53d[_0x9d51('0x2a')]]={'$like':'%'+_0x1414b5['query'][_0x9d51('0x3b')]+'%'};return _0x1bf853;}})});}_0x1b08c1=_[_0x9d51('0x3c')]({},_0x1b08c1,_0x1414b5[_0x9d51('0x3e')]);var _0x44aa24={'where':_0x1b08c1[_0x9d51('0x38')]};return db['Attachment'][_0x9d51('0x1e')](_0x44aa24)[_0x9d51('0x25')](function(_0x3c2104){_0x348a8f[_0x9d51('0x1e')]=_0x3c2104;if(_0x1414b5['query'][_0x9d51('0x3f')]){_0x1b08c1[_0x9d51('0x40')]=[{'all':!![]}];}return db['Attachment'][_0x9d51('0x41')](_0x1b08c1);})[_0x9d51('0x25')](function(_0x276daf){_0x348a8f[_0x9d51('0x42')]=_0x276daf;return _0x348a8f;})['then'](respondWithFilteredResult(_0x5885f8,_0x1b08c1))[_0x9d51('0x43')](handleError(_0x5885f8,null));};exports[_0x9d51('0x44')]=function(_0x171214,_0xe2204){var _0x1d6d6b={'raw':!![],'where':{'id':_0x171214[_0x9d51('0x45')]['id']}},_0x3225de={};_0x3225de[_0x9d51('0x2f')]=_['keys'](db[_0x9d51('0x46')][_0x9d51('0x47')]);_0x3225de['query']=_[_0x9d51('0x48')](_0x171214[_0x9d51('0x30')]);_0x3225de[_0x9d51('0x39')]=_[_0x9d51('0x31')](_0x3225de[_0x9d51('0x2f')],_0x3225de[_0x9d51('0x30')]);_0x1d6d6b[_0x9d51('0x33')]=_[_0x9d51('0x31')](_0x3225de['model'],qs[_0x9d51('0x32')](_0x171214[_0x9d51('0x30')][_0x9d51('0x32')]));_0x1d6d6b[_0x9d51('0x33')]=_0x1d6d6b[_0x9d51('0x33')]['length']?_0x1d6d6b['attributes']:_0x3225de[_0x9d51('0x2f')];if(_0x171214[_0x9d51('0x30')][_0x9d51('0x3f')]){_0x1d6d6b[_0x9d51('0x40')]=[{'all':!![]}];}_0x1d6d6b=_[_0x9d51('0x3c')]({},_0x1d6d6b,_0x171214['options']);return db[_0x9d51('0x46')]['find'](_0x1d6d6b)['then'](handleEntityNotFound(_0xe2204,null))[_0x9d51('0x25')](respondWithResult(_0xe2204,null))[_0x9d51('0x43')](handleError(_0xe2204,null));};exports[_0x9d51('0x49')]=function(_0x441e17,_0x21c811){var _0x19c5b2={'where':{'id':_0x441e17[_0x9d51('0x45')]['id']}},_0x55f9fe={};_0x55f9fe['model']=_['keys'](db['Attachment'][_0x9d51('0x47')]);_0x19c5b2[_0x9d51('0x33')]=_[_0x9d51('0x31')](_0x55f9fe[_0x9d51('0x2f')],qs[_0x9d51('0x32')](_0x441e17[_0x9d51('0x30')][_0x9d51('0x32')]));_0x19c5b2['attributes']=_0x19c5b2[_0x9d51('0x33')]['length']?_0x19c5b2[_0x9d51('0x33')]:_0x55f9fe[_0x9d51('0x2f')];if(_0x441e17[_0x9d51('0x30')][_0x9d51('0x3f')]){_0x19c5b2[_0x9d51('0x40')]=[{'all':!![]}];}_0x19c5b2=_[_0x9d51('0x3c')]({},_0x19c5b2,_0x441e17[_0x9d51('0x3e')]);return db[_0x9d51('0x46')][_0x9d51('0x4a')](_0x19c5b2)['then'](handleEntityNotFound(_0x21c811,null))['then'](function(_0x399854){if(_0x399854){var _0x1d709f=_0x399854[_0x9d51('0x4b')]({'plain':!![]});_0x1d709f=qs[_0x9d51('0x4c')](_0x1d709f,['id',_0x9d51('0x4d'),_0x9d51('0x4e')]);_0x441e17['body']=_['omit'](_0x441e17['body'],['id',_0x9d51('0x4d'),_0x9d51('0x4e')]);return db[_0x9d51('0x46')]['create'](_[_0x9d51('0x3c')](_0x1d709f,_0x441e17[_0x9d51('0x4f')]),{'include':_0x441e17[_0x9d51('0x30')][_0x9d51('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x21c811,0xc9))[_0x9d51('0x43')](handleError(_0x21c811,null));};exports[_0x9d51('0x24')]=function(_0x196370,_0x10218f){if(_0x196370[_0x9d51('0x4f')]['id']){delete _0x196370[_0x9d51('0x4f')]['id'];}return db[_0x9d51('0x46')][_0x9d51('0x4a')]({'where':{'id':_0x196370[_0x9d51('0x45')]['id']}})[_0x9d51('0x25')](handleEntityNotFound(_0x10218f,null))[_0x9d51('0x25')](saveUpdates(_0x196370[_0x9d51('0x4f')],null))[_0x9d51('0x25')](respondWithResult(_0x10218f,null))[_0x9d51('0x43')](handleError(_0x10218f,null));};exports['destroy']=function(_0xa4c749,_0x3f3621){return db[_0x9d51('0x46')][_0x9d51('0x4a')]({'where':{'id':_0xa4c749[_0x9d51('0x45')]['id']}})[_0x9d51('0x25')](handleEntityNotFound(_0x3f3621,null))[_0x9d51('0x25')](removeEntity(_0x3f3621,null))[_0x9d51('0x43')](handleError(_0x3f3621,null));};exports['create']=function(_0x48c30d,_0x364d46,_0x5b95eb){_0x48c30d[_0x9d51('0x4f')][_0x9d51('0x2a')]=_0x48c30d[_0x9d51('0x50')][_0x9d51('0x51')];_0x48c30d[_0x9d51('0x4f')][_0x9d51('0x52')]=_0x48c30d[_0x9d51('0x50')][_0x9d51('0x53')];_0x48c30d[_0x9d51('0x4f')]['type']=_0x48c30d[_0x9d51('0x50')][_0x9d51('0x54')];return db[_0x9d51('0x46')][_0x9d51('0x55')](_0x48c30d[_0x9d51('0x4f')])[_0x9d51('0x25')](respondWithResult(_0x364d46,0xc9))[_0x9d51('0x43')](handleError(_0x364d46,null));};exports[_0x9d51('0x56')]=function(_0x3ba379,_0x5615af,_0x53450a){return db[_0x9d51('0x46')]['findOne']({'where':{'id':_0x3ba379[_0x9d51('0x45')]['id']},'raw':!![]})[_0x9d51('0x25')](handleEntityNotFound(_0x5615af,null))[_0x9d51('0x25')](function(_0x3e2336){if(_0x3e2336){var _0x46d017=_0x3e2336['ChatOfflineMessageId']!==null;var _0x3cb073=path[_0x9d51('0x57')](config[_0x9d51('0x58')],'server/files/attachments/');if(_0x46d017){_0x3cb073=path[_0x9d51('0x57')](_0x3cb073,_0x9d51('0x59'));}var _0x513b86=path[_0x9d51('0x57')](_0x3cb073,_0x3e2336[_0x9d51('0x52')]);return _0x5615af[_0x9d51('0x56')](_0x513b86);}})['catch'](handleError(_0x5615af,null));};
\ No newline at end of file
+var _0xdd36=['map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../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','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xdd36,0xe7));var _0x6dd3=function(_0x389b1a,_0x155431){_0x389b1a=_0x389b1a-0x0;var _0x1e035a=_0xdd36[_0x389b1a];return _0x1e035a;};'use strict';var emlformat=require(_0x6dd3('0x0'));var rimraf=require(_0x6dd3('0x1'));var zipdir=require(_0x6dd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dd3('0x3'));var moment=require(_0x6dd3('0x4'));var BPromise=require(_0x6dd3('0x5'));var Mustache=require(_0x6dd3('0x6'));var util=require(_0x6dd3('0x7'));var path=require(_0x6dd3('0x8'));var sox=require(_0x6dd3('0x9'));var csv=require(_0x6dd3('0xa'));var ejs=require(_0x6dd3('0xb'));var fs=require('fs');var fs_extra=require(_0x6dd3('0xc'));var _=require(_0x6dd3('0xd'));var squel=require(_0x6dd3('0xe'));var crypto=require('crypto');var jsforce=require(_0x6dd3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6dd3('0xa'));var querystring=require(_0x6dd3('0x10'));var Papa=require(_0x6dd3('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6dd3('0x12'));var as=require(_0x6dd3('0x13'));var hardwareService=require(_0x6dd3('0x14'));var logger=require(_0x6dd3('0x15'))(_0x6dd3('0x16'));var utils=require(_0x6dd3('0x17'));var config=require(_0x6dd3('0x18'));var licenseUtil=require(_0x6dd3('0x19'));var db=require(_0x6dd3('0x1a'))['db'];function respondWithStatusCode(_0x13ca0b,_0x54e006){_0x54e006=_0x54e006||0xcc;return function(_0x38bf61){if(_0x38bf61){return _0x13ca0b[_0x6dd3('0x1b')](_0x54e006);}return _0x13ca0b[_0x6dd3('0x1c')](_0x54e006)[_0x6dd3('0x1d')]();};}function respondWithResult(_0x5811d9,_0x59d946){_0x59d946=_0x59d946||0xc8;return function(_0x52d904){if(_0x52d904){return _0x5811d9[_0x6dd3('0x1c')](_0x59d946)[_0x6dd3('0x1e')](_0x52d904);}};}function respondWithFilteredResult(_0x1a187d,_0x42a91a){return function(_0x57a7b7){if(_0x57a7b7){var _0x2f0add=typeof _0x42a91a[_0x6dd3('0x1f')]==='undefined'&&typeof _0x42a91a[_0x6dd3('0x20')]===_0x6dd3('0x21');var _0x55be36=_0x57a7b7[_0x6dd3('0x22')];var _0x398450=_0x2f0add?0x0:_0x42a91a[_0x6dd3('0x1f')];var _0x2d1646=_0x2f0add?_0x57a7b7[_0x6dd3('0x22')]:_0x42a91a['offset']+_0x42a91a[_0x6dd3('0x20')];var _0x128fc5;if(_0x2d1646>=_0x55be36){_0x2d1646=_0x55be36;_0x128fc5=0xc8;}else{_0x128fc5=0xce;}_0x1a187d[_0x6dd3('0x1c')](_0x128fc5);return _0x1a187d[_0x6dd3('0x23')](_0x6dd3('0x24'),_0x398450+'-'+_0x2d1646+'/'+_0x55be36)[_0x6dd3('0x1e')](_0x57a7b7);}return null;};}function patchUpdates(_0x3b0772){return function(_0x9808a0){try{jsonpatch[_0x6dd3('0x25')](_0x9808a0,_0x3b0772,!![]);}catch(_0x184588){return BPromise[_0x6dd3('0x26')](_0x184588);}return _0x9808a0[_0x6dd3('0x27')]();};}function saveUpdates(_0x1962ee,_0x28d67d){return function(_0x54b21d){if(_0x54b21d){return _0x54b21d[_0x6dd3('0x28')](_0x1962ee)['then'](function(_0x1c6b96){return _0x1c6b96;});}return null;};}function removeEntity(_0x1d6282,_0x4fe6b3){return function(_0x5b54c6){if(_0x5b54c6){return _0x5b54c6[_0x6dd3('0x29')]()[_0x6dd3('0x2a')](function(){_0x1d6282[_0x6dd3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d2ed,_0x381066){return function(_0x35fd9b){if(!_0x35fd9b){_0x21d2ed[_0x6dd3('0x1b')](0x194);}return _0x35fd9b;};}function handleError(_0x2c2649,_0x3a0717){_0x3a0717=_0x3a0717||0x1f4;return function(_0x199b8a){logger[_0x6dd3('0x2b')](_0x199b8a[_0x6dd3('0x2c')]);if(_0x199b8a[_0x6dd3('0x2d')]){delete _0x199b8a['name'];}_0x2c2649[_0x6dd3('0x1c')](_0x3a0717)[_0x6dd3('0x2e')](_0x199b8a);};}exports[_0x6dd3('0x2f')]=function(_0x271418,_0x498510){var _0x11e703={},_0x1089f0={},_0xe25d87={'count':0x0,'rows':[]};var _0xedc8c4=_[_0x6dd3('0x30')](db[_0x6dd3('0x31')][_0x6dd3('0x32')],function(_0x55841d){return{'name':_0x55841d[_0x6dd3('0x33')],'type':_0x55841d[_0x6dd3('0x34')][_0x6dd3('0x35')]};});_0x1089f0[_0x6dd3('0x36')]=_[_0x6dd3('0x30')](_0xedc8c4,_0x6dd3('0x2d'));_0x1089f0[_0x6dd3('0x37')]=_[_0x6dd3('0x38')](_0x271418[_0x6dd3('0x37')]);_0x1089f0['filters']=_[_0x6dd3('0x39')](_0x1089f0[_0x6dd3('0x36')],_0x1089f0[_0x6dd3('0x37')]);_0x11e703[_0x6dd3('0x3a')]=_[_0x6dd3('0x39')](_0x1089f0['model'],qs[_0x6dd3('0x3b')](_0x271418['query'][_0x6dd3('0x3b')]));_0x11e703['attributes']=_0x11e703[_0x6dd3('0x3a')][_0x6dd3('0x3c')]?_0x11e703['attributes']:_0x1089f0[_0x6dd3('0x36')];if(!_0x271418[_0x6dd3('0x37')]['hasOwnProperty']('nolimit')){_0x11e703[_0x6dd3('0x20')]=qs[_0x6dd3('0x20')](_0x271418[_0x6dd3('0x37')][_0x6dd3('0x20')]);_0x11e703[_0x6dd3('0x1f')]=qs['offset'](_0x271418[_0x6dd3('0x37')][_0x6dd3('0x1f')]);}_0x11e703[_0x6dd3('0x3d')]=qs[_0x6dd3('0x3e')](_0x271418[_0x6dd3('0x37')][_0x6dd3('0x3e')]);_0x11e703[_0x6dd3('0x3f')]=qs[_0x6dd3('0x40')](_[_0x6dd3('0x41')](_0x271418[_0x6dd3('0x37')],_0x1089f0[_0x6dd3('0x40')]),_0xedc8c4);if(_0x271418[_0x6dd3('0x37')][_0x6dd3('0x42')]){_0x11e703[_0x6dd3('0x3f')]=_[_0x6dd3('0x43')](_0x11e703[_0x6dd3('0x3f')],{'$or':_[_0x6dd3('0x30')](_0xedc8c4,function(_0x305a8){if(_0x305a8[_0x6dd3('0x34')]!==_0x6dd3('0x44')){var _0x2d47ce={};_0x2d47ce[_0x305a8[_0x6dd3('0x2d')]]={'$like':'%'+_0x271418[_0x6dd3('0x37')]['filter']+'%'};return _0x2d47ce;}})});}_0x11e703=_[_0x6dd3('0x43')]({},_0x11e703,_0x271418[_0x6dd3('0x45')]);var _0x5381cd={'where':_0x11e703[_0x6dd3('0x3f')]};return db[_0x6dd3('0x31')][_0x6dd3('0x22')](_0x5381cd)[_0x6dd3('0x2a')](function(_0x4f0f0f){_0xe25d87[_0x6dd3('0x22')]=_0x4f0f0f;if(_0x271418[_0x6dd3('0x37')][_0x6dd3('0x46')]){_0x11e703[_0x6dd3('0x47')]=[{'all':!![]}];}return db[_0x6dd3('0x31')][_0x6dd3('0x48')](_0x11e703);})[_0x6dd3('0x2a')](function(_0x4e7e51){_0xe25d87['rows']=_0x4e7e51;return _0xe25d87;})[_0x6dd3('0x2a')](respondWithFilteredResult(_0x498510,_0x11e703))[_0x6dd3('0x49')](handleError(_0x498510,null));};exports[_0x6dd3('0x4a')]=function(_0x56c3c6,_0x51cdc6){var _0x5b706f={'raw':!![],'where':{'id':_0x56c3c6[_0x6dd3('0x4b')]['id']}},_0x5abc81={};_0x5abc81[_0x6dd3('0x36')]=_[_0x6dd3('0x38')](db[_0x6dd3('0x31')][_0x6dd3('0x32')]);_0x5abc81[_0x6dd3('0x37')]=_[_0x6dd3('0x38')](_0x56c3c6[_0x6dd3('0x37')]);_0x5abc81['filters']=_[_0x6dd3('0x39')](_0x5abc81[_0x6dd3('0x36')],_0x5abc81[_0x6dd3('0x37')]);_0x5b706f[_0x6dd3('0x3a')]=_[_0x6dd3('0x39')](_0x5abc81[_0x6dd3('0x36')],qs[_0x6dd3('0x3b')](_0x56c3c6[_0x6dd3('0x37')][_0x6dd3('0x3b')]));_0x5b706f[_0x6dd3('0x3a')]=_0x5b706f[_0x6dd3('0x3a')][_0x6dd3('0x3c')]?_0x5b706f['attributes']:_0x5abc81[_0x6dd3('0x36')];if(_0x56c3c6[_0x6dd3('0x37')][_0x6dd3('0x46')]){_0x5b706f['include']=[{'all':!![]}];}_0x5b706f=_[_0x6dd3('0x43')]({},_0x5b706f,_0x56c3c6[_0x6dd3('0x45')]);return db[_0x6dd3('0x31')][_0x6dd3('0x4c')](_0x5b706f)[_0x6dd3('0x2a')](handleEntityNotFound(_0x51cdc6,null))[_0x6dd3('0x2a')](respondWithResult(_0x51cdc6,null))[_0x6dd3('0x49')](handleError(_0x51cdc6,null));};exports['clone']=function(_0x1b3842,_0x16281d){var _0x81d607={'where':{'id':_0x1b3842[_0x6dd3('0x4b')]['id']}},_0x467c28={};_0x467c28['model']=_[_0x6dd3('0x38')](db['Attachment'][_0x6dd3('0x32')]);_0x81d607[_0x6dd3('0x3a')]=_['intersection'](_0x467c28[_0x6dd3('0x36')],qs['fields'](_0x1b3842[_0x6dd3('0x37')]['fields']));_0x81d607[_0x6dd3('0x3a')]=_0x81d607['attributes'][_0x6dd3('0x3c')]?_0x81d607[_0x6dd3('0x3a')]:_0x467c28[_0x6dd3('0x36')];if(_0x1b3842[_0x6dd3('0x37')][_0x6dd3('0x46')]){_0x81d607[_0x6dd3('0x47')]=[{'all':!![]}];}_0x81d607=_[_0x6dd3('0x43')]({},_0x81d607,_0x1b3842[_0x6dd3('0x45')]);return db[_0x6dd3('0x31')][_0x6dd3('0x4c')](_0x81d607)[_0x6dd3('0x2a')](handleEntityNotFound(_0x16281d,null))[_0x6dd3('0x2a')](function(_0x40889c){if(_0x40889c){var _0x310e98=_0x40889c[_0x6dd3('0x4d')]({'plain':!![]});_0x310e98=qs[_0x6dd3('0x4e')](_0x310e98,['id',_0x6dd3('0x4f'),_0x6dd3('0x50')]);_0x1b3842[_0x6dd3('0x51')]=_[_0x6dd3('0x4e')](_0x1b3842['body'],['id',_0x6dd3('0x4f'),'updatedAt']);return db[_0x6dd3('0x31')][_0x6dd3('0x52')](_[_0x6dd3('0x43')](_0x310e98,_0x1b3842[_0x6dd3('0x51')]),{'include':_0x1b3842[_0x6dd3('0x37')][_0x6dd3('0x46')]?[{'all':!![]}]:undefined});}})[_0x6dd3('0x2a')](respondWithResult(_0x16281d,0xc9))['catch'](handleError(_0x16281d,null));};exports[_0x6dd3('0x28')]=function(_0x596bb4,_0x30713c){if(_0x596bb4[_0x6dd3('0x51')]['id']){delete _0x596bb4[_0x6dd3('0x51')]['id'];}return db[_0x6dd3('0x31')]['find']({'where':{'id':_0x596bb4['params']['id']}})[_0x6dd3('0x2a')](handleEntityNotFound(_0x30713c,null))[_0x6dd3('0x2a')](saveUpdates(_0x596bb4[_0x6dd3('0x51')],null))[_0x6dd3('0x2a')](respondWithResult(_0x30713c,null))[_0x6dd3('0x49')](handleError(_0x30713c,null));};exports[_0x6dd3('0x29')]=function(_0x155074,_0x4396ea){return db[_0x6dd3('0x31')]['find']({'where':{'id':_0x155074[_0x6dd3('0x4b')]['id']}})[_0x6dd3('0x2a')](handleEntityNotFound(_0x4396ea,null))[_0x6dd3('0x2a')](removeEntity(_0x4396ea,null))[_0x6dd3('0x49')](handleError(_0x4396ea,null));};exports['create']=function(_0x4c6fac,_0x5b7337,_0x222753){_0x4c6fac['body'][_0x6dd3('0x2d')]=_0x4c6fac[_0x6dd3('0x53')][_0x6dd3('0x54')];_0x4c6fac[_0x6dd3('0x51')][_0x6dd3('0x55')]=_0x4c6fac[_0x6dd3('0x53')]['filename'];_0x4c6fac[_0x6dd3('0x51')][_0x6dd3('0x34')]=_0x4c6fac[_0x6dd3('0x53')][_0x6dd3('0x56')];return db[_0x6dd3('0x31')][_0x6dd3('0x52')](_0x4c6fac[_0x6dd3('0x51')])[_0x6dd3('0x2a')](respondWithResult(_0x5b7337,0xc9))[_0x6dd3('0x49')](handleError(_0x5b7337,null));};exports['download']=function(_0x5716fd,_0x495af7,_0x2b1109){return db['Attachment'][_0x6dd3('0x57')]({'where':{'id':_0x5716fd[_0x6dd3('0x4b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x495af7,null))[_0x6dd3('0x2a')](function(_0x38ded8){if(_0x38ded8){var _0x4f9ac1=_0x38ded8[_0x6dd3('0x58')]!==null;var _0x3e3653=path[_0x6dd3('0x59')](config[_0x6dd3('0x5a')],_0x6dd3('0x5b'));if(_0x4f9ac1){_0x3e3653=path[_0x6dd3('0x59')](_0x3e3653,'offline-chat/');}var _0x3e888b=path['join'](_0x3e3653,_0x38ded8[_0x6dd3('0x55')]);return _0x495af7[_0x6dd3('0x5c')](_0x3e888b);}})[_0x6dd3('0x49')](handleError(_0x495af7,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 7c09f9b..e2fb6c3 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 _0x5251=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','lodash'];(function(_0xa338f6,_0x5a75d6){var _0x1fb469=function(_0x1ff512){while(--_0x1ff512){_0xa338f6['push'](_0xa338f6['shift']());}};_0x1fb469(++_0x5a75d6);}(_0x5251,0x167));var _0x1525=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5251[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1525('0x0'));var util=require(_0x1525('0x1'));var logger=require(_0x1525('0x2'))(_0x1525('0x3'));var moment=require(_0x1525('0x4'));var BPromise=require(_0x1525('0x5'));var rp=require(_0x1525('0x6'));var fs=require('fs');var path=require(_0x1525('0x7'));var rimraf=require('rimraf');var config=require(_0x1525('0x8'));var attributes=require(_0x1525('0x9'));module[_0x1525('0xa')]=function(_0x470262,_0x3bda57){return _0x470262[_0x1525('0xb')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdee1=['exports','define','attachments','util','../../config/logger','bluebird','request-promise','path','./attachment.attributes'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xdee1,0x9c));var _0x1dee=function(_0x35dc52,_0x5c666f){_0x35dc52=_0x35dc52-0x0;var _0x4134cd=_0xdee1[_0x35dc52];return _0x4134cd;};'use strict';var _=require('lodash');var util=require(_0x1dee('0x0'));var logger=require(_0x1dee('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1dee('0x2'));var rp=require(_0x1dee('0x3'));var fs=require('fs');var path=require(_0x1dee('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1dee('0x5'));module[_0x1dee('0x6')]=function(_0x17bcd5,_0x4444ff){return _0x17bcd5[_0x1dee('0x7')]('Attachment',attributes,{'tableName':_0x1dee('0x8'),'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 d5fb31b..6016ecd 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 _0xbb53=['http','then','info','request\x20sent','stringify','error','message','Attachment,\x20%s,\x20%s','result','CreateAttachment','body','options','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xbb53,0x121));var _0x3bb5=function(_0x17a88f,_0x2e6255){_0x17a88f=_0x17a88f-0x0;var _0x45e177=_0xbb53[_0x17a88f];return _0x45e177;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var moment=require(_0x3bb5('0x2'));var BPromise=require(_0x3bb5('0x3'));var rs=require(_0x3bb5('0x4'));var fs=require('fs');var Redis=require(_0x3bb5('0x5'));var db=require(_0x3bb5('0x6'))['db'];var utils=require(_0x3bb5('0x7'));var logger=require(_0x3bb5('0x8'))(_0x3bb5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bb5('0xa')][_0x3bb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aa7d,_0x157e04,_0x22f92f){return new BPromise(function(_0x480f9c,_0x5a4ae3){return client['request'](_0x28aa7d,_0x22f92f)[_0x3bb5('0xc')](function(_0x2e0cfa){logger[_0x3bb5('0xd')]('Attachment,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'),JSON[_0x3bb5('0xf')](_0x2e0cfa));if(_0x2e0cfa['error']){if(_0x2e0cfa[_0x3bb5('0x10')]['code']===0x1f4){logger[_0x3bb5('0x10')]('Attachment,\x20%s,\x20%s',_0x157e04,_0x2e0cfa['error'][_0x3bb5('0x11')]);return _0x5a4ae3(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}logger['error'](_0x3bb5('0x12'),_0x157e04,_0x2e0cfa[_0x3bb5('0x10')]['message']);return _0x480f9c(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x157e04,'request\x20sent');_0x480f9c(_0x2e0cfa[_0x3bb5('0x13')][_0x3bb5('0x11')]);}})['catch'](function(_0x25d774){logger[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x157e04,_0x25d774);_0x5a4ae3(_0x25d774);});});}exports[_0x3bb5('0x14')]=function(_0x48bc25){var _0x13cb3a=this;return new Promise(function(_0x1109d0,_0x289177){return db['Attachment']['create'](_0x48bc25[_0x3bb5('0x15')],{'raw':_0x48bc25[_0x3bb5('0x16')]?_0x48bc25[_0x3bb5('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x3bb5('0xc')](function(_0x2afe6e){logger[_0x3bb5('0xd')](_0x3bb5('0x14'),_0x48bc25);logger[_0x3bb5('0x17')](_0x3bb5('0x14'),_0x48bc25,JSON['stringify'](_0x2afe6e));_0x1109d0(_0x2afe6e);})[_0x3bb5('0x18')](function(_0x3eae85){logger[_0x3bb5('0x10')](_0x3bb5('0x14'),_0x3eae85[_0x3bb5('0x11')],_0x48bc25);_0x289177(_0x13cb3a[_0x3bb5('0x10')](0x1f4,_0x3eae85[_0x3bb5('0x11')]));});});};
\ No newline at end of file
+var _0x74f0=['body','raw','then','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x74f0,0xf3));var _0x074f=function(_0x10e653,_0x59f1cc){_0x10e653=_0x10e653-0x0;var _0x328dfd=_0x74f0[_0x10e653];return _0x328dfd;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x074f('0x1'));var fs=require('fs');var Redis=require(_0x074f('0x2'));var db=require(_0x074f('0x3'))['db'];var utils=require(_0x074f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x074f('0x5'));var jayson=require(_0x074f('0x6'));var client=jayson[_0x074f('0x7')][_0x074f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10b244,_0x395b3c,_0x3dd440){return new BPromise(function(_0x547297,_0x7108e1){return client[_0x074f('0x9')](_0x10b244,_0x3dd440)['then'](function(_0x252a2e){logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));logger[_0x074f('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x395b3c,'request\x20sent',JSON[_0x074f('0xe')](_0x252a2e));if(_0x252a2e[_0x074f('0xf')]){if(_0x252a2e[_0x074f('0xf')][_0x074f('0x10')]===0x1f4){logger[_0x074f('0xf')](_0x074f('0xb'),_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x7108e1(_0x252a2e[_0x074f('0xf')]['message']);}logger[_0x074f('0xf')]('Attachment,\x20%s,\x20%s',_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x547297(_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);}else{logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));_0x547297(_0x252a2e[_0x074f('0x12')][_0x074f('0x11')]);}})[_0x074f('0x13')](function(_0x40fd10){logger['error'](_0x074f('0xb'),_0x395b3c,_0x40fd10);_0x7108e1(_0x40fd10);});});}exports[_0x074f('0x14')]=function(_0x200e43){var _0x3facd8=this;return new Promise(function(_0x315e7d,_0x1c5406){return db['Attachment']['create'](_0x200e43[_0x074f('0x15')],{'raw':_0x200e43['options']?_0x200e43['options'][_0x074f('0x16')]===undefined?!![]:![]:!![]})[_0x074f('0x17')](function(_0x1563f3){logger[_0x074f('0xa')](_0x074f('0x14'),_0x200e43);logger[_0x074f('0xd')](_0x074f('0x14'),_0x200e43,JSON[_0x074f('0xe')](_0x1563f3));_0x315e7d(_0x1563f3);})[_0x074f('0x13')](function(_0x2c3b23){logger[_0x074f('0xf')](_0x074f('0x14'),_0x2c3b23[_0x074f('0x11')],_0x200e43);_0x1c5406(_0x3facd8[_0x074f('0xf')](0x1f4,_0x2c3b23[_0x074f('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index fe279a8..e35a87f 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5c1ca0,_0x410ca9){var _0x3a693c=function(_0x3cc4c2){while(--_0x3cc4c2){_0x5c1ca0['push'](_0x5c1ca0['shift']());}};_0x3a693c(++_0x410ca9);}(_0x2032,0xd9));var _0x2203=function(_0x23cc6a,_0x248f69){_0x23cc6a=_0x23cc6a-0x0;var _0x15a927=_0x2032[_0x23cc6a];return _0x15a927;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=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(_0x5e0f94,_0x4a9ae7){var _0x55345a=function(_0x443222){while(--_0x443222){_0x5e0f94['push'](_0x5e0f94['shift']());}};_0x55345a(++_0x4a9ae7);}(_0xb10b,0x12a));var _0xbb10=function(_0x263714,_0x399b37){_0x263714=_0x263714-0x0;var _0x1cd43d=_0xb10b[_0x263714];return _0x1cd43d;};'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 c7e60eb..3be65f2 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 _0x17c2=['activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','baseDN','domain','authenticate','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','name','password','salt','role','blocked','blockedAt','online','user','agent','add','blockDuration','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0x17c2,0x81));var _0x217c=function(_0x12321d,_0x1cf3bf){_0x12321d=_0x12321d-0x0;var _0x18fec7=_0x17c2[_0x12321d];return _0x18fec7;};'use strict';var passport=require(_0x217c('0x0'));var LocalStrategy=require(_0x217c('0x1'))[_0x217c('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x217c('0x3'));var BPromise=require(_0x217c('0x4'));var util=require(_0x217c('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x217c('0x6'));var utils=require(_0x217c('0x7'));var config=require('../../config/environment');var logger=require(_0x217c('0x8'))('api');function isActiveDirectoryConfigured(_0x249030){var _0x30923b=![];if(typeof _0x249030['activedirectory']!=='undefined'){_0x30923b=_0x249030[_0x217c('0x9')][_0x217c('0xa')]&&_0x249030[_0x217c('0x9')]['url']&&_0x249030[_0x217c('0x9')][_0x217c('0xb')];}return _0x30923b;}function adAuthenticate(_0x56298c,_0x119a5e,_0x1e845d){return new BPromise(function(_0x3bbe15,_0xb2f66b){try{var _0x3e61db=new ActiveDirectory(_0x56298c);_0x3e61db[_0x217c('0xc')](_0x119a5e,_0x1e845d,function(_0x22d490,_0xe35dce){if(_0x22d490){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x119a5e,util[_0x217c('0xd')](_0x22d490,{'showHidden':![],'depth':null}));_0xb2f66b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0xe35dce){logger[_0x217c('0xe')](_0x217c('0xf'),_0x119a5e);_0xb2f66b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3bbe15(_0xe35dce);}});}catch(_0x254d64){_0xb2f66b(_0x254d64);}});}function ActiveDirectoryAuthenticate(_0x4c2b28,_0x9a69d7,_0x17b547,_0x325510){var _0x33c46f,_0x256808;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x217c('0x10'),_0x9a69d7);return _0x325510(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x217c('0x11')][_0x217c('0x12')]({'where':{'id':0x1},'attributes':[_0x217c('0x13'),'blockDuration'],'raw':!![]})[_0x217c('0x14')](function(_0x453cb9){_0x33c46f=_0x453cb9;if(!_0x33c46f[_0x217c('0x13')]){logger[_0x217c('0xe')](_0x217c('0x15'),_0x9a69d7);throw new Error(_0x217c('0x16'));}return _0x4c2b28[_0x217c('0x12')]({'attributes':['id',_0x217c('0x17'),_0x217c('0x18'),_0x217c('0x19'),_0x217c('0x1a'),'disabled',_0x217c('0x1b'),_0x217c('0x1c'),_0x217c('0x1d')],'where':{'name':_0x9a69d7,'role':{'$or':['admin',_0x217c('0x1e'),_0x217c('0x1f')]},'adSsoEnabled':!![]}});})[_0x217c('0x14')](function(_0x2ba310){if(!_0x2ba310||_0x2ba310&&_0x2ba310['name']!==_0x9a69d7){throw new Error(_0x217c('0x16'));}_0x256808=_0x2ba310;var _0x2372e6=_0x256808[_0x217c('0x17')]+'@'+config['activedirectory'][_0x217c('0xb')];return adAuthenticate(config[_0x217c('0x9')],_0x2372e6,_0x17b547);})[_0x217c('0x14')](function(_0x5ccef5){if(_0x256808['disabled']){throw new Error(_0x217c('0x16'));}if(_0x33c46f['blockDuration']>0x0){if(_0x256808[_0x217c('0x1b')]){if(moment(_0x256808[_0x217c('0x1c')])[_0x217c('0x20')](_0x33c46f[_0x217c('0x21')],'minutes')>moment()){throw new Error(_0x217c('0x16'));}return utils[_0x217c('0x22')](_0x256808,0x0,![],null)[_0x217c('0x14')](function(){return utils[_0x217c('0x23')](_0x256808);})[_0x217c('0x14')](function(){return _0x325510(null,_0x256808);});}else{return utils['getLicense'](_0x256808)[_0x217c('0x14')](function(){return _0x325510(null,_0x256808);});}}else{return utils[_0x217c('0x23')](_0x256808)[_0x217c('0x14')](function(){return _0x325510(null,_0x256808);});}})['catch'](function(_0x3b38ce){return _0x325510(null,![],_0x3b38ce);});}function handleError(_0xf68ff,_0x56cf2c,_0x36fad1){return _0xf68ff[_0x217c('0x24')](_0x56cf2c||0x1f4)['send']({'message':_0x36fad1?_0x36fad1[_0x217c('0x25')]||_0x36fad1:''});}exports[_0x217c('0x26')]=function(_0x4ce46c,_0x15d2e7,_0x591d65){passport['authenticate'](_0x217c('0x27'),function(_0x78aa1c,_0x5a4efe,_0x272bd3){var _0xd3e0c3=_0x78aa1c||_0x272bd3;if(_0xd3e0c3){return handleError(_0x15d2e7,0x191,_0xd3e0c3);}if(!_0x5a4efe){return handleError(_0x15d2e7,0x194,{'message':_0x217c('0x28')});}else{var _0x19efe4={'payload':{'id':_0x5a4efe['id'],'role':_0x5a4efe[_0x217c('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x217c('0x29')](_0x19efe4)[_0x217c('0x14')](function(_0x4c0d82){_0x15d2e7[_0x217c('0x2a')]({'id':_0x5a4efe['id'],'token':_0x4c0d82,'statusCall':'','isAlreadyLogged':_0x5a4efe[_0x217c('0x1d')]});});}})(_0x4ce46c,_0x15d2e7,_0x591d65);};passport[_0x217c('0x2b')]('ad-login',new LocalStrategy({'usernameField':_0x217c('0x17'),'passwordField':_0x217c('0x18')},function(_0x5317ff,_0x45e145,_0x533fad){return ActiveDirectoryAuthenticate(db['User'],_0x5317ff,_0x45e145,_0x533fad);}));
\ No newline at end of file
+var _0xb644=['blockedAt','online','name','add','minutes','clearBlockUser','getLicense','catch','ad-login','signToken','json','User','passport','passport-local','Strategy','moment','activedirectory2','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','password','salt','role','disabled','blocked'];(function(_0x219750,_0x4b83c1){var _0x4c90c1=function(_0x471d36){while(--_0x471d36){_0x219750['push'](_0x219750['shift']());}};_0x4c90c1(++_0x4b83c1);}(_0xb644,0x15c));var _0x4b64=function(_0x1ccd29,_0x3c456b){_0x1ccd29=_0x1ccd29-0x0;var _0x207fbb=_0xb644[_0x1ccd29];return _0x207fbb;};'use strict';var passport=require(_0x4b64('0x0'));var LocalStrategy=require(_0x4b64('0x1'))[_0x4b64('0x2')];var moment=require(_0x4b64('0x3'));var ActiveDirectory=require(_0x4b64('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require(_0x4b64('0x5'))['db'];var authService=require(_0x4b64('0x6'));var utils=require('../../config/utils');var config=require(_0x4b64('0x7'));var logger=require(_0x4b64('0x8'))(_0x4b64('0x9'));function isActiveDirectoryConfigured(_0x477da6){var _0x583e05=![];if(typeof _0x477da6[_0x4b64('0xa')]!==_0x4b64('0xb')){_0x583e05=_0x477da6[_0x4b64('0xa')][_0x4b64('0xc')]&&_0x477da6[_0x4b64('0xa')]['url']&&_0x477da6[_0x4b64('0xa')][_0x4b64('0xd')];}return _0x583e05;}function adAuthenticate(_0x2f5147,_0x4a43bc,_0x3731c2){return new BPromise(function(_0x21b76f,_0x42f461){try{var _0x4bebc7=new ActiveDirectory(_0x2f5147);_0x4bebc7[_0x4b64('0xe')](_0x4a43bc,_0x3731c2,function(_0x17b0e8,_0x282f9a){if(_0x17b0e8){logger[_0x4b64('0xf')](_0x4b64('0x10'),_0x4a43bc,util[_0x4b64('0x11')](_0x17b0e8,{'showHidden':![],'depth':null}));_0x42f461('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x282f9a){logger[_0x4b64('0xf')](_0x4b64('0x12'),_0x4a43bc);_0x42f461(_0x4b64('0x13'));}else{_0x21b76f(_0x282f9a);}});}catch(_0x5d507a){_0x42f461(_0x5d507a);}});}function ActiveDirectoryAuthenticate(_0x19a168,_0x364192,_0x8cd928,_0x1d95b8){var _0x3cf154,_0x2322a0;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4b64('0x14'),_0x364192);return _0x1d95b8(null,![],{'message':_0x4b64('0x13')});}return db['Setting'][_0x4b64('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x4b64('0x16')],'raw':!![]})[_0x4b64('0x17')](function(_0x2649bb){_0x3cf154=_0x2649bb;if(!_0x3cf154[_0x4b64('0x18')]){logger[_0x4b64('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x364192);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x19a168['findOne']({'attributes':['id','name',_0x4b64('0x19'),_0x4b64('0x1a'),_0x4b64('0x1b'),_0x4b64('0x1c'),_0x4b64('0x1d'),_0x4b64('0x1e'),_0x4b64('0x1f')],'where':{'name':_0x364192,'role':{'$or':['admin','user','agent']},'adSsoEnabled':!![]}});})[_0x4b64('0x17')](function(_0x5bae1b){if(!_0x5bae1b||_0x5bae1b&&_0x5bae1b[_0x4b64('0x20')]!==_0x364192){throw new Error(_0x4b64('0x13'));}_0x2322a0=_0x5bae1b;var _0x2406bb=_0x2322a0[_0x4b64('0x20')]+'@'+config[_0x4b64('0xa')][_0x4b64('0xd')];return adAuthenticate(config[_0x4b64('0xa')],_0x2406bb,_0x8cd928);})[_0x4b64('0x17')](function(_0x2cb563){if(_0x2322a0[_0x4b64('0x1c')]){throw new Error(_0x4b64('0x13'));}if(_0x3cf154[_0x4b64('0x16')]>0x0){if(_0x2322a0[_0x4b64('0x1d')]){if(moment(_0x2322a0[_0x4b64('0x1e')])[_0x4b64('0x21')](_0x3cf154[_0x4b64('0x16')],_0x4b64('0x22'))>moment()){throw new Error(_0x4b64('0x13'));}return utils[_0x4b64('0x23')](_0x2322a0,0x0,![],null)[_0x4b64('0x17')](function(){return utils['getLicense'](_0x2322a0);})['then'](function(){return _0x1d95b8(null,_0x2322a0);});}else{return utils[_0x4b64('0x24')](_0x2322a0)['then'](function(){return _0x1d95b8(null,_0x2322a0);});}}else{return utils[_0x4b64('0x24')](_0x2322a0)['then'](function(){return _0x1d95b8(null,_0x2322a0);});}})[_0x4b64('0x25')](function(_0x2a3374){return _0x1d95b8(null,![],_0x2a3374);});}function handleError(_0x57c235,_0x2ab215,_0x5c59e2){return _0x57c235['status'](_0x2ab215||0x1f4)['send']({'message':_0x5c59e2?_0x5c59e2['message']||_0x5c59e2:''});}exports['login']=function(_0x875216,_0x49db32,_0x1c63a0){passport[_0x4b64('0xe')](_0x4b64('0x26'),function(_0x2b7d22,_0x11de08,_0x13c9ee){var _0x39de48=_0x2b7d22||_0x13c9ee;if(_0x39de48){return handleError(_0x49db32,0x191,_0x39de48);}if(!_0x11de08){return handleError(_0x49db32,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xa5eb94={'payload':{'id':_0x11de08['id'],'role':_0x11de08['role']},'options':{'expiresIn':0x15180}};return authService[_0x4b64('0x27')](_0xa5eb94)['then'](function(_0x29172e){_0x49db32[_0x4b64('0x28')]({'id':_0x11de08['id'],'token':_0x29172e,'statusCall':'','isAlreadyLogged':_0x11de08[_0x4b64('0x1f')]});});}})(_0x875216,_0x49db32,_0x1c63a0);};passport['use'](_0x4b64('0x26'),new LocalStrategy({'usernameField':_0x4b64('0x20'),'passwordField':_0x4b64('0x19')},function(_0x7b48d6,_0x3b5899,_0x33931b){return ActiveDirectoryAuthenticate(db[_0x4b64('0x29')],_0x7b48d6,_0x3b5899,_0x33931b);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 04a5b85..d65eaef 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 _0x827d=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x55d800,_0x377aeb){var _0x512130=function(_0x53460f){while(--_0x53460f){_0x55d800['push'](_0x55d800['shift']());}};_0x512130(++_0x377aeb);}(_0x827d,0x150));var _0xd827=function(_0x34199f,_0x114d5a){_0x34199f=_0x34199f-0x0;var _0x4296ff=_0x827d[_0x34199f];return _0x4296ff;};'use strict';var express=require(_0xd827('0x0'));var router=express[_0xd827('0x1')]();var controller=require(_0xd827('0x2'));router[_0xd827('0x3')]('/',controller[_0xd827('0x4')]);module[_0xd827('0x5')]=router;
\ No newline at end of file
+var _0x97bf=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x278a74,_0x4ea713){var _0xc065b1=function(_0x4064b7){while(--_0x4064b7){_0x278a74['push'](_0x278a74['shift']());}};_0xc065b1(++_0x4ea713);}(_0x97bf,0x15b));var _0xf97b=function(_0x408380,_0x587b99){_0x408380=_0x408380-0x0;var _0x10e025=_0x97bf[_0x408380];return _0x10e025;};'use strict';var express=require(_0xf97b('0x0'));var router=express[_0xf97b('0x1')]();var controller=require(_0xf97b('0x2'));router['post']('/',controller[_0xf97b('0x3')]);module[_0xf97b('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 146de50..f94de0a 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x7a54,0x106));var _0x47a5=function(_0x57429d,_0x493e61){_0x57429d=_0x57429d-0x0;var _0x4df528=_0x7a54[_0x57429d];return _0x4df528;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x13e6ff,_0x991288){_0x13e6ff=_0x13e6ff-0x0;var _0x4aee8b=_0x7a54[_0x13e6ff];return _0x4aee8b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index ae501b4..47c6377 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 _0x142b=['isMiddleware','setTokenCookie','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x15736e,_0x112ce7){var _0x2c99fe=function(_0x53657c){while(--_0x53657c){_0x15736e['push'](_0x15736e['shift']());}};_0x2c99fe(++_0x112ce7);}(_0x142b,0x1bb));var _0xb142=function(_0x548f36,_0x20365f){_0x548f36=_0x548f36-0x0;var _0x4474d2=_0x142b[_0x548f36];return _0x4474d2;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xb142('0x0'));var authService=require(_0xb142('0x1'));router[_0xb142('0x2')]('/',controller[_0xb142('0x3')]);router[_0xb142('0x2')]('/callback',controller[_0xb142('0x4')],authService[_0xb142('0x5')],userController[_0xb142('0x3')],authService[_0xb142('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x1fc7=['../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','exports','express','passport','Router','./authGoogle.controller'];(function(_0x3ed1c1,_0x45fe0a){var _0x11797d=function(_0x26bad3){while(--_0x26bad3){_0x3ed1c1['push'](_0x3ed1c1['shift']());}};_0x11797d(++_0x45fe0a);}(_0x1fc7,0x1ca));var _0x71fc=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x1fc7[_0x1694f5];return _0x5b4321;};'use strict';var express=require(_0x71fc('0x0'));var passport=require(_0x71fc('0x1'));var router=express[_0x71fc('0x2')]();var controller=require(_0x71fc('0x3'));var userController=require(_0x71fc('0x4'));var authService=require(_0x71fc('0x5'));router[_0x71fc('0x6')]('/',controller[_0x71fc('0x7')]);router[_0x71fc('0x6')]('/callback',controller[_0x71fc('0x8')],authService[_0x71fc('0x9')],userController[_0x71fc('0x7')],authService['setTokenCookie']);module[_0x71fc('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index cbc02a2..6f6d91a 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 _0x9490=['util','passport-local','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','blocked','loginAttempts','admin','user','agent','then','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','clearBlockUser','minutes','getLicense','catch','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','message','stringify','error','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','toLowerCase','User','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','find','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','passwordHistoryLimit','use'];(function(_0x5cefc6,_0x25facc){var _0x36ab4d=function(_0x2c0426){while(--_0x2c0426){_0x5cefc6['push'](_0x5cefc6['shift']());}};_0x36ab4d(++_0x25facc);}(_0x9490,0x1b6));var _0x0949=function(_0x40e513,_0x4071ab){_0x40e513=_0x40e513-0x0;var _0x59068d=_0x9490[_0x40e513];return _0x59068d;};'use strict';var util=require(_0x0949('0x0'));var passport=require('passport');var LocalStrategy=require(_0x0949('0x1'))['Strategy'];var jayson=require(_0x0949('0x2'));var _=require(_0x0949('0x3'));var rs=require(_0x0949('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x0949('0x5'));var utils=require(_0x0949('0x6'));var client=jayson[_0x0949('0x7')][_0x0949('0x8')]({'port':0x232b});function localAuthenticate(_0x124b4b,_0x536c1f,_0x172b81,_0x2a16a3){var _0x3871b9,_0x23287b;return db[_0x0949('0x9')][_0x0949('0xa')]({'where':{'id':0x1},'attributes':[_0x0949('0xb'),_0x0949('0xc')],'raw':!![]})['then'](function(_0x342473){_0x3871b9=_0x342473;return _0x124b4b['findOne']({'attributes':['id','name',_0x0949('0xd'),'salt','role','disabled',_0x0949('0xe'),'blockedAt',_0x0949('0xf')],'where':{'name':_0x536c1f,'role':{'$or':[_0x0949('0x10'),_0x0949('0x11'),_0x0949('0x12')]}}});})['then'](function(_0x50eceb){if(!_0x50eceb||_0x50eceb&&_0x50eceb['name']!==_0x536c1f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x23287b=_0x50eceb;return _0x23287b;}})[_0x0949('0x13')](function(){_0x23287b[_0x0949('0x14')](_0x172b81,function(_0x8d253d,_0x13ed74){var _0x352056=_0x23287b[_0x0949('0xf')]+0x1;if(_0x8d253d){return _0x2a16a3(_0x8d253d);}else if(!_0x13ed74){if(_0x23287b[_0x0949('0x15')]){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}else if(_0x3871b9['allowedLoginAttempts']>0x0){if(_0x23287b[_0x0949('0xe')]){if(_0x3871b9[_0x0949('0xc')]>0x0){if(moment(_0x23287b[_0x0949('0x17')])[_0x0949('0x18')](_0x3871b9['blockDuration'],'minutes')>moment()){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}else{return utils[_0x0949('0x19')](_0x23287b,_0x352056,![],null)[_0x0949('0x13')](function(){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});});}}else{return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}}else{if(_0x352056>=_0x3871b9[_0x0949('0xb')]){return utils[_0x0949('0x19')](_0x23287b,0x0,!![],moment())['then'](function(){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});});}else{return utils[_0x0949('0x19')](_0x23287b,_0x352056,![],null)[_0x0949('0x13')](function(){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});});}}}else{return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}}else{if(_0x23287b[_0x0949('0x15')]){return _0x2a16a3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3871b9[_0x0949('0xb')]>0x0){if(_0x23287b[_0x0949('0xe')]){if(_0x3871b9[_0x0949('0xc')]>0x0){if(moment(_0x23287b[_0x0949('0x17')])[_0x0949('0x18')](_0x3871b9[_0x0949('0xc')],_0x0949('0x1a'))>moment()){return _0x2a16a3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0949('0x19')](_0x23287b,0x0,![],null)['then'](function(){return utils[_0x0949('0x1b')](_0x23287b);})[_0x0949('0x13')](function(){return _0x2a16a3(null,_0x23287b);});}}else{return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}}else{return utils['clearBlockUser'](_0x23287b,0x0,![],null)[_0x0949('0x13')](function(){return utils[_0x0949('0x1b')](_0x23287b);})[_0x0949('0x13')](function(){return _0x2a16a3(null,_0x23287b);})[_0x0949('0x1c')](function(_0x570391){return _0x2a16a3(null,![],_0x570391);});}}else{if(_0x23287b[_0x0949('0xe')]){return _0x2a16a3(null,![],{'message':_0x0949('0x16')});}else{return utils[_0x0949('0x1b')](_0x23287b)['then'](function(){return _0x2a16a3(null,_0x23287b);});}}}});})['catch'](function(_0xcfd295){return _0x2a16a3(null,![],_0xcfd295);});}function sendServiceMail(_0x4b2bf6){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x0949('0x1d'),_0x0949('0x1e')],'include':[{'model':db[_0x0949('0x1f')],'as':_0x0949('0x20'),'include':[{'model':db[_0x0949('0x21')],'as':'CloudProvider'}]}]})[_0x0949('0x13')](function(_0x55c0b1){if(!_0x55c0b1){throw new Error(_0x0949('0x22'));}var _0x573ae9=_0x55c0b1[_0x0949('0x23')]();var _0x2e82c0={'account':_0x573ae9,'message':_['merge']({'from':util[_0x0949('0x24')](_0x0949('0x25'),_0x55c0b1[_0x0949('0x1d')],_0x55c0b1[_0x0949('0x1e')]||_0x55c0b1['Smtp'][_0x0949('0x11')])},_0x4b2bf6)};return client['request']('SendMail',_0x2e82c0);})[_0x0949('0x13')](function(_0x33cd59){if(_0x33cd59['error']){throw new Error(util[_0x0949('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x33cd59['error'][_0x0949('0x26')]||JSON[_0x0949('0x27')](_0x33cd59[_0x0949('0x28')])));}return!![];});}function handleError(_0x5973b3,_0x460546,_0x5500c2){return _0x5973b3['status'](_0x460546||0x1f4)['send']({'message':_0x5500c2?_0x5500c2[_0x0949('0x26')]||_0x5500c2:''});}exports['login']=function(_0x1082ab,_0x503d4c,_0x3b72cf){passport[_0x0949('0x14')](_0x0949('0x29'),function(_0x555a64,_0x3c53cd,_0xbd3b6e){var _0x206666=_0x555a64||_0xbd3b6e;if(_0x206666){return handleError(_0x503d4c,0x191,_0x206666);}if(!_0x3c53cd){return handleError(_0x503d4c,0x194,{'message':_0x0949('0x2a')});}else{var _0x49783b={'payload':{'id':_0x3c53cd['id'],'role':_0x3c53cd['role']},'options':{'expiresIn':0x15180}};return authService[_0x0949('0x2b')](_0x49783b)['then'](function(_0x191be2){_0x503d4c[_0x0949('0x2c')]({'id':_0x3c53cd['id'],'token':_0x191be2,'statusCall':'','isAlreadyLogged':_0x3c53cd[_0x0949('0x2d')]});});}})(_0x1082ab,_0x503d4c,_0x3b72cf);};exports[_0x0949('0x2e')]=function(_0x4d2745,_0x2e8e6e){if(!_0x4d2745[_0x0949('0x2f')][_0x0949('0x1e')]){return handleError(_0x2e8e6e,0x1f4,{'message':_0x0949('0x30')});}var _0x21c22=rs['generate']();_0x4d2745[_0x0949('0x2f')][_0x0949('0x1e')]=_0x4d2745['body'][_0x0949('0x1e')]['trim']()[_0x0949('0x31')]();var _0x26457d;return db[_0x0949('0x9')][_0x0949('0xa')]({'where':{'id':0x1},'attributes':[_0x0949('0xb'),_0x0949('0xc')],'raw':!![]})[_0x0949('0x13')](function(_0x3c9731){_0x26457d=_0x3c9731;return db[_0x0949('0x32')]['find']({'where':{'email':_0x4d2745[_0x0949('0x2f')]['email']}});})['then'](function(_0x2f1c95){if(!_0x2f1c95){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2f1c95[_0x0949('0x15')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2f1c95[_0x0949('0xe')]){if(moment(_0x2f1c95[_0x0949('0x17')])['add'](_0x26457d[_0x0949('0xc')],_0x0949('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2f1c95['blocked']=![];_0x2f1c95[_0x0949('0x17')]=null;}}_0x2f1c95[_0x0949('0x33')]=_0x21c22;_0x2f1c95[_0x0949('0x34')]=Date['now']()+0x36ee80;return _0x2f1c95[_0x0949('0x35')]();})[_0x0949('0x13')](function(){return sendServiceMail({'to':_0x4d2745[_0x0949('0x2f')][_0x0949('0x1e')],'subject':_0x0949('0x36'),'text':_0x0949('0x37')+_0x0949('0x38')+_0x0949('0x39')+_0x4d2745['headers']['host']+_0x0949('0x3a')+_0x21c22+'\x0a\x0a'+_0x0949('0x3b')});})['then'](function(){_0x2e8e6e[_0x0949('0x3c')](0xc8)[_0x0949('0x3d')]({'message':_0x0949('0x3e')});})['catch'](function(_0x47f34b){return handleError(_0x2e8e6e,0x1f4,_0x47f34b);});};exports[_0x0949('0x3f')]=function(_0x5d8341,_0x9ae32b){return db['User'][_0x0949('0x40')]({'where':{'resetPasswordToken':_0x5d8341[_0x0949('0x41')]['token'],'resetPasswordExpires':{'$gt':Date[_0x0949('0x42')]()}}})['then'](function(_0x988f91){if(!_0x988f91){throw new Error(_0x0949('0x43'));}return db[_0x0949('0x9')][_0x0949('0xa')]({'attributes':['id','securePassword',_0x0949('0x44'),'passwordHistoryLimit']})[_0x0949('0x13')](function(_0x46dbc0){if(_0x46dbc0['securePassword'])authService[_0x0949('0x45')](_0x5d8341[_0x0949('0x2f')]['password']);if(!_0x46dbc0[_0x0949('0x44')]||!_0x988f91['previousPasswords'])return _0x988f91;authService[_0x0949('0x46')](_0x5d8341[_0x0949('0x2f')][_0x0949('0xd')],_0x988f91['previousPasswords'],_0x46dbc0[_0x0949('0x47')]);return _0x988f91;})[_0x0949('0x13')](function(){_0x988f91['password']=_0x5d8341[_0x0949('0x2f')]['password'];_0x988f91[_0x0949('0x33')]=null;_0x988f91[_0x0949('0x34')]=null;return _0x988f91[_0x0949('0x35')]();});})['then'](function(){_0x9ae32b['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0x0949('0x1c')](function(_0x492b66){return handleError(_0x9ae32b,0x1f4,_0x492b66);});};passport[_0x0949('0x48')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x0949('0xd')},function(_0x22c33f,_0x5ec3e9,_0x216931){return localAuthenticate(db['User'],_0x22c33f,_0x5ec3e9,_0x216931);}));
\ No newline at end of file
+var _0x44b0=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','merge','format','\x22%s\x22\x20<%s>','SendMail'];(function(_0xdb8e6c,_0x15df30){var _0x12c7e9=function(_0x2ae495){while(--_0x2ae495){_0xdb8e6c['push'](_0xdb8e6c['shift']());}};_0x12c7e9(++_0x15df30);}(_0x44b0,0x120));var _0x044b=function(_0x58403c,_0x45d162){_0x58403c=_0x58403c-0x0;var _0x117a7e=_0x44b0[_0x58403c];return _0x117a7e;};'use strict';var util=require(_0x044b('0x0'));var passport=require(_0x044b('0x1'));var LocalStrategy=require('passport-local')[_0x044b('0x2')];var jayson=require(_0x044b('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x044b('0x4'));var db=require(_0x044b('0x5'))['db'];var authService=require(_0x044b('0x6'));var utils=require(_0x044b('0x7'));var client=jayson[_0x044b('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x1242bb,_0x1ae22b,_0x1c960a,_0x7d0105){var _0x2ca4d3,_0x3f5c63;return db[_0x044b('0x9')][_0x044b('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x044b('0xb')],'raw':!![]})[_0x044b('0xc')](function(_0x9e2ddd){_0x2ca4d3=_0x9e2ddd;return _0x1242bb[_0x044b('0xa')]({'attributes':['id',_0x044b('0xd'),_0x044b('0xe'),_0x044b('0xf'),_0x044b('0x10'),_0x044b('0x11'),'blocked',_0x044b('0x12'),_0x044b('0x13')],'where':{'name':_0x1ae22b,'role':{'$or':[_0x044b('0x14'),_0x044b('0x15'),'agent']}}});})[_0x044b('0xc')](function(_0x4fbe79){if(!_0x4fbe79||_0x4fbe79&&_0x4fbe79[_0x044b('0xd')]!==_0x1ae22b){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3f5c63=_0x4fbe79;return _0x3f5c63;}})[_0x044b('0xc')](function(){_0x3f5c63[_0x044b('0x16')](_0x1c960a,function(_0x17eea1,_0xc8c131){var _0x55e853=_0x3f5c63[_0x044b('0x13')]+0x1;if(_0x17eea1){return _0x7d0105(_0x17eea1);}else if(!_0xc8c131){if(_0x3f5c63['disabled']){return _0x7d0105(null,![],{'message':_0x044b('0x17')});}else if(_0x2ca4d3[_0x044b('0x18')]>0x0){if(_0x3f5c63['blocked']){if(_0x2ca4d3['blockDuration']>0x0){if(moment(_0x3f5c63[_0x044b('0x12')])[_0x044b('0x19')](_0x2ca4d3['blockDuration'],_0x044b('0x1a'))>moment()){return _0x7d0105(null,![],{'message':_0x044b('0x17')});}else{return utils['clearBlockUser'](_0x3f5c63,_0x55e853,![],null)[_0x044b('0xc')](function(){return _0x7d0105(null,![],{'message':_0x044b('0x17')});});}}else{return _0x7d0105(null,![],{'message':_0x044b('0x17')});}}else{if(_0x55e853>=_0x2ca4d3[_0x044b('0x18')]){return utils[_0x044b('0x1b')](_0x3f5c63,0x0,!![],moment())[_0x044b('0xc')](function(){return _0x7d0105(null,![],{'message':_0x044b('0x17')});});}else{return utils[_0x044b('0x1b')](_0x3f5c63,_0x55e853,![],null)[_0x044b('0xc')](function(){return _0x7d0105(null,![],{'message':_0x044b('0x17')});});}}}else{return _0x7d0105(null,![],{'message':_0x044b('0x17')});}}else{if(_0x3f5c63[_0x044b('0x11')]){return _0x7d0105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2ca4d3[_0x044b('0x18')]>0x0){if(_0x3f5c63[_0x044b('0x1c')]){if(_0x2ca4d3[_0x044b('0xb')]>0x0){if(moment(_0x3f5c63[_0x044b('0x12')])[_0x044b('0x19')](_0x2ca4d3['blockDuration'],_0x044b('0x1a'))>moment()){return _0x7d0105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3f5c63,0x0,![],null)[_0x044b('0xc')](function(){return utils['getLicense'](_0x3f5c63);})[_0x044b('0xc')](function(){return _0x7d0105(null,_0x3f5c63);});}}else{return _0x7d0105(null,![],{'message':_0x044b('0x17')});}}else{return utils[_0x044b('0x1b')](_0x3f5c63,0x0,![],null)['then'](function(){return utils[_0x044b('0x1d')](_0x3f5c63);})[_0x044b('0xc')](function(){return _0x7d0105(null,_0x3f5c63);})[_0x044b('0x1e')](function(_0xcc00ba){return _0x7d0105(null,![],_0xcc00ba);});}}else{if(_0x3f5c63[_0x044b('0x1c')]){return _0x7d0105(null,![],{'message':_0x044b('0x17')});}else{return utils[_0x044b('0x1d')](_0x3f5c63)[_0x044b('0xc')](function(){return _0x7d0105(null,_0x3f5c63);});}}}});})[_0x044b('0x1e')](function(_0x142b1b){return _0x7d0105(null,![],_0x142b1b);});}function sendServiceMail(_0x4b576f){return db[_0x044b('0x1f')][_0x044b('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x044b('0x21')],'include':[{'model':db[_0x044b('0x22')],'as':'Smtp','include':[{'model':db[_0x044b('0x23')],'as':'CloudProvider'}]}]})[_0x044b('0xc')](function(_0x33618d){if(!_0x33618d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3d7f6f=_0x33618d['getSmtpOptions']();var _0x24b358={'account':_0x3d7f6f,'message':_[_0x044b('0x24')]({'from':util[_0x044b('0x25')](_0x044b('0x26'),_0x33618d[_0x044b('0xd')],_0x33618d[_0x044b('0x21')]||_0x33618d['Smtp']['user'])},_0x4b576f)};return client['request'](_0x044b('0x27'),_0x24b358);})[_0x044b('0xc')](function(_0x5b2954){if(_0x5b2954[_0x044b('0x28')]){throw new Error(util[_0x044b('0x25')](_0x044b('0x29'),_0x5b2954[_0x044b('0x28')]['message']||JSON[_0x044b('0x2a')](_0x5b2954[_0x044b('0x28')])));}return!![];});}function handleError(_0x12bcc5,_0x17d17a,_0x5bb150){return _0x12bcc5[_0x044b('0x2b')](_0x17d17a||0x1f4)[_0x044b('0x2c')]({'message':_0x5bb150?_0x5bb150[_0x044b('0x2d')]||_0x5bb150:''});}exports[_0x044b('0x2e')]=function(_0x1e4bf6,_0x89bfb3,_0x9d5e5f){passport[_0x044b('0x16')](_0x044b('0x2f'),function(_0x5e9d53,_0x19e279,_0x333a2e){var _0x357501=_0x5e9d53||_0x333a2e;if(_0x357501){return handleError(_0x89bfb3,0x191,_0x357501);}if(!_0x19e279){return handleError(_0x89bfb3,0x194,{'message':_0x044b('0x30')});}else{var _0x1b7592={'payload':{'id':_0x19e279['id'],'role':_0x19e279[_0x044b('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x044b('0x31')](_0x1b7592)[_0x044b('0xc')](function(_0x30ca9e){_0x89bfb3[_0x044b('0x32')]({'id':_0x19e279['id'],'token':_0x30ca9e,'statusCall':'','isAlreadyLogged':_0x19e279[_0x044b('0x33')]});});}})(_0x1e4bf6,_0x89bfb3,_0x9d5e5f);};exports[_0x044b('0x34')]=function(_0x122cc7,_0x352ed9){if(!_0x122cc7[_0x044b('0x35')]['email']){return handleError(_0x352ed9,0x1f4,{'message':_0x044b('0x36')});}var _0x413c4a=rs['generate']();_0x122cc7['body'][_0x044b('0x21')]=_0x122cc7[_0x044b('0x35')]['email'][_0x044b('0x37')]()[_0x044b('0x38')]();var _0xd9522c;return db[_0x044b('0x9')][_0x044b('0xa')]({'where':{'id':0x1},'attributes':[_0x044b('0x18'),_0x044b('0xb')],'raw':!![]})[_0x044b('0xc')](function(_0x104cf0){_0xd9522c=_0x104cf0;return db[_0x044b('0x39')]['find']({'where':{'email':_0x122cc7['body'][_0x044b('0x21')]}});})['then'](function(_0x30a5a1){if(!_0x30a5a1){throw new Error(_0x044b('0x3a'));}if(_0x30a5a1[_0x044b('0x11')]){throw new Error(_0x044b('0x3b'));}if(_0x30a5a1[_0x044b('0x1c')]){if(moment(_0x30a5a1[_0x044b('0x12')])[_0x044b('0x19')](_0xd9522c[_0x044b('0xb')],_0x044b('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x30a5a1['blocked']=![];_0x30a5a1[_0x044b('0x12')]=null;}}_0x30a5a1[_0x044b('0x3c')]=_0x413c4a;_0x30a5a1[_0x044b('0x3d')]=Date[_0x044b('0x3e')]()+0x36ee80;return _0x30a5a1[_0x044b('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x122cc7[_0x044b('0x35')][_0x044b('0x21')],'subject':_0x044b('0x40'),'text':_0x044b('0x41')+_0x044b('0x42')+_0x044b('0x43')+_0x122cc7[_0x044b('0x44')][_0x044b('0x45')]+_0x044b('0x46')+_0x413c4a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x044b('0xc')](function(){_0x352ed9[_0x044b('0x2b')](0xc8)[_0x044b('0x2c')]({'message':_0x044b('0x47')});})[_0x044b('0x1e')](function(_0x53aa05){return handleError(_0x352ed9,0x1f4,_0x53aa05);});};exports['reset']=function(_0x564198,_0x35a52f){return db['User'][_0x044b('0x20')]({'where':{'resetPasswordToken':_0x564198['params'][_0x044b('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x044b('0xc')](function(_0x37a79b){if(!_0x37a79b){throw new Error(_0x044b('0x49'));}return db[_0x044b('0x9')][_0x044b('0xa')]({'attributes':['id','securePassword',_0x044b('0x4a'),_0x044b('0x4b')]})[_0x044b('0xc')](function(_0x354905){if(_0x354905[_0x044b('0x4c')])authService[_0x044b('0x4d')](_0x564198[_0x044b('0x35')][_0x044b('0xe')]);if(!_0x354905[_0x044b('0x4a')]||!_0x37a79b[_0x044b('0x4e')])return _0x37a79b;authService[_0x044b('0x4f')](_0x564198[_0x044b('0x35')]['password'],_0x37a79b[_0x044b('0x4e')],_0x354905[_0x044b('0x4b')]);return _0x37a79b;})[_0x044b('0xc')](function(){_0x37a79b[_0x044b('0xe')]=_0x564198[_0x044b('0x35')][_0x044b('0xe')];_0x37a79b[_0x044b('0x3c')]=null;_0x37a79b['resetPasswordExpires']=null;return _0x37a79b[_0x044b('0x3f')]();});})[_0x044b('0xc')](function(){_0x35a52f[_0x044b('0x2b')](0xc8)[_0x044b('0x2c')]({'message':_0x044b('0x50')});})[_0x044b('0x1e')](function(_0x49d8a4){return handleError(_0x35a52f,0x1f4,_0x49d8a4);});};passport[_0x044b('0x51')](_0x044b('0x2f'),new LocalStrategy({'usernameField':_0x044b('0xd'),'passwordField':_0x044b('0xe')},function(_0x509c7e,_0x48162f,_0x26a25b){return localAuthenticate(db[_0x044b('0x39')],_0x509c7e,_0x48162f,_0x26a25b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 2642587..966c080 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 _0x2bd2=['post','login','forgot','reset','express','./authLocal.controller'];(function(_0x25dd41,_0xf30601){var _0x1e8624=function(_0x49f111){while(--_0x49f111){_0x25dd41['push'](_0x25dd41['shift']());}};_0x1e8624(++_0xf30601);}(_0x2bd2,0x19c));var _0x22bd=function(_0x37463a,_0x496ccb){_0x37463a=_0x37463a-0x0;var _0x356f55=_0x2bd2[_0x37463a];return _0x356f55;};'use strict';var express=require(_0x22bd('0x0'));var router=express['Router']();var controller=require(_0x22bd('0x1'));router[_0x22bd('0x2')]('/',controller[_0x22bd('0x3')]);router[_0x22bd('0x2')]('/forgot',controller[_0x22bd('0x4')]);router[_0x22bd('0x2')]('/reset/:token',controller[_0x22bd('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x38bc=['exports','express','Router','./authLocal.controller','login','post','/forgot','/reset/:token','reset'];(function(_0x3e41c0,_0x592a69){var _0x3e2903=function(_0xc2db0b){while(--_0xc2db0b){_0x3e41c0['push'](_0x3e41c0['shift']());}};_0x3e2903(++_0x592a69);}(_0x38bc,0x1c3));var _0xc38b=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x38bc[_0x4d613c];return _0x301fe3;};'use strict';var express=require(_0xc38b('0x0'));var router=express[_0xc38b('0x1')]();var controller=require(_0xc38b('0x2'));router['post']('/',controller[_0xc38b('0x3')]);router[_0xc38b('0x4')](_0xc38b('0x5'),controller['forgot']);router['post'](_0xc38b('0x6'),controller[_0xc38b('0x7')]);module[_0xc38b('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 04ef6c6..342d543 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 _0x79a5=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x2f48c8,_0x29cf4e){var _0x381dd0=function(_0xd0b14){while(--_0xd0b14){_0x2f48c8['push'](_0x2f48c8['shift']());}};_0x381dd0(++_0x29cf4e);}(_0x79a5,0x1d8));var _0x579a=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x79a5[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0x579a('0x0'));module[_0x579a('0x1')]={'name':{'type':Sequelize[_0x579a('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x579a('0x2')]},'status':{'type':Sequelize[_0x579a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x579a('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xedbd=['sequelize','STRING'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xedbd,0x162));var _0xdedb=function(_0x182812,_0x564202){_0x182812=_0x182812-0x0;var _0x182927=_0xedbd[_0x182812];return _0x182927;};'use strict';var Sequelize=require(_0xdedb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdedb('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xdedb('0x1')]},'description':{'type':Sequelize[_0xdedb('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 2a1ebfb..0b4e65e 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 _0x73b6=['body','find','catch','addConditions','ids','omit','getConditions','filter','addActions','Action','findOne','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','Automation','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','options','includeAll','include','findAll','rows','show','params','create'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x73b6,0xff));var _0x673b=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x73b6[_0x521929];return _0x632436;};'use strict';var emlformat=require(_0x673b('0x0'));var rimraf=require(_0x673b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x673b('0x2'));var rp=require(_0x673b('0x3'));var moment=require(_0x673b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x673b('0x5'));var util=require(_0x673b('0x6'));var path=require(_0x673b('0x7'));var sox=require('sox');var csv=require(_0x673b('0x8'));var ejs=require(_0x673b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x673b('0xa'));var jsforce=require(_0x673b('0xb'));var deskjs=require(_0x673b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x673b('0xd'));var Papa=require(_0x673b('0xe'));var Redis=require(_0x673b('0xf'));var authService=require(_0x673b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x673b('0x11'));var hardwareService=require(_0x673b('0x12'));var logger=require(_0x673b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x673b('0x14'));var licenseUtil=require(_0x673b('0x15'));var db=require(_0x673b('0x16'))['db'];function respondWithStatusCode(_0x45fa37,_0x725d10){_0x725d10=_0x725d10||0xcc;return function(_0x21598a){if(_0x21598a){return _0x45fa37[_0x673b('0x17')](_0x725d10);}return _0x45fa37[_0x673b('0x18')](_0x725d10)['end']();};}function respondWithResult(_0x12223c,_0x3cb10e){_0x3cb10e=_0x3cb10e||0xc8;return function(_0x4a6361){if(_0x4a6361){return _0x12223c[_0x673b('0x18')](_0x3cb10e)[_0x673b('0x19')](_0x4a6361);}};}function respondWithFilteredResult(_0x1af309,_0x40615a){return function(_0x141b7d){if(_0x141b7d){var _0x4e34ba=typeof _0x40615a[_0x673b('0x1a')]===_0x673b('0x1b')&&typeof _0x40615a[_0x673b('0x1c')]===_0x673b('0x1b');var _0x28b627=_0x141b7d[_0x673b('0x1d')];var _0x457c50=_0x4e34ba?0x0:_0x40615a[_0x673b('0x1a')];var _0x28ee67=_0x4e34ba?_0x141b7d['count']:_0x40615a[_0x673b('0x1a')]+_0x40615a[_0x673b('0x1c')];var _0x20c6a8;if(_0x28ee67>=_0x28b627){_0x28ee67=_0x28b627;_0x20c6a8=0xc8;}else{_0x20c6a8=0xce;}_0x1af309[_0x673b('0x18')](_0x20c6a8);return _0x1af309['set'](_0x673b('0x1e'),_0x457c50+'-'+_0x28ee67+'/'+_0x28b627)[_0x673b('0x19')](_0x141b7d);}return null;};}function patchUpdates(_0x2c5a35){return function(_0x487333){try{jsonpatch[_0x673b('0x1f')](_0x487333,_0x2c5a35,!![]);}catch(_0x2b5f71){return BPromise[_0x673b('0x20')](_0x2b5f71);}return _0x487333[_0x673b('0x21')]();};}function saveUpdates(_0x20a6a4,_0x1049fd){return function(_0x2870f2){if(_0x2870f2){return _0x2870f2[_0x673b('0x22')](_0x20a6a4)['then'](function(_0x388cd3){return _0x388cd3;});}return null;};}function removeEntity(_0x5f0e00,_0xf287c5){return function(_0xf06416){if(_0xf06416){return _0xf06416[_0x673b('0x23')]()[_0x673b('0x24')](function(){_0x5f0e00[_0x673b('0x18')](0xcc)[_0x673b('0x25')]();});}};}function handleEntityNotFound(_0x397dca,_0x266224){return function(_0x2e83c7){if(!_0x2e83c7){_0x397dca[_0x673b('0x17')](0x194);}return _0x2e83c7;};}function handleError(_0x49c35b,_0x47c033){_0x47c033=_0x47c033||0x1f4;return function(_0x32597b){logger[_0x673b('0x26')](_0x32597b[_0x673b('0x27')]);if(_0x32597b[_0x673b('0x28')]){delete _0x32597b['name'];}_0x49c35b['status'](_0x47c033)[_0x673b('0x29')](_0x32597b);};}exports['index']=function(_0x33cd7f,_0xb01dde){var _0x4b3f84={},_0x9149ea={},_0x250950={'count':0x0,'rows':[]};var _0x329bdc=_[_0x673b('0x2a')](db[_0x673b('0x2b')][_0x673b('0x2c')],function(_0x594fb3){return{'name':_0x594fb3['fieldName'],'type':_0x594fb3[_0x673b('0x2d')]['key']};});_0x9149ea[_0x673b('0x2e')]=_['map'](_0x329bdc,_0x673b('0x28'));_0x9149ea[_0x673b('0x2f')]=_[_0x673b('0x30')](_0x33cd7f[_0x673b('0x2f')]);_0x9149ea['filters']=_[_0x673b('0x31')](_0x9149ea[_0x673b('0x2e')],_0x9149ea['query']);_0x4b3f84[_0x673b('0x32')]=_['intersection'](_0x9149ea[_0x673b('0x2e')],qs[_0x673b('0x33')](_0x33cd7f[_0x673b('0x2f')][_0x673b('0x33')]));_0x4b3f84[_0x673b('0x32')]=_0x4b3f84['attributes'][_0x673b('0x34')]?_0x4b3f84[_0x673b('0x32')]:_0x9149ea[_0x673b('0x2e')];if(!_0x33cd7f[_0x673b('0x2f')][_0x673b('0x35')](_0x673b('0x36'))){_0x4b3f84[_0x673b('0x1c')]=qs[_0x673b('0x1c')](_0x33cd7f[_0x673b('0x2f')]['limit']);_0x4b3f84[_0x673b('0x1a')]=qs['offset'](_0x33cd7f[_0x673b('0x2f')][_0x673b('0x1a')]);}_0x4b3f84[_0x673b('0x37')]=qs['sort'](_0x33cd7f['query'][_0x673b('0x38')]);_0x4b3f84['where']=qs[_0x673b('0x39')](_[_0x673b('0x3a')](_0x33cd7f['query'],_0x9149ea[_0x673b('0x39')]),_0x329bdc);if(_0x33cd7f[_0x673b('0x2f')]['filter']){_0x4b3f84[_0x673b('0x3b')]=_[_0x673b('0x3c')](_0x4b3f84['where'],{'$or':_[_0x673b('0x2a')](_0x329bdc,function(_0x3c785c){if(_0x3c785c[_0x673b('0x2d')]!=='VIRTUAL'){var _0x392935={};_0x392935[_0x3c785c[_0x673b('0x28')]]={'$like':'%'+_0x33cd7f[_0x673b('0x2f')]['filter']+'%'};return _0x392935;}})});}_0x4b3f84=_[_0x673b('0x3c')]({},_0x4b3f84,_0x33cd7f[_0x673b('0x3d')]);var _0xd91ca5={'where':_0x4b3f84[_0x673b('0x3b')]};return db[_0x673b('0x2b')][_0x673b('0x1d')](_0xd91ca5)[_0x673b('0x24')](function(_0x59f1be){_0x250950[_0x673b('0x1d')]=_0x59f1be;if(_0x33cd7f[_0x673b('0x2f')][_0x673b('0x3e')]){_0x4b3f84[_0x673b('0x3f')]=[{'all':!![]}];}return db[_0x673b('0x2b')][_0x673b('0x40')](_0x4b3f84);})['then'](function(_0x3a0da3){_0x250950[_0x673b('0x41')]=_0x3a0da3;return _0x250950;})[_0x673b('0x24')](respondWithFilteredResult(_0xb01dde,_0x4b3f84))['catch'](handleError(_0xb01dde,null));};exports[_0x673b('0x42')]=function(_0x44acf2,_0x22b4ed){var _0xbaa317={'raw':![],'where':{'id':_0x44acf2[_0x673b('0x43')]['id']}},_0x5b173e={};_0x5b173e[_0x673b('0x2e')]=_[_0x673b('0x30')](db[_0x673b('0x2b')][_0x673b('0x2c')]);_0x5b173e['query']=_[_0x673b('0x30')](_0x44acf2[_0x673b('0x2f')]);_0x5b173e['filters']=_[_0x673b('0x31')](_0x5b173e[_0x673b('0x2e')],_0x5b173e['query']);_0xbaa317['attributes']=_[_0x673b('0x31')](_0x5b173e['model'],qs[_0x673b('0x33')](_0x44acf2[_0x673b('0x2f')][_0x673b('0x33')]));_0xbaa317[_0x673b('0x32')]=_0xbaa317[_0x673b('0x32')][_0x673b('0x34')]?_0xbaa317[_0x673b('0x32')]:_0x5b173e[_0x673b('0x2e')];if(_0x44acf2[_0x673b('0x2f')][_0x673b('0x3e')]){_0xbaa317[_0x673b('0x3f')]=[{'all':!![]}];}_0xbaa317=_[_0x673b('0x3c')]({},_0xbaa317,_0x44acf2[_0x673b('0x3d')]);return db['Automation']['find'](_0xbaa317)[_0x673b('0x24')](handleEntityNotFound(_0x22b4ed,null))['then'](respondWithResult(_0x22b4ed,null))['catch'](handleError(_0x22b4ed,null));};exports[_0x673b('0x44')]=function(_0x587da2,_0x2a66ae){return db[_0x673b('0x2b')]['create'](_0x587da2['body'],{})[_0x673b('0x24')](respondWithResult(_0x2a66ae,0xc9))['catch'](handleError(_0x2a66ae,null));};exports['update']=function(_0x2cdfb0,_0x53bd1c){if(_0x2cdfb0[_0x673b('0x45')]['id']){delete _0x2cdfb0[_0x673b('0x45')]['id'];}return db[_0x673b('0x2b')][_0x673b('0x46')]({'where':{'id':_0x2cdfb0['params']['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x53bd1c,null))[_0x673b('0x24')](saveUpdates(_0x2cdfb0[_0x673b('0x45')],null))[_0x673b('0x24')](respondWithResult(_0x53bd1c,null))[_0x673b('0x47')](handleError(_0x53bd1c,null));};exports['destroy']=function(_0x1dcfaf,_0x2e1afe){return db['Automation'][_0x673b('0x46')]({'where':{'id':_0x1dcfaf[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x2e1afe,null))[_0x673b('0x24')](removeEntity(_0x2e1afe,null))[_0x673b('0x47')](handleError(_0x2e1afe,null));};exports[_0x673b('0x48')]=function(_0xe384d8,_0x393eae,_0x3e7256){return db['Condition'][_0x673b('0x46')]({'where':{'id':_0xe384d8['params']['id']}})['then'](handleEntityNotFound(_0x393eae,null))[_0x673b('0x24')](function(_0x27d83d){if(_0x27d83d){return _0x27d83d[_0x673b('0x48')](_0xe384d8[_0x673b('0x45')][_0x673b('0x49')],_[_0x673b('0x4a')](_0xe384d8[_0x673b('0x45')],[_0x673b('0x49'),'id'])||{});}})[_0x673b('0x24')](respondWithResult(_0x393eae,null))['catch'](handleError(_0x393eae,null));};exports[_0x673b('0x4b')]=function(_0x3bdfb5,_0x45f6dc,_0x7b2214){var _0x21db97={};var _0x4f48ad={};var _0x2d6aab;var _0x1945c4;return db['Automation']['findOne']({'where':{'id':_0x3bdfb5[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x45f6dc,null))[_0x673b('0x24')](function(_0xa68100){if(_0xa68100){_0x2d6aab=_0xa68100;_0x4f48ad['model']=_[_0x673b('0x30')](db['Condition'][_0x673b('0x2c')]);_0x4f48ad[_0x673b('0x2f')]=_[_0x673b('0x30')](_0x3bdfb5['query']);_0x4f48ad[_0x673b('0x39')]=_[_0x673b('0x31')](_0x4f48ad[_0x673b('0x2e')],_0x4f48ad[_0x673b('0x2f')]);_0x21db97['attributes']=_[_0x673b('0x31')](_0x4f48ad[_0x673b('0x2e')],qs[_0x673b('0x33')](_0x3bdfb5['query'][_0x673b('0x33')]));_0x21db97[_0x673b('0x32')]=_0x21db97[_0x673b('0x32')][_0x673b('0x34')]?_0x21db97['attributes']:_0x4f48ad[_0x673b('0x2e')];_0x21db97['order']=qs[_0x673b('0x38')](_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x38')]);_0x21db97[_0x673b('0x3b')]=qs[_0x673b('0x39')](_[_0x673b('0x3a')](_0x3bdfb5[_0x673b('0x2f')],_0x4f48ad[_0x673b('0x39')]));if(_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x4c')]){_0x21db97['where']=_[_0x673b('0x3c')](_0x21db97[_0x673b('0x3b')],{'$or':_[_0x673b('0x2a')](_0x21db97[_0x673b('0x32')],function(_0x51f6a7){var _0x4ee45e={};_0x4ee45e[_0x51f6a7]={'$like':'%'+_0x3bdfb5[_0x673b('0x2f')]['filter']+'%'};return _0x4ee45e;})});}_0x21db97=_[_0x673b('0x3c')]({},_0x21db97,_0x3bdfb5[_0x673b('0x3d')]);return _0x2d6aab['getConditions'](_0x21db97);}})['then'](function(_0xb3812d){if(_0xb3812d){_0x1945c4=_0xb3812d[_0x673b('0x34')];if(!_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x35')](_0x673b('0x36'))){_0x21db97[_0x673b('0x1c')]=qs[_0x673b('0x1c')](_0x3bdfb5[_0x673b('0x2f')][_0x673b('0x1c')]);_0x21db97['offset']=qs[_0x673b('0x1a')](_0x3bdfb5[_0x673b('0x2f')]['offset']);}return _0x2d6aab[_0x673b('0x4b')](_0x21db97);}})['then'](function(_0x248388){if(_0x248388){return _0x248388?{'count':_0x1945c4,'rows':_0x248388}:null;}})[_0x673b('0x24')](respondWithResult(_0x45f6dc,null))['catch'](handleError(_0x45f6dc,null));};exports[_0x673b('0x4d')]=function(_0x568ba7,_0x382770,_0x1e4889){return db[_0x673b('0x4e')][_0x673b('0x46')]({'where':{'id':_0x568ba7[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0x382770,null))[_0x673b('0x24')](function(_0x1b396c){if(_0x1b396c){return _0x1b396c[_0x673b('0x4d')](_0x568ba7[_0x673b('0x45')][_0x673b('0x49')],_['omit'](_0x568ba7['body'],[_0x673b('0x49'),'id'])||{});}})[_0x673b('0x24')](respondWithResult(_0x382770,null))[_0x673b('0x47')](handleError(_0x382770,null));};exports['getActions']=function(_0x17ae97,_0xc42b37,_0xfb2b1a){var _0x16046e={};var _0x5161b3={};var _0x275b8c;var _0xf6b9;return db[_0x673b('0x2b')][_0x673b('0x4f')]({'where':{'id':_0x17ae97[_0x673b('0x43')]['id']}})[_0x673b('0x24')](handleEntityNotFound(_0xc42b37,null))['then'](function(_0x2060b6){if(_0x2060b6){_0x275b8c=_0x2060b6;_0x5161b3[_0x673b('0x2e')]=_[_0x673b('0x30')](db[_0x673b('0x4e')][_0x673b('0x2c')]);_0x5161b3[_0x673b('0x2f')]=_[_0x673b('0x30')](_0x17ae97['query']);_0x5161b3[_0x673b('0x39')]=_[_0x673b('0x31')](_0x5161b3[_0x673b('0x2e')],_0x5161b3[_0x673b('0x2f')]);_0x16046e[_0x673b('0x32')]=_['intersection'](_0x5161b3[_0x673b('0x2e')],qs[_0x673b('0x33')](_0x17ae97['query'][_0x673b('0x33')]));_0x16046e[_0x673b('0x32')]=_0x16046e[_0x673b('0x32')][_0x673b('0x34')]?_0x16046e[_0x673b('0x32')]:_0x5161b3['model'];_0x16046e[_0x673b('0x37')]=qs['sort'](_0x17ae97['query'][_0x673b('0x38')]);_0x16046e[_0x673b('0x3b')]=qs[_0x673b('0x39')](_[_0x673b('0x3a')](_0x17ae97[_0x673b('0x2f')],_0x5161b3[_0x673b('0x39')]));if(_0x17ae97[_0x673b('0x2f')]['filter']){_0x16046e[_0x673b('0x3b')]=_[_0x673b('0x3c')](_0x16046e['where'],{'$or':_[_0x673b('0x2a')](_0x16046e['attributes'],function(_0x1ac4b6){var _0x1a2950={};_0x1a2950[_0x1ac4b6]={'$like':'%'+_0x17ae97[_0x673b('0x2f')][_0x673b('0x4c')]+'%'};return _0x1a2950;})});}_0x16046e=_['merge']({},_0x16046e,_0x17ae97['options']);return _0x275b8c['getActions'](_0x16046e);}})[_0x673b('0x24')](function(_0xafc84b){if(_0xafc84b){_0xf6b9=_0xafc84b[_0x673b('0x34')];if(!_0x17ae97[_0x673b('0x2f')][_0x673b('0x35')](_0x673b('0x36'))){_0x16046e[_0x673b('0x1c')]=qs[_0x673b('0x1c')](_0x17ae97[_0x673b('0x2f')][_0x673b('0x1c')]);_0x16046e[_0x673b('0x1a')]=qs[_0x673b('0x1a')](_0x17ae97[_0x673b('0x2f')][_0x673b('0x1a')]);}return _0x275b8c[_0x673b('0x50')](_0x16046e);}})[_0x673b('0x24')](function(_0x152308){if(_0x152308){return _0x152308?{'count':_0xf6b9,'rows':_0x152308}:null;}})[_0x673b('0x24')](respondWithResult(_0xc42b37,null))['catch'](handleError(_0xc42b37,null));};
\ No newline at end of file
+var _0x3f7b=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','addConditions','omit','ids','findOne','Condition','length','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x5773b4,_0x460374){var _0x5a8181=function(_0x2bd576){while(--_0x2bd576){_0x5773b4['push'](_0x5773b4['shift']());}};_0x5a8181(++_0x460374);}(_0x3f7b,0x117));var _0xb3f7=function(_0x2211d4,_0x592254){_0x2211d4=_0x2211d4-0x0;var _0x565b56=_0x3f7b[_0x2211d4];return _0x565b56;};'use strict';var emlformat=require(_0xb3f7('0x0'));var rimraf=require(_0xb3f7('0x1'));var zipdir=require(_0xb3f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb3f7('0x4'));var util=require(_0xb3f7('0x5'));var path=require('path');var sox=require(_0xb3f7('0x6'));var csv=require('to-csv');var ejs=require(_0xb3f7('0x7'));var fs=require('fs');var fs_extra=require(_0xb3f7('0x8'));var _=require(_0xb3f7('0x9'));var squel=require(_0xb3f7('0xa'));var crypto=require(_0xb3f7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb3f7('0xc'));var toCsv=require(_0xb3f7('0xd'));var querystring=require(_0xb3f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xb3f7('0xf'));var authService=require(_0xb3f7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb3f7('0x11'));var hardwareService=require(_0xb3f7('0x12'));var logger=require(_0xb3f7('0x13'))(_0xb3f7('0x14'));var utils=require('../../config/utils');var config=require(_0xb3f7('0x15'));var licenseUtil=require(_0xb3f7('0x16'));var db=require(_0xb3f7('0x17'))['db'];function respondWithStatusCode(_0x587205,_0x435b93){_0x435b93=_0x435b93||0xcc;return function(_0x3ee2b3){if(_0x3ee2b3){return _0x587205[_0xb3f7('0x18')](_0x435b93);}return _0x587205[_0xb3f7('0x19')](_0x435b93)[_0xb3f7('0x1a')]();};}function respondWithResult(_0x5a3a3f,_0x129749){_0x129749=_0x129749||0xc8;return function(_0xcf28c4){if(_0xcf28c4){return _0x5a3a3f['status'](_0x129749)[_0xb3f7('0x1b')](_0xcf28c4);}};}function respondWithFilteredResult(_0x543573,_0x317bdd){return function(_0x12e1d2){if(_0x12e1d2){var _0x19dadd=typeof _0x317bdd[_0xb3f7('0x1c')]===_0xb3f7('0x1d')&&typeof _0x317bdd[_0xb3f7('0x1e')]===_0xb3f7('0x1d');var _0xcf97f7=_0x12e1d2[_0xb3f7('0x1f')];var _0x3dfeb7=_0x19dadd?0x0:_0x317bdd[_0xb3f7('0x1c')];var _0x5ba469=_0x19dadd?_0x12e1d2[_0xb3f7('0x1f')]:_0x317bdd[_0xb3f7('0x1c')]+_0x317bdd[_0xb3f7('0x1e')];var _0x370ac2;if(_0x5ba469>=_0xcf97f7){_0x5ba469=_0xcf97f7;_0x370ac2=0xc8;}else{_0x370ac2=0xce;}_0x543573[_0xb3f7('0x19')](_0x370ac2);return _0x543573[_0xb3f7('0x20')]('Content-Range',_0x3dfeb7+'-'+_0x5ba469+'/'+_0xcf97f7)[_0xb3f7('0x1b')](_0x12e1d2);}return null;};}function patchUpdates(_0x1d44a2){return function(_0xc5f1f1){try{jsonpatch[_0xb3f7('0x21')](_0xc5f1f1,_0x1d44a2,!![]);}catch(_0x2699ca){return BPromise['reject'](_0x2699ca);}return _0xc5f1f1['save']();};}function saveUpdates(_0x2daf74,_0x1a270d){return function(_0x389329){if(_0x389329){return _0x389329[_0xb3f7('0x22')](_0x2daf74)[_0xb3f7('0x23')](function(_0x13549c){return _0x13549c;});}return null;};}function removeEntity(_0x4e8de9,_0x2b3d7a){return function(_0x49f3f0){if(_0x49f3f0){return _0x49f3f0[_0xb3f7('0x24')]()['then'](function(){_0x4e8de9['status'](0xcc)[_0xb3f7('0x1a')]();});}};}function handleEntityNotFound(_0x80b12b,_0x79a3b2){return function(_0x32e4d4){if(!_0x32e4d4){_0x80b12b[_0xb3f7('0x18')](0x194);}return _0x32e4d4;};}function handleError(_0x4adbfe,_0x3b9698){_0x3b9698=_0x3b9698||0x1f4;return function(_0x4f48bb){logger[_0xb3f7('0x25')](_0x4f48bb[_0xb3f7('0x26')]);if(_0x4f48bb[_0xb3f7('0x27')]){delete _0x4f48bb[_0xb3f7('0x27')];}_0x4adbfe['status'](_0x3b9698)[_0xb3f7('0x28')](_0x4f48bb);};}exports[_0xb3f7('0x29')]=function(_0x2a0d38,_0x17755d){var _0x3a6b68={},_0x5a2566={},_0x38d823={'count':0x0,'rows':[]};var _0x243a02=_[_0xb3f7('0x2a')](db[_0xb3f7('0x2b')][_0xb3f7('0x2c')],function(_0xe04496){return{'name':_0xe04496[_0xb3f7('0x2d')],'type':_0xe04496[_0xb3f7('0x2e')][_0xb3f7('0x2f')]};});_0x5a2566[_0xb3f7('0x30')]=_[_0xb3f7('0x2a')](_0x243a02,_0xb3f7('0x27'));_0x5a2566[_0xb3f7('0x31')]=_['keys'](_0x2a0d38[_0xb3f7('0x31')]);_0x5a2566[_0xb3f7('0x32')]=_[_0xb3f7('0x33')](_0x5a2566[_0xb3f7('0x30')],_0x5a2566[_0xb3f7('0x31')]);_0x3a6b68[_0xb3f7('0x34')]=_[_0xb3f7('0x33')](_0x5a2566[_0xb3f7('0x30')],qs['fields'](_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x35')]));_0x3a6b68[_0xb3f7('0x34')]=_0x3a6b68['attributes']['length']?_0x3a6b68[_0xb3f7('0x34')]:_0x5a2566[_0xb3f7('0x30')];if(!_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x36')](_0xb3f7('0x37'))){_0x3a6b68[_0xb3f7('0x1e')]=qs[_0xb3f7('0x1e')](_0x2a0d38['query'][_0xb3f7('0x1e')]);_0x3a6b68[_0xb3f7('0x1c')]=qs['offset'](_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x1c')]);}_0x3a6b68[_0xb3f7('0x38')]=qs[_0xb3f7('0x39')](_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x39')]);_0x3a6b68[_0xb3f7('0x3a')]=qs[_0xb3f7('0x32')](_[_0xb3f7('0x3b')](_0x2a0d38[_0xb3f7('0x31')],_0x5a2566['filters']),_0x243a02);if(_0x2a0d38[_0xb3f7('0x31')][_0xb3f7('0x3c')]){_0x3a6b68[_0xb3f7('0x3a')]=_[_0xb3f7('0x3d')](_0x3a6b68[_0xb3f7('0x3a')],{'$or':_['map'](_0x243a02,function(_0x5b4cc2){if(_0x5b4cc2['type']!=='VIRTUAL'){var _0x3bf5bb={};_0x3bf5bb[_0x5b4cc2[_0xb3f7('0x27')]]={'$like':'%'+_0x2a0d38['query'][_0xb3f7('0x3c')]+'%'};return _0x3bf5bb;}})});}_0x3a6b68=_[_0xb3f7('0x3d')]({},_0x3a6b68,_0x2a0d38[_0xb3f7('0x3e')]);var _0x2fd149={'where':_0x3a6b68[_0xb3f7('0x3a')]};return db[_0xb3f7('0x2b')][_0xb3f7('0x1f')](_0x2fd149)[_0xb3f7('0x23')](function(_0x376af2){_0x38d823[_0xb3f7('0x1f')]=_0x376af2;if(_0x2a0d38['query'][_0xb3f7('0x3f')]){_0x3a6b68[_0xb3f7('0x40')]=[{'all':!![]}];}return db[_0xb3f7('0x2b')][_0xb3f7('0x41')](_0x3a6b68);})[_0xb3f7('0x23')](function(_0x97f317){_0x38d823['rows']=_0x97f317;return _0x38d823;})[_0xb3f7('0x23')](respondWithFilteredResult(_0x17755d,_0x3a6b68))['catch'](handleError(_0x17755d,null));};exports[_0xb3f7('0x42')]=function(_0x54887f,_0x1fa88c){var _0x150e39={'raw':![],'where':{'id':_0x54887f[_0xb3f7('0x43')]['id']}},_0x6cb41e={};_0x6cb41e[_0xb3f7('0x30')]=_[_0xb3f7('0x44')](db['Automation']['rawAttributes']);_0x6cb41e[_0xb3f7('0x31')]=_[_0xb3f7('0x44')](_0x54887f[_0xb3f7('0x31')]);_0x6cb41e[_0xb3f7('0x32')]=_['intersection'](_0x6cb41e[_0xb3f7('0x30')],_0x6cb41e['query']);_0x150e39[_0xb3f7('0x34')]=_[_0xb3f7('0x33')](_0x6cb41e['model'],qs[_0xb3f7('0x35')](_0x54887f[_0xb3f7('0x31')][_0xb3f7('0x35')]));_0x150e39['attributes']=_0x150e39[_0xb3f7('0x34')]['length']?_0x150e39[_0xb3f7('0x34')]:_0x6cb41e['model'];if(_0x54887f[_0xb3f7('0x31')]['includeAll']){_0x150e39[_0xb3f7('0x40')]=[{'all':!![]}];}_0x150e39=_[_0xb3f7('0x3d')]({},_0x150e39,_0x54887f['options']);return db[_0xb3f7('0x2b')][_0xb3f7('0x45')](_0x150e39)['then'](handleEntityNotFound(_0x1fa88c,null))[_0xb3f7('0x23')](respondWithResult(_0x1fa88c,null))[_0xb3f7('0x46')](handleError(_0x1fa88c,null));};exports[_0xb3f7('0x47')]=function(_0x472c2c,_0x55ed1d){return db[_0xb3f7('0x2b')][_0xb3f7('0x47')](_0x472c2c[_0xb3f7('0x48')],{})[_0xb3f7('0x23')](respondWithResult(_0x55ed1d,0xc9))[_0xb3f7('0x46')](handleError(_0x55ed1d,null));};exports['update']=function(_0x1f9adb,_0x50361f){if(_0x1f9adb[_0xb3f7('0x48')]['id']){delete _0x1f9adb[_0xb3f7('0x48')]['id'];}return db[_0xb3f7('0x2b')][_0xb3f7('0x45')]({'where':{'id':_0x1f9adb[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x50361f,null))[_0xb3f7('0x23')](saveUpdates(_0x1f9adb[_0xb3f7('0x48')],null))['then'](respondWithResult(_0x50361f,null))['catch'](handleError(_0x50361f,null));};exports[_0xb3f7('0x24')]=function(_0x43ddcc,_0x1f88f5){return db[_0xb3f7('0x2b')][_0xb3f7('0x45')]({'where':{'id':_0x43ddcc[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x1f88f5,null))[_0xb3f7('0x23')](removeEntity(_0x1f88f5,null))[_0xb3f7('0x46')](handleError(_0x1f88f5,null));};exports[_0xb3f7('0x49')]=function(_0x5128de,_0x2ac948,_0x5ba4e3){return db['Condition'][_0xb3f7('0x45')]({'where':{'id':_0x5128de[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x2ac948,null))[_0xb3f7('0x23')](function(_0x1dc1e5){if(_0x1dc1e5){return _0x1dc1e5[_0xb3f7('0x49')](_0x5128de[_0xb3f7('0x48')]['ids'],_[_0xb3f7('0x4a')](_0x5128de[_0xb3f7('0x48')],[_0xb3f7('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x2ac948,null))[_0xb3f7('0x46')](handleError(_0x2ac948,null));};exports['getConditions']=function(_0x10c917,_0x65c1d4,_0x1de412){var _0x33803e={};var _0x5d3573={};var _0x1f79b8;var _0x426ec7;return db[_0xb3f7('0x2b')][_0xb3f7('0x4c')]({'where':{'id':_0x10c917[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x65c1d4,null))[_0xb3f7('0x23')](function(_0xe631ea){if(_0xe631ea){_0x1f79b8=_0xe631ea;_0x5d3573['model']=_[_0xb3f7('0x44')](db[_0xb3f7('0x4d')][_0xb3f7('0x2c')]);_0x5d3573['query']=_[_0xb3f7('0x44')](_0x10c917[_0xb3f7('0x31')]);_0x5d3573[_0xb3f7('0x32')]=_[_0xb3f7('0x33')](_0x5d3573['model'],_0x5d3573[_0xb3f7('0x31')]);_0x33803e[_0xb3f7('0x34')]=_[_0xb3f7('0x33')](_0x5d3573[_0xb3f7('0x30')],qs['fields'](_0x10c917[_0xb3f7('0x31')]['fields']));_0x33803e['attributes']=_0x33803e[_0xb3f7('0x34')][_0xb3f7('0x4e')]?_0x33803e[_0xb3f7('0x34')]:_0x5d3573[_0xb3f7('0x30')];_0x33803e[_0xb3f7('0x38')]=qs['sort'](_0x10c917['query']['sort']);_0x33803e[_0xb3f7('0x3a')]=qs[_0xb3f7('0x32')](_['pick'](_0x10c917[_0xb3f7('0x31')],_0x5d3573[_0xb3f7('0x32')]));if(_0x10c917[_0xb3f7('0x31')]['filter']){_0x33803e[_0xb3f7('0x3a')]=_[_0xb3f7('0x3d')](_0x33803e[_0xb3f7('0x3a')],{'$or':_[_0xb3f7('0x2a')](_0x33803e[_0xb3f7('0x34')],function(_0x128617){var _0x5f84c4={};_0x5f84c4[_0x128617]={'$like':'%'+_0x10c917[_0xb3f7('0x31')][_0xb3f7('0x3c')]+'%'};return _0x5f84c4;})});}_0x33803e=_[_0xb3f7('0x3d')]({},_0x33803e,_0x10c917[_0xb3f7('0x3e')]);return _0x1f79b8[_0xb3f7('0x4f')](_0x33803e);}})['then'](function(_0x31cd87){if(_0x31cd87){_0x426ec7=_0x31cd87[_0xb3f7('0x4e')];if(!_0x10c917[_0xb3f7('0x31')]['hasOwnProperty'](_0xb3f7('0x37'))){_0x33803e['limit']=qs[_0xb3f7('0x1e')](_0x10c917[_0xb3f7('0x31')][_0xb3f7('0x1e')]);_0x33803e[_0xb3f7('0x1c')]=qs[_0xb3f7('0x1c')](_0x10c917[_0xb3f7('0x31')][_0xb3f7('0x1c')]);}return _0x1f79b8['getConditions'](_0x33803e);}})[_0xb3f7('0x23')](function(_0x257457){if(_0x257457){return _0x257457?{'count':_0x426ec7,'rows':_0x257457}:null;}})[_0xb3f7('0x23')](respondWithResult(_0x65c1d4,null))[_0xb3f7('0x46')](handleError(_0x65c1d4,null));};exports[_0xb3f7('0x50')]=function(_0x469861,_0x4463a9,_0xdb8e8f){return db[_0xb3f7('0x51')][_0xb3f7('0x45')]({'where':{'id':_0x469861['params']['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x4463a9,null))[_0xb3f7('0x23')](function(_0x26dbaf){if(_0x26dbaf){return _0x26dbaf[_0xb3f7('0x50')](_0x469861[_0xb3f7('0x48')]['ids'],_[_0xb3f7('0x4a')](_0x469861[_0xb3f7('0x48')],[_0xb3f7('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x4463a9,null))[_0xb3f7('0x46')](handleError(_0x4463a9,null));};exports[_0xb3f7('0x52')]=function(_0x24f1d4,_0x810f1c,_0x80288c){var _0x5e672e={};var _0x1826e2={};var _0xce6175;var _0x1d18f6;return db[_0xb3f7('0x2b')]['findOne']({'where':{'id':_0x24f1d4[_0xb3f7('0x43')]['id']}})[_0xb3f7('0x23')](handleEntityNotFound(_0x810f1c,null))[_0xb3f7('0x23')](function(_0x705bb3){if(_0x705bb3){_0xce6175=_0x705bb3;_0x1826e2[_0xb3f7('0x30')]=_['keys'](db[_0xb3f7('0x51')][_0xb3f7('0x2c')]);_0x1826e2[_0xb3f7('0x31')]=_[_0xb3f7('0x44')](_0x24f1d4[_0xb3f7('0x31')]);_0x1826e2['filters']=_[_0xb3f7('0x33')](_0x1826e2[_0xb3f7('0x30')],_0x1826e2[_0xb3f7('0x31')]);_0x5e672e['attributes']=_[_0xb3f7('0x33')](_0x1826e2[_0xb3f7('0x30')],qs[_0xb3f7('0x35')](_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x35')]));_0x5e672e[_0xb3f7('0x34')]=_0x5e672e['attributes'][_0xb3f7('0x4e')]?_0x5e672e[_0xb3f7('0x34')]:_0x1826e2[_0xb3f7('0x30')];_0x5e672e['order']=qs[_0xb3f7('0x39')](_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x39')]);_0x5e672e['where']=qs['filters'](_[_0xb3f7('0x3b')](_0x24f1d4[_0xb3f7('0x31')],_0x1826e2[_0xb3f7('0x32')]));if(_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x3c')]){_0x5e672e[_0xb3f7('0x3a')]=_[_0xb3f7('0x3d')](_0x5e672e['where'],{'$or':_[_0xb3f7('0x2a')](_0x5e672e[_0xb3f7('0x34')],function(_0x536d77){var _0x2214fa={};_0x2214fa[_0x536d77]={'$like':'%'+_0x24f1d4['query']['filter']+'%'};return _0x2214fa;})});}_0x5e672e=_['merge']({},_0x5e672e,_0x24f1d4['options']);return _0xce6175[_0xb3f7('0x52')](_0x5e672e);}})[_0xb3f7('0x23')](function(_0x4ccf43){if(_0x4ccf43){_0x1d18f6=_0x4ccf43[_0xb3f7('0x4e')];if(!_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x36')](_0xb3f7('0x37'))){_0x5e672e[_0xb3f7('0x1e')]=qs['limit'](_0x24f1d4[_0xb3f7('0x31')]['limit']);_0x5e672e['offset']=qs['offset'](_0x24f1d4[_0xb3f7('0x31')][_0xb3f7('0x1c')]);}return _0xce6175[_0xb3f7('0x52')](_0x5e672e);}})[_0xb3f7('0x23')](function(_0x1f8227){if(_0x1f8227){return _0x1f8227?{'count':_0x1d18f6,'rows':_0x1f8227}:null;}})[_0xb3f7('0x23')](respondWithResult(_0x810f1c,null))[_0xb3f7('0x46')](handleError(_0x810f1c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 32b7a75..646ea64 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 _0xd080=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./automation.attributes','exports','define','tools_automations'];(function(_0x16446a,_0x5e9140){var _0x2c7051=function(_0x2e6a25){while(--_0x2e6a25){_0x16446a['push'](_0x16446a['shift']());}};_0x2c7051(++_0x5e9140);}(_0xd080,0x82));var _0x0d08=function(_0x1945b6,_0x1e9dba){_0x1945b6=_0x1945b6-0x0;var _0x2a16e6=_0xd080[_0x1945b6];return _0x2a16e6;};'use strict';var _=require(_0x0d08('0x0'));var util=require(_0x0d08('0x1'));var logger=require(_0x0d08('0x2'))('api');var moment=require(_0x0d08('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0d08('0x5'));var attributes=require(_0x0d08('0x6'));module[_0x0d08('0x7')]=function(_0xc0b17d,_0x4f5f7b){return _0xc0b17d[_0x0d08('0x8')]('Automation',attributes,{'tableName':_0x0d08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b65=['path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','api','moment','request-promise'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x2b65,0x131));var _0x52b6=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0x2b65[_0x5f584a];return _0x3788d9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x52b6('0x0'));var moment=require(_0x52b6('0x1'));var BPromise=require('bluebird');var rp=require(_0x52b6('0x2'));var fs=require('fs');var path=require(_0x52b6('0x3'));var rimraf=require(_0x52b6('0x4'));var config=require(_0x52b6('0x5'));var attributes=require(_0x52b6('0x6'));module[_0x52b6('0x7')]=function(_0x900710,_0x5779b0){return _0x900710[_0x52b6('0x8')](_0x52b6('0x9'),attributes,{'tableName':_0x52b6('0xa'),'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 c7c8367..c3667ab 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 _0xad07=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3a2cc8,_0x17defa){var _0x2db4e2=function(_0x1cbd2a){while(--_0x1cbd2a){_0x3a2cc8['push'](_0x3a2cc8['shift']());}};_0x2db4e2(++_0x17defa);}(_0xad07,0xe3));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ad0('0x0'));var util=require(_0x7ad0('0x1'));var moment=require('moment');var BPromise=require(_0x7ad0('0x2'));var rs=require(_0x7ad0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ad0('0x4'));var logger=require(_0x7ad0('0x5'))(_0x7ad0('0x6'));var config=require('../../config/environment');var jayson=require(_0x7ad0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d09f9,_0x458ffd,_0x533282){return new BPromise(function(_0x50b4e7,_0x8684e2){return client[_0x7ad0('0x8')](_0x2d09f9,_0x533282)['then'](function(_0x5afa7c){logger[_0x7ad0('0x9')](_0x7ad0('0xa'),_0x458ffd,_0x7ad0('0xb'));logger['debug'](_0x7ad0('0xc'),_0x458ffd,_0x7ad0('0xb'),JSON[_0x7ad0('0xd')](_0x5afa7c));if(_0x5afa7c[_0x7ad0('0xe')]){if(_0x5afa7c[_0x7ad0('0xe')][_0x7ad0('0xf')]===0x1f4){logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x458ffd,_0x5afa7c[_0x7ad0('0xe')]['message']);return _0x8684e2(_0x5afa7c[_0x7ad0('0xe')][_0x7ad0('0x10')]);}logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x458ffd,_0x5afa7c['error']['message']);return _0x50b4e7(_0x5afa7c[_0x7ad0('0xe')][_0x7ad0('0x10')]);}else{logger[_0x7ad0('0x9')](_0x7ad0('0xa'),_0x458ffd,_0x7ad0('0xb'));_0x50b4e7(_0x5afa7c[_0x7ad0('0x11')][_0x7ad0('0x10')]);}})[_0x7ad0('0x12')](function(_0x52c802){logger[_0x7ad0('0xe')](_0x7ad0('0xa'),_0x458ffd,_0x52c802);_0x8684e2(_0x52c802);});});}
\ No newline at end of file
+var _0x225b=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x476036,_0x13c6a6){var _0x30b0ef=function(_0x35af25){while(--_0x35af25){_0x476036['push'](_0x476036['shift']());}};_0x30b0ef(++_0x13c6a6);}(_0x225b,0xb1));var _0xb225=function(_0x3e9d9f,_0x55766d){_0x3e9d9f=_0x3e9d9f-0x0;var _0xd04a20=_0x225b[_0x3e9d9f];return _0xd04a20;};'use strict';var _=require(_0xb225('0x0'));var util=require(_0xb225('0x1'));var moment=require('moment');var BPromise=require(_0xb225('0x2'));var rs=require(_0xb225('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb225('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb225('0x5'))('rpc');var config=require(_0xb225('0x6'));var jayson=require(_0xb225('0x7'));var client=jayson[_0xb225('0x8')][_0xb225('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37e0a1,_0x3f25e6,_0x31a718){return new BPromise(function(_0x4da794,_0x168aa8){return client[_0xb225('0xa')](_0x37e0a1,_0x31a718)[_0xb225('0xb')](function(_0xccc2e3){logger['info'](_0xb225('0xc'),_0x3f25e6,_0xb225('0xd'));logger[_0xb225('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x3f25e6,_0xb225('0xd'),JSON[_0xb225('0xf')](_0xccc2e3));if(_0xccc2e3[_0xb225('0x10')]){if(_0xccc2e3[_0xb225('0x10')][_0xb225('0x11')]===0x1f4){logger['error'](_0xb225('0xc'),_0x3f25e6,_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);return _0x168aa8(_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3f25e6,_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);return _0x4da794(_0xccc2e3[_0xb225('0x10')][_0xb225('0x12')]);}else{logger[_0xb225('0x13')](_0xb225('0xc'),_0x3f25e6,_0xb225('0xd'));_0x4da794(_0xccc2e3[_0xb225('0x14')][_0xb225('0x12')]);}})[_0xb225('0x15')](function(_0x343ff8){logger[_0xb225('0x10')]('Automation,\x20%s,\x20%s',_0x3f25e6,_0x343ff8);_0x168aa8(_0x343ff8);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 252b1de..20e2ea4 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 _0xef35=['fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','/:id/actions','post','addConditions','addActions','put','update','delete','multer','path','connect-timeout','express','Router'];(function(_0xdb0d3,_0xa7146b){var _0x333824=function(_0x21d2a2){while(--_0x21d2a2){_0xdb0d3['push'](_0xdb0d3['shift']());}};_0x333824(++_0xa7146b);}(_0xef35,0x95));var _0x5ef3=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0xef35[_0x15bbf1];return _0x5c4b47;};'use strict';var multer=require(_0x5ef3('0x0'));var util=require('util');var path=require(_0x5ef3('0x1'));var timeout=require(_0x5ef3('0x2'));var express=require(_0x5ef3('0x3'));var router=express[_0x5ef3('0x4')]();var fs_extra=require(_0x5ef3('0x5'));var auth=require(_0x5ef3('0x6'));var interaction=require(_0x5ef3('0x7'));var config=require('../../config/environment');var controller=require(_0x5ef3('0x8'));router['get']('/',auth[_0x5ef3('0x9')](),controller['index']);router[_0x5ef3('0xa')](_0x5ef3('0xb'),auth[_0x5ef3('0x9')](),controller[_0x5ef3('0xc')]);router[_0x5ef3('0xa')](_0x5ef3('0xd'),auth['isAuthenticated'](),controller[_0x5ef3('0xe')]);router['get'](_0x5ef3('0xf'),auth[_0x5ef3('0x9')](),controller['getActions']);router[_0x5ef3('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5ef3('0xd'),auth[_0x5ef3('0x9')](),controller[_0x5ef3('0x11')]);router[_0x5ef3('0x10')](_0x5ef3('0xf'),auth['isAuthenticated'](),controller[_0x5ef3('0x12')]);router[_0x5ef3('0x13')](_0x5ef3('0xb'),auth[_0x5ef3('0x9')](),controller[_0x5ef3('0x14')]);router[_0x5ef3('0x15')](_0x5ef3('0xb'),auth[_0x5ef3('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9901=['create','addConditions','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x149b5f,_0x522e4a){var _0x1222fb=function(_0x3d420f){while(--_0x3d420f){_0x149b5f['push'](_0x149b5f['shift']());}};_0x1222fb(++_0x522e4a);}(_0x9901,0x15e));var _0x1990=function(_0x5b3946,_0x23053c){_0x5b3946=_0x5b3946-0x0;var _0x2bd577=_0x9901[_0x5b3946];return _0x2bd577;};'use strict';var multer=require('multer');var util=require(_0x1990('0x0'));var path=require('path');var timeout=require(_0x1990('0x1'));var express=require(_0x1990('0x2'));var router=express[_0x1990('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1990('0x4'));var interaction=require(_0x1990('0x5'));var config=require(_0x1990('0x6'));var controller=require(_0x1990('0x7'));router[_0x1990('0x8')]('/',auth[_0x1990('0x9')](),controller[_0x1990('0xa')]);router[_0x1990('0x8')](_0x1990('0xb'),auth[_0x1990('0x9')](),controller[_0x1990('0xc')]);router['get'](_0x1990('0xd'),auth[_0x1990('0x9')](),controller[_0x1990('0xe')]);router[_0x1990('0x8')](_0x1990('0xf'),auth[_0x1990('0x9')](),controller[_0x1990('0x10')]);router[_0x1990('0x11')]('/',auth[_0x1990('0x9')](),controller[_0x1990('0x12')]);router[_0x1990('0x11')](_0x1990('0xd'),auth['isAuthenticated'](),controller[_0x1990('0x13')]);router['post']('/:id/actions',auth[_0x1990('0x9')](),controller['addActions']);router[_0x1990('0x14')](_0x1990('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1990('0x15')](_0x1990('0xb'),auth[_0x1990('0x9')](),controller[_0x1990('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 69b3c63..aa24fe9 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 _0x57e9=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x57e9,0x150));var _0x957e=function(_0xb0394e,_0x5221ac){_0xb0394e=_0xb0394e-0x0;var _0x364703=_0x57e9[_0xb0394e];return _0x364703;};'use strict';var Sequelize=require('sequelize');module[_0x957e('0x0')]={'name':{'type':Sequelize[_0x957e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x957e('0x2')](_0x957e('0x3')),'allowNull':![],'defaultValue':_0x957e('0x3')},'description':{'type':Sequelize[_0x957e('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x957e('0x4')},'limitCalls':{'type':Sequelize[_0x957e('0x5')](0x4)[_0x957e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x957e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x957e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x957e('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x957e('0xe')},'dialTimezone':{'type':Sequelize[_0x957e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x957e('0x1')],'defaultValue':_0x957e('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x957e('0x2')](_0x957e('0x10'),_0x957e('0x11'),'onlyIfOpen'),'defaultValue':_0x957e('0x10')},'dialAMDActive':{'type':Sequelize[_0x957e('0x12')],'defaultValue':0x0,'comment':_0x957e('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x957e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x957e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x957e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x957e('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x957e('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x957e('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x957e('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x957e('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x957e('0x5')](0x9)[_0x957e('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x957e('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x957e('0x2')](_0x957e('0x1b'),_0x957e('0x1c')),'defaultValue':_0x957e('0x1b')},'dialPrefix':{'type':Sequelize[_0x957e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x957e('0x1d')},'dialCutDigit':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x957e('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x957e('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x957e('0x5')](0x5)[_0x957e('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x957e('0x5')](0x3)[_0x957e('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x957e('0x23')}};
\ No newline at end of file
+var _0x0111=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence'];(function(_0x16a645,_0x4743bc){var _0x41dccb=function(_0xc681bf){while(--_0xc681bf){_0x16a645['push'](_0x16a645['shift']());}};_0x41dccb(++_0x4743bc);}(_0x0111,0x1cb));var _0x1011=function(_0xa0cc6f,_0x2cf629){_0xa0cc6f=_0xa0cc6f-0x0;var _0x2705b0=_0x0111[_0xa0cc6f];return _0x2705b0;};'use strict';var Sequelize=require(_0x1011('0x0'));module['exports']={'name':{'type':Sequelize[_0x1011('0x1')],'unique':_0x1011('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1011('0x3')](_0x1011('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1011('0x1')]},'active':{'type':Sequelize[_0x1011('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1011('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1011('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1011('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1011('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1011('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1011('0x1')],'defaultValue':_0x1011('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x1011('0x3')](_0x1011('0xf'),_0x1011('0x10'),'onlyIfOpen'),'defaultValue':_0x1011('0xf')},'dialAMDActive':{'type':Sequelize[_0x1011('0x5')],'defaultValue':0x0,'comment':_0x1011('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x1011('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1011('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1011('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1011('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1011('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1011('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1011('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1011('0x6')](0x9)[_0x1011('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1011('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1011('0x3')](_0x1011('0x18'),_0x1011('0x19')),'defaultValue':_0x1011('0x18')},'dialPrefix':{'type':Sequelize[_0x1011('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1011('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1011('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1011('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1011('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1011('0x6')](0x3)[_0x1011('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1011('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1011('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9d373d5..3006d58 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 _0xd2a8=['CmHopper','hasOwnProperty','CampaignId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','path','to-csv','squel','jsforce','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','limit','count','offset','apply','reject','save','update','then','destroy','IvrCampaigns','error','name','send','index','Campaign','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getHoppers','findOne'];(function(_0x43560b,_0x52a8ff){var _0x4687ee=function(_0x3d4a08){while(--_0x3d4a08){_0x43560b['push'](_0x43560b['shift']());}};_0x4687ee(++_0x52a8ff);}(_0xd2a8,0xc9));var _0x8d2a=function(_0x14dc3b,_0x497455){_0x14dc3b=_0x14dc3b-0x0;var _0x5848a7=_0xd2a8[_0x14dc3b];return _0x5848a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d2a('0x0'));var zipdir=require(_0x8d2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d2a('0x2'));var moment=require(_0x8d2a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8d2a('0x4'));var sox=require('sox');var csv=require(_0x8d2a('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d2a('0x6'));var crypto=require('crypto');var jsforce=require(_0x8d2a('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x8d2a('0x5'));var querystring=require('querystring');var Papa=require(_0x8d2a('0x8'));var Redis=require(_0x8d2a('0x9'));var authService=require('../../components/auth/service');var qs=require(_0x8d2a('0xa'));var as=require(_0x8d2a('0xb'));var hardwareService=require(_0x8d2a('0xc'));var logger=require(_0x8d2a('0xd'))(_0x8d2a('0xe'));var utils=require(_0x8d2a('0xf'));var config=require(_0x8d2a('0x10'));var licenseUtil=require(_0x8d2a('0x11'));var db=require(_0x8d2a('0x12'))['db'];function respondWithStatusCode(_0x1c4d91,_0x20c7bf){_0x20c7bf=_0x20c7bf||0xcc;return function(_0x36faf1){if(_0x36faf1){return _0x1c4d91[_0x8d2a('0x13')](_0x20c7bf);}return _0x1c4d91[_0x8d2a('0x14')](_0x20c7bf)[_0x8d2a('0x15')]();};}function respondWithResult(_0xac7097,_0x390844){_0x390844=_0x390844||0xc8;return function(_0x1ce423){if(_0x1ce423){return _0xac7097[_0x8d2a('0x14')](_0x390844)[_0x8d2a('0x16')](_0x1ce423);}};}function respondWithFilteredResult(_0x4dd8ec,_0x431ef1){return function(_0x356ece){if(_0x356ece){var _0x11dbd9=typeof _0x431ef1['offset']===_0x8d2a('0x17')&&typeof _0x431ef1[_0x8d2a('0x18')]===_0x8d2a('0x17');var _0x2ae5dd=_0x356ece[_0x8d2a('0x19')];var _0x48c0cc=_0x11dbd9?0x0:_0x431ef1[_0x8d2a('0x1a')];var _0x2ea79a=_0x11dbd9?_0x356ece[_0x8d2a('0x19')]:_0x431ef1[_0x8d2a('0x1a')]+_0x431ef1[_0x8d2a('0x18')];var _0x35639d;if(_0x2ea79a>=_0x2ae5dd){_0x2ea79a=_0x2ae5dd;_0x35639d=0xc8;}else{_0x35639d=0xce;}_0x4dd8ec[_0x8d2a('0x14')](_0x35639d);return _0x4dd8ec['set']('Content-Range',_0x48c0cc+'-'+_0x2ea79a+'/'+_0x2ae5dd)[_0x8d2a('0x16')](_0x356ece);}return null;};}function patchUpdates(_0x372f77){return function(_0x345a01){try{jsonpatch[_0x8d2a('0x1b')](_0x345a01,_0x372f77,!![]);}catch(_0x4e3010){return BPromise[_0x8d2a('0x1c')](_0x4e3010);}return _0x345a01[_0x8d2a('0x1d')]();};}function saveUpdates(_0x36ed11,_0x17e370){return function(_0x34983a){if(_0x34983a){return _0x34983a[_0x8d2a('0x1e')](_0x36ed11)[_0x8d2a('0x1f')](function(_0x59384e){return _0x59384e;});}return null;};}function removeEntity(_0x1c4bc9,_0x4cf2db){return function(_0x3ee19d){if(_0x3ee19d){return _0x3ee19d[_0x8d2a('0x20')]()[_0x8d2a('0x1f')](function(){var _0x3b5b9d=_0x3ee19d['get']({'plain':!![]});var _0x41172a=_0x8d2a('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x41172a,'resourceId':_0x3b5b9d['id']}})[_0x8d2a('0x1f')](function(){return _0x3ee19d;});})[_0x8d2a('0x1f')](function(){_0x1c4bc9[_0x8d2a('0x14')](0xcc)[_0x8d2a('0x15')]();});}};}function handleEntityNotFound(_0x2b1d7e,_0x53244b){return function(_0x515c1c){if(!_0x515c1c){_0x2b1d7e[_0x8d2a('0x13')](0x194);}return _0x515c1c;};}function handleError(_0x2249ab,_0x330e17){_0x330e17=_0x330e17||0x1f4;return function(_0x2422da){logger[_0x8d2a('0x22')](_0x2422da['stack']);if(_0x2422da[_0x8d2a('0x23')]){delete _0x2422da[_0x8d2a('0x23')];}_0x2249ab[_0x8d2a('0x14')](_0x330e17)[_0x8d2a('0x24')](_0x2422da);};}exports[_0x8d2a('0x25')]=function(_0x8caecc,_0xd470b3){var _0xb90057={},_0x55b8e8={},_0x769d35={'count':0x0,'rows':[]};var _0xa1b981=_['map'](db[_0x8d2a('0x26')][_0x8d2a('0x27')],function(_0x3b69ee){return{'name':_0x3b69ee[_0x8d2a('0x28')],'type':_0x3b69ee['type']['key']};});_0x55b8e8[_0x8d2a('0x29')]=_[_0x8d2a('0x2a')](_0xa1b981,_0x8d2a('0x23'));_0x55b8e8[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x8caecc[_0x8d2a('0x2b')]);_0x55b8e8[_0x8d2a('0x2d')]=_['intersection'](_0x55b8e8[_0x8d2a('0x29')],_0x55b8e8[_0x8d2a('0x2b')]);_0xb90057[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x55b8e8[_0x8d2a('0x29')],qs['fields'](_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0xb90057[_0x8d2a('0x2e')]=_0xb90057['attributes'][_0x8d2a('0x31')]?_0xb90057[_0x8d2a('0x2e')]:_0x55b8e8[_0x8d2a('0x29')];if(!_0x8caecc[_0x8d2a('0x2b')]['hasOwnProperty'](_0x8d2a('0x32'))){_0xb90057[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x8caecc['query'][_0x8d2a('0x18')]);_0xb90057['offset']=qs['offset'](_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x1a')]);}_0xb90057[_0x8d2a('0x33')]=qs[_0x8d2a('0x34')](_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x34')]);_0xb90057[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x8caecc[_0x8d2a('0x2b')],_0x55b8e8[_0x8d2a('0x2d')]),_0xa1b981);if(_0x8caecc[_0x8d2a('0x2b')]['filter']){_0xb90057[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0xb90057['where'],{'$or':_[_0x8d2a('0x2a')](_0xa1b981,function(_0x58cfba){if(_0x58cfba[_0x8d2a('0x38')]!=='VIRTUAL'){var _0x43e1a4={};_0x43e1a4[_0x58cfba[_0x8d2a('0x23')]]={'$like':'%'+_0x8caecc[_0x8d2a('0x2b')]['filter']+'%'};return _0x43e1a4;}})});}_0xb90057=_[_0x8d2a('0x37')]({},_0xb90057,_0x8caecc[_0x8d2a('0x39')]);var _0x1297bb={'where':_0xb90057[_0x8d2a('0x35')]};return db[_0x8d2a('0x26')][_0x8d2a('0x19')](_0x1297bb)[_0x8d2a('0x1f')](function(_0xdf9825){_0x769d35[_0x8d2a('0x19')]=_0xdf9825;if(_0x8caecc[_0x8d2a('0x2b')][_0x8d2a('0x3a')]){_0xb90057[_0x8d2a('0x3b')]=[{'all':!![]}];}return db['Campaign'][_0x8d2a('0x3c')](_0xb90057);})['then'](function(_0x143cd2){_0x769d35[_0x8d2a('0x3d')]=_0x143cd2;return _0x769d35;})[_0x8d2a('0x1f')](respondWithFilteredResult(_0xd470b3,_0xb90057))[_0x8d2a('0x3e')](handleError(_0xd470b3,null));};exports[_0x8d2a('0x3f')]=function(_0x5f2a52,_0x51aea6){var _0x1793b0={'raw':![],'where':{'id':_0x5f2a52[_0x8d2a('0x40')]['id']}},_0x12b6c5={};_0x12b6c5[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db[_0x8d2a('0x26')][_0x8d2a('0x27')]);_0x12b6c5[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x5f2a52[_0x8d2a('0x2b')]);_0x12b6c5[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x12b6c5[_0x8d2a('0x29')],_0x12b6c5[_0x8d2a('0x2b')]);_0x1793b0[_0x8d2a('0x2e')]=_['intersection'](_0x12b6c5[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x5f2a52[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x1793b0[_0x8d2a('0x2e')]=_0x1793b0[_0x8d2a('0x2e')]['length']?_0x1793b0[_0x8d2a('0x2e')]:_0x12b6c5[_0x8d2a('0x29')];if(_0x5f2a52['query'][_0x8d2a('0x3a')]){_0x1793b0['include']=[{'all':!![]}];}_0x1793b0=_[_0x8d2a('0x37')]({},_0x1793b0,_0x5f2a52['options']);return db[_0x8d2a('0x26')][_0x8d2a('0x41')](_0x1793b0)[_0x8d2a('0x1f')](handleEntityNotFound(_0x51aea6,null))[_0x8d2a('0x1f')](respondWithResult(_0x51aea6,null))[_0x8d2a('0x3e')](handleError(_0x51aea6,null));};exports[_0x8d2a('0x42')]=function(_0x364777,_0x505a99){return db[_0x8d2a('0x26')][_0x8d2a('0x42')](_0x364777['body'],{})[_0x8d2a('0x1f')](function(_0x317313){var _0x3767a2=_0x364777[_0x8d2a('0x43')][_0x8d2a('0x44')]({'plain':!![]});if(!_0x3767a2)throw new Error(_0x8d2a('0x45'));if(_0x3767a2[_0x8d2a('0x46')]==='user'){var _0x4cd307=_0x317313[_0x8d2a('0x44')]({'plain':!![]});var _0x1a874c='IvrCampaigns';return db[_0x8d2a('0x47')][_0x8d2a('0x41')]({'where':{'name':_0x1a874c,'userProfileId':_0x3767a2[_0x8d2a('0x48')]},'raw':!![]})[_0x8d2a('0x1f')](function(_0xde4bb7){if(_0xde4bb7&&_0xde4bb7[_0x8d2a('0x49')]===0x0){return db[_0x8d2a('0x4a')][_0x8d2a('0x42')]({'name':_0x4cd307[_0x8d2a('0x23')],'resourceId':_0x4cd307['id'],'type':_0xde4bb7[_0x8d2a('0x23')],'sectionId':_0xde4bb7['id']},{})[_0x8d2a('0x1f')](function(){return _0x317313;});}else{return _0x317313;}})['catch'](function(_0x70a1c5){logger['error'](_0x8d2a('0x4b'),_0x70a1c5);throw _0x70a1c5;});}return _0x317313;})[_0x8d2a('0x1f')](respondWithResult(_0x505a99,0xc9))[_0x8d2a('0x3e')](handleError(_0x505a99,null));};exports[_0x8d2a('0x4c')]=function(_0x8c69cc,_0xc8c04b){var _0x80ba4={'where':{'id':_0x8c69cc[_0x8d2a('0x40')]['id']}},_0x3caf84={};_0x3caf84[_0x8d2a('0x29')]=_['keys'](db[_0x8d2a('0x26')][_0x8d2a('0x27')]);_0x80ba4[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x3caf84[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x8c69cc[_0x8d2a('0x2b')]['fields']));_0x80ba4['attributes']=_0x80ba4['attributes'][_0x8d2a('0x31')]?_0x80ba4['attributes']:_0x3caf84[_0x8d2a('0x29')];if(_0x8c69cc['query'][_0x8d2a('0x3a')]){_0x80ba4['include']=[{'all':!![]}];}_0x80ba4=_[_0x8d2a('0x37')]({},_0x80ba4,_0x8c69cc[_0x8d2a('0x39')]);return db[_0x8d2a('0x26')][_0x8d2a('0x41')](_0x80ba4)[_0x8d2a('0x1f')](handleEntityNotFound(_0xc8c04b,null))[_0x8d2a('0x1f')](function(_0x267e15){if(_0x267e15){var _0x29aa45=_0x267e15['get']({'plain':!![]});_0x29aa45=qs[_0x8d2a('0x4d')](_0x29aa45,['id',_0x8d2a('0x4e'),_0x8d2a('0x4f')]);_0x8c69cc[_0x8d2a('0x50')]=_[_0x8d2a('0x4d')](_0x8c69cc[_0x8d2a('0x50')],['id',_0x8d2a('0x4e'),'updatedAt']);return db['Campaign'][_0x8d2a('0x42')](_[_0x8d2a('0x37')](_0x29aa45,_0x8c69cc[_0x8d2a('0x50')]),{'include':_0x8c69cc['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x8da82e){var _0x486e2e=_0x8c69cc[_0x8d2a('0x43')][_0x8d2a('0x44')]({'plain':!![]});if(!_0x486e2e)throw new Error(_0x8d2a('0x45'));if(_0x486e2e['role']===_0x8d2a('0x43')){var _0x4ca908=_0x8da82e[_0x8d2a('0x44')]({'plain':!![]});var _0x19ad25=_0x8d2a('0x21');return db[_0x8d2a('0x47')][_0x8d2a('0x41')]({'where':{'name':_0x19ad25,'userProfileId':_0x486e2e[_0x8d2a('0x48')]},'raw':!![]})[_0x8d2a('0x1f')](function(_0x47bf9f){if(_0x47bf9f&&_0x47bf9f[_0x8d2a('0x49')]===0x0){return db[_0x8d2a('0x4a')][_0x8d2a('0x42')]({'name':_0x4ca908[_0x8d2a('0x23')],'resourceId':_0x4ca908['id'],'type':_0x47bf9f[_0x8d2a('0x23')],'sectionId':_0x47bf9f['id']},{})[_0x8d2a('0x1f')](function(){return _0x8da82e;});}else{return _0x8da82e;}})[_0x8d2a('0x3e')](function(_0xcb9352){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcb9352);throw _0xcb9352;});}return _0x8da82e;});}})[_0x8d2a('0x1f')](respondWithResult(_0xc8c04b,0xc9))[_0x8d2a('0x3e')](handleError(_0xc8c04b,null));};exports[_0x8d2a('0x1e')]=function(_0x12c1c,_0x3a2c96){if(_0x12c1c[_0x8d2a('0x50')]['id']){delete _0x12c1c['body']['id'];}return db[_0x8d2a('0x26')][_0x8d2a('0x41')]({'where':{'id':_0x12c1c[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x3a2c96,null))['then'](saveUpdates(_0x12c1c[_0x8d2a('0x50')],null))[_0x8d2a('0x1f')](respondWithResult(_0x3a2c96,null))['catch'](handleError(_0x3a2c96,null));};exports[_0x8d2a('0x20')]=function(_0x2d07a5,_0x4c2f3b){return db[_0x8d2a('0x26')]['find']({'where':{'id':_0x2d07a5[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x4c2f3b,null))[_0x8d2a('0x1f')](removeEntity(_0x4c2f3b,null))[_0x8d2a('0x3e')](handleError(_0x4c2f3b,null));};exports[_0x8d2a('0x51')]=function(_0x6dc9c9,_0x59a9b9,_0x1155a6){var _0x5f0ecc={'raw':!![],'where':{}};var _0x621f17={};var _0x50caf3={'count':0x0,'rows':[]};return db[_0x8d2a('0x26')][_0x8d2a('0x52')]({'where':{'id':_0x6dc9c9[_0x8d2a('0x40')]['id']}})['then'](handleEntityNotFound(_0x59a9b9,null))['then'](function(_0x1fd988){if(_0x1fd988){_0x621f17['model']=_[_0x8d2a('0x2c')](db[_0x8d2a('0x53')][_0x8d2a('0x27')]);_0x621f17[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x6dc9c9[_0x8d2a('0x2b')]);_0x621f17[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x621f17[_0x8d2a('0x29')],_0x621f17[_0x8d2a('0x2b')]);_0x5f0ecc[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x621f17[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x5f0ecc[_0x8d2a('0x2e')]=_0x5f0ecc[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x5f0ecc[_0x8d2a('0x2e')]:_0x621f17[_0x8d2a('0x29')];if(!_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x54')](_0x8d2a('0x32'))){_0x5f0ecc['limit']=qs[_0x8d2a('0x18')](_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x5f0ecc['offset']=qs[_0x8d2a('0x1a')](_0x6dc9c9['query']['offset']);}_0x5f0ecc[_0x8d2a('0x33')]=qs[_0x8d2a('0x34')](_0x6dc9c9['query'][_0x8d2a('0x34')]);_0x5f0ecc[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x6dc9c9[_0x8d2a('0x2b')],_0x621f17['filters']));_0x5f0ecc[_0x8d2a('0x35')][_0x8d2a('0x55')]=_0x1fd988['id'];if(_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x5f0ecc[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x5f0ecc['where'],{'$or':_['map'](_0x5f0ecc[_0x8d2a('0x2e')],function(_0x2ff32f){var _0x116909={};_0x116909[_0x2ff32f]={'$like':'%'+_0x6dc9c9[_0x8d2a('0x2b')]['filter']+'%'};return _0x116909;})});}_0x5f0ecc=_[_0x8d2a('0x37')]({},_0x5f0ecc,_0x6dc9c9[_0x8d2a('0x39')]);return db[_0x8d2a('0x53')][_0x8d2a('0x19')]({'where':_0x5f0ecc['where']})[_0x8d2a('0x1f')](function(_0x30aa34){_0x50caf3['count']=_0x30aa34;if(_0x6dc9c9[_0x8d2a('0x2b')][_0x8d2a('0x3a')]){_0x5f0ecc[_0x8d2a('0x3b')]=[{'all':!![]}];}return db[_0x8d2a('0x53')]['findAll'](_0x5f0ecc);})[_0x8d2a('0x1f')](function(_0x53f022){_0x50caf3[_0x8d2a('0x3d')]=_0x53f022;return _0x50caf3;});}})[_0x8d2a('0x1f')](respondWithFilteredResult(_0x59a9b9,_0x5f0ecc))[_0x8d2a('0x3e')](handleError(_0x59a9b9,null));};exports[_0x8d2a('0x57')]=function(_0x468853,_0x134240,_0x210bc3){var _0x45feaf={'raw':!![],'where':{}};var _0x1f63c4={};var _0x429516={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x468853[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x134240,null))[_0x8d2a('0x1f')](function(_0x14b81c){if(_0x14b81c){_0x1f63c4['model']=_['keys'](db[_0x8d2a('0x58')][_0x8d2a('0x27')]);_0x1f63c4[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x468853[_0x8d2a('0x2b')]);_0x1f63c4[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x1f63c4[_0x8d2a('0x29')],_0x1f63c4['query']);_0x45feaf[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x1f63c4['model'],qs['fields'](_0x468853[_0x8d2a('0x2b')]['fields']));_0x45feaf[_0x8d2a('0x2e')]=_0x45feaf[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x45feaf[_0x8d2a('0x2e')]:_0x1f63c4[_0x8d2a('0x29')];if(!_0x468853[_0x8d2a('0x2b')][_0x8d2a('0x54')]('nolimit')){_0x45feaf[_0x8d2a('0x18')]=qs['limit'](_0x468853[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x45feaf['offset']=qs[_0x8d2a('0x1a')](_0x468853['query'][_0x8d2a('0x1a')]);}_0x45feaf[_0x8d2a('0x33')]=qs['sort'](_0x468853['query'][_0x8d2a('0x34')]);_0x45feaf[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_['pick'](_0x468853[_0x8d2a('0x2b')],_0x1f63c4[_0x8d2a('0x2d')]));_0x45feaf[_0x8d2a('0x35')]['CampaignId']=_0x14b81c['id'];if(_0x468853['query']['filter']){_0x45feaf[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x45feaf[_0x8d2a('0x35')],{'$or':_[_0x8d2a('0x2a')](_0x45feaf[_0x8d2a('0x2e')],function(_0x3e0b2b){var _0x31a42a={};_0x31a42a[_0x3e0b2b]={'$like':'%'+_0x468853[_0x8d2a('0x2b')]['filter']+'%'};return _0x31a42a;})});}_0x45feaf=_[_0x8d2a('0x37')]({},_0x45feaf,_0x468853['options']);return db[_0x8d2a('0x58')]['count']({'where':_0x45feaf[_0x8d2a('0x35')]})[_0x8d2a('0x1f')](function(_0x29e872){_0x429516['count']=_0x29e872;if(_0x468853['query'][_0x8d2a('0x3a')]){_0x45feaf[_0x8d2a('0x3b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8d2a('0x3c')](_0x45feaf);})[_0x8d2a('0x1f')](function(_0x5a7f46){_0x429516['rows']=_0x5a7f46;return _0x429516;});}})[_0x8d2a('0x1f')](respondWithFilteredResult(_0x134240,_0x45feaf))[_0x8d2a('0x3e')](handleError(_0x134240,null));};exports[_0x8d2a('0x59')]=function(_0x2176f4,_0x4b5bb7,_0x5646a7){var _0x53a4d0={'raw':!![],'where':{}};var _0x1e5804={};var _0x47d41a={'count':0x0,'rows':[]};return db[_0x8d2a('0x26')][_0x8d2a('0x52')]({'where':{'id':_0x2176f4[_0x8d2a('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b5bb7,null))[_0x8d2a('0x1f')](function(_0x339b3b){if(_0x339b3b){_0x1e5804[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db['CmHopperFinal'][_0x8d2a('0x27')]);_0x1e5804[_0x8d2a('0x2b')]=_['keys'](_0x2176f4[_0x8d2a('0x2b')]);_0x1e5804[_0x8d2a('0x2d')]=_['intersection'](_0x1e5804[_0x8d2a('0x29')],_0x1e5804['query']);_0x53a4d0[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x1e5804[_0x8d2a('0x29')],qs['fields'](_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x53a4d0[_0x8d2a('0x2e')]=_0x53a4d0[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x53a4d0[_0x8d2a('0x2e')]:_0x1e5804[_0x8d2a('0x29')];if(!_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x54')]('nolimit')){_0x53a4d0[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x53a4d0[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x1a')]);}_0x53a4d0[_0x8d2a('0x33')]=qs[_0x8d2a('0x34')](_0x2176f4[_0x8d2a('0x2b')]['sort']);_0x53a4d0[_0x8d2a('0x35')]=qs['filters'](_[_0x8d2a('0x36')](_0x2176f4['query'],_0x1e5804[_0x8d2a('0x2d')]));_0x53a4d0[_0x8d2a('0x35')][_0x8d2a('0x55')]=_0x339b3b['id'];if(_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x53a4d0['where']=_[_0x8d2a('0x37')](_0x53a4d0[_0x8d2a('0x35')],{'$or':_['map'](_0x53a4d0[_0x8d2a('0x2e')],function(_0x1c274c){var _0x15bb8e={};_0x15bb8e[_0x1c274c]={'$like':'%'+_0x2176f4[_0x8d2a('0x2b')][_0x8d2a('0x56')]+'%'};return _0x15bb8e;})});}_0x53a4d0=_[_0x8d2a('0x37')]({},_0x53a4d0,_0x2176f4[_0x8d2a('0x39')]);return db['CmHopperFinal'][_0x8d2a('0x19')]({'where':_0x53a4d0[_0x8d2a('0x35')]})['then'](function(_0x392482){_0x47d41a[_0x8d2a('0x19')]=_0x392482;if(_0x2176f4[_0x8d2a('0x2b')]['includeAll']){_0x53a4d0[_0x8d2a('0x3b')]=[{'all':!![]}];}return db[_0x8d2a('0x5a')][_0x8d2a('0x3c')](_0x53a4d0);})[_0x8d2a('0x1f')](function(_0x1efa9e){_0x47d41a[_0x8d2a('0x3d')]=_0x1efa9e;return _0x47d41a;});}})['then'](respondWithFilteredResult(_0x4b5bb7,_0x53a4d0))[_0x8d2a('0x3e')](handleError(_0x4b5bb7,null));};exports[_0x8d2a('0x5b')]=function(_0x512bf8,_0x2593d7,_0x4e634c){var _0x2bf366={'raw':!![],'where':{}};var _0x17e63a={};var _0xb7c019={'count':0x0,'rows':[]};return db[_0x8d2a('0x26')]['findOne']({'where':{'id':_0x512bf8[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x2593d7,null))['then'](function(_0x45a902){if(_0x45a902){_0x17e63a[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db[_0x8d2a('0x5c')][_0x8d2a('0x27')]);_0x17e63a[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x512bf8[_0x8d2a('0x2b')]);_0x17e63a[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x17e63a[_0x8d2a('0x29')],_0x17e63a['query']);_0x2bf366[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x17e63a['model'],qs['fields'](_0x512bf8['query'][_0x8d2a('0x30')]));_0x2bf366['attributes']=_0x2bf366[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x2bf366['attributes']:_0x17e63a[_0x8d2a('0x29')];if(!_0x512bf8['query'][_0x8d2a('0x54')](_0x8d2a('0x32'))){_0x2bf366['limit']=qs[_0x8d2a('0x18')](_0x512bf8['query'][_0x8d2a('0x18')]);_0x2bf366[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x1a')]);}_0x2bf366['order']=qs[_0x8d2a('0x34')](_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x34')]);_0x2bf366[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_['pick'](_0x512bf8[_0x8d2a('0x2b')],_0x17e63a[_0x8d2a('0x2d')]));_0x2bf366[_0x8d2a('0x35')][_0x8d2a('0x55')]=_0x45a902['id'];if(_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x2bf366[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x2bf366[_0x8d2a('0x35')],{'$or':_[_0x8d2a('0x2a')](_0x2bf366['attributes'],function(_0x1e6c29){var _0x283b48={};_0x283b48[_0x1e6c29]={'$like':'%'+_0x512bf8[_0x8d2a('0x2b')][_0x8d2a('0x56')]+'%'};return _0x283b48;})});}_0x2bf366=_[_0x8d2a('0x37')]({},_0x2bf366,_0x512bf8['options']);return db[_0x8d2a('0x5c')]['count']({'where':_0x2bf366[_0x8d2a('0x35')]})['then'](function(_0x113c95){_0xb7c019[_0x8d2a('0x19')]=_0x113c95;if(_0x512bf8['query'][_0x8d2a('0x3a')]){_0x2bf366['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x8d2a('0x3c')](_0x2bf366);})['then'](function(_0x4f0f0e){_0xb7c019[_0x8d2a('0x3d')]=_0x4f0f0e;return _0xb7c019;});}})[_0x8d2a('0x1f')](respondWithFilteredResult(_0x2593d7,_0x2bf366))['catch'](handleError(_0x2593d7,null));};exports[_0x8d2a('0x5d')]=function(_0x1a67e4,_0x5727d,_0x48fdf7){var _0x37e8ae={};var _0x773c7e={};var _0x3e7534;var _0x4c4f09;return db[_0x8d2a('0x26')][_0x8d2a('0x52')]({'where':{'id':_0x1a67e4[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x5727d,null))[_0x8d2a('0x1f')](function(_0x3a4247){if(_0x3a4247){_0x3e7534=_0x3a4247;_0x773c7e[_0x8d2a('0x29')]=_[_0x8d2a('0x2c')](db[_0x8d2a('0x5e')]['rawAttributes']);_0x773c7e['query']=_[_0x8d2a('0x2c')](_0x1a67e4['query']);_0x773c7e['filters']=_[_0x8d2a('0x2f')](_0x773c7e['model'],_0x773c7e[_0x8d2a('0x2b')]);_0x37e8ae[_0x8d2a('0x2e')]=_['intersection'](_0x773c7e[_0x8d2a('0x29')],qs[_0x8d2a('0x30')](_0x1a67e4['query'][_0x8d2a('0x30')]));_0x37e8ae['attributes']=_0x37e8ae['attributes'][_0x8d2a('0x31')]?_0x37e8ae[_0x8d2a('0x2e')]:_0x773c7e[_0x8d2a('0x29')];_0x37e8ae['order']=qs[_0x8d2a('0x34')](_0x1a67e4['query'][_0x8d2a('0x34')]);_0x37e8ae[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x1a67e4['query'],_0x773c7e[_0x8d2a('0x2d')]));if(_0x1a67e4[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x37e8ae[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x37e8ae[_0x8d2a('0x35')],{'$or':_['map'](_0x37e8ae['attributes'],function(_0x7ac96b){var _0x13b54b={};_0x13b54b[_0x7ac96b]={'$like':'%'+_0x1a67e4[_0x8d2a('0x2b')]['filter']+'%'};return _0x13b54b;})});}_0x37e8ae=_['merge']({},_0x37e8ae,_0x1a67e4[_0x8d2a('0x39')]);return _0x3e7534[_0x8d2a('0x5d')](_0x37e8ae);}})['then'](function(_0x303de5){if(_0x303de5){_0x4c4f09=_0x303de5['length'];if(!_0x1a67e4[_0x8d2a('0x2b')][_0x8d2a('0x54')](_0x8d2a('0x32'))){_0x37e8ae[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x1a67e4[_0x8d2a('0x2b')][_0x8d2a('0x18')]);_0x37e8ae[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x1a67e4[_0x8d2a('0x2b')]['offset']);}return _0x3e7534[_0x8d2a('0x5d')](_0x37e8ae);}})[_0x8d2a('0x1f')](function(_0x150be4){if(_0x150be4){return _0x150be4?{'count':_0x4c4f09,'rows':_0x150be4}:null;}})['then'](respondWithResult(_0x5727d,null))[_0x8d2a('0x3e')](handleError(_0x5727d,null));};exports[_0x8d2a('0x5f')]=function(_0x31ff46,_0x5aaa5e,_0x8cc053){var _0x402d58,_0xa9edf3;var _0x24e38d=[];var _0x4b9975=moment()[_0x8d2a('0x60')](_0x8d2a('0x61'));return db[_0x8d2a('0x26')][_0x8d2a('0x41')]({'where':{'id':_0x31ff46[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x5aaa5e,null))['then'](function(_0x5bff98){if(_0x5bff98){_0xa9edf3=_0x5bff98;return _0x5bff98[_0x8d2a('0x5f')](_0x31ff46[_0x8d2a('0x50')][_0x8d2a('0x62')],_[_0x8d2a('0x4d')](_0x31ff46[_0x8d2a('0x50')],['ids','id'])||{});}return null;})[_0x8d2a('0x63')](function(_0x2bc211){var _0x4d8e7d;var _0x513ff3;_0x402d58=_0x2bc211||[];var _0x7b9994=[];if(_0x2bc211){for(var _0x413022=0x0;_0x413022<_0x2bc211[_0x8d2a('0x31')];_0x413022+=0x1){var _0x469e44=_0x2bc211[_0x413022]['get']({'plain':!![]});_0xa9edf3[_0x8d2a('0x64')]=_0x31ff46[_0x8d2a('0x50')][_0x8d2a('0x64')]?_0x31ff46[_0x8d2a('0x50')][_0x8d2a('0x64')]:_0xa9edf3[_0x8d2a('0x64')];switch(_0xa9edf3[_0x8d2a('0x64')]){case _0x8d2a('0x65'):_0x4d8e7d=squel[_0x8d2a('0x66')]()[_0x8d2a('0x67')]('cm_hopper')[_0x8d2a('0x68')](['phone',_0x8d2a('0x69'),_0x8d2a('0x6a'),'ListId','CampaignId','createdAt',_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x6d'),_0x8d2a('0x6d'))[_0x8d2a('0x6c')](_0x8d2a('0x6e'),'scheduledAt')[_0x8d2a('0x6c')]('id','ContactId')[_0x8d2a('0x6c')](_0x469e44['CmListId'][_0x8d2a('0x6f')](),_0x8d2a('0x70'))[_0x8d2a('0x6c')](_0x31ff46[_0x8d2a('0x40')]['id'][_0x8d2a('0x6f')](),'CampaignId')['field']('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4f'))[_0x8d2a('0x71')](_0x8d2a('0x72'))['where'](_0x8d2a('0x73'))['where']('ListId\x20=\x20?',_0x469e44[_0x8d2a('0x74')]['toString']())[_0x8d2a('0x35')]('phone\x20IS\x20NOT\x20NULL')[_0x8d2a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x8d2a('0x71')]('cm_hopper_final')[_0x8d2a('0x35')](_0x8d2a('0x75'),_0x31ff46[_0x8d2a('0x40')]['id']['toString']()))[_0x8d2a('0x35')](_0x8d2a('0x76'),squel['select']()[_0x8d2a('0x6c')](_0x8d2a('0x77'))['from']('cm_hopper')[_0x8d2a('0x35')](_0x8d2a('0x75'),_0x31ff46[_0x8d2a('0x40')]['id'][_0x8d2a('0x6f')]())))[_0x8d2a('0x6f')]();break;case _0x8d2a('0x78'):_0x4d8e7d=squel['insert']()[_0x8d2a('0x67')](_0x8d2a('0x79'))[_0x8d2a('0x68')](['phone',_0x8d2a('0x69'),_0x8d2a('0x6a'),_0x8d2a('0x70'),_0x8d2a('0x55'),'createdAt',_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x6d'),_0x8d2a('0x6d'))[_0x8d2a('0x6c')]('NOW()',_0x8d2a('0x69'))[_0x8d2a('0x6c')]('id','ContactId')[_0x8d2a('0x6c')](_0x469e44[_0x8d2a('0x74')]['toString'](),_0x8d2a('0x70'))['field'](_0x31ff46['params']['id']['toString'](),'CampaignId')[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27','createdAt')['field']('\x27'+_0x4b9975+'\x27','updatedAt')['from'](_0x8d2a('0x72'))[_0x8d2a('0x35')]('deletedAt\x20IS\x20NULL')['where'](_0x8d2a('0x7a'),_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')]())[_0x8d2a('0x35')](_0x8d2a('0x7b'))[_0x8d2a('0x35')](_0x8d2a('0x76'),squel['select']()[_0x8d2a('0x6c')]('COALESCE(phone,\x27\x27)')[_0x8d2a('0x71')]('cm_hopper')[_0x8d2a('0x35')](_0x8d2a('0x75'),_0x31ff46[_0x8d2a('0x40')]['id'][_0x8d2a('0x6f')]())))[_0x8d2a('0x6f')]();break;default:_0x4d8e7d=squel[_0x8d2a('0x66')]()[_0x8d2a('0x67')]('cm_hopper')[_0x8d2a('0x68')](['phone',_0x8d2a('0x69'),_0x8d2a('0x6a'),_0x8d2a('0x70'),_0x8d2a('0x55'),_0x8d2a('0x4e'),_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')]('phone',_0x8d2a('0x6d'))[_0x8d2a('0x6c')](_0x8d2a('0x6e'),_0x8d2a('0x69'))[_0x8d2a('0x6c')]('id',_0x8d2a('0x6a'))['field'](_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')](),_0x8d2a('0x70'))[_0x8d2a('0x6c')](_0x31ff46['params']['id'][_0x8d2a('0x6f')](),'CampaignId')[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4f'))['from'](_0x8d2a('0x72'))[_0x8d2a('0x35')](_0x8d2a('0x73'))[_0x8d2a('0x35')](_0x8d2a('0x7a'),_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')]())[_0x8d2a('0x35')](_0x8d2a('0x7b')))[_0x8d2a('0x6f')]();}_0x513ff3=squel['insert']()[_0x8d2a('0x67')](_0x8d2a('0x7c'))[_0x8d2a('0x68')]([_0x8d2a('0x7d'),'scheduledAt','phone',_0x8d2a('0x7e'),'createdAt',_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x7f'),'id')['field'](_0x8d2a('0x6e'),_0x8d2a('0x69'))[_0x8d2a('0x6c')](_0x8d2a('0x80'),_0x8d2a('0x6d'))['field'](_0x8d2a('0x81'),_0x8d2a('0x7e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27',_0x8d2a('0x4e'))[_0x8d2a('0x6c')]('\x27'+_0x4b9975+'\x27','updatedAt')[_0x8d2a('0x71')](_0x8d2a('0x82'),'ci')[_0x8d2a('0x83')](_0x8d2a('0x79'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x8d2a('0x84'),_0x469e44[_0x8d2a('0x74')][_0x8d2a('0x6f')]())[_0x8d2a('0x35')]('h.CampaignId=?',_0x31ff46['params']['id'][_0x8d2a('0x6f')]())[_0x8d2a('0x35')](_0x8d2a('0x85'),_0x4b9975))['toString']();_0x7b9994[_0x8d2a('0x86')](db[_0x8d2a('0x87')][_0x8d2a('0x2b')](_0x4d8e7d));_0x24e38d['push'](db[_0x8d2a('0x87')]['query'](_0x513ff3));}return BPromise['all'](_0x7b9994);}})[_0x8d2a('0x1f')](function(){return BPromise[_0x8d2a('0x88')](_0x24e38d);})[_0x8d2a('0x1f')](function(){return _0x402d58;})['then'](respondWithResult(_0x5aaa5e,null))[_0x8d2a('0x3e')](handleError(_0x5aaa5e,null));};exports[_0x8d2a('0x89')]=function(_0x3e0ca4,_0xd4e83b,_0xbd5d22){return db[_0x8d2a('0x26')]['find']({'where':{'id':_0x3e0ca4[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0xd4e83b,null))[_0x8d2a('0x1f')](function(_0x189295){if(_0x189295){return _0x189295['removeLists'](_0x3e0ca4['query'][_0x8d2a('0x62')]);}})[_0x8d2a('0x1f')](function(_0x1c034d){if(_0x1c034d){return db['CmHopper'][_0x8d2a('0x20')]({'where':{'ListId':_0x3e0ca4[_0x8d2a('0x2b')][_0x8d2a('0x62')],'CampaignId':_0x3e0ca4[_0x8d2a('0x40')]['id']}})['then'](function(){return _0x1c034d;});}})[_0x8d2a('0x1f')](respondWithStatusCode(_0xd4e83b,null))[_0x8d2a('0x3e')](handleError(_0xd4e83b,null));};exports[_0x8d2a('0x8a')]=function(_0x2b3eb2,_0x36c4bb,_0x13f169){var _0x1d0c1e={};var _0x2a564a={};var _0xa006db;var _0x2c55e8;return db[_0x8d2a('0x26')]['findOne']({'where':{'id':_0x2b3eb2[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x36c4bb,null))[_0x8d2a('0x1f')](function(_0x1aeef6){if(_0x1aeef6){_0xa006db=_0x1aeef6;_0x2a564a['model']=_[_0x8d2a('0x2c')](db[_0x8d2a('0x5e')][_0x8d2a('0x27')]);_0x2a564a[_0x8d2a('0x2b')]=_[_0x8d2a('0x2c')](_0x2b3eb2[_0x8d2a('0x2b')]);_0x2a564a[_0x8d2a('0x2d')]=_[_0x8d2a('0x2f')](_0x2a564a[_0x8d2a('0x29')],_0x2a564a[_0x8d2a('0x2b')]);_0x1d0c1e[_0x8d2a('0x2e')]=_[_0x8d2a('0x2f')](_0x2a564a[_0x8d2a('0x29')],qs['fields'](_0x2b3eb2[_0x8d2a('0x2b')][_0x8d2a('0x30')]));_0x1d0c1e[_0x8d2a('0x2e')]=_0x1d0c1e[_0x8d2a('0x2e')][_0x8d2a('0x31')]?_0x1d0c1e[_0x8d2a('0x2e')]:_0x2a564a[_0x8d2a('0x29')];_0x1d0c1e[_0x8d2a('0x33')]=qs['sort'](_0x2b3eb2[_0x8d2a('0x2b')]['sort']);_0x1d0c1e[_0x8d2a('0x35')]=qs[_0x8d2a('0x2d')](_[_0x8d2a('0x36')](_0x2b3eb2['query'],_0x2a564a[_0x8d2a('0x2d')]));if(_0x2b3eb2[_0x8d2a('0x2b')][_0x8d2a('0x56')]){_0x1d0c1e[_0x8d2a('0x35')]=_[_0x8d2a('0x37')](_0x1d0c1e['where'],{'$or':_[_0x8d2a('0x2a')](_0x1d0c1e['attributes'],function(_0x285056){var _0x343858={};_0x343858[_0x285056]={'$like':'%'+_0x2b3eb2['query'][_0x8d2a('0x56')]+'%'};return _0x343858;})});}_0x1d0c1e=_['merge']({},_0x1d0c1e,_0x2b3eb2[_0x8d2a('0x39')]);return _0xa006db['getBlackLists'](_0x1d0c1e);}})[_0x8d2a('0x1f')](function(_0x1a400a){if(_0x1a400a){_0x2c55e8=_0x1a400a[_0x8d2a('0x31')];if(!_0x2b3eb2[_0x8d2a('0x2b')]['hasOwnProperty'](_0x8d2a('0x32'))){_0x1d0c1e[_0x8d2a('0x18')]=qs[_0x8d2a('0x18')](_0x2b3eb2['query'][_0x8d2a('0x18')]);_0x1d0c1e[_0x8d2a('0x1a')]=qs[_0x8d2a('0x1a')](_0x2b3eb2[_0x8d2a('0x2b')]['offset']);}return _0xa006db[_0x8d2a('0x8a')](_0x1d0c1e);}})[_0x8d2a('0x1f')](function(_0x51eaf1){if(_0x51eaf1){return _0x51eaf1?{'count':_0x2c55e8,'rows':_0x51eaf1}:null;}})['then'](respondWithResult(_0x36c4bb,null))[_0x8d2a('0x3e')](handleError(_0x36c4bb,null));};exports['addBlackLists']=function(_0x2622ae,_0x1f3ce7,_0x13d354){var _0x141c0e,_0x426ba3;var _0x4d558d=[];var _0x3487f2=moment()['format'](_0x8d2a('0x61'));return db['Campaign'][_0x8d2a('0x41')]({'where':{'id':_0x2622ae[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x1f3ce7,null))[_0x8d2a('0x1f')](function(_0x32213d){if(_0x32213d){_0x426ba3=_0x32213d;return _0x32213d[_0x8d2a('0x8b')](_0x2622ae['body'][_0x8d2a('0x62')],_[_0x8d2a('0x4d')](_0x2622ae[_0x8d2a('0x50')],['ids','id'])||{});}return null;})[_0x8d2a('0x63')](function(_0x2cc871){var _0x5c8bb2;var _0x75a0ac;_0x141c0e=_0x2cc871||[];var _0x4c0362=[];if(_0x2cc871){for(var _0x2db8d3=0x0;_0x2db8d3<_0x2cc871[_0x8d2a('0x31')];_0x2db8d3+=0x1){var _0xfb8025=_0x2cc871[_0x2db8d3][_0x8d2a('0x44')]({'plain':!![]});_0x5c8bb2=squel['insert']()[_0x8d2a('0x67')](_0x8d2a('0x8c'))[_0x8d2a('0x68')](['phone',_0x8d2a('0x6a'),_0x8d2a('0x70'),_0x8d2a('0x55'),_0x8d2a('0x4e'),_0x8d2a('0x4f')],squel[_0x8d2a('0x6b')]()[_0x8d2a('0x6c')](_0x8d2a('0x6d'),'phone')[_0x8d2a('0x6c')]('id','ContactId')[_0x8d2a('0x6c')](_0xfb8025[_0x8d2a('0x74')][_0x8d2a('0x6f')](),_0x8d2a('0x70'))[_0x8d2a('0x6c')](_0x2622ae['params']['id'][_0x8d2a('0x6f')](),'CampaignId')[_0x8d2a('0x6c')](_0x8d2a('0x6e'),_0x8d2a('0x4e'))['field'](_0x8d2a('0x6e'),_0x8d2a('0x4f'))[_0x8d2a('0x71')](_0x8d2a('0x72'))['where'](_0x8d2a('0x73'))['where']('ListId\x20=\x20?',_0xfb8025[_0x8d2a('0x74')][_0x8d2a('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x4c0362[_0x8d2a('0x86')](db[_0x8d2a('0x87')][_0x8d2a('0x2b')](_0x5c8bb2));}return BPromise[_0x8d2a('0x88')](_0x4c0362);}})['then'](function(){return _0x141c0e;})[_0x8d2a('0x1f')](respondWithResult(_0x1f3ce7,null))[_0x8d2a('0x3e')](handleError(_0x1f3ce7,null));};exports[_0x8d2a('0x8d')]=function(_0x30bc18,_0x18197b,_0x45302b){return db[_0x8d2a('0x26')][_0x8d2a('0x41')]({'where':{'id':_0x30bc18[_0x8d2a('0x40')]['id']}})[_0x8d2a('0x1f')](handleEntityNotFound(_0x18197b,null))['then'](function(_0x48a063){if(_0x48a063){return _0x48a063[_0x8d2a('0x8d')](_0x30bc18['query'][_0x8d2a('0x62')]);}})[_0x8d2a('0x1f')](function(_0x59427f){if(_0x59427f){return db[_0x8d2a('0x5c')][_0x8d2a('0x20')]({'where':{'ListId':_0x30bc18['query'][_0x8d2a('0x62')],'CampaignId':_0x30bc18['params']['id']}})[_0x8d2a('0x1f')](function(){return _0x59427f;});}})[_0x8d2a('0x1f')](respondWithStatusCode(_0x18197b,null))[_0x8d2a('0x3e')](handleError(_0x18197b,null));};
\ No newline at end of file
+var _0xbe99=['Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','send','index','map','Campaign','rawAttributes','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','getHoppers','CmHopper','findAll','rows','findOne','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','scheduledAt','select','field','phone','NOW()','ContactId','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','insert','fromQuery','cmHopperId','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x19fc44,_0x4bca56){var _0x3414ec=function(_0x696b3d){while(--_0x696b3d){_0x19fc44['push'](_0x19fc44['shift']());}};_0x3414ec(++_0x4bca56);}(_0xbe99,0x196));var _0x9be9=function(_0x2b41e8,_0x86e285){_0x2b41e8=_0x2b41e8-0x0;var _0x396ab3=_0xbe99[_0x2b41e8];return _0x396ab3;};'use strict';var emlformat=require(_0x9be9('0x0'));var rimraf=require(_0x9be9('0x1'));var zipdir=require(_0x9be9('0x2'));var jsonpatch=require(_0x9be9('0x3'));var rp=require(_0x9be9('0x4'));var moment=require('moment');var BPromise=require(_0x9be9('0x5'));var Mustache=require('mustache');var util=require(_0x9be9('0x6'));var path=require(_0x9be9('0x7'));var sox=require(_0x9be9('0x8'));var csv=require(_0x9be9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9be9('0xa'));var _=require(_0x9be9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9be9('0xc'));var deskjs=require(_0x9be9('0xd'));var toCsv=require(_0x9be9('0x9'));var querystring=require(_0x9be9('0xe'));var Papa=require(_0x9be9('0xf'));var Redis=require(_0x9be9('0x10'));var authService=require(_0x9be9('0x11'));var qs=require(_0x9be9('0x12'));var as=require(_0x9be9('0x13'));var hardwareService=require(_0x9be9('0x14'));var logger=require(_0x9be9('0x15'))(_0x9be9('0x16'));var utils=require(_0x9be9('0x17'));var config=require(_0x9be9('0x18'));var licenseUtil=require(_0x9be9('0x19'));var db=require(_0x9be9('0x1a'))['db'];function respondWithStatusCode(_0x33c2cd,_0x4b6d99){_0x4b6d99=_0x4b6d99||0xcc;return function(_0x1251e4){if(_0x1251e4){return _0x33c2cd[_0x9be9('0x1b')](_0x4b6d99);}return _0x33c2cd[_0x9be9('0x1c')](_0x4b6d99)[_0x9be9('0x1d')]();};}function respondWithResult(_0x2cc374,_0x50a7fb){_0x50a7fb=_0x50a7fb||0xc8;return function(_0x2798bd){if(_0x2798bd){return _0x2cc374[_0x9be9('0x1c')](_0x50a7fb)[_0x9be9('0x1e')](_0x2798bd);}};}function respondWithFilteredResult(_0x5a8a3d,_0x2d3e45){return function(_0x418c1e){if(_0x418c1e){var _0x3c92cc=typeof _0x2d3e45[_0x9be9('0x1f')]===_0x9be9('0x20')&&typeof _0x2d3e45['limit']===_0x9be9('0x20');var _0x1cbff7=_0x418c1e[_0x9be9('0x21')];var _0x5f2612=_0x3c92cc?0x0:_0x2d3e45['offset'];var _0x9a37a0=_0x3c92cc?_0x418c1e[_0x9be9('0x21')]:_0x2d3e45[_0x9be9('0x1f')]+_0x2d3e45['limit'];var _0x5aeca2;if(_0x9a37a0>=_0x1cbff7){_0x9a37a0=_0x1cbff7;_0x5aeca2=0xc8;}else{_0x5aeca2=0xce;}_0x5a8a3d[_0x9be9('0x1c')](_0x5aeca2);return _0x5a8a3d[_0x9be9('0x22')](_0x9be9('0x23'),_0x5f2612+'-'+_0x9a37a0+'/'+_0x1cbff7)[_0x9be9('0x1e')](_0x418c1e);}return null;};}function patchUpdates(_0x1b041b){return function(_0x3761c7){try{jsonpatch[_0x9be9('0x24')](_0x3761c7,_0x1b041b,!![]);}catch(_0x2c1f2f){return BPromise[_0x9be9('0x25')](_0x2c1f2f);}return _0x3761c7[_0x9be9('0x26')]();};}function saveUpdates(_0xd700ff,_0x100637){return function(_0x599429){if(_0x599429){return _0x599429[_0x9be9('0x27')](_0xd700ff)['then'](function(_0x2d543d){return _0x2d543d;});}return null;};}function removeEntity(_0xf87e6d,_0x451e60){return function(_0x3fe959){if(_0x3fe959){return _0x3fe959['destroy']()[_0x9be9('0x28')](function(){var _0xfb4266=_0x3fe959[_0x9be9('0x29')]({'plain':!![]});var _0x42a486=_0x9be9('0x2a');return db[_0x9be9('0x2b')][_0x9be9('0x2c')]({'where':{'type':_0x42a486,'resourceId':_0xfb4266['id']}})[_0x9be9('0x28')](function(){return _0x3fe959;});})[_0x9be9('0x28')](function(){_0xf87e6d[_0x9be9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195330,_0x2f8466){return function(_0x26db60){if(!_0x26db60){_0x195330[_0x9be9('0x1b')](0x194);}return _0x26db60;};}function handleError(_0x10ac46,_0x54de1f){_0x54de1f=_0x54de1f||0x1f4;return function(_0x22c898){logger[_0x9be9('0x2d')](_0x22c898['stack']);if(_0x22c898[_0x9be9('0x2e')]){delete _0x22c898['name'];}_0x10ac46[_0x9be9('0x1c')](_0x54de1f)[_0x9be9('0x2f')](_0x22c898);};}exports[_0x9be9('0x30')]=function(_0x199cbd,_0x5a527a){var _0x133eca={},_0x3f6fff={},_0xb61721={'count':0x0,'rows':[]};var _0x35665c=_[_0x9be9('0x31')](db[_0x9be9('0x32')][_0x9be9('0x33')],function(_0x3dcb2a){return{'name':_0x3dcb2a['fieldName'],'type':_0x3dcb2a['type'][_0x9be9('0x34')]};});_0x3f6fff['model']=_[_0x9be9('0x31')](_0x35665c,_0x9be9('0x2e'));_0x3f6fff[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x199cbd['query']);_0x3f6fff[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x3f6fff[_0x9be9('0x39')],_0x3f6fff[_0x9be9('0x35')]);_0x133eca[_0x9be9('0x3a')]=_['intersection'](_0x3f6fff[_0x9be9('0x39')],qs['fields'](_0x199cbd['query']['fields']));_0x133eca['attributes']=_0x133eca[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x133eca['attributes']:_0x3f6fff[_0x9be9('0x39')];if(!_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x133eca[_0x9be9('0x3e')]=qs['limit'](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x133eca[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x133eca[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x40')]);_0x133eca[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x199cbd[_0x9be9('0x35')],_0x3f6fff[_0x9be9('0x37')]),_0x35665c);if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]){_0x133eca[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x133eca[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x35665c,function(_0x1c1d9a){if(_0x1c1d9a[_0x9be9('0x45')]!==_0x9be9('0x46')){var _0x56a49d={};_0x56a49d[_0x1c1d9a[_0x9be9('0x2e')]]={'$like':'%'+_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]+'%'};return _0x56a49d;}})});}_0x133eca=_[_0x9be9('0x44')]({},_0x133eca,_0x199cbd[_0x9be9('0x47')]);var _0x51e6fe={'where':_0x133eca[_0x9be9('0x41')]};return db[_0x9be9('0x32')][_0x9be9('0x21')](_0x51e6fe)[_0x9be9('0x28')](function(_0x1f7775){_0xb61721[_0x9be9('0x21')]=_0x1f7775;if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x48')]){_0x133eca[_0x9be9('0x49')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x133eca);})[_0x9be9('0x28')](function(_0x56bf39){_0xb61721['rows']=_0x56bf39;return _0xb61721;})[_0x9be9('0x28')](respondWithFilteredResult(_0x5a527a,_0x133eca))[_0x9be9('0x4a')](handleError(_0x5a527a,null));};exports[_0x9be9('0x4b')]=function(_0x59ed83,_0x5ab632){var _0x24c121={'raw':![],'where':{'id':_0x59ed83[_0x9be9('0x4c')]['id']}},_0x4f4168={};_0x4f4168[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x32')][_0x9be9('0x33')]);_0x4f4168[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x59ed83[_0x9be9('0x35')]);_0x4f4168['filters']=_[_0x9be9('0x38')](_0x4f4168[_0x9be9('0x39')],_0x4f4168[_0x9be9('0x35')]);_0x24c121['attributes']=_[_0x9be9('0x38')](_0x4f4168['model'],qs[_0x9be9('0x4d')](_0x59ed83[_0x9be9('0x35')][_0x9be9('0x4d')]));_0x24c121[_0x9be9('0x3a')]=_0x24c121['attributes']['length']?_0x24c121[_0x9be9('0x3a')]:_0x4f4168[_0x9be9('0x39')];if(_0x59ed83['query'][_0x9be9('0x48')]){_0x24c121[_0x9be9('0x49')]=[{'all':!![]}];}_0x24c121=_[_0x9be9('0x44')]({},_0x24c121,_0x59ed83[_0x9be9('0x47')]);return db[_0x9be9('0x32')][_0x9be9('0x4e')](_0x24c121)[_0x9be9('0x28')](handleEntityNotFound(_0x5ab632,null))[_0x9be9('0x28')](respondWithResult(_0x5ab632,null))[_0x9be9('0x4a')](handleError(_0x5ab632,null));};exports[_0x9be9('0x4f')]=function(_0x1385ac,_0x31faa8){return db['Campaign'][_0x9be9('0x4f')](_0x1385ac[_0x9be9('0x50')],{})[_0x9be9('0x28')](function(_0x31928f){var _0x47e6c8=_0x1385ac['user'][_0x9be9('0x29')]({'plain':!![]});if(!_0x47e6c8)throw new Error(_0x9be9('0x51'));if(_0x47e6c8[_0x9be9('0x52')]===_0x9be9('0x53')){var _0x18450a=_0x31928f['get']({'plain':!![]});var _0x240265=_0x9be9('0x2a');return db['UserProfileSection'][_0x9be9('0x4e')]({'where':{'name':_0x240265,'userProfileId':_0x47e6c8[_0x9be9('0x54')]},'raw':!![]})['then'](function(_0x5a4795){if(_0x5a4795&&_0x5a4795[_0x9be9('0x55')]===0x0){return db[_0x9be9('0x2b')][_0x9be9('0x4f')]({'name':_0x18450a['name'],'resourceId':_0x18450a['id'],'type':_0x5a4795[_0x9be9('0x2e')],'sectionId':_0x5a4795['id']},{})[_0x9be9('0x28')](function(){return _0x31928f;});}else{return _0x31928f;}})[_0x9be9('0x4a')](function(_0x46a7d2){logger[_0x9be9('0x2d')](_0x9be9('0x56'),_0x46a7d2);throw _0x46a7d2;});}return _0x31928f;})[_0x9be9('0x28')](respondWithResult(_0x31faa8,0xc9))[_0x9be9('0x4a')](handleError(_0x31faa8,null));};exports[_0x9be9('0x57')]=function(_0x156637,_0x4dd1d0){var _0x489f39={'where':{'id':_0x156637[_0x9be9('0x4c')]['id']}},_0x5862ef={};_0x5862ef[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x32')][_0x9be9('0x33')]);_0x489f39[_0x9be9('0x3a')]=_[_0x9be9('0x38')](_0x5862ef[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x156637[_0x9be9('0x35')]['fields']));_0x489f39[_0x9be9('0x3a')]=_0x489f39['attributes'][_0x9be9('0x3b')]?_0x489f39[_0x9be9('0x3a')]:_0x5862ef['model'];if(_0x156637[_0x9be9('0x35')][_0x9be9('0x48')]){_0x489f39[_0x9be9('0x49')]=[{'all':!![]}];}_0x489f39=_['merge']({},_0x489f39,_0x156637[_0x9be9('0x47')]);return db[_0x9be9('0x32')][_0x9be9('0x4e')](_0x489f39)[_0x9be9('0x28')](handleEntityNotFound(_0x4dd1d0,null))[_0x9be9('0x28')](function(_0x1b9d96){if(_0x1b9d96){var _0x2e025f=_0x1b9d96['get']({'plain':!![]});_0x2e025f=qs[_0x9be9('0x58')](_0x2e025f,['id',_0x9be9('0x59'),_0x9be9('0x5a')]);_0x156637[_0x9be9('0x50')]=_[_0x9be9('0x58')](_0x156637[_0x9be9('0x50')],['id',_0x9be9('0x59'),_0x9be9('0x5a')]);return db[_0x9be9('0x32')][_0x9be9('0x4f')](_[_0x9be9('0x44')](_0x2e025f,_0x156637['body']),{'include':_0x156637[_0x9be9('0x35')][_0x9be9('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x4bc3f0){var _0x2d0f36=_0x156637[_0x9be9('0x53')][_0x9be9('0x29')]({'plain':!![]});if(!_0x2d0f36)throw new Error(_0x9be9('0x51'));if(_0x2d0f36[_0x9be9('0x52')]==='user'){var _0x4dcf4d=_0x4bc3f0[_0x9be9('0x29')]({'plain':!![]});var _0x3bf990=_0x9be9('0x2a');return db[_0x9be9('0x5b')][_0x9be9('0x4e')]({'where':{'name':_0x3bf990,'userProfileId':_0x2d0f36[_0x9be9('0x54')]},'raw':!![]})[_0x9be9('0x28')](function(_0x11d7e9){if(_0x11d7e9&&_0x11d7e9['autoAssociation']===0x0){return db[_0x9be9('0x2b')][_0x9be9('0x4f')]({'name':_0x4dcf4d[_0x9be9('0x2e')],'resourceId':_0x4dcf4d['id'],'type':_0x11d7e9[_0x9be9('0x2e')],'sectionId':_0x11d7e9['id']},{})['then'](function(){return _0x4bc3f0;});}else{return _0x4bc3f0;}})[_0x9be9('0x4a')](function(_0x32d4ba){logger[_0x9be9('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32d4ba);throw _0x32d4ba;});}return _0x4bc3f0;});}})[_0x9be9('0x28')](respondWithResult(_0x4dd1d0,0xc9))[_0x9be9('0x4a')](handleError(_0x4dd1d0,null));};exports['update']=function(_0xcb0a1c,_0x5e961f){if(_0xcb0a1c['body']['id']){delete _0xcb0a1c[_0x9be9('0x50')]['id'];}return db['Campaign']['find']({'where':{'id':_0xcb0a1c[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x5e961f,null))[_0x9be9('0x28')](saveUpdates(_0xcb0a1c[_0x9be9('0x50')],null))[_0x9be9('0x28')](respondWithResult(_0x5e961f,null))[_0x9be9('0x4a')](handleError(_0x5e961f,null));};exports['destroy']=function(_0x37e5f9,_0xb101cc){return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x37e5f9[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb101cc,null))[_0x9be9('0x28')](removeEntity(_0xb101cc,null))[_0x9be9('0x4a')](handleError(_0xb101cc,null));};exports[_0x9be9('0x5c')]=function(_0x4dd055,_0x502d7b,_0x1f0623){var _0x179c64={'raw':!![],'where':{}};var _0x2425e0={};var _0x36a097={'count':0x0,'rows':[]};return db[_0x9be9('0x32')]['findOne']({'where':{'id':_0x4dd055[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x502d7b,null))[_0x9be9('0x28')](function(_0x133801){if(_0x133801){_0x2425e0['model']=_[_0x9be9('0x36')](db[_0x9be9('0x5d')][_0x9be9('0x33')]);_0x2425e0['query']=_[_0x9be9('0x36')](_0x4dd055[_0x9be9('0x35')]);_0x2425e0[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x2425e0[_0x9be9('0x39')],_0x2425e0[_0x9be9('0x35')]);_0x179c64['attributes']=_['intersection'](_0x2425e0[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x4dd055[_0x9be9('0x35')]['fields']));_0x179c64['attributes']=_0x179c64[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x179c64[_0x9be9('0x3a')]:_0x2425e0[_0x9be9('0x39')];if(!_0x4dd055[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x179c64[_0x9be9('0x3e')]=qs['limit'](_0x4dd055['query'][_0x9be9('0x3e')]);_0x179c64[_0x9be9('0x1f')]=qs['offset'](_0x4dd055[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x179c64[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x4dd055[_0x9be9('0x35')][_0x9be9('0x40')]);_0x179c64[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x4dd055['query'],_0x2425e0[_0x9be9('0x37')]));_0x179c64['where']['CampaignId']=_0x133801['id'];if(_0x4dd055[_0x9be9('0x35')]['filter']){_0x179c64['where']=_[_0x9be9('0x44')](_0x179c64['where'],{'$or':_[_0x9be9('0x31')](_0x179c64[_0x9be9('0x3a')],function(_0x230c0b){var _0x5a617a={};_0x5a617a[_0x230c0b]={'$like':'%'+_0x4dd055['query']['filter']+'%'};return _0x5a617a;})});}_0x179c64=_[_0x9be9('0x44')]({},_0x179c64,_0x4dd055[_0x9be9('0x47')]);return db[_0x9be9('0x5d')][_0x9be9('0x21')]({'where':_0x179c64[_0x9be9('0x41')]})['then'](function(_0x2f0478){_0x36a097[_0x9be9('0x21')]=_0x2f0478;if(_0x4dd055[_0x9be9('0x35')][_0x9be9('0x48')]){_0x179c64[_0x9be9('0x49')]=[{'all':!![]}];}return db[_0x9be9('0x5d')][_0x9be9('0x5e')](_0x179c64);})['then'](function(_0x3f3684){_0x36a097[_0x9be9('0x5f')]=_0x3f3684;return _0x36a097;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x502d7b,_0x179c64))[_0x9be9('0x4a')](handleError(_0x502d7b,null));};exports['getHopperHistories']=function(_0x385c5d,_0x314816,_0x4ce25a){var _0x3a21eb={'raw':!![],'where':{}};var _0x348ecc={};var _0x5b9c66={'count':0x0,'rows':[]};return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x385c5d['params']['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x314816,null))[_0x9be9('0x28')](function(_0x2e97c9){if(_0x2e97c9){_0x348ecc[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x61')][_0x9be9('0x33')]);_0x348ecc[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x385c5d[_0x9be9('0x35')]);_0x348ecc['filters']=_[_0x9be9('0x38')](_0x348ecc[_0x9be9('0x39')],_0x348ecc[_0x9be9('0x35')]);_0x3a21eb['attributes']=_[_0x9be9('0x38')](_0x348ecc[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x385c5d['query'][_0x9be9('0x4d')]));_0x3a21eb[_0x9be9('0x3a')]=_0x3a21eb[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x3a21eb[_0x9be9('0x3a')]:_0x348ecc['model'];if(!_0x385c5d['query']['hasOwnProperty'](_0x9be9('0x3d'))){_0x3a21eb['limit']=qs[_0x9be9('0x3e')](_0x385c5d['query'][_0x9be9('0x3e')]);_0x3a21eb['offset']=qs['offset'](_0x385c5d[_0x9be9('0x35')]['offset']);}_0x3a21eb[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x385c5d[_0x9be9('0x35')][_0x9be9('0x40')]);_0x3a21eb['where']=qs['filters'](_['pick'](_0x385c5d[_0x9be9('0x35')],_0x348ecc[_0x9be9('0x37')]));_0x3a21eb[_0x9be9('0x41')][_0x9be9('0x62')]=_0x2e97c9['id'];if(_0x385c5d[_0x9be9('0x35')][_0x9be9('0x43')]){_0x3a21eb[_0x9be9('0x41')]=_['merge'](_0x3a21eb[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x3a21eb[_0x9be9('0x3a')],function(_0x52e019){var _0xbb5e51={};_0xbb5e51[_0x52e019]={'$like':'%'+_0x385c5d['query']['filter']+'%'};return _0xbb5e51;})});}_0x3a21eb=_[_0x9be9('0x44')]({},_0x3a21eb,_0x385c5d[_0x9be9('0x47')]);return db[_0x9be9('0x61')][_0x9be9('0x21')]({'where':_0x3a21eb[_0x9be9('0x41')]})[_0x9be9('0x28')](function(_0x1d6019){_0x5b9c66[_0x9be9('0x21')]=_0x1d6019;if(_0x385c5d[_0x9be9('0x35')]['includeAll']){_0x3a21eb['include']=[{'all':!![]}];}return db[_0x9be9('0x61')][_0x9be9('0x5e')](_0x3a21eb);})[_0x9be9('0x28')](function(_0x5464df){_0x5b9c66['rows']=_0x5464df;return _0x5b9c66;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x314816,_0x3a21eb))[_0x9be9('0x4a')](handleError(_0x314816,null));};exports['getHopperFinals']=function(_0x2b6511,_0x11a231,_0x3e3352){var _0x44b2d5={'raw':!![],'where':{}};var _0x18c40b={};var _0x1054aa={'count':0x0,'rows':[]};return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x2b6511['params']['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x11a231,null))[_0x9be9('0x28')](function(_0x1722ff){if(_0x1722ff){_0x18c40b[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x63')][_0x9be9('0x33')]);_0x18c40b['query']=_[_0x9be9('0x36')](_0x2b6511[_0x9be9('0x35')]);_0x18c40b[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x18c40b[_0x9be9('0x39')],_0x18c40b[_0x9be9('0x35')]);_0x44b2d5[_0x9be9('0x3a')]=_[_0x9be9('0x38')](_0x18c40b['model'],qs[_0x9be9('0x4d')](_0x2b6511['query'][_0x9be9('0x4d')]));_0x44b2d5[_0x9be9('0x3a')]=_0x44b2d5[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x44b2d5[_0x9be9('0x3a')]:_0x18c40b[_0x9be9('0x39')];if(!_0x2b6511[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x44b2d5[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x2b6511[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x44b2d5[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x2b6511[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x44b2d5[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x2b6511['query']['sort']);_0x44b2d5[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x2b6511[_0x9be9('0x35')],_0x18c40b[_0x9be9('0x37')]));_0x44b2d5[_0x9be9('0x41')][_0x9be9('0x62')]=_0x1722ff['id'];if(_0x2b6511[_0x9be9('0x35')][_0x9be9('0x43')]){_0x44b2d5[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x44b2d5[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x44b2d5[_0x9be9('0x3a')],function(_0x5576f7){var _0x414357={};_0x414357[_0x5576f7]={'$like':'%'+_0x2b6511[_0x9be9('0x35')]['filter']+'%'};return _0x414357;})});}_0x44b2d5=_['merge']({},_0x44b2d5,_0x2b6511['options']);return db[_0x9be9('0x63')][_0x9be9('0x21')]({'where':_0x44b2d5[_0x9be9('0x41')]})[_0x9be9('0x28')](function(_0x46abb4){_0x1054aa[_0x9be9('0x21')]=_0x46abb4;if(_0x2b6511[_0x9be9('0x35')]['includeAll']){_0x44b2d5[_0x9be9('0x49')]=[{'all':!![]}];}return db[_0x9be9('0x63')][_0x9be9('0x5e')](_0x44b2d5);})[_0x9be9('0x28')](function(_0x56ea74){_0x1054aa[_0x9be9('0x5f')]=_0x56ea74;return _0x1054aa;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x11a231,_0x44b2d5))['catch'](handleError(_0x11a231,null));};exports[_0x9be9('0x64')]=function(_0x5be199,_0x3e6908,_0x172351){var _0x3e3fab={'raw':!![],'where':{}};var _0x536259={};var _0x2e24c7={'count':0x0,'rows':[]};return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x5be199[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x3e6908,null))[_0x9be9('0x28')](function(_0x55c9e9){if(_0x55c9e9){_0x536259[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x65')][_0x9be9('0x33')]);_0x536259[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x5be199[_0x9be9('0x35')]);_0x536259[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x536259[_0x9be9('0x39')],_0x536259[_0x9be9('0x35')]);_0x3e3fab[_0x9be9('0x3a')]=_[_0x9be9('0x38')](_0x536259[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x5be199['query'][_0x9be9('0x4d')]));_0x3e3fab[_0x9be9('0x3a')]=_0x3e3fab[_0x9be9('0x3a')]['length']?_0x3e3fab[_0x9be9('0x3a')]:_0x536259[_0x9be9('0x39')];if(!_0x5be199['query']['hasOwnProperty'](_0x9be9('0x3d'))){_0x3e3fab[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x5be199['query'][_0x9be9('0x3e')]);_0x3e3fab['offset']=qs[_0x9be9('0x1f')](_0x5be199[_0x9be9('0x35')]['offset']);}_0x3e3fab[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x5be199[_0x9be9('0x35')][_0x9be9('0x40')]);_0x3e3fab[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x5be199[_0x9be9('0x35')],_0x536259[_0x9be9('0x37')]));_0x3e3fab[_0x9be9('0x41')][_0x9be9('0x62')]=_0x55c9e9['id'];if(_0x5be199[_0x9be9('0x35')]['filter']){_0x3e3fab[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x3e3fab[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x3e3fab[_0x9be9('0x3a')],function(_0x366d2d){var _0x1a01dc={};_0x1a01dc[_0x366d2d]={'$like':'%'+_0x5be199[_0x9be9('0x35')]['filter']+'%'};return _0x1a01dc;})});}_0x3e3fab=_['merge']({},_0x3e3fab,_0x5be199[_0x9be9('0x47')]);return db[_0x9be9('0x65')][_0x9be9('0x21')]({'where':_0x3e3fab[_0x9be9('0x41')]})[_0x9be9('0x28')](function(_0x3c2dd6){_0x2e24c7[_0x9be9('0x21')]=_0x3c2dd6;if(_0x5be199[_0x9be9('0x35')]['includeAll']){_0x3e3fab['include']=[{'all':!![]}];}return db[_0x9be9('0x65')][_0x9be9('0x5e')](_0x3e3fab);})[_0x9be9('0x28')](function(_0x2300ed){_0x2e24c7[_0x9be9('0x5f')]=_0x2300ed;return _0x2e24c7;});}})[_0x9be9('0x28')](respondWithFilteredResult(_0x3e6908,_0x3e3fab))['catch'](handleError(_0x3e6908,null));};exports[_0x9be9('0x66')]=function(_0x244992,_0x4a4aa9,_0x24e468){var _0x1cbb84={};var _0xbdd102={};var _0x11f44d;var _0x5f5263;return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x244992[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a4aa9,null))[_0x9be9('0x28')](function(_0x538e7e){if(_0x538e7e){_0x11f44d=_0x538e7e;_0xbdd102[_0x9be9('0x39')]=_[_0x9be9('0x36')](db[_0x9be9('0x67')][_0x9be9('0x33')]);_0xbdd102[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x244992['query']);_0xbdd102[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0xbdd102[_0x9be9('0x39')],_0xbdd102[_0x9be9('0x35')]);_0x1cbb84[_0x9be9('0x3a')]=_['intersection'](_0xbdd102[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x244992[_0x9be9('0x35')][_0x9be9('0x4d')]));_0x1cbb84[_0x9be9('0x3a')]=_0x1cbb84[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x1cbb84[_0x9be9('0x3a')]:_0xbdd102[_0x9be9('0x39')];_0x1cbb84[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x244992[_0x9be9('0x35')][_0x9be9('0x40')]);_0x1cbb84[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x244992[_0x9be9('0x35')],_0xbdd102['filters']));if(_0x244992[_0x9be9('0x35')]['filter']){_0x1cbb84[_0x9be9('0x41')]=_['merge'](_0x1cbb84['where'],{'$or':_[_0x9be9('0x31')](_0x1cbb84['attributes'],function(_0x34a538){var _0x5023ff={};_0x5023ff[_0x34a538]={'$like':'%'+_0x244992[_0x9be9('0x35')]['filter']+'%'};return _0x5023ff;})});}_0x1cbb84=_[_0x9be9('0x44')]({},_0x1cbb84,_0x244992[_0x9be9('0x47')]);return _0x11f44d['getLists'](_0x1cbb84);}})[_0x9be9('0x28')](function(_0x5b06a2){if(_0x5b06a2){_0x5f5263=_0x5b06a2[_0x9be9('0x3b')];if(!_0x244992['query'][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x1cbb84[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x244992[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x1cbb84[_0x9be9('0x1f')]=qs['offset'](_0x244992['query'][_0x9be9('0x1f')]);}return _0x11f44d[_0x9be9('0x66')](_0x1cbb84);}})[_0x9be9('0x28')](function(_0x22cb72){if(_0x22cb72){return _0x22cb72?{'count':_0x5f5263,'rows':_0x22cb72}:null;}})['then'](respondWithResult(_0x4a4aa9,null))['catch'](handleError(_0x4a4aa9,null));};exports[_0x9be9('0x68')]=function(_0x38ffff,_0x19c4d0,_0x5cb511){var _0x146977,_0x42bd13;var _0x4a6162=[];var _0x485f2a=moment()[_0x9be9('0x69')](_0x9be9('0x6a'));return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x38ffff[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x19c4d0,null))[_0x9be9('0x28')](function(_0xa37285){if(_0xa37285){_0x42bd13=_0xa37285;return _0xa37285[_0x9be9('0x68')](_0x38ffff[_0x9be9('0x50')][_0x9be9('0x6b')],_[_0x9be9('0x58')](_0x38ffff[_0x9be9('0x50')],[_0x9be9('0x6b'),'id'])||{});}return null;})[_0x9be9('0x6c')](function(_0x4a1b0a){var _0x1189ad;var _0x421383;_0x146977=_0x4a1b0a||[];var _0x399015=[];if(_0x4a1b0a){for(var _0x184724=0x0;_0x184724<_0x4a1b0a[_0x9be9('0x3b')];_0x184724+=0x1){var _0x23f523=_0x4a1b0a[_0x184724][_0x9be9('0x29')]({'plain':!![]});_0x42bd13[_0x9be9('0x6d')]=_0x38ffff['body'][_0x9be9('0x6d')]?_0x38ffff[_0x9be9('0x50')][_0x9be9('0x6d')]:_0x42bd13['dialCheckDuplicateType'];switch(_0x42bd13[_0x9be9('0x6d')]){case'always':_0x1189ad=squel['insert']()[_0x9be9('0x6e')]('cm_hopper')['fromQuery'](['phone',_0x9be9('0x6f'),'ContactId','ListId','CampaignId',_0x9be9('0x59'),_0x9be9('0x5a')],squel[_0x9be9('0x70')]()[_0x9be9('0x71')](_0x9be9('0x72'),_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x73'),'scheduledAt')[_0x9be9('0x71')]('id',_0x9be9('0x74'))[_0x9be9('0x71')](_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')](),_0x9be9('0x77'))['field'](_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x5a'))[_0x9be9('0x78')]('cm_contacts')[_0x9be9('0x41')](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')]())[_0x9be9('0x41')](_0x9be9('0x7b'))['where'](_0x9be9('0x7c'),squel['select']()[_0x9be9('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x9be9('0x78')]('cm_hopper_final')[_0x9be9('0x41')]('CampaignId\x20=\x20?',_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')]()))[_0x9be9('0x41')](_0x9be9('0x7c'),squel['select']()[_0x9be9('0x71')](_0x9be9('0x7d'))['from'](_0x9be9('0x7e'))[_0x9be9('0x41')]('CampaignId\x20=\x20?',_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')]())))[_0x9be9('0x76')]();break;case _0x9be9('0x7f'):_0x1189ad=squel['insert']()[_0x9be9('0x6e')](_0x9be9('0x7e'))['fromQuery']([_0x9be9('0x72'),'scheduledAt','ContactId',_0x9be9('0x77'),_0x9be9('0x62'),_0x9be9('0x59'),_0x9be9('0x5a')],squel['select']()['field'](_0x9be9('0x72'),_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x73'),'scheduledAt')[_0x9be9('0x71')]('id','ContactId')[_0x9be9('0x71')](_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')](),_0x9be9('0x77'))[_0x9be9('0x71')](_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x5a'))[_0x9be9('0x78')](_0x9be9('0x80'))['where'](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')]())['where'](_0x9be9('0x7b'))[_0x9be9('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9be9('0x70')]()[_0x9be9('0x71')]('COALESCE(phone,\x27\x27)')['from'](_0x9be9('0x7e'))[_0x9be9('0x41')]('CampaignId\x20=\x20?',_0x38ffff[_0x9be9('0x4c')]['id']['toString']())))[_0x9be9('0x76')]();break;default:_0x1189ad=squel[_0x9be9('0x81')]()[_0x9be9('0x6e')]('cm_hopper')[_0x9be9('0x82')]([_0x9be9('0x72'),_0x9be9('0x6f'),_0x9be9('0x74'),_0x9be9('0x77'),_0x9be9('0x62'),_0x9be9('0x59'),_0x9be9('0x5a')],squel[_0x9be9('0x70')]()[_0x9be9('0x71')]('phone',_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x73'),_0x9be9('0x6f'))[_0x9be9('0x71')]('id',_0x9be9('0x74'))['field'](_0x23f523[_0x9be9('0x75')]['toString'](),'ListId')[_0x9be9('0x71')](_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))['field']('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27','updatedAt')[_0x9be9('0x78')]('cm_contacts')[_0x9be9('0x41')](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x23f523[_0x9be9('0x75')][_0x9be9('0x76')]())[_0x9be9('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x9be9('0x76')]();}_0x421383=squel[_0x9be9('0x81')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x9be9('0x83'),_0x9be9('0x6f'),'phone',_0x9be9('0x84'),_0x9be9('0x59'),_0x9be9('0x5a')],squel['select']()[_0x9be9('0x71')](_0x9be9('0x85'),'id')['field']('NOW()',_0x9be9('0x6f'))['field']('ci.item',_0x9be9('0x72'))[_0x9be9('0x71')](_0x9be9('0x86'),_0x9be9('0x84'))[_0x9be9('0x71')]('\x27'+_0x485f2a+'\x27',_0x9be9('0x59'))['field']('\x27'+_0x485f2a+'\x27',_0x9be9('0x5a'))[_0x9be9('0x78')](_0x9be9('0x87'),'ci')[_0x9be9('0x88')](_0x9be9('0x7e'),'h',_0x9be9('0x89'))[_0x9be9('0x41')](_0x9be9('0x8a'),_0x23f523['CmListId'][_0x9be9('0x76')]())[_0x9be9('0x41')](_0x9be9('0x8b'),_0x38ffff[_0x9be9('0x4c')]['id'][_0x9be9('0x76')]())[_0x9be9('0x41')]('h.createdAt\x20=\x20?',_0x485f2a))[_0x9be9('0x76')]();_0x399015['push'](db['sequelize'][_0x9be9('0x35')](_0x1189ad));_0x4a6162[_0x9be9('0x8c')](db[_0x9be9('0x8d')][_0x9be9('0x35')](_0x421383));}return BPromise[_0x9be9('0x8e')](_0x399015);}})[_0x9be9('0x28')](function(){return BPromise[_0x9be9('0x8e')](_0x4a6162);})[_0x9be9('0x28')](function(){return _0x146977;})[_0x9be9('0x28')](respondWithResult(_0x19c4d0,null))[_0x9be9('0x4a')](handleError(_0x19c4d0,null));};exports[_0x9be9('0x8f')]=function(_0x2e2cdf,_0x37b5fa,_0x233e0b){return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x2e2cdf[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37b5fa,null))[_0x9be9('0x28')](function(_0x4e624b){if(_0x4e624b){return _0x4e624b[_0x9be9('0x8f')](_0x2e2cdf['query'][_0x9be9('0x6b')]);}})[_0x9be9('0x28')](function(_0x34a5e2){if(_0x34a5e2){return db[_0x9be9('0x5d')]['destroy']({'where':{'ListId':_0x2e2cdf['query'][_0x9be9('0x6b')],'CampaignId':_0x2e2cdf[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](function(){return _0x34a5e2;});}})[_0x9be9('0x28')](respondWithStatusCode(_0x37b5fa,null))[_0x9be9('0x4a')](handleError(_0x37b5fa,null));};exports[_0x9be9('0x90')]=function(_0x945e1a,_0x25a5bc,_0x49d1ee){var _0x4c0d0e={};var _0x3e9851={};var _0x1b3bd4;var _0x3855a0;return db[_0x9be9('0x32')][_0x9be9('0x60')]({'where':{'id':_0x945e1a[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25a5bc,null))[_0x9be9('0x28')](function(_0x15cf5e){if(_0x15cf5e){_0x1b3bd4=_0x15cf5e;_0x3e9851[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x67')]['rawAttributes']);_0x3e9851['query']=_[_0x9be9('0x36')](_0x945e1a[_0x9be9('0x35')]);_0x3e9851['filters']=_['intersection'](_0x3e9851[_0x9be9('0x39')],_0x3e9851['query']);_0x4c0d0e['attributes']=_[_0x9be9('0x38')](_0x3e9851[_0x9be9('0x39')],qs[_0x9be9('0x4d')](_0x945e1a['query'][_0x9be9('0x4d')]));_0x4c0d0e['attributes']=_0x4c0d0e[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x4c0d0e['attributes']:_0x3e9851['model'];_0x4c0d0e[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x945e1a[_0x9be9('0x35')][_0x9be9('0x40')]);_0x4c0d0e[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_['pick'](_0x945e1a[_0x9be9('0x35')],_0x3e9851[_0x9be9('0x37')]));if(_0x945e1a[_0x9be9('0x35')][_0x9be9('0x43')]){_0x4c0d0e[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x4c0d0e[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x4c0d0e[_0x9be9('0x3a')],function(_0x2c54b2){var _0x580312={};_0x580312[_0x2c54b2]={'$like':'%'+_0x945e1a['query'][_0x9be9('0x43')]+'%'};return _0x580312;})});}_0x4c0d0e=_[_0x9be9('0x44')]({},_0x4c0d0e,_0x945e1a[_0x9be9('0x47')]);return _0x1b3bd4['getBlackLists'](_0x4c0d0e);}})['then'](function(_0x5b643b){if(_0x5b643b){_0x3855a0=_0x5b643b[_0x9be9('0x3b')];if(!_0x945e1a[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x4c0d0e[_0x9be9('0x3e')]=qs[_0x9be9('0x3e')](_0x945e1a[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x4c0d0e[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x945e1a[_0x9be9('0x35')][_0x9be9('0x1f')]);}return _0x1b3bd4[_0x9be9('0x90')](_0x4c0d0e);}})[_0x9be9('0x28')](function(_0x412b53){if(_0x412b53){return _0x412b53?{'count':_0x3855a0,'rows':_0x412b53}:null;}})[_0x9be9('0x28')](respondWithResult(_0x25a5bc,null))[_0x9be9('0x4a')](handleError(_0x25a5bc,null));};exports[_0x9be9('0x91')]=function(_0x1d2e3e,_0x639d41,_0x299ffc){var _0x308eca,_0x4fe7e5;var _0x49be00=[];var _0x58fc7d=moment()['format'](_0x9be9('0x6a'));return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x1d2e3e[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x639d41,null))[_0x9be9('0x28')](function(_0x2db33b){if(_0x2db33b){_0x4fe7e5=_0x2db33b;return _0x2db33b['addBlackLists'](_0x1d2e3e[_0x9be9('0x50')][_0x9be9('0x6b')],_[_0x9be9('0x58')](_0x1d2e3e[_0x9be9('0x50')],['ids','id'])||{});}return null;})['spread'](function(_0x3c1cfa){var _0x81087f;var _0xb6b1f9;_0x308eca=_0x3c1cfa||[];var _0x3684fd=[];if(_0x3c1cfa){for(var _0x4a2f1e=0x0;_0x4a2f1e<_0x3c1cfa['length'];_0x4a2f1e+=0x1){var _0x756c25=_0x3c1cfa[_0x4a2f1e][_0x9be9('0x29')]({'plain':!![]});_0x81087f=squel[_0x9be9('0x81')]()[_0x9be9('0x6e')]('cm_hopper_black')['fromQuery']([_0x9be9('0x72'),'ContactId',_0x9be9('0x77'),'CampaignId','createdAt','updatedAt'],squel[_0x9be9('0x70')]()[_0x9be9('0x71')]('phone','phone')['field']('id',_0x9be9('0x74'))['field'](_0x756c25[_0x9be9('0x75')]['toString'](),_0x9be9('0x77'))[_0x9be9('0x71')](_0x1d2e3e[_0x9be9('0x4c')]['id'][_0x9be9('0x76')](),_0x9be9('0x62'))[_0x9be9('0x71')](_0x9be9('0x73'),_0x9be9('0x59'))[_0x9be9('0x71')](_0x9be9('0x73'),_0x9be9('0x5a'))[_0x9be9('0x78')]('cm_contacts')[_0x9be9('0x41')](_0x9be9('0x79'))[_0x9be9('0x41')](_0x9be9('0x7a'),_0x756c25[_0x9be9('0x75')][_0x9be9('0x76')]())[_0x9be9('0x41')](_0x9be9('0x7b')))[_0x9be9('0x76')]();_0x3684fd[_0x9be9('0x8c')](db[_0x9be9('0x8d')][_0x9be9('0x35')](_0x81087f));}return BPromise[_0x9be9('0x8e')](_0x3684fd);}})[_0x9be9('0x28')](function(){return _0x308eca;})['then'](respondWithResult(_0x639d41,null))[_0x9be9('0x4a')](handleError(_0x639d41,null));};exports['removeBlackLists']=function(_0x3f32fd,_0x40ec04,_0x30965b){return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x3f32fd[_0x9be9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x40ec04,null))[_0x9be9('0x28')](function(_0x185b20){if(_0x185b20){return _0x185b20[_0x9be9('0x92')](_0x3f32fd[_0x9be9('0x35')][_0x9be9('0x6b')]);}})[_0x9be9('0x28')](function(_0x199e54){if(_0x199e54){return db[_0x9be9('0x65')]['destroy']({'where':{'ListId':_0x3f32fd['query'][_0x9be9('0x6b')],'CampaignId':_0x3f32fd[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](function(){return _0x199e54;});}})[_0x9be9('0x28')](respondWithStatusCode(_0x40ec04,null))['catch'](handleError(_0x40ec04,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index b2b80fd..47e5806 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4f51cb,_0x3d7bd4){var _0x4b34b1=function(_0x1bab33){while(--_0x1bab33){_0x4f51cb['push'](_0x4f51cb['shift']());}};_0x4b34b1(++_0x3d7bd4);}(_0x7a54,0x106));var _0x47a5=function(_0x1b4a7b,_0x42cf67){_0x1b4a7b=_0x1b4a7b-0x0;var _0x4478aa=_0x7a54[_0x1b4a7b];return _0x4478aa;};'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 b67475e..b9b4f37 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 _0xdecb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','findAll','options','raw','where','include','map','attributes','model','stringify','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x530129,_0x5cf11f){var _0x408ac5=function(_0x27715e){while(--_0x27715e){_0x530129['push'](_0x530129['shift']());}};_0x408ac5(++_0x5cf11f);}(_0xdecb,0xe2));var _0xbdec=function(_0x5b78f4,_0x4a20e0){_0x5b78f4=_0x5b78f4-0x0;var _0x32bcab=_0xdecb[_0x5b78f4];return _0x32bcab;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var moment=require(_0xbdec('0x1'));var BPromise=require(_0xbdec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdec('0x4'));var logger=require(_0xbdec('0x5'))(_0xbdec('0x6'));var config=require(_0xbdec('0x7'));var jayson=require(_0xbdec('0x8'));var client=jayson[_0xbdec('0x9')][_0xbdec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x532f8e,_0x32d039,_0x22f7d4){return new BPromise(function(_0x2e8942,_0x298770){return client[_0xbdec('0xb')](_0x532f8e,_0x22f7d4)[_0xbdec('0xc')](function(_0x2333f6){logger[_0xbdec('0xd')]('Campaign,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));logger[_0xbdec('0xf')](_0xbdec('0x10'),_0x32d039,_0xbdec('0xe'),JSON['stringify'](_0x2333f6));if(_0x2333f6[_0xbdec('0x11')]){if(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x12')]===0x1f4){logger['error'](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x298770(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x2e8942(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}else{logger[_0xbdec('0xd')]('Campaign,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));_0x2e8942(_0x2333f6[_0xbdec('0x15')][_0xbdec('0x14')]);}})[_0xbdec('0x16')](function(_0x324378){logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x324378);_0x298770(_0x324378);});});}exports[_0xbdec('0x17')]=function(_0x2b9288){var _0x4f7879=this;return new Promise(function(_0x1206b8,_0x5da657){return db['Campaign'][_0xbdec('0x18')]({'raw':_0x2b9288[_0xbdec('0x19')]?_0x2b9288[_0xbdec('0x19')][_0xbdec('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b9288[_0xbdec('0x19')]?_0x2b9288['options'][_0xbdec('0x1b')]||null:null,'attributes':_0x2b9288['options']?_0x2b9288[_0xbdec('0x19')]['attributes']||null:null,'limit':_0x2b9288['options']?_0x2b9288[_0xbdec('0x19')]['limit']||null:null,'include':_0x2b9288[_0xbdec('0x19')]?_0x2b9288['options'][_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x2b9288[_0xbdec('0x19')][_0xbdec('0x1c')],function(_0x1a93e1){return{'model':db[_0x1a93e1['model']],'as':_0x1a93e1['as'],'attributes':_0x1a93e1[_0xbdec('0x1e')],'include':_0x1a93e1[_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x1a93e1[_0xbdec('0x1c')],function(_0x45eb56){return{'model':db[_0x45eb56[_0xbdec('0x1f')]],'as':_0x45eb56['as'],'attributes':_0x45eb56[_0xbdec('0x1e')],'include':_0x45eb56[_0xbdec('0x1c')]?_[_0xbdec('0x1d')](_0x45eb56['include'],function(_0x5aae12){return{'model':db[_0x5aae12['model']],'as':_0x5aae12['as'],'attributes':_0x5aae12['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdec('0xc')](function(_0x3b67bc){logger[_0xbdec('0xd')](_0xbdec('0x17'),_0x2b9288);logger[_0xbdec('0xf')]('GetCampaign',_0x2b9288,JSON[_0xbdec('0x20')](_0x3b67bc));_0x1206b8(_0x3b67bc);})[_0xbdec('0x16')](function(_0x11c971){logger[_0xbdec('0x11')]('GetCampaign',_0x11c971[_0xbdec('0x14')],_0x2b9288);_0x5da657(_0x4f7879[_0xbdec('0x11')](0x1f4,_0x11c971[_0xbdec('0x14')]));});});};
\ No newline at end of file
+var _0xb7fc=['include','map','model','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','findAll','options','attributes','limit'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x14eba8,_0x1b1b10){_0x14eba8=_0x14eba8-0x0;var _0x4ca2c5=_0xb7fc[_0x14eba8];return _0x4ca2c5;};'use strict';var _=require(_0xcb7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb7f('0x1'));var rs=require(_0xcb7f('0x2'));var fs=require('fs');var Redis=require(_0xcb7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb7f('0x4'))(_0xcb7f('0x5'));var config=require(_0xcb7f('0x6'));var jayson=require(_0xcb7f('0x7'));var client=jayson[_0xcb7f('0x8')][_0xcb7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5059ca,_0x226ba8,_0x31de8e){return new BPromise(function(_0x1f8ba3,_0x4dde1f){return client[_0xcb7f('0xa')](_0x5059ca,_0x31de8e)[_0xcb7f('0xb')](function(_0x4d8d72){logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,'request\x20sent');logger[_0xcb7f('0xe')](_0xcb7f('0xf'),_0x226ba8,_0xcb7f('0x10'),JSON[_0xcb7f('0x11')](_0x4d8d72));if(_0x4d8d72[_0xcb7f('0x12')]){if(_0x4d8d72['error']['code']===0x1f4){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x4dde1f(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x1f8ba3(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}else{logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,_0xcb7f('0x10'));_0x1f8ba3(_0x4d8d72[_0xcb7f('0x14')][_0xcb7f('0x13')]);}})[_0xcb7f('0x15')](function(_0x2c2799){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x2c2799);_0x4dde1f(_0x2c2799);});});}exports[_0xcb7f('0x16')]=function(_0x5d43b6){var _0x2430b3=this;return new Promise(function(_0x1d1d4c,_0x57274b){return db['Campaign'][_0xcb7f('0x17')]({'raw':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5d43b6['options']?_0x5d43b6[_0xcb7f('0x18')]['where']||null:null,'attributes':_0x5d43b6['options']?_0x5d43b6['options'][_0xcb7f('0x19')]||null:null,'limit':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6['options'][_0xcb7f('0x1a')]||null:null,'include':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')][_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x5d43b6[_0xcb7f('0x18')]['include'],function(_0x588a4b){return{'model':db[_0x588a4b[_0xcb7f('0x1d')]],'as':_0x588a4b['as'],'attributes':_0x588a4b[_0xcb7f('0x19')],'include':_0x588a4b[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x588a4b[_0xcb7f('0x1b')],function(_0x2a1a8c){return{'model':db[_0x2a1a8c['model']],'as':_0x2a1a8c['as'],'attributes':_0x2a1a8c[_0xcb7f('0x19')],'include':_0x2a1a8c[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x2a1a8c['include'],function(_0x30ecb7){return{'model':db[_0x30ecb7[_0xcb7f('0x1d')]],'as':_0x30ecb7['as'],'attributes':_0x30ecb7[_0xcb7f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8879a1){logger['info'](_0xcb7f('0x16'),_0x5d43b6);logger['debug'](_0xcb7f('0x16'),_0x5d43b6,JSON[_0xcb7f('0x11')](_0x8879a1));_0x1d1d4c(_0x8879a1);})['catch'](function(_0x597a82){logger['error'](_0xcb7f('0x16'),_0x597a82[_0xcb7f('0x13')],_0x5d43b6);_0x57274b(_0x2430b3['error'](0x1f4,_0x597a82[_0xcb7f('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index d097fc1..74acadc 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 _0xe239=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','create','/:id/clone','post','addBlackLists','put','update','delete','destroy','removeBlackLists','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','/:id','isAuthenticated','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xe239,0x151));var _0x9e23=function(_0x4c0dd,_0x72eeba){_0x4c0dd=_0x4c0dd-0x0;var _0x1134a9=_0xe239[_0x4c0dd];return _0x1134a9;};'use strict';var multer=require(_0x9e23('0x0'));var util=require(_0x9e23('0x1'));var path=require('path');var timeout=require(_0x9e23('0x2'));var express=require(_0x9e23('0x3'));var router=express[_0x9e23('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e23('0x5'));var interaction=require(_0x9e23('0x6'));var config=require('../../config/environment');var controller=require(_0x9e23('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9e23('0x8'),auth[_0x9e23('0x9')](),controller['show']);router[_0x9e23('0xa')]('/:id/hoppers',auth[_0x9e23('0x9')](),controller[_0x9e23('0xb')]);router['get'](_0x9e23('0xc'),auth['isAuthenticated'](),controller[_0x9e23('0xd')]);router[_0x9e23('0xa')](_0x9e23('0xe'),auth['isAuthenticated'](),controller[_0x9e23('0xf')]);router['get'](_0x9e23('0x10'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x11')]);router['get'](_0x9e23('0x12'),auth[_0x9e23('0x9')](),controller['getLists']);router[_0x9e23('0xa')](_0x9e23('0x13'),auth[_0x9e23('0x9')](),controller['getBlackLists']);router['post']('/',auth[_0x9e23('0x9')](),controller[_0x9e23('0x14')]);router['post'](_0x9e23('0x15'),auth[_0x9e23('0x9')](),controller['clone']);router[_0x9e23('0x16')](_0x9e23('0x12'),auth[_0x9e23('0x9')](),controller['addLists']);router[_0x9e23('0x16')](_0x9e23('0x13'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x17')]);router[_0x9e23('0x18')](_0x9e23('0x8'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x19')]);router[_0x9e23('0x1a')](_0x9e23('0x8'),auth[_0x9e23('0x9')](),controller[_0x9e23('0x1b')]);router[_0x9e23('0x1a')](_0x9e23('0x12'),auth[_0x9e23('0x9')](),controller['removeLists']);router[_0x9e23('0x1a')]('/:id/blacklists',auth[_0x9e23('0x9')](),controller[_0x9e23('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x1da7=['./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x429ce2,_0x387314){var _0x4045bc=function(_0x1b11a4){while(--_0x1b11a4){_0x429ce2['push'](_0x429ce2['shift']());}};_0x4045bc(++_0x387314);}(_0x1da7,0xee));var _0x71da=function(_0x166548,_0x12113b){_0x166548=_0x166548-0x0;var _0x5837ad=_0x1da7[_0x166548];return _0x5837ad;};'use strict';var multer=require('multer');var util=require(_0x71da('0x0'));var path=require('path');var timeout=require(_0x71da('0x1'));var express=require('express');var router=express[_0x71da('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x71da('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x71da('0x4'));var controller=require(_0x71da('0x5'));router[_0x71da('0x6')]('/',auth[_0x71da('0x7')](),controller['index']);router[_0x71da('0x6')](_0x71da('0x8'),auth['isAuthenticated'](),controller[_0x71da('0x9')]);router[_0x71da('0x6')](_0x71da('0xa'),auth[_0x71da('0x7')](),controller['getHoppers']);router['get'](_0x71da('0xb'),auth[_0x71da('0x7')](),controller['getHopperHistories']);router[_0x71da('0x6')]('/:id/hopper_finals',auth[_0x71da('0x7')](),controller['getHopperFinals']);router[_0x71da('0x6')](_0x71da('0xc'),auth['isAuthenticated'](),controller[_0x71da('0xd')]);router[_0x71da('0x6')](_0x71da('0xe'),auth[_0x71da('0x7')](),controller[_0x71da('0xf')]);router[_0x71da('0x6')](_0x71da('0x10'),auth['isAuthenticated'](),controller[_0x71da('0x11')]);router[_0x71da('0x12')]('/',auth[_0x71da('0x7')](),controller['create']);router[_0x71da('0x12')]('/:id/clone',auth[_0x71da('0x7')](),controller['clone']);router[_0x71da('0x12')]('/:id/lists',auth['isAuthenticated'](),controller[_0x71da('0x13')]);router[_0x71da('0x12')]('/:id/blacklists',auth[_0x71da('0x7')](),controller[_0x71da('0x14')]);router[_0x71da('0x15')](_0x71da('0x8'),auth[_0x71da('0x7')](),controller[_0x71da('0x16')]);router[_0x71da('0x17')](_0x71da('0x8'),auth[_0x71da('0x7')](),controller[_0x71da('0x18')]);router['delete'](_0x71da('0xe'),auth[_0x71da('0x7')](),controller[_0x71da('0x19')]);router[_0x71da('0x17')](_0x71da('0x10'),auth[_0x71da('0x7')](),controller[_0x71da('0x1a')]);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 7eac27a..81185e5 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 _0x54aa=['TEXT','VIRTUAL','getDataValue','sequelize','exports','STRING'];(function(_0x49416f,_0x457ccd){var _0x57ee0d=function(_0x416dc0){while(--_0x416dc0){_0x49416f['push'](_0x49416f['shift']());}};_0x57ee0d(++_0x457ccd);}(_0x54aa,0x6f));var _0xa54a=function(_0x4b8c8c,_0x454428){_0x4b8c8c=_0x4b8c8c-0x0;var _0x2035bc=_0x54aa[_0x4b8c8c];return _0x2035bc;};'use strict';var Sequelize=require(_0xa54a('0x0'));module[_0xa54a('0x1')]={'key':{'type':Sequelize[_0xa54a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa54a('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0xa54a('0x2')]},'name':{'type':Sequelize[_0xa54a('0x4')],'get':function(){return this[_0xa54a('0x5')]('key');}}};
\ No newline at end of file
+var _0x937a=['medium','VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0x5c8fa9,_0x26415f){var _0x35ae19=function(_0x42a1a6){while(--_0x42a1a6){_0x5c8fa9['push'](_0x5c8fa9['shift']());}};_0x35ae19(++_0x26415f);}(_0x937a,0x94));var _0xa937=function(_0x4d69a6,_0x44cbe8){_0x4d69a6=_0x4d69a6-0x0;var _0x56739a=_0x937a[_0x4d69a6];return _0x56739a;};'use strict';var Sequelize=require(_0xa937('0x0'));module['exports']={'key':{'type':Sequelize[_0xa937('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xa937('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa937('0x3')],'get':function(){return this[_0xa937('0x4')](_0xa937('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index a5befba..dda11b3 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 _0xaaea=['send','map','CannedAnswer','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','catch','show','params','length','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','error','stack','name'];(function(_0x4d6de2,_0x200506){var _0x1c18a5=function(_0x5e9c01){while(--_0x5e9c01){_0x4d6de2['push'](_0x4d6de2['shift']());}};_0x1c18a5(++_0x200506);}(_0xaaea,0x191));var _0xaaae=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xaaea[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaaae('0x0'));var zipdir=require(_0xaaae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaaae('0x2'));var moment=require(_0xaaae('0x3'));var BPromise=require(_0xaaae('0x4'));var Mustache=require(_0xaaae('0x5'));var util=require(_0xaaae('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xaaae('0x7'));var ejs=require(_0xaaae('0x8'));var fs=require('fs');var fs_extra=require(_0xaaae('0x9'));var _=require(_0xaaae('0xa'));var squel=require(_0xaaae('0xb'));var crypto=require(_0xaaae('0xc'));var jsforce=require(_0xaaae('0xd'));var deskjs=require(_0xaaae('0xe'));var toCsv=require(_0xaaae('0x7'));var querystring=require('querystring');var Papa=require(_0xaaae('0xf'));var Redis=require('ioredis');var authService=require(_0xaaae('0x10'));var qs=require(_0xaaae('0x11'));var as=require(_0xaaae('0x12'));var hardwareService=require(_0xaaae('0x13'));var logger=require(_0xaaae('0x14'))(_0xaaae('0x15'));var utils=require(_0xaaae('0x16'));var config=require(_0xaaae('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xaaae('0x18'))['db'];function respondWithStatusCode(_0x47bb24,_0x200d49){_0x200d49=_0x200d49||0xcc;return function(_0x41ff37){if(_0x41ff37){return _0x47bb24[_0xaaae('0x19')](_0x200d49);}return _0x47bb24[_0xaaae('0x1a')](_0x200d49)[_0xaaae('0x1b')]();};}function respondWithResult(_0x39c975,_0x7097b1){_0x7097b1=_0x7097b1||0xc8;return function(_0x53dba7){if(_0x53dba7){return _0x39c975[_0xaaae('0x1a')](_0x7097b1)[_0xaaae('0x1c')](_0x53dba7);}};}function respondWithFilteredResult(_0x330268,_0x413276){return function(_0x4610d6){if(_0x4610d6){var _0x55036c=typeof _0x413276['offset']===_0xaaae('0x1d')&&typeof _0x413276[_0xaaae('0x1e')]===_0xaaae('0x1d');var _0x355d0b=_0x4610d6[_0xaaae('0x1f')];var _0xf96a39=_0x55036c?0x0:_0x413276['offset'];var _0xfc89f=_0x55036c?_0x4610d6[_0xaaae('0x1f')]:_0x413276[_0xaaae('0x20')]+_0x413276['limit'];var _0x5922d1;if(_0xfc89f>=_0x355d0b){_0xfc89f=_0x355d0b;_0x5922d1=0xc8;}else{_0x5922d1=0xce;}_0x330268[_0xaaae('0x1a')](_0x5922d1);return _0x330268['set'](_0xaaae('0x21'),_0xf96a39+'-'+_0xfc89f+'/'+_0x355d0b)['json'](_0x4610d6);}return null;};}function patchUpdates(_0x1ca7bf){return function(_0x2d92b9){try{jsonpatch[_0xaaae('0x22')](_0x2d92b9,_0x1ca7bf,!![]);}catch(_0x3fb6b2){return BPromise[_0xaaae('0x23')](_0x3fb6b2);}return _0x2d92b9[_0xaaae('0x24')]();};}function saveUpdates(_0x500174,_0x14e78c){return function(_0x14d8e9){if(_0x14d8e9){return _0x14d8e9[_0xaaae('0x25')](_0x500174)[_0xaaae('0x26')](function(_0x1bce35){return _0x1bce35;});}return null;};}function removeEntity(_0x2117dd,_0x498d24){return function(_0x5bb9f2){if(_0x5bb9f2){return _0x5bb9f2[_0xaaae('0x27')]()[_0xaaae('0x26')](function(){var _0x2cb798=_0x5bb9f2['get']({'plain':!![]});var _0x458c59=_0xaaae('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x458c59,'resourceId':_0x2cb798['id']}})['then'](function(){return _0x5bb9f2;});})['then'](function(){_0x2117dd['status'](0xcc)[_0xaaae('0x1b')]();});}};}function handleEntityNotFound(_0x3aff5f,_0x4bd604){return function(_0x577539){if(!_0x577539){_0x3aff5f[_0xaaae('0x19')](0x194);}return _0x577539;};}function handleError(_0x687459,_0x5f4547){_0x5f4547=_0x5f4547||0x1f4;return function(_0x4c4bb0){logger[_0xaaae('0x29')](_0x4c4bb0[_0xaaae('0x2a')]);if(_0x4c4bb0[_0xaaae('0x2b')]){delete _0x4c4bb0['name'];}_0x687459[_0xaaae('0x1a')](_0x5f4547)[_0xaaae('0x2c')](_0x4c4bb0);};}exports['index']=function(_0x4e6f1a,_0x67ea2b){var _0x13b203={},_0xd7608c={},_0x47bc75={'count':0x0,'rows':[]};var _0x4bbd89=_[_0xaaae('0x2d')](db[_0xaaae('0x2e')][_0xaaae('0x2f')],function(_0x72a83f){return{'name':_0x72a83f['fieldName'],'type':_0x72a83f[_0xaaae('0x30')][_0xaaae('0x31')]};});_0xd7608c[_0xaaae('0x32')]=_[_0xaaae('0x2d')](_0x4bbd89,_0xaaae('0x2b'));_0xd7608c[_0xaaae('0x33')]=_[_0xaaae('0x34')](_0x4e6f1a[_0xaaae('0x33')]);_0xd7608c['filters']=_[_0xaaae('0x35')](_0xd7608c['model'],_0xd7608c[_0xaaae('0x33')]);_0x13b203['attributes']=_['intersection'](_0xd7608c[_0xaaae('0x32')],qs[_0xaaae('0x36')](_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x36')]));_0x13b203[_0xaaae('0x37')]=_0x13b203[_0xaaae('0x37')]['length']?_0x13b203[_0xaaae('0x37')]:_0xd7608c[_0xaaae('0x32')];if(!_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x38')](_0xaaae('0x39'))){_0x13b203['limit']=qs[_0xaaae('0x1e')](_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x1e')]);_0x13b203[_0xaaae('0x20')]=qs[_0xaaae('0x20')](_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x20')]);}_0x13b203['order']=qs[_0xaaae('0x3a')](_0x4e6f1a['query']['sort']);_0x13b203[_0xaaae('0x3b')]=qs[_0xaaae('0x3c')](_['pick'](_0x4e6f1a[_0xaaae('0x33')],_0xd7608c[_0xaaae('0x3c')]),_0x4bbd89);if(_0x4e6f1a['query'][_0xaaae('0x3d')]){_0x13b203[_0xaaae('0x3b')]=_[_0xaaae('0x3e')](_0x13b203[_0xaaae('0x3b')],{'$or':[{'key':{'$like':'%'+_0x4e6f1a['query'][_0xaaae('0x3d')]+'%'}},{'value':{'$like':'%'+_0x4e6f1a[_0xaaae('0x33')][_0xaaae('0x3d')]+'%'}}]});}_0x13b203=_[_0xaaae('0x3e')]({},_0x13b203,_0x4e6f1a[_0xaaae('0x3f')]);var _0x564108={'where':_0x13b203['where']};return db['CannedAnswer'][_0xaaae('0x1f')](_0x564108)[_0xaaae('0x26')](function(_0x27065c){_0x47bc75[_0xaaae('0x1f')]=_0x27065c;if(_0x4e6f1a['query'][_0xaaae('0x40')]){_0x13b203[_0xaaae('0x41')]=[{'all':!![]}];}return db[_0xaaae('0x2e')][_0xaaae('0x42')](_0x13b203);})[_0xaaae('0x26')](function(_0x42195e){_0x47bc75['rows']=_0x42195e;return _0x47bc75;})[_0xaaae('0x26')](respondWithFilteredResult(_0x67ea2b,_0x13b203))[_0xaaae('0x43')](handleError(_0x67ea2b,null));};exports[_0xaaae('0x44')]=function(_0x2d0c04,_0x3bc692){var _0x261fa6={'raw':!![],'where':{'id':_0x2d0c04[_0xaaae('0x45')]['id']}},_0x190d83={};_0x190d83[_0xaaae('0x32')]=_[_0xaaae('0x34')](db[_0xaaae('0x2e')][_0xaaae('0x2f')]);_0x190d83[_0xaaae('0x33')]=_[_0xaaae('0x34')](_0x2d0c04[_0xaaae('0x33')]);_0x190d83['filters']=_[_0xaaae('0x35')](_0x190d83[_0xaaae('0x32')],_0x190d83[_0xaaae('0x33')]);_0x261fa6[_0xaaae('0x37')]=_[_0xaaae('0x35')](_0x190d83['model'],qs['fields'](_0x2d0c04[_0xaaae('0x33')]['fields']));_0x261fa6[_0xaaae('0x37')]=_0x261fa6[_0xaaae('0x37')][_0xaaae('0x46')]?_0x261fa6['attributes']:_0x190d83['model'];if(_0x2d0c04[_0xaaae('0x33')][_0xaaae('0x40')]){_0x261fa6[_0xaaae('0x41')]=[{'all':!![]}];}_0x261fa6=_[_0xaaae('0x3e')]({},_0x261fa6,_0x2d0c04[_0xaaae('0x3f')]);return db[_0xaaae('0x2e')]['find'](_0x261fa6)[_0xaaae('0x26')](handleEntityNotFound(_0x3bc692,null))['then'](respondWithResult(_0x3bc692,null))['catch'](handleError(_0x3bc692,null));};exports[_0xaaae('0x25')]=function(_0x376507,_0x2bde69){if(_0x376507[_0xaaae('0x47')]['id']){delete _0x376507[_0xaaae('0x47')]['id'];}return db[_0xaaae('0x2e')][_0xaaae('0x48')]({'where':{'id':_0x376507[_0xaaae('0x45')]['id']}})['then'](handleEntityNotFound(_0x2bde69,null))[_0xaaae('0x26')](saveUpdates(_0x376507[_0xaaae('0x47')],null))[_0xaaae('0x26')](respondWithResult(_0x2bde69,null))[_0xaaae('0x43')](handleError(_0x2bde69,null));};exports[_0xaaae('0x27')]=function(_0x44bee4,_0x30da61){return db[_0xaaae('0x2e')][_0xaaae('0x48')]({'where':{'id':_0x44bee4[_0xaaae('0x45')]['id']}})['then'](handleEntityNotFound(_0x30da61,null))['then'](removeEntity(_0x30da61,null))[_0xaaae('0x43')](handleError(_0x30da61,null));};exports[_0xaaae('0x49')]=function(_0x3bba61,_0x1ba96b){var _0x330f9b={'key':_0x3bba61['body'][_0xaaae('0x31')]};if(_0x3bba61['body'][_0xaaae('0x4a')]){_0x330f9b[_0xaaae('0x4a')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4a')];}else if(_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4b')]){_0x330f9b[_0xaaae('0x4b')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4b')];}else if(_0x3bba61[_0xaaae('0x47')]['OpenchannelAccountId']){_0x330f9b[_0xaaae('0x4c')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4c')];}else if(_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4d')]){_0x330f9b[_0xaaae('0x4d')]=_0x3bba61[_0xaaae('0x47')][_0xaaae('0x4d')];}return db[_0xaaae('0x2e')][_0xaaae('0x48')]({'where':_0x330f9b})[_0xaaae('0x26')](function(_0x378a39){if(_0x378a39){throw new db[(_0xaaae('0x4e'))][(_0xaaae('0x4f'))](_0xaaae('0x50'));}return db[_0xaaae('0x2e')][_0xaaae('0x49')](_0x3bba61[_0xaaae('0x47')]);})[_0xaaae('0x26')](function(_0x32c614){var _0x2f9886=_0x3bba61[_0xaaae('0x51')][_0xaaae('0x52')]({'plain':!![]});if(!_0x2f9886)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f9886[_0xaaae('0x53')]===_0xaaae('0x51')){var _0x20b7a4=_0x32c614[_0xaaae('0x52')]({'plain':!![]});return db[_0xaaae('0x54')]['find']({'where':{'name':_0xaaae('0x28'),'userProfileId':_0x2f9886[_0xaaae('0x55')]},'raw':!![]})['then'](function(_0x2c10dc){if(_0x2c10dc&&_0x2c10dc[_0xaaae('0x56')]===0x0){return db[_0xaaae('0x57')][_0xaaae('0x49')]({'name':_0x20b7a4[_0xaaae('0x2b')],'resourceId':_0x20b7a4['id'],'type':_0x2c10dc[_0xaaae('0x2b')],'sectionId':_0x2c10dc['id']},{})['then'](function(){return _0x32c614;});}else{return _0x32c614;}})['catch'](function(_0x595cb1){logger[_0xaaae('0x29')](_0xaaae('0x58'),_0x595cb1);throw _0x595cb1;});}return _0x32c614;})[_0xaaae('0x26')](respondWithResult(_0x1ba96b,0xc9))[_0xaaae('0x43')](handleError(_0x1ba96b,null));};
\ No newline at end of file
+var _0x2bfd=['fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x3b3092,_0x1eee2a){var _0x399002=function(_0x54b829){while(--_0x54b829){_0x3b3092['push'](_0x3b3092['shift']());}};_0x399002(++_0x1eee2a);}(_0x2bfd,0x77));var _0xd2bf=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x2bfd[_0x36f243];return _0x426436;};'use strict';var emlformat=require(_0xd2bf('0x0'));var rimraf=require(_0xd2bf('0x1'));var zipdir=require(_0xd2bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2bf('0x3'));var moment=require('moment');var BPromise=require(_0xd2bf('0x4'));var Mustache=require(_0xd2bf('0x5'));var util=require(_0xd2bf('0x6'));var path=require('path');var sox=require(_0xd2bf('0x7'));var csv=require(_0xd2bf('0x8'));var ejs=require(_0xd2bf('0x9'));var fs=require('fs');var fs_extra=require(_0xd2bf('0xa'));var _=require(_0xd2bf('0xb'));var squel=require(_0xd2bf('0xc'));var crypto=require(_0xd2bf('0xd'));var jsforce=require(_0xd2bf('0xe'));var deskjs=require(_0xd2bf('0xf'));var toCsv=require(_0xd2bf('0x8'));var querystring=require('querystring');var Papa=require(_0xd2bf('0x10'));var Redis=require(_0xd2bf('0x11'));var authService=require(_0xd2bf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd2bf('0x13'));var hardwareService=require(_0xd2bf('0x14'));var logger=require('../../config/logger')(_0xd2bf('0x15'));var utils=require(_0xd2bf('0x16'));var config=require(_0xd2bf('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30e636,_0x3099f8){_0x3099f8=_0x3099f8||0xcc;return function(_0x2fe218){if(_0x2fe218){return _0x30e636[_0xd2bf('0x18')](_0x3099f8);}return _0x30e636[_0xd2bf('0x19')](_0x3099f8)[_0xd2bf('0x1a')]();};}function respondWithResult(_0x71d706,_0x3d2af4){_0x3d2af4=_0x3d2af4||0xc8;return function(_0x3bf98e){if(_0x3bf98e){return _0x71d706[_0xd2bf('0x19')](_0x3d2af4)['json'](_0x3bf98e);}};}function respondWithFilteredResult(_0x497359,_0x50261f){return function(_0x1b76b1){if(_0x1b76b1){var _0x4283af=typeof _0x50261f['offset']==='undefined'&&typeof _0x50261f[_0xd2bf('0x1b')]===_0xd2bf('0x1c');var _0x1d2b4a=_0x1b76b1[_0xd2bf('0x1d')];var _0x5a702b=_0x4283af?0x0:_0x50261f['offset'];var _0x170fbb=_0x4283af?_0x1b76b1[_0xd2bf('0x1d')]:_0x50261f[_0xd2bf('0x1e')]+_0x50261f[_0xd2bf('0x1b')];var _0x589c18;if(_0x170fbb>=_0x1d2b4a){_0x170fbb=_0x1d2b4a;_0x589c18=0xc8;}else{_0x589c18=0xce;}_0x497359['status'](_0x589c18);return _0x497359[_0xd2bf('0x1f')](_0xd2bf('0x20'),_0x5a702b+'-'+_0x170fbb+'/'+_0x1d2b4a)[_0xd2bf('0x21')](_0x1b76b1);}return null;};}function patchUpdates(_0x1c6711){return function(_0x32f9c9){try{jsonpatch[_0xd2bf('0x22')](_0x32f9c9,_0x1c6711,!![]);}catch(_0x43fc35){return BPromise[_0xd2bf('0x23')](_0x43fc35);}return _0x32f9c9['save']();};}function saveUpdates(_0x47cd27,_0x26bd76){return function(_0x80d19d){if(_0x80d19d){return _0x80d19d[_0xd2bf('0x24')](_0x47cd27)[_0xd2bf('0x25')](function(_0x55b513){return _0x55b513;});}return null;};}function removeEntity(_0x39f9d6,_0x1edd13){return function(_0x34c7a7){if(_0x34c7a7){return _0x34c7a7[_0xd2bf('0x26')]()[_0xd2bf('0x25')](function(){var _0x57bde6=_0x34c7a7[_0xd2bf('0x27')]({'plain':!![]});var _0x37ffa9=_0xd2bf('0x28');return db['UserProfileResource'][_0xd2bf('0x26')]({'where':{'type':_0x37ffa9,'resourceId':_0x57bde6['id']}})[_0xd2bf('0x25')](function(){return _0x34c7a7;});})[_0xd2bf('0x25')](function(){_0x39f9d6['status'](0xcc)[_0xd2bf('0x1a')]();});}};}function handleEntityNotFound(_0x1ace01,_0x1d2441){return function(_0x491668){if(!_0x491668){_0x1ace01[_0xd2bf('0x18')](0x194);}return _0x491668;};}function handleError(_0x376c3b,_0x3dd61d){_0x3dd61d=_0x3dd61d||0x1f4;return function(_0x41b45f){logger[_0xd2bf('0x29')](_0x41b45f[_0xd2bf('0x2a')]);if(_0x41b45f[_0xd2bf('0x2b')]){delete _0x41b45f[_0xd2bf('0x2b')];}_0x376c3b[_0xd2bf('0x19')](_0x3dd61d)[_0xd2bf('0x2c')](_0x41b45f);};}exports['index']=function(_0x20da60,_0x414e13){var _0x487215={},_0x595ac0={},_0x2fdfee={'count':0x0,'rows':[]};var _0x338a40=_[_0xd2bf('0x2d')](db[_0xd2bf('0x2e')][_0xd2bf('0x2f')],function(_0x27f379){return{'name':_0x27f379[_0xd2bf('0x30')],'type':_0x27f379[_0xd2bf('0x31')][_0xd2bf('0x32')]};});_0x595ac0[_0xd2bf('0x33')]=_[_0xd2bf('0x2d')](_0x338a40,'name');_0x595ac0[_0xd2bf('0x34')]=_[_0xd2bf('0x35')](_0x20da60[_0xd2bf('0x34')]);_0x595ac0[_0xd2bf('0x36')]=_[_0xd2bf('0x37')](_0x595ac0[_0xd2bf('0x33')],_0x595ac0[_0xd2bf('0x34')]);_0x487215[_0xd2bf('0x38')]=_['intersection'](_0x595ac0[_0xd2bf('0x33')],qs[_0xd2bf('0x39')](_0x20da60['query'][_0xd2bf('0x39')]));_0x487215[_0xd2bf('0x38')]=_0x487215[_0xd2bf('0x38')][_0xd2bf('0x3a')]?_0x487215[_0xd2bf('0x38')]:_0x595ac0[_0xd2bf('0x33')];if(!_0x20da60['query']['hasOwnProperty'](_0xd2bf('0x3b'))){_0x487215[_0xd2bf('0x1b')]=qs[_0xd2bf('0x1b')](_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x1b')]);_0x487215[_0xd2bf('0x1e')]=qs[_0xd2bf('0x1e')](_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x1e')]);}_0x487215[_0xd2bf('0x3c')]=qs[_0xd2bf('0x3d')](_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x3d')]);_0x487215[_0xd2bf('0x3e')]=qs[_0xd2bf('0x36')](_[_0xd2bf('0x3f')](_0x20da60[_0xd2bf('0x34')],_0x595ac0[_0xd2bf('0x36')]),_0x338a40);if(_0x20da60[_0xd2bf('0x34')]['filter']){_0x487215[_0xd2bf('0x3e')]=_[_0xd2bf('0x40')](_0x487215[_0xd2bf('0x3e')],{'$or':[{'key':{'$like':'%'+_0x20da60[_0xd2bf('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x20da60['query'][_0xd2bf('0x41')]+'%'}}]});}_0x487215=_['merge']({},_0x487215,_0x20da60[_0xd2bf('0x42')]);var _0x5e8124={'where':_0x487215[_0xd2bf('0x3e')]};return db['CannedAnswer'][_0xd2bf('0x1d')](_0x5e8124)['then'](function(_0x22f92a){_0x2fdfee[_0xd2bf('0x1d')]=_0x22f92a;if(_0x20da60[_0xd2bf('0x34')][_0xd2bf('0x43')]){_0x487215[_0xd2bf('0x44')]=[{'all':!![]}];}return db[_0xd2bf('0x2e')][_0xd2bf('0x45')](_0x487215);})[_0xd2bf('0x25')](function(_0x585d23){_0x2fdfee[_0xd2bf('0x46')]=_0x585d23;return _0x2fdfee;})['then'](respondWithFilteredResult(_0x414e13,_0x487215))[_0xd2bf('0x47')](handleError(_0x414e13,null));};exports['show']=function(_0xa0a4af,_0x337759){var _0x52e74c={'raw':!![],'where':{'id':_0xa0a4af['params']['id']}},_0x5c5da4={};_0x5c5da4['model']=_[_0xd2bf('0x35')](db[_0xd2bf('0x2e')][_0xd2bf('0x2f')]);_0x5c5da4[_0xd2bf('0x34')]=_[_0xd2bf('0x35')](_0xa0a4af[_0xd2bf('0x34')]);_0x5c5da4[_0xd2bf('0x36')]=_['intersection'](_0x5c5da4['model'],_0x5c5da4[_0xd2bf('0x34')]);_0x52e74c[_0xd2bf('0x38')]=_[_0xd2bf('0x37')](_0x5c5da4[_0xd2bf('0x33')],qs[_0xd2bf('0x39')](_0xa0a4af['query'][_0xd2bf('0x39')]));_0x52e74c['attributes']=_0x52e74c[_0xd2bf('0x38')][_0xd2bf('0x3a')]?_0x52e74c[_0xd2bf('0x38')]:_0x5c5da4['model'];if(_0xa0a4af['query'][_0xd2bf('0x43')]){_0x52e74c[_0xd2bf('0x44')]=[{'all':!![]}];}_0x52e74c=_['merge']({},_0x52e74c,_0xa0a4af[_0xd2bf('0x42')]);return db[_0xd2bf('0x2e')][_0xd2bf('0x48')](_0x52e74c)[_0xd2bf('0x25')](handleEntityNotFound(_0x337759,null))[_0xd2bf('0x25')](respondWithResult(_0x337759,null))[_0xd2bf('0x47')](handleError(_0x337759,null));};exports[_0xd2bf('0x24')]=function(_0x488508,_0x4f3c4b){if(_0x488508[_0xd2bf('0x49')]['id']){delete _0x488508[_0xd2bf('0x49')]['id'];}return db['CannedAnswer'][_0xd2bf('0x48')]({'where':{'id':_0x488508[_0xd2bf('0x4a')]['id']}})[_0xd2bf('0x25')](handleEntityNotFound(_0x4f3c4b,null))[_0xd2bf('0x25')](saveUpdates(_0x488508['body'],null))[_0xd2bf('0x25')](respondWithResult(_0x4f3c4b,null))['catch'](handleError(_0x4f3c4b,null));};exports['destroy']=function(_0x43e801,_0x5bce20){return db[_0xd2bf('0x2e')][_0xd2bf('0x48')]({'where':{'id':_0x43e801[_0xd2bf('0x4a')]['id']}})[_0xd2bf('0x25')](handleEntityNotFound(_0x5bce20,null))[_0xd2bf('0x25')](removeEntity(_0x5bce20,null))[_0xd2bf('0x47')](handleError(_0x5bce20,null));};exports[_0xd2bf('0x4b')]=function(_0xd23076,_0x1408a2){var _0x108b27={'key':_0xd23076['body'][_0xd2bf('0x32')]};if(_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4c')]){_0x108b27[_0xd2bf('0x4c')]=_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4c')];}else if(_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4d')]){_0x108b27['SmsAccountId']=_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4d')];}else if(_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4e')]){_0x108b27[_0xd2bf('0x4e')]=_0xd23076[_0xd2bf('0x49')][_0xd2bf('0x4e')];}else if(_0xd23076[_0xd2bf('0x49')]['ChatWebsiteId']){_0x108b27[_0xd2bf('0x4f')]=_0xd23076['body'][_0xd2bf('0x4f')];}return db['CannedAnswer']['find']({'where':_0x108b27})[_0xd2bf('0x25')](function(_0x198ce2){if(_0x198ce2){throw new db['Sequelize'][(_0xd2bf('0x50'))](_0xd2bf('0x51'));}return db[_0xd2bf('0x2e')][_0xd2bf('0x4b')](_0xd23076[_0xd2bf('0x49')]);})[_0xd2bf('0x25')](function(_0x30e6bd){var _0xd23240=_0xd23076['user'][_0xd2bf('0x27')]({'plain':!![]});if(!_0xd23240)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd23240['role']===_0xd2bf('0x52')){var _0x171d85=_0x30e6bd[_0xd2bf('0x27')]({'plain':!![]});return db[_0xd2bf('0x53')][_0xd2bf('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0xd23240[_0xd2bf('0x54')]},'raw':!![]})['then'](function(_0x6044dd){if(_0x6044dd&&_0x6044dd[_0xd2bf('0x55')]===0x0){return db[_0xd2bf('0x56')][_0xd2bf('0x4b')]({'name':_0x171d85[_0xd2bf('0x2b')],'resourceId':_0x171d85['id'],'type':_0x6044dd[_0xd2bf('0x2b')],'sectionId':_0x6044dd['id']},{})[_0xd2bf('0x25')](function(){return _0x30e6bd;});}else{return _0x30e6bd;}})[_0xd2bf('0x47')](function(_0x37cdfb){logger['error'](_0xd2bf('0x57'),_0x37cdfb);throw _0x37cdfb;});}return _0x30e6bd;})['then'](respondWithResult(_0x1408a2,0xc9))[_0xd2bf('0x47')](handleError(_0x1408a2,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4319be2..6c9ab49 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 _0xe280=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe280,0x1b3));var _0x0e28=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xe280[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x0e28('0x0'));var util=require(_0x0e28('0x1'));var logger=require(_0x0e28('0x2'))('api');var moment=require(_0x0e28('0x3'));var BPromise=require(_0x0e28('0x4'));var rp=require(_0x0e28('0x5'));var fs=require('fs');var path=require(_0x0e28('0x6'));var rimraf=require(_0x0e28('0x7'));var config=require(_0x0e28('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x0e28('0x9')]=function(_0x3983d8,_0x23cd5c){return _0x3983d8[_0x0e28('0xa')](_0x0e28('0xb'),attributes,{'tableName':_0x0e28('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0e28('0xd'),'collate':_0x0e28('0xe')});};
\ No newline at end of file
+var _0x0de3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4_unicode_ci','lodash','util'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x0de3,0x184));var _0x30de=function(_0x235b75,_0x322c34){_0x235b75=_0x235b75-0x0;var _0x38d797=_0x0de3[_0x235b75];return _0x38d797;};'use strict';var _=require(_0x30de('0x0'));var util=require(_0x30de('0x1'));var logger=require('../../config/logger')(_0x30de('0x2'));var moment=require(_0x30de('0x3'));var BPromise=require(_0x30de('0x4'));var rp=require(_0x30de('0x5'));var fs=require('fs');var path=require(_0x30de('0x6'));var rimraf=require(_0x30de('0x7'));var config=require(_0x30de('0x8'));var attributes=require(_0x30de('0x9'));module[_0x30de('0xa')]=function(_0x512874,_0x55e5e9){return _0x512874[_0x30de('0xb')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x30de('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index c38d4ca..93d5f8b 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(_0x4066ba,_0x5c032c){var _0x290596=function(_0x40aac7){while(--_0x40aac7){_0x4066ba['push'](_0x4066ba['shift']());}};_0x290596(++_0x5c032c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0xbfa2b4,_0x4e3706){var _0x34024e=function(_0x5825a3){while(--_0x5825a3){_0xbfa2b4['push'](_0xbfa2b4['shift']());}};_0x34024e(++_0x4e3706);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 9281317..45079ac 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 _0xd22c=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2fe7c7,_0x51a75d){var _0x39fac8=function(_0x4ed0db){while(--_0x4ed0db){_0x2fe7c7['push'](_0x2fe7c7['shift']());}};_0x39fac8(++_0x51a75d);}(_0xd22c,0x182));var _0xcd22=function(_0x5b05de,_0x441400){_0x5b05de=_0x5b05de-0x0;var _0x1dbd07=_0xd22c[_0x5b05de];return _0x1dbd07;};'use strict';var multer=require('multer');var util=require(_0xcd22('0x0'));var path=require(_0xcd22('0x1'));var timeout=require(_0xcd22('0x2'));var express=require(_0xcd22('0x3'));var router=express['Router']();var fs_extra=require(_0xcd22('0x4'));var auth=require(_0xcd22('0x5'));var interaction=require(_0xcd22('0x6'));var config=require('../../config/environment');var controller=require(_0xcd22('0x7'));router[_0xcd22('0x8')]('/',auth[_0xcd22('0x9')](),controller[_0xcd22('0xa')]);router[_0xcd22('0x8')](_0xcd22('0xb'),auth[_0xcd22('0x9')](),controller[_0xcd22('0xc')]);router[_0xcd22('0xd')]('/',auth['isAuthenticated'](),controller[_0xcd22('0xe')]);router[_0xcd22('0xf')]('/:id',auth[_0xcd22('0x9')](),controller[_0xcd22('0x10')]);router[_0xcd22('0x11')]('/:id',auth[_0xcd22('0x9')](),controller[_0xcd22('0x12')]);module[_0xcd22('0x13')]=router;
\ No newline at end of file
+var _0x0d7d=['isAuthenticated','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0d7d,0x1db));var _0xd0d7=function(_0x4851ff,_0x1c9a8d){_0x4851ff=_0x4851ff-0x0;var _0x26773b=_0x0d7d[_0x4851ff];return _0x26773b;};'use strict';var multer=require(_0xd0d7('0x0'));var util=require(_0xd0d7('0x1'));var path=require(_0xd0d7('0x2'));var timeout=require(_0xd0d7('0x3'));var express=require(_0xd0d7('0x4'));var router=express['Router']();var fs_extra=require(_0xd0d7('0x5'));var auth=require(_0xd0d7('0x6'));var interaction=require(_0xd0d7('0x7'));var config=require(_0xd0d7('0x8'));var controller=require(_0xd0d7('0x9'));router[_0xd0d7('0xa')]('/',auth[_0xd0d7('0xb')](),controller['index']);router['get'](_0xd0d7('0xc'),auth[_0xd0d7('0xb')](),controller['show']);router[_0xd0d7('0xd')]('/',auth[_0xd0d7('0xb')](),controller[_0xd0d7('0xe')]);router['put']('/:id',auth[_0xd0d7('0xb')](),controller[_0xd0d7('0xf')]);router[_0xd0d7('0x10')]('/:id',auth[_0xd0d7('0xb')](),controller[_0xd0d7('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 86a6279..b7563c5 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 _0x5c5a=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x1997c6,_0x1c364e){var _0x3afeed=function(_0x1756e6){while(--_0x1756e6){_0x1997c6['push'](_0x1997c6['shift']());}};_0x3afeed(++_0x1c364e);}(_0x5c5a,0x198));var _0xa5c5=function(_0x43bc3d,_0x22674f){_0x43bc3d=_0x43bc3d-0x0;var _0x3409a4=_0x5c5a[_0x43bc3d];return _0x3409a4;};'use strict';var Sequelize=require('sequelize');module[_0xa5c5('0x0')]={'calldate':{'type':Sequelize[_0xa5c5('0x1')],'allowNull':![],'defaultValue':_0xa5c5('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xa5c5('0x3')]},'dst':{'type':Sequelize[_0xa5c5('0x3')]},'dcontext':{'type':Sequelize[_0xa5c5('0x3')]},'channel':{'type':Sequelize[_0xa5c5('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xa5c5('0x3')]},'lastdata':{'type':Sequelize[_0xa5c5('0x3')]},'duration':{'type':Sequelize[_0xa5c5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa5c5('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa5c5('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa5c5('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa5c5('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa5c5('0x3')]},'tag':{'type':Sequelize[_0xa5c5('0x3')]}};
\ No newline at end of file
+var _0xa508=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x553c61,_0x594716){var _0x20d786=function(_0x4f1c62){while(--_0x4f1c62){_0x553c61['push'](_0x553c61['shift']());}};_0x20d786(++_0x594716);}(_0xa508,0x187));var _0x8a50=function(_0x15a5b4,_0x90b469){_0x15a5b4=_0x15a5b4-0x0;var _0x26f037=_0xa508[_0x15a5b4];return _0x26f037;};'use strict';var Sequelize=require(_0x8a50('0x0'));module[_0x8a50('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x8a50('0x2')},'clid':{'type':Sequelize[_0x8a50('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x8a50('0x3')]},'channel':{'type':Sequelize[_0x8a50('0x3')]},'dstchannel':{'type':Sequelize[_0x8a50('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8a50('0x3')]},'duration':{'type':Sequelize[_0x8a50('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8a50('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8a50('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8a50('0x3')]},'userfield':{'type':Sequelize[_0x8a50('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x8a50('0x3')]},'sequence':{'type':Sequelize[_0x8a50('0x3')]},'peeraccount':{'type':Sequelize[_0x8a50('0x3')]},'type':{'type':Sequelize[_0x8a50('0x3')]},'tag':{'type':Sequelize[_0x8a50('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e4418f3..bbc659b 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 _0x23f4=['index','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','update','find','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','send'];(function(_0x2c769e,_0x1178f5){var _0x52acdd=function(_0x4b1a01){while(--_0x4b1a01){_0x2c769e['push'](_0x2c769e['shift']());}};_0x52acdd(++_0x1178f5);}(_0x23f4,0x1ee));var _0x423f=function(_0x1c890f,_0x47172a){_0x1c890f=_0x1c890f-0x0;var _0x5d1bfb=_0x23f4[_0x1c890f];return _0x5d1bfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];function respondWithStatusCode(_0x3d4027,_0x216360){_0x216360=_0x216360||0xcc;return function(_0x5275b0){if(_0x5275b0){return _0x3d4027[_0x423f('0x16')](_0x216360);}return _0x3d4027[_0x423f('0x17')](_0x216360)[_0x423f('0x18')]();};}function respondWithResult(_0x1c894f,_0x44e1d5){_0x44e1d5=_0x44e1d5||0xc8;return function(_0x3b531d){if(_0x3b531d){return _0x1c894f[_0x423f('0x17')](_0x44e1d5)[_0x423f('0x19')](_0x3b531d);}};}function respondWithFilteredResult(_0x252e6c,_0x235c86){return function(_0x3940ea){if(_0x3940ea){var _0x276be1=typeof _0x235c86[_0x423f('0x1a')]===_0x423f('0x1b')&&typeof _0x235c86[_0x423f('0x1c')]===_0x423f('0x1b');var _0x3fd56d=_0x3940ea[_0x423f('0x1d')];var _0x26b6d1=_0x276be1?0x0:_0x235c86['offset'];var _0x99435f=_0x276be1?_0x3940ea['count']:_0x235c86['offset']+_0x235c86[_0x423f('0x1c')];var _0x4956e0;if(_0x99435f>=_0x3fd56d){_0x99435f=_0x3fd56d;_0x4956e0=0xc8;}else{_0x4956e0=0xce;}_0x252e6c[_0x423f('0x17')](_0x4956e0);return _0x252e6c[_0x423f('0x1e')]('Content-Range',_0x26b6d1+'-'+_0x99435f+'/'+_0x3fd56d)[_0x423f('0x19')](_0x3940ea);}return null;};}function patchUpdates(_0x1fc317){return function(_0x56c21e){try{jsonpatch[_0x423f('0x1f')](_0x56c21e,_0x1fc317,!![]);}catch(_0x2ebe74){return BPromise['reject'](_0x2ebe74);}return _0x56c21e[_0x423f('0x20')]();};}function saveUpdates(_0x1b4ecc,_0x568dcd){return function(_0x54f47){if(_0x54f47){return _0x54f47['update'](_0x1b4ecc)[_0x423f('0x21')](function(_0x3c942e){return _0x3c942e;});}return null;};}function removeEntity(_0x4502ab,_0x3955a0){return function(_0xb82e8d){if(_0xb82e8d){return _0xb82e8d[_0x423f('0x22')]()[_0x423f('0x21')](function(){_0x4502ab[_0x423f('0x17')](0xcc)[_0x423f('0x18')]();});}};}function handleEntityNotFound(_0x36f57f,_0x45889f){return function(_0x199196){if(!_0x199196){_0x36f57f[_0x423f('0x16')](0x194);}return _0x199196;};}function handleError(_0x1f1747,_0x4a98f2){_0x4a98f2=_0x4a98f2||0x1f4;return function(_0x3308dd){logger[_0x423f('0x23')](_0x3308dd[_0x423f('0x24')]);if(_0x3308dd['name']){delete _0x3308dd['name'];}_0x1f1747[_0x423f('0x17')](_0x4a98f2)[_0x423f('0x25')](_0x3308dd);};}exports[_0x423f('0x26')]=function(_0x4c2f21,_0x5882ed){var _0x3ca28d={},_0xbb4bce={},_0x5a838e={'count':0x0,'rows':[]};var _0x3cf4aa=_[_0x423f('0x27')](db[_0x423f('0x28')][_0x423f('0x29')],function(_0x518c1e){return{'name':_0x518c1e[_0x423f('0x2a')],'type':_0x518c1e[_0x423f('0x2b')][_0x423f('0x2c')]};});_0xbb4bce[_0x423f('0x2d')]=_['map'](_0x3cf4aa,_0x423f('0x2e'));_0xbb4bce[_0x423f('0x2f')]=_[_0x423f('0x30')](_0x4c2f21[_0x423f('0x2f')]);_0xbb4bce[_0x423f('0x31')]=_[_0x423f('0x32')](_0xbb4bce[_0x423f('0x2d')],_0xbb4bce[_0x423f('0x2f')]);_0x3ca28d[_0x423f('0x33')]=_[_0x423f('0x32')](_0xbb4bce['model'],qs[_0x423f('0x34')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x34')]));_0x3ca28d['attributes']=_0x3ca28d[_0x423f('0x33')]['length']?_0x3ca28d[_0x423f('0x33')]:_0xbb4bce[_0x423f('0x2d')];if(!_0x4c2f21[_0x423f('0x2f')][_0x423f('0x35')](_0x423f('0x36'))){_0x3ca28d['limit']=qs['limit'](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1c')]);_0x3ca28d[_0x423f('0x1a')]=qs[_0x423f('0x1a')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1a')]);}_0x3ca28d[_0x423f('0x37')]=qs[_0x423f('0x38')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x38')]);_0x3ca28d[_0x423f('0x39')]=qs[_0x423f('0x31')](_[_0x423f('0x3a')](_0x4c2f21['query'],_0xbb4bce['filters']),_0x3cf4aa);if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]){_0x3ca28d[_0x423f('0x39')]=_[_0x423f('0x3c')](_0x3ca28d[_0x423f('0x39')],{'$or':_['map'](_0x3cf4aa,function(_0x38dcce){if(_0x38dcce[_0x423f('0x2b')]!==_0x423f('0x3d')){var _0x1d47d8={};_0x1d47d8[_0x38dcce[_0x423f('0x2e')]]={'$like':'%'+_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]+'%'};return _0x1d47d8;}})});}_0x3ca28d=_[_0x423f('0x3c')]({},_0x3ca28d,_0x4c2f21[_0x423f('0x3e')]);var _0x40571a={'where':_0x3ca28d['where']};return db['Cdr'][_0x423f('0x1d')](_0x40571a)[_0x423f('0x21')](function(_0x81bd62){_0x5a838e[_0x423f('0x1d')]=_0x81bd62;if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3ca28d['include']=[{'all':!![]}];}return db[_0x423f('0x28')][_0x423f('0x40')](_0x3ca28d);})[_0x423f('0x21')](function(_0x393618){_0x5a838e[_0x423f('0x41')]=_0x393618;return _0x5a838e;})[_0x423f('0x21')](respondWithFilteredResult(_0x5882ed,_0x3ca28d))[_0x423f('0x42')](handleError(_0x5882ed,null));};exports[_0x423f('0x43')]=function(_0x518443,_0x4165e0){var _0x3bc113={'raw':!![],'where':{'id':_0x518443[_0x423f('0x44')]['id']}},_0x192ae5={};_0x192ae5[_0x423f('0x2d')]=_[_0x423f('0x30')](db[_0x423f('0x28')][_0x423f('0x29')]);_0x192ae5[_0x423f('0x2f')]=_['keys'](_0x518443[_0x423f('0x2f')]);_0x192ae5['filters']=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],_0x192ae5[_0x423f('0x2f')]);_0x3bc113[_0x423f('0x33')]=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],qs[_0x423f('0x34')](_0x518443[_0x423f('0x2f')][_0x423f('0x34')]));_0x3bc113[_0x423f('0x33')]=_0x3bc113[_0x423f('0x33')][_0x423f('0x45')]?_0x3bc113[_0x423f('0x33')]:_0x192ae5[_0x423f('0x2d')];if(_0x518443[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3bc113[_0x423f('0x46')]=[{'all':!![]}];}_0x3bc113=_[_0x423f('0x3c')]({},_0x3bc113,_0x518443[_0x423f('0x3e')]);return db[_0x423f('0x28')]['find'](_0x3bc113)[_0x423f('0x21')](handleEntityNotFound(_0x4165e0,null))['then'](respondWithResult(_0x4165e0,null))[_0x423f('0x42')](handleError(_0x4165e0,null));};exports[_0x423f('0x47')]=function(_0x1cf881,_0x37035a){return db[_0x423f('0x28')][_0x423f('0x47')](_0x1cf881[_0x423f('0x48')],{})[_0x423f('0x21')](respondWithResult(_0x37035a,0xc9))[_0x423f('0x42')](handleError(_0x37035a,null));};exports[_0x423f('0x49')]=function(_0x31b88e,_0x2dcbec){if(_0x31b88e['body']['id']){delete _0x31b88e[_0x423f('0x48')]['id'];}return db[_0x423f('0x28')]['find']({'where':{'id':_0x31b88e[_0x423f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dcbec,null))[_0x423f('0x21')](saveUpdates(_0x31b88e['body'],null))['then'](respondWithResult(_0x2dcbec,null))[_0x423f('0x42')](handleError(_0x2dcbec,null));};exports[_0x423f('0x22')]=function(_0x1668d4,_0x4114e1){return db['Cdr'][_0x423f('0x4a')]({'where':{'id':_0x1668d4['params']['id']}})[_0x423f('0x21')](handleEntityNotFound(_0x4114e1,null))[_0x423f('0x21')](removeEntity(_0x4114e1,null))[_0x423f('0x42')](handleError(_0x4114e1,null));};exports[_0x423f('0x4b')]=function(_0x17c2b6,_0x961f0d){return db[_0x423f('0x28')][_0x423f('0x4b')]()[_0x423f('0x21')](respondWithResult(_0x961f0d,null))['catch'](handleError(_0x961f0d,null));};
\ No newline at end of file
+var _0x032e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0xc48470,_0x2561ad){var _0x2152be=function(_0x2a0a34){while(--_0x2a0a34){_0xc48470['push'](_0xc48470['shift']());}};_0x2152be(++_0x2561ad);}(_0x032e,0x124));var _0xe032=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x032e[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['Cdr'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_0x4e8b72,_0xe032('0x29'));_0x469290[_0xe032('0x30')]=_[_0xe032('0x31')](_0x5573e4['query']);_0x469290[_0xe032('0x32')]=_[_0xe032('0x33')](_0x469290[_0xe032('0x2e')],_0x469290[_0xe032('0x30')]);_0x38e7ea['attributes']=_[_0xe032('0x33')](_0x469290['model'],qs[_0xe032('0x34')](_0x5573e4['query'][_0xe032('0x34')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x35')]['length']?_0x38e7ea[_0xe032('0x35')]:_0x469290[_0xe032('0x2e')];if(!_0x5573e4['query'][_0xe032('0x36')](_0xe032('0x37'))){_0x38e7ea[_0xe032('0x21')]=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea['offset']=qs[_0xe032('0x1f')](_0x5573e4[_0xe032('0x30')]['offset']);}_0x38e7ea[_0xe032('0x38')]=qs[_0xe032('0x39')](_0x5573e4['query'][_0xe032('0x39')]);_0x38e7ea[_0xe032('0x3a')]=qs[_0xe032('0x32')](_[_0xe032('0x3b')](_0x5573e4[_0xe032('0x30')],_0x469290[_0xe032('0x32')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x30')][_0xe032('0x3c')]){_0x38e7ea[_0xe032('0x3a')]=_[_0xe032('0x3d')](_0x38e7ea[_0xe032('0x3a')],{'$or':_[_0xe032('0x2f')](_0x4e8b72,function(_0x30571c){if(_0x30571c[_0xe032('0x2d')]!==_0xe032('0x3e')){var _0x14ea1a={};_0x14ea1a[_0x30571c[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3c')]+'%'};return _0x14ea1a;}})});}_0x38e7ea=_['merge']({},_0x38e7ea,_0x5573e4[_0xe032('0x3f')]);var _0x2bcfb4={'where':_0x38e7ea[_0xe032('0x3a')]};return db[_0xe032('0x40')][_0xe032('0x22')](_0x2bcfb4)['then'](function(_0x132d25){_0xae116e['count']=_0x132d25;if(_0x5573e4[_0xe032('0x30')]['includeAll']){_0x38e7ea[_0xe032('0x41')]=[{'all':!![]}];}return db[_0xe032('0x40')][_0xe032('0x42')](_0x38e7ea);})[_0xe032('0x27')](function(_0x4dc836){_0xae116e[_0xe032('0x43')]=_0x4dc836;return _0xae116e;})['then'](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x44')](handleError(_0x3e2575,null));};exports[_0xe032('0x45')]=function(_0x3c43f1,_0xe572b6){var _0x4b58eb={'raw':!![],'where':{'id':_0x3c43f1[_0xe032('0x46')]['id']}},_0x513b0c={};_0x513b0c[_0xe032('0x2e')]=_['keys'](db[_0xe032('0x40')][_0xe032('0x2b')]);_0x513b0c[_0xe032('0x30')]=_[_0xe032('0x31')](_0x3c43f1[_0xe032('0x30')]);_0x513b0c['filters']=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],_0x513b0c[_0xe032('0x30')]);_0x4b58eb[_0xe032('0x35')]=_[_0xe032('0x33')](_0x513b0c[_0xe032('0x2e')],qs[_0xe032('0x34')](_0x3c43f1[_0xe032('0x30')]['fields']));_0x4b58eb['attributes']=_0x4b58eb[_0xe032('0x35')]['length']?_0x4b58eb[_0xe032('0x35')]:_0x513b0c[_0xe032('0x2e')];if(_0x3c43f1[_0xe032('0x30')][_0xe032('0x47')]){_0x4b58eb[_0xe032('0x41')]=[{'all':!![]}];}_0x4b58eb=_[_0xe032('0x3d')]({},_0x4b58eb,_0x3c43f1[_0xe032('0x3f')]);return db[_0xe032('0x40')][_0xe032('0x48')](_0x4b58eb)['then'](handleEntityNotFound(_0xe572b6,null))[_0xe032('0x27')](respondWithResult(_0xe572b6,null))['catch'](handleError(_0xe572b6,null));};exports['create']=function(_0x28f973,_0x2583e9){return db[_0xe032('0x40')][_0xe032('0x49')](_0x28f973['body'],{})[_0xe032('0x27')](respondWithResult(_0x2583e9,0xc9))[_0xe032('0x44')](handleError(_0x2583e9,null));};exports[_0xe032('0x26')]=function(_0x39ffb7,_0x1b3172){if(_0x39ffb7[_0xe032('0x4a')]['id']){delete _0x39ffb7[_0xe032('0x4a')]['id'];}return db['Cdr'][_0xe032('0x48')]({'where':{'id':_0x39ffb7[_0xe032('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b3172,null))[_0xe032('0x27')](saveUpdates(_0x39ffb7[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x1b3172,null))[_0xe032('0x44')](handleError(_0x1b3172,null));};exports[_0xe032('0x4b')]=function(_0x434f1a,_0x24b013){return db[_0xe032('0x40')][_0xe032('0x48')]({'where':{'id':_0x434f1a[_0xe032('0x46')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x24b013,null))[_0xe032('0x27')](removeEntity(_0x24b013,null))[_0xe032('0x44')](handleError(_0x24b013,null));};exports[_0xe032('0x4c')]=function(_0x4eabfc,_0x1c8b32){return db['Cdr'][_0xe032('0x4c')]()[_0xe032('0x27')](respondWithResult(_0x1c8b32,null))[_0xe032('0x44')](handleError(_0x1c8b32,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 2bb0bd3..8000500 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(_0x3555c0,_0x1b32cd){var _0x9852f8=function(_0x387282){while(--_0x387282){_0x3555c0['push'](_0x3555c0['shift']());}};_0x9852f8(++_0x1b32cd);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3f62d8,_0x4ebd4a){var _0x4a649d=function(_0x2b69dc){while(--_0x2b69dc){_0x3f62d8['push'](_0x3f62d8['shift']());}};_0x4a649d(++_0x4ebd4a);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index eaa132c..6963d7c 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 _0x2cb5=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch'];(function(_0x493a89,_0x2f5fac){var _0x5be45c=function(_0x1147ed){while(--_0x1147ed){_0x493a89['push'](_0x493a89['shift']());}};_0x5be45c(++_0x2f5fac);}(_0x2cb5,0x176));var _0x52cb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2cb5[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x52cb('0x0'));var util=require(_0x52cb('0x1'));var moment=require(_0x52cb('0x2'));var BPromise=require(_0x52cb('0x3'));var rs=require(_0x52cb('0x4'));var fs=require('fs');var Redis=require(_0x52cb('0x5'));var db=require(_0x52cb('0x6'))['db'];var utils=require(_0x52cb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x52cb('0x8'));var jayson=require(_0x52cb('0x9'));var client=jayson[_0x52cb('0xa')][_0x52cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38e38e,_0x2a7bb9,_0x5e5844){return new BPromise(function(_0x367c8f,_0x4a5b98){return client['request'](_0x38e38e,_0x5e5844)[_0x52cb('0xc')](function(_0x2b185a){logger[_0x52cb('0xd')]('Cdr,\x20%s,\x20%s',_0x2a7bb9,'request\x20sent');logger['debug'](_0x52cb('0xe'),_0x2a7bb9,_0x52cb('0xf'),JSON[_0x52cb('0x10')](_0x2b185a));if(_0x2b185a[_0x52cb('0x11')]){if(_0x2b185a[_0x52cb('0x11')][_0x52cb('0x12')]===0x1f4){logger[_0x52cb('0x11')](_0x52cb('0x13'),_0x2a7bb9,_0x2b185a['error'][_0x52cb('0x14')]);return _0x4a5b98(_0x2b185a[_0x52cb('0x11')][_0x52cb('0x14')]);}logger['error'](_0x52cb('0x13'),_0x2a7bb9,_0x2b185a['error'][_0x52cb('0x14')]);return _0x367c8f(_0x2b185a[_0x52cb('0x11')][_0x52cb('0x14')]);}else{logger['info'](_0x52cb('0x13'),_0x2a7bb9,_0x52cb('0xf'));_0x367c8f(_0x2b185a['result'][_0x52cb('0x14')]);}})[_0x52cb('0x15')](function(_0x51f481){logger[_0x52cb('0x11')](_0x52cb('0x13'),_0x2a7bb9,_0x51f481);_0x4a5b98(_0x51f481);});});}
\ No newline at end of file
+var _0x1131=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e6e33,_0x507530){var _0x79305a=function(_0x12308b){while(--_0x12308b){_0x4e6e33['push'](_0x4e6e33['shift']());}};_0x79305a(++_0x507530);}(_0x1131,0x8b));var _0x1113=function(_0x229689,_0xa87582){_0x229689=_0x229689-0x0;var _0x3e7163=_0x1131[_0x229689];return _0x3e7163;};'use strict';var _=require('lodash');var util=require(_0x1113('0x0'));var moment=require(_0x1113('0x1'));var BPromise=require(_0x1113('0x2'));var rs=require(_0x1113('0x3'));var fs=require('fs');var Redis=require(_0x1113('0x4'));var db=require(_0x1113('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1113('0x6'))(_0x1113('0x7'));var config=require('../../config/environment');var jayson=require(_0x1113('0x8'));var client=jayson[_0x1113('0x9')][_0x1113('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c8ff1,_0x26bfeb,_0x523a29){return new BPromise(function(_0x268c69,_0x5cae96){return client[_0x1113('0xb')](_0x4c8ff1,_0x523a29)[_0x1113('0xc')](function(_0x2a662a){logger[_0x1113('0xd')](_0x1113('0xe'),_0x26bfeb,_0x1113('0xf'));logger[_0x1113('0x10')](_0x1113('0x11'),_0x26bfeb,_0x1113('0xf'),JSON[_0x1113('0x12')](_0x2a662a));if(_0x2a662a['error']){if(_0x2a662a['error'][_0x1113('0x13')]===0x1f4){logger[_0x1113('0x14')](_0x1113('0xe'),_0x26bfeb,_0x2a662a[_0x1113('0x14')][_0x1113('0x15')]);return _0x5cae96(_0x2a662a[_0x1113('0x14')][_0x1113('0x15')]);}logger['error'](_0x1113('0xe'),_0x26bfeb,_0x2a662a[_0x1113('0x14')][_0x1113('0x15')]);return _0x268c69(_0x2a662a[_0x1113('0x14')]['message']);}else{logger[_0x1113('0xd')](_0x1113('0xe'),_0x26bfeb,_0x1113('0xf'));_0x268c69(_0x2a662a[_0x1113('0x16')]['message']);}})[_0x1113('0x17')](function(_0x482070){logger[_0x1113('0x14')]('Cdr,\x20%s,\x20%s',_0x26bfeb,_0x482070);_0x5cae96(_0x482070);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 53fdead..749b741 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(_0x60a935,_0x4fae24){var _0x4e22a0=function(_0x395a0a){while(--_0x395a0a){_0x60a935['push'](_0x60a935['shift']());}};_0x4e22a0(++_0x4fae24);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x45e647,_0x2c482c){var _0x2deace=function(_0x12e383){while(--_0x12e383){_0x45e647['push'](_0x45e647['shift']());}};_0x2deace(++_0x2c482c);}(_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 36064dc..ea1f84c 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 _0x4b72=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x6bbb11,_0x44e6b5){var _0x4c4dc3=function(_0x1307e8){while(--_0x1307e8){_0x6bbb11['push'](_0x6bbb11['shift']());}};_0x4c4dc3(++_0x44e6b5);}(_0x4b72,0x141));var _0x24b7=function(_0x1df6e8,_0x4589fe){_0x1df6e8=_0x1df6e8-0x0;var _0xf2f7b6=_0x4b72[_0x1df6e8];return _0xf2f7b6;};'use strict';var Sequelize=require(_0x24b7('0x0'));module[_0x24b7('0x1')]={'priority':{'type':Sequelize[_0x24b7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x24b7('0x3')},'appdata':{'type':Sequelize[_0x24b7('0x4')]()},'description':{'type':Sequelize[_0x24b7('0x5')]},'interval':{'type':Sequelize[_0x24b7('0x5')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xdf0e=['exports','STRING','TEXT','sequelize'];(function(_0x3aa341,_0xf2becc){var _0x4bd698=function(_0x5b7c81){while(--_0x5b7c81){_0x3aa341['push'](_0x3aa341['shift']());}};_0x4bd698(++_0xf2becc);}(_0xdf0e,0xa7));var _0xedf0=function(_0x5ea326,_0x3d52fa){_0x5ea326=_0x5ea326-0x0;var _0x48cf87=_0xdf0e[_0x5ea326];return _0x48cf87;};'use strict';var Sequelize=require(_0xedf0('0x0'));module[_0xedf0('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xedf0('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xedf0('0x3')]()},'description':{'type':Sequelize[_0xedf0('0x2')]},'interval':{'type':Sequelize[_0xedf0('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 925b24a..fb302fa 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 _0x76bc=['send','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','name'];(function(_0x450b15,_0x28ac6b){var _0x35ae8a=function(_0x560ae7){while(--_0x560ae7){_0x450b15['push'](_0x450b15['shift']());}};_0x35ae8a(++_0x28ac6b);}(_0x76bc,0x17f));var _0xc76b=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x76bc[_0xf9a6cf];return _0x59e2bc;};'use strict';var emlformat=require(_0xc76b('0x0'));var rimraf=require(_0xc76b('0x1'));var zipdir=require(_0xc76b('0x2'));var jsonpatch=require(_0xc76b('0x3'));var rp=require(_0xc76b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc76b('0x5'));var util=require(_0xc76b('0x6'));var path=require(_0xc76b('0x7'));var sox=require(_0xc76b('0x8'));var csv=require(_0xc76b('0x9'));var ejs=require(_0xc76b('0xa'));var fs=require('fs');var fs_extra=require(_0xc76b('0xb'));var _=require(_0xc76b('0xc'));var squel=require(_0xc76b('0xd'));var crypto=require(_0xc76b('0xe'));var jsforce=require(_0xc76b('0xf'));var deskjs=require(_0xc76b('0x10'));var toCsv=require(_0xc76b('0x9'));var querystring=require(_0xc76b('0x11'));var Papa=require(_0xc76b('0x12'));var Redis=require(_0xc76b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc76b('0x14'));var as=require(_0xc76b('0x15'));var hardwareService=require(_0xc76b('0x16'));var logger=require(_0xc76b('0x17'))(_0xc76b('0x18'));var utils=require(_0xc76b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc76b('0x1a'));var db=require(_0xc76b('0x1b'))['db'];function respondWithStatusCode(_0x30835f,_0xc84b2c){_0xc84b2c=_0xc84b2c||0xcc;return function(_0x4474cd){if(_0x4474cd){return _0x30835f[_0xc76b('0x1c')](_0xc84b2c);}return _0x30835f[_0xc76b('0x1d')](_0xc84b2c)['end']();};}function respondWithResult(_0x538ca8,_0x38a0f1){_0x38a0f1=_0x38a0f1||0xc8;return function(_0x25e4a1){if(_0x25e4a1){return _0x538ca8[_0xc76b('0x1d')](_0x38a0f1)[_0xc76b('0x1e')](_0x25e4a1);}};}function respondWithFilteredResult(_0x25752f,_0x5d1130){return function(_0x21d99a){if(_0x21d99a){var _0x2db167=typeof _0x5d1130[_0xc76b('0x1f')]==='undefined'&&typeof _0x5d1130['limit']===_0xc76b('0x20');var _0x2d3e9d=_0x21d99a[_0xc76b('0x21')];var _0x3e716e=_0x2db167?0x0:_0x5d1130[_0xc76b('0x1f')];var _0x55a61d=_0x2db167?_0x21d99a['count']:_0x5d1130['offset']+_0x5d1130[_0xc76b('0x22')];var _0x164d38;if(_0x55a61d>=_0x2d3e9d){_0x55a61d=_0x2d3e9d;_0x164d38=0xc8;}else{_0x164d38=0xce;}_0x25752f[_0xc76b('0x1d')](_0x164d38);return _0x25752f[_0xc76b('0x23')](_0xc76b('0x24'),_0x3e716e+'-'+_0x55a61d+'/'+_0x2d3e9d)[_0xc76b('0x1e')](_0x21d99a);}return null;};}function patchUpdates(_0x336be9){return function(_0x20aed4){try{jsonpatch[_0xc76b('0x25')](_0x20aed4,_0x336be9,!![]);}catch(_0x393b0b){return BPromise['reject'](_0x393b0b);}return _0x20aed4[_0xc76b('0x26')]();};}function saveUpdates(_0x4bf5a9,_0x51fafe){return function(_0x3bbede){if(_0x3bbede){return _0x3bbede[_0xc76b('0x27')](_0x4bf5a9)[_0xc76b('0x28')](function(_0xac9a7f){return _0xac9a7f;});}return null;};}function removeEntity(_0x18332d,_0xa6a862){return function(_0x24ee9a){if(_0x24ee9a){return _0x24ee9a[_0xc76b('0x29')]()['then'](function(){_0x18332d[_0xc76b('0x1d')](0xcc)[_0xc76b('0x2a')]();});}};}function handleEntityNotFound(_0x5f0a7b,_0xf43320){return function(_0x2ac9de){if(!_0x2ac9de){_0x5f0a7b[_0xc76b('0x1c')](0x194);}return _0x2ac9de;};}function handleError(_0x25ea69,_0x369fc1){_0x369fc1=_0x369fc1||0x1f4;return function(_0x451ee1){logger['error'](_0x451ee1['stack']);if(_0x451ee1[_0xc76b('0x2b')]){delete _0x451ee1[_0xc76b('0x2b')];}_0x25ea69[_0xc76b('0x1d')](_0x369fc1)[_0xc76b('0x2c')](_0x451ee1);};}exports['show']=function(_0xd92178,_0x26c19b){var _0x35d1bc={'raw':!![],'where':{'id':_0xd92178[_0xc76b('0x2d')]['id']}},_0x4a0918={};_0x4a0918[_0xc76b('0x2e')]=_[_0xc76b('0x2f')](db[_0xc76b('0x30')]['rawAttributes']);_0x4a0918[_0xc76b('0x31')]=_[_0xc76b('0x2f')](_0xd92178[_0xc76b('0x31')]);_0x4a0918[_0xc76b('0x32')]=_[_0xc76b('0x33')](_0x4a0918['model'],_0x4a0918[_0xc76b('0x31')]);_0x35d1bc['attributes']=_[_0xc76b('0x33')](_0x4a0918[_0xc76b('0x2e')],qs[_0xc76b('0x34')](_0xd92178[_0xc76b('0x31')][_0xc76b('0x34')]));_0x35d1bc[_0xc76b('0x35')]=_0x35d1bc['attributes']['length']?_0x35d1bc[_0xc76b('0x35')]:_0x4a0918[_0xc76b('0x2e')];if(_0xd92178[_0xc76b('0x31')][_0xc76b('0x36')]){_0x35d1bc[_0xc76b('0x37')]=[{'all':!![]}];}_0x35d1bc=_[_0xc76b('0x38')]({},_0x35d1bc,_0xd92178[_0xc76b('0x39')]);return db[_0xc76b('0x30')][_0xc76b('0x3a')](_0x35d1bc)[_0xc76b('0x28')](handleEntityNotFound(_0x26c19b,null))[_0xc76b('0x28')](respondWithResult(_0x26c19b,null))[_0xc76b('0x3b')](handleError(_0x26c19b,null));};exports[_0xc76b('0x27')]=function(_0x21bc23,_0xb3c2c6){if(_0x21bc23['body']['id']){delete _0x21bc23[_0xc76b('0x3c')]['id'];}return db[_0xc76b('0x30')][_0xc76b('0x3a')]({'where':{'id':_0x21bc23[_0xc76b('0x2d')]['id']}})[_0xc76b('0x28')](handleEntityNotFound(_0xb3c2c6,null))[_0xc76b('0x28')](saveUpdates(_0x21bc23[_0xc76b('0x3c')],null))[_0xc76b('0x28')](respondWithResult(_0xb3c2c6,null))[_0xc76b('0x3b')](handleError(_0xb3c2c6,null));};exports[_0xc76b('0x29')]=function(_0x41d26d,_0x3fc3d7){return db[_0xc76b('0x30')][_0xc76b('0x3a')]({'where':{'id':_0x41d26d['params']['id']}})[_0xc76b('0x28')](handleEntityNotFound(_0x3fc3d7,null))['then'](removeEntity(_0x3fc3d7,null))[_0xc76b('0x3b')](handleError(_0x3fc3d7,null));};
\ No newline at end of file
+var _0x1ddc=['ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','options','find','update','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x2e7054,_0x3e955e){_0x2e7054=_0x2e7054-0x0;var _0x5b08a0=_0x1ddc[_0x2e7054];return _0x5b08a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1dd('0x0'));var zipdir=require(_0xc1dd('0x1'));var jsonpatch=require(_0xc1dd('0x2'));var rp=require('request-promise');var moment=require(_0xc1dd('0x3'));var BPromise=require(_0xc1dd('0x4'));var Mustache=require('mustache');var util=require(_0xc1dd('0x5'));var path=require(_0xc1dd('0x6'));var sox=require('sox');var csv=require(_0xc1dd('0x7'));var ejs=require(_0xc1dd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1dd('0x9'));var squel=require(_0xc1dd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc1dd('0xb'));var toCsv=require(_0xc1dd('0x7'));var querystring=require(_0xc1dd('0xc'));var Papa=require(_0xc1dd('0xd'));var Redis=require('ioredis');var authService=require(_0xc1dd('0xe'));var qs=require(_0xc1dd('0xf'));var as=require(_0xc1dd('0x10'));var hardwareService=require(_0xc1dd('0x11'));var logger=require('../../config/logger')(_0xc1dd('0x12'));var utils=require(_0xc1dd('0x13'));var config=require(_0xc1dd('0x14'));var licenseUtil=require(_0xc1dd('0x15'));var db=require(_0xc1dd('0x16'))['db'];function respondWithStatusCode(_0x2613c9,_0x1d9815){_0x1d9815=_0x1d9815||0xcc;return function(_0x83a291){if(_0x83a291){return _0x2613c9[_0xc1dd('0x17')](_0x1d9815);}return _0x2613c9[_0xc1dd('0x18')](_0x1d9815)[_0xc1dd('0x19')]();};}function respondWithResult(_0x576fc1,_0x3d4c7f){_0x3d4c7f=_0x3d4c7f||0xc8;return function(_0x30f49a){if(_0x30f49a){return _0x576fc1[_0xc1dd('0x18')](_0x3d4c7f)[_0xc1dd('0x1a')](_0x30f49a);}};}function respondWithFilteredResult(_0x104177,_0x52a9b8){return function(_0xe5a17a){if(_0xe5a17a){var _0x76994c=typeof _0x52a9b8[_0xc1dd('0x1b')]===_0xc1dd('0x1c')&&typeof _0x52a9b8['limit']==='undefined';var _0x3e7e6f=_0xe5a17a['count'];var _0x35139a=_0x76994c?0x0:_0x52a9b8['offset'];var _0x6198a7=_0x76994c?_0xe5a17a[_0xc1dd('0x1d')]:_0x52a9b8[_0xc1dd('0x1b')]+_0x52a9b8[_0xc1dd('0x1e')];var _0x312054;if(_0x6198a7>=_0x3e7e6f){_0x6198a7=_0x3e7e6f;_0x312054=0xc8;}else{_0x312054=0xce;}_0x104177[_0xc1dd('0x18')](_0x312054);return _0x104177['set'](_0xc1dd('0x1f'),_0x35139a+'-'+_0x6198a7+'/'+_0x3e7e6f)[_0xc1dd('0x1a')](_0xe5a17a);}return null;};}function patchUpdates(_0x5e99a6){return function(_0x3d22bb){try{jsonpatch[_0xc1dd('0x20')](_0x3d22bb,_0x5e99a6,!![]);}catch(_0x3650fd){return BPromise[_0xc1dd('0x21')](_0x3650fd);}return _0x3d22bb[_0xc1dd('0x22')]();};}function saveUpdates(_0x266147,_0x228626){return function(_0x60ef4a){if(_0x60ef4a){return _0x60ef4a['update'](_0x266147)[_0xc1dd('0x23')](function(_0x16a2b0){return _0x16a2b0;});}return null;};}function removeEntity(_0x22f9be,_0x3363ff){return function(_0x5f4c9e){if(_0x5f4c9e){return _0x5f4c9e[_0xc1dd('0x24')]()[_0xc1dd('0x23')](function(){_0x22f9be[_0xc1dd('0x18')](0xcc)[_0xc1dd('0x19')]();});}};}function handleEntityNotFound(_0x16fb8b,_0x1aea60){return function(_0x3c3a32){if(!_0x3c3a32){_0x16fb8b[_0xc1dd('0x17')](0x194);}return _0x3c3a32;};}function handleError(_0x29dc08,_0x41d319){_0x41d319=_0x41d319||0x1f4;return function(_0x1212c3){logger[_0xc1dd('0x25')](_0x1212c3[_0xc1dd('0x26')]);if(_0x1212c3[_0xc1dd('0x27')]){delete _0x1212c3['name'];}_0x29dc08['status'](_0x41d319)[_0xc1dd('0x28')](_0x1212c3);};}exports[_0xc1dd('0x29')]=function(_0x25a651,_0x1e112){var _0x2b5dbe={'raw':!![],'where':{'id':_0x25a651[_0xc1dd('0x2a')]['id']}},_0x39b8ac={};_0x39b8ac['model']=_[_0xc1dd('0x2b')](db[_0xc1dd('0x2c')][_0xc1dd('0x2d')]);_0x39b8ac[_0xc1dd('0x2e')]=_['keys'](_0x25a651[_0xc1dd('0x2e')]);_0x39b8ac[_0xc1dd('0x2f')]=_[_0xc1dd('0x30')](_0x39b8ac['model'],_0x39b8ac[_0xc1dd('0x2e')]);_0x2b5dbe['attributes']=_[_0xc1dd('0x30')](_0x39b8ac[_0xc1dd('0x31')],qs[_0xc1dd('0x32')](_0x25a651['query'][_0xc1dd('0x32')]));_0x2b5dbe[_0xc1dd('0x33')]=_0x2b5dbe[_0xc1dd('0x33')][_0xc1dd('0x34')]?_0x2b5dbe['attributes']:_0x39b8ac[_0xc1dd('0x31')];if(_0x25a651[_0xc1dd('0x2e')][_0xc1dd('0x35')]){_0x2b5dbe['include']=[{'all':!![]}];}_0x2b5dbe=_['merge']({},_0x2b5dbe,_0x25a651[_0xc1dd('0x36')]);return db[_0xc1dd('0x2c')][_0xc1dd('0x37')](_0x2b5dbe)[_0xc1dd('0x23')](handleEntityNotFound(_0x1e112,null))[_0xc1dd('0x23')](respondWithResult(_0x1e112,null))['catch'](handleError(_0x1e112,null));};exports[_0xc1dd('0x38')]=function(_0xe09168,_0x544b71){if(_0xe09168[_0xc1dd('0x39')]['id']){delete _0xe09168[_0xc1dd('0x39')]['id'];}return db[_0xc1dd('0x2c')]['find']({'where':{'id':_0xe09168[_0xc1dd('0x2a')]['id']}})['then'](handleEntityNotFound(_0x544b71,null))[_0xc1dd('0x23')](saveUpdates(_0xe09168[_0xc1dd('0x39')],null))['then'](respondWithResult(_0x544b71,null))[_0xc1dd('0x3a')](handleError(_0x544b71,null));};exports[_0xc1dd('0x24')]=function(_0x28723c,_0x299842){return db[_0xc1dd('0x2c')][_0xc1dd('0x37')]({'where':{'id':_0x28723c[_0xc1dd('0x2a')]['id']}})[_0xc1dd('0x23')](handleEntityNotFound(_0x299842,null))[_0xc1dd('0x23')](removeEntity(_0x299842,null))[_0xc1dd('0x3a')](handleError(_0x299842,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 56fb25f..6a625d6 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 _0xece1=['define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x140d18,_0x5bb6f7){var _0x2a4de4=function(_0xc08464){while(--_0xc08464){_0x140d18['push'](_0x140d18['shift']());}};_0x2a4de4(++_0x5bb6f7);}(_0xece1,0x8a));var _0x1ece=function(_0x29cd1e,_0x4e7512){_0x29cd1e=_0x29cd1e-0x0;var _0x47bb36=_0xece1[_0x29cd1e];return _0x47bb36;};'use strict';var _=require(_0x1ece('0x0'));var util=require(_0x1ece('0x1'));var logger=require(_0x1ece('0x2'))(_0x1ece('0x3'));var moment=require(_0x1ece('0x4'));var BPromise=require(_0x1ece('0x5'));var rp=require(_0x1ece('0x6'));var fs=require('fs');var path=require(_0x1ece('0x7'));var rimraf=require(_0x1ece('0x8'));var config=require(_0x1ece('0x9'));var attributes=require(_0x1ece('0xa'));module[_0x1ece('0xb')]=function(_0xfe0b6c,_0x5a65b6){return _0xfe0b6c[_0x1ece('0xc')](_0x1ece('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ece('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6953=['chat_applications','utf8mb4','lodash','util','bluebird','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x6953,0x91));var _0x3695=function(_0x1ba4c1,_0x3f409f){_0x1ba4c1=_0x1ba4c1-0x0;var _0x42304c=_0x6953[_0x1ba4c1];return _0x42304c;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3695('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3695('0x3'));var rimraf=require(_0x3695('0x4'));var config=require(_0x3695('0x5'));var attributes=require('./chatApplication.attributes');module[_0x3695('0x6')]=function(_0x558026,_0x2d7d98){return _0x558026[_0x3695('0x7')](_0x3695('0x8'),attributes,{'tableName':_0x3695('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3695('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 f144a4b..da1d9a9 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 _0xa58a=['../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x507f9e,_0x308d20){var _0x250f7e=function(_0x144202){while(--_0x144202){_0x507f9e['push'](_0x507f9e['shift']());}};_0x250f7e(++_0x308d20);}(_0xa58a,0x18a));var _0xaa58=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xa58a[_0x58e469];return _0x4c01c5;};'use strict';var _=require('lodash');var util=require(_0xaa58('0x0'));var moment=require(_0xaa58('0x1'));var BPromise=require(_0xaa58('0x2'));var rs=require(_0xaa58('0x3'));var fs=require('fs');var Redis=require(_0xaa58('0x4'));var db=require(_0xaa58('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xaa58('0x6'));var jayson=require(_0xaa58('0x7'));var client=jayson['client'][_0xaa58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a26a9,_0x1802a0,_0x320f8c){return new BPromise(function(_0x9113d4,_0x33e24d){return client[_0xaa58('0x9')](_0x3a26a9,_0x320f8c)[_0xaa58('0xa')](function(_0x234ada){logger[_0xaa58('0xb')](_0xaa58('0xc'),_0x1802a0,'request\x20sent');logger[_0xaa58('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1802a0,_0xaa58('0xe'),JSON[_0xaa58('0xf')](_0x234ada));if(_0x234ada[_0xaa58('0x10')]){if(_0x234ada[_0xaa58('0x10')]['code']===0x1f4){logger['error'](_0xaa58('0xc'),_0x1802a0,_0x234ada[_0xaa58('0x10')]['message']);return _0x33e24d(_0x234ada['error']['message']);}logger[_0xaa58('0x10')](_0xaa58('0xc'),_0x1802a0,_0x234ada[_0xaa58('0x10')][_0xaa58('0x11')]);return _0x9113d4(_0x234ada['error'][_0xaa58('0x11')]);}else{logger[_0xaa58('0xb')](_0xaa58('0xc'),_0x1802a0,_0xaa58('0xe'));_0x9113d4(_0x234ada[_0xaa58('0x12')]['message']);}})[_0xaa58('0x13')](function(_0x167a2a){logger['error'](_0xaa58('0xc'),_0x1802a0,_0x167a2a);_0x33e24d(_0x167a2a);});});}
\ No newline at end of file
+var _0x1838=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','catch','lodash'];(function(_0x59347e,_0x5a45aa){var _0x56cadd=function(_0x34ae1b){while(--_0x34ae1b){_0x59347e['push'](_0x59347e['shift']());}};_0x56cadd(++_0x5a45aa);}(_0x1838,0x1a3));var _0x8183=function(_0x203374,_0x314eb7){_0x203374=_0x203374-0x0;var _0x469bf3=_0x1838[_0x203374];return _0x469bf3;};'use strict';var _=require(_0x8183('0x0'));var util=require('util');var moment=require(_0x8183('0x1'));var BPromise=require('bluebird');var rs=require(_0x8183('0x2'));var fs=require('fs');var Redis=require(_0x8183('0x3'));var db=require(_0x8183('0x4'))['db'];var utils=require(_0x8183('0x5'));var logger=require(_0x8183('0x6'))(_0x8183('0x7'));var config=require(_0x8183('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8183('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcd26c8,_0x394359,_0x362c94){return new BPromise(function(_0x15e265,_0x480f6b){return client[_0x8183('0xa')](_0xcd26c8,_0x362c94)['then'](function(_0x42fe35){logger[_0x8183('0xb')]('ChatApplication,\x20%s,\x20%s',_0x394359,_0x8183('0xc'));logger[_0x8183('0xd')](_0x8183('0xe'),_0x394359,_0x8183('0xc'),JSON[_0x8183('0xf')](_0x42fe35));if(_0x42fe35[_0x8183('0x10')]){if(_0x42fe35[_0x8183('0x10')][_0x8183('0x11')]===0x1f4){logger['error'](_0x8183('0x12'),_0x394359,_0x42fe35['error'][_0x8183('0x13')]);return _0x480f6b(_0x42fe35[_0x8183('0x10')][_0x8183('0x13')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x394359,_0x42fe35[_0x8183('0x10')][_0x8183('0x13')]);return _0x15e265(_0x42fe35['error'][_0x8183('0x13')]);}else{logger[_0x8183('0xb')]('ChatApplication,\x20%s,\x20%s',_0x394359,_0x8183('0xc'));_0x15e265(_0x42fe35['result'][_0x8183('0x13')]);}})[_0x8183('0x14')](function(_0x1f3722){logger[_0x8183('0x10')](_0x8183('0x12'),_0x394359,_0x1f3722);_0x480f6b(_0x1f3722);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index baa1e90..2756adc 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 _0xa209=['express','fs-extra','../../config/environment','./chatApplication.controller','get','put','/:id','delete','isAuthenticated','destroy','multer','util','connect-timeout'];(function(_0x388e6c,_0x2ca243){var _0x3dc6de=function(_0x1dfd84){while(--_0x1dfd84){_0x388e6c['push'](_0x388e6c['shift']());}};_0x3dc6de(++_0x2ca243);}(_0xa209,0x11b));var _0x9a20=function(_0x12a0c5,_0x46b206){_0x12a0c5=_0x12a0c5-0x0;var _0x14e148=_0xa209[_0x12a0c5];return _0x14e148;};'use strict';var multer=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var path=require('path');var timeout=require(_0x9a20('0x2'));var express=require(_0x9a20('0x3'));var router=express['Router']();var fs_extra=require(_0x9a20('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a20('0x5'));var controller=require(_0x9a20('0x6'));router[_0x9a20('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9a20('0x8')](_0x9a20('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x9a20('0xa')](_0x9a20('0x9'),auth[_0x9a20('0xb')](),controller[_0x9a20('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x17b7=['update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','isAuthenticated','show','put','/:id'];(function(_0x464582,_0x3cf4c6){var _0x1e161c=function(_0x236733){while(--_0x236733){_0x464582['push'](_0x464582['shift']());}};_0x1e161c(++_0x3cf4c6);}(_0x17b7,0xc3));var _0x717b=function(_0x1a19f2,_0x44c1eb){_0x1a19f2=_0x1a19f2-0x0;var _0xeb7e0=_0x17b7[_0x1a19f2];return _0xeb7e0;};'use strict';var multer=require(_0x717b('0x0'));var util=require(_0x717b('0x1'));var path=require(_0x717b('0x2'));var timeout=require(_0x717b('0x3'));var express=require(_0x717b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x717b('0x5'));var interaction=require(_0x717b('0x6'));var config=require('../../config/environment');var controller=require(_0x717b('0x7'));router[_0x717b('0x8')]('/:id',auth[_0x717b('0x9')](),controller[_0x717b('0xa')]);router[_0x717b('0xb')](_0x717b('0xc'),auth[_0x717b('0x9')](),controller[_0x717b('0xd')]);router[_0x717b('0xe')](_0x717b('0xc'),auth['isAuthenticated'](),controller[_0x717b('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 39f65c6..e5e86b8 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 _0x3f1b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x582171,_0x443d13){var _0x6e3900=function(_0x399c20){while(--_0x399c20){_0x582171['push'](_0x582171['shift']());}};_0x6e3900(++_0x443d13);}(_0x3f1b,0xcc));var _0xb3f1=function(_0x9b16c6,_0x24be9c){_0x9b16c6=_0x9b16c6-0x0;var _0x21bbd7=_0x3f1b[_0x9b16c6];return _0x21bbd7;};'use strict';var Sequelize=require(_0xb3f1('0x0'));module[_0xb3f1('0x1')]={'name':{'type':Sequelize[_0xb3f1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb3f1('0x2')]},'write':{'type':Sequelize[_0xb3f1('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x961e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1b40cf,_0x341a7a){var _0x16f16b=function(_0x12f14e){while(--_0x12f14e){_0x1b40cf['push'](_0x1b40cf['shift']());}};_0x16f16b(++_0x341a7a);}(_0x961e,0xd2));var _0xe961=function(_0x25ddeb,_0x167818){_0x25ddeb=_0x25ddeb-0x0;var _0x3d5ed5=_0x961e[_0x25ddeb];return _0x3d5ed5;};'use strict';var Sequelize=require(_0xe961('0x0'));module[_0xe961('0x1')]={'name':{'type':Sequelize[_0xe961('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe961('0x2')]},'write':{'type':Sequelize[_0xe961('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 7b30627..d9ff2c5 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 _0x33c9=['show','params','keys','intersection','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','nolimit','removeMembers','addMessage','pick','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','error','stack','name','send','ChatGroup','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','merge','options','includeAll','include','findAll','catch'];(function(_0x15dace,_0x69ab2b){var _0x3a1fa6=function(_0x626b09){while(--_0x626b09){_0x15dace['push'](_0x15dace['shift']());}};_0x3a1fa6(++_0x69ab2b);}(_0x33c9,0xdc));var _0x933c=function(_0x17c4b9,_0x2466fa){_0x17c4b9=_0x17c4b9-0x0;var _0x2c9261=_0x33c9[_0x17c4b9];return _0x2c9261;};'use strict';var emlformat=require(_0x933c('0x0'));var rimraf=require(_0x933c('0x1'));var zipdir=require(_0x933c('0x2'));var jsonpatch=require(_0x933c('0x3'));var rp=require('request-promise');var moment=require(_0x933c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x933c('0x5'));var util=require(_0x933c('0x6'));var path=require(_0x933c('0x7'));var sox=require(_0x933c('0x8'));var csv=require(_0x933c('0x9'));var ejs=require(_0x933c('0xa'));var fs=require('fs');var fs_extra=require(_0x933c('0xb'));var _=require(_0x933c('0xc'));var squel=require('squel');var crypto=require(_0x933c('0xd'));var jsforce=require(_0x933c('0xe'));var deskjs=require(_0x933c('0xf'));var toCsv=require(_0x933c('0x9'));var querystring=require(_0x933c('0x10'));var Papa=require(_0x933c('0x11'));var Redis=require(_0x933c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x933c('0x13'));var as=require(_0x933c('0x14'));var hardwareService=require(_0x933c('0x15'));var logger=require(_0x933c('0x16'))(_0x933c('0x17'));var utils=require(_0x933c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x933c('0x19'));var db=require(_0x933c('0x1a'))['db'];config[_0x933c('0x1b')]=_[_0x933c('0x1c')](config[_0x933c('0x1b')],{'host':_0x933c('0x1d'),'port':0x18eb});var socket=require(_0x933c('0x1e'))(new Redis(config[_0x933c('0x1b')]));require('./chatGroup.socket')[_0x933c('0x1f')](socket);function respondWithStatusCode(_0x17ec8f,_0x5d32a3){_0x5d32a3=_0x5d32a3||0xcc;return function(_0x2d365a){if(_0x2d365a){return _0x17ec8f[_0x933c('0x20')](_0x5d32a3);}return _0x17ec8f[_0x933c('0x21')](_0x5d32a3)[_0x933c('0x22')]();};}function respondWithResult(_0x1aba47,_0x870ec){_0x870ec=_0x870ec||0xc8;return function(_0x24db24){if(_0x24db24){return _0x1aba47[_0x933c('0x21')](_0x870ec)[_0x933c('0x23')](_0x24db24);}};}function respondWithFilteredResult(_0x5b45b2,_0x33a4d1){return function(_0x23f9c){if(_0x23f9c){var _0x27605e=typeof _0x33a4d1[_0x933c('0x24')]==='undefined'&&typeof _0x33a4d1[_0x933c('0x25')]===_0x933c('0x26');var _0x31add8=_0x23f9c[_0x933c('0x27')];var _0xe54ba3=_0x27605e?0x0:_0x33a4d1[_0x933c('0x24')];var _0x442409=_0x27605e?_0x23f9c[_0x933c('0x27')]:_0x33a4d1[_0x933c('0x24')]+_0x33a4d1['limit'];var _0x2875ed;if(_0x442409>=_0x31add8){_0x442409=_0x31add8;_0x2875ed=0xc8;}else{_0x2875ed=0xce;}_0x5b45b2['status'](_0x2875ed);return _0x5b45b2[_0x933c('0x28')](_0x933c('0x29'),_0xe54ba3+'-'+_0x442409+'/'+_0x31add8)[_0x933c('0x23')](_0x23f9c);}return null;};}function patchUpdates(_0x200057){return function(_0x4c4649){try{jsonpatch['apply'](_0x4c4649,_0x200057,!![]);}catch(_0x30b499){return BPromise[_0x933c('0x2a')](_0x30b499);}return _0x4c4649['save']();};}function saveUpdates(_0x58d5e0,_0x41f54e){return function(_0x30eefa){if(_0x30eefa){return _0x30eefa[_0x933c('0x2b')](_0x58d5e0)[_0x933c('0x2c')](function(_0x160164){return _0x160164;});}return null;};}function removeEntity(_0x27885d,_0xe279cd){return function(_0x5a5878){if(_0x5a5878){return _0x5a5878['destroy']()[_0x933c('0x2c')](function(){_0x27885d[_0x933c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fed5d,_0x4119d4){return function(_0x28959f){if(!_0x28959f){_0x4fed5d[_0x933c('0x20')](0x194);}return _0x28959f;};}function handleError(_0x2f73f5,_0x3fa99b){_0x3fa99b=_0x3fa99b||0x1f4;return function(_0x15f966){logger[_0x933c('0x2d')](_0x15f966[_0x933c('0x2e')]);if(_0x15f966[_0x933c('0x2f')]){delete _0x15f966[_0x933c('0x2f')];}_0x2f73f5['status'](_0x3fa99b)[_0x933c('0x30')](_0x15f966);};}exports['index']=function(_0x3d8c20,_0x126543){var _0xa371d7={},_0x3a5db4={},_0x4e6536={'count':0x0,'rows':[]};var _0x1d4163=_['map'](db[_0x933c('0x31')]['rawAttributes'],function(_0x14abef){return{'name':_0x14abef[_0x933c('0x32')],'type':_0x14abef[_0x933c('0x33')][_0x933c('0x34')]};});_0x3a5db4[_0x933c('0x35')]=_['map'](_0x1d4163,'name');_0x3a5db4[_0x933c('0x36')]=_['keys'](_0x3d8c20['query']);_0x3a5db4[_0x933c('0x37')]=_['intersection'](_0x3a5db4[_0x933c('0x35')],_0x3a5db4[_0x933c('0x36')]);_0xa371d7[_0x933c('0x38')]=_['intersection'](_0x3a5db4[_0x933c('0x35')],qs[_0x933c('0x39')](_0x3d8c20['query'][_0x933c('0x39')]));_0xa371d7[_0x933c('0x38')]=_0xa371d7[_0x933c('0x38')][_0x933c('0x3a')]?_0xa371d7[_0x933c('0x38')]:_0x3a5db4[_0x933c('0x35')];if(!_0x3d8c20[_0x933c('0x36')][_0x933c('0x3b')]('nolimit')){_0xa371d7[_0x933c('0x25')]=qs[_0x933c('0x25')](_0x3d8c20[_0x933c('0x36')][_0x933c('0x25')]);_0xa371d7[_0x933c('0x24')]=qs[_0x933c('0x24')](_0x3d8c20[_0x933c('0x36')][_0x933c('0x24')]);}_0xa371d7[_0x933c('0x3c')]=qs[_0x933c('0x3d')](_0x3d8c20[_0x933c('0x36')][_0x933c('0x3d')]);_0xa371d7[_0x933c('0x3e')]=qs[_0x933c('0x37')](_['pick'](_0x3d8c20[_0x933c('0x36')],_0x3a5db4[_0x933c('0x37')]),_0x1d4163);if(_0x3d8c20[_0x933c('0x36')][_0x933c('0x3f')]){_0xa371d7['where']=_['merge'](_0xa371d7['where'],{'$or':_[_0x933c('0x40')](_0x1d4163,function(_0xb2e538){if(_0xb2e538[_0x933c('0x33')]!=='VIRTUAL'){var _0x44ee01={};_0x44ee01[_0xb2e538[_0x933c('0x2f')]]={'$like':'%'+_0x3d8c20[_0x933c('0x36')][_0x933c('0x3f')]+'%'};return _0x44ee01;}})});}_0xa371d7=_[_0x933c('0x41')]({},_0xa371d7,_0x3d8c20[_0x933c('0x42')]);var _0x5d0354={'where':_0xa371d7['where']};return db[_0x933c('0x31')][_0x933c('0x27')](_0x5d0354)['then'](function(_0x320166){_0x4e6536[_0x933c('0x27')]=_0x320166;if(_0x3d8c20['query'][_0x933c('0x43')]){_0xa371d7[_0x933c('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x933c('0x45')](_0xa371d7);})[_0x933c('0x2c')](function(_0x4a744b){_0x4e6536['rows']=_0x4a744b;return _0x4e6536;})[_0x933c('0x2c')](respondWithFilteredResult(_0x126543,_0xa371d7))[_0x933c('0x46')](handleError(_0x126543,null));};exports[_0x933c('0x47')]=function(_0x4ce709,_0x2d8b4a){var _0x15fb4c={'raw':!![],'where':{'id':_0x4ce709[_0x933c('0x48')]['id']}},_0x3b1c30={};_0x3b1c30['model']=_[_0x933c('0x49')](db['ChatGroup']['rawAttributes']);_0x3b1c30[_0x933c('0x36')]=_['keys'](_0x4ce709[_0x933c('0x36')]);_0x3b1c30[_0x933c('0x37')]=_[_0x933c('0x4a')](_0x3b1c30[_0x933c('0x35')],_0x3b1c30[_0x933c('0x36')]);_0x15fb4c[_0x933c('0x38')]=_['intersection'](_0x3b1c30['model'],qs[_0x933c('0x39')](_0x4ce709[_0x933c('0x36')][_0x933c('0x39')]));_0x15fb4c['attributes']=_0x15fb4c[_0x933c('0x38')][_0x933c('0x3a')]?_0x15fb4c[_0x933c('0x38')]:_0x3b1c30[_0x933c('0x35')];if(_0x4ce709[_0x933c('0x36')][_0x933c('0x43')]){_0x15fb4c[_0x933c('0x44')]=[{'all':!![]}];}_0x15fb4c=_[_0x933c('0x41')]({},_0x15fb4c,_0x4ce709[_0x933c('0x42')]);return db[_0x933c('0x31')][_0x933c('0x4b')](_0x15fb4c)[_0x933c('0x2c')](handleEntityNotFound(_0x2d8b4a,null))['then'](respondWithResult(_0x2d8b4a,null))[_0x933c('0x46')](handleError(_0x2d8b4a,null));};exports[_0x933c('0x4c')]=function(_0x2ca4be,_0x1f28c6){return db[_0x933c('0x31')][_0x933c('0x4c')](_0x2ca4be['body'],{})[_0x933c('0x2c')](respondWithResult(_0x1f28c6,0xc9))[_0x933c('0x46')](handleError(_0x1f28c6,null));};exports[_0x933c('0x2b')]=function(_0x89e168,_0x116b15){if(_0x89e168[_0x933c('0x4d')]['id']){delete _0x89e168['body']['id'];}return db[_0x933c('0x31')][_0x933c('0x4b')]({'where':{'id':_0x89e168[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x116b15,null))[_0x933c('0x2c')](saveUpdates(_0x89e168['body'],null))['then'](respondWithResult(_0x116b15,null))[_0x933c('0x46')](handleError(_0x116b15,null));};exports['destroy']=function(_0xa37bbc,_0x599193){return db[_0x933c('0x31')][_0x933c('0x4b')]({'where':{'id':_0xa37bbc[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x599193,null))[_0x933c('0x2c')](removeEntity(_0x599193,null))[_0x933c('0x46')](handleError(_0x599193,null));};exports['describe']=function(_0x257827,_0x11118d){return db[_0x933c('0x31')][_0x933c('0x4e')]()['then'](respondWithResult(_0x11118d,null))[_0x933c('0x46')](handleError(_0x11118d,null));};exports['getUnread']=function(_0xa385da,_0x4e0e24,_0x15878c){return db[_0x933c('0x4f')][_0x933c('0x27')]({'where':{'ChatGroupId':_0xa385da['params']['id'],'ToId':_0xa385da[_0x933c('0x50')]['id'],'read':![]}})[_0x933c('0x2c')](function(_0x4cb64e){return{'id':_[_0x933c('0x51')](_0xa385da[_0x933c('0x48')]['id']),'count':_0x4cb64e};})['then'](respondWithResult(_0x4e0e24,null))[_0x933c('0x46')](handleError(_0x4e0e24,null));};exports['addMembers']=function(_0x4075d1,_0x2bd48f,_0x4b995c){return db['ChatGroup']['find']({'where':{'id':_0x4075d1[_0x933c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2bd48f,null))[_0x933c('0x2c')](function(_0x520ab7){if(_0x520ab7){return _0x520ab7[_0x933c('0x52')](_0x4075d1[_0x933c('0x4d')][_0x933c('0x53')],_[_0x933c('0x54')](_0x4075d1['body'],[_0x933c('0x53'),'id'])||{});}})[_0x933c('0x2c')](respondWithResult(_0x2bd48f,null))[_0x933c('0x46')](handleError(_0x2bd48f,null));};exports[_0x933c('0x55')]=function(_0x291935,_0x57aeb2,_0x2f8493){var _0x24b80c={};var _0x14cdfa={};var _0xb49de6;var _0x35e457;return db[_0x933c('0x31')][_0x933c('0x56')]({'where':{'id':_0x291935[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x57aeb2,null))[_0x933c('0x2c')](function(_0x38cafd){if(_0x38cafd){_0xb49de6=_0x38cafd;_0x14cdfa[_0x933c('0x35')]=_[_0x933c('0x49')](db[_0x933c('0x57')][_0x933c('0x58')]);_0x14cdfa['query']=_[_0x933c('0x49')](_0x291935[_0x933c('0x36')]);_0x14cdfa['filters']=_[_0x933c('0x4a')](_0x14cdfa[_0x933c('0x35')],_0x14cdfa['query']);_0x24b80c['attributes']=_[_0x933c('0x4a')](_0x14cdfa[_0x933c('0x35')],qs[_0x933c('0x39')](_0x291935[_0x933c('0x36')][_0x933c('0x39')]));_0x24b80c[_0x933c('0x38')]=_0x24b80c['attributes'][_0x933c('0x3a')]?_0x24b80c[_0x933c('0x38')]:_0x14cdfa['model'];_0x24b80c[_0x933c('0x3c')]=qs[_0x933c('0x3d')](_0x291935[_0x933c('0x36')][_0x933c('0x3d')]);_0x24b80c[_0x933c('0x3e')]=qs[_0x933c('0x37')](_['pick'](_0x291935[_0x933c('0x36')],_0x14cdfa[_0x933c('0x37')]));if(_0x291935['query']['filter']){_0x24b80c[_0x933c('0x3e')]=_[_0x933c('0x41')](_0x24b80c[_0x933c('0x3e')],{'$or':_[_0x933c('0x40')](_0x24b80c['attributes'],function(_0x86b9){var _0x22f97c={};_0x22f97c[_0x86b9]={'$like':'%'+_0x291935[_0x933c('0x36')][_0x933c('0x3f')]+'%'};return _0x22f97c;})});}_0x24b80c=_[_0x933c('0x41')]({},_0x24b80c,_0x291935['options']);return _0xb49de6[_0x933c('0x55')](_0x24b80c);}})[_0x933c('0x2c')](function(_0x35daf9){if(_0x35daf9){_0x35e457=_0x35daf9[_0x933c('0x3a')];if(!_0x291935['query'][_0x933c('0x3b')](_0x933c('0x59'))){_0x24b80c['limit']=qs['limit'](_0x291935[_0x933c('0x36')][_0x933c('0x25')]);_0x24b80c[_0x933c('0x24')]=qs['offset'](_0x291935[_0x933c('0x36')][_0x933c('0x24')]);}return _0xb49de6[_0x933c('0x55')](_0x24b80c);}})[_0x933c('0x2c')](function(_0x443f05){if(_0x443f05){return _0x443f05?{'count':_0x35e457,'rows':_0x443f05}:null;}})[_0x933c('0x2c')](respondWithResult(_0x57aeb2,null))[_0x933c('0x46')](handleError(_0x57aeb2,null));};exports[_0x933c('0x5a')]=function(_0x593b04,_0x899154,_0x103dd7){return db['ChatGroup'][_0x933c('0x4b')]({'where':{'id':_0x593b04['params']['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x899154,null))[_0x933c('0x2c')](function(_0x45c957){if(_0x45c957){return _0x45c957[_0x933c('0x5a')](_0x593b04[_0x933c('0x36')]['ids']);}})[_0x933c('0x2c')](respondWithStatusCode(_0x899154,null))['catch'](handleError(_0x899154,null));};exports[_0x933c('0x5b')]=function(_0x2f2c7b,_0x22d268,_0xd7f511){if(_0x2f2c7b[_0x933c('0x4d')]['id']){delete _0x2f2c7b[_0x933c('0x4d')]['id'];}return db[_0x933c('0x31')][_0x933c('0x4b')]({'where':{'id':_0x2f2c7b[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x22d268,null))['then'](function(_0x27cd75){if(_0x27cd75){_0x2f2c7b[_0x933c('0x4d')]['ChatGroupId']=_0x27cd75['id'];return db[_0x933c('0x4f')][_0x933c('0x4c')](_0x2f2c7b['body']);}})[_0x933c('0x2c')](respondWithResult(_0x22d268,null))[_0x933c('0x46')](handleError(_0x22d268,null));};exports['getMessages']=function(_0x1b66a3,_0x585595,_0x5d0686){var _0x12f3c0={};var _0x2d1445={};var _0x11a68e;var _0x12589e;return db[_0x933c('0x31')][_0x933c('0x56')]({'where':{'id':_0x1b66a3[_0x933c('0x48')]['id']}})[_0x933c('0x2c')](handleEntityNotFound(_0x585595,null))[_0x933c('0x2c')](function(_0x665735){if(_0x665735){_0x11a68e=_0x665735;_0x2d1445['model']=_[_0x933c('0x49')](db[_0x933c('0x4f')]['rawAttributes']);_0x2d1445[_0x933c('0x36')]=_[_0x933c('0x49')](_0x1b66a3[_0x933c('0x36')]);_0x2d1445[_0x933c('0x37')]=_['intersection'](_0x2d1445['model'],_0x2d1445[_0x933c('0x36')]);_0x12f3c0[_0x933c('0x38')]=_[_0x933c('0x4a')](_0x2d1445[_0x933c('0x35')],qs[_0x933c('0x39')](_0x1b66a3[_0x933c('0x36')][_0x933c('0x39')]));_0x12f3c0['attributes']=_0x12f3c0[_0x933c('0x38')][_0x933c('0x3a')]?_0x12f3c0[_0x933c('0x38')]:_0x2d1445['model'];_0x12f3c0[_0x933c('0x3c')]=qs[_0x933c('0x3d')](_0x1b66a3[_0x933c('0x36')][_0x933c('0x3d')]);_0x12f3c0[_0x933c('0x3e')]=qs[_0x933c('0x37')](_[_0x933c('0x5c')](_0x1b66a3[_0x933c('0x36')],_0x2d1445[_0x933c('0x37')]));if(_0x1b66a3[_0x933c('0x36')][_0x933c('0x3f')]){_0x12f3c0['where']=_[_0x933c('0x41')](_0x12f3c0[_0x933c('0x3e')],{'$or':_[_0x933c('0x40')](_0x12f3c0[_0x933c('0x38')],function(_0x36300f){var _0x10f966={};_0x10f966[_0x36300f]={'$like':'%'+_0x1b66a3[_0x933c('0x36')]['filter']+'%'};return _0x10f966;})});}if(_0x1b66a3['query'][_0x933c('0x5d')]){var _0x5a6835=_0x1b66a3[_0x933c('0x36')][_0x933c('0x5d')][_0x933c('0x5e')](',');var _0x33d1b0={};_0x33d1b0[_0x5a6835[0x0]]={'$gte':moment(_0x5a6835[0x1])['format'](_0x933c('0x5f'))};_0x12f3c0[_0x933c('0x3e')]=_[_0x933c('0x41')](_0x12f3c0['where'],_0x33d1b0);}_0x12f3c0=_[_0x933c('0x41')]({},_0x12f3c0,_0x1b66a3['options']);return _0x11a68e[_0x933c('0x60')](_0x12f3c0);}})[_0x933c('0x2c')](function(_0x10b495){if(_0x10b495){_0x12589e=_0x10b495['length'];if(!_0x1b66a3[_0x933c('0x36')][_0x933c('0x3b')](_0x933c('0x59'))){_0x12f3c0[_0x933c('0x25')]=qs['limit'](_0x1b66a3[_0x933c('0x36')][_0x933c('0x25')]);_0x12f3c0['offset']=qs[_0x933c('0x24')](_0x1b66a3[_0x933c('0x36')][_0x933c('0x24')]);}return _0x11a68e[_0x933c('0x60')](_0x12f3c0);}})[_0x933c('0x2c')](function(_0x5977bf){if(_0x5977bf){return _0x5977bf?{'count':_0x12589e,'rows':_0x5977bf}:null;}})[_0x933c('0x2c')](respondWithResult(_0x585595,null))[_0x933c('0x46')](handleError(_0x585595,null));};
\ No newline at end of file
+var _0x14d4=['catch','create','body','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','stack','name','send','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','includeAll','include','findAll','rows','show','params','rawAttributes'];(function(_0x21b916,_0x2f1c29){var _0x4df8bc=function(_0x33de8c){while(--_0x33de8c){_0x21b916['push'](_0x21b916['shift']());}};_0x4df8bc(++_0x2f1c29);}(_0x14d4,0x78));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x414d('0x0'));var rimraf=require(_0x414d('0x1'));var zipdir=require(_0x414d('0x2'));var jsonpatch=require(_0x414d('0x3'));var rp=require(_0x414d('0x4'));var moment=require(_0x414d('0x5'));var BPromise=require(_0x414d('0x6'));var Mustache=require(_0x414d('0x7'));var util=require(_0x414d('0x8'));var path=require(_0x414d('0x9'));var sox=require(_0x414d('0xa'));var csv=require(_0x414d('0xb'));var ejs=require(_0x414d('0xc'));var fs=require('fs');var fs_extra=require(_0x414d('0xd'));var _=require(_0x414d('0xe'));var squel=require(_0x414d('0xf'));var crypto=require('crypto');var jsforce=require(_0x414d('0x10'));var deskjs=require(_0x414d('0x11'));var toCsv=require(_0x414d('0xb'));var querystring=require('querystring');var Papa=require(_0x414d('0x12'));var Redis=require(_0x414d('0x13'));var authService=require(_0x414d('0x14'));var qs=require(_0x414d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x414d('0x16'))('api');var utils=require(_0x414d('0x17'));var config=require(_0x414d('0x18'));var licenseUtil=require(_0x414d('0x19'));var db=require('../../mysqldb')['db'];config[_0x414d('0x1a')]=_[_0x414d('0x1b')](config[_0x414d('0x1a')],{'host':_0x414d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x414d('0x1a')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0xf93be2,_0x565dcc){_0x565dcc=_0x565dcc||0xcc;return function(_0x2ba939){if(_0x2ba939){return _0xf93be2[_0x414d('0x1d')](_0x565dcc);}return _0xf93be2[_0x414d('0x1e')](_0x565dcc)['end']();};}function respondWithResult(_0x33f141,_0x576fe1){_0x576fe1=_0x576fe1||0xc8;return function(_0x520e05){if(_0x520e05){return _0x33f141[_0x414d('0x1e')](_0x576fe1)[_0x414d('0x1f')](_0x520e05);}};}function respondWithFilteredResult(_0x485858,_0x32b806){return function(_0x20e8de){if(_0x20e8de){var _0x44e5ef=typeof _0x32b806[_0x414d('0x20')]===_0x414d('0x21')&&typeof _0x32b806[_0x414d('0x22')]===_0x414d('0x21');var _0x3270a4=_0x20e8de[_0x414d('0x23')];var _0x5bc72b=_0x44e5ef?0x0:_0x32b806[_0x414d('0x20')];var _0x51bc87=_0x44e5ef?_0x20e8de['count']:_0x32b806[_0x414d('0x20')]+_0x32b806[_0x414d('0x22')];var _0x9a2c3b;if(_0x51bc87>=_0x3270a4){_0x51bc87=_0x3270a4;_0x9a2c3b=0xc8;}else{_0x9a2c3b=0xce;}_0x485858[_0x414d('0x1e')](_0x9a2c3b);return _0x485858[_0x414d('0x24')](_0x414d('0x25'),_0x5bc72b+'-'+_0x51bc87+'/'+_0x3270a4)[_0x414d('0x1f')](_0x20e8de);}return null;};}function patchUpdates(_0x170882){return function(_0x43da98){try{jsonpatch['apply'](_0x43da98,_0x170882,!![]);}catch(_0x494875){return BPromise[_0x414d('0x26')](_0x494875);}return _0x43da98[_0x414d('0x27')]();};}function saveUpdates(_0x26406a,_0x510d03){return function(_0x4a5481){if(_0x4a5481){return _0x4a5481[_0x414d('0x28')](_0x26406a)['then'](function(_0x516bbd){return _0x516bbd;});}return null;};}function removeEntity(_0x511018,_0x4ec885){return function(_0x5b554d){if(_0x5b554d){return _0x5b554d['destroy']()[_0x414d('0x29')](function(){_0x511018[_0x414d('0x1e')](0xcc)[_0x414d('0x2a')]();});}};}function handleEntityNotFound(_0x4200b7,_0x51205f){return function(_0x3f60e0){if(!_0x3f60e0){_0x4200b7[_0x414d('0x1d')](0x194);}return _0x3f60e0;};}function handleError(_0xad511f,_0x20d904){_0x20d904=_0x20d904||0x1f4;return function(_0x2912f1){logger['error'](_0x2912f1[_0x414d('0x2b')]);if(_0x2912f1[_0x414d('0x2c')]){delete _0x2912f1['name'];}_0xad511f[_0x414d('0x1e')](_0x20d904)[_0x414d('0x2d')](_0x2912f1);};}exports['index']=function(_0x4ed3fa,_0x3ae9a0){var _0xb245d5={},_0x49ce83={},_0x1d87ef={'count':0x0,'rows':[]};var _0x16149c=_['map'](db['ChatGroup']['rawAttributes'],function(_0x297354){return{'name':_0x297354[_0x414d('0x2e')],'type':_0x297354[_0x414d('0x2f')][_0x414d('0x30')]};});_0x49ce83['model']=_[_0x414d('0x31')](_0x16149c,_0x414d('0x2c'));_0x49ce83[_0x414d('0x32')]=_[_0x414d('0x33')](_0x4ed3fa[_0x414d('0x32')]);_0x49ce83[_0x414d('0x34')]=_[_0x414d('0x35')](_0x49ce83[_0x414d('0x36')],_0x49ce83[_0x414d('0x32')]);_0xb245d5[_0x414d('0x37')]=_[_0x414d('0x35')](_0x49ce83[_0x414d('0x36')],qs[_0x414d('0x38')](_0x4ed3fa['query'][_0x414d('0x38')]));_0xb245d5['attributes']=_0xb245d5['attributes'][_0x414d('0x39')]?_0xb245d5[_0x414d('0x37')]:_0x49ce83[_0x414d('0x36')];if(!_0x4ed3fa[_0x414d('0x32')][_0x414d('0x3a')]('nolimit')){_0xb245d5['limit']=qs[_0x414d('0x22')](_0x4ed3fa['query'][_0x414d('0x22')]);_0xb245d5[_0x414d('0x20')]=qs['offset'](_0x4ed3fa[_0x414d('0x32')][_0x414d('0x20')]);}_0xb245d5[_0x414d('0x3b')]=qs[_0x414d('0x3c')](_0x4ed3fa['query'][_0x414d('0x3c')]);_0xb245d5[_0x414d('0x3d')]=qs[_0x414d('0x34')](_[_0x414d('0x3e')](_0x4ed3fa[_0x414d('0x32')],_0x49ce83[_0x414d('0x34')]),_0x16149c);if(_0x4ed3fa[_0x414d('0x32')][_0x414d('0x3f')]){_0xb245d5[_0x414d('0x3d')]=_[_0x414d('0x40')](_0xb245d5[_0x414d('0x3d')],{'$or':_[_0x414d('0x31')](_0x16149c,function(_0x3d744c){if(_0x3d744c[_0x414d('0x2f')]!==_0x414d('0x41')){var _0x36fb91={};_0x36fb91[_0x3d744c[_0x414d('0x2c')]]={'$like':'%'+_0x4ed3fa[_0x414d('0x32')][_0x414d('0x3f')]+'%'};return _0x36fb91;}})});}_0xb245d5=_[_0x414d('0x40')]({},_0xb245d5,_0x4ed3fa['options']);var _0x5e1fa2={'where':_0xb245d5[_0x414d('0x3d')]};return db[_0x414d('0x42')][_0x414d('0x23')](_0x5e1fa2)['then'](function(_0x3b96a8){_0x1d87ef[_0x414d('0x23')]=_0x3b96a8;if(_0x4ed3fa[_0x414d('0x32')][_0x414d('0x43')]){_0xb245d5[_0x414d('0x44')]=[{'all':!![]}];}return db[_0x414d('0x42')][_0x414d('0x45')](_0xb245d5);})[_0x414d('0x29')](function(_0x2e5122){_0x1d87ef[_0x414d('0x46')]=_0x2e5122;return _0x1d87ef;})[_0x414d('0x29')](respondWithFilteredResult(_0x3ae9a0,_0xb245d5))['catch'](handleError(_0x3ae9a0,null));};exports[_0x414d('0x47')]=function(_0xb51350,_0x40a092){var _0x21cf34={'raw':!![],'where':{'id':_0xb51350[_0x414d('0x48')]['id']}},_0x2c2c8d={};_0x2c2c8d['model']=_[_0x414d('0x33')](db[_0x414d('0x42')][_0x414d('0x49')]);_0x2c2c8d[_0x414d('0x32')]=_['keys'](_0xb51350[_0x414d('0x32')]);_0x2c2c8d[_0x414d('0x34')]=_[_0x414d('0x35')](_0x2c2c8d[_0x414d('0x36')],_0x2c2c8d[_0x414d('0x32')]);_0x21cf34[_0x414d('0x37')]=_[_0x414d('0x35')](_0x2c2c8d['model'],qs[_0x414d('0x38')](_0xb51350[_0x414d('0x32')][_0x414d('0x38')]));_0x21cf34['attributes']=_0x21cf34[_0x414d('0x37')]['length']?_0x21cf34[_0x414d('0x37')]:_0x2c2c8d[_0x414d('0x36')];if(_0xb51350[_0x414d('0x32')][_0x414d('0x43')]){_0x21cf34[_0x414d('0x44')]=[{'all':!![]}];}_0x21cf34=_[_0x414d('0x40')]({},_0x21cf34,_0xb51350['options']);return db[_0x414d('0x42')]['find'](_0x21cf34)[_0x414d('0x29')](handleEntityNotFound(_0x40a092,null))[_0x414d('0x29')](respondWithResult(_0x40a092,null))[_0x414d('0x4a')](handleError(_0x40a092,null));};exports[_0x414d('0x4b')]=function(_0x72e8e9,_0x457767){return db[_0x414d('0x42')]['create'](_0x72e8e9[_0x414d('0x4c')],{})[_0x414d('0x29')](respondWithResult(_0x457767,0xc9))[_0x414d('0x4a')](handleError(_0x457767,null));};exports['update']=function(_0xc4d472,_0x3f4cf9){if(_0xc4d472[_0x414d('0x4c')]['id']){delete _0xc4d472[_0x414d('0x4c')]['id'];}return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0xc4d472[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x3f4cf9,null))[_0x414d('0x29')](saveUpdates(_0xc4d472[_0x414d('0x4c')],null))[_0x414d('0x29')](respondWithResult(_0x3f4cf9,null))[_0x414d('0x4a')](handleError(_0x3f4cf9,null));};exports[_0x414d('0x4e')]=function(_0x1c3090,_0x2005e0){return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0x1c3090[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x2005e0,null))[_0x414d('0x29')](removeEntity(_0x2005e0,null))[_0x414d('0x4a')](handleError(_0x2005e0,null));};exports[_0x414d('0x4f')]=function(_0x9d42c3,_0x427412){return db[_0x414d('0x42')]['describe']()[_0x414d('0x29')](respondWithResult(_0x427412,null))[_0x414d('0x4a')](handleError(_0x427412,null));};exports[_0x414d('0x50')]=function(_0x368cc0,_0x2a5e28,_0x55f829){return db[_0x414d('0x51')][_0x414d('0x23')]({'where':{'ChatGroupId':_0x368cc0[_0x414d('0x48')]['id'],'ToId':_0x368cc0[_0x414d('0x52')]['id'],'read':![]}})[_0x414d('0x29')](function(_0x3c7733){return{'id':_[_0x414d('0x53')](_0x368cc0[_0x414d('0x48')]['id']),'count':_0x3c7733};})[_0x414d('0x29')](respondWithResult(_0x2a5e28,null))[_0x414d('0x4a')](handleError(_0x2a5e28,null));};exports[_0x414d('0x54')]=function(_0x14ddb7,_0x260b52,_0x166deb){return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0x14ddb7[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x260b52,null))['then'](function(_0x421a2b){if(_0x421a2b){return _0x421a2b[_0x414d('0x54')](_0x14ddb7['body'][_0x414d('0x55')],_['omit'](_0x14ddb7[_0x414d('0x4c')],['ids','id'])||{});}})[_0x414d('0x29')](respondWithResult(_0x260b52,null))['catch'](handleError(_0x260b52,null));};exports['getMembers']=function(_0x52ef8a,_0x4a1b39,_0x5da766){var _0x389187={};var _0x1bc860={};var _0x2b529b;var _0x1f5f70;return db[_0x414d('0x42')]['findOne']({'where':{'id':_0x52ef8a[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x4a1b39,null))[_0x414d('0x29')](function(_0x142a4b){if(_0x142a4b){_0x2b529b=_0x142a4b;_0x1bc860[_0x414d('0x36')]=_['keys'](db['User'][_0x414d('0x49')]);_0x1bc860[_0x414d('0x32')]=_[_0x414d('0x33')](_0x52ef8a[_0x414d('0x32')]);_0x1bc860[_0x414d('0x34')]=_[_0x414d('0x35')](_0x1bc860['model'],_0x1bc860[_0x414d('0x32')]);_0x389187['attributes']=_[_0x414d('0x35')](_0x1bc860[_0x414d('0x36')],qs['fields'](_0x52ef8a['query'][_0x414d('0x38')]));_0x389187[_0x414d('0x37')]=_0x389187[_0x414d('0x37')][_0x414d('0x39')]?_0x389187[_0x414d('0x37')]:_0x1bc860[_0x414d('0x36')];_0x389187['order']=qs[_0x414d('0x3c')](_0x52ef8a[_0x414d('0x32')][_0x414d('0x3c')]);_0x389187[_0x414d('0x3d')]=qs[_0x414d('0x34')](_['pick'](_0x52ef8a['query'],_0x1bc860[_0x414d('0x34')]));if(_0x52ef8a[_0x414d('0x32')][_0x414d('0x3f')]){_0x389187[_0x414d('0x3d')]=_[_0x414d('0x40')](_0x389187[_0x414d('0x3d')],{'$or':_['map'](_0x389187[_0x414d('0x37')],function(_0x1fa70f){var _0x49b11e={};_0x49b11e[_0x1fa70f]={'$like':'%'+_0x52ef8a[_0x414d('0x32')][_0x414d('0x3f')]+'%'};return _0x49b11e;})});}_0x389187=_[_0x414d('0x40')]({},_0x389187,_0x52ef8a['options']);return _0x2b529b[_0x414d('0x56')](_0x389187);}})[_0x414d('0x29')](function(_0x2bff97){if(_0x2bff97){_0x1f5f70=_0x2bff97['length'];if(!_0x52ef8a[_0x414d('0x32')][_0x414d('0x3a')](_0x414d('0x57'))){_0x389187[_0x414d('0x22')]=qs['limit'](_0x52ef8a[_0x414d('0x32')]['limit']);_0x389187[_0x414d('0x20')]=qs[_0x414d('0x20')](_0x52ef8a['query']['offset']);}return _0x2b529b[_0x414d('0x56')](_0x389187);}})['then'](function(_0x2982e4){if(_0x2982e4){return _0x2982e4?{'count':_0x1f5f70,'rows':_0x2982e4}:null;}})[_0x414d('0x29')](respondWithResult(_0x4a1b39,null))['catch'](handleError(_0x4a1b39,null));};exports['removeMembers']=function(_0xfefb3e,_0x28198c,_0x13ad4b){return db['ChatGroup']['find']({'where':{'id':_0xfefb3e[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x28198c,null))[_0x414d('0x29')](function(_0x2b7f53){if(_0x2b7f53){return _0x2b7f53[_0x414d('0x58')](_0xfefb3e[_0x414d('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x28198c,null))[_0x414d('0x4a')](handleError(_0x28198c,null));};exports[_0x414d('0x59')]=function(_0x13951f,_0x3fe896,_0x1829be){if(_0x13951f['body']['id']){delete _0x13951f[_0x414d('0x4c')]['id'];}return db[_0x414d('0x42')][_0x414d('0x4d')]({'where':{'id':_0x13951f[_0x414d('0x48')]['id']}})['then'](handleEntityNotFound(_0x3fe896,null))[_0x414d('0x29')](function(_0x1b399d){if(_0x1b399d){_0x13951f[_0x414d('0x4c')][_0x414d('0x5a')]=_0x1b399d['id'];return db['ChatInternalMessage'][_0x414d('0x4b')](_0x13951f[_0x414d('0x4c')]);}})['then'](respondWithResult(_0x3fe896,null))['catch'](handleError(_0x3fe896,null));};exports[_0x414d('0x5b')]=function(_0x96f052,_0x5af5fc,_0x47b508){var _0x30f1eb={};var _0x2e874c={};var _0x7a67b9;var _0x4aba48;return db['ChatGroup'][_0x414d('0x5c')]({'where':{'id':_0x96f052[_0x414d('0x48')]['id']}})[_0x414d('0x29')](handleEntityNotFound(_0x5af5fc,null))[_0x414d('0x29')](function(_0x22f024){if(_0x22f024){_0x7a67b9=_0x22f024;_0x2e874c[_0x414d('0x36')]=_[_0x414d('0x33')](db[_0x414d('0x51')]['rawAttributes']);_0x2e874c['query']=_['keys'](_0x96f052[_0x414d('0x32')]);_0x2e874c[_0x414d('0x34')]=_[_0x414d('0x35')](_0x2e874c[_0x414d('0x36')],_0x2e874c[_0x414d('0x32')]);_0x30f1eb['attributes']=_[_0x414d('0x35')](_0x2e874c[_0x414d('0x36')],qs[_0x414d('0x38')](_0x96f052[_0x414d('0x32')][_0x414d('0x38')]));_0x30f1eb[_0x414d('0x37')]=_0x30f1eb[_0x414d('0x37')][_0x414d('0x39')]?_0x30f1eb[_0x414d('0x37')]:_0x2e874c[_0x414d('0x36')];_0x30f1eb['order']=qs[_0x414d('0x3c')](_0x96f052[_0x414d('0x32')][_0x414d('0x3c')]);_0x30f1eb[_0x414d('0x3d')]=qs[_0x414d('0x34')](_[_0x414d('0x3e')](_0x96f052[_0x414d('0x32')],_0x2e874c[_0x414d('0x34')]));if(_0x96f052[_0x414d('0x32')][_0x414d('0x3f')]){_0x30f1eb[_0x414d('0x3d')]=_['merge'](_0x30f1eb['where'],{'$or':_[_0x414d('0x31')](_0x30f1eb[_0x414d('0x37')],function(_0x387b2a){var _0x773189={};_0x773189[_0x387b2a]={'$like':'%'+_0x96f052[_0x414d('0x32')]['filter']+'%'};return _0x773189;})});}if(_0x96f052['query'][_0x414d('0x5d')]){var _0x5c826f=_0x96f052[_0x414d('0x32')][_0x414d('0x5d')][_0x414d('0x5e')](',');var _0x458e54={};_0x458e54[_0x5c826f[0x0]]={'$gte':moment(_0x5c826f[0x1])[_0x414d('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x30f1eb[_0x414d('0x3d')]=_['merge'](_0x30f1eb['where'],_0x458e54);}_0x30f1eb=_['merge']({},_0x30f1eb,_0x96f052[_0x414d('0x60')]);return _0x7a67b9[_0x414d('0x5b')](_0x30f1eb);}})[_0x414d('0x29')](function(_0x4c8604){if(_0x4c8604){_0x4aba48=_0x4c8604[_0x414d('0x39')];if(!_0x96f052[_0x414d('0x32')][_0x414d('0x3a')](_0x414d('0x57'))){_0x30f1eb[_0x414d('0x22')]=qs[_0x414d('0x22')](_0x96f052[_0x414d('0x32')][_0x414d('0x22')]);_0x30f1eb[_0x414d('0x20')]=qs[_0x414d('0x20')](_0x96f052[_0x414d('0x32')]['offset']);}return _0x7a67b9['getMessages'](_0x30f1eb);}})['then'](function(_0x1f759f){if(_0x1f759f){return _0x1f759f?{'count':_0x4aba48,'rows':_0x1f759f}:null;}})[_0x414d('0x29')](respondWithResult(_0x5af5fc,null))[_0x414d('0x4a')](handleError(_0x5af5fc,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 76faf72..bfb8034 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 _0x3fc6=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','ChatGroup'];(function(_0x308a3e,_0x81ce84){var _0x52a708=function(_0x5965f1){while(--_0x5965f1){_0x308a3e['push'](_0x308a3e['shift']());}};_0x52a708(++_0x81ce84);}(_0x3fc6,0x115));var _0x63fc=function(_0x1b46ed,_0x203e80){_0x1b46ed=_0x1b46ed-0x0;var _0x1a9c62=_0x3fc6[_0x1b46ed];return _0x1a9c62;};'use strict';var EventEmitter=require(_0x63fc('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x63fc('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x63fc('0x2')](0x0);var events={'afterCreate':_0x63fc('0x3'),'afterUpdate':_0x63fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ceadb){return function(_0x26d57e,_0x237af7,_0x5ce071){ChatGroupEvents[_0x63fc('0x5')](_0x3ceadb+':'+_0x26d57e['id'],_0x26d57e);ChatGroupEvents['emit'](_0x3ceadb,_0x26d57e);_0x5ce071(null);};}for(var e in events){if(events[_0x63fc('0x6')](e)){var event=events[e];ChatGroup[_0x63fc('0x7')](e,emitEvent(event));}}module[_0x63fc('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x74d3=['hook','events','../../mysqldb','ChatGroup','save','remove','emit','hasOwnProperty'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x74d3,0x159));var _0x374d=function(_0x305be7,_0x527c99){_0x305be7=_0x305be7-0x0;var _0x122e11=_0x74d3[_0x305be7];return _0x122e11;};'use strict';var EventEmitter=require(_0x374d('0x0'));var ChatGroup=require(_0x374d('0x1'))['db'][_0x374d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x374d('0x3'),'afterUpdate':'update','afterDestroy':_0x374d('0x4')};function emitEvent(_0x9f6268){return function(_0x1a79ae,_0x5e7908,_0x2ef1fc){ChatGroupEvents['emit'](_0x9f6268+':'+_0x1a79ae['id'],_0x1a79ae);ChatGroupEvents[_0x374d('0x5')](_0x9f6268,_0x1a79ae);_0x2ef1fc(null);};}for(var e in events){if(events[_0x374d('0x6')](e)){var event=events[e];ChatGroup[_0x374d('0x7')](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 403e236..ce13707 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 _0x7d40=['./chatGroup.attributes','exports','define','ChatGroup','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5387d9,_0x3e7c3e){var _0x2ea58b=function(_0x4d47ba){while(--_0x4d47ba){_0x5387d9['push'](_0x5387d9['shift']());}};_0x2ea58b(++_0x3e7c3e);}(_0x7d40,0x138));var _0x07d4=function(_0x27a45e,_0x556bb4){_0x27a45e=_0x27a45e-0x0;var _0x1fca64=_0x7d40[_0x27a45e];return _0x1fca64;};'use strict';var _=require('lodash');var util=require(_0x07d4('0x0'));var logger=require('../../config/logger')(_0x07d4('0x1'));var moment=require('moment');var BPromise=require(_0x07d4('0x2'));var rp=require(_0x07d4('0x3'));var fs=require('fs');var path=require(_0x07d4('0x4'));var rimraf=require(_0x07d4('0x5'));var config=require(_0x07d4('0x6'));var attributes=require(_0x07d4('0x7'));module[_0x07d4('0x8')]=function(_0x303b43,_0x4a83ef){return _0x303b43[_0x07d4('0x9')](_0x07d4('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cdd=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0x5a4d1f,_0x11e801){var _0x327268=function(_0x310d46){while(--_0x310d46){_0x5a4d1f['push'](_0x5a4d1f['shift']());}};_0x327268(++_0x11e801);}(_0x5cdd,0x6c));var _0xd5cd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5cdd[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd5cd('0x0'));var util=require(_0xd5cd('0x1'));var logger=require('../../config/logger')(_0xd5cd('0x2'));var moment=require(_0xd5cd('0x3'));var BPromise=require(_0xd5cd('0x4'));var rp=require(_0xd5cd('0x5'));var fs=require('fs');var path=require(_0xd5cd('0x6'));var rimraf=require(_0xd5cd('0x7'));var config=require(_0xd5cd('0x8'));var attributes=require(_0xd5cd('0x9'));module[_0xd5cd('0xa')]=function(_0x3e9305,_0x5adbe6){return _0x3e9305['define']('ChatGroup',attributes,{'tableName':_0xd5cd('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 0814ac8..e2aea39 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 _0xab5b=['debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x4817f9,_0x4070d1){var _0x2dcfa6=function(_0x408973){while(--_0x408973){_0x4817f9['push'](_0x4817f9['shift']());}};_0x2dcfa6(++_0x4070d1);}(_0xab5b,0x11a));var _0xbab5=function(_0x5641dd,_0x3560b5){_0x5641dd=_0x5641dd-0x0;var _0x5767ba=_0xab5b[_0x5641dd];return _0x5767ba;};'use strict';var _=require(_0xbab5('0x0'));var util=require(_0xbab5('0x1'));var moment=require('moment');var BPromise=require(_0xbab5('0x2'));var rs=require(_0xbab5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbab5('0x4'));var logger=require('../../config/logger')(_0xbab5('0x5'));var config=require(_0xbab5('0x6'));var jayson=require(_0xbab5('0x7'));var client=jayson[_0xbab5('0x8')][_0xbab5('0x9')]({'port':0x232a});config['redis']=_[_0xbab5('0xa')](config[_0xbab5('0xb')],{'host':_0xbab5('0xc'),'port':0x18eb});var socket=require(_0xbab5('0xd'))(new Redis(config[_0xbab5('0xb')]));require('./chatGroup.socket')[_0xbab5('0xe')](socket);function respondWithRpcPromise(_0x31f54b,_0x37ccba,_0x4c9350){return new BPromise(function(_0x226c55,_0xfbb62c){return client['request'](_0x31f54b,_0x4c9350)[_0xbab5('0xf')](function(_0x20b3fb){logger[_0xbab5('0x10')](_0xbab5('0x11'),_0x37ccba,'request\x20sent');logger[_0xbab5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x37ccba,_0xbab5('0x13'),JSON[_0xbab5('0x14')](_0x20b3fb));if(_0x20b3fb[_0xbab5('0x15')]){if(_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x16')]===0x1f4){logger['error'](_0xbab5('0x11'),_0x37ccba,_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);return _0xfbb62c(_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);}logger[_0xbab5('0x15')](_0xbab5('0x11'),_0x37ccba,_0x20b3fb[_0xbab5('0x15')][_0xbab5('0x17')]);return _0x226c55(_0x20b3fb['error'][_0xbab5('0x17')]);}else{logger[_0xbab5('0x10')](_0xbab5('0x11'),_0x37ccba,'request\x20sent');_0x226c55(_0x20b3fb['result'][_0xbab5('0x17')]);}})[_0xbab5('0x18')](function(_0x25fbf1){logger[_0xbab5('0x15')](_0xbab5('0x11'),_0x37ccba,_0x25fbf1);_0xfbb62c(_0x25fbf1);});});}
\ No newline at end of file
+var _0x0fda=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x1d72ef,_0x251f64){_0x1d72ef=_0x1d72ef-0x0;var _0x35fc66=_0x0fda[_0x1d72ef];return _0x35fc66;};'use strict';var _=require(_0xa0fd('0x0'));var util=require('util');var moment=require(_0xa0fd('0x1'));var BPromise=require(_0xa0fd('0x2'));var rs=require(_0xa0fd('0x3'));var fs=require('fs');var Redis=require(_0xa0fd('0x4'));var db=require(_0xa0fd('0x5'))['db'];var utils=require(_0xa0fd('0x6'));var logger=require(_0xa0fd('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa0fd('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xa0fd('0x9')]=_[_0xa0fd('0xa')](config[_0xa0fd('0x9')],{'host':_0xa0fd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0fd('0x9')]));require(_0xa0fd('0xc'))[_0xa0fd('0xd')](socket);function respondWithRpcPromise(_0x322a1a,_0x4e1873,_0x31088d){return new BPromise(function(_0x423616,_0x36634c){return client['request'](_0x322a1a,_0x31088d)[_0xa0fd('0xe')](function(_0x332e66){logger[_0xa0fd('0xf')](_0xa0fd('0x10'),_0x4e1873,_0xa0fd('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4e1873,_0xa0fd('0x11'),JSON[_0xa0fd('0x12')](_0x332e66));if(_0x332e66['error']){if(_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x14')]===0x1f4){logger[_0xa0fd('0x13')](_0xa0fd('0x10'),_0x4e1873,_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x15')]);return _0x36634c(_0x332e66[_0xa0fd('0x13')]['message']);}logger[_0xa0fd('0x13')](_0xa0fd('0x10'),_0x4e1873,_0x332e66['error']['message']);return _0x423616(_0x332e66[_0xa0fd('0x13')][_0xa0fd('0x15')]);}else{logger['info'](_0xa0fd('0x10'),_0x4e1873,_0xa0fd('0x11'));_0x423616(_0x332e66[_0xa0fd('0x16')]['message']);}})['catch'](function(_0x46e15a){logger['error'](_0xa0fd('0x10'),_0x4e1873,_0x46e15a);_0x36634c(_0x46e15a);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 602a979..2fec8d9 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 _0x5818=['remove','update','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x461b72,_0xb59085){var _0x4e1955=function(_0x45a50a){while(--_0x45a50a){_0x461b72['push'](_0x461b72['shift']());}};_0x4e1955(++_0xb59085);}(_0x5818,0x17e));var _0x8581=function(_0x32c8cb,_0x49c7d0){_0x32c8cb=_0x32c8cb-0x0;var _0x329a20=_0x5818[_0x32c8cb];return _0x329a20;};'use strict';var ChatGroupEvents=require(_0x8581('0x0'));var events=[_0x8581('0x1'),_0x8581('0x2'),_0x8581('0x3')];function createListener(_0x2dd013,_0x23df87){return function(_0x331626){_0x23df87['emit'](_0x2dd013,_0x331626);};}function removeListener(_0x55c237,_0x19476e){return function(){ChatGroupEvents[_0x8581('0x4')](_0x55c237,_0x19476e);};}exports[_0x8581('0x5')]=function(_0x226d63){for(var _0x399306=0x0,_0x481eca=events[_0x8581('0x6')];_0x399306<_0x481eca;_0x399306++){var _0x52cfa4=events[_0x399306];var _0x110761=createListener(_0x8581('0x7')+_0x52cfa4,_0x226d63);ChatGroupEvents['on'](_0x52cfa4,_0x110761);}};
\ No newline at end of file
+var _0x3526=['save','remove','length','chatGroup:','./chatGroup.events'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x3526,0x1ad));var _0x6352=function(_0x4d2ea7,_0x2b2459){_0x4d2ea7=_0x4d2ea7-0x0;var _0x5875f6=_0x3526[_0x4d2ea7];return _0x5875f6;};'use strict';var ChatGroupEvents=require(_0x6352('0x0'));var events=[_0x6352('0x1'),_0x6352('0x2'),'update'];function createListener(_0x46d183,_0x5e2f1b){return function(_0x5a20f7){_0x5e2f1b['emit'](_0x46d183,_0x5a20f7);};}function removeListener(_0x3e9ea8,_0x3a7282){return function(){ChatGroupEvents['removeListener'](_0x3e9ea8,_0x3a7282);};}exports['register']=function(_0x1c34da){for(var _0x3f726d=0x0,_0x577b97=events[_0x6352('0x3')];_0x3f726d<_0x577b97;_0x3f726d++){var _0x2a1d45=events[_0x3f726d];var _0x1d138a=createListener(_0x6352('0x4')+_0x2a1d45,_0x1c34da);ChatGroupEvents['on'](_0x2a1d45,_0x1d138a);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1ffe0d1..e007245 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 _0x839c=['../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers','/:id/messages','addMessage','put','/:id','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x839c,0x64));var _0xc839=function(_0x1633a0,_0x3cdfc1){_0x1633a0=_0x1633a0-0x0;var _0x523846=_0x839c[_0x1633a0];return _0x523846;};'use strict';var multer=require(_0xc839('0x0'));var util=require(_0xc839('0x1'));var path=require('path');var timeout=require(_0xc839('0x2'));var express=require('express');var router=express[_0xc839('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc839('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc839('0x5'));var controller=require(_0xc839('0x6'));router[_0xc839('0x7')]('/',auth[_0xc839('0x8')](),controller[_0xc839('0x9')]);router['get']('/describe',auth[_0xc839('0x8')](),controller[_0xc839('0xa')]);router[_0xc839('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc839('0xb')]);router[_0xc839('0x7')](_0xc839('0xc'),auth[_0xc839('0x8')](),controller[_0xc839('0xd')]);router[_0xc839('0x7')](_0xc839('0xe'),auth['isAuthenticated'](),controller[_0xc839('0xf')]);router[_0xc839('0x7')]('/:id/messages',auth[_0xc839('0x8')](),controller[_0xc839('0x10')]);router[_0xc839('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc839('0x11')](_0xc839('0xe'),auth[_0xc839('0x8')](),controller[_0xc839('0x12')]);router[_0xc839('0x11')](_0xc839('0x13'),auth[_0xc839('0x8')](),controller[_0xc839('0x14')]);router[_0xc839('0x15')](_0xc839('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xc839('0x17')](_0xc839('0x16'),auth['isAuthenticated'](),controller[_0xc839('0x18')]);router[_0xc839('0x17')](_0xc839('0xe'),auth[_0xc839('0x8')](),controller['removeMembers']);module[_0xc839('0x19')]=router;
\ No newline at end of file
+var _0xcc2a=['show','/:id/unread','getUnread','getMembers','getMessages','post','/:id/members','addMembers','/:id/messages','update','delete','destroy','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id'];(function(_0xafdec6,_0x3d94df){var _0x372bdb=function(_0x5b3fd6){while(--_0x5b3fd6){_0xafdec6['push'](_0xafdec6['shift']());}};_0x372bdb(++_0x3d94df);}(_0xcc2a,0xb0));var _0xacc2=function(_0x2b8271,_0x182807){_0x2b8271=_0x2b8271-0x0;var _0x5a863f=_0xcc2a[_0x2b8271];return _0x5a863f;};'use strict';var multer=require(_0xacc2('0x0'));var util=require(_0xacc2('0x1'));var path=require(_0xacc2('0x2'));var timeout=require('connect-timeout');var express=require(_0xacc2('0x3'));var router=express[_0xacc2('0x4')]();var fs_extra=require(_0xacc2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xacc2('0x6'));var config=require(_0xacc2('0x7'));var controller=require('./chatGroup.controller');router[_0xacc2('0x8')]('/',auth['isAuthenticated'](),controller[_0xacc2('0x9')]);router[_0xacc2('0x8')]('/describe',auth[_0xacc2('0xa')](),controller[_0xacc2('0xb')]);router['get'](_0xacc2('0xc'),auth[_0xacc2('0xa')](),controller[_0xacc2('0xd')]);router[_0xacc2('0x8')](_0xacc2('0xe'),auth['isAuthenticated'](),controller[_0xacc2('0xf')]);router[_0xacc2('0x8')]('/:id/members',auth[_0xacc2('0xa')](),controller[_0xacc2('0x10')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xacc2('0x11')]);router[_0xacc2('0x12')]('/',auth[_0xacc2('0xa')](),controller['create']);router[_0xacc2('0x12')](_0xacc2('0x13'),auth[_0xacc2('0xa')](),controller[_0xacc2('0x14')]);router[_0xacc2('0x12')](_0xacc2('0x15'),auth[_0xacc2('0xa')](),controller['addMessage']);router['put'](_0xacc2('0xc'),auth[_0xacc2('0xa')](),controller[_0xacc2('0x16')]);router[_0xacc2('0x17')](_0xacc2('0xc'),auth['isAuthenticated'](),controller[_0xacc2('0x18')]);router[_0xacc2('0x17')](_0xacc2('0x13'),auth[_0xacc2('0xa')](),controller[_0xacc2('0x19')]);module[_0xacc2('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 f4aef90..0d914da 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 _0xd681=['star','thumb','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0xd681,0x1b4));var _0x1d68=function(_0x34e1f7,_0x149976){_0x34e1f7=_0x34e1f7-0x0;var _0x1c5971=_0xd681[_0x34e1f7];return _0x1c5971;};'use strict';var Sequelize=require(_0x1d68('0x0'));module[_0x1d68('0x1')]={'closed':{'type':Sequelize[_0x1d68('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x1d68('0x3')](_0x1d68('0x4'),_0x1d68('0x5')),'defaultValue':_0x1d68('0x4')},'ratingMessage':{'type':Sequelize[_0x1d68('0x6')]},'pathTranscript':{'type':Sequelize[_0x1d68('0x6')]},'mailTranscript':{'type':Sequelize[_0x1d68('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1d68('0x7')]},'secondDisposition':{'type':Sequelize[_0x1d68('0x7')]},'thirdDisposition':{'type':Sequelize[_0x1d68('0x7')]},'note':{'type':Sequelize[_0x1d68('0x7')]},'browserName':{'type':Sequelize[_0x1d68('0x7')]},'browserVersion':{'type':Sequelize[_0x1d68('0x7')]},'osName':{'type':Sequelize[_0x1d68('0x7')]},'osVersion':{'type':Sequelize[_0x1d68('0x7')]},'deviceModel':{'type':Sequelize[_0x1d68('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x1d68('0x7')]},'referer':{'type':Sequelize[_0x1d68('0x6')]},'customerIp':{'type':Sequelize[_0x1d68('0x7')]},'formData':{'type':Sequelize[_0x1d68('0x6')](_0x1d68('0x8'))},'read1stAt':{'type':Sequelize[_0x1d68('0x9')]},'lastMsgAt':{'type':Sequelize[_0x1d68('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x1d68('0x3')]('in',_0x1d68('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1d68('0x7')]},'customerPort':{'type':Sequelize[_0x1d68('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x1d68('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x190f=['star','thumb','STRING','DATE','TEXT','long','out','INTEGER','sequelize','exports','BOOLEAN','ENUM'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x190f,0x1d0));var _0xf190=function(_0x42c04b,_0x4a7d52){_0x42c04b=_0x42c04b-0x0;var _0xdd038d=_0x190f[_0x42c04b];return _0xdd038d;};'use strict';var Sequelize=require(_0xf190('0x0'));module[_0xf190('0x1')]={'closed':{'type':Sequelize[_0xf190('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf190('0x3')](_0xf190('0x4'),_0xf190('0x5')),'defaultValue':_0xf190('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xf190('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf190('0x7')]},'disposition':{'type':Sequelize[_0xf190('0x6')]},'secondDisposition':{'type':Sequelize[_0xf190('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xf190('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf190('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xf190('0x6')]},'deviceVendor':{'type':Sequelize[_0xf190('0x6')]},'deviceType':{'type':Sequelize[_0xf190('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf190('0x6')]},'formData':{'type':Sequelize[_0xf190('0x8')](_0xf190('0x9'))},'read1stAt':{'type':Sequelize[_0xf190('0x7')]},'lastMsgAt':{'type':Sequelize[_0xf190('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xf190('0x3')]('in',_0xf190('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf190('0x6')]},'customerPort':{'type':Sequelize[_0xf190('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xf190('0x8')]},'autoreplyExecuted':{'type':Sequelize[_0xf190('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf190('0xb')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index da6ee79..51d0e69 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 _0x84f8=['vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','sendStatus','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ContactId','length','UserId','format','%s%d','agentAlias','System','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','hasOwnProperty','push','addTags','setTags','omit','spread','chatInteractionTags:save','removeTags','download','toString','server','tmp','files','attachments','firstName','lastName','createdAt','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','localhost','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','status','end','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','type','getOptions','findAll','chat','query','catch','show','params','keys','filters','intersection','model','fields','attributes','includeAll','include','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId'];(function(_0x56b9be,_0x22848c){var _0x313502=function(_0x2a99f1){while(--_0x2a99f1){_0x56b9be['push'](_0x56b9be['shift']());}};_0x313502(++_0x22848c);}(_0x84f8,0x143));var _0x884f=function(_0x1e06e9,_0x200bbb){_0x1e06e9=_0x1e06e9-0x0;var _0x1b2ea8=_0x84f8[_0x1e06e9];return _0x1b2ea8;};'use strict';var rimraf=require(_0x884f('0x0'));var zipdir=require(_0x884f('0x1'));var rp=require(_0x884f('0x2'));var moment=require('moment');var BPromise=require(_0x884f('0x3'));var Mustache=require(_0x884f('0x4'));var util=require('util');var path=require('path');var ejs=require(_0x884f('0x5'));var fs=require('fs');var _=require(_0x884f('0x6'));var Redis=require(_0x884f('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x884f('0x8'));var pdf=require(_0x884f('0x9'));var logger=require('../../config/logger')(_0x884f('0xa'));var config=require(_0x884f('0xb'));var db=require(_0x884f('0xc'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x884f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x884f('0xe'));var client=jayson[_0x884f('0xf')][_0x884f('0x10')]({'port':0x232b});var client9004=jayson[_0x884f('0xf')][_0x884f('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x46c2a1,_0x548ec7,_0x453ce6,_0x50a98a){return new BPromise(function(_0x3474fd,_0x334238){var _0x59fc9d=_0x50a98a||client;return _0x59fc9d['request'](_0x46c2a1,_0x453ce6)[_0x884f('0x11')](function(_0x2bac68){logger[_0x884f('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x548ec7,_0x884f('0x13'));logger[_0x884f('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x548ec7,_0x884f('0x13'),JSON[_0x884f('0x15')](_0x2bac68));if(_0x2bac68[_0x884f('0x16')]){if(_0x2bac68['error'][_0x884f('0x17')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x548ec7,_0x2bac68['error']['message']);return _0x334238(_0x2bac68[_0x884f('0x16')][_0x884f('0x18')]);}logger[_0x884f('0x16')](_0x884f('0x19'),_0x548ec7,_0x2bac68[_0x884f('0x16')][_0x884f('0x18')]);return _0x3474fd(_0x2bac68['error']['message']);}else{logger[_0x884f('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x548ec7,_0x884f('0x13'));_0x3474fd(_0x2bac68[_0x884f('0x1a')][_0x884f('0x18')]);}})['catch'](function(_0xf35570){logger[_0x884f('0x16')](_0x884f('0x19'),_0x548ec7,_0xf35570);_0x334238(_0xf35570);});});}function respondWithStatusCode(_0x3354d2,_0x303ad7){_0x303ad7=_0x303ad7||0xcc;return function(_0x44d2d4){if(_0x44d2d4){return _0x3354d2['sendStatus'](_0x303ad7);}return _0x3354d2[_0x884f('0x1b')](_0x303ad7)[_0x884f('0x1c')]();};}function respondWithResult(_0xc7991f,_0x901a9a){_0x901a9a=_0x901a9a||0xc8;return function(_0x4a82d4){if(_0x4a82d4){return _0xc7991f[_0x884f('0x1b')](_0x901a9a)[_0x884f('0x1d')](_0x4a82d4);}};}function respondWithFilteredResult(_0x3b104f,_0x38f990){return function(_0x3e0180){if(_0x3e0180){var _0x4ba3c1=typeof _0x38f990[_0x884f('0x1e')]===_0x884f('0x1f')&&typeof _0x38f990[_0x884f('0x20')]===_0x884f('0x1f');var _0x5cd3b0=_0x3e0180['count'];var _0x3fe375=_0x4ba3c1?0x0:_0x38f990[_0x884f('0x1e')];var _0x84babc=_0x4ba3c1?_0x3e0180[_0x884f('0x21')]:_0x38f990[_0x884f('0x1e')]+_0x38f990[_0x884f('0x20')];var _0x19ffa9;if(_0x84babc>=_0x5cd3b0){_0x84babc=_0x5cd3b0;_0x19ffa9=0xc8;}else{_0x19ffa9=0xce;}_0x3b104f[_0x884f('0x1b')](_0x19ffa9);return _0x3b104f[_0x884f('0x22')]('Content-Range',_0x3fe375+'-'+_0x84babc+'/'+_0x5cd3b0)[_0x884f('0x1d')](_0x3e0180);}return null;};}function saveUpdates(_0x4b29b3){return function(_0x5a4b59){if(_0x5a4b59){return _0x5a4b59[_0x884f('0x23')](_0x4b29b3)[_0x884f('0x11')](function(_0xd32b68){return _0xd32b68;});}return null;};}function removeEntity(_0x4d8a2e){return function(_0x3a089a){if(_0x3a089a){return _0x3a089a[_0x884f('0x24')]()[_0x884f('0x11')](function(){_0x4d8a2e[_0x884f('0x1b')](0xcc)[_0x884f('0x1c')]();});}};}function handleEntityNotFound(_0x5a7671){return function(_0x595283){if(!_0x595283){_0x5a7671['sendStatus'](0x194);}return _0x595283;};}function handleError(_0x50f4be,_0x4d6e2a){_0x4d6e2a=_0x4d6e2a||0x1f4;return function(_0x4d67fc){logger[_0x884f('0x16')](_0x4d67fc[_0x884f('0x25')]);if(_0x4d67fc[_0x884f('0x26')]){delete _0x4d67fc[_0x884f('0x26')];}_0x50f4be[_0x884f('0x1b')](_0x4d6e2a)[_0x884f('0x27')](_0x4d67fc);};}function getMustacheRender(_0x241f02,_0x27c0b1){return Mustache[_0x884f('0x28')](_0x241f02,_[_0x884f('0x29')](_0x27c0b1[_0x884f('0x2a')],{'contact':_0x27c0b1[_0x884f('0x2b')],'message':_0x27c0b1[_0x884f('0x18')],'agent':_0x27c0b1[_0x884f('0x2c')],'interaction':_0x27c0b1[_0x884f('0x2d')],'account':_0x27c0b1[_0x884f('0x2e')]}))||'';}exports['index']=function(_0x530d89,_0x56ad40){var _0x4118e8={};var _0x54bc57=_[_0x884f('0x2f')](db[_0x884f('0x30')][_0x884f('0x31')],function(_0x26a6ce){return{'name':_0x26a6ce['fieldName'],'type':_0x26a6ce[_0x884f('0x32')]['key']};});_0x4118e8=qs[_0x884f('0x33')](_0x54bc57,_0x530d89);return interaction[_0x884f('0x34')](_0x884f('0x35'),_0x530d89[_0x884f('0x36')],_0x530d89['user'],_0x4118e8,_0x54bc57)[_0x884f('0x11')](respondWithFilteredResult(_0x56ad40,_0x4118e8))[_0x884f('0x37')](handleError(_0x56ad40,null));};exports[_0x884f('0x38')]=function(_0x17e007,_0x5d3cf3){var _0x3d388f={'raw':![],'where':{'id':_0x17e007[_0x884f('0x39')]['id']}},_0x24d4cf={};_0x24d4cf['model']=_[_0x884f('0x3a')](db[_0x884f('0x30')][_0x884f('0x31')]);_0x24d4cf['query']=_[_0x884f('0x3a')](_0x17e007['query']);_0x24d4cf[_0x884f('0x3b')]=_[_0x884f('0x3c')](_0x24d4cf[_0x884f('0x3d')],_0x24d4cf[_0x884f('0x36')]);_0x3d388f['attributes']=_['intersection'](_0x24d4cf[_0x884f('0x3d')],qs[_0x884f('0x3e')](_0x17e007['query'][_0x884f('0x3e')]));_0x3d388f[_0x884f('0x3f')]=_0x3d388f[_0x884f('0x3f')]['length']?_0x3d388f[_0x884f('0x3f')]:_0x24d4cf['model'];if(_0x17e007[_0x884f('0x36')][_0x884f('0x40')]){_0x3d388f[_0x884f('0x41')]=[{'all':!![]}];}_0x3d388f=_['merge']({},_0x3d388f,_0x17e007[_0x884f('0x42')]);return db['ChatInteraction'][_0x884f('0x43')](_0x3d388f)[_0x884f('0x11')](handleEntityNotFound(_0x5d3cf3,null))[_0x884f('0x11')](respondWithResult(_0x5d3cf3,null))[_0x884f('0x37')](handleError(_0x5d3cf3,null));};exports[_0x884f('0x44')]=function(_0x25ef35,_0x2977f3){return db['ChatInteraction'][_0x884f('0x44')](_0x25ef35[_0x884f('0x2a')],{})[_0x884f('0x11')](respondWithResult(_0x2977f3,0xc9))[_0x884f('0x37')](handleError(_0x2977f3,null));};exports[_0x884f('0x23')]=function(_0x5850c9,_0x3abf22){if(_0x5850c9[_0x884f('0x2a')]['id']){delete _0x5850c9[_0x884f('0x2a')]['id'];}return db[_0x884f('0x30')]['find']({'where':{'id':_0x5850c9[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x3abf22,null))['then'](saveUpdates(_0x5850c9[_0x884f('0x2a')],null))[_0x884f('0x11')](respondWithResult(_0x3abf22,null))[_0x884f('0x37')](handleError(_0x3abf22,null));};exports[_0x884f('0x24')]=function(_0x1e7e97,_0x1fa47a){return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x1e7e97[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x1fa47a,null))[_0x884f('0x11')](removeEntity(_0x1fa47a,null))[_0x884f('0x37')](handleError(_0x1fa47a,null));};exports['describe']=function(_0xb9dffc,_0x19584c){return db[_0x884f('0x30')][_0x884f('0x45')]()['then'](respondWithResult(_0x19584c,null))[_0x884f('0x37')](handleError(_0x19584c,null));};exports['createVidaooSession']=function(_0x554cde,_0xd00464){var _0xdc8f1d=_0x554cde[_0x884f('0x39')]['id'];var _0x1eae98;var _0x40b0e0;var _0x231012;return db['ChatInteraction'][_0x884f('0x46')]({'where':{'id':_0xdc8f1d}})[_0x884f('0x11')](function(_0x80bb2c){_0x1eae98=_0x80bb2c;return db[_0x884f('0x47')][_0x884f('0x46')]({'where':{'id':_0x80bb2c[_0x884f('0x48')]},'attributes':['id',_0x884f('0x49'),_0x884f('0x4a'),_0x884f('0x4b'),_0x884f('0x4c'),_0x884f('0x4d')],'raw':!![]});})[_0x884f('0x11')](function(_0x3eaddc){if(_0x3eaddc&&_0x3eaddc[_0x884f('0x49')]&&_0x3eaddc[_0x884f('0x4a')]){_0x40b0e0=_0x3eaddc;var _0x2ec353={'interaction':{'id':_0xdc8f1d},'agent':{'id':_0x554cde['user']['id'],'name':_0x554cde['user'][_0x884f('0x26')],'fullname':_0x554cde[_0x884f('0x4e')][_0x884f('0x4f')],'email':_0x554cde[_0x884f('0x4e')]['email']},'contact':_0x554cde[_0x884f('0x2a')][_0x884f('0x2b')],'account':_0x554cde[_0x884f('0x2a')][_0x884f('0x2e')]};var _0x5550a1={'rejectUnauthorized':![],'method':'POST','url':_0x884f('0x50'),'headers':{'X-APIKEY':_0x3eaddc['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x554cde['user'][_0x884f('0x51')]],'buttons':null,'topic':_0x40b0e0[_0x884f('0x4b')],'note':_[_0x884f('0x52')](_0x40b0e0[_0x884f('0x4c')])?null:getMustacheRender(_0x40b0e0['vidaooNote'],_0x2ec353),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x40b0e0[_0x884f('0x4d')])){var _0x5ee2af=getMustacheRender(_0x40b0e0[_0x884f('0x4d')],_0x2ec353);var _0x469a25=JSON['parse'](_0x5ee2af);_0x5550a1[_0x884f('0x2a')][_0x884f('0x53')]=_0x469a25;}}catch(_0x21008e){throw new db['Sequelize'][(_0x884f('0x54'))](_0x884f('0x55'));}return rp(_0x5550a1);}else{throw new db['Sequelize'][(_0x884f('0x54'))](_0x884f('0x56'));}})[_0x884f('0x11')](function(_0xd2bac8){_0x231012=_0xd2bac8;if(_0x231012['id']){var _0x445871={'body':_0x231012[_0x884f('0x57')],'ChatWebsiteId':_0x40b0e0['id'],'ChatInteractionId':_0x1eae98['id'],'direction':_0x884f('0x58'),'UserId':_0x554cde['user']['id']};return db['ChatMessage'][_0x884f('0x44')](_0x445871,{});}else{throw new db[(_0x884f('0x59'))][(_0x884f('0x54'))](_0x884f('0x5a'));}})['then'](function(){return _0x1eae98[_0x884f('0x5b')]({'vidaooSessionId':_0x231012['id']});})[_0x884f('0x11')](respondWithResult(_0xd00464,null))[_0x884f('0x37')](handleError(_0xd00464,null));};exports[_0x884f('0x5c')]=function(_0x3a6f53,_0x56aaf3){if(_0x3a6f53[_0x884f('0x2a')]['id']){delete _0x3a6f53['body']['id'];}return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x3a6f53['params']['id']},'include':[{'model':db[_0x884f('0x5d')],'as':_0x884f('0x5e')}]})[_0x884f('0x11')](handleEntityNotFound(_0x56aaf3,null))[_0x884f('0x11')](saveUpdates(_0x3a6f53[_0x884f('0x2a')],null))[_0x884f('0x11')](respondWithResult(_0x56aaf3,null))[_0x884f('0x37')](handleError(_0x56aaf3,null));};exports['abandon']=function(_0x2407b4,_0x305721){if(_0x2407b4['body']['id']){delete _0x2407b4[_0x884f('0x2a')]['id'];}return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x2407b4[_0x884f('0x39')]['id']}})[_0x884f('0x11')](function(_0x2b8859){if(!_0x2b8859){logger[_0x884f('0x16')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x884f('0x5f'),0x194,_0x884f('0x60'));_0x305721[_0x884f('0x61')](0x194);}else{if(_0x2b8859['UserId']){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x2b8859;})[_0x884f('0x11')](function(_0x20f6ec){if(_0x20f6ec){return _0x20f6ec['update']({'closed':_0x2407b4['body'][_0x884f('0x62')],'disposition':_0x2407b4[_0x884f('0x2a')][_0x884f('0x63')]})[_0x884f('0x11')](function(_0x5def35){return _0x5def35;});}})[_0x884f('0x11')](function(){return respondWithRpcPromise(_0x884f('0x64'),_0x884f('0x5f'),_0x2407b4['body'],client9004);})[_0x884f('0x11')](respondWithResult(_0x305721,null))[_0x884f('0x37')](handleError(_0x305721,null));};exports[_0x884f('0x65')]=function(_0x54e660,_0x567c06){_0x54e660[_0x884f('0x2a')][_0x884f('0x26')]=_0x54e660[_0x884f('0x66')][_0x884f('0x67')];_0x54e660[_0x884f('0x2a')]['basename']=_0x54e660[_0x884f('0x66')]['filename'];_0x54e660[_0x884f('0x2a')][_0x884f('0x32')]=_0x54e660[_0x884f('0x66')][_0x884f('0x68')];return db[_0x884f('0x69')][_0x884f('0x44')](_0x54e660[_0x884f('0x2a')])[_0x884f('0x11')](respondWithResult(_0x567c06,0xc9))[_0x884f('0x37')](handleError(_0x567c06,null));};exports[_0x884f('0x6a')]=function(_0xd38e1c,_0x1e181f){return db[_0x884f('0x30')]['findOne']({'where':{'id':_0xd38e1c[_0x884f('0x39')]['id']},'raw':!![]})[_0x884f('0x11')](handleEntityNotFound(_0x1e181f,null))[_0x884f('0x11')](function(_0x1e0c5c){if(_0x1e0c5c){if(_0x1e0c5c[_0x884f('0x62')]){return _0x1e181f['status'](0x193)['json']({'status':0x193,'message':_0x884f('0x6b')});}return db[_0x884f('0x69')][_0x884f('0x46')]({'where':{'id':_0xd38e1c['query']['attachId']},'raw':!![]})[_0x884f('0x11')](handleEntityNotFound(_0x1e181f,null));}})[_0x884f('0x11')](function(_0x572ff5){if(_0x572ff5){var _0x2cca5d=_0x572ff5[_0x884f('0x6c')]!==null;var _0x3d7399=path[_0x884f('0x6d')](config[_0x884f('0x6e')],_0x884f('0x6f'));if(_0x2cca5d){_0x3d7399=path[_0x884f('0x6d')](_0x3d7399,_0x884f('0x70'));}var _0x407cd5=path['join'](_0x3d7399,_0x572ff5[_0x884f('0x71')]);return _0x1e181f['download'](_0x407cd5);}})[_0x884f('0x37')](handleError(_0x1e181f,null));};exports[_0x884f('0x72')]=function(_0x1d0102,_0x5c1095){var _0x36efe0=null;var _0x3a5a06=null;var _0xb470a9=null;if(_0x1d0102['body']['id']){delete _0x1d0102[_0x884f('0x2a')]['id'];}if(_0x1d0102[_0x884f('0x2a')][_0x884f('0x73')]){_0xb470a9=path[_0x884f('0x6d')](config[_0x884f('0x6e')],'server/files/chat/upload/',util['format'](_0x884f('0x74'),Date[_0x884f('0x75')]()));_0x1d0102[_0x884f('0x2a')][_0x884f('0x76')]=_0xb470a9;}return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x1d0102['params']['id']},'include':[{'model':db[_0x884f('0x77')],'as':_0x884f('0x78'),'include':[{'model':db[_0x884f('0x79')],'as':_0x884f('0x79')}]}]})[_0x884f('0x11')](handleEntityNotFound(_0x5c1095,null))[_0x884f('0x11')](saveUpdates(_0x1d0102[_0x884f('0x2a')],null))[_0x884f('0x11')](function(_0x17a595){if(_0x17a595){_0x36efe0=_0x17a595;return db[_0x884f('0x47')]['find']({'where':{'id':_0x36efe0['ChatWebsiteId']}});}})['then'](function(_0x4ce2d0){if(_0x4ce2d0){_0x3a5a06=_0x4ce2d0;return db['CmContact'][_0x884f('0x43')]({'where':{'id':_0x36efe0[_0x884f('0x7a')]}});}})[_0x884f('0x11')](function(_0x12cab8){if(_0x12cab8){if(_0xb470a9){var _0x10fd32=null;for(var _0x2bfa09=0x1;_0x2bfa09<_0x36efe0[_0x884f('0x78')][_0x884f('0x7b')];++_0x2bfa09){_0x10fd32=_0x36efe0[_0x884f('0x78')][_0x2bfa09];var _0x117852=_0x10fd32[_0x884f('0x7c')]?util[_0x884f('0x7d')](_0x884f('0x7e'),_0x3a5a06[_0x884f('0x7f')],_0x10fd32[_0x884f('0x7c')]):_0x884f('0x80');var _0x1a77de=_0x1d0102[_0x884f('0x2a')]['customer']||util['format'](_0x884f('0x7e'),_0x884f('0x81'),_0x10fd32[_0x884f('0x7a')]);switch(_0x3a5a06[_0x884f('0x82')]){case'website_alias':_0x117852=_0x10fd32[_0x884f('0x7c')]?util[_0x884f('0x7d')](_0x884f('0x7e'),_0x3a5a06['agentAlias'],_0x10fd32[_0x884f('0x7c')]):_0x884f('0x80');break;case _0x884f('0x83'):_0x117852=_0x10fd32['UserId']?_0x10fd32[_0x884f('0x79')][_0x884f('0x84')]||_0x10fd32[_0x884f('0x79')][_0x884f('0x4f')]:'System';break;case _0x884f('0x85'):_0x117852=_0x10fd32[_0x884f('0x7c')]?_0x10fd32[_0x884f('0x79')]['fullname']:_0x884f('0x80');break;default:_0x117852=_0x10fd32['UserId']?util['format'](_0x884f('0x7e'),_0x3a5a06[_0x884f('0x7f')],_0x10fd32[_0x884f('0x7c')]):_0x884f('0x80');}var _0xab91bc=util[_0x884f('0x7d')](_0x884f('0x86'),moment(_0x10fd32['createdAt'])[_0x884f('0x7d')]('MM/DD/YYYY\x20HH:mm:ss'),_0x10fd32[_0x884f('0x87')]==='in'?_0x1a77de:_0x117852,_0x10fd32[_0x884f('0x2a')]);if(!_0x10fd32[_0x884f('0x88')]){fs['appendFileSync'](_0xb470a9,_0xab91bc);}}return db[_0x884f('0x89')][_0x884f('0x46')]({'where':{'service':!![]},'include':[{'model':db[_0x884f('0x8a')],'as':_0x884f('0x8b'),'raw':!![],'include':[{'model':db[_0x884f('0x8c')],'as':_0x884f('0x8c'),'raw':!![]}]}]});}}})[_0x884f('0x11')](function(_0x3a1030){if(!_0x3a1030||!_0x3a1030[_0x884f('0x8b')]||!_0x1d0102['body'])return _0x36efe0;var _0x398f66=_0x3a1030[_0x884f('0x8d')]();return respondWithRpcPromise('SendMail',_0x884f('0x8e'),{'account':_0x398f66,'message':{'from':util[_0x884f('0x7d')](_0x884f('0x8f'),_0x3a1030[_0x884f('0x26')],_0x3a1030[_0x884f('0x51')]||_0x3a1030[_0x884f('0x8b')][_0x884f('0x4e')]),'to':_0x1d0102[_0x884f('0x2a')][_0x884f('0x73')],'subject':_0x884f('0x90'),'text':util[_0x884f('0x7d')](_0x884f('0x91'),_0x1d0102[_0x884f('0x2a')][_0x884f('0x73')]),'attachments':[{'path':_0xb470a9}]}})[_0x884f('0x11')](function(){return _0x36efe0;})[_0x884f('0x37')](function(_0x3e7dd4){logger[_0x884f('0x16')](_0x3e7dd4);});})[_0x884f('0x11')](respondWithStatusCode(_0x5c1095,0xc8))[_0x884f('0x37')](handleError(_0x5c1095,null));};exports['addMessage']=function(_0x47f185,_0x33db9d){return db[_0x884f('0x77')][_0x884f('0x43')]({'where':{'id':_0x47f185[_0x884f('0x39')]['id']}})['then'](handleEntityNotFound(_0x33db9d,null))['then'](function(_0x3dbdc0){if(_0x3dbdc0){return _0x3dbdc0[_0x884f('0x92')](_0x47f185[_0x884f('0x2a')]['ids'],_['omit'](_0x47f185[_0x884f('0x2a')],[_0x884f('0x93'),'id'])||{});}})[_0x884f('0x11')](respondWithResult(_0x33db9d,null))[_0x884f('0x37')](handleError(_0x33db9d,null));};exports[_0x884f('0x94')]=function(_0xce7443,_0x4af438){var _0xe50790={'raw':![],'where':{}};var _0x4a8e08={};var _0x1b8599={'count':0x0,'rows':[]};return db[_0x884f('0x30')]['findOne']({'where':{'id':_0xce7443[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x4af438,null))[_0x884f('0x11')](function(_0x4de07b){if(_0x4de07b){_0x4a8e08[_0x884f('0x3d')]=_[_0x884f('0x3a')](db[_0x884f('0x77')]['rawAttributes']);_0x4a8e08[_0x884f('0x36')]=_[_0x884f('0x3a')](_0xce7443[_0x884f('0x36')]);_0x4a8e08[_0x884f('0x3b')]=_[_0x884f('0x3c')](_0x4a8e08['model'],_0x4a8e08['query']);_0xe50790[_0x884f('0x3f')]=_[_0x884f('0x3c')](_0x4a8e08[_0x884f('0x3d')],qs[_0x884f('0x3e')](_0xce7443[_0x884f('0x36')][_0x884f('0x3e')]));_0xe50790[_0x884f('0x3f')]=_0xe50790[_0x884f('0x3f')][_0x884f('0x7b')]?_0xe50790[_0x884f('0x3f')]:_0x4a8e08[_0x884f('0x3d')];if(!_0xce7443[_0x884f('0x36')]['hasOwnProperty'](_0x884f('0x95'))){_0xe50790[_0x884f('0x20')]=qs[_0x884f('0x20')](_0xce7443[_0x884f('0x36')][_0x884f('0x20')]);_0xe50790['offset']=qs['offset'](_0xce7443[_0x884f('0x36')][_0x884f('0x1e')]);}_0xe50790['order']=qs['sort'](_0xce7443[_0x884f('0x36')]['sort']);_0xe50790[_0x884f('0x96')]=qs[_0x884f('0x3b')](_[_0x884f('0x97')](_0xce7443['query'],_0x4a8e08[_0x884f('0x3b')]));_0xe50790[_0x884f('0x96')][_0x884f('0x98')]=_0x4de07b['id'];if(_0xce7443[_0x884f('0x36')][_0x884f('0x99')]){_0xe50790['where']=_['merge'](_0xe50790['where'],{'$or':_[_0x884f('0x2f')](_0xe50790[_0x884f('0x3f')],function(_0x5626b6){var _0xd2a09a={};_0xd2a09a[_0x5626b6]={'$like':'%'+_0xce7443[_0x884f('0x36')][_0x884f('0x99')]+'%'};return _0xd2a09a;})});}if(_0xce7443[_0x884f('0x36')][_0x884f('0x9a')]){var _0x582fce=_0xce7443[_0x884f('0x36')][_0x884f('0x9a')][_0x884f('0x9b')](',');var _0x4b2c14={};_0x4b2c14[_0x582fce[0x0]]={'$gte':moment(_0x582fce[0x1])[_0x884f('0x7d')](_0x884f('0x9c'))};_0xe50790['where']=_['merge'](_0xe50790[_0x884f('0x96')],_0x4b2c14);}_0xe50790=_[_0x884f('0x29')]({},_0xe50790,_0xce7443[_0x884f('0x42')]);return db[_0x884f('0x77')][_0x884f('0x21')]({'where':_0xe50790['where']})[_0x884f('0x11')](function(_0x36ac81){_0x1b8599[_0x884f('0x21')]=_0x36ac81;if(_0xce7443[_0x884f('0x36')][_0x884f('0x40')]){_0xe50790['include']=[{'all':!![]}];}return db[_0x884f('0x77')][_0x884f('0x34')](_0xe50790);})[_0x884f('0x11')](function(_0x52fc49){_0x1b8599[_0x884f('0x9d')]=_0x52fc49;return _0x1b8599;});}})['then'](respondWithFilteredResult(_0x4af438,_0xe50790))['catch'](handleError(_0x4af438,null));};exports['getMyMessages']=function(_0x58b711,_0x4dd595){var _0x3c4e2e={'where':{}},_0x3b1dce={},_0x6bf3bb={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x884f('0x46')]({'where':{'id':_0x58b711[_0x884f('0x39')]['id']}})['then'](handleEntityNotFound(_0x4dd595,null))[_0x884f('0x11')](function(_0x312433){if(_0x312433){_0x3b1dce['model']=_[_0x884f('0x3a')](db[_0x884f('0x77')][_0x884f('0x31')]);_0x3b1dce[_0x884f('0x36')]=_[_0x884f('0x3a')](_0x58b711[_0x884f('0x36')]);_0x3b1dce[_0x884f('0x3b')]=_[_0x884f('0x3c')](_0x3b1dce[_0x884f('0x3d')],_0x3b1dce[_0x884f('0x36')]);_0x3c4e2e[_0x884f('0x3f')]=_[_0x884f('0x3c')](_0x3b1dce[_0x884f('0x3d')],qs['fields'](_0x58b711[_0x884f('0x36')]['fields']));_0x3c4e2e[_0x884f('0x3f')]=_0x3c4e2e[_0x884f('0x3f')]['length']?_0x3c4e2e[_0x884f('0x3f')]:_0x3b1dce[_0x884f('0x3d')];if(!_0x58b711[_0x884f('0x36')][_0x884f('0x9e')](_0x884f('0x95'))){_0x3c4e2e[_0x884f('0x20')]=qs[_0x884f('0x20')](_0x58b711['query'][_0x884f('0x20')]);_0x3c4e2e[_0x884f('0x1e')]=qs['offset'](_0x58b711[_0x884f('0x36')][_0x884f('0x1e')]);}_0x3c4e2e['order']=qs['sort'](_0x58b711['query']['sort']);_0x3c4e2e['where']=qs[_0x884f('0x3b')](_[_0x884f('0x97')](_0x58b711['query'],_0x3b1dce[_0x884f('0x3b')]));_0x3c4e2e['where'][_0x884f('0x98')]=_0x312433['id'];if(_0x58b711[_0x884f('0x36')][_0x884f('0x99')]){_0x3c4e2e[_0x884f('0x96')]=_[_0x884f('0x29')](_0x3c4e2e[_0x884f('0x96')],{'$or':_[_0x884f('0x2f')](_0x3c4e2e[_0x884f('0x3f')],function(_0x368ae1){var _0x16ad81={};_0x16ad81[_0x368ae1]={'$like':'%'+_0x58b711[_0x884f('0x36')][_0x884f('0x99')]+'%'};return _0x16ad81;})});}_0x3c4e2e[_0x884f('0x96')][_0x884f('0x88')]=![];if(_0x58b711[_0x884f('0x36')]['id']){_0x3c4e2e[_0x884f('0x96')]['id']={'$gt':_0x58b711['query']['id']};}_0x3c4e2e=_[_0x884f('0x29')]({},_0x3c4e2e,_0x58b711[_0x884f('0x42')]);return db[_0x884f('0x77')]['count']({'where':_0x3c4e2e[_0x884f('0x96')]})[_0x884f('0x11')](function(_0x228a74){_0x6bf3bb[_0x884f('0x21')]=_0x228a74;_0x3c4e2e[_0x884f('0x41')]=[];if(_0x58b711[_0x884f('0x36')]['includeAgent']){_0x3c4e2e[_0x884f('0x41')][_0x884f('0x9f')]({'model':db['User'],'as':'User','attributes':['id','fullname',_0x884f('0x84')]});}if(_0x58b711[_0x884f('0x36')]['includeAll']){_0x3c4e2e[_0x884f('0x41')]=[{'all':!![]}];}return db[_0x884f('0x77')][_0x884f('0x34')](_0x3c4e2e);})[_0x884f('0x11')](function(_0x153aac){_0x6bf3bb[_0x884f('0x9d')]=_0x153aac;return _0x6bf3bb;});}})['then'](respondWithFilteredResult(_0x4dd595,_0x3c4e2e))[_0x884f('0x37')](handleError(_0x4dd595,null));};exports[_0x884f('0xa0')]=function(_0x1fb049,_0x231eb3){return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x1fb049[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x231eb3,null))[_0x884f('0x11')](function(_0x1f7754){if(_0x1f7754){return _0x1f7754[_0x884f('0xa1')](_0x1fb049[_0x884f('0x2a')][_0x884f('0x93')],_[_0x884f('0xa2')](_0x1fb049['body'],['ids','id'])||{})[_0x884f('0xa3')](function(){return db['Tag'][_0x884f('0x34')]({'attributes':['id','name','color'],'where':{'id':_0x1fb049[_0x884f('0x2a')]['ids']}});})[_0x884f('0x11')](function(_0x5e9303){socket['emit'](_0x884f('0xa4'),{'id':Number(_0x1fb049[_0x884f('0x39')]['id']),'tags':_0x5e9303||[]});return{'id':Number(_0x1fb049[_0x884f('0x39')]['id']),'tags':_0x5e9303||[]};});}})[_0x884f('0x11')](respondWithResult(_0x231eb3,null))[_0x884f('0x37')](handleError(_0x231eb3,null));};exports[_0x884f('0xa5')]=function(_0x5b7ecc,_0x296a77){return db[_0x884f('0x30')][_0x884f('0x43')]({'where':{'id':_0x5b7ecc[_0x884f('0x39')]['id']}})[_0x884f('0x11')](handleEntityNotFound(_0x296a77,null))[_0x884f('0x11')](function(_0x504cdd){if(_0x504cdd){return _0x504cdd[_0x884f('0xa5')](_0x5b7ecc['query']['ids']);}})['then'](respondWithStatusCode(_0x296a77,null))[_0x884f('0x37')](handleError(_0x296a77,null));};exports[_0x884f('0xa6')]=function(_0xcc90fa,_0x1daa20){var _0x39a12f=moment()['unix']()[_0x884f('0xa7')]();var _0x4fa701=path['join'](config[_0x884f('0x6e')],_0x884f('0xa8'),'files',_0x884f('0xa9'));var _0x4ff7c4=path['join'](config[_0x884f('0x6e')],_0x884f('0xa8'),_0x884f('0xaa'),_0x884f('0xab'));var _0x42e47b=path[_0x884f('0x6d')](_0x4fa701,_0x39a12f);var _0x4c278f=util[_0x884f('0x7d')]('transcript-%d-%s.zip',_0xcc90fa[_0x884f('0x39')]['id'],_0x39a12f);var _0x347a64=path[_0x884f('0x6d')](_0x4fa701,_0x4c278f);var _0x3badf2=[];_0x3badf2['push']({'model':db[_0x884f('0x79')],'as':'User','attributes':['id',_0x884f('0x4f')],'raw':!![]});_0x3badf2[_0x884f('0x9f')]({'model':db[_0x884f('0x5d')],'as':_0x884f('0x5e'),'attributes':['id',_0x884f('0xac'),_0x884f('0xad')],'raw':!![]});if(_0xcc90fa[_0x884f('0x36')][_0x884f('0xab')]){_0x3badf2['push']({'model':db['Attachment'],'as':_0x884f('0x69'),'raw':!![]});}var _0x1b0447=[{'model':db['ChatMessage'],'as':_0x884f('0x78'),'attributes':['id','body',_0x884f('0xae'),_0x884f('0x87'),_0x884f('0x88'),_0x884f('0xaf')],'include':_0x3badf2}];_0x1b0447[_0x884f('0x9f')]({'model':db[_0x884f('0x47')],'as':_0x884f('0xb0'),'attributes':['id',_0x884f('0x26')]});_0x1b0447[_0x884f('0x9f')]({'model':db['User'],'as':_0x884f('0xb1'),'attributes':['id',_0x884f('0x4f')]});return db[_0x884f('0x30')]['find']({'where':{'id':_0xcc90fa[_0x884f('0x39')]['id']},'include':_0x1b0447})['then'](handleEntityNotFound(_0x1daa20,null))['then'](function(_0x109366){if(_0x109366){var _0x1765f2=_0x109366[_0x884f('0xb2')]({'plain':!![]});fs[_0x884f('0xb3')](_0x42e47b);var _0x319a6c={'channel':_0x884f('0xb4'),'account':_0x1765f2[_0x884f('0xb0')]['name'],'agent':_0x1765f2[_0x884f('0xb1')]?_0x1765f2[_0x884f('0xb1')][_0x884f('0x4f')]:'N.A.','createdAt':moment(_0x1765f2[_0x884f('0xae')])[_0x884f('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x884f('0xa7')](),'closedAt':_0x1765f2['closed']?moment(_0x1765f2[_0x884f('0xb5')])['format'](_0x884f('0x9c'))[_0x884f('0xa7')]():'','disposition':_0x1765f2[_0x884f('0x63')],'chatInfo':{'browser':_0x1765f2[_0x884f('0xb6')],'os':_0x1765f2[_0x884f('0xb7')],'referer':_0x1765f2[_0x884f('0xb8')],'customerIp':_0x1765f2[_0x884f('0xb9')],'customerPort':_0x1765f2[_0x884f('0xba')]?_0x1765f2[_0x884f('0xba')]:'N.A.'},'messages':_(_0x1765f2[_0x884f('0x78')])[_0x884f('0xbb')]()[_0x884f('0x99')]({'secret':![]})[_0x884f('0x2f')](function(_0x1af258){if(_0x1af258['Attachment']){var _0x2e95fc=path[_0x884f('0x6d')](_0x4ff7c4,_0x1af258['Attachment'][_0x884f('0x71')]);if(fs[_0x884f('0xbc')](_0x2e95fc)){fs[_0x884f('0xbd')](_0x2e95fc)[_0x884f('0xbe')](fs[_0x884f('0xbf')](path[_0x884f('0x6d')](_0x42e47b,_0x1af258[_0x884f('0x69')]['basename'])));}}return{'date':moment(_0x1af258[_0x884f('0xae')])['format'](_0x884f('0x9c'))[_0x884f('0xa7')](),'sender':_0x1af258[_0x884f('0x87')]===_0x884f('0x58')?_0x1af258[_0x884f('0x79')]?_0x1af258[_0x884f('0x79')][_0x884f('0x4f')]:_0x884f('0x80'):_0x1af258['Contact']['firstName']+(_0x1af258['Contact'][_0x884f('0xad')]?'\x20'+_0x1af258[_0x884f('0x5e')][_0x884f('0xad')]:''),'body':_0x1af258['Attachment']?_0x1af258[_0x884f('0x69')][_0x884f('0x71')]:_0x1af258[_0x884f('0x2a')],'direction':_0x1af258[_0x884f('0x87')]===_0x884f('0x58')?'A':'C','secret':_0x1af258['secret'],'read':_0x1af258[_0x884f('0xaf')],'attachment':_0x1af258[_0x884f('0x69')]};})[_0x884f('0xc0')]()};return ejs[_0x884f('0xc1')](path[_0x884f('0x6d')](config[_0x884f('0x6e')],_0x884f('0xa8'),'views','downloadInteraction.ejs'),{'interaction':_0x319a6c})[_0x884f('0x11')](function(_0x49d5d8){var _0x416b78=path[_0x884f('0x6d')](_0x42e47b,_0x884f('0xc2')+_0x1765f2['id']+'-'+_0x39a12f+'.pdf');var _0x1f7ea6={'path':_0x416b78,'channel':_0x884f('0xb4'),'interactionId':_0x1765f2['id']};return pdf[_0x884f('0xc3')](_0x49d5d8,_0x1f7ea6);})[_0x884f('0x11')](function(){return new Promise(function(_0x520d25,_0x40f806){zipdir(_0x42e47b,{'saveTo':_0x347a64},function(_0x123445,_0x2bb007){if(_0x123445)return _0x40f806(_0x123445);return _0x520d25(_0x2bb007);});})['then'](function(){return new BPromise(function(_0x16bf14,_0x1183e8){rimraf(_0x42e47b,function(_0x42ccc0){if(_0x42ccc0)_0x1183e8(_0x42ccc0);return _0x16bf14();});});})['then'](function(){return _0x1daa20[_0x884f('0xa6')](_0x347a64,_0x4c278f,function(_0x50c054){if(_0x50c054){logger[_0x884f('0x16')](_0x884f('0xc4'),_0x50c054);}else{fs[_0x884f('0xc5')](_0x347a64);}});});});}else{return _0x1daa20['sendStatus'](0xc8);}})[_0x884f('0x37')](handleError(_0x1daa20,null));};
\ No newline at end of file
+var _0x016d=['ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','length','%s%d','System','ContactId','agentIdentifier','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','Smtp','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','getMessages','keys','hasOwnProperty','order','sort','where','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','nolimit','pick','includeAgent','push','rows','addTags','setTags','ids','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','index','ChatInteraction','rawAttributes','fieldName','key','findAll','chat','query','show','params','filters','intersection','model','attributes','fields','includeAll','include','find','create','describe','createVidaooSession','findOne'];(function(_0x28fccf,_0x72a99c){var _0x3a1889=function(_0x47cc32){while(--_0x47cc32){_0x28fccf['push'](_0x28fccf['shift']());}};_0x3a1889(++_0x72a99c);}(_0x016d,0x15c));var _0xd016=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x016d[_0x20a584];return _0x4b41a8;};'use strict';var rimraf=require(_0xd016('0x0'));var zipdir=require(_0xd016('0x1'));var rp=require(_0xd016('0x2'));var moment=require(_0xd016('0x3'));var BPromise=require(_0xd016('0x4'));var Mustache=require(_0xd016('0x5'));var util=require(_0xd016('0x6'));var path=require(_0xd016('0x7'));var ejs=require(_0xd016('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd016('0x9'));var interaction=require(_0xd016('0xa'));var qs=require(_0xd016('0xb'));var pdf=require(_0xd016('0xc'));var logger=require(_0xd016('0xd'))(_0xd016('0xe'));var config=require(_0xd016('0xf'));var db=require(_0xd016('0x10'))['db'];config[_0xd016('0x11')]=_['defaults'](config['redis'],{'host':_0xd016('0x12'),'port':0x18eb});var socket=require(_0xd016('0x13'))(new Redis(config[_0xd016('0x11')]));require('./chatInteraction.socket')[_0xd016('0x14')](socket);var jayson=require(_0xd016('0x15'));var client=jayson['client'][_0xd016('0x16')]({'port':0x232b});var client9004=jayson[_0xd016('0x17')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3ba57c,_0x15220e,_0x4d6682,_0x1782c3){return new BPromise(function(_0x4e8cfe,_0x3539e2){var _0x4505cc=_0x1782c3||client;return _0x4505cc[_0xd016('0x18')](_0x3ba57c,_0x4d6682)[_0xd016('0x19')](function(_0x379ee8){logger[_0xd016('0x1a')](_0xd016('0x1b'),_0x15220e,_0xd016('0x1c'));logger[_0xd016('0x1d')](_0xd016('0x1e'),_0x15220e,_0xd016('0x1c'),JSON[_0xd016('0x1f')](_0x379ee8));if(_0x379ee8[_0xd016('0x20')]){if(_0x379ee8[_0xd016('0x20')][_0xd016('0x21')]===0x1f4){logger[_0xd016('0x20')](_0xd016('0x1b'),_0x15220e,_0x379ee8[_0xd016('0x20')][_0xd016('0x22')]);return _0x3539e2(_0x379ee8['error'][_0xd016('0x22')]);}logger[_0xd016('0x20')](_0xd016('0x1b'),_0x15220e,_0x379ee8[_0xd016('0x20')][_0xd016('0x22')]);return _0x4e8cfe(_0x379ee8['error']['message']);}else{logger['info'](_0xd016('0x1b'),_0x15220e,_0xd016('0x1c'));_0x4e8cfe(_0x379ee8['result'][_0xd016('0x22')]);}})[_0xd016('0x23')](function(_0x192d9e){logger[_0xd016('0x20')](_0xd016('0x1b'),_0x15220e,_0x192d9e);_0x3539e2(_0x192d9e);});});}function respondWithStatusCode(_0x2f3e92,_0x2d5901){_0x2d5901=_0x2d5901||0xcc;return function(_0x3ee7a2){if(_0x3ee7a2){return _0x2f3e92[_0xd016('0x24')](_0x2d5901);}return _0x2f3e92[_0xd016('0x25')](_0x2d5901)[_0xd016('0x26')]();};}function respondWithResult(_0x52d0e,_0x4051b7){_0x4051b7=_0x4051b7||0xc8;return function(_0x45af3d){if(_0x45af3d){return _0x52d0e[_0xd016('0x25')](_0x4051b7)[_0xd016('0x27')](_0x45af3d);}};}function respondWithFilteredResult(_0x83ce98,_0x3a6549){return function(_0x5953a9){if(_0x5953a9){var _0xcfc002=typeof _0x3a6549['offset']==='undefined'&&typeof _0x3a6549[_0xd016('0x28')]===_0xd016('0x29');var _0x27fc96=_0x5953a9[_0xd016('0x2a')];var _0x28280d=_0xcfc002?0x0:_0x3a6549['offset'];var _0x4cbb8b=_0xcfc002?_0x5953a9[_0xd016('0x2a')]:_0x3a6549[_0xd016('0x2b')]+_0x3a6549[_0xd016('0x28')];var _0x49a69c;if(_0x4cbb8b>=_0x27fc96){_0x4cbb8b=_0x27fc96;_0x49a69c=0xc8;}else{_0x49a69c=0xce;}_0x83ce98[_0xd016('0x25')](_0x49a69c);return _0x83ce98[_0xd016('0x2c')]('Content-Range',_0x28280d+'-'+_0x4cbb8b+'/'+_0x27fc96)[_0xd016('0x27')](_0x5953a9);}return null;};}function saveUpdates(_0x8af6af){return function(_0x28e2c3){if(_0x28e2c3){return _0x28e2c3[_0xd016('0x2d')](_0x8af6af)[_0xd016('0x19')](function(_0x2c0fe9){return _0x2c0fe9;});}return null;};}function removeEntity(_0x425509){return function(_0x44cea1){if(_0x44cea1){return _0x44cea1[_0xd016('0x2e')]()['then'](function(){_0x425509[_0xd016('0x25')](0xcc)[_0xd016('0x26')]();});}};}function handleEntityNotFound(_0xe6c200){return function(_0x1f7fcf){if(!_0x1f7fcf){_0xe6c200[_0xd016('0x24')](0x194);}return _0x1f7fcf;};}function handleError(_0x5bbe8a,_0xf43041){_0xf43041=_0xf43041||0x1f4;return function(_0x1cbb5c){logger[_0xd016('0x20')](_0x1cbb5c[_0xd016('0x2f')]);if(_0x1cbb5c[_0xd016('0x30')]){delete _0x1cbb5c[_0xd016('0x30')];}_0x5bbe8a[_0xd016('0x25')](_0xf43041)[_0xd016('0x31')](_0x1cbb5c);};}function getMustacheRender(_0x50cc65,_0x2b5a3d){return Mustache[_0xd016('0x32')](_0x50cc65,_[_0xd016('0x33')](_0x2b5a3d[_0xd016('0x34')],{'contact':_0x2b5a3d[_0xd016('0x35')],'message':_0x2b5a3d['message'],'agent':_0x2b5a3d[_0xd016('0x36')],'interaction':_0x2b5a3d[_0xd016('0x37')],'account':_0x2b5a3d['account']}))||'';}exports[_0xd016('0x38')]=function(_0x923d2d,_0x19f25c){var _0x1bc210={};var _0x30c3fc=_['map'](db[_0xd016('0x39')][_0xd016('0x3a')],function(_0x42e9c5){return{'name':_0x42e9c5[_0xd016('0x3b')],'type':_0x42e9c5['type'][_0xd016('0x3c')]};});_0x1bc210=qs['getOptions'](_0x30c3fc,_0x923d2d);return interaction[_0xd016('0x3d')](_0xd016('0x3e'),_0x923d2d[_0xd016('0x3f')],_0x923d2d['user'],_0x1bc210,_0x30c3fc)['then'](respondWithFilteredResult(_0x19f25c,_0x1bc210))['catch'](handleError(_0x19f25c,null));};exports[_0xd016('0x40')]=function(_0x4de15c,_0x281496){var _0x37bcc8={'raw':![],'where':{'id':_0x4de15c[_0xd016('0x41')]['id']}},_0x3098c0={};_0x3098c0['model']=_['keys'](db[_0xd016('0x39')][_0xd016('0x3a')]);_0x3098c0['query']=_['keys'](_0x4de15c[_0xd016('0x3f')]);_0x3098c0[_0xd016('0x42')]=_[_0xd016('0x43')](_0x3098c0[_0xd016('0x44')],_0x3098c0[_0xd016('0x3f')]);_0x37bcc8[_0xd016('0x45')]=_[_0xd016('0x43')](_0x3098c0[_0xd016('0x44')],qs[_0xd016('0x46')](_0x4de15c[_0xd016('0x3f')][_0xd016('0x46')]));_0x37bcc8[_0xd016('0x45')]=_0x37bcc8[_0xd016('0x45')]['length']?_0x37bcc8[_0xd016('0x45')]:_0x3098c0[_0xd016('0x44')];if(_0x4de15c['query'][_0xd016('0x47')]){_0x37bcc8[_0xd016('0x48')]=[{'all':!![]}];}_0x37bcc8=_['merge']({},_0x37bcc8,_0x4de15c['options']);return db[_0xd016('0x39')][_0xd016('0x49')](_0x37bcc8)[_0xd016('0x19')](handleEntityNotFound(_0x281496,null))[_0xd016('0x19')](respondWithResult(_0x281496,null))[_0xd016('0x23')](handleError(_0x281496,null));};exports[_0xd016('0x4a')]=function(_0x1a8cce,_0x4f57fd){return db['ChatInteraction'][_0xd016('0x4a')](_0x1a8cce[_0xd016('0x34')],{})[_0xd016('0x19')](respondWithResult(_0x4f57fd,0xc9))[_0xd016('0x23')](handleError(_0x4f57fd,null));};exports[_0xd016('0x2d')]=function(_0xe4de6a,_0x51949f){if(_0xe4de6a[_0xd016('0x34')]['id']){delete _0xe4de6a['body']['id'];}return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0xe4de6a[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x51949f,null))['then'](saveUpdates(_0xe4de6a['body'],null))[_0xd016('0x19')](respondWithResult(_0x51949f,null))[_0xd016('0x23')](handleError(_0x51949f,null));};exports[_0xd016('0x2e')]=function(_0x4923b2,_0x41c47b){return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x4923b2['params']['id']}})[_0xd016('0x19')](handleEntityNotFound(_0x41c47b,null))[_0xd016('0x19')](removeEntity(_0x41c47b,null))[_0xd016('0x23')](handleError(_0x41c47b,null));};exports[_0xd016('0x4b')]=function(_0x427dca,_0x47b4ad){return db[_0xd016('0x39')][_0xd016('0x4b')]()['then'](respondWithResult(_0x47b4ad,null))[_0xd016('0x23')](handleError(_0x47b4ad,null));};exports[_0xd016('0x4c')]=function(_0x3d06f9,_0x36a903){var _0x2ade32=_0x3d06f9['params']['id'];var _0x5d2729;var _0x5689e2;var _0x11524e;return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x2ade32}})['then'](function(_0x446bdd){_0x5d2729=_0x446bdd;return db[_0xd016('0x4e')][_0xd016('0x4d')]({'where':{'id':_0x446bdd[_0xd016('0x4f')]},'attributes':['id',_0xd016('0x50'),_0xd016('0x51'),_0xd016('0x52'),_0xd016('0x53'),_0xd016('0x54')],'raw':!![]});})[_0xd016('0x19')](function(_0x310c34){if(_0x310c34&&_0x310c34['vidaooApiKey']&&_0x310c34[_0xd016('0x51')]){_0x5689e2=_0x310c34;var _0x43ef97={'interaction':{'id':_0x2ade32},'agent':{'id':_0x3d06f9['user']['id'],'name':_0x3d06f9[_0xd016('0x55')][_0xd016('0x30')],'fullname':_0x3d06f9[_0xd016('0x55')][_0xd016('0x56')],'email':_0x3d06f9[_0xd016('0x55')][_0xd016('0x57')]},'contact':_0x3d06f9[_0xd016('0x34')][_0xd016('0x35')],'account':_0x3d06f9[_0xd016('0x34')][_0xd016('0x58')]};var _0x305f21={'rejectUnauthorized':![],'method':_0xd016('0x59'),'url':_0xd016('0x5a'),'headers':{'X-APIKEY':_0x310c34[_0xd016('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3d06f9['user'][_0xd016('0x57')]],'buttons':null,'topic':_0x5689e2[_0xd016('0x52')],'note':_[_0xd016('0x5b')](_0x5689e2['vidaooNote'])?null:getMustacheRender(_0x5689e2[_0xd016('0x53')],_0x43ef97),'metadata':null},'redirect':_0xd016('0x5c'),'json':!![]};try{if(!_['isNull'](_0x5689e2['vidaooMetadata'])){var _0x293407=getMustacheRender(_0x5689e2['vidaooMetadata'],_0x43ef97);var _0x211d57=JSON[_0xd016('0x5d')](_0x293407);_0x305f21[_0xd016('0x34')][_0xd016('0x5e')]=_0x211d57;}}catch(_0x43944a){throw new db[(_0xd016('0x5f'))]['ValidationError'](_0xd016('0x60'));}return rp(_0x305f21);}else{throw new db[(_0xd016('0x5f'))][(_0xd016('0x61'))](_0xd016('0x62'));}})['then'](function(_0x7a24b6){_0x11524e=_0x7a24b6;if(_0x11524e['id']){var _0x383f19={'body':_0x11524e[_0xd016('0x63')],'ChatWebsiteId':_0x5689e2['id'],'ChatInteractionId':_0x5d2729['id'],'direction':_0xd016('0x64'),'UserId':_0x3d06f9['user']['id']};return db['ChatMessage'][_0xd016('0x4a')](_0x383f19,{});}else{throw new db['Sequelize'][(_0xd016('0x61'))](_0xd016('0x65'));}})['then'](function(){return _0x5d2729[_0xd016('0x66')]({'vidaooSessionId':_0x11524e['id']});})[_0xd016('0x19')](respondWithResult(_0x36a903,null))[_0xd016('0x23')](handleError(_0x36a903,null));};exports[_0xd016('0x67')]=function(_0x501916,_0x5a2499){if(_0x501916['body']['id']){delete _0x501916[_0xd016('0x34')]['id'];}return db['ChatInteraction'][_0xd016('0x49')]({'where':{'id':_0x501916['params']['id']},'include':[{'model':db['CmContact'],'as':_0xd016('0x68')}]})['then'](handleEntityNotFound(_0x5a2499,null))[_0xd016('0x19')](saveUpdates(_0x501916['body'],null))['then'](respondWithResult(_0x5a2499,null))[_0xd016('0x23')](handleError(_0x5a2499,null));};exports['abandon']=function(_0xe6affc,_0x3b9a5f){if(_0xe6affc[_0xd016('0x34')]['id']){delete _0xe6affc[_0xd016('0x34')]['id'];}return db[_0xd016('0x39')]['find']({'where':{'id':_0xe6affc['params']['id']}})[_0xd016('0x19')](function(_0xffe302){if(!_0xffe302){logger[_0xd016('0x20')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd016('0x69'),0x194,_0xd016('0x6a'));_0x3b9a5f[_0xd016('0x24')](0x194);}else{if(_0xffe302[_0xd016('0x6b')]){throw new db[(_0xd016('0x5f'))][(_0xd016('0x61'))](_0xd016('0x6c'));}}return _0xffe302;})[_0xd016('0x19')](function(_0x10a90a){if(_0x10a90a){return _0x10a90a[_0xd016('0x2d')]({'closed':_0xe6affc[_0xd016('0x34')][_0xd016('0x6d')],'disposition':_0xe6affc[_0xd016('0x34')][_0xd016('0x6e')]})[_0xd016('0x19')](function(_0x51f13a){return _0x51f13a;});}})[_0xd016('0x19')](function(){return respondWithRpcPromise(_0xd016('0x6f'),_0xd016('0x69'),_0xe6affc[_0xd016('0x34')],client9004);})['then'](respondWithResult(_0x3b9a5f,null))[_0xd016('0x23')](handleError(_0x3b9a5f,null));};exports[_0xd016('0x70')]=function(_0x1b194d,_0x40056b){_0x1b194d[_0xd016('0x34')]['name']=_0x1b194d['file'][_0xd016('0x71')];_0x1b194d['body'][_0xd016('0x72')]=_0x1b194d[_0xd016('0x73')][_0xd016('0x74')];_0x1b194d['body']['type']=_0x1b194d[_0xd016('0x73')][_0xd016('0x75')];return db[_0xd016('0x76')][_0xd016('0x4a')](_0x1b194d[_0xd016('0x34')])['then'](respondWithResult(_0x40056b,0xc9))[_0xd016('0x23')](handleError(_0x40056b,null));};exports['attachmentDownload']=function(_0x439949,_0x2538f3){return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x439949[_0xd016('0x41')]['id']},'raw':!![]})[_0xd016('0x19')](handleEntityNotFound(_0x2538f3,null))[_0xd016('0x19')](function(_0x302914){if(_0x302914){if(_0x302914[_0xd016('0x6d')]){return _0x2538f3[_0xd016('0x25')](0x193)[_0xd016('0x27')]({'status':0x193,'message':_0xd016('0x77')});}return db[_0xd016('0x76')][_0xd016('0x4d')]({'where':{'id':_0x439949['query'][_0xd016('0x78')]},'raw':!![]})[_0xd016('0x19')](handleEntityNotFound(_0x2538f3,null));}})[_0xd016('0x19')](function(_0x2edcfb){if(_0x2edcfb){var _0x48f3cf=_0x2edcfb[_0xd016('0x79')]!==null;var _0x2e0cc9=path[_0xd016('0x7a')](config[_0xd016('0x7b')],_0xd016('0x7c'));if(_0x48f3cf){_0x2e0cc9=path[_0xd016('0x7a')](_0x2e0cc9,_0xd016('0x7d'));}var _0x53a56f=path[_0xd016('0x7a')](_0x2e0cc9,_0x2edcfb[_0xd016('0x72')]);return _0x2538f3[_0xd016('0x7e')](_0x53a56f);}})[_0xd016('0x23')](handleError(_0x2538f3,null));};exports['close']=function(_0x5afb85,_0x3082e9){var _0x3f4131=null;var _0x543e75=null;var _0x4469d1=null;if(_0x5afb85[_0xd016('0x34')]['id']){delete _0x5afb85[_0xd016('0x34')]['id'];}if(_0x5afb85[_0xd016('0x34')][_0xd016('0x7f')]){_0x4469d1=path[_0xd016('0x7a')](config['root'],_0xd016('0x80'),util[_0xd016('0x81')]('transcript-%s.txt',Date[_0xd016('0x82')]()));_0x5afb85[_0xd016('0x34')][_0xd016('0x83')]=_0x4469d1;}return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x5afb85[_0xd016('0x41')]['id']},'include':[{'model':db[_0xd016('0x84')],'as':_0xd016('0x85'),'include':[{'model':db[_0xd016('0x86')],'as':'User'}]}]})[_0xd016('0x19')](handleEntityNotFound(_0x3082e9,null))[_0xd016('0x19')](saveUpdates(_0x5afb85[_0xd016('0x34')],null))[_0xd016('0x19')](function(_0x2e12fd){if(_0x2e12fd){_0x3f4131=_0x2e12fd;return db[_0xd016('0x4e')][_0xd016('0x49')]({'where':{'id':_0x3f4131[_0xd016('0x4f')]}});}})[_0xd016('0x19')](function(_0x3670a0){if(_0x3670a0){_0x543e75=_0x3670a0;return db['CmContact'][_0xd016('0x49')]({'where':{'id':_0x3f4131['ContactId']}});}})['then'](function(_0x40284c){if(_0x40284c){if(_0x4469d1){var _0x1cf0f7=null;for(var _0x1f6351=0x1;_0x1f6351<_0x3f4131[_0xd016('0x85')][_0xd016('0x87')];++_0x1f6351){_0x1cf0f7=_0x3f4131['Messages'][_0x1f6351];var _0x91f191=_0x1cf0f7[_0xd016('0x6b')]?util['format'](_0xd016('0x88'),_0x543e75['agentAlias'],_0x1cf0f7[_0xd016('0x6b')]):_0xd016('0x89');var _0x32269a=_0x5afb85['body']['customer']||util['format'](_0xd016('0x88'),'Visitor',_0x1cf0f7[_0xd016('0x8a')]);switch(_0x543e75[_0xd016('0x8b')]){case'website_alias':_0x91f191=_0x1cf0f7['UserId']?util[_0xd016('0x81')](_0xd016('0x88'),_0x543e75[_0xd016('0x8c')],_0x1cf0f7[_0xd016('0x6b')]):_0xd016('0x89');break;case'agent_alias':_0x91f191=_0x1cf0f7[_0xd016('0x6b')]?_0x1cf0f7[_0xd016('0x86')][_0xd016('0x8d')]||_0x1cf0f7[_0xd016('0x86')][_0xd016('0x56')]:'System';break;case _0xd016('0x8e'):_0x91f191=_0x1cf0f7[_0xd016('0x6b')]?_0x1cf0f7[_0xd016('0x86')][_0xd016('0x56')]:_0xd016('0x89');break;default:_0x91f191=_0x1cf0f7['UserId']?util[_0xd016('0x81')](_0xd016('0x88'),_0x543e75['agentAlias'],_0x1cf0f7[_0xd016('0x6b')]):_0xd016('0x89');}var _0x29d762=util[_0xd016('0x81')](_0xd016('0x8f'),moment(_0x1cf0f7[_0xd016('0x90')])['format'](_0xd016('0x91')),_0x1cf0f7[_0xd016('0x92')]==='in'?_0x32269a:_0x91f191,_0x1cf0f7[_0xd016('0x34')]);if(!_0x1cf0f7[_0xd016('0x93')]){fs['appendFileSync'](_0x4469d1,_0x29d762);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd016('0x94'),'raw':!![],'include':[{'model':db[_0xd016('0x95')],'as':_0xd016('0x95'),'raw':!![]}]}]});}}})[_0xd016('0x19')](function(_0x2aa679){if(!_0x2aa679||!_0x2aa679[_0xd016('0x94')]||!_0x5afb85[_0xd016('0x34')])return _0x3f4131;var _0x53fa9e=_0x2aa679[_0xd016('0x96')]();return respondWithRpcPromise(_0xd016('0x97'),_0xd016('0x98'),{'account':_0x53fa9e,'message':{'from':util[_0xd016('0x81')](_0xd016('0x99'),_0x2aa679[_0xd016('0x30')],_0x2aa679[_0xd016('0x57')]||_0x2aa679[_0xd016('0x94')][_0xd016('0x55')]),'to':_0x5afb85[_0xd016('0x34')][_0xd016('0x7f')],'subject':_0xd016('0x9a'),'text':util[_0xd016('0x81')](_0xd016('0x9b'),_0x5afb85['body']['mailTranscript']),'attachments':[{'path':_0x4469d1}]}})[_0xd016('0x19')](function(){return _0x3f4131;})['catch'](function(_0x2f2e02){logger[_0xd016('0x20')](_0x2f2e02);});})[_0xd016('0x19')](respondWithStatusCode(_0x3082e9,0xc8))[_0xd016('0x23')](handleError(_0x3082e9,null));};exports[_0xd016('0x9c')]=function(_0x31769c,_0x356a73){return db[_0xd016('0x84')][_0xd016('0x49')]({'where':{'id':_0x31769c[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x356a73,null))[_0xd016('0x19')](function(_0x4edf0e){if(_0x4edf0e){return _0x4edf0e[_0xd016('0x9c')](_0x31769c['body']['ids'],_[_0xd016('0x9d')](_0x31769c[_0xd016('0x34')],['ids','id'])||{});}})[_0xd016('0x19')](respondWithResult(_0x356a73,null))[_0xd016('0x23')](handleError(_0x356a73,null));};exports[_0xd016('0x9e')]=function(_0x2cc602,_0x42afed){var _0x219084={'raw':![],'where':{}};var _0x1529de={};var _0x3ccf84={'count':0x0,'rows':[]};return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x2cc602['params']['id']}})[_0xd016('0x19')](handleEntityNotFound(_0x42afed,null))[_0xd016('0x19')](function(_0x575f8e){if(_0x575f8e){_0x1529de['model']=_['keys'](db['ChatMessage'][_0xd016('0x3a')]);_0x1529de['query']=_[_0xd016('0x9f')](_0x2cc602['query']);_0x1529de[_0xd016('0x42')]=_[_0xd016('0x43')](_0x1529de[_0xd016('0x44')],_0x1529de['query']);_0x219084[_0xd016('0x45')]=_[_0xd016('0x43')](_0x1529de[_0xd016('0x44')],qs[_0xd016('0x46')](_0x2cc602[_0xd016('0x3f')][_0xd016('0x46')]));_0x219084['attributes']=_0x219084[_0xd016('0x45')]['length']?_0x219084[_0xd016('0x45')]:_0x1529de[_0xd016('0x44')];if(!_0x2cc602[_0xd016('0x3f')][_0xd016('0xa0')]('nolimit')){_0x219084['limit']=qs['limit'](_0x2cc602[_0xd016('0x3f')][_0xd016('0x28')]);_0x219084[_0xd016('0x2b')]=qs[_0xd016('0x2b')](_0x2cc602[_0xd016('0x3f')][_0xd016('0x2b')]);}_0x219084[_0xd016('0xa1')]=qs[_0xd016('0xa2')](_0x2cc602[_0xd016('0x3f')]['sort']);_0x219084[_0xd016('0xa3')]=qs['filters'](_['pick'](_0x2cc602[_0xd016('0x3f')],_0x1529de[_0xd016('0x42')]));_0x219084[_0xd016('0xa3')][_0xd016('0xa4')]=_0x575f8e['id'];if(_0x2cc602[_0xd016('0x3f')][_0xd016('0xa5')]){_0x219084[_0xd016('0xa3')]=_[_0xd016('0x33')](_0x219084[_0xd016('0xa3')],{'$or':_[_0xd016('0xa6')](_0x219084[_0xd016('0x45')],function(_0x34e4c9){var _0x2a8a4a={};_0x2a8a4a[_0x34e4c9]={'$like':'%'+_0x2cc602['query']['filter']+'%'};return _0x2a8a4a;})});}if(_0x2cc602[_0xd016('0x3f')][_0xd016('0xa7')]){var _0x3e1029=_0x2cc602['query'][_0xd016('0xa7')][_0xd016('0xa8')](',');var _0x370941={};_0x370941[_0x3e1029[0x0]]={'$gte':moment(_0x3e1029[0x1])['format'](_0xd016('0xa9'))};_0x219084[_0xd016('0xa3')]=_[_0xd016('0x33')](_0x219084['where'],_0x370941);}_0x219084=_['merge']({},_0x219084,_0x2cc602[_0xd016('0xaa')]);return db['ChatMessage'][_0xd016('0x2a')]({'where':_0x219084[_0xd016('0xa3')]})[_0xd016('0x19')](function(_0x3bbcbb){_0x3ccf84[_0xd016('0x2a')]=_0x3bbcbb;if(_0x2cc602['query'][_0xd016('0x47')]){_0x219084['include']=[{'all':!![]}];}return db[_0xd016('0x84')][_0xd016('0x3d')](_0x219084);})[_0xd016('0x19')](function(_0x158045){_0x3ccf84['rows']=_0x158045;return _0x3ccf84;});}})[_0xd016('0x19')](respondWithFilteredResult(_0x42afed,_0x219084))[_0xd016('0x23')](handleError(_0x42afed,null));};exports['getMyMessages']=function(_0x886201,_0x11e002){var _0x4a4966={'where':{}},_0x3c1353={},_0x19e32e={'count':0x0,'rows':[]};return db[_0xd016('0x39')][_0xd016('0x4d')]({'where':{'id':_0x886201[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x11e002,null))['then'](function(_0x5aab1f){if(_0x5aab1f){_0x3c1353['model']=_['keys'](db['ChatMessage'][_0xd016('0x3a')]);_0x3c1353[_0xd016('0x3f')]=_[_0xd016('0x9f')](_0x886201[_0xd016('0x3f')]);_0x3c1353[_0xd016('0x42')]=_[_0xd016('0x43')](_0x3c1353[_0xd016('0x44')],_0x3c1353[_0xd016('0x3f')]);_0x4a4966[_0xd016('0x45')]=_[_0xd016('0x43')](_0x3c1353[_0xd016('0x44')],qs['fields'](_0x886201[_0xd016('0x3f')][_0xd016('0x46')]));_0x4a4966[_0xd016('0x45')]=_0x4a4966[_0xd016('0x45')][_0xd016('0x87')]?_0x4a4966[_0xd016('0x45')]:_0x3c1353['model'];if(!_0x886201[_0xd016('0x3f')][_0xd016('0xa0')](_0xd016('0xab'))){_0x4a4966['limit']=qs[_0xd016('0x28')](_0x886201[_0xd016('0x3f')][_0xd016('0x28')]);_0x4a4966['offset']=qs['offset'](_0x886201[_0xd016('0x3f')][_0xd016('0x2b')]);}_0x4a4966[_0xd016('0xa1')]=qs[_0xd016('0xa2')](_0x886201[_0xd016('0x3f')][_0xd016('0xa2')]);_0x4a4966['where']=qs[_0xd016('0x42')](_[_0xd016('0xac')](_0x886201['query'],_0x3c1353[_0xd016('0x42')]));_0x4a4966['where']['ChatInteractionId']=_0x5aab1f['id'];if(_0x886201[_0xd016('0x3f')]['filter']){_0x4a4966[_0xd016('0xa3')]=_[_0xd016('0x33')](_0x4a4966[_0xd016('0xa3')],{'$or':_['map'](_0x4a4966['attributes'],function(_0x2426be){var _0x54fa77={};_0x54fa77[_0x2426be]={'$like':'%'+_0x886201[_0xd016('0x3f')]['filter']+'%'};return _0x54fa77;})});}_0x4a4966['where']['secret']=![];if(_0x886201[_0xd016('0x3f')]['id']){_0x4a4966[_0xd016('0xa3')]['id']={'$gt':_0x886201[_0xd016('0x3f')]['id']};}_0x4a4966=_[_0xd016('0x33')]({},_0x4a4966,_0x886201['options']);return db[_0xd016('0x84')][_0xd016('0x2a')]({'where':_0x4a4966[_0xd016('0xa3')]})['then'](function(_0x333eb6){_0x19e32e['count']=_0x333eb6;_0x4a4966['include']=[];if(_0x886201['query'][_0xd016('0xad')]){_0x4a4966['include'][_0xd016('0xae')]({'model':db[_0xd016('0x86')],'as':_0xd016('0x86'),'attributes':['id',_0xd016('0x56'),_0xd016('0x8d')]});}if(_0x886201[_0xd016('0x3f')][_0xd016('0x47')]){_0x4a4966[_0xd016('0x48')]=[{'all':!![]}];}return db[_0xd016('0x84')]['findAll'](_0x4a4966);})[_0xd016('0x19')](function(_0x2cc157){_0x19e32e[_0xd016('0xaf')]=_0x2cc157;return _0x19e32e;});}})[_0xd016('0x19')](respondWithFilteredResult(_0x11e002,_0x4a4966))[_0xd016('0x23')](handleError(_0x11e002,null));};exports[_0xd016('0xb0')]=function(_0x48035f,_0x43bb41){return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x48035f[_0xd016('0x41')]['id']}})['then'](handleEntityNotFound(_0x43bb41,null))[_0xd016('0x19')](function(_0x210108){if(_0x210108){return _0x210108[_0xd016('0xb1')](_0x48035f[_0xd016('0x34')][_0xd016('0xb2')],_[_0xd016('0x9d')](_0x48035f[_0xd016('0x34')],[_0xd016('0xb2'),'id'])||{})['spread'](function(){return db['Tag'][_0xd016('0x3d')]({'attributes':['id','name','color'],'where':{'id':_0x48035f['body']['ids']}});})['then'](function(_0x277324){socket['emit'](_0xd016('0xb3'),{'id':Number(_0x48035f[_0xd016('0x41')]['id']),'tags':_0x277324||[]});return{'id':Number(_0x48035f[_0xd016('0x41')]['id']),'tags':_0x277324||[]};});}})['then'](respondWithResult(_0x43bb41,null))[_0xd016('0x23')](handleError(_0x43bb41,null));};exports[_0xd016('0xb4')]=function(_0x2f89d5,_0x268208){return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x2f89d5['params']['id']}})['then'](handleEntityNotFound(_0x268208,null))[_0xd016('0x19')](function(_0x3d98c4){if(_0x3d98c4){return _0x3d98c4[_0xd016('0xb4')](_0x2f89d5[_0xd016('0x3f')][_0xd016('0xb2')]);}})[_0xd016('0x19')](respondWithStatusCode(_0x268208,null))[_0xd016('0x23')](handleError(_0x268208,null));};exports['download']=function(_0x2b93a8,_0x51f259){var _0x23b17d=moment()[_0xd016('0xb5')]()[_0xd016('0xb6')]();var _0x4d9c15=path['join'](config['root'],_0xd016('0xb7'),_0xd016('0xb8'),_0xd016('0xb9'));var _0x552197=path[_0xd016('0x7a')](config[_0xd016('0x7b')],_0xd016('0xb7'),'files',_0xd016('0xba'));var _0x249b94=path[_0xd016('0x7a')](_0x4d9c15,_0x23b17d);var _0x4ce0a5=util[_0xd016('0x81')](_0xd016('0xbb'),_0x2b93a8[_0xd016('0x41')]['id'],_0x23b17d);var _0x103dc0=path['join'](_0x4d9c15,_0x4ce0a5);var _0x2653f9=[];_0x2653f9[_0xd016('0xae')]({'model':db[_0xd016('0x86')],'as':_0xd016('0x86'),'attributes':['id',_0xd016('0x56')],'raw':!![]});_0x2653f9[_0xd016('0xae')]({'model':db[_0xd016('0xbc')],'as':'Contact','attributes':['id',_0xd016('0xbd'),_0xd016('0xbe')],'raw':!![]});if(_0x2b93a8['query'][_0xd016('0xba')]){_0x2653f9[_0xd016('0xae')]({'model':db[_0xd016('0x76')],'as':_0xd016('0x76'),'raw':!![]});}var _0x453cb9=[{'model':db[_0xd016('0x84')],'as':_0xd016('0x85'),'attributes':['id',_0xd016('0x34'),_0xd016('0x90'),_0xd016('0x92'),'secret',_0xd016('0xbf')],'include':_0x2653f9}];_0x453cb9['push']({'model':db[_0xd016('0x4e')],'as':_0xd016('0xc0'),'attributes':['id','name']});_0x453cb9['push']({'model':db[_0xd016('0x86')],'as':_0xd016('0xc1'),'attributes':['id',_0xd016('0x56')]});return db[_0xd016('0x39')][_0xd016('0x49')]({'where':{'id':_0x2b93a8[_0xd016('0x41')]['id']},'include':_0x453cb9})[_0xd016('0x19')](handleEntityNotFound(_0x51f259,null))[_0xd016('0x19')](function(_0x230231){if(_0x230231){var _0x486641=_0x230231[_0xd016('0xc2')]({'plain':!![]});fs[_0xd016('0xc3')](_0x249b94);var _0x450a37={'channel':_0xd016('0xc4'),'account':_0x486641[_0xd016('0xc0')]['name'],'agent':_0x486641['Owner']?_0x486641[_0xd016('0xc1')][_0xd016('0x56')]:'N.A.','createdAt':moment(_0x486641[_0xd016('0x90')])[_0xd016('0x81')](_0xd016('0xa9'))[_0xd016('0xb6')](),'closedAt':_0x486641[_0xd016('0x6d')]?moment(_0x486641[_0xd016('0xc5')])[_0xd016('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd016('0xb6')]():'','disposition':_0x486641[_0xd016('0x6e')],'chatInfo':{'browser':_0x486641['browserName'],'os':_0x486641[_0xd016('0xc6')],'referer':_0x486641[_0xd016('0xc7')],'customerIp':_0x486641[_0xd016('0xc8')],'customerPort':_0x486641['customerPort']?_0x486641[_0xd016('0xc9')]:_0xd016('0xca')},'messages':_(_0x486641['Messages'])[_0xd016('0xcb')]()[_0xd016('0xa5')]({'secret':![]})[_0xd016('0xa6')](function(_0x1c5af3){if(_0x1c5af3['Attachment']){var _0x34c8a8=path[_0xd016('0x7a')](_0x552197,_0x1c5af3[_0xd016('0x76')][_0xd016('0x72')]);if(fs[_0xd016('0xcc')](_0x34c8a8)){fs[_0xd016('0xcd')](_0x34c8a8)['pipe'](fs['createWriteStream'](path[_0xd016('0x7a')](_0x249b94,_0x1c5af3['Attachment'][_0xd016('0x72')])));}}return{'date':moment(_0x1c5af3[_0xd016('0x90')])[_0xd016('0x81')](_0xd016('0xa9'))[_0xd016('0xb6')](),'sender':_0x1c5af3[_0xd016('0x92')]===_0xd016('0x64')?_0x1c5af3[_0xd016('0x86')]?_0x1c5af3['User'][_0xd016('0x56')]:_0xd016('0x89'):_0x1c5af3[_0xd016('0x68')][_0xd016('0xbd')]+(_0x1c5af3[_0xd016('0x68')]['lastName']?'\x20'+_0x1c5af3[_0xd016('0x68')][_0xd016('0xbe')]:''),'body':_0x1c5af3['Attachment']?_0x1c5af3[_0xd016('0x76')][_0xd016('0x72')]:_0x1c5af3[_0xd016('0x34')],'direction':_0x1c5af3[_0xd016('0x92')]===_0xd016('0x64')?'A':'C','secret':_0x1c5af3[_0xd016('0x93')],'read':_0x1c5af3[_0xd016('0xbf')],'attachment':_0x1c5af3[_0xd016('0x76')]};})[_0xd016('0xce')]()};return ejs[_0xd016('0xcf')](path['join'](config[_0xd016('0x7b')],_0xd016('0xb7'),_0xd016('0xd0'),'downloadInteraction.ejs'),{'interaction':_0x450a37})[_0xd016('0x19')](function(_0x2ade34){var _0x187540=path[_0xd016('0x7a')](_0x249b94,_0xd016('0xd1')+_0x486641['id']+'-'+_0x23b17d+_0xd016('0xd2'));var _0x4f5366={'path':_0x187540,'channel':'Chat','interactionId':_0x486641['id']};return pdf[_0xd016('0xd3')](_0x2ade34,_0x4f5366);})[_0xd016('0x19')](function(){return new Promise(function(_0x305b77,_0x4a1809){zipdir(_0x249b94,{'saveTo':_0x103dc0},function(_0x6d77d2,_0x4726b8){if(_0x6d77d2)return _0x4a1809(_0x6d77d2);return _0x305b77(_0x4726b8);});})[_0xd016('0x19')](function(){return new BPromise(function(_0x1772f0,_0x588119){rimraf(_0x249b94,function(_0x504741){if(_0x504741)_0x588119(_0x504741);return _0x1772f0();});});})[_0xd016('0x19')](function(){return _0x51f259[_0xd016('0x7e')](_0x103dc0,_0x4ce0a5,function(_0x2c5b7c){if(_0x2c5b7c){logger['error'](_0xd016('0xd4'),_0x2c5b7c);}else{fs['unlinkSync'](_0x103dc0);}});});});}else{return _0x51f259[_0xd016('0x24')](0xc8);}})[_0xd016('0x23')](handleError(_0x51f259,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index dee2419..c848f4c 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 _0x4cbc=['unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map'];(function(_0x419ddc,_0x38acb3){var _0x1215e8=function(_0x17a495){while(--_0x17a495){_0x419ddc['push'](_0x419ddc['shift']());}};_0x1215e8(++_0x38acb3);}(_0x4cbc,0x155));var _0xc4cb=function(_0xdbb4c3,_0x244108){_0xdbb4c3=_0xdbb4c3-0x0;var _0x1b5f3f=_0x4cbc[_0xdbb4c3];return _0x1b5f3f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xc4cb('0x0'))['db'][_0xc4cb('0x1')];var ChatMessage=require(_0xc4cb('0x0'))['db'][_0xc4cb('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc4cb('0x3')](0x0);var events={'afterCreate':_0xc4cb('0x4'),'afterUpdate':_0xc4cb('0x5'),'afterDestroy':_0xc4cb('0x6')};function emitEvent(_0x1a7a28){return function(_0x27c884,_0x4bea35,_0x5dd9b3){_0x27c884[_0xc4cb('0x7')]({'attributes':['id'],'raw':!![]})[_0xc4cb('0x8')](function(_0x5b7486){_0x27c884[_0xc4cb('0x9')]('Users',_0x5b7486[_0xc4cb('0xa')](function(_0x5040ca){return{'id':_0x5040ca['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x27c884['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x51362c){_0x27c884['setDataValue'](_0xc4cb('0xb'),_0x51362c['length']);ChatInteractionEvents['emit'](_0x1a7a28+':'+_0x27c884['id'],_0x27c884);ChatInteractionEvents[_0xc4cb('0xc')](_0x1a7a28,_0x27c884);_0x5dd9b3(null);})[_0xc4cb('0xd')](_0x5dd9b3(null));};}for(var e in events){if(events[_0xc4cb('0xe')](e)){var event=events[e];ChatInteraction[_0xc4cb('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0xbfc1=['../../mysqldb','ChatMessage','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hook','ChatInteraction'];(function(_0x1ddfe2,_0x41e6a4){var _0xa19e17=function(_0x585cb8){while(--_0x585cb8){_0x1ddfe2['push'](_0x1ddfe2['shift']());}};_0xa19e17(++_0x41e6a4);}(_0xbfc1,0x1df));var _0x1bfc=function(_0xa66bc1,_0x26010d){_0xa66bc1=_0xa66bc1-0x0;var _0x3783a8=_0xbfc1[_0xa66bc1];return _0x3783a8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x1bfc('0x0')];var ChatMessage=require(_0x1bfc('0x1'))['db'][_0x1bfc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1bfc('0x3'),'afterUpdate':_0x1bfc('0x4'),'afterDestroy':_0x1bfc('0x5')};function emitEvent(_0x324dd6){return function(_0x852547,_0x50d39f,_0x2aabb5){_0x852547[_0x1bfc('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5eda9c){_0x852547[_0x1bfc('0x7')](_0x1bfc('0x8'),_0x5eda9c[_0x1bfc('0x9')](function(_0x15321e){return{'id':_0x15321e['id']};}));return ChatMessage[_0x1bfc('0xa')]({'where':{'ChatInteractionId':_0x852547['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1bfc('0xb')](function(_0x1a9410){_0x852547[_0x1bfc('0x7')]('unreadMessages',_0x1a9410[_0x1bfc('0xc')]);ChatInteractionEvents[_0x1bfc('0xd')](_0x324dd6+':'+_0x852547['id'],_0x852547);ChatInteractionEvents[_0x1bfc('0xd')](_0x324dd6,_0x852547);_0x2aabb5(null);})[_0x1bfc('0xe')](_0x2aabb5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x1bfc('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 78610e8..cd88ac5 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 _0xca82=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x1f3f38,_0x284d6f){var _0xba052=function(_0x1a1bbb){while(--_0x1a1bbb){_0x1f3f38['push'](_0x1f3f38['shift']());}};_0xba052(++_0x284d6f);}(_0xca82,0x16c));var _0x2ca8=function(_0x330ff0,_0x146528){_0x330ff0=_0x330ff0-0x0;var _0x215472=_0xca82[_0x330ff0];return _0x215472;};'use strict';var _=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var logger=require(_0x2ca8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2ca8('0x3'));var rp=require(_0x2ca8('0x4'));var fs=require('fs');var path=require(_0x2ca8('0x5'));var rimraf=require('rimraf');var config=require(_0x2ca8('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x2ca8('0x7')]=function(_0x33a3e1,_0x824126){return _0x33a3e1[_0x2ca8('0x8')](_0x2ca8('0x9'),attributes,{'tableName':_0x2ca8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ec966,_0x24ecf6,_0x50455a){if(_0x1ec966[_0x2ca8('0xb')](_0x2ca8('0xc'))){_0x1ec966[_0x2ca8('0xd')]=moment()[_0x2ca8('0xe')](_0x2ca8('0xf'));}_0x50455a(null,_0x1ec966);}},'charset':_0x2ca8('0x10'),'collate':_0x2ca8('0x11')});};
\ No newline at end of file
+var _0xebcc=['exports','define','ChatInteraction','changed','closedAt','format','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xebcc,0x107));var _0xcebc=function(_0x4b0388,_0x3749fb){_0x4b0388=_0x4b0388-0x0;var _0x5c3406=_0xebcc[_0x4b0388];return _0x5c3406;};'use strict';var _=require(_0xcebc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcebc('0x1'));var moment=require(_0xcebc('0x2'));var BPromise=require(_0xcebc('0x3'));var rp=require(_0xcebc('0x4'));var fs=require('fs');var path=require(_0xcebc('0x5'));var rimraf=require(_0xcebc('0x6'));var config=require(_0xcebc('0x7'));var attributes=require(_0xcebc('0x8'));module[_0xcebc('0x9')]=function(_0x1a10f3,_0x3e238b){return _0x1a10f3[_0xcebc('0xa')](_0xcebc('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x581360,_0x2dfe33,_0x3ea8ba){if(_0x581360[_0xcebc('0xc')]('closed')){_0x581360[_0xcebc('0xd')]=moment()[_0xcebc('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3ea8ba(null,_0x581360);}},'charset':'utf8mb4','collate':_0xcebc('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 58b64f2..7bc119f 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 _0x7978=['ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','ChatInteraction','update','options','raw','where','attributes','limit','then','UpdateChatInteraction','stringify','find','addTags','body','ids','omit','lodash','util','bluebird','randomstring'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7978,0x1a9));var _0x8797=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x7978[_0x176329];return _0x31997c;};'use strict';var _=require(_0x8797('0x0'));var util=require(_0x8797('0x1'));var moment=require('moment');var BPromise=require(_0x8797('0x2'));var rs=require(_0x8797('0x3'));var fs=require('fs');var Redis=require(_0x8797('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8797('0x5'))(_0x8797('0x6'));var config=require('../../config/environment');var jayson=require(_0x8797('0x7'));var client=jayson[_0x8797('0x8')]['http']({'port':0x232a});config[_0x8797('0x9')]=_[_0x8797('0xa')](config[_0x8797('0x9')],{'host':_0x8797('0xb'),'port':0x18eb});var socket=require(_0x8797('0xc'))(new Redis(config['redis']));require(_0x8797('0xd'))[_0x8797('0xe')](socket);function respondWithRpcPromise(_0x4f73bb,_0x105f58,_0x17429d){return new BPromise(function(_0x42a68f,_0x399887){return client['request'](_0x4f73bb,_0x17429d)['then'](function(_0x3e662c){logger[_0x8797('0xf')](_0x8797('0x10'),_0x105f58,_0x8797('0x11'));logger[_0x8797('0x12')](_0x8797('0x13'),_0x105f58,'request\x20sent',JSON['stringify'](_0x3e662c));if(_0x3e662c[_0x8797('0x14')]){if(_0x3e662c[_0x8797('0x14')][_0x8797('0x15')]===0x1f4){logger[_0x8797('0x14')](_0x8797('0x10'),_0x105f58,_0x3e662c[_0x8797('0x14')]['message']);return _0x399887(_0x3e662c[_0x8797('0x14')][_0x8797('0x16')]);}logger[_0x8797('0x14')](_0x8797('0x10'),_0x105f58,_0x3e662c[_0x8797('0x14')][_0x8797('0x16')]);return _0x42a68f(_0x3e662c[_0x8797('0x14')][_0x8797('0x16')]);}else{logger[_0x8797('0xf')](_0x8797('0x10'),_0x105f58,_0x8797('0x11'));_0x42a68f(_0x3e662c['result'][_0x8797('0x16')]);}})[_0x8797('0x17')](function(_0x49b41b){logger['error'](_0x8797('0x10'),_0x105f58,_0x49b41b);_0x399887(_0x49b41b);});});}exports['UpdateChatInteraction']=function(_0x43fef7){var _0xa86c9e=this;return new Promise(function(_0x41bf25,_0x226846){return db[_0x8797('0x18')][_0x8797('0x19')](_0x43fef7['body'],{'raw':_0x43fef7[_0x8797('0x1a')]?_0x43fef7[_0x8797('0x1a')][_0x8797('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43fef7[_0x8797('0x1a')]?_0x43fef7[_0x8797('0x1a')][_0x8797('0x1c')]||null:null,'attributes':_0x43fef7[_0x8797('0x1a')]?_0x43fef7[_0x8797('0x1a')][_0x8797('0x1d')]||null:null,'limit':_0x43fef7[_0x8797('0x1a')]?_0x43fef7['options'][_0x8797('0x1e')]||null:null})[_0x8797('0x1f')](function(_0x3aa9de){logger[_0x8797('0xf')](_0x8797('0x20'),_0x43fef7);logger[_0x8797('0x12')](_0x8797('0x20'),_0x43fef7,JSON[_0x8797('0x21')](_0x3aa9de));_0x41bf25(_0x3aa9de);})[_0x8797('0x17')](function(_0x42bbe){logger[_0x8797('0x14')]('UpdateChatInteraction',_0x42bbe[_0x8797('0x16')],_0x43fef7);_0x226846(_0xa86c9e[_0x8797('0x14')](0x1f4,_0x42bbe[_0x8797('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x5aa023){return new Promise(function(_0x37f37f,_0x3cefea){return db[_0x8797('0x18')][_0x8797('0x22')]({'where':_0x5aa023['options']?_0x5aa023[_0x8797('0x1a')][_0x8797('0x1c')]||null:null})[_0x8797('0x1f')](function(_0x47e39a){if(_0x47e39a){return _0x47e39a[_0x8797('0x23')](_0x5aa023[_0x8797('0x24')][_0x8797('0x25')],_[_0x8797('0x26')](_0x5aa023['body'],['ids','id'])||{});}})['spread'](function(_0x24b122){logger['info']('AddTags',_0x5aa023);logger[_0x8797('0x12')]('AddTags',_0x5aa023,JSON[_0x8797('0x21')](_0x24b122));_0x37f37f(_0x24b122);})[_0x8797('0x17')](function(_0x520708){logger[_0x8797('0x14')]('AddTags',_0x520708[_0x8797('0x16')],_0x5aa023);_0x3cefea(_this['error'](0x1f4,_0x520708[_0x8797('0x16')]));});});};
\ No newline at end of file
+var _0xaec7=['error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xaec7,0x1b9));var _0x7aec=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0xaec7[_0x20e7e3];return _0x14b9de;};'use strict';var _=require(_0x7aec('0x0'));var util=require(_0x7aec('0x1'));var moment=require(_0x7aec('0x2'));var BPromise=require('bluebird');var rs=require(_0x7aec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7aec('0x4'));var logger=require(_0x7aec('0x5'))(_0x7aec('0x6'));var config=require(_0x7aec('0x7'));var jayson=require(_0x7aec('0x8'));var client=jayson[_0x7aec('0x9')][_0x7aec('0xa')]({'port':0x232a});config[_0x7aec('0xb')]=_['defaults'](config['redis'],{'host':_0x7aec('0xc'),'port':0x18eb});var socket=require(_0x7aec('0xd'))(new Redis(config[_0x7aec('0xb')]));require(_0x7aec('0xe'))[_0x7aec('0xf')](socket);function respondWithRpcPromise(_0x112457,_0x4a7ca1,_0x2be259){return new BPromise(function(_0x3bec6a,_0x58e819){return client['request'](_0x112457,_0x2be259)[_0x7aec('0x10')](function(_0x43ce87){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4a7ca1,_0x7aec('0x11'));logger[_0x7aec('0x12')](_0x7aec('0x13'),_0x4a7ca1,_0x7aec('0x11'),JSON[_0x7aec('0x14')](_0x43ce87));if(_0x43ce87[_0x7aec('0x15')]){if(_0x43ce87['error'][_0x7aec('0x16')]===0x1f4){logger['error'](_0x7aec('0x17'),_0x4a7ca1,_0x43ce87['error'][_0x7aec('0x18')]);return _0x58e819(_0x43ce87[_0x7aec('0x15')][_0x7aec('0x18')]);}logger[_0x7aec('0x15')](_0x7aec('0x17'),_0x4a7ca1,_0x43ce87[_0x7aec('0x15')][_0x7aec('0x18')]);return _0x3bec6a(_0x43ce87[_0x7aec('0x15')][_0x7aec('0x18')]);}else{logger[_0x7aec('0x19')](_0x7aec('0x17'),_0x4a7ca1,_0x7aec('0x11'));_0x3bec6a(_0x43ce87['result']['message']);}})[_0x7aec('0x1a')](function(_0x2bf09f){logger[_0x7aec('0x15')](_0x7aec('0x17'),_0x4a7ca1,_0x2bf09f);_0x58e819(_0x2bf09f);});});}exports[_0x7aec('0x1b')]=function(_0x56573b){var _0x2323e7=this;return new Promise(function(_0x5d05d0,_0x56268d){return db[_0x7aec('0x1c')][_0x7aec('0x1d')](_0x56573b[_0x7aec('0x1e')],{'raw':_0x56573b[_0x7aec('0x1f')]?_0x56573b[_0x7aec('0x1f')][_0x7aec('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56573b['options']?_0x56573b['options'][_0x7aec('0x21')]||null:null,'attributes':_0x56573b[_0x7aec('0x1f')]?_0x56573b[_0x7aec('0x1f')]['attributes']||null:null,'limit':_0x56573b[_0x7aec('0x1f')]?_0x56573b[_0x7aec('0x1f')][_0x7aec('0x22')]||null:null})[_0x7aec('0x10')](function(_0x16772c){logger[_0x7aec('0x19')](_0x7aec('0x1b'),_0x56573b);logger['debug']('UpdateChatInteraction',_0x56573b,JSON[_0x7aec('0x14')](_0x16772c));_0x5d05d0(_0x16772c);})['catch'](function(_0x266453){logger[_0x7aec('0x15')](_0x7aec('0x1b'),_0x266453[_0x7aec('0x18')],_0x56573b);_0x56268d(_0x2323e7['error'](0x1f4,_0x266453[_0x7aec('0x18')]));});});};exports[_0x7aec('0x23')]=function(_0xa66034){return new Promise(function(_0x5e8dc1,_0x3de67a){return db['ChatInteraction'][_0x7aec('0x24')]({'where':_0xa66034['options']?_0xa66034[_0x7aec('0x1f')][_0x7aec('0x21')]||null:null})[_0x7aec('0x10')](function(_0xe87c37){if(_0xe87c37){return _0xe87c37[_0x7aec('0x25')](_0xa66034[_0x7aec('0x1e')]['ids'],_[_0x7aec('0x26')](_0xa66034[_0x7aec('0x1e')],[_0x7aec('0x27'),'id'])||{});}})[_0x7aec('0x28')](function(_0x23931c){logger[_0x7aec('0x19')]('AddTags',_0xa66034);logger[_0x7aec('0x12')](_0x7aec('0x29'),_0xa66034,JSON[_0x7aec('0x14')](_0x23931c));_0x5e8dc1(_0x23931c);})['catch'](function(_0xa9ead6){logger[_0x7aec('0x15')](_0x7aec('0x29'),_0xa9ead6[_0x7aec('0x18')],_0xa66034);_0x3de67a(_this['error'](0x1f4,_0xa9ead6[_0x7aec('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 017f268..207e507 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 _0x99fa=['removeListener','register','length','./chatInteraction.events','save','remove','update','emit'];(function(_0x36319d,_0x25df43){var _0x587d8d=function(_0xe528ab){while(--_0xe528ab){_0x36319d['push'](_0x36319d['shift']());}};_0x587d8d(++_0x25df43);}(_0x99fa,0x14b));var _0xa99f=function(_0x2d892a,_0x59e61a){_0x2d892a=_0x2d892a-0x0;var _0x367765=_0x99fa[_0x2d892a];return _0x367765;};'use strict';var ChatInteractionEvents=require(_0xa99f('0x0'));var events=[_0xa99f('0x1'),_0xa99f('0x2'),_0xa99f('0x3')];function createListener(_0x1063d5,_0x2b5be0){return function(_0x4c7b07){_0x2b5be0[_0xa99f('0x4')](_0x1063d5,_0x4c7b07);};}function removeListener(_0xe3164a,_0x2b6d57){return function(){ChatInteractionEvents[_0xa99f('0x5')](_0xe3164a,_0x2b6d57);};}exports[_0xa99f('0x6')]=function(_0x53cc48){for(var _0x533119=0x0,_0x385b19=events[_0xa99f('0x7')];_0x533119<_0x385b19;_0x533119++){var _0x104afe=events[_0x533119];var _0x2acde8=createListener('chatInteraction:'+_0x104afe,_0x53cc48);ChatInteractionEvents['on'](_0x104afe,_0x2acde8);}};
\ No newline at end of file
+var _0x5d15=['save','remove','update','emit','register','length','./chatInteraction.events'];(function(_0x458f09,_0xf2ee90){var _0x1ca565=function(_0x8ec760){while(--_0x8ec760){_0x458f09['push'](_0x458f09['shift']());}};_0x1ca565(++_0xf2ee90);}(_0x5d15,0x76));var _0x55d1=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x5d15[_0x5550b3];return _0x4b8fc4;};'use strict';var ChatInteractionEvents=require(_0x55d1('0x0'));var events=[_0x55d1('0x1'),_0x55d1('0x2'),_0x55d1('0x3')];function createListener(_0x532365,_0x53d4b8){return function(_0x2f31be){_0x53d4b8[_0x55d1('0x4')](_0x532365,_0x2f31be);};}function removeListener(_0x11fb4b,_0x14f2cf){return function(){ChatInteractionEvents['removeListener'](_0x11fb4b,_0x14f2cf);};}exports[_0x55d1('0x5')]=function(_0x38136b){for(var _0x40e406=0x0,_0x3aba1a=events[_0x55d1('0x6')];_0x40e406<_0x3aba1a;_0x40e406++){var _0x3e9d0d=events[_0x40e406];var _0x2ee6c1=createListener('chatInteraction:'+_0x3e9d0d,_0x38136b);ChatInteractionEvents['on'](_0x3e9d0d,_0x2ee6c1);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 1725adf..2ca150c 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 _0x993b=['addTags','put','tracked','chat','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0x993b,0x1d5));var _0xb993=function(_0x2f05fd,_0x1185c6){_0x2f05fd=_0x2f05fd-0x0;var _0x5aa831=_0x993b[_0x2f05fd];return _0x5aa831;};'use strict';var multer=require(_0xb993('0x0'));var util=require(_0xb993('0x1'));var path=require(_0xb993('0x2'));var timeout=require(_0xb993('0x3'));var express=require(_0xb993('0x4'));var router=express[_0xb993('0x5')]();var fs_extra=require(_0xb993('0x6'));var auth=require(_0xb993('0x7'));var interaction=require(_0xb993('0x8'));var config=require(_0xb993('0x9'));var controller=require('./chatInteraction.controller');router[_0xb993('0xa')]('/',auth[_0xb993('0xb')](),controller[_0xb993('0xc')]);router[_0xb993('0xa')](_0xb993('0xd'),auth[_0xb993('0xb')](),controller[_0xb993('0xe')]);router[_0xb993('0xa')](_0xb993('0xf'),auth[_0xb993('0x10')](),controller[_0xb993('0x11')]);router[_0xb993('0xa')]('/:id/attachment_download',auth[_0xb993('0x10')](),controller[_0xb993('0x12')]);router[_0xb993('0xa')](_0xb993('0x13'),auth[_0xb993('0xb')](),controller[_0xb993('0x14')]);router[_0xb993('0xa')](_0xb993('0x15'),auth[_0xb993('0x10')](),controller[_0xb993('0x16')]);router[_0xb993('0xa')](_0xb993('0x17'),auth['isAuthenticated'](),controller[_0xb993('0x18')]);router[_0xb993('0x19')]('/',auth[_0xb993('0xb')](),controller[_0xb993('0x1a')]);router[_0xb993('0x19')](_0xb993('0x1b'),auth[_0xb993('0xb')](),controller[_0xb993('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d5f52,_0x817de3,_0x445e2c){_0x445e2c(null,path[_0xb993('0x1d')](config[_0xb993('0x1e')],_0xb993('0x1f')));},'filename':function(_0x3a6b0b,_0x761e90,_0x34e3b8){_0x34e3b8(null,util[_0xb993('0x20')](_0xb993('0x21'),Date[_0xb993('0x22')](),_0x761e90[_0xb993('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb993('0x19')]('/:id/attachment_upload',upload['single'](_0xb993('0x24')),controller[_0xb993('0x25')]);router[_0xb993('0x19')](_0xb993('0x13'),auth[_0xb993('0x10')](),controller[_0xb993('0x26')]);router[_0xb993('0x19')](_0xb993('0x27'),auth[_0xb993('0xb')](),interaction['tracked']('chat',_0xb993('0x28')),controller[_0xb993('0x29')]);router[_0xb993('0x2a')](_0xb993('0xf'),auth[_0xb993('0xb')](),interaction[_0xb993('0x2b')](_0xb993('0x2c'),'chatinteraction:update'),controller['update']);router[_0xb993('0x2a')](_0xb993('0x2d'),controller[_0xb993('0x2e')]);router[_0xb993('0x2a')](_0xb993('0x2f'),auth[_0xb993('0x10')](),controller[_0xb993('0x30')]);router[_0xb993('0x2a')]('/:id/close',controller['close']);router[_0xb993('0x31')](_0xb993('0xf'),auth['isAuthenticated'](),interaction[_0xb993('0x2b')]('chat',_0xb993('0x32')),controller['destroy']);router[_0xb993('0x31')](_0xb993('0x27'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x37e3=['put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x19ccd3,_0x3cb70c){var _0x134097=function(_0x32fdb6){while(--_0x32fdb6){_0x19ccd3['push'](_0x19ccd3['shift']());}};_0x134097(++_0x3cb70c);}(_0x37e3,0xbc));var _0x337e=function(_0x51a6ea,_0x4789e7){_0x51a6ea=_0x51a6ea-0x0;var _0x4c6e17=_0x37e3[_0x51a6ea];return _0x4c6e17;};'use strict';var multer=require(_0x337e('0x0'));var util=require(_0x337e('0x1'));var path=require(_0x337e('0x2'));var timeout=require(_0x337e('0x3'));var express=require(_0x337e('0x4'));var router=express[_0x337e('0x5')]();var fs_extra=require(_0x337e('0x6'));var auth=require(_0x337e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x337e('0x8'));var controller=require(_0x337e('0x9'));router[_0x337e('0xa')]('/',auth['isAuthenticated'](),controller[_0x337e('0xb')]);router[_0x337e('0xa')](_0x337e('0xc'),auth[_0x337e('0xd')](),controller[_0x337e('0xe')]);router['get']('/:id',auth[_0x337e('0xf')](),controller[_0x337e('0x10')]);router[_0x337e('0xa')]('/:id/attachment_download',auth[_0x337e('0xf')](),controller[_0x337e('0x11')]);router[_0x337e('0xa')](_0x337e('0x12'),auth[_0x337e('0xd')](),controller[_0x337e('0x13')]);router[_0x337e('0xa')](_0x337e('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x337e('0x15')]);router['get'](_0x337e('0x16'),auth[_0x337e('0xd')](),controller[_0x337e('0x17')]);router[_0x337e('0x18')]('/',auth[_0x337e('0xd')](),controller[_0x337e('0x19')]);router[_0x337e('0x18')](_0x337e('0x1a'),auth[_0x337e('0xd')](),controller[_0x337e('0x1b')]);var upload=multer({'storage':multer[_0x337e('0x1c')]({'destination':function(_0xfb5c13,_0x31649e,_0x5b9c9a){_0x5b9c9a(null,path['join'](config[_0x337e('0x1d')],_0x337e('0x1e')));},'filename':function(_0x31460b,_0x37bc46,_0x469719){_0x469719(null,util[_0x337e('0x1f')](_0x337e('0x20'),Date[_0x337e('0x21')](),_0x37bc46['originalname'][_0x337e('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x337e('0x18')](_0x337e('0x23'),upload[_0x337e('0x24')](_0x337e('0x25')),controller[_0x337e('0x26')]);router['post'](_0x337e('0x12'),auth[_0x337e('0xf')](),controller[_0x337e('0x27')]);router[_0x337e('0x18')]('/:id/tags',auth[_0x337e('0xd')](),interaction[_0x337e('0x28')](_0x337e('0x29'),_0x337e('0x2a')),controller[_0x337e('0x2b')]);router[_0x337e('0x2c')](_0x337e('0x2d'),auth['isAuthenticated'](),interaction[_0x337e('0x28')](_0x337e('0x29'),_0x337e('0x2e')),controller[_0x337e('0x2f')]);router[_0x337e('0x2c')](_0x337e('0x30'),controller[_0x337e('0x31')]);router[_0x337e('0x2c')](_0x337e('0x32'),auth[_0x337e('0xf')](),controller['abandon']);router[_0x337e('0x2c')](_0x337e('0x33'),controller[_0x337e('0x34')]);router[_0x337e('0x35')]('/:id',auth[_0x337e('0xd')](),interaction[_0x337e('0x28')](_0x337e('0x29'),_0x337e('0x36')),controller[_0x337e('0x37')]);router['delete']('/:id/tags',auth[_0x337e('0xd')](),controller[_0x337e('0x38')]);module[_0x337e('0x39')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 621955a..e882857 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 _0xcc78=['TEXT','medium','INTEGER','sequelize','exports'];(function(_0x1439fa,_0x208d7a){var _0x3a03ec=function(_0x5c9679){while(--_0x5c9679){_0x1439fa['push'](_0x1439fa['shift']());}};_0x3a03ec(++_0x208d7a);}(_0xcc78,0xfd));var _0x8cc7=function(_0x26d0b4,_0x3091c9){_0x26d0b4=_0x26d0b4-0x0;var _0x3ac956=_0xcc78[_0x26d0b4];return _0x3ac956;};'use strict';var Sequelize=require(_0x8cc7('0x0'));module[_0x8cc7('0x1')]={'body':{'type':Sequelize[_0x8cc7('0x2')](_0x8cc7('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8cc7('0x4')]}};
\ No newline at end of file
+var _0xe426=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe426,0xac));var _0x6e42=function(_0x316b7b,_0x4f7b7b){_0x316b7b=_0x316b7b-0x0;var _0x2a7b74=_0xe426[_0x316b7b];return _0x2a7b74;};'use strict';var Sequelize=require(_0x6e42('0x0'));module[_0x6e42('0x1')]={'body':{'type':Sequelize[_0x6e42('0x2')](_0x6e42('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6e42('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6e42('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 49b4ee1..ca11b76 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 _0xb245=['VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xb245,0xf0));var _0x5b24=function(_0x308195,_0x1423f4){_0x308195=_0x308195-0x0;var _0x2c31f9=_0xb245[_0x308195];return _0x2c31f9;};'use strict';var emlformat=require(_0x5b24('0x0'));var rimraf=require(_0x5b24('0x1'));var zipdir=require(_0x5b24('0x2'));var jsonpatch=require(_0x5b24('0x3'));var rp=require(_0x5b24('0x4'));var moment=require(_0x5b24('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5b24('0x6'));var path=require(_0x5b24('0x7'));var sox=require('sox');var csv=require(_0x5b24('0x8'));var ejs=require(_0x5b24('0x9'));var fs=require('fs');var fs_extra=require(_0x5b24('0xa'));var _=require(_0x5b24('0xb'));var squel=require(_0x5b24('0xc'));var crypto=require(_0x5b24('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b24('0xe'));var toCsv=require(_0x5b24('0x8'));var querystring=require(_0x5b24('0xf'));var Papa=require(_0x5b24('0x10'));var Redis=require('ioredis');var authService=require(_0x5b24('0x11'));var qs=require(_0x5b24('0x12'));var as=require(_0x5b24('0x13'));var hardwareService=require(_0x5b24('0x14'));var logger=require(_0x5b24('0x15'))(_0x5b24('0x16'));var utils=require(_0x5b24('0x17'));var config=require(_0x5b24('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b24('0x19'))['db'];config[_0x5b24('0x1a')]=_[_0x5b24('0x1b')](config[_0x5b24('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b24('0x1c'))(new Redis(config[_0x5b24('0x1a')]));require('./chatInternalMessage.socket')[_0x5b24('0x1d')](socket);function respondWithStatusCode(_0x70b63b,_0x141cd3){_0x141cd3=_0x141cd3||0xcc;return function(_0x4139f6){if(_0x4139f6){return _0x70b63b[_0x5b24('0x1e')](_0x141cd3);}return _0x70b63b[_0x5b24('0x1f')](_0x141cd3)[_0x5b24('0x20')]();};}function respondWithResult(_0x52d383,_0x57a49b){_0x57a49b=_0x57a49b||0xc8;return function(_0x4de627){if(_0x4de627){return _0x52d383['status'](_0x57a49b)['json'](_0x4de627);}};}function respondWithFilteredResult(_0x3e1831,_0xbb305){return function(_0x4cd574){if(_0x4cd574){var _0xe0910c=typeof _0xbb305[_0x5b24('0x21')]==='undefined'&&typeof _0xbb305['limit']===_0x5b24('0x22');var _0x2ead72=_0x4cd574[_0x5b24('0x23')];var _0x4e1cc6=_0xe0910c?0x0:_0xbb305[_0x5b24('0x21')];var _0x593b81=_0xe0910c?_0x4cd574[_0x5b24('0x23')]:_0xbb305[_0x5b24('0x21')]+_0xbb305[_0x5b24('0x24')];var _0x313f77;if(_0x593b81>=_0x2ead72){_0x593b81=_0x2ead72;_0x313f77=0xc8;}else{_0x313f77=0xce;}_0x3e1831['status'](_0x313f77);return _0x3e1831[_0x5b24('0x25')](_0x5b24('0x26'),_0x4e1cc6+'-'+_0x593b81+'/'+_0x2ead72)[_0x5b24('0x27')](_0x4cd574);}return null;};}function patchUpdates(_0x41ae9f){return function(_0x4ab918){try{jsonpatch['apply'](_0x4ab918,_0x41ae9f,!![]);}catch(_0x48a4ae){return BPromise[_0x5b24('0x28')](_0x48a4ae);}return _0x4ab918[_0x5b24('0x29')]();};}function saveUpdates(_0x2a07ba,_0x3147fb){return function(_0x301fea){if(_0x301fea){return _0x301fea[_0x5b24('0x2a')](_0x2a07ba)[_0x5b24('0x2b')](function(_0x1ede38){return _0x1ede38;});}return null;};}function removeEntity(_0xf5f504,_0x23969d){return function(_0x38669c){if(_0x38669c){return _0x38669c[_0x5b24('0x2c')]()[_0x5b24('0x2b')](function(){_0xf5f504[_0x5b24('0x1f')](0xcc)[_0x5b24('0x20')]();});}};}function handleEntityNotFound(_0x3f50a6,_0x5ed603){return function(_0x468df7){if(!_0x468df7){_0x3f50a6[_0x5b24('0x1e')](0x194);}return _0x468df7;};}function handleError(_0x3bb438,_0x8de6c1){_0x8de6c1=_0x8de6c1||0x1f4;return function(_0x38c3b1){logger[_0x5b24('0x2d')](_0x38c3b1[_0x5b24('0x2e')]);if(_0x38c3b1[_0x5b24('0x2f')]){delete _0x38c3b1[_0x5b24('0x2f')];}_0x3bb438[_0x5b24('0x1f')](_0x8de6c1)[_0x5b24('0x30')](_0x38c3b1);};}exports[_0x5b24('0x31')]=function(_0x1069da,_0x5a007b){var _0x51bf3f={},_0x3193aa={},_0x51ebc9={'count':0x0,'rows':[]};var _0x2d0d16=_[_0x5b24('0x32')](db[_0x5b24('0x33')][_0x5b24('0x34')],function(_0xf859f1){return{'name':_0xf859f1['fieldName'],'type':_0xf859f1[_0x5b24('0x35')][_0x5b24('0x36')]};});_0x3193aa[_0x5b24('0x37')]=_['map'](_0x2d0d16,_0x5b24('0x2f'));_0x3193aa[_0x5b24('0x38')]=_[_0x5b24('0x39')](_0x1069da[_0x5b24('0x38')]);_0x3193aa['filters']=_[_0x5b24('0x3a')](_0x3193aa[_0x5b24('0x37')],_0x3193aa[_0x5b24('0x38')]);_0x51bf3f['attributes']=_['intersection'](_0x3193aa[_0x5b24('0x37')],qs['fields'](_0x1069da['query'][_0x5b24('0x3b')]));_0x51bf3f[_0x5b24('0x3c')]=_0x51bf3f[_0x5b24('0x3c')][_0x5b24('0x3d')]?_0x51bf3f[_0x5b24('0x3c')]:_0x3193aa[_0x5b24('0x37')];if(!_0x1069da[_0x5b24('0x38')][_0x5b24('0x3e')](_0x5b24('0x3f'))){_0x51bf3f[_0x5b24('0x24')]=qs[_0x5b24('0x24')](_0x1069da[_0x5b24('0x38')][_0x5b24('0x24')]);_0x51bf3f[_0x5b24('0x21')]=qs[_0x5b24('0x21')](_0x1069da['query']['offset']);}_0x51bf3f['order']=qs[_0x5b24('0x40')](_0x1069da['query']['sort']);_0x51bf3f[_0x5b24('0x41')]=qs[_0x5b24('0x42')](_[_0x5b24('0x43')](_0x1069da['query'],_0x3193aa['filters']),_0x2d0d16);if(_0x1069da[_0x5b24('0x38')][_0x5b24('0x44')]){_0x51bf3f[_0x5b24('0x41')]=_['merge'](_0x51bf3f[_0x5b24('0x41')],{'$or':_[_0x5b24('0x32')](_0x2d0d16,function(_0x2fa99f){if(_0x2fa99f[_0x5b24('0x35')]!==_0x5b24('0x45')){var _0x2be0ec={};_0x2be0ec[_0x2fa99f[_0x5b24('0x2f')]]={'$like':'%'+_0x1069da[_0x5b24('0x38')]['filter']+'%'};return _0x2be0ec;}})});}_0x51bf3f=_[_0x5b24('0x46')]({},_0x51bf3f,_0x1069da[_0x5b24('0x47')]);var _0x51801c={'where':_0x51bf3f[_0x5b24('0x41')]};return db[_0x5b24('0x33')][_0x5b24('0x23')](_0x51801c)[_0x5b24('0x2b')](function(_0x396f6d){_0x51ebc9[_0x5b24('0x23')]=_0x396f6d;if(_0x1069da['query'][_0x5b24('0x48')]){_0x51bf3f[_0x5b24('0x49')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5b24('0x4a')](_0x51bf3f);})['then'](function(_0x3b775e){_0x51ebc9['rows']=_0x3b775e;return _0x51ebc9;})[_0x5b24('0x2b')](respondWithFilteredResult(_0x5a007b,_0x51bf3f))[_0x5b24('0x4b')](handleError(_0x5a007b,null));};exports['show']=function(_0x4a3db3,_0x40cc4f){var _0x283066={'raw':!![],'where':{'id':_0x4a3db3[_0x5b24('0x4c')]['id']}},_0x4bfc04={};_0x4bfc04[_0x5b24('0x37')]=_[_0x5b24('0x39')](db[_0x5b24('0x33')][_0x5b24('0x34')]);_0x4bfc04['query']=_[_0x5b24('0x39')](_0x4a3db3[_0x5b24('0x38')]);_0x4bfc04[_0x5b24('0x42')]=_[_0x5b24('0x3a')](_0x4bfc04[_0x5b24('0x37')],_0x4bfc04[_0x5b24('0x38')]);_0x283066['attributes']=_[_0x5b24('0x3a')](_0x4bfc04[_0x5b24('0x37')],qs[_0x5b24('0x3b')](_0x4a3db3[_0x5b24('0x38')][_0x5b24('0x3b')]));_0x283066[_0x5b24('0x3c')]=_0x283066[_0x5b24('0x3c')]['length']?_0x283066['attributes']:_0x4bfc04[_0x5b24('0x37')];if(_0x4a3db3[_0x5b24('0x38')][_0x5b24('0x48')]){_0x283066[_0x5b24('0x49')]=[{'all':!![]}];}_0x283066=_['merge']({},_0x283066,_0x4a3db3[_0x5b24('0x47')]);return db[_0x5b24('0x33')][_0x5b24('0x4d')](_0x283066)[_0x5b24('0x2b')](handleEntityNotFound(_0x40cc4f,null))[_0x5b24('0x2b')](respondWithResult(_0x40cc4f,null))[_0x5b24('0x4b')](handleError(_0x40cc4f,null));};exports[_0x5b24('0x4e')]=function(_0x31c0a9,_0x4d3736){return db[_0x5b24('0x33')][_0x5b24('0x4e')](_0x31c0a9[_0x5b24('0x4f')],{})[_0x5b24('0x2b')](respondWithResult(_0x4d3736,0xc9))[_0x5b24('0x4b')](handleError(_0x4d3736,null));};exports[_0x5b24('0x2a')]=function(_0x2ad8aa,_0x2baf02){if(_0x2ad8aa[_0x5b24('0x4f')]['id']){delete _0x2ad8aa[_0x5b24('0x4f')]['id'];}return db[_0x5b24('0x33')][_0x5b24('0x4d')]({'where':{'id':_0x2ad8aa[_0x5b24('0x4c')]['id']}})[_0x5b24('0x2b')](handleEntityNotFound(_0x2baf02,null))[_0x5b24('0x2b')](saveUpdates(_0x2ad8aa[_0x5b24('0x4f')],null))[_0x5b24('0x2b')](respondWithResult(_0x2baf02,null))[_0x5b24('0x4b')](handleError(_0x2baf02,null));};exports['destroy']=function(_0x50a86c,_0x1a3a81){return db['ChatInternalMessage']['find']({'where':{'id':_0x50a86c[_0x5b24('0x4c')]['id']}})[_0x5b24('0x2b')](handleEntityNotFound(_0x1a3a81,null))[_0x5b24('0x2b')](removeEntity(_0x1a3a81,null))[_0x5b24('0x4b')](handleError(_0x1a3a81,null));};exports[_0x5b24('0x50')]=function(_0x2e1ca5,_0x1df010){return db[_0x5b24('0x33')][_0x5b24('0x50')]()[_0x5b24('0x2b')](respondWithResult(_0x1df010,null))[_0x5b24('0x4b')](handleError(_0x1df010,null));};function wrapUser(_0x46ceb9){return function(_0x3daae5){var _0x3b9125=_0x46ceb9[_0x5b24('0x51')]({'plain':!![]});_0x3b9125[_0x5b24('0x52')]=[];if(_0x3daae5){_0x3b9125['lastMessageAt']=_0x3daae5['createdAt'];_0x3b9125[_0x5b24('0x53')]=_0x3daae5;}else{_0x3b9125[_0x5b24('0x54')]=moment(0x0)[_0x5b24('0x55')](_0x5b24('0x56'));_0x3b9125[_0x5b24('0x53')]={};}return _0x3b9125;};}exports[_0x5b24('0x57')]=function(_0x5daa66,_0x13bae0,_0x485343){var _0x1f7cea=[];return db[_0x5b24('0x58')][_0x5b24('0x4a')]({'where':{'role':[_0x5b24('0x59'),_0x5b24('0x5a'),'user']},'attributes':['id','fullname',_0x5b24('0x2f'),_0x5b24('0x5b'),_0x5b24('0x5c'),_0x5b24('0x5d'),'online',_0x5b24('0x5e'),_0x5b24('0x5f'),_0x5b24('0x60')],'order':qs[_0x5b24('0x40')](_0x5b24('0x61')),'include':[{'model':db[_0x5b24('0x62')],'as':_0x5b24('0x63'),'attributes':['id',_0x5b24('0x2f'),'type'],'through':{'attributes':[]}}]})[_0x5b24('0x2b')](function(_0x49d9b6){if(_0x49d9b6){var _0x26c60f=_0x5daa66[_0x5b24('0x64')][_0x5b24('0x51')]({'plain':!![]});if(!_0x26c60f)throw new Error(_0x5b24('0x65'));if(_0x26c60f['role']===_0x5b24('0x64')){return db[_0x5b24('0x66')][_0x5b24('0x4d')]({'where':{'name':'Agents','userProfileId':_0x26c60f[_0x5b24('0x67')]},'raw':!![]})[_0x5b24('0x2b')](function(_0x510bef){if(_0x510bef){if(_0x510bef[_0x5b24('0x68')]===0x0){return db[_0x5b24('0x69')]['findAll']({'where':{'sectionId':_0x510bef['id']},'raw':!![]})[_0x5b24('0x2b')](function(_0x3f8eb8){var _0x5bddd8=[];if(_[_0x5b24('0x6a')](_0x3f8eb8)){_0x5bddd8=_['filter'](_0x49d9b6,function(_0x4f8ede){if(_0x4f8ede[_0x5b24('0x5b')]!==_0x5b24('0x59')){return _0x4f8ede;}});return _0x5bddd8;}else{for(var _0xb69848=0x0;_0xb69848<_0x49d9b6['length'];_0xb69848++){var _0x1653fb=_0x49d9b6[_0xb69848];if(_0x1653fb[_0x5b24('0x5b')]==='agent'){var _0x4fa87b=_[_0x5b24('0x4d')](_0x3f8eb8,function(_0x7ceb10){return _0x7ceb10[_0x5b24('0x6b')]===_0x1653fb['id'];});if(_0x4fa87b)_0x5bddd8[_0x5b24('0x6c')](_0x1653fb);}else{_0x5bddd8[_0x5b24('0x6c')](_0x1653fb);}}return _0x5bddd8;}});}else{return _0x49d9b6;}}else{var _0x45dfd7=_['filter'](_0x49d9b6,function(_0x53d971){if(_0x53d971['role']!==_0x5b24('0x59')){return _0x53d971;}});return _0x45dfd7;}});}else{return _0x49d9b6;}}})[_0x5b24('0x2b')](function(_0x3fed09){var _0x1d666f=[];if(_0x3fed09){_0x1f7cea=_0x3fed09;for(var _0x5c56c1=0x0;_0x5c56c1<_0x3fed09[_0x5b24('0x3d')];_0x5c56c1+=0x1){_0x1f7cea[_0x5c56c1][_0x5b24('0x52')]=[];_0x1d666f[_0x5b24('0x6c')](db[_0x5b24('0x33')][_0x5b24('0x4d')]({'where':{'FromId':[_0x5daa66['user']['id'],_0x3fed09[_0x5c56c1]['id']],'ToId':[_0x5daa66[_0x5b24('0x64')]['id'],_0x3fed09[_0x5c56c1]['id']],'ChatGroupId':null},'attributes':['id',_0x5b24('0x6d'),_0x5b24('0x6e'),_0x5b24('0x6f'),_0x5b24('0x70'),_0x5b24('0x4f')],'order':qs[_0x5b24('0x40')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5b24('0x2b')](wrapUser(_0x3fed09[_0x5c56c1])));}return BPromise['all'](_0x1d666f);}return[];})['then'](function(_0x26103c){return{'rows':_0x26103c,'count':_0x26103c['length']};})['then'](respondWithResult(_0x13bae0,null))[_0x5b24('0x4b')](handleError(_0x13bae0,null));};
\ No newline at end of file
+var _0xae5f=['-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','keys','includeAll','options','create','body','find','params','describe','get','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','read'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xae5f,0xdc));var _0xfae5=function(_0x55b6f2,_0x178fbf){_0x55b6f2=_0x55b6f2-0x0;var _0x1fc1ab=_0xae5f[_0x55b6f2];return _0x1fc1ab;};'use strict';var emlformat=require(_0xfae5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfae5('0x1'));var jsonpatch=require(_0xfae5('0x2'));var rp=require(_0xfae5('0x3'));var moment=require(_0xfae5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfae5('0x5'));var util=require(_0xfae5('0x6'));var path=require(_0xfae5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfae5('0x8'));var fs=require('fs');var fs_extra=require(_0xfae5('0x9'));var _=require(_0xfae5('0xa'));var squel=require(_0xfae5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfae5('0xc'));var toCsv=require(_0xfae5('0xd'));var querystring=require(_0xfae5('0xe'));var Papa=require(_0xfae5('0xf'));var Redis=require(_0xfae5('0x10'));var authService=require(_0xfae5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfae5('0x12'));var hardwareService=require(_0xfae5('0x13'));var logger=require('../../config/logger')(_0xfae5('0x14'));var utils=require('../../config/utils');var config=require(_0xfae5('0x15'));var licenseUtil=require(_0xfae5('0x16'));var db=require(_0xfae5('0x17'))['db'];config[_0xfae5('0x18')]=_[_0xfae5('0x19')](config['redis'],{'host':_0xfae5('0x1a'),'port':0x18eb});var socket=require(_0xfae5('0x1b'))(new Redis(config[_0xfae5('0x18')]));require(_0xfae5('0x1c'))[_0xfae5('0x1d')](socket);function respondWithStatusCode(_0x561cfe,_0x8c1f49){_0x8c1f49=_0x8c1f49||0xcc;return function(_0x1d3ba6){if(_0x1d3ba6){return _0x561cfe[_0xfae5('0x1e')](_0x8c1f49);}return _0x561cfe[_0xfae5('0x1f')](_0x8c1f49)[_0xfae5('0x20')]();};}function respondWithResult(_0x4d7573,_0x15565c){_0x15565c=_0x15565c||0xc8;return function(_0x26370b){if(_0x26370b){return _0x4d7573['status'](_0x15565c)[_0xfae5('0x21')](_0x26370b);}};}function respondWithFilteredResult(_0x323378,_0x1dbc2e){return function(_0x281e85){if(_0x281e85){var _0x4acc40=typeof _0x1dbc2e[_0xfae5('0x22')]===_0xfae5('0x23')&&typeof _0x1dbc2e[_0xfae5('0x24')]==='undefined';var _0x3493d9=_0x281e85['count'];var _0x16821a=_0x4acc40?0x0:_0x1dbc2e[_0xfae5('0x22')];var _0x1a1a32=_0x4acc40?_0x281e85[_0xfae5('0x25')]:_0x1dbc2e['offset']+_0x1dbc2e['limit'];var _0x5979b7;if(_0x1a1a32>=_0x3493d9){_0x1a1a32=_0x3493d9;_0x5979b7=0xc8;}else{_0x5979b7=0xce;}_0x323378[_0xfae5('0x1f')](_0x5979b7);return _0x323378[_0xfae5('0x26')](_0xfae5('0x27'),_0x16821a+'-'+_0x1a1a32+'/'+_0x3493d9)[_0xfae5('0x21')](_0x281e85);}return null;};}function patchUpdates(_0x2b3991){return function(_0x3a1933){try{jsonpatch[_0xfae5('0x28')](_0x3a1933,_0x2b3991,!![]);}catch(_0x3be144){return BPromise['reject'](_0x3be144);}return _0x3a1933[_0xfae5('0x29')]();};}function saveUpdates(_0x540eb3,_0x53ce28){return function(_0x2d8db2){if(_0x2d8db2){return _0x2d8db2[_0xfae5('0x2a')](_0x540eb3)[_0xfae5('0x2b')](function(_0x4e8f64){return _0x4e8f64;});}return null;};}function removeEntity(_0x6e2538,_0x4b7cb2){return function(_0x12d739){if(_0x12d739){return _0x12d739[_0xfae5('0x2c')]()['then'](function(){_0x6e2538[_0xfae5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fc92d,_0x14c14d){return function(_0x1e5984){if(!_0x1e5984){_0x8fc92d[_0xfae5('0x1e')](0x194);}return _0x1e5984;};}function handleError(_0x243d00,_0x9da725){_0x9da725=_0x9da725||0x1f4;return function(_0x3ae786){logger[_0xfae5('0x2d')](_0x3ae786[_0xfae5('0x2e')]);if(_0x3ae786[_0xfae5('0x2f')]){delete _0x3ae786[_0xfae5('0x2f')];}_0x243d00[_0xfae5('0x1f')](_0x9da725)['send'](_0x3ae786);};}exports[_0xfae5('0x30')]=function(_0x299133,_0x4d4518){var _0x266a4a={},_0x54c734={},_0x1648ab={'count':0x0,'rows':[]};var _0x3303d9=_[_0xfae5('0x31')](db[_0xfae5('0x32')][_0xfae5('0x33')],function(_0x15c492){return{'name':_0x15c492['fieldName'],'type':_0x15c492[_0xfae5('0x34')]['key']};});_0x54c734['model']=_[_0xfae5('0x31')](_0x3303d9,_0xfae5('0x2f'));_0x54c734[_0xfae5('0x35')]=_['keys'](_0x299133[_0xfae5('0x35')]);_0x54c734[_0xfae5('0x36')]=_[_0xfae5('0x37')](_0x54c734[_0xfae5('0x38')],_0x54c734[_0xfae5('0x35')]);_0x266a4a[_0xfae5('0x39')]=_[_0xfae5('0x37')](_0x54c734[_0xfae5('0x38')],qs['fields'](_0x299133['query'][_0xfae5('0x3a')]));_0x266a4a[_0xfae5('0x39')]=_0x266a4a['attributes'][_0xfae5('0x3b')]?_0x266a4a[_0xfae5('0x39')]:_0x54c734[_0xfae5('0x38')];if(!_0x299133[_0xfae5('0x35')][_0xfae5('0x3c')]('nolimit')){_0x266a4a[_0xfae5('0x24')]=qs[_0xfae5('0x24')](_0x299133['query'][_0xfae5('0x24')]);_0x266a4a[_0xfae5('0x22')]=qs[_0xfae5('0x22')](_0x299133[_0xfae5('0x35')]['offset']);}_0x266a4a[_0xfae5('0x3d')]=qs[_0xfae5('0x3e')](_0x299133[_0xfae5('0x35')][_0xfae5('0x3e')]);_0x266a4a[_0xfae5('0x3f')]=qs[_0xfae5('0x36')](_[_0xfae5('0x40')](_0x299133[_0xfae5('0x35')],_0x54c734[_0xfae5('0x36')]),_0x3303d9);if(_0x299133[_0xfae5('0x35')][_0xfae5('0x41')]){_0x266a4a[_0xfae5('0x3f')]=_[_0xfae5('0x42')](_0x266a4a['where'],{'$or':_[_0xfae5('0x31')](_0x3303d9,function(_0x498f1b){if(_0x498f1b['type']!=='VIRTUAL'){var _0x39c8af={};_0x39c8af[_0x498f1b[_0xfae5('0x2f')]]={'$like':'%'+_0x299133[_0xfae5('0x35')][_0xfae5('0x41')]+'%'};return _0x39c8af;}})});}_0x266a4a=_[_0xfae5('0x42')]({},_0x266a4a,_0x299133['options']);var _0x678fbf={'where':_0x266a4a[_0xfae5('0x3f')]};return db[_0xfae5('0x32')][_0xfae5('0x25')](_0x678fbf)[_0xfae5('0x2b')](function(_0x680ef4){_0x1648ab['count']=_0x680ef4;if(_0x299133[_0xfae5('0x35')]['includeAll']){_0x266a4a[_0xfae5('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xfae5('0x44')](_0x266a4a);})[_0xfae5('0x2b')](function(_0x1406ce){_0x1648ab[_0xfae5('0x45')]=_0x1406ce;return _0x1648ab;})['then'](respondWithFilteredResult(_0x4d4518,_0x266a4a))[_0xfae5('0x46')](handleError(_0x4d4518,null));};exports['show']=function(_0x23ef0d,_0x262b38){var _0x4fd014={'raw':!![],'where':{'id':_0x23ef0d['params']['id']}},_0x5ec947={};_0x5ec947['model']=_[_0xfae5('0x47')](db[_0xfae5('0x32')][_0xfae5('0x33')]);_0x5ec947[_0xfae5('0x35')]=_[_0xfae5('0x47')](_0x23ef0d[_0xfae5('0x35')]);_0x5ec947[_0xfae5('0x36')]=_['intersection'](_0x5ec947[_0xfae5('0x38')],_0x5ec947['query']);_0x4fd014[_0xfae5('0x39')]=_[_0xfae5('0x37')](_0x5ec947[_0xfae5('0x38')],qs['fields'](_0x23ef0d['query'][_0xfae5('0x3a')]));_0x4fd014[_0xfae5('0x39')]=_0x4fd014['attributes'][_0xfae5('0x3b')]?_0x4fd014[_0xfae5('0x39')]:_0x5ec947[_0xfae5('0x38')];if(_0x23ef0d['query'][_0xfae5('0x48')]){_0x4fd014['include']=[{'all':!![]}];}_0x4fd014=_['merge']({},_0x4fd014,_0x23ef0d[_0xfae5('0x49')]);return db['ChatInternalMessage']['find'](_0x4fd014)[_0xfae5('0x2b')](handleEntityNotFound(_0x262b38,null))[_0xfae5('0x2b')](respondWithResult(_0x262b38,null))[_0xfae5('0x46')](handleError(_0x262b38,null));};exports['create']=function(_0x1b6e83,_0xa6a595){return db[_0xfae5('0x32')][_0xfae5('0x4a')](_0x1b6e83['body'],{})[_0xfae5('0x2b')](respondWithResult(_0xa6a595,0xc9))['catch'](handleError(_0xa6a595,null));};exports[_0xfae5('0x2a')]=function(_0x36cbf3,_0x442f02){if(_0x36cbf3[_0xfae5('0x4b')]['id']){delete _0x36cbf3[_0xfae5('0x4b')]['id'];}return db[_0xfae5('0x32')][_0xfae5('0x4c')]({'where':{'id':_0x36cbf3[_0xfae5('0x4d')]['id']}})[_0xfae5('0x2b')](handleEntityNotFound(_0x442f02,null))[_0xfae5('0x2b')](saveUpdates(_0x36cbf3[_0xfae5('0x4b')],null))[_0xfae5('0x2b')](respondWithResult(_0x442f02,null))['catch'](handleError(_0x442f02,null));};exports[_0xfae5('0x2c')]=function(_0x12a5a3,_0x463143){return db[_0xfae5('0x32')][_0xfae5('0x4c')]({'where':{'id':_0x12a5a3[_0xfae5('0x4d')]['id']}})[_0xfae5('0x2b')](handleEntityNotFound(_0x463143,null))[_0xfae5('0x2b')](removeEntity(_0x463143,null))['catch'](handleError(_0x463143,null));};exports['describe']=function(_0x512369,_0x5d52f8){return db[_0xfae5('0x32')][_0xfae5('0x4e')]()[_0xfae5('0x2b')](respondWithResult(_0x5d52f8,null))[_0xfae5('0x46')](handleError(_0x5d52f8,null));};function wrapUser(_0xfd144a){return function(_0x1ad3be){var _0x3cbf52=_0xfd144a[_0xfae5('0x4f')]({'plain':!![]});_0x3cbf52[_0xfae5('0x50')]=[];if(_0x1ad3be){_0x3cbf52['lastMessageAt']=_0x1ad3be[_0xfae5('0x51')];_0x3cbf52[_0xfae5('0x52')]=_0x1ad3be;}else{_0x3cbf52[_0xfae5('0x53')]=moment(0x0)['format'](_0xfae5('0x54'));_0x3cbf52[_0xfae5('0x52')]={};}return _0x3cbf52;};}exports[_0xfae5('0x55')]=function(_0x7714bc,_0x31bdcf,_0x144c42){var _0x306a70=[];return db['User'][_0xfae5('0x44')]({'where':{'role':[_0xfae5('0x56'),_0xfae5('0x57'),_0xfae5('0x58')]},'attributes':['id',_0xfae5('0x59'),_0xfae5('0x2f'),_0xfae5('0x5a'),_0xfae5('0x5b'),_0xfae5('0x5c'),_0xfae5('0x5d'),_0xfae5('0x5e'),_0xfae5('0x5f'),'showWebBar'],'order':qs[_0xfae5('0x3e')]('-online'),'include':[{'model':db[_0xfae5('0x60')],'as':_0xfae5('0x61'),'attributes':['id',_0xfae5('0x2f'),_0xfae5('0x34')],'through':{'attributes':[]}}]})[_0xfae5('0x2b')](function(_0x413dce){if(_0x413dce){var _0x12a642=_0x7714bc[_0xfae5('0x58')]['get']({'plain':!![]});if(!_0x12a642)throw new Error(_0xfae5('0x62'));if(_0x12a642[_0xfae5('0x5a')]===_0xfae5('0x58')){return db[_0xfae5('0x63')]['find']({'where':{'name':_0xfae5('0x64'),'userProfileId':_0x12a642['userProfileId']},'raw':!![]})[_0xfae5('0x2b')](function(_0x1be189){if(_0x1be189){if(_0x1be189[_0xfae5('0x65')]===0x0){return db[_0xfae5('0x66')][_0xfae5('0x44')]({'where':{'sectionId':_0x1be189['id']},'raw':!![]})[_0xfae5('0x2b')](function(_0x1faf0b){var _0x52e39a=[];if(_[_0xfae5('0x67')](_0x1faf0b)){_0x52e39a=_[_0xfae5('0x41')](_0x413dce,function(_0x351132){if(_0x351132['role']!==_0xfae5('0x56')){return _0x351132;}});return _0x52e39a;}else{for(var _0x132ac2=0x0;_0x132ac2<_0x413dce[_0xfae5('0x3b')];_0x132ac2++){var _0x4556b9=_0x413dce[_0x132ac2];if(_0x4556b9['role']===_0xfae5('0x56')){var _0xd16d53=_['find'](_0x1faf0b,function(_0x4488a0){return _0x4488a0['resourceId']===_0x4556b9['id'];});if(_0xd16d53)_0x52e39a[_0xfae5('0x68')](_0x4556b9);}else{_0x52e39a['push'](_0x4556b9);}}return _0x52e39a;}});}else{return _0x413dce;}}else{var _0x5780b9=_['filter'](_0x413dce,function(_0x4a11fc){if(_0x4a11fc[_0xfae5('0x5a')]!=='agent'){return _0x4a11fc;}});return _0x5780b9;}});}else{return _0x413dce;}}})[_0xfae5('0x2b')](function(_0x40e063){var _0xebcdea=[];if(_0x40e063){_0x306a70=_0x40e063;for(var _0x3d2430=0x0;_0x3d2430<_0x40e063[_0xfae5('0x3b')];_0x3d2430+=0x1){_0x306a70[_0x3d2430]['messages']=[];_0xebcdea[_0xfae5('0x68')](db[_0xfae5('0x32')][_0xfae5('0x4c')]({'where':{'FromId':[_0x7714bc[_0xfae5('0x58')]['id'],_0x40e063[_0x3d2430]['id']],'ToId':[_0x7714bc[_0xfae5('0x58')]['id'],_0x40e063[_0x3d2430]['id']],'ChatGroupId':null},'attributes':['id',_0xfae5('0x51'),_0xfae5('0x69'),'ToId',_0xfae5('0x6a'),_0xfae5('0x4b')],'order':qs[_0xfae5('0x3e')](_0xfae5('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfae5('0x2b')](wrapUser(_0x40e063[_0x3d2430])));}return BPromise[_0xfae5('0x6c')](_0xebcdea);}return[];})[_0xfae5('0x2b')](function(_0x15afd3){return{'rows':_0x15afd3,'count':_0x15afd3[_0xfae5('0x3b')]};})[_0xfae5('0x2b')](respondWithResult(_0x31bdcf,null))[_0xfae5('0x46')](handleError(_0x31bdcf,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 280c4ed..424363a 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 _0x5d4e=['update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x5d4e,0x112));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe5d4('0x0'));var ChatInternalMessage=require(_0xe5d4('0x1'))['db'][_0xe5d4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe5d4('0x3')](0x0);var events={'afterCreate':_0xe5d4('0x4'),'afterUpdate':_0xe5d4('0x5'),'afterDestroy':_0xe5d4('0x6')};function emitEvent(_0x59e9c3){return function(_0x346274,_0x5eb8fd,_0x566066){ChatInternalMessageEvents[_0xe5d4('0x7')](_0x59e9c3+':'+_0x346274['id'],_0x346274);ChatInternalMessageEvents[_0xe5d4('0x7')](_0x59e9c3,_0x346274);_0x566066(null);};}for(var e in events){if(events[_0xe5d4('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x943d=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x4a464e,_0x250abf){var _0x54d070=function(_0xf56d7){while(--_0xf56d7){_0x4a464e['push'](_0x4a464e['shift']());}};_0x54d070(++_0x250abf);}(_0x943d,0x155));var _0xd943=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0x943d[_0x305486];return _0xa04940;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd943('0x0'))['db'][_0xd943('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd943('0x2')](0x0);var events={'afterCreate':_0xd943('0x3'),'afterUpdate':_0xd943('0x4'),'afterDestroy':_0xd943('0x5')};function emitEvent(_0x21052e){return function(_0x3cbb0d,_0xf6c0e3,_0xd005c7){ChatInternalMessageEvents[_0xd943('0x6')](_0x21052e+':'+_0x3cbb0d['id'],_0x3cbb0d);ChatInternalMessageEvents[_0xd943('0x6')](_0x21052e,_0x3cbb0d);_0xd005c7(null);};}for(var e in events){if(events[_0xd943('0x7')](e)){var event=events[e];ChatInternalMessage[_0xd943('0x8')](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 716a348..d1d928b 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 _0x4945=['api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x4945,0x15e));var _0x5494=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x4945[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require(_0x5494('0x0'));var logger=require('../../config/logger')(_0x5494('0x1'));var moment=require(_0x5494('0x2'));var BPromise=require(_0x5494('0x3'));var rp=require(_0x5494('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5494('0x5'));var config=require('../../config/environment');var attributes=require(_0x5494('0x6'));module[_0x5494('0x7')]=function(_0x5a141f,_0x40b495){return _0x5a141f[_0x5494('0x8')](_0x5494('0x9'),attributes,{'tableName':_0x5494('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5494('0xb'),'collate':_0x5494('0xc')});};
\ No newline at end of file
+var _0x4d68=['api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util'];(function(_0x93b6aa,_0x19ca6e){var _0x580214=function(_0x55888b){while(--_0x55888b){_0x93b6aa['push'](_0x93b6aa['shift']());}};_0x580214(++_0x19ca6e);}(_0x4d68,0x19e));var _0x84d6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x4d68[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x84d6('0x0'));var util=require(_0x84d6('0x1'));var logger=require('../../config/logger')(_0x84d6('0x2'));var moment=require(_0x84d6('0x3'));var BPromise=require(_0x84d6('0x4'));var rp=require(_0x84d6('0x5'));var fs=require('fs');var path=require(_0x84d6('0x6'));var rimraf=require(_0x84d6('0x7'));var config=require('../../config/environment');var attributes=require(_0x84d6('0x8'));module['exports']=function(_0x49e5c6,_0x57be95){return _0x49e5c6[_0x84d6('0x9')](_0x84d6('0xa'),attributes,{'tableName':_0x84d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x84d6('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index f6a28be..466c071 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 _0xeb0d=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInternalMessage.socket','register'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x5a4860,_0x22dc1d){_0x5a4860=_0x5a4860-0x0;var _0x6a4bf8=_0xeb0d[_0x5a4860];return _0x6a4bf8;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdeb0('0x1'));var fs=require('fs');var Redis=require(_0xdeb0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeb0('0x3'));var logger=require(_0xdeb0('0x4'))(_0xdeb0('0x5'));var config=require(_0xdeb0('0x6'));var jayson=require(_0xdeb0('0x7'));var client=jayson[_0xdeb0('0x8')][_0xdeb0('0x9')]({'port':0x232a});config[_0xdeb0('0xa')]=_['defaults'](config[_0xdeb0('0xa')],{'host':_0xdeb0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdeb0('0xa')]));require(_0xdeb0('0xc'))[_0xdeb0('0xd')](socket);function respondWithRpcPromise(_0x307271,_0x13e2c4,_0x43c43e){return new BPromise(function(_0x2eac19,_0x1ac0cf){return client['request'](_0x307271,_0x43c43e)['then'](function(_0x4169b0){logger['info'](_0xdeb0('0xe'),_0x13e2c4,_0xdeb0('0xf'));logger[_0xdeb0('0x10')](_0xdeb0('0x11'),_0x13e2c4,_0xdeb0('0xf'),JSON[_0xdeb0('0x12')](_0x4169b0));if(_0x4169b0[_0xdeb0('0x13')]){if(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x14')]===0x1f4){logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);return _0x1ac0cf(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}logger['error'](_0xdeb0('0xe'),_0x13e2c4,_0x4169b0['error'][_0xdeb0('0x15')]);return _0x2eac19(_0x4169b0[_0xdeb0('0x13')][_0xdeb0('0x15')]);}else{logger['info'](_0xdeb0('0xe'),_0x13e2c4,'request\x20sent');_0x2eac19(_0x4169b0[_0xdeb0('0x16')][_0xdeb0('0x15')]);}})[_0xdeb0('0x17')](function(_0x52b34d){logger[_0xdeb0('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e2c4,_0x52b34d);_0x1ac0cf(_0x52b34d);});});}
\ No newline at end of file
+var _0xe1ce=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x46f736,_0x39930d){var _0x480865=function(_0x531f1e){while(--_0x531f1e){_0x46f736['push'](_0x46f736['shift']());}};_0x480865(++_0x39930d);}(_0xe1ce,0x15e));var _0xee1c=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xe1ce[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xee1c('0x0'));var util=require(_0xee1c('0x1'));var moment=require(_0xee1c('0x2'));var BPromise=require(_0xee1c('0x3'));var rs=require(_0xee1c('0x4'));var fs=require('fs');var Redis=require(_0xee1c('0x5'));var db=require(_0xee1c('0x6'))['db'];var utils=require(_0xee1c('0x7'));var logger=require(_0xee1c('0x8'))(_0xee1c('0x9'));var config=require('../../config/environment');var jayson=require(_0xee1c('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xee1c('0xb')]=_[_0xee1c('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee1c('0xb')]));require(_0xee1c('0xd'))[_0xee1c('0xe')](socket);function respondWithRpcPromise(_0x1b1cca,_0x4e5fcd,_0x458b53){return new BPromise(function(_0x451be7,_0x56fe63){return client[_0xee1c('0xf')](_0x1b1cca,_0x458b53)[_0xee1c('0x10')](function(_0x562266){logger['info'](_0xee1c('0x11'),_0x4e5fcd,_0xee1c('0x12'));logger[_0xee1c('0x13')](_0xee1c('0x14'),_0x4e5fcd,_0xee1c('0x12'),JSON[_0xee1c('0x15')](_0x562266));if(_0x562266['error']){if(_0x562266[_0xee1c('0x16')][_0xee1c('0x17')]===0x1f4){logger['error'](_0xee1c('0x11'),_0x4e5fcd,_0x562266['error']['message']);return _0x56fe63(_0x562266[_0xee1c('0x16')]['message']);}logger[_0xee1c('0x16')](_0xee1c('0x11'),_0x4e5fcd,_0x562266['error'][_0xee1c('0x18')]);return _0x451be7(_0x562266[_0xee1c('0x16')][_0xee1c('0x18')]);}else{logger['info'](_0xee1c('0x11'),_0x4e5fcd,_0xee1c('0x12'));_0x451be7(_0x562266[_0xee1c('0x19')][_0xee1c('0x18')]);}})[_0xee1c('0x1a')](function(_0x3994b4){logger[_0xee1c('0x16')](_0xee1c('0x11'),_0x4e5fcd,_0x3994b4);_0x56fe63(_0x3994b4);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 481f605..57e1e7e 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 _0xad75=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x58fac9,_0x290a65){var _0x35da60=function(_0xff9be0){while(--_0xff9be0){_0x58fac9['push'](_0x58fac9['shift']());}};_0x35da60(++_0x290a65);}(_0xad75,0xca));var _0x5ad7=function(_0x13f411,_0x1402ee){_0x13f411=_0x13f411-0x0;var _0x523d52=_0xad75[_0x13f411];return _0x523d52;};'use strict';var ChatInternalMessageEvents=require(_0x5ad7('0x0'));var events=[_0x5ad7('0x1'),_0x5ad7('0x2'),_0x5ad7('0x3')];function createListener(_0x109af9,_0x316eee){return function(_0x3867fb){_0x316eee[_0x5ad7('0x4')](_0x109af9,_0x3867fb);};}function removeListener(_0x2331e0,_0x54bcc0){return function(){ChatInternalMessageEvents[_0x5ad7('0x5')](_0x2331e0,_0x54bcc0);};}exports[_0x5ad7('0x6')]=function(_0x480d79){for(var _0x17273b=0x0,_0x4694dd=events[_0x5ad7('0x7')];_0x17273b<_0x4694dd;_0x17273b++){var _0x25ec21=events[_0x17273b];var _0x29f7e2=createListener(_0x5ad7('0x8')+_0x25ec21,_0x480d79);ChatInternalMessageEvents['on'](_0x25ec21,_0x29f7e2);}};
\ No newline at end of file
+var _0x3f67=['chatInternalMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x52015b,_0x14e87b){var _0x5f01be=function(_0x513d45){while(--_0x513d45){_0x52015b['push'](_0x52015b['shift']());}};_0x5f01be(++_0x14e87b);}(_0x3f67,0x89));var _0x73f6=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0x3f67[_0x5c6ceb];return _0x28821b;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x73f6('0x0'),_0x73f6('0x1'),_0x73f6('0x2')];function createListener(_0x35be9f,_0x3e4dec){return function(_0x14c773){_0x3e4dec[_0x73f6('0x3')](_0x35be9f,_0x14c773);};}function removeListener(_0x2e0ad5,_0x3cd3c4){return function(){ChatInternalMessageEvents[_0x73f6('0x4')](_0x2e0ad5,_0x3cd3c4);};}exports[_0x73f6('0x5')]=function(_0x37679f){for(var _0x4b2323=0x0,_0x1a7d71=events[_0x73f6('0x6')];_0x4b2323<_0x1a7d71;_0x4b2323++){var _0x3fcce5=events[_0x4b2323];var _0x30b6f2=createListener(_0x73f6('0x7')+_0x3fcce5,_0x37679f);ChatInternalMessageEvents['on'](_0x3fcce5,_0x30b6f2);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f0cb642..37c0d4a 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 _0x461a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','create','put','delete','/:id','exports','util'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x461a,0x125));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa461('0x0'));var path=require(_0xa461('0x1'));var timeout=require(_0xa461('0x2'));var express=require(_0xa461('0x3'));var router=express[_0xa461('0x4')]();var fs_extra=require(_0xa461('0x5'));var auth=require(_0xa461('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa461('0x7'));router[_0xa461('0x8')]('/',auth[_0xa461('0x9')](),controller[_0xa461('0xa')]);router['get'](_0xa461('0xb'),auth['isAuthenticated'](),controller[_0xa461('0xc')]);router['get'](_0xa461('0xd'),auth[_0xa461('0x9')](),controller[_0xa461('0xe')]);router[_0xa461('0x8')]('/:id',auth[_0xa461('0x9')](),controller[_0xa461('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa461('0x10')]);router[_0xa461('0x11')]('/:id',controller['update']);router[_0xa461('0x12')](_0xa461('0x13'),auth[_0xa461('0x9')](),controller['destroy']);module[_0xa461('0x14')]=router;
\ No newline at end of file
+var _0x7eec=['get','isAuthenticated','index','/describe','describe','/users','getUsers','post','create','put','/:id','update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x202d12,_0x232a5e){var _0x100006=function(_0x43778f){while(--_0x43778f){_0x202d12['push'](_0x202d12['shift']());}};_0x100006(++_0x232a5e);}(_0x7eec,0x149));var _0xc7ee=function(_0x2ef2ae,_0x4a740a){_0x2ef2ae=_0x2ef2ae-0x0;var _0x276928=_0x7eec[_0x2ef2ae];return _0x276928;};'use strict';var multer=require(_0xc7ee('0x0'));var util=require(_0xc7ee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc7ee('0x2')]();var fs_extra=require(_0xc7ee('0x3'));var auth=require(_0xc7ee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc7ee('0x5'));var controller=require(_0xc7ee('0x6'));router[_0xc7ee('0x7')]('/',auth[_0xc7ee('0x8')](),controller[_0xc7ee('0x9')]);router[_0xc7ee('0x7')](_0xc7ee('0xa'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xb')]);router[_0xc7ee('0x7')](_0xc7ee('0xc'),auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xd')]);router[_0xc7ee('0x7')]('/:id',auth[_0xc7ee('0x8')](),controller['show']);router[_0xc7ee('0xe')]('/',auth[_0xc7ee('0x8')](),controller[_0xc7ee('0xf')]);router[_0xc7ee('0x10')](_0xc7ee('0x11'),controller[_0xc7ee('0x12')]);router[_0xc7ee('0x13')](_0xc7ee('0x11'),auth['isAuthenticated'](),controller[_0xc7ee('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index eba4ac1..1ca478c 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 _0x7275=['out','DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0xf0928a,_0x30a122){var _0x1b49fc=function(_0x1686ce){while(--_0x1686ce){_0xf0928a['push'](_0xf0928a['shift']());}};_0x1b49fc(++_0x30a122);}(_0x7275,0x143));var _0x5727=function(_0x4ba9d7,_0x2ec6cc){_0x4ba9d7=_0x4ba9d7-0x0;var _0x45866e=_0x7275[_0x4ba9d7];return _0x45866e;};'use strict';var Sequelize=require(_0x5727('0x0'));module[_0x5727('0x1')]={'body':{'type':Sequelize[_0x5727('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5727('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5727('0x4')]('in',_0x5727('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x5727('0x6')]},'providerName':{'type':Sequelize[_0x5727('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4c71=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x51448c,_0x17e9dc){var _0x47e735=function(_0x187ff6){while(--_0x187ff6){_0x51448c['push'](_0x51448c['shift']());}};_0x47e735(++_0x17e9dc);}(_0x4c71,0x12b));var _0x14c7=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x4c71[_0x4f9b18];return _0x29f20c;};'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 7f97b12..8c6d47d 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 _0xd6d0=['create','body','find','describe','../../config/logger','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','parse','chat','ChatInteraction','RejectMessage','rejectMessage','sequelize','fullname','rejectmessage','formData','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','status','undefined','limit','count','offset','json','reject','save','update','destroy','end','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','show','params'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0xd6d0,0xaf));var _0x0d6d=function(_0x2bd0ba,_0x2ca03b){_0x2bd0ba=_0x2bd0ba-0x0;var _0x10426b=_0xd6d0[_0x2bd0ba];return _0x10426b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0d6d('0x0'));var jsonpatch=require(_0x0d6d('0x1'));var rp=require(_0x0d6d('0x2'));var moment=require(_0x0d6d('0x3'));var BPromise=require(_0x0d6d('0x4'));var Mustache=require('mustache');var util=require(_0x0d6d('0x5'));var path=require(_0x0d6d('0x6'));var sox=require(_0x0d6d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d6d('0x8'));var squel=require(_0x0d6d('0x9'));var crypto=require('crypto');var jsforce=require(_0x0d6d('0xa'));var deskjs=require(_0x0d6d('0xb'));var toCsv=require(_0x0d6d('0xc'));var querystring=require('querystring');var Papa=require(_0x0d6d('0xd'));var Redis=require('ioredis');var authService=require(_0x0d6d('0xe'));var qs=require(_0x0d6d('0xf'));var as=require(_0x0d6d('0x10'));var hardwareService=require(_0x0d6d('0x11'));var logger=require('../../config/logger')(_0x0d6d('0x12'));var utils=require('../../config/utils');var config=require(_0x0d6d('0x13'));var licenseUtil=require(_0x0d6d('0x14'));var db=require(_0x0d6d('0x15'))['db'];config[_0x0d6d('0x16')]=_[_0x0d6d('0x17')](config['redis'],{'host':_0x0d6d('0x18'),'port':0x18eb});var socket=require(_0x0d6d('0x19'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x0d6d('0x1a')](socket);var jayson=require(_0x0d6d('0x1b'));var client=jayson[_0x0d6d('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x0d6d('0x1c')][_0x0d6d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x111d3b,_0x1141e8,_0x198ec6,_0x3a67b2){return new BPromise(function(_0x19ee0b,_0x4afb4d){var _0xe49f56=_0x3a67b2||client;return _0xe49f56[_0x0d6d('0x1e')](_0x111d3b,_0x198ec6)[_0x0d6d('0x1f')](function(_0x26c558){logger[_0x0d6d('0x20')](_0x0d6d('0x21'),_0x1141e8,_0x0d6d('0x22'));logger[_0x0d6d('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1141e8,_0x0d6d('0x22'),JSON[_0x0d6d('0x24')](_0x26c558));if(_0x26c558['error']){if(_0x26c558['error'][_0x0d6d('0x25')]===0x1f4){logger[_0x0d6d('0x26')](_0x0d6d('0x21'),_0x1141e8,_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);return _0x4afb4d(_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);}logger[_0x0d6d('0x26')](_0x0d6d('0x21'),_0x1141e8,_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);return _0x19ee0b(_0x26c558[_0x0d6d('0x26')][_0x0d6d('0x27')]);}else{logger[_0x0d6d('0x20')](_0x0d6d('0x21'),_0x1141e8,'request\x20sent');_0x19ee0b(_0x26c558['result'][_0x0d6d('0x27')]);}})[_0x0d6d('0x28')](function(_0xe75004){logger[_0x0d6d('0x26')](_0x0d6d('0x21'),_0x1141e8,_0xe75004);_0x4afb4d(_0xe75004);});});}function respondWithStatusCode(_0x4c44f2,_0x59be3f){_0x59be3f=_0x59be3f||0xcc;return function(_0x38a5f8){if(_0x38a5f8){return _0x4c44f2['sendStatus'](_0x59be3f);}return _0x4c44f2['status'](_0x59be3f)['end']();};}function respondWithResult(_0x5be14e,_0x138625){_0x138625=_0x138625||0xc8;return function(_0x445a90){if(_0x445a90){return _0x5be14e[_0x0d6d('0x29')](_0x138625)['json'](_0x445a90);}};}function respondWithFilteredResult(_0x3ea76f,_0x5ac06e){return function(_0x43b399){if(_0x43b399){var _0x31dd85=typeof _0x5ac06e['offset']===_0x0d6d('0x2a')&&typeof _0x5ac06e[_0x0d6d('0x2b')]===_0x0d6d('0x2a');var _0x4eb094=_0x43b399[_0x0d6d('0x2c')];var _0x589cee=_0x31dd85?0x0:_0x5ac06e[_0x0d6d('0x2d')];var _0x59340f=_0x31dd85?_0x43b399[_0x0d6d('0x2c')]:_0x5ac06e[_0x0d6d('0x2d')]+_0x5ac06e[_0x0d6d('0x2b')];var _0x52539d;if(_0x59340f>=_0x4eb094){_0x59340f=_0x4eb094;_0x52539d=0xc8;}else{_0x52539d=0xce;}_0x3ea76f['status'](_0x52539d);return _0x3ea76f['set']('Content-Range',_0x589cee+'-'+_0x59340f+'/'+_0x4eb094)[_0x0d6d('0x2e')](_0x43b399);}return null;};}function patchUpdates(_0x3fd64b){return function(_0x13d631){try{jsonpatch['apply'](_0x13d631,_0x3fd64b,!![]);}catch(_0x265daa){return BPromise[_0x0d6d('0x2f')](_0x265daa);}return _0x13d631[_0x0d6d('0x30')]();};}function saveUpdates(_0x2fab4f,_0x21b254){return function(_0x48a932){if(_0x48a932){return _0x48a932[_0x0d6d('0x31')](_0x2fab4f)['then'](function(_0x4cf41f){return _0x4cf41f;});}return null;};}function removeEntity(_0x54dd4f,_0x5125d4){return function(_0xbdd569){if(_0xbdd569){return _0xbdd569[_0x0d6d('0x32')]()[_0x0d6d('0x1f')](function(){_0x54dd4f[_0x0d6d('0x29')](0xcc)[_0x0d6d('0x33')]();});}};}function handleEntityNotFound(_0x537751,_0x4c7192){return function(_0x315de1){if(!_0x315de1){_0x537751[_0x0d6d('0x34')](0x194);}return _0x315de1;};}function handleError(_0xd039ee,_0x5bb9ac){_0x5bb9ac=_0x5bb9ac||0x1f4;return function(_0x1a9b01){logger[_0x0d6d('0x26')](_0x1a9b01[_0x0d6d('0x35')]);if(_0x1a9b01[_0x0d6d('0x36')]){delete _0x1a9b01[_0x0d6d('0x36')];}_0xd039ee[_0x0d6d('0x29')](_0x5bb9ac)[_0x0d6d('0x37')](_0x1a9b01);};}exports['index']=function(_0x39ffae,_0x49d9b9){var _0x50e84a={},_0x41bc61={},_0x1dbea7={'count':0x0,'rows':[]};var _0x27b398=_[_0x0d6d('0x38')](db[_0x0d6d('0x39')][_0x0d6d('0x3a')],function(_0x12d289){return{'name':_0x12d289[_0x0d6d('0x3b')],'type':_0x12d289['type']['key']};});_0x41bc61[_0x0d6d('0x3c')]=_[_0x0d6d('0x38')](_0x27b398,_0x0d6d('0x36'));_0x41bc61['query']=_[_0x0d6d('0x3d')](_0x39ffae[_0x0d6d('0x3e')]);_0x41bc61[_0x0d6d('0x3f')]=_[_0x0d6d('0x40')](_0x41bc61[_0x0d6d('0x3c')],_0x41bc61[_0x0d6d('0x3e')]);_0x50e84a[_0x0d6d('0x41')]=_['intersection'](_0x41bc61[_0x0d6d('0x3c')],qs['fields'](_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x42')]));_0x50e84a[_0x0d6d('0x41')]=_0x50e84a[_0x0d6d('0x41')][_0x0d6d('0x43')]?_0x50e84a[_0x0d6d('0x41')]:_0x41bc61[_0x0d6d('0x3c')];if(!_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x44')](_0x0d6d('0x45'))){_0x50e84a[_0x0d6d('0x2b')]=qs[_0x0d6d('0x2b')](_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x2b')]);_0x50e84a[_0x0d6d('0x2d')]=qs[_0x0d6d('0x2d')](_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x2d')]);}_0x50e84a['order']=qs[_0x0d6d('0x46')](_0x39ffae[_0x0d6d('0x3e')]['sort']);_0x50e84a[_0x0d6d('0x47')]=qs[_0x0d6d('0x3f')](_[_0x0d6d('0x48')](_0x39ffae[_0x0d6d('0x3e')],_0x41bc61[_0x0d6d('0x3f')]),_0x27b398);if(_0x39ffae[_0x0d6d('0x3e')]['filter']){_0x50e84a['where']=_[_0x0d6d('0x49')](_0x50e84a[_0x0d6d('0x47')],{'$or':_[_0x0d6d('0x38')](_0x27b398,function(_0x5a028a){if(_0x5a028a['type']!==_0x0d6d('0x4a')){var _0x271cf0={};_0x271cf0[_0x5a028a[_0x0d6d('0x36')]]={'$like':'%'+_0x39ffae[_0x0d6d('0x3e')]['filter']+'%'};return _0x271cf0;}})});}_0x50e84a=_[_0x0d6d('0x49')]({},_0x50e84a,_0x39ffae[_0x0d6d('0x4b')]);var _0x921e82={'where':_0x50e84a[_0x0d6d('0x47')]};return db['ChatMessage'][_0x0d6d('0x2c')](_0x921e82)[_0x0d6d('0x1f')](function(_0x350a93){_0x1dbea7[_0x0d6d('0x2c')]=_0x350a93;if(_0x39ffae[_0x0d6d('0x3e')][_0x0d6d('0x4c')]){_0x50e84a[_0x0d6d('0x4d')]=[{'all':!![]}];}return db[_0x0d6d('0x39')][_0x0d6d('0x4e')](_0x50e84a);})[_0x0d6d('0x1f')](function(_0x5dd50e){_0x1dbea7['rows']=_0x5dd50e;return _0x1dbea7;})['then'](respondWithFilteredResult(_0x49d9b9,_0x50e84a))['catch'](handleError(_0x49d9b9,null));};exports[_0x0d6d('0x4f')]=function(_0x1f996e,_0x11bb56){var _0x556f9b={'raw':!![],'where':{'id':_0x1f996e[_0x0d6d('0x50')]['id']}},_0x3f43a6={};_0x3f43a6[_0x0d6d('0x3c')]=_['keys'](db['ChatMessage'][_0x0d6d('0x3a')]);_0x3f43a6[_0x0d6d('0x3e')]=_['keys'](_0x1f996e[_0x0d6d('0x3e')]);_0x3f43a6[_0x0d6d('0x3f')]=_[_0x0d6d('0x40')](_0x3f43a6[_0x0d6d('0x3c')],_0x3f43a6[_0x0d6d('0x3e')]);_0x556f9b[_0x0d6d('0x41')]=_[_0x0d6d('0x40')](_0x3f43a6[_0x0d6d('0x3c')],qs[_0x0d6d('0x42')](_0x1f996e[_0x0d6d('0x3e')][_0x0d6d('0x42')]));_0x556f9b['attributes']=_0x556f9b[_0x0d6d('0x41')][_0x0d6d('0x43')]?_0x556f9b[_0x0d6d('0x41')]:_0x3f43a6[_0x0d6d('0x3c')];if(_0x1f996e['query'][_0x0d6d('0x4c')]){_0x556f9b[_0x0d6d('0x4d')]=[{'all':!![]}];}_0x556f9b=_[_0x0d6d('0x49')]({},_0x556f9b,_0x1f996e[_0x0d6d('0x4b')]);return db[_0x0d6d('0x39')]['find'](_0x556f9b)[_0x0d6d('0x1f')](handleEntityNotFound(_0x11bb56,null))['then'](respondWithResult(_0x11bb56,null))[_0x0d6d('0x28')](handleError(_0x11bb56,null));};exports['create']=function(_0xece2e0,_0x1b12a3){return db[_0x0d6d('0x39')][_0x0d6d('0x51')](_0xece2e0[_0x0d6d('0x52')],{})[_0x0d6d('0x1f')](respondWithResult(_0x1b12a3,0xc9))['catch'](handleError(_0x1b12a3,null));};exports['update']=function(_0x16eff5,_0x1233c0){if(_0x16eff5['body']['id']){delete _0x16eff5[_0x0d6d('0x52')]['id'];}return db[_0x0d6d('0x39')][_0x0d6d('0x53')]({'where':{'id':_0x16eff5[_0x0d6d('0x50')]['id']}})[_0x0d6d('0x1f')](handleEntityNotFound(_0x1233c0,null))[_0x0d6d('0x1f')](saveUpdates(_0x16eff5[_0x0d6d('0x52')],null))[_0x0d6d('0x1f')](respondWithResult(_0x1233c0,null))[_0x0d6d('0x28')](handleError(_0x1233c0,null));};exports[_0x0d6d('0x32')]=function(_0x4c3056,_0x1ffa29){return db['ChatMessage']['find']({'where':{'id':_0x4c3056[_0x0d6d('0x50')]['id']}})[_0x0d6d('0x1f')](handleEntityNotFound(_0x1ffa29,null))[_0x0d6d('0x1f')](removeEntity(_0x1ffa29,null))[_0x0d6d('0x28')](handleError(_0x1ffa29,null));};exports[_0x0d6d('0x54')]=function(_0x3232ba,_0xe4f49e){return db[_0x0d6d('0x39')]['describe']()[_0x0d6d('0x1f')](respondWithResult(_0xe4f49e,null))['catch'](handleError(_0xe4f49e,null));};var interaction_log=require(_0x0d6d('0x55'))(_0x0d6d('0x56'));exports[_0x0d6d('0x57')]=function(_0x2ef38e,_0x24f74f,_0x487dcc){var _0x66388b={'agent':{},'channel':'chat'};if(_0x2ef38e['body']['id']){delete _0x2ef38e[_0x0d6d('0x52')]['id'];}_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x58')]=!![];_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x59')]=moment()[_0x0d6d('0x5a')](_0x0d6d('0x5b'));_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')]=_0x2ef38e['body'][_0x0d6d('0x5c')]||_0x2ef38e[_0x0d6d('0x5d')]['id'];_0x66388b[_0x0d6d('0x5e')]['id']=_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')];return db[_0x0d6d('0x39')][_0x0d6d('0x53')]({'where':{'id':_0x2ef38e[_0x0d6d('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24f74f,null))[_0x0d6d('0x1f')](saveUpdates(_0x2ef38e[_0x0d6d('0x52')],null))[_0x0d6d('0x1f')](function(_0x1da300){if(_0x1da300){_0x66388b['message']=_0x1da300[_0x0d6d('0x5f')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x1da300[_0x0d6d('0x60')]}});}return null;})[_0x0d6d('0x1f')](handleEntityNotFound(_0x24f74f,null))[_0x0d6d('0x1f')](function(_0x3a2e22){if(_0x3a2e22){return _0x3a2e22[_0x0d6d('0x31')]({'UserId':_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')],'read1stAt':_[_0x0d6d('0x61')](_0x3a2e22['read1stAt'])?moment()['format'](_0x0d6d('0x5b')):undefined});}return null;})[_0x0d6d('0x1f')](function(_0x50ea93){if(_0x50ea93){_0x66388b[_0x0d6d('0x62')]=_0x50ea93['get']({'plain':!![]});interaction_log['info'](_0x0d6d('0x63'),_0x2ef38e[_0x0d6d('0x5d')]['id'],_0x2ef38e[_0x0d6d('0x5d')][_0x0d6d('0x36')],_0x2ef38e[_0x0d6d('0x5d')][_0x0d6d('0x64')],_0x66388b[_0x0d6d('0x62')]['id'],_0x2ef38e[_0x0d6d('0x52')]?JSON[_0x0d6d('0x24')](_0x2ef38e['body']):_0x0d6d('0x65'));return respondWithRpcPromise(_0x0d6d('0x66'),_0x0d6d('0x67'),_0x66388b);}return null;})['then'](function(_0x1bc2d7){var _0x27010c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1bc2d7[_0x0d6d('0x27')][_0x0d6d('0x68')];return db['sequelize']['query'](_0x27010c,{'type':db[_0x0d6d('0x69')][_0x0d6d('0x6a')][_0x0d6d('0x6b')],'raw':!![]})[_0x0d6d('0x1f')](function(_0x2f8e30){return _0x2f8e30;});})[_0x0d6d('0x1f')](function(_0x4ac516){if(_0x4ac516){_0x66388b['message'][_0x0d6d('0x6c')]=_0x4ac516[0x0];if(!_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')])return;return db[_0x0d6d('0x6d')][_0x0d6d('0x53')]({'where':{'id':_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x5c')],'role':_0x0d6d('0x5e')},'attributes':['id',_0x0d6d('0x36'),'fullname',_0x0d6d('0x6e'),_0x0d6d('0x6f')],'raw':!![]});}return null;})[_0x0d6d('0x1f')](function(_0x1a082b){if(!_0x1a082b)return null;_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x5e')]=_0x1a082b;return _0x66388b;})[_0x0d6d('0x1f')](function(_0x449ecd){if(_0x449ecd){if(_0x2ef38e[_0x0d6d('0x52')][_0x0d6d('0x70')]){_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x71')]=util[_0x0d6d('0x5a')](_0x0d6d('0x72'),_0x2ef38e[_0x0d6d('0x5d')]['name']);_0x66388b['message']['channel']=_0x66388b['channel'];_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x73')]=_0x66388b[_0x0d6d('0x74')];_0x66388b[_0x0d6d('0x27')][_0x0d6d('0x75')]=_0x0d6d('0x57');return respondWithRpcPromise('EventManager',_0x0d6d('0x76'),{'event':'acceptmessage','message':_[_0x0d6d('0x49')](_0x66388b[_0x0d6d('0x27')],JSON[_0x0d6d('0x77')](_0x66388b[_0x0d6d('0x62')]['formData']))},client9002)[_0x0d6d('0x1f')](function(){return _0x66388b;});}return _0x66388b;}return null;})[_0x0d6d('0x1f')](respondWithResult(_0x24f74f,null))[_0x0d6d('0x28')](handleError(_0x24f74f,null));};var interaction_log=require('../../config/logger')(_0x0d6d('0x56'));exports['reject']=function(_0x44a26,_0x56660a,_0x6e52a){var _0x24ffad={'agent':{},'channel':_0x0d6d('0x78')};if(_0x44a26[_0x0d6d('0x52')]['id']){delete _0x44a26[_0x0d6d('0x52')]['id'];}_0x44a26[_0x0d6d('0x52')]['UserId']=_0x44a26[_0x0d6d('0x52')][_0x0d6d('0x5c')]||_0x44a26[_0x0d6d('0x5d')]['id'];_0x24ffad[_0x0d6d('0x5e')]['id']=_0x44a26[_0x0d6d('0x52')][_0x0d6d('0x5c')];return db['ChatMessage']['find']({'where':{'id':_0x44a26[_0x0d6d('0x50')]['id'],'UserId':null}})[_0x0d6d('0x1f')](handleEntityNotFound(_0x56660a,null))[_0x0d6d('0x1f')](function(_0x2c9653){if(_0x2c9653){_0x24ffad[_0x0d6d('0x27')]=_0x2c9653[_0x0d6d('0x5f')]({'plain':!![]});return db[_0x0d6d('0x79')][_0x0d6d('0x53')]({'where':{'id':_0x2c9653[_0x0d6d('0x60')]}});}return null;})[_0x0d6d('0x1f')](handleEntityNotFound(_0x56660a,null))[_0x0d6d('0x1f')](function(_0x1069b6){if(_0x1069b6){_0x24ffad[_0x0d6d('0x62')]=_0x1069b6[_0x0d6d('0x5f')]({'plain':!![]});interaction_log[_0x0d6d('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x44a26[_0x0d6d('0x5d')]['id'],_0x44a26[_0x0d6d('0x5d')]['name'],_0x44a26[_0x0d6d('0x5d')][_0x0d6d('0x64')],_0x24ffad[_0x0d6d('0x62')]['id'],_0x44a26[_0x0d6d('0x52')]?JSON[_0x0d6d('0x24')](_0x44a26[_0x0d6d('0x52')]):'null');return respondWithRpcPromise(_0x0d6d('0x7a'),_0x0d6d('0x7b'),_0x24ffad);}return null;})[_0x0d6d('0x1f')](function(_0x513b14){var _0x127676='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x513b14[_0x0d6d('0x27')][_0x0d6d('0x68')];return db[_0x0d6d('0x7c')][_0x0d6d('0x3e')](_0x127676,{'type':db[_0x0d6d('0x69')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x15f66f){return _0x15f66f;});})[_0x0d6d('0x1f')](function(_0x5c345f){if(_0x5c345f){_0x24ffad[_0x0d6d('0x27')][_0x0d6d('0x6c')]=_0x5c345f[0x0];if(!_0x44a26[_0x0d6d('0x52')]['UserId'])return;return db['User'][_0x0d6d('0x53')]({'where':{'id':_0x44a26[_0x0d6d('0x52')][_0x0d6d('0x5c')],'role':_0x0d6d('0x5e')},'attributes':['id',_0x0d6d('0x36'),_0x0d6d('0x7d'),_0x0d6d('0x6e'),_0x0d6d('0x6f')],'raw':!![]});}return null;})[_0x0d6d('0x1f')](function(_0x3df6b0){if(!_0x3df6b0)return null;_0x24ffad[_0x0d6d('0x27')][_0x0d6d('0x5e')]=_0x3df6b0;return _0x24ffad;})['then'](function(_0x491fe9){if(_0x491fe9){_0x491fe9['message'][_0x0d6d('0x71')]=util['format']('SIP/%s',_0x44a26[_0x0d6d('0x5d')][_0x0d6d('0x36')]);_0x491fe9[_0x0d6d('0x27')][_0x0d6d('0x74')]=_0x24ffad['channel'];_0x491fe9['message'][_0x0d6d('0x73')]=_0x24ffad[_0x0d6d('0x74')];_0x491fe9[_0x0d6d('0x27')][_0x0d6d('0x75')]='reject';respondWithRpcPromise(_0x0d6d('0x76'),_0x0d6d('0x76'),{'event':_0x0d6d('0x7e'),'message':_['merge'](_0x24ffad[_0x0d6d('0x27')],JSON[_0x0d6d('0x77')](_0x24ffad[_0x0d6d('0x62')][_0x0d6d('0x7f')]))},client9002);return _0x24ffad;}return null;})['then'](respondWithResult(_0x56660a,null))['catch'](handleError(_0x56660a,null));};
\ No newline at end of file
+var _0x5579=['map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','chat-interactions','chat','RejectMessage','rejectMessage','User','fullname','event','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key'];(function(_0x4cd3f8,_0x534557){var _0x1660f8=function(_0x170ac1){while(--_0x170ac1){_0x4cd3f8['push'](_0x4cd3f8['shift']());}};_0x1660f8(++_0x534557);}(_0x5579,0x151));var _0x9557=function(_0xffd205,_0x392c2a){_0xffd205=_0xffd205-0x0;var _0x106a92=_0x5579[_0xffd205];return _0x106a92;};'use strict';var emlformat=require(_0x9557('0x0'));var rimraf=require(_0x9557('0x1'));var zipdir=require(_0x9557('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9557('0x3'));var moment=require(_0x9557('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9557('0x5'));var util=require(_0x9557('0x6'));var path=require(_0x9557('0x7'));var sox=require(_0x9557('0x8'));var csv=require(_0x9557('0x9'));var ejs=require(_0x9557('0xa'));var fs=require('fs');var fs_extra=require(_0x9557('0xb'));var _=require(_0x9557('0xc'));var squel=require(_0x9557('0xd'));var crypto=require('crypto');var jsforce=require(_0x9557('0xe'));var deskjs=require(_0x9557('0xf'));var toCsv=require(_0x9557('0x9'));var querystring=require(_0x9557('0x10'));var Papa=require(_0x9557('0x11'));var Redis=require(_0x9557('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9557('0x13'));var hardwareService=require(_0x9557('0x14'));var logger=require(_0x9557('0x15'))('api');var utils=require(_0x9557('0x16'));var config=require(_0x9557('0x17'));var licenseUtil=require(_0x9557('0x18'));var db=require(_0x9557('0x19'))['db'];config['redis']=_['defaults'](config[_0x9557('0x1a')],{'host':_0x9557('0x1b'),'port':0x18eb});var socket=require(_0x9557('0x1c'))(new Redis(config[_0x9557('0x1a')]));require('./chatMessage.socket')[_0x9557('0x1d')](socket);var jayson=require(_0x9557('0x1e'));var client=jayson['client'][_0x9557('0x1f')]({'port':0x232c});var client9002=jayson[_0x9557('0x20')][_0x9557('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3fa294,_0x879b9e,_0x4a6f66,_0x4f2c00){return new BPromise(function(_0x207be3,_0x59871b){var _0x4a509a=_0x4f2c00||client;return _0x4a509a['request'](_0x3fa294,_0x4a6f66)['then'](function(_0x7c83eb){logger['info'](_0x9557('0x21'),_0x879b9e,_0x9557('0x22'));logger[_0x9557('0x23')](_0x9557('0x24'),_0x879b9e,_0x9557('0x22'),JSON[_0x9557('0x25')](_0x7c83eb));if(_0x7c83eb[_0x9557('0x26')]){if(_0x7c83eb[_0x9557('0x26')][_0x9557('0x27')]===0x1f4){logger[_0x9557('0x26')]('ChatMessage,\x20%s,\x20%s',_0x879b9e,_0x7c83eb[_0x9557('0x26')]['message']);return _0x59871b(_0x7c83eb[_0x9557('0x26')][_0x9557('0x28')]);}logger[_0x9557('0x26')]('ChatMessage,\x20%s,\x20%s',_0x879b9e,_0x7c83eb[_0x9557('0x26')][_0x9557('0x28')]);return _0x207be3(_0x7c83eb['error'][_0x9557('0x28')]);}else{logger[_0x9557('0x29')]('ChatMessage,\x20%s,\x20%s',_0x879b9e,_0x9557('0x22'));_0x207be3(_0x7c83eb['result'][_0x9557('0x28')]);}})['catch'](function(_0x50fba2){logger[_0x9557('0x26')](_0x9557('0x21'),_0x879b9e,_0x50fba2);_0x59871b(_0x50fba2);});});}function respondWithStatusCode(_0x467081,_0x307b5c){_0x307b5c=_0x307b5c||0xcc;return function(_0x3e6917){if(_0x3e6917){return _0x467081[_0x9557('0x2a')](_0x307b5c);}return _0x467081[_0x9557('0x2b')](_0x307b5c)['end']();};}function respondWithResult(_0x4b5bc0,_0x5d8ecd){_0x5d8ecd=_0x5d8ecd||0xc8;return function(_0x5b5ab9){if(_0x5b5ab9){return _0x4b5bc0[_0x9557('0x2b')](_0x5d8ecd)[_0x9557('0x2c')](_0x5b5ab9);}};}function respondWithFilteredResult(_0x9416b5,_0x599c79){return function(_0x240c06){if(_0x240c06){var _0x474d61=typeof _0x599c79[_0x9557('0x2d')]===_0x9557('0x2e')&&typeof _0x599c79[_0x9557('0x2f')]===_0x9557('0x2e');var _0x4ca41b=_0x240c06[_0x9557('0x30')];var _0x42c433=_0x474d61?0x0:_0x599c79['offset'];var _0x591953=_0x474d61?_0x240c06[_0x9557('0x30')]:_0x599c79[_0x9557('0x2d')]+_0x599c79[_0x9557('0x2f')];var _0x25ac80;if(_0x591953>=_0x4ca41b){_0x591953=_0x4ca41b;_0x25ac80=0xc8;}else{_0x25ac80=0xce;}_0x9416b5['status'](_0x25ac80);return _0x9416b5['set'](_0x9557('0x31'),_0x42c433+'-'+_0x591953+'/'+_0x4ca41b)[_0x9557('0x2c')](_0x240c06);}return null;};}function patchUpdates(_0x314712){return function(_0x227085){try{jsonpatch[_0x9557('0x32')](_0x227085,_0x314712,!![]);}catch(_0x54c91d){return BPromise[_0x9557('0x33')](_0x54c91d);}return _0x227085[_0x9557('0x34')]();};}function saveUpdates(_0xdca481,_0x280390){return function(_0x234377){if(_0x234377){return _0x234377[_0x9557('0x35')](_0xdca481)[_0x9557('0x36')](function(_0x5e86b7){return _0x5e86b7;});}return null;};}function removeEntity(_0x29309c,_0x48136b){return function(_0x4f930a){if(_0x4f930a){return _0x4f930a[_0x9557('0x37')]()[_0x9557('0x36')](function(){_0x29309c[_0x9557('0x2b')](0xcc)[_0x9557('0x38')]();});}};}function handleEntityNotFound(_0x4d0a95,_0x45534a){return function(_0x5484b6){if(!_0x5484b6){_0x4d0a95[_0x9557('0x2a')](0x194);}return _0x5484b6;};}function handleError(_0x3e207b,_0x5ee5a1){_0x5ee5a1=_0x5ee5a1||0x1f4;return function(_0x4c254b){logger[_0x9557('0x26')](_0x4c254b[_0x9557('0x39')]);if(_0x4c254b[_0x9557('0x3a')]){delete _0x4c254b[_0x9557('0x3a')];}_0x3e207b[_0x9557('0x2b')](_0x5ee5a1)[_0x9557('0x3b')](_0x4c254b);};}exports['index']=function(_0x1bc276,_0xdb9c3c){var _0x2ecd8e={},_0x1e13a7={},_0x35802e={'count':0x0,'rows':[]};var _0xdba233=_['map'](db[_0x9557('0x3c')][_0x9557('0x3d')],function(_0x5af36c){return{'name':_0x5af36c[_0x9557('0x3e')],'type':_0x5af36c[_0x9557('0x3f')][_0x9557('0x40')]};});_0x1e13a7['model']=_[_0x9557('0x41')](_0xdba233,'name');_0x1e13a7[_0x9557('0x42')]=_[_0x9557('0x43')](_0x1bc276[_0x9557('0x42')]);_0x1e13a7[_0x9557('0x44')]=_['intersection'](_0x1e13a7['model'],_0x1e13a7[_0x9557('0x42')]);_0x2ecd8e['attributes']=_[_0x9557('0x45')](_0x1e13a7[_0x9557('0x46')],qs[_0x9557('0x47')](_0x1bc276[_0x9557('0x42')][_0x9557('0x47')]));_0x2ecd8e['attributes']=_0x2ecd8e[_0x9557('0x48')][_0x9557('0x49')]?_0x2ecd8e[_0x9557('0x48')]:_0x1e13a7[_0x9557('0x46')];if(!_0x1bc276[_0x9557('0x42')][_0x9557('0x4a')](_0x9557('0x4b'))){_0x2ecd8e[_0x9557('0x2f')]=qs[_0x9557('0x2f')](_0x1bc276[_0x9557('0x42')][_0x9557('0x2f')]);_0x2ecd8e[_0x9557('0x2d')]=qs[_0x9557('0x2d')](_0x1bc276[_0x9557('0x42')]['offset']);}_0x2ecd8e[_0x9557('0x4c')]=qs[_0x9557('0x4d')](_0x1bc276[_0x9557('0x42')]['sort']);_0x2ecd8e[_0x9557('0x4e')]=qs['filters'](_[_0x9557('0x4f')](_0x1bc276[_0x9557('0x42')],_0x1e13a7[_0x9557('0x44')]),_0xdba233);if(_0x1bc276[_0x9557('0x42')][_0x9557('0x50')]){_0x2ecd8e['where']=_[_0x9557('0x51')](_0x2ecd8e[_0x9557('0x4e')],{'$or':_[_0x9557('0x41')](_0xdba233,function(_0x3d0db3){if(_0x3d0db3[_0x9557('0x3f')]!==_0x9557('0x52')){var _0x24548a={};_0x24548a[_0x3d0db3[_0x9557('0x3a')]]={'$like':'%'+_0x1bc276[_0x9557('0x42')][_0x9557('0x50')]+'%'};return _0x24548a;}})});}_0x2ecd8e=_[_0x9557('0x51')]({},_0x2ecd8e,_0x1bc276[_0x9557('0x53')]);var _0x2ef387={'where':_0x2ecd8e[_0x9557('0x4e')]};return db[_0x9557('0x3c')][_0x9557('0x30')](_0x2ef387)[_0x9557('0x36')](function(_0x2f8ef5){_0x35802e['count']=_0x2f8ef5;if(_0x1bc276[_0x9557('0x42')][_0x9557('0x54')]){_0x2ecd8e[_0x9557('0x55')]=[{'all':!![]}];}return db[_0x9557('0x3c')]['findAll'](_0x2ecd8e);})[_0x9557('0x36')](function(_0x1e76ae){_0x35802e['rows']=_0x1e76ae;return _0x35802e;})[_0x9557('0x36')](respondWithFilteredResult(_0xdb9c3c,_0x2ecd8e))[_0x9557('0x56')](handleError(_0xdb9c3c,null));};exports['show']=function(_0x4110e9,_0x306530){var _0x189121={'raw':!![],'where':{'id':_0x4110e9[_0x9557('0x57')]['id']}},_0x1df139={};_0x1df139[_0x9557('0x46')]=_['keys'](db[_0x9557('0x3c')][_0x9557('0x3d')]);_0x1df139[_0x9557('0x42')]=_[_0x9557('0x43')](_0x4110e9[_0x9557('0x42')]);_0x1df139[_0x9557('0x44')]=_['intersection'](_0x1df139[_0x9557('0x46')],_0x1df139['query']);_0x189121['attributes']=_[_0x9557('0x45')](_0x1df139[_0x9557('0x46')],qs[_0x9557('0x47')](_0x4110e9['query'][_0x9557('0x47')]));_0x189121[_0x9557('0x48')]=_0x189121['attributes'][_0x9557('0x49')]?_0x189121[_0x9557('0x48')]:_0x1df139[_0x9557('0x46')];if(_0x4110e9[_0x9557('0x42')][_0x9557('0x54')]){_0x189121[_0x9557('0x55')]=[{'all':!![]}];}_0x189121=_[_0x9557('0x51')]({},_0x189121,_0x4110e9[_0x9557('0x53')]);return db['ChatMessage'][_0x9557('0x58')](_0x189121)[_0x9557('0x36')](handleEntityNotFound(_0x306530,null))[_0x9557('0x36')](respondWithResult(_0x306530,null))['catch'](handleError(_0x306530,null));};exports[_0x9557('0x59')]=function(_0x392712,_0x276b13){return db[_0x9557('0x3c')][_0x9557('0x59')](_0x392712['body'],{})['then'](respondWithResult(_0x276b13,0xc9))[_0x9557('0x56')](handleError(_0x276b13,null));};exports['update']=function(_0x44875a,_0x18aa64){if(_0x44875a[_0x9557('0x5a')]['id']){delete _0x44875a[_0x9557('0x5a')]['id'];}return db[_0x9557('0x3c')]['find']({'where':{'id':_0x44875a[_0x9557('0x57')]['id']}})[_0x9557('0x36')](handleEntityNotFound(_0x18aa64,null))[_0x9557('0x36')](saveUpdates(_0x44875a[_0x9557('0x5a')],null))[_0x9557('0x36')](respondWithResult(_0x18aa64,null))[_0x9557('0x56')](handleError(_0x18aa64,null));};exports[_0x9557('0x37')]=function(_0x5b986d,_0x4ff6c4){return db[_0x9557('0x3c')][_0x9557('0x58')]({'where':{'id':_0x5b986d[_0x9557('0x57')]['id']}})[_0x9557('0x36')](handleEntityNotFound(_0x4ff6c4,null))[_0x9557('0x36')](removeEntity(_0x4ff6c4,null))[_0x9557('0x56')](handleError(_0x4ff6c4,null));};exports['describe']=function(_0x2edf89,_0x3911e5){return db['ChatMessage'][_0x9557('0x5b')]()[_0x9557('0x36')](respondWithResult(_0x3911e5,null))[_0x9557('0x56')](handleError(_0x3911e5,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x9557('0x5c')]=function(_0x42bc90,_0x4697ef,_0x835396){var _0x2c15eb={'agent':{},'channel':'chat'};if(_0x42bc90['body']['id']){delete _0x42bc90['body']['id'];}_0x42bc90[_0x9557('0x5a')][_0x9557('0x5d')]=!![];_0x42bc90[_0x9557('0x5a')][_0x9557('0x5e')]=moment()[_0x9557('0x5f')](_0x9557('0x60'));_0x42bc90['body'][_0x9557('0x61')]=_0x42bc90[_0x9557('0x5a')][_0x9557('0x61')]||_0x42bc90[_0x9557('0x62')]['id'];_0x2c15eb[_0x9557('0x63')]['id']=_0x42bc90[_0x9557('0x5a')][_0x9557('0x61')];return db[_0x9557('0x3c')]['find']({'where':{'id':_0x42bc90[_0x9557('0x57')]['id'],'UserId':null}})[_0x9557('0x36')](handleEntityNotFound(_0x4697ef,null))[_0x9557('0x36')](saveUpdates(_0x42bc90[_0x9557('0x5a')],null))[_0x9557('0x36')](function(_0x5f165b){if(_0x5f165b){_0x2c15eb[_0x9557('0x28')]=_0x5f165b[_0x9557('0x64')]({'plain':!![]});return db[_0x9557('0x65')][_0x9557('0x58')]({'where':{'id':_0x5f165b[_0x9557('0x66')]}});}return null;})[_0x9557('0x36')](handleEntityNotFound(_0x4697ef,null))[_0x9557('0x36')](function(_0x5f2572){if(_0x5f2572){return _0x5f2572['update']({'UserId':_0x42bc90[_0x9557('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x5f2572['read1stAt'])?moment()['format'](_0x9557('0x60')):undefined});}return null;})[_0x9557('0x36')](function(_0x17314f){if(_0x17314f){_0x2c15eb[_0x9557('0x67')]=_0x17314f[_0x9557('0x64')]({'plain':!![]});interaction_log[_0x9557('0x29')](_0x9557('0x68'),_0x42bc90[_0x9557('0x62')]['id'],_0x42bc90['user']['name'],_0x42bc90[_0x9557('0x62')][_0x9557('0x69')],_0x2c15eb['interaction']['id'],_0x42bc90[_0x9557('0x5a')]?JSON[_0x9557('0x25')](_0x42bc90[_0x9557('0x5a')]):_0x9557('0x6a'));return respondWithRpcPromise(_0x9557('0x6b'),_0x9557('0x6c'),_0x2c15eb);}return null;})[_0x9557('0x36')](function(_0x5573be){var _0x38e20c=_0x9557('0x6d')+_0x5573be[_0x9557('0x28')][_0x9557('0x6e')];return db[_0x9557('0x6f')]['query'](_0x38e20c,{'type':db[_0x9557('0x70')][_0x9557('0x71')][_0x9557('0x72')],'raw':!![]})[_0x9557('0x36')](function(_0x381569){return _0x381569;});})[_0x9557('0x36')](function(_0x40a01f){if(_0x40a01f){_0x2c15eb['message'][_0x9557('0x73')]=_0x40a01f[0x0];if(!_0x42bc90[_0x9557('0x5a')][_0x9557('0x61')])return;return db['User'][_0x9557('0x58')]({'where':{'id':_0x42bc90['body'][_0x9557('0x61')],'role':_0x9557('0x63')},'attributes':['id',_0x9557('0x3a'),'fullname',_0x9557('0x74'),_0x9557('0x75')],'raw':!![]});}return null;})[_0x9557('0x36')](function(_0x1bea5e){if(!_0x1bea5e)return null;_0x2c15eb[_0x9557('0x28')]['agent']=_0x1bea5e;return _0x2c15eb;})[_0x9557('0x36')](function(_0x369bf1){if(_0x369bf1){if(_0x42bc90[_0x9557('0x5a')][_0x9557('0x76')]){_0x2c15eb[_0x9557('0x28')][_0x9557('0x77')]=util[_0x9557('0x5f')](_0x9557('0x78'),_0x42bc90[_0x9557('0x62')][_0x9557('0x3a')]);_0x2c15eb[_0x9557('0x28')][_0x9557('0x79')]=_0x2c15eb[_0x9557('0x79')];_0x2c15eb[_0x9557('0x28')]['motionChannel']=_0x2c15eb[_0x9557('0x79')];_0x2c15eb[_0x9557('0x28')]['event']='accept';return respondWithRpcPromise(_0x9557('0x7a'),_0x9557('0x7a'),{'event':_0x9557('0x7b'),'message':_[_0x9557('0x51')](_0x2c15eb['message'],JSON[_0x9557('0x7c')](_0x2c15eb['interaction']['formData']))},client9002)[_0x9557('0x36')](function(){return _0x2c15eb;});}return _0x2c15eb;}return null;})[_0x9557('0x36')](respondWithResult(_0x4697ef,null))[_0x9557('0x56')](handleError(_0x4697ef,null));};var interaction_log=require(_0x9557('0x15'))(_0x9557('0x7d'));exports[_0x9557('0x33')]=function(_0x59b3de,_0x49f028,_0x45f270){var _0x2db267={'agent':{},'channel':_0x9557('0x7e')};if(_0x59b3de['body']['id']){delete _0x59b3de[_0x9557('0x5a')]['id'];}_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')]=_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')]||_0x59b3de['user']['id'];_0x2db267[_0x9557('0x63')]['id']=_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x59b3de[_0x9557('0x57')]['id'],'UserId':null}})[_0x9557('0x36')](handleEntityNotFound(_0x49f028,null))[_0x9557('0x36')](function(_0x1699ee){if(_0x1699ee){_0x2db267[_0x9557('0x28')]=_0x1699ee['get']({'plain':!![]});return db[_0x9557('0x65')][_0x9557('0x58')]({'where':{'id':_0x1699ee[_0x9557('0x66')]}});}return null;})[_0x9557('0x36')](handleEntityNotFound(_0x49f028,null))[_0x9557('0x36')](function(_0xe25db6){if(_0xe25db6){_0x2db267['interaction']=_0xe25db6['get']({'plain':!![]});interaction_log[_0x9557('0x29')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59b3de['user']['id'],_0x59b3de[_0x9557('0x62')][_0x9557('0x3a')],_0x59b3de[_0x9557('0x62')][_0x9557('0x69')],_0x2db267['interaction']['id'],_0x59b3de['body']?JSON[_0x9557('0x25')](_0x59b3de[_0x9557('0x5a')]):_0x9557('0x6a'));return respondWithRpcPromise(_0x9557('0x7f'),_0x9557('0x80'),_0x2db267);}return null;})[_0x9557('0x36')](function(_0x5d6d8c){var _0x37a559='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d6d8c[_0x9557('0x28')][_0x9557('0x6e')];return db['sequelize'][_0x9557('0x42')](_0x37a559,{'type':db[_0x9557('0x70')][_0x9557('0x71')][_0x9557('0x72')],'raw':!![]})['then'](function(_0x2e7cb6){return _0x2e7cb6;});})['then'](function(_0x17bfa0){if(_0x17bfa0){_0x2db267[_0x9557('0x28')]['contact']=_0x17bfa0[0x0];if(!_0x59b3de[_0x9557('0x5a')]['UserId'])return;return db[_0x9557('0x81')][_0x9557('0x58')]({'where':{'id':_0x59b3de[_0x9557('0x5a')][_0x9557('0x61')],'role':_0x9557('0x63')},'attributes':['id',_0x9557('0x3a'),_0x9557('0x82'),_0x9557('0x74'),_0x9557('0x75')],'raw':!![]});}return null;})['then'](function(_0x1f94e1){if(!_0x1f94e1)return null;_0x2db267['message'][_0x9557('0x63')]=_0x1f94e1;return _0x2db267;})[_0x9557('0x36')](function(_0x242a05){if(_0x242a05){_0x242a05['message'][_0x9557('0x77')]=util[_0x9557('0x5f')](_0x9557('0x78'),_0x59b3de[_0x9557('0x62')][_0x9557('0x3a')]);_0x242a05[_0x9557('0x28')][_0x9557('0x79')]=_0x2db267[_0x9557('0x79')];_0x242a05[_0x9557('0x28')]['motionChannel']=_0x2db267[_0x9557('0x79')];_0x242a05[_0x9557('0x28')][_0x9557('0x83')]='reject';respondWithRpcPromise('EventManager',_0x9557('0x7a'),{'event':_0x9557('0x84'),'message':_[_0x9557('0x51')](_0x2db267[_0x9557('0x28')],JSON[_0x9557('0x7c')](_0x2db267['interaction'][_0x9557('0x85')]))},client9002);return _0x2db267;}return null;})[_0x9557('0x36')](respondWithResult(_0x49f028,null))['catch'](handleError(_0x49f028,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 394781a..7d15879 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 _0x788d=['emit','events','setMaxListeners','save','remove'];(function(_0x2b3a2d,_0x1132de){var _0x4efb9f=function(_0x13df56){while(--_0x13df56){_0x2b3a2d['push'](_0x2b3a2d['shift']());}};_0x4efb9f(++_0x1132de);}(_0x788d,0x17d));var _0xd788=function(_0x348ab1,_0x58b7ee){_0x348ab1=_0x348ab1-0x0;var _0x15b1b7=_0x788d[_0x348ab1];return _0x15b1b7;};'use strict';var EventEmitter=require(_0xd788('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd788('0x1')](0x0);var events={'afterCreate':_0xd788('0x2'),'afterUpdate':'update','afterDestroy':_0xd788('0x3')};function emitEvent(_0x41f6d7){return function(_0x131a28,_0x2dce58,_0x336d8a){ChatMessageEvents['emit'](_0x41f6d7+':'+_0x131a28['id'],_0x131a28);ChatMessageEvents[_0xd788('0x4')](_0x41f6d7,_0x131a28);_0x336d8a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xaffe=['hasOwnProperty','hook','exports','events','ChatMessage','update','remove','emit'];(function(_0x2b2cc3,_0x5277d7){var _0x49d8a6=function(_0x1b604c){while(--_0x1b604c){_0x2b2cc3['push'](_0x2b2cc3['shift']());}};_0x49d8a6(++_0x5277d7);}(_0xaffe,0x17b));var _0xeaff=function(_0x165244,_0x26f339){_0x165244=_0x165244-0x0;var _0x1778bf=_0xaffe[_0x165244];return _0x1778bf;};'use strict';var EventEmitter=require(_0xeaff('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xeaff('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xeaff('0x2'),'afterDestroy':_0xeaff('0x3')};function emitEvent(_0x552990){return function(_0x1df606,_0x435fef,_0x23ced4){ChatMessageEvents[_0xeaff('0x4')](_0x552990+':'+_0x1df606['id'],_0x1df606);ChatMessageEvents[_0xeaff('0x4')](_0x552990,_0x1df606);_0x23ced4(null);};}for(var e in events){if(events[_0xeaff('0x5')](e)){var event=events[e];ChatMessage[_0xeaff('0x6')](e,emitEvent(event));}}module[_0xeaff('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 165f647..b59f743 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 _0x50a1=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x50a1,0xc4));var _0x150a=function(_0x3c841c,_0x3f26fb){_0x3c841c=_0x3c841c-0x0;var _0xd58efd=_0x50a1[_0x3c841c];return _0xd58efd;};'use strict';var _=require(_0x150a('0x0'));var util=require('util');var logger=require(_0x150a('0x1'))(_0x150a('0x2'));var moment=require(_0x150a('0x3'));var BPromise=require(_0x150a('0x4'));var rp=require(_0x150a('0x5'));var fs=require('fs');var path=require(_0x150a('0x6'));var rimraf=require(_0x150a('0x7'));var config=require('../../config/environment');var attributes=require(_0x150a('0x8'));module[_0x150a('0x9')]=function(_0x1fb98a,_0xf2c38d){return _0x1fb98a['define']('ChatMessage',attributes,{'tableName':_0x150a('0xa'),'paranoid':![],'indexes':[{'name':_0x150a('0xb'),'fields':[_0x150a('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58de26,_0x3e999c,_0x2b1eb8){var _0x391cda=_0x1fb98a[_0x150a('0xd')];var _0x1ebab6=_0x58de26[_0x150a('0xe')]({'plain':!![]});if(_0x1ebab6[_0x150a('0xf')][_0x150a('0x10')]()==='in'||_0x1ebab6['direction']['toLowerCase']()===_0x150a('0x11')&&!_0x1ebab6[_0x150a('0x12')]&&!_[_0x150a('0x13')](_0x1ebab6['UserId'])){_0x391cda[_0x150a('0x14')]['findOne']({'where':{'id':_0x1ebab6['ChatInteractionId']}})[_0x150a('0x15')](function(_0x254839){if(_0x254839){_0x254839[_0x150a('0x16')]({'lastMsgAt':_0x1ebab6[_0x150a('0x17')],'lastMsgDirection':_0x1ebab6[_0x150a('0xf')][_0x150a('0x10')]()});}})[_0x150a('0x18')](function(_0x4af914){console[_0x150a('0x19')](_0x4af914);});}_0x2b1eb8();}},'charset':_0x150a('0x1a'),'collate':_0x150a('0x1b')});};
\ No newline at end of file
+var _0xf57b=['utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','update','createdAt','error','utf8mb4'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0xf57b,0x1c3));var _0xbf57=function(_0x1a9845,_0x5f1ca7){_0x1a9845=_0x1a9845-0x0;var _0x4f4490=_0xf57b[_0x1a9845];return _0x4f4490;};'use strict';var _=require(_0xbf57('0x0'));var util=require(_0xbf57('0x1'));var logger=require(_0xbf57('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf57('0x3'));var fs=require('fs');var path=require(_0xbf57('0x4'));var rimraf=require(_0xbf57('0x5'));var config=require(_0xbf57('0x6'));var attributes=require(_0xbf57('0x7'));module['exports']=function(_0x4140bf,_0x16c741){return _0x4140bf[_0xbf57('0x8')](_0xbf57('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xbf57('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x459ed6,_0x3be804,_0x128fa3){var _0x6e95cb=_0x4140bf[_0xbf57('0xb')];var _0x454b0b=_0x459ed6[_0xbf57('0xc')]({'plain':!![]});if(_0x454b0b['direction'][_0xbf57('0xd')]()==='in'||_0x454b0b[_0xbf57('0xe')][_0xbf57('0xd')]()===_0xbf57('0xf')&&!_0x454b0b[_0xbf57('0x10')]&&!_[_0xbf57('0x11')](_0x454b0b[_0xbf57('0x12')])){_0x6e95cb['ChatInteraction'][_0xbf57('0x13')]({'where':{'id':_0x454b0b['ChatInteractionId']}})['then'](function(_0x2dcef1){if(_0x2dcef1){_0x2dcef1[_0xbf57('0x14')]({'lastMsgAt':_0x454b0b[_0xbf57('0x15')],'lastMsgDirection':_0x454b0b[_0xbf57('0xe')][_0xbf57('0xd')]()});}})['catch'](function(_0x391e34){console[_0xbf57('0x16')](_0x391e34);});}_0x128fa3();}},'charset':_0xbf57('0x17'),'collate':_0xbf57('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 2ddea98..4fc8585 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 _0x7281=['options','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateChatMessage','create'];(function(_0x25e812,_0x1342a2){var _0x727c56=function(_0x243b79){while(--_0x243b79){_0x25e812['push'](_0x25e812['shift']());}};_0x727c56(++_0x1342a2);}(_0x7281,0x153));var _0x1728=function(_0x2438c1,_0x47d044){_0x2438c1=_0x2438c1-0x0;var _0x1cdf71=_0x7281[_0x2438c1];return _0x1cdf71;};'use strict';var _=require(_0x1728('0x0'));var util=require(_0x1728('0x1'));var moment=require(_0x1728('0x2'));var BPromise=require(_0x1728('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1728('0x4'));var db=require(_0x1728('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1728('0x6'));var config=require('../../config/environment');var jayson=require(_0x1728('0x7'));var client=jayson[_0x1728('0x8')]['http']({'port':0x232a});config[_0x1728('0x9')]=_[_0x1728('0xa')](config[_0x1728('0x9')],{'host':_0x1728('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1728('0x9')]));require('./chatMessage.socket')[_0x1728('0xc')](socket);function respondWithRpcPromise(_0x3730e4,_0x18912d,_0x2cca4e){return new BPromise(function(_0x14d2eb,_0x474c9a){return client['request'](_0x3730e4,_0x2cca4e)[_0x1728('0xd')](function(_0x527d7d){logger[_0x1728('0xe')](_0x1728('0xf'),_0x18912d,_0x1728('0x10'));logger[_0x1728('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x18912d,_0x1728('0x10'),JSON[_0x1728('0x12')](_0x527d7d));if(_0x527d7d[_0x1728('0x13')]){if(_0x527d7d[_0x1728('0x13')][_0x1728('0x14')]===0x1f4){logger[_0x1728('0x13')](_0x1728('0xf'),_0x18912d,_0x527d7d[_0x1728('0x13')][_0x1728('0x15')]);return _0x474c9a(_0x527d7d['error'][_0x1728('0x15')]);}logger[_0x1728('0x13')]('ChatMessage,\x20%s,\x20%s',_0x18912d,_0x527d7d['error'][_0x1728('0x15')]);return _0x14d2eb(_0x527d7d[_0x1728('0x13')][_0x1728('0x15')]);}else{logger['info'](_0x1728('0xf'),_0x18912d,'request\x20sent');_0x14d2eb(_0x527d7d['result']['message']);}})[_0x1728('0x16')](function(_0x4c88c6){logger['error'](_0x1728('0xf'),_0x18912d,_0x4c88c6);_0x474c9a(_0x4c88c6);});});}exports[_0x1728('0x17')]=function(_0x1c5caa){var _0x4cb6a5=this;return new Promise(function(_0x30d599,_0xb4380b){return db['ChatMessage'][_0x1728('0x18')](_0x1c5caa['body'],{'raw':_0x1c5caa[_0x1728('0x19')]?_0x1c5caa[_0x1728('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x1728('0xd')](function(_0x2670d0){logger[_0x1728('0xe')]('CreateChatMessage',_0x1c5caa);logger[_0x1728('0x11')](_0x1728('0x17'),_0x1c5caa,JSON[_0x1728('0x12')](_0x2670d0));_0x30d599(_0x2670d0);})[_0x1728('0x16')](function(_0x318506){logger[_0x1728('0x13')](_0x1728('0x17'),_0x318506[_0x1728('0x15')],_0x1c5caa);_0xb4380b(_0x4cb6a5['error'](0x1f4,_0x318506['message']));});});};
\ No newline at end of file
+var _0xa981=['error','code','message','result','CreateChatMessage','ChatMessage','body','options','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0xa981,0xa9));var _0x1a98=function(_0x512e72,_0x49ffe1){_0x512e72=_0x512e72-0x0;var _0x143086=_0xa981[_0x512e72];return _0x143086;};'use strict';var _=require('lodash');var util=require(_0x1a98('0x0'));var moment=require('moment');var BPromise=require(_0x1a98('0x1'));var rs=require(_0x1a98('0x2'));var fs=require('fs');var Redis=require(_0x1a98('0x3'));var db=require(_0x1a98('0x4'))['db'];var utils=require(_0x1a98('0x5'));var logger=require('../../config/logger')(_0x1a98('0x6'));var config=require(_0x1a98('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1a98('0x8')][_0x1a98('0x9')]({'port':0x232a});config[_0x1a98('0xa')]=_[_0x1a98('0xb')](config[_0x1a98('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a98('0xc'))(new Redis(config[_0x1a98('0xa')]));require(_0x1a98('0xd'))[_0x1a98('0xe')](socket);function respondWithRpcPromise(_0x137a44,_0x45c260,_0x1d01c3){return new BPromise(function(_0x2b7877,_0x3ccd5b){return client[_0x1a98('0xf')](_0x137a44,_0x1d01c3)[_0x1a98('0x10')](function(_0x4647af){logger[_0x1a98('0x11')](_0x1a98('0x12'),_0x45c260,_0x1a98('0x13'));logger[_0x1a98('0x14')](_0x1a98('0x15'),_0x45c260,_0x1a98('0x13'),JSON[_0x1a98('0x16')](_0x4647af));if(_0x4647af[_0x1a98('0x17')]){if(_0x4647af[_0x1a98('0x17')][_0x1a98('0x18')]===0x1f4){logger['error'](_0x1a98('0x12'),_0x45c260,_0x4647af[_0x1a98('0x17')][_0x1a98('0x19')]);return _0x3ccd5b(_0x4647af[_0x1a98('0x17')][_0x1a98('0x19')]);}logger[_0x1a98('0x17')]('ChatMessage,\x20%s,\x20%s',_0x45c260,_0x4647af[_0x1a98('0x17')]['message']);return _0x2b7877(_0x4647af[_0x1a98('0x17')][_0x1a98('0x19')]);}else{logger[_0x1a98('0x11')](_0x1a98('0x12'),_0x45c260,_0x1a98('0x13'));_0x2b7877(_0x4647af[_0x1a98('0x1a')][_0x1a98('0x19')]);}})['catch'](function(_0x47a04b){logger['error'](_0x1a98('0x12'),_0x45c260,_0x47a04b);_0x3ccd5b(_0x47a04b);});});}exports[_0x1a98('0x1b')]=function(_0x2067e5){var _0x590c52=this;return new Promise(function(_0x5d426c,_0x25182e){return db[_0x1a98('0x1c')]['create'](_0x2067e5[_0x1a98('0x1d')],{'raw':_0x2067e5['options']?_0x2067e5[_0x1a98('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x1a98('0x10')](function(_0x17fd92){logger['info'](_0x1a98('0x1b'),_0x2067e5);logger[_0x1a98('0x14')](_0x1a98('0x1b'),_0x2067e5,JSON['stringify'](_0x17fd92));_0x5d426c(_0x17fd92);})[_0x1a98('0x1f')](function(_0x3b4bef){logger[_0x1a98('0x17')]('CreateChatMessage',_0x3b4bef[_0x1a98('0x19')],_0x2067e5);_0x25182e(_0x590c52[_0x1a98('0x17')](0x1f4,_0x3b4bef[_0x1a98('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index f285e0b..1aadc51 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 _0x3595=['emit','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0xb90be8,_0x3014df){var _0x287c3f=function(_0x1016e9){while(--_0x1016e9){_0xb90be8['push'](_0xb90be8['shift']());}};_0x287c3f(++_0x3014df);}(_0x3595,0x147));var _0x5359=function(_0x384752,_0x3c4c5f){_0x384752=_0x384752-0x0;var _0x431eec=_0x3595[_0x384752];return _0x431eec;};'use strict';var ChatMessageEvents=require(_0x5359('0x0'));var events=[_0x5359('0x1'),_0x5359('0x2'),'update'];function createListener(_0x18677f,_0x398ac6){return function(_0xcb2beb){_0x398ac6[_0x5359('0x3')](_0x18677f,_0xcb2beb);};}function removeListener(_0x1fa814,_0x125c76){return function(){ChatMessageEvents['removeListener'](_0x1fa814,_0x125c76);};}exports['register']=function(_0x1cb891){for(var _0x24545a=0x0,_0x1b6f48=events[_0x5359('0x4')];_0x24545a<_0x1b6f48;_0x24545a++){var _0x39fcd8=events[_0x24545a];var _0x51b2fb=createListener(_0x5359('0x5')+_0x39fcd8,_0x1cb891);ChatMessageEvents['on'](_0x39fcd8,_0x51b2fb);}};
\ No newline at end of file
+var _0x5162=['chatMessage:','./chatMessage.events','emit','removeListener','register','length'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0x5162,0x103));var _0x2516=function(_0x425af8,_0x366c35){_0x425af8=_0x425af8-0x0;var _0x5c2eb1=_0x5162[_0x425af8];return _0x5c2eb1;};'use strict';var ChatMessageEvents=require(_0x2516('0x0'));var events=['save','remove','update'];function createListener(_0x4db25c,_0x41fd28){return function(_0x2aaef5){_0x41fd28[_0x2516('0x1')](_0x4db25c,_0x2aaef5);};}function removeListener(_0x2d0b53,_0x2e48b6){return function(){ChatMessageEvents[_0x2516('0x2')](_0x2d0b53,_0x2e48b6);};}exports[_0x2516('0x3')]=function(_0x5b71b5){for(var _0x48f411=0x0,_0x5beeb3=events[_0x2516('0x4')];_0x48f411<_0x5beeb3;_0x48f411++){var _0xba4b36=events[_0x48f411];var _0xa1557=createListener(_0x2516('0x5')+_0xba4b36,_0x5b71b5);ChatMessageEvents['on'](_0xba4b36,_0xa1557);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 9947d72..328ce50 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 _0x1bc9=['tracked','chatmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x1bc9,0xad));var _0x91bc=function(_0x1ba3b7,_0x302135){_0x1ba3b7=_0x1ba3b7-0x0;var _0x42228e=_0x1bc9[_0x1ba3b7];return _0x42228e;};'use strict';var multer=require(_0x91bc('0x0'));var util=require('util');var path=require(_0x91bc('0x1'));var timeout=require(_0x91bc('0x2'));var express=require(_0x91bc('0x3'));var router=express[_0x91bc('0x4')]();var fs_extra=require(_0x91bc('0x5'));var auth=require(_0x91bc('0x6'));var interaction=require(_0x91bc('0x7'));var config=require(_0x91bc('0x8'));var controller=require(_0x91bc('0x9'));router[_0x91bc('0xa')]('/',auth[_0x91bc('0xb')](),controller[_0x91bc('0xc')]);router[_0x91bc('0xa')](_0x91bc('0xd'),auth[_0x91bc('0xb')](),controller[_0x91bc('0xe')]);router['get']('/:id',auth[_0x91bc('0xb')](),controller[_0x91bc('0xf')]);router['post']('/',auth[_0x91bc('0xb')](),interaction[_0x91bc('0x10')]('chat',_0x91bc('0x11')),controller[_0x91bc('0x12')]);router[_0x91bc('0x13')](_0x91bc('0x14'),controller[_0x91bc('0x15')]);router['put'](_0x91bc('0x16'),auth[_0x91bc('0xb')](),controller[_0x91bc('0x17')]);router['put'](_0x91bc('0x18'),auth['isAuthenticated'](),controller[_0x91bc('0x19')]);router['delete'](_0x91bc('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x91bc('0x1a')]=router;
\ No newline at end of file
+var _0x2248=['show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x57b5d0,_0xf302ef){var _0x7c212e=function(_0x3c6cef){while(--_0x3c6cef){_0x57b5d0['push'](_0x57b5d0['shift']());}};_0x7c212e(++_0xf302ef);}(_0x2248,0x93));var _0x8224=function(_0x5218db,_0x388fc7){_0x5218db=_0x5218db-0x0;var _0x157852=_0x2248[_0x5218db];return _0x157852;};'use strict';var multer=require(_0x8224('0x0'));var util=require(_0x8224('0x1'));var path=require(_0x8224('0x2'));var timeout=require('connect-timeout');var express=require(_0x8224('0x3'));var router=express[_0x8224('0x4')]();var fs_extra=require(_0x8224('0x5'));var auth=require(_0x8224('0x6'));var interaction=require(_0x8224('0x7'));var config=require('../../config/environment');var controller=require(_0x8224('0x8'));router[_0x8224('0x9')]('/',auth[_0x8224('0xa')](),controller[_0x8224('0xb')]);router[_0x8224('0x9')](_0x8224('0xc'),auth['isAuthenticated'](),controller[_0x8224('0xd')]);router[_0x8224('0x9')](_0x8224('0xe'),auth[_0x8224('0xa')](),controller[_0x8224('0xf')]);router[_0x8224('0x10')]('/',auth['isAuthenticated'](),interaction[_0x8224('0x11')](_0x8224('0x12'),_0x8224('0x13')),controller['create']);router[_0x8224('0x14')](_0x8224('0xe'),controller[_0x8224('0x15')]);router[_0x8224('0x14')](_0x8224('0x16'),auth[_0x8224('0xa')](),controller[_0x8224('0x17')]);router[_0x8224('0x14')](_0x8224('0x18'),auth[_0x8224('0xa')](),controller['reject']);router['delete'](_0x8224('0xe'),auth[_0x8224('0xa')](),controller[_0x8224('0x19')]);module[_0x8224('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 4fa6587..04e34bf 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b7b9b,_0xa4aff9){_0x4b7b9b=_0x4b7b9b-0x0;var _0x3be710=_0x0b0e[_0x4b7b9b];return _0x3be710;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x40c656,_0x27b0fa){var _0x553a28=function(_0x49ce84){while(--_0x49ce84){_0x40c656['push'](_0x40c656['shift']());}};_0x553a28(++_0x27b0fa);}(_0x2032,0xd9));var _0x2203=function(_0x3b1a3e,_0xfed716){_0x3b1a3e=_0x3b1a3e-0x0;var _0x343add=_0x2032[_0x3b1a3e];return _0x343add;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 529f758..938e9ee 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(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x10f4f3,_0x3320d3){_0x10f4f3=_0x10f4f3-0x0;var _0x3c4332=_0x7a54[_0x10f4f3];return _0x3c4332;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x22d268,_0x1347fc){var _0x30def5=function(_0xc83fc8){while(--_0xc83fc8){_0x22d268['push'](_0x22d268['shift']());}};_0x30def5(++_0x1347fc);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index eea6ba1..11f351b 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 _0xee65=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xee65,0x1bb));var _0x5ee6=function(_0x15caea,_0xd23bf){_0x15caea=_0x15caea-0x0;var _0x5713cf=_0xee65[_0x15caea];return _0x5713cf;};'use strict';var EventEmitter=require(_0x5ee6('0x0'));var ChatOfflineMessage=require(_0x5ee6('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5ee6('0x2')](0x0);var events={'afterCreate':_0x5ee6('0x3'),'afterUpdate':_0x5ee6('0x4'),'afterDestroy':_0x5ee6('0x5')};function emitEvent(_0x58d65c){return function(_0x5bcbaf,_0x8130d1,_0x46075c){ChatOfflineMessageEvents[_0x5ee6('0x6')](_0x58d65c+':'+_0x5bcbaf['id'],_0x5bcbaf);ChatOfflineMessageEvents[_0x5ee6('0x6')](_0x58d65c,_0x5bcbaf);_0x46075c(null);};}for(var e in events){if(events[_0x5ee6('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x5ee6('0x8')](e,emitEvent(event));}}module[_0x5ee6('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xe396=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xc8c149,_0x104184){var _0x261259=function(_0x314df3){while(--_0x314df3){_0xc8c149['push'](_0xc8c149['shift']());}};_0x261259(++_0x104184);}(_0xe396,0xa3));var _0x6e39=function(_0x6f7355,_0x3246eb){_0x6f7355=_0x6f7355-0x0;var _0xbd5cb5=_0xe396[_0x6f7355];return _0xbd5cb5;};'use strict';var EventEmitter=require(_0x6e39('0x0'));var ChatOfflineMessage=require(_0x6e39('0x1'))['db'][_0x6e39('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6e39('0x3')](0x0);var events={'afterCreate':_0x6e39('0x4'),'afterUpdate':_0x6e39('0x5'),'afterDestroy':_0x6e39('0x6')};function emitEvent(_0x2e51f0){return function(_0x34bb99,_0x59bce9,_0x3e8e20){ChatOfflineMessageEvents[_0x6e39('0x7')](_0x2e51f0+':'+_0x34bb99['id'],_0x34bb99);ChatOfflineMessageEvents[_0x6e39('0x7')](_0x2e51f0,_0x34bb99);_0x3e8e20(null);};}for(var e in events){if(events[_0x6e39('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x6e39('0x9')](e,emitEvent(event));}}module[_0x6e39('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 9ff6215..330ce09 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 _0x0605=['./chatOfflineMessage.attributes','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x471452,_0x157074){var _0x1220ac=function(_0x404d5c){while(--_0x404d5c){_0x471452['push'](_0x471452['shift']());}};_0x1220ac(++_0x157074);}(_0x0605,0x1e5));var _0x5060=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0605[_0x31e29a];return _0x32d892;};'use strict';var attributes=require(_0x5060('0x0'));module['exports']=function(_0x44ca89){return _0x44ca89[_0x5060('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x5060('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5060('0x3'),'collate':_0x5060('0x4')});};
\ No newline at end of file
+var _0x823b=['exports','define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes'];(function(_0x4b5714,_0x4a8ff6){var _0x384f28=function(_0x1a97a5){while(--_0x1a97a5){_0x4b5714['push'](_0x4b5714['shift']());}};_0x384f28(++_0x4a8ff6);}(_0x823b,0xcc));var _0xb823=function(_0x52a9c3,_0x54a987){_0x52a9c3=_0x52a9c3-0x0;var _0x5b9422=_0x823b[_0x52a9c3];return _0x5b9422;};'use strict';var attributes=require(_0xb823('0x0'));module[_0xb823('0x1')]=function(_0x231efe){return _0x231efe[_0xb823('0x2')](_0xb823('0x3'),attributes,{'tableName':_0xb823('0x4'),'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 44fe1bd..6f980c4 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 _0x031f=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4bb730,_0x25cbee){var _0x4c0897=function(_0x1b13ef){while(--_0x1b13ef){_0x4bb730['push'](_0x4bb730['shift']());}};_0x4c0897(++_0x25cbee);}(_0x031f,0x1c2));var _0xf031=function(_0x3c7c41,_0x4c4375){_0x3c7c41=_0x3c7c41-0x0;var _0x27d147=_0x031f[_0x3c7c41];return _0x27d147;};'use strict';var _=require(_0xf031('0x0'));var util=require('util');var moment=require(_0xf031('0x1'));var BPromise=require('bluebird');var rs=require(_0xf031('0x2'));var fs=require('fs');var Redis=require(_0xf031('0x3'));var db=require(_0xf031('0x4'))['db'];var utils=require(_0xf031('0x5'));var logger=require('../../config/logger')(_0xf031('0x6'));var config=require(_0xf031('0x7'));var jayson=require(_0xf031('0x8'));var client=jayson[_0xf031('0x9')][_0xf031('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32aa5c,_0x3c598b,_0x506616){return new BPromise(function(_0x3f27ee,_0x49ac08){return client[_0xf031('0xb')](_0x32aa5c,_0x506616)[_0xf031('0xc')](function(_0x987107){logger[_0xf031('0xd')](_0xf031('0xe'),_0x3c598b,'request\x20sent');logger[_0xf031('0xf')](_0xf031('0x10'),_0x3c598b,'request\x20sent',JSON[_0xf031('0x11')](_0x987107));if(_0x987107[_0xf031('0x12')]){if(_0x987107[_0xf031('0x12')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3c598b,_0x987107[_0xf031('0x12')][_0xf031('0x13')]);return _0x49ac08(_0x987107['error'][_0xf031('0x13')]);}logger[_0xf031('0x12')](_0xf031('0xe'),_0x3c598b,_0x987107[_0xf031('0x12')]['message']);return _0x3f27ee(_0x987107['error']['message']);}else{logger[_0xf031('0xd')](_0xf031('0xe'),_0x3c598b,_0xf031('0x14'));_0x3f27ee(_0x987107[_0xf031('0x15')]['message']);}})[_0xf031('0x16')](function(_0x211c93){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3c598b,_0x211c93);_0x49ac08(_0x211c93);});});}
\ No newline at end of file
+var _0xe20a=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xe20a,0xf7));var _0xae20=function(_0x9f2ca5,_0x575ffd){_0x9f2ca5=_0x9f2ca5-0x0;var _0x3ff23e=_0xe20a[_0x9f2ca5];return _0x3ff23e;};'use strict';var _=require(_0xae20('0x0'));var util=require(_0xae20('0x1'));var moment=require(_0xae20('0x2'));var BPromise=require(_0xae20('0x3'));var rs=require(_0xae20('0x4'));var fs=require('fs');var Redis=require(_0xae20('0x5'));var db=require(_0xae20('0x6'))['db'];var utils=require(_0xae20('0x7'));var logger=require(_0xae20('0x8'))(_0xae20('0x9'));var config=require('../../config/environment');var jayson=require(_0xae20('0xa'));var client=jayson[_0xae20('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcb526d,_0x11bba1,_0x1159d7){return new BPromise(function(_0x407652,_0x47b731){return client['request'](_0xcb526d,_0x1159d7)[_0xae20('0xc')](function(_0x520a6a){logger[_0xae20('0xd')](_0xae20('0xe'),_0x11bba1,_0xae20('0xf'));logger[_0xae20('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x11bba1,_0xae20('0xf'),JSON[_0xae20('0x11')](_0x520a6a));if(_0x520a6a['error']){if(_0x520a6a[_0xae20('0x12')]['code']===0x1f4){logger['error'](_0xae20('0xe'),_0x11bba1,_0x520a6a[_0xae20('0x12')][_0xae20('0x13')]);return _0x47b731(_0x520a6a[_0xae20('0x12')][_0xae20('0x13')]);}logger[_0xae20('0x12')](_0xae20('0xe'),_0x11bba1,_0x520a6a[_0xae20('0x12')][_0xae20('0x13')]);return _0x407652(_0x520a6a['error'][_0xae20('0x13')]);}else{logger[_0xae20('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x11bba1,_0xae20('0xf'));_0x407652(_0x520a6a['result']['message']);}})['catch'](function(_0x27e6e7){logger[_0xae20('0x12')](_0xae20('0xe'),_0x11bba1,_0x27e6e7);_0x47b731(_0x27e6e7);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index ffed146..e2ba43e 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 _0xada8=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','show','post','create','delete','/:id'];(function(_0xe98847,_0x197762){var _0x27f822=function(_0x2d26c6){while(--_0x2d26c6){_0xe98847['push'](_0xe98847['shift']());}};_0x27f822(++_0x197762);}(_0xada8,0x17c));var _0x8ada=function(_0x19c57f,_0x259afa){_0x19c57f=_0x19c57f-0x0;var _0x3696b8=_0xada8[_0x19c57f];return _0x3696b8;};'use strict';var multer=require(_0x8ada('0x0'));var util=require('util');var path=require(_0x8ada('0x1'));var timeout=require(_0x8ada('0x2'));var express=require('express');var router=express[_0x8ada('0x3')]();var fs_extra=require(_0x8ada('0x4'));var auth=require(_0x8ada('0x5'));var interaction=require(_0x8ada('0x6'));var config=require('../../config/environment');var controller=require(_0x8ada('0x7'));router['get']('/',auth[_0x8ada('0x8')](),controller[_0x8ada('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8ada('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8ada('0xb')]);router[_0x8ada('0xc')]('/',auth[_0x8ada('0x8')](),controller[_0x8ada('0xd')]);router['put']('/:id',auth[_0x8ada('0x8')](),controller['update']);router[_0x8ada('0xe')](_0x8ada('0xf'),auth[_0x8ada('0x8')](),controller[_0x8ada('0x10')]);module[_0x8ada('0x11')]=router;
\ No newline at end of file
+var _0xa738=['show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x2d8db5,_0x3c9c8d){var _0xdc5579=function(_0x36f14f){while(--_0x36f14f){_0x2d8db5['push'](_0x2d8db5['shift']());}};_0xdc5579(++_0x3c9c8d);}(_0xa738,0x86));var _0x8a73=function(_0x50804b,_0x34b219){_0x50804b=_0x50804b-0x0;var _0x1e3a47=_0xa738[_0x50804b];return _0x1e3a47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a73('0x0'));var timeout=require(_0x8a73('0x1'));var express=require(_0x8a73('0x2'));var router=express[_0x8a73('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8a73('0x4'));var interaction=require(_0x8a73('0x5'));var config=require(_0x8a73('0x6'));var controller=require(_0x8a73('0x7'));router[_0x8a73('0x8')]('/',auth[_0x8a73('0x9')](),controller['index']);router['get'](_0x8a73('0xa'),auth[_0x8a73('0x9')](),controller[_0x8a73('0xb')]);router[_0x8a73('0x8')](_0x8a73('0xc'),auth[_0x8a73('0x9')](),controller[_0x8a73('0xd')]);router[_0x8a73('0xe')]('/',auth[_0x8a73('0x9')](),controller[_0x8a73('0xf')]);router[_0x8a73('0x10')](_0x8a73('0xc'),auth[_0x8a73('0x9')](),controller[_0x8a73('0x11')]);router[_0x8a73('0x12')]('/:id',auth[_0x8a73('0x9')](),controller[_0x8a73('0x13')]);module[_0x8a73('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 3ccc332..6767485 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 _0xe2d4=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x1c07b0,_0x1876cc){var _0x3038ce=function(_0x376d13){while(--_0x376d13){_0x1c07b0['push'](_0x1c07b0['shift']());}};_0x3038ce(++_0x1876cc);}(_0xe2d4,0xa1));var _0x4e2d=function(_0x592d17,_0x57e2ed){_0x592d17=_0x592d17-0x0;var _0x44808f=_0xe2d4[_0x592d17];return _0x44808f;};'use strict';var Sequelize=require(_0x4e2d('0x0'));module[_0x4e2d('0x1')]={'name':{'type':Sequelize[_0x4e2d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4e2d('0x3')]('mouseOver','timeout'),'defaultValue':_0x4e2d('0x4')},'selector':{'type':Sequelize[_0x4e2d('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xae29=['STRING','mouseOver','INTEGER','sequelize','exports'];(function(_0x2c7b11,_0x19a38e){var _0x222b49=function(_0x57a52d){while(--_0x57a52d){_0x2c7b11['push'](_0x2c7b11['shift']());}};_0x222b49(++_0x19a38e);}(_0xae29,0xad));var _0x9ae2=function(_0x3f3f75,_0x5e215f){_0x3f3f75=_0x3f3f75-0x0;var _0x322635=_0xae29[_0x3f3f75];return _0x322635;};'use strict';var Sequelize=require(_0x9ae2('0x0'));module[_0x9ae2('0x1')]={'name':{'type':Sequelize[_0x9ae2('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x9ae2('0x3')},'selector':{'type':Sequelize[_0x9ae2('0x2')]},'timeout':{'type':Sequelize[_0x9ae2('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 53e7a9e..04175db 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 _0xd13e=['fast-json-patch','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','name','show','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','length','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir'];(function(_0x3a2b60,_0x454e7c){var _0x3e73e6=function(_0x3d3f96){while(--_0x3d3f96){_0x3a2b60['push'](_0x3a2b60['shift']());}};_0x3e73e6(++_0x454e7c);}(_0xd13e,0x193));var _0xed13=function(_0xc35948,_0x11fa59){_0xc35948=_0xc35948-0x0;var _0x192662=_0xd13e[_0xc35948];return _0x192662;};'use strict';var emlformat=require(_0xed13('0x0'));var rimraf=require(_0xed13('0x1'));var zipdir=require(_0xed13('0x2'));var jsonpatch=require(_0xed13('0x3'));var rp=require('request-promise');var moment=require(_0xed13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed13('0x5'));var util=require('util');var path=require(_0xed13('0x6'));var sox=require(_0xed13('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed13('0x8'));var squel=require(_0xed13('0x9'));var crypto=require(_0xed13('0xa'));var jsforce=require(_0xed13('0xb'));var deskjs=require(_0xed13('0xc'));var toCsv=require(_0xed13('0xd'));var querystring=require(_0xed13('0xe'));var Papa=require(_0xed13('0xf'));var Redis=require(_0xed13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed13('0x11'));var as=require(_0xed13('0x12'));var hardwareService=require(_0xed13('0x13'));var logger=require(_0xed13('0x14'))(_0xed13('0x15'));var utils=require('../../config/utils');var config=require(_0xed13('0x16'));var licenseUtil=require(_0xed13('0x17'));var db=require(_0xed13('0x18'))['db'];function respondWithStatusCode(_0x3c0b22,_0x936103){_0x936103=_0x936103||0xcc;return function(_0x3295ba){if(_0x3295ba){return _0x3c0b22['sendStatus'](_0x936103);}return _0x3c0b22[_0xed13('0x19')](_0x936103)['end']();};}function respondWithResult(_0x257074,_0x56fdc6){_0x56fdc6=_0x56fdc6||0xc8;return function(_0x6e2978){if(_0x6e2978){return _0x257074['status'](_0x56fdc6)[_0xed13('0x1a')](_0x6e2978);}};}function respondWithFilteredResult(_0x4d5435,_0x38901a){return function(_0xf900d2){if(_0xf900d2){var _0x1d3d67=typeof _0x38901a[_0xed13('0x1b')]===_0xed13('0x1c')&&typeof _0x38901a[_0xed13('0x1d')]===_0xed13('0x1c');var _0x1148a3=_0xf900d2[_0xed13('0x1e')];var _0x1e161f=_0x1d3d67?0x0:_0x38901a[_0xed13('0x1b')];var _0x31de07=_0x1d3d67?_0xf900d2[_0xed13('0x1e')]:_0x38901a[_0xed13('0x1b')]+_0x38901a[_0xed13('0x1d')];var _0x2f38c9;if(_0x31de07>=_0x1148a3){_0x31de07=_0x1148a3;_0x2f38c9=0xc8;}else{_0x2f38c9=0xce;}_0x4d5435['status'](_0x2f38c9);return _0x4d5435['set'](_0xed13('0x1f'),_0x1e161f+'-'+_0x31de07+'/'+_0x1148a3)[_0xed13('0x1a')](_0xf900d2);}return null;};}function patchUpdates(_0x4f455b){return function(_0x40dd86){try{jsonpatch['apply'](_0x40dd86,_0x4f455b,!![]);}catch(_0x4e9e3b){return BPromise[_0xed13('0x20')](_0x4e9e3b);}return _0x40dd86[_0xed13('0x21')]();};}function saveUpdates(_0x2d62cd,_0x192d12){return function(_0x1d7621){if(_0x1d7621){return _0x1d7621[_0xed13('0x22')](_0x2d62cd)['then'](function(_0x5c0daf){return _0x5c0daf;});}return null;};}function removeEntity(_0x5d7ae1,_0x19d51b){return function(_0x3b1f23){if(_0x3b1f23){return _0x3b1f23[_0xed13('0x23')]()[_0xed13('0x24')](function(){_0x5d7ae1[_0xed13('0x19')](0xcc)[_0xed13('0x25')]();});}};}function handleEntityNotFound(_0x1f0405,_0x276c57){return function(_0x2410e2){if(!_0x2410e2){_0x1f0405[_0xed13('0x26')](0x194);}return _0x2410e2;};}function handleError(_0x1f064c,_0x3bc666){_0x3bc666=_0x3bc666||0x1f4;return function(_0x2c6c33){logger[_0xed13('0x27')](_0x2c6c33['stack']);if(_0x2c6c33['name']){delete _0x2c6c33[_0xed13('0x28')];}_0x1f064c[_0xed13('0x19')](_0x3bc666)['send'](_0x2c6c33);};}exports[_0xed13('0x29')]=function(_0x40444a,_0x4ed119){var _0x7ce996={'raw':!![],'where':{'id':_0x40444a[_0xed13('0x2a')]['id']}},_0x2066ca={};_0x2066ca['model']=_[_0xed13('0x2b')](db[_0xed13('0x2c')]['rawAttributes']);_0x2066ca[_0xed13('0x2d')]=_[_0xed13('0x2b')](_0x40444a['query']);_0x2066ca[_0xed13('0x2e')]=_[_0xed13('0x2f')](_0x2066ca[_0xed13('0x30')],_0x2066ca[_0xed13('0x2d')]);_0x7ce996[_0xed13('0x31')]=_[_0xed13('0x2f')](_0x2066ca[_0xed13('0x30')],qs['fields'](_0x40444a[_0xed13('0x2d')]['fields']));_0x7ce996['attributes']=_0x7ce996[_0xed13('0x31')][_0xed13('0x32')]?_0x7ce996[_0xed13('0x31')]:_0x2066ca['model'];if(_0x40444a[_0xed13('0x2d')][_0xed13('0x33')]){_0x7ce996[_0xed13('0x34')]=[{'all':!![]}];}_0x7ce996=_['merge']({},_0x7ce996,_0x40444a[_0xed13('0x35')]);return db[_0xed13('0x2c')][_0xed13('0x36')](_0x7ce996)[_0xed13('0x24')](handleEntityNotFound(_0x4ed119,null))['then'](respondWithResult(_0x4ed119,null))[_0xed13('0x37')](handleError(_0x4ed119,null));};exports[_0xed13('0x38')]=function(_0x2508b4,_0xed7343){return db[_0xed13('0x2c')][_0xed13('0x38')](_0x2508b4[_0xed13('0x39')],{})[_0xed13('0x24')](respondWithResult(_0xed7343,0xc9))[_0xed13('0x37')](handleError(_0xed7343,null));};exports[_0xed13('0x22')]=function(_0x5a09e4,_0x2342a5){if(_0x5a09e4[_0xed13('0x39')]['id']){delete _0x5a09e4['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x5a09e4[_0xed13('0x2a')]['id']}})[_0xed13('0x24')](handleEntityNotFound(_0x2342a5,null))['then'](saveUpdates(_0x5a09e4['body'],null))[_0xed13('0x24')](respondWithResult(_0x2342a5,null))[_0xed13('0x37')](handleError(_0x2342a5,null));};exports[_0xed13('0x23')]=function(_0x32ec49,_0x358098){return db['ChatProactiveAction']['find']({'where':{'id':_0x32ec49[_0xed13('0x2a')]['id']}})['then'](handleEntityNotFound(_0x358098,null))[_0xed13('0x24')](removeEntity(_0x358098,null))['catch'](handleError(_0x358098,null));};
\ No newline at end of file
+var _0x9a19=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x18ca81,_0x5698ae){var _0x4c8c5c=function(_0x57477f){while(--_0x57477f){_0x18ca81['push'](_0x18ca81['shift']());}};_0x4c8c5c(++_0x5698ae);}(_0x9a19,0x114));var _0x99a1=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x9a19[_0x32b542];return _0x554d54;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['show']=function(_0xf41b0d,_0x499eef){var _0x255197={'raw':!![],'where':{'id':_0xf41b0d[_0x99a1('0x29')]['id']}},_0x1137f2={};_0x1137f2['model']=_[_0x99a1('0x2a')](db[_0x99a1('0x2b')]['rawAttributes']);_0x1137f2[_0x99a1('0x2c')]=_[_0x99a1('0x2a')](_0xf41b0d[_0x99a1('0x2c')]);_0x1137f2[_0x99a1('0x2d')]=_[_0x99a1('0x2e')](_0x1137f2[_0x99a1('0x2f')],_0x1137f2[_0x99a1('0x2c')]);_0x255197[_0x99a1('0x30')]=_['intersection'](_0x1137f2['model'],qs[_0x99a1('0x31')](_0xf41b0d['query'][_0x99a1('0x31')]));_0x255197[_0x99a1('0x30')]=_0x255197['attributes'][_0x99a1('0x32')]?_0x255197[_0x99a1('0x30')]:_0x1137f2[_0x99a1('0x2f')];if(_0xf41b0d[_0x99a1('0x2c')][_0x99a1('0x33')]){_0x255197[_0x99a1('0x34')]=[{'all':!![]}];}_0x255197=_[_0x99a1('0x35')]({},_0x255197,_0xf41b0d[_0x99a1('0x36')]);return db[_0x99a1('0x2b')][_0x99a1('0x37')](_0x255197)[_0x99a1('0x23')](handleEntityNotFound(_0x499eef,null))[_0x99a1('0x23')](respondWithResult(_0x499eef,null))[_0x99a1('0x38')](handleError(_0x499eef,null));};exports[_0x99a1('0x39')]=function(_0x55005e,_0x53fed5){return db[_0x99a1('0x2b')][_0x99a1('0x39')](_0x55005e[_0x99a1('0x3a')],{})[_0x99a1('0x23')](respondWithResult(_0x53fed5,0xc9))[_0x99a1('0x38')](handleError(_0x53fed5,null));};exports[_0x99a1('0x3b')]=function(_0x318dab,_0x54840d){if(_0x318dab[_0x99a1('0x3a')]['id']){delete _0x318dab[_0x99a1('0x3a')]['id'];}return db['ChatProactiveAction'][_0x99a1('0x37')]({'where':{'id':_0x318dab[_0x99a1('0x29')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x54840d,null))[_0x99a1('0x23')](saveUpdates(_0x318dab[_0x99a1('0x3a')],null))[_0x99a1('0x23')](respondWithResult(_0x54840d,null))[_0x99a1('0x38')](handleError(_0x54840d,null));};exports[_0x99a1('0x24')]=function(_0x1a44c6,_0x17bb50){return db[_0x99a1('0x2b')][_0x99a1('0x37')]({'where':{'id':_0x1a44c6[_0x99a1('0x29')]['id']}})['then'](handleEntityNotFound(_0x17bb50,null))['then'](removeEntity(_0x17bb50,null))['catch'](handleError(_0x17bb50,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index e522edd..e0a7170 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 _0xf344=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_proactive_actions'];(function(_0x1d6000,_0x3a3185){var _0x1db9ac=function(_0x22c3ba){while(--_0x22c3ba){_0x1d6000['push'](_0x1d6000['shift']());}};_0x1db9ac(++_0x3a3185);}(_0xf344,0xaa));var _0x4f34=function(_0x127483,_0x2bada2){_0x127483=_0x127483-0x0;var _0x16a73e=_0xf344[_0x127483];return _0x16a73e;};'use strict';var _=require('lodash');var util=require(_0x4f34('0x0'));var logger=require(_0x4f34('0x1'))(_0x4f34('0x2'));var moment=require('moment');var BPromise=require(_0x4f34('0x3'));var rp=require(_0x4f34('0x4'));var fs=require('fs');var path=require(_0x4f34('0x5'));var rimraf=require(_0x4f34('0x6'));var config=require(_0x4f34('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x4f34('0x8')]=function(_0x139eeb,_0x5d3955){return _0x139eeb['define']('ChatProactiveAction',attributes,{'tableName':_0x4f34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd28e=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','api','bluebird'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0xd28e,0x105));var _0xed28=function(_0x2d9c49,_0xc40595){_0x2d9c49=_0x2d9c49-0x0;var _0x4b86f3=_0xd28e[_0x2d9c49];return _0x4b86f3;};'use strict';var _=require('lodash');var util=require(_0xed28('0x0'));var logger=require('../../config/logger')(_0xed28('0x1'));var moment=require('moment');var BPromise=require(_0xed28('0x2'));var rp=require(_0xed28('0x3'));var fs=require('fs');var path=require(_0xed28('0x4'));var rimraf=require(_0xed28('0x5'));var config=require(_0xed28('0x6'));var attributes=require(_0xed28('0x7'));module[_0xed28('0x8')]=function(_0x594d16,_0x471f93){return _0x594d16[_0xed28('0x9')](_0xed28('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 93b6692..a03f93a 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 _0x614f=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message'];(function(_0xd8cfdb,_0x57ea8a){var _0x32b83d=function(_0x173629){while(--_0x173629){_0xd8cfdb['push'](_0xd8cfdb['shift']());}};_0x32b83d(++_0x57ea8a);}(_0x614f,0x1c5));var _0xf614=function(_0x37bc49,_0x48a894){_0x37bc49=_0x37bc49-0x0;var _0x49767a=_0x614f[_0x37bc49];return _0x49767a;};'use strict';var _=require(_0xf614('0x0'));var util=require(_0xf614('0x1'));var moment=require(_0xf614('0x2'));var BPromise=require(_0xf614('0x3'));var rs=require(_0xf614('0x4'));var fs=require('fs');var Redis=require(_0xf614('0x5'));var db=require(_0xf614('0x6'))['db'];var utils=require(_0xf614('0x7'));var logger=require(_0xf614('0x8'))(_0xf614('0x9'));var config=require(_0xf614('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf614('0xb')][_0xf614('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x127f7b,_0x550a9e,_0x557a64){return new BPromise(function(_0x19c677,_0x3d5333){return client['request'](_0x127f7b,_0x557a64)[_0xf614('0xd')](function(_0x36eb17){logger[_0xf614('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x550a9e,'request\x20sent');logger[_0xf614('0xf')](_0xf614('0x10'),_0x550a9e,'request\x20sent',JSON[_0xf614('0x11')](_0x36eb17));if(_0x36eb17[_0xf614('0x12')]){if(_0x36eb17[_0xf614('0x12')][_0xf614('0x13')]===0x1f4){logger[_0xf614('0x12')](_0xf614('0x14'),_0x550a9e,_0x36eb17[_0xf614('0x12')]['message']);return _0x3d5333(_0x36eb17[_0xf614('0x12')]['message']);}logger['error'](_0xf614('0x14'),_0x550a9e,_0x36eb17[_0xf614('0x12')][_0xf614('0x15')]);return _0x19c677(_0x36eb17[_0xf614('0x12')]['message']);}else{logger[_0xf614('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x550a9e,_0xf614('0x16'));_0x19c677(_0x36eb17[_0xf614('0x17')][_0xf614('0x15')]);}})[_0xf614('0x18')](function(_0x3f4ce1){logger['error'](_0xf614('0x14'),_0x550a9e,_0x3f4ce1);_0x3d5333(_0x3f4ce1);});});}
\ No newline at end of file
+var _0x6c32=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','error','code','message','result','catch','util','moment'];(function(_0x305a8a,_0x52b422){var _0x31e245=function(_0x4722c0){while(--_0x4722c0){_0x305a8a['push'](_0x305a8a['shift']());}};_0x31e245(++_0x52b422);}(_0x6c32,0xda));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x26c3('0x0'));var moment=require(_0x26c3('0x1'));var BPromise=require(_0x26c3('0x2'));var rs=require(_0x26c3('0x3'));var fs=require('fs');var Redis=require(_0x26c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x26c3('0x5'));var logger=require('../../config/logger')(_0x26c3('0x6'));var config=require(_0x26c3('0x7'));var jayson=require(_0x26c3('0x8'));var client=jayson[_0x26c3('0x9')][_0x26c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c3483,_0x1a3450,_0x42be62){return new BPromise(function(_0x452612,_0x4a8126){return client[_0x26c3('0xb')](_0x4c3483,_0x42be62)['then'](function(_0xb3294e){logger[_0x26c3('0xc')](_0x26c3('0xd'),_0x1a3450,'request\x20sent');logger[_0x26c3('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1a3450,'request\x20sent',JSON['stringify'](_0xb3294e));if(_0xb3294e['error']){if(_0xb3294e[_0x26c3('0xf')][_0x26c3('0x10')]===0x1f4){logger[_0x26c3('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x1a3450,_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);return _0x4a8126(_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);}logger[_0x26c3('0xf')](_0x26c3('0xd'),_0x1a3450,_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);return _0x452612(_0xb3294e[_0x26c3('0xf')][_0x26c3('0x11')]);}else{logger[_0x26c3('0xc')](_0x26c3('0xd'),_0x1a3450,'request\x20sent');_0x452612(_0xb3294e[_0x26c3('0x12')]['message']);}})[_0x26c3('0x13')](function(_0xb0af8){logger[_0x26c3('0xf')](_0x26c3('0xd'),_0x1a3450,_0xb0af8);_0x4a8126(_0xb0af8);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a78f0b9..06d6c50 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 _0x5d58=['/:id','isAuthenticated','show','create','update','delete','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x24c9b3,_0xcad610){var _0xc570f8=function(_0x530a3e){while(--_0x530a3e){_0x24c9b3['push'](_0x24c9b3['shift']());}};_0xc570f8(++_0xcad610);}(_0x5d58,0x187));var _0x85d5=function(_0x133117,_0xed49ea){_0x133117=_0x133117-0x0;var _0x566916=_0x5d58[_0x133117];return _0x566916;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./chatProactiveAction.controller');router[_0x85d5('0x4')](_0x85d5('0x5'),auth[_0x85d5('0x6')](),controller[_0x85d5('0x7')]);router['post']('/',auth[_0x85d5('0x6')](),controller[_0x85d5('0x8')]);router['put'](_0x85d5('0x5'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x5'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x4852bf,_0x56c4a0){var _0x205695=function(_0x307f9b){while(--_0x307f9b){_0x4852bf['push'](_0x4852bf['shift']());}};_0x205695(++_0x56c4a0);}(_0x032e,0x124));var _0xe032=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x032e[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 30bfc21..2134800 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 _0x694f=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x596b7c,_0x1d6e61){var _0x4816ac=function(_0x43a376){while(--_0x43a376){_0x596b7c['push'](_0x596b7c['shift']());}};_0x4816ac(++_0x1d6e61);}(_0x694f,0x1a1));var _0xf694=function(_0x5243db,_0x1cd37e){_0x5243db=_0x5243db-0x0;var _0x436ed9=_0x694f[_0x5243db];return _0x436ed9;};'use strict';var Sequelize=require(_0xf694('0x0'));module[_0xf694('0x1')]={'name':{'type':Sequelize[_0xf694('0x2')],'unique':_0xf694('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf694('0x2')]},'timeout':{'type':Sequelize[_0xf694('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf694('0x5')](_0xf694('0x6'),_0xf694('0x7'),_0xf694('0x8'))}};
\ No newline at end of file
+var _0xf6b1=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x43ce33,_0x300b57){var _0x26f433=function(_0x2a473e){while(--_0x2a473e){_0x43ce33['push'](_0x43ce33['shift']());}};_0x26f433(++_0x300b57);}(_0xf6b1,0x1ae));var _0x1f6b=function(_0x24c803,_0xaf258c){_0x24c803=_0x24c803-0x0;var _0x59a954=_0xf6b1[_0x24c803];return _0x59a954;};'use strict';var Sequelize=require(_0x1f6b('0x0'));module[_0x1f6b('0x1')]={'name':{'type':Sequelize[_0x1f6b('0x2')],'unique':_0x1f6b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1f6b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1f6b('0x5')](_0x1f6b('0x6'),_0x1f6b('0x7'),_0x1f6b('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f2511ee..a407885 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 _0xc345=['forEach','userChatQueue:save','removeTeams','ids','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','all','union','value','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','destroy','then','UserProfileResource','name','send','map','ChatQueue','rawAttributes','type','getOptions','where','include','query','findAll','rows','catch','show','params','filters','intersection','attributes','model','fields','length','includeAll','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','keys','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','addTeams','Team','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate'];(function(_0x41bdb7,_0x2d3c1c){var _0xa1e594=function(_0x4aa014){while(--_0x4aa014){_0x41bdb7['push'](_0x41bdb7['shift']());}};_0xa1e594(++_0x2d3c1c);}(_0xc345,0x190));var _0x5c34=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0xc345[_0xf97eb0];return _0xea70f4;};'use strict';var BPromise=require(_0x5c34('0x0'));var util=require(_0x5c34('0x1'));var _=require('lodash');var squel=require(_0x5c34('0x2'));var Redis=require('ioredis');var qs=require(_0x5c34('0x3'));var logger=require(_0x5c34('0x4'))(_0x5c34('0x5'));var config=require(_0x5c34('0x6'));var db=require(_0x5c34('0x7'))['db'];config['redis']=_[_0x5c34('0x8')](config[_0x5c34('0x9')],{'host':_0x5c34('0xa'),'port':0x18eb});var socket=require(_0x5c34('0xb'))(new Redis(config[_0x5c34('0x9')]));require('./chatQueue.socket')[_0x5c34('0xc')](socket);function respondWithStatusCode(_0x5554b0,_0xb48c06){_0xb48c06=_0xb48c06||0xcc;return function(_0x589320){if(_0x589320){return _0x5554b0[_0x5c34('0xd')](_0xb48c06);}return _0x5554b0['status'](_0xb48c06)[_0x5c34('0xe')]();};}function respondWithResult(_0x4a8fc8,_0x2c9721){_0x2c9721=_0x2c9721||0xc8;return function(_0x46054b){if(_0x46054b){return _0x4a8fc8[_0x5c34('0xf')](_0x2c9721)['json'](_0x46054b);}};}function respondWithFilteredResult(_0x5ee821,_0x57b1dd){return function(_0x25ae3f){if(_0x25ae3f){var _0x4c6be5=typeof _0x57b1dd[_0x5c34('0x10')]==='undefined'&&typeof _0x57b1dd[_0x5c34('0x11')]===_0x5c34('0x12');var _0x3bcb6a=_0x25ae3f[_0x5c34('0x13')];var _0x13ef6d=_0x4c6be5?0x0:_0x57b1dd[_0x5c34('0x10')];var _0x390558=_0x4c6be5?_0x25ae3f['count']:_0x57b1dd[_0x5c34('0x10')]+_0x57b1dd[_0x5c34('0x11')];var _0x57466c;if(_0x390558>=_0x3bcb6a){_0x390558=_0x3bcb6a;_0x57466c=0xc8;}else{_0x57466c=0xce;}_0x5ee821[_0x5c34('0xf')](_0x57466c);return _0x5ee821[_0x5c34('0x14')](_0x5c34('0x15'),_0x13ef6d+'-'+_0x390558+'/'+_0x3bcb6a)[_0x5c34('0x16')](_0x25ae3f);}return null;};}function saveUpdates(_0x1d0c8b){return function(_0x32b53c){if(_0x32b53c){return _0x32b53c['update'](_0x1d0c8b)['then'](function(_0x3a469a){return _0x3a469a;});}return null;};}function removeEntity(_0x395b8e){return function(_0x190cf3){if(_0x190cf3){return _0x190cf3[_0x5c34('0x17')]()[_0x5c34('0x18')](function(){var _0x5f9f8a=_0x190cf3['get']({'plain':!![]});var _0x3ab59d='ChatQueues';return db[_0x5c34('0x19')][_0x5c34('0x17')]({'where':{'type':_0x3ab59d,'resourceId':_0x5f9f8a['id']}})[_0x5c34('0x18')](function(){return _0x190cf3;});})['then'](function(){_0x395b8e[_0x5c34('0xf')](0xcc)[_0x5c34('0xe')]();});}};}function handleEntityNotFound(_0x2f92d6){return function(_0xea5423){if(!_0xea5423){_0x2f92d6[_0x5c34('0xd')](0x194);}return _0xea5423;};}function handleError(_0x7e1276,_0x52665a){_0x52665a=_0x52665a||0x1f4;return function(_0x337c20){logger['error'](_0x337c20['stack']);if(_0x337c20[_0x5c34('0x1a')]){delete _0x337c20[_0x5c34('0x1a')];}_0x7e1276[_0x5c34('0xf')](_0x52665a)[_0x5c34('0x1b')](_0x337c20);};}exports['index']=function(_0x428d63,_0x3801f1){var _0x3905c9={};var _0x3f7570={'count':0x0,'rows':[]};var _0x4a7b8c=_[_0x5c34('0x1c')](db[_0x5c34('0x1d')][_0x5c34('0x1e')],function(_0x12537b){return{'name':_0x12537b['fieldName'],'type':_0x12537b[_0x5c34('0x1f')]['key']};});_0x3905c9=qs[_0x5c34('0x20')](_0x4a7b8c,_0x428d63);var _0x1db41c={'where':_0x3905c9[_0x5c34('0x21')]};return db[_0x5c34('0x1d')]['count'](_0x1db41c)['then'](function(_0x53494c){_0x3f7570[_0x5c34('0x13')]=_0x53494c;_0x3905c9[_0x5c34('0x22')]=qs[_0x5c34('0x22')](_0x428d63[_0x5c34('0x23')]);return db['ChatQueue'][_0x5c34('0x24')](_0x3905c9);})['then'](function(_0x16704c){_0x3f7570[_0x5c34('0x25')]=_0x16704c;return _0x3f7570;})[_0x5c34('0x18')](respondWithFilteredResult(_0x3801f1,_0x3905c9))[_0x5c34('0x26')](handleError(_0x3801f1,null));};exports[_0x5c34('0x27')]=function(_0x122b63,_0x1865bd){var _0x5f3b28={'raw':!![],'where':{'id':_0x122b63[_0x5c34('0x28')]['id']}},_0x5a4721={};_0x5a4721['model']=_['keys'](db['ChatQueue']['rawAttributes']);_0x5a4721[_0x5c34('0x23')]=_['keys'](_0x122b63[_0x5c34('0x23')]);_0x5a4721[_0x5c34('0x29')]=_[_0x5c34('0x2a')](_0x5a4721['model'],_0x5a4721[_0x5c34('0x23')]);_0x5f3b28[_0x5c34('0x2b')]=_[_0x5c34('0x2a')](_0x5a4721[_0x5c34('0x2c')],qs['fields'](_0x122b63['query'][_0x5c34('0x2d')]));_0x5f3b28['attributes']=_0x5f3b28[_0x5c34('0x2b')][_0x5c34('0x2e')]?_0x5f3b28['attributes']:_0x5a4721[_0x5c34('0x2c')];if(_0x122b63[_0x5c34('0x23')][_0x5c34('0x2f')]){_0x5f3b28[_0x5c34('0x22')]=[{'all':!![]}];}_0x5f3b28=_[_0x5c34('0x30')]({},_0x5f3b28,_0x122b63[_0x5c34('0x31')]);return db[_0x5c34('0x1d')][_0x5c34('0x32')](_0x5f3b28)[_0x5c34('0x18')](handleEntityNotFound(_0x1865bd,null))[_0x5c34('0x18')](respondWithResult(_0x1865bd,null))[_0x5c34('0x26')](handleError(_0x1865bd,null));};exports[_0x5c34('0x33')]=function(_0x4efcd4,_0x4ce5b4){return db['ChatQueue'][_0x5c34('0x33')](_0x4efcd4[_0x5c34('0x34')],{})['then'](function(_0x483148){var _0x3a44ce=_0x4efcd4[_0x5c34('0x35')][_0x5c34('0x36')]({'plain':!![]});if(!_0x3a44ce)throw new Error(_0x5c34('0x37'));if(_0x3a44ce[_0x5c34('0x38')]===_0x5c34('0x35')){var _0x54cc0e=_0x483148[_0x5c34('0x36')]({'plain':!![]});var _0xd8ef6c=_0x5c34('0x39');return db[_0x5c34('0x3a')][_0x5c34('0x32')]({'where':{'name':_0xd8ef6c,'userProfileId':_0x3a44ce[_0x5c34('0x3b')]},'raw':!![]})[_0x5c34('0x18')](function(_0x4fa203){if(_0x4fa203&&_0x4fa203[_0x5c34('0x3c')]===0x0){return db[_0x5c34('0x19')][_0x5c34('0x33')]({'name':_0x54cc0e['name'],'resourceId':_0x54cc0e['id'],'type':_0x4fa203[_0x5c34('0x1a')],'sectionId':_0x4fa203['id']},{})[_0x5c34('0x18')](function(){return _0x483148;});}else{return _0x483148;}})['catch'](function(_0x505a62){logger[_0x5c34('0x3d')](_0x5c34('0x3e'),_0x505a62);throw _0x505a62;});}return _0x483148;})[_0x5c34('0x18')](respondWithResult(_0x4ce5b4,0xc9))['catch'](handleError(_0x4ce5b4,null));};exports[_0x5c34('0x3f')]=function(_0x423024,_0x334733){if(_0x423024[_0x5c34('0x34')]['id']){delete _0x423024[_0x5c34('0x34')]['id'];}return db[_0x5c34('0x1d')][_0x5c34('0x32')]({'where':{'id':_0x423024['params']['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x334733,null))[_0x5c34('0x18')](saveUpdates(_0x423024['body'],null))[_0x5c34('0x18')](respondWithResult(_0x334733,null))[_0x5c34('0x26')](handleError(_0x334733,null));};exports['destroy']=function(_0x1056b5,_0x138bd4){return db[_0x5c34('0x1d')]['find']({'where':{'id':_0x1056b5[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x138bd4,null))[_0x5c34('0x18')](removeEntity(_0x138bd4,null))['catch'](handleError(_0x138bd4,null));};exports[_0x5c34('0x40')]=function(_0x3a7eca,_0x471fa6){return db[_0x5c34('0x1d')][_0x5c34('0x40')]()[_0x5c34('0x18')](respondWithResult(_0x471fa6,null))[_0x5c34('0x26')](handleError(_0x471fa6,null));};exports[_0x5c34('0x41')]=function(_0x5e2e77,_0x5cebfc){var _0x4dd331={'raw':!![],'where':{}},_0xb3bd14={},_0x3106ef;return db[_0x5c34('0x1d')][_0x5c34('0x42')]({'where':{'id':_0x5e2e77['params']['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x5cebfc,null))[_0x5c34('0x18')](function(_0x20c547){if(_0x20c547){_0x3106ef=_0x20c547['get']({'plain':!![]});_0xb3bd14[_0x5c34('0x2c')]=_[_0x5c34('0x43')](db[_0x5c34('0x44')][_0x5c34('0x1e')]);_0xb3bd14[_0x5c34('0x23')]=_['keys'](_0x5e2e77[_0x5c34('0x23')]);_0xb3bd14[_0x5c34('0x29')]=_[_0x5c34('0x2a')](_0xb3bd14[_0x5c34('0x2c')],_0xb3bd14[_0x5c34('0x23')]);_0x4dd331['attributes']=_[_0x5c34('0x2a')](_0xb3bd14[_0x5c34('0x2c')],qs[_0x5c34('0x2d')](_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x2d')]));_0x4dd331['attributes']=_0x4dd331[_0x5c34('0x2b')][_0x5c34('0x2e')]?_0x4dd331[_0x5c34('0x2b')]:_0xb3bd14[_0x5c34('0x2c')];if(!_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x45')](_0x5c34('0x46'))){_0x4dd331['limit']=qs['limit'](_0x5e2e77[_0x5c34('0x23')]['limit']);_0x4dd331[_0x5c34('0x10')]=qs[_0x5c34('0x10')](_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x10')]);}_0x4dd331[_0x5c34('0x47')]=qs['sort'](_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x48')]);_0x4dd331[_0x5c34('0x21')]=qs[_0x5c34('0x29')](_[_0x5c34('0x49')](_0x5e2e77[_0x5c34('0x23')],_0xb3bd14[_0x5c34('0x29')]));_0x4dd331['where'][_0x5c34('0x4a')]=_0x20c547['id'];if(_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x4b')]){_0x4dd331[_0x5c34('0x21')]=_[_0x5c34('0x30')](_0x4dd331[_0x5c34('0x21')],{'$or':_['map'](_0x4dd331[_0x5c34('0x2b')],function(_0x205781){var _0xca7636={};_0xca7636[_0x205781]={'$like':'%'+_0x5e2e77[_0x5c34('0x23')][_0x5c34('0x4b')]+'%'};return _0xca7636;})});}_0x4dd331=_[_0x5c34('0x30')]({},_0x4dd331,_0x5e2e77['options']);return db['UserChatQueue'][_0x5c34('0x24')](_0x4dd331);}})[_0x5c34('0x18')](function(_0x561586){if(_0x561586){return db[_0x5c34('0x4c')][_0x5c34('0x4d')]({'where':{'id':_[_0x5c34('0x1c')](_0x561586,_0x5c34('0x4e')),'role':_0x5c34('0x4f')},'attributes':['id',_0x5c34('0x1a'),_0x5c34('0x50'),_0x5c34('0x51'),'createdAt']});}})[_0x5c34('0x18')](function(_0x345933){if(_0x345933){return{'count':_0x345933[_0x5c34('0x13')],'rows':_[_0x5c34('0x1c')](_0x345933[_0x5c34('0x25')],function(_0x5c5c21){return{'membername':_0x5c5c21[_0x5c34('0x1a')],'UserId':_0x5c5c21['id'],'queue_name':_0x3106ef['name'],'ChatQueueId':_0x3106ef['id'],'interface':util[_0x5c34('0x52')]('%s/%s',_0x5c34('0x53'),_0x5c5c21[_0x5c34('0x1a')]),'penalty':0x0,'paused':_0x5c5c21[_0x5c34('0x50')],'createdAt':_0x5c5c21[_0x5c34('0x54')],'updatedAt':_0x5c5c21[_0x5c34('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c34('0x18')](respondWithFilteredResult(_0x5cebfc,_0x4dd331))[_0x5c34('0x26')](handleError(_0x5cebfc,null));};exports[_0x5c34('0x55')]=function(_0x5b32f4,_0x485000){var _0x55e065={};var _0x58b317={};var _0x5af40e;var _0x589128;return db[_0x5c34('0x1d')][_0x5c34('0x42')]({'where':{'id':_0x5b32f4[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x485000,null))['then'](function(_0x2a8d8f){if(_0x2a8d8f){_0x5af40e=_0x2a8d8f;_0x58b317[_0x5c34('0x2c')]=_[_0x5c34('0x43')](db['Team'][_0x5c34('0x1e')]);_0x58b317[_0x5c34('0x23')]=_[_0x5c34('0x43')](_0x5b32f4[_0x5c34('0x23')]);_0x58b317['filters']=_[_0x5c34('0x2a')](_0x58b317['model'],_0x58b317['query']);_0x55e065[_0x5c34('0x2b')]=_[_0x5c34('0x2a')](_0x58b317[_0x5c34('0x2c')],qs['fields'](_0x5b32f4['query'][_0x5c34('0x2d')]));_0x55e065['attributes']=_0x55e065[_0x5c34('0x2b')][_0x5c34('0x2e')]?_0x55e065[_0x5c34('0x2b')]:_0x58b317[_0x5c34('0x2c')];_0x55e065['order']=qs['sort'](_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x48')]);_0x55e065[_0x5c34('0x21')]=qs[_0x5c34('0x29')](_[_0x5c34('0x49')](_0x5b32f4[_0x5c34('0x23')],_0x58b317[_0x5c34('0x29')]));if(_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x4b')]){_0x55e065['where']=_[_0x5c34('0x30')](_0x55e065['where'],{'$or':_[_0x5c34('0x1c')](_0x55e065[_0x5c34('0x2b')],function(_0x19b048){var _0x25a0ae={};_0x25a0ae[_0x19b048]={'$like':'%'+_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x4b')]+'%'};return _0x25a0ae;})});}_0x55e065=_['merge']({},_0x55e065,_0x5b32f4[_0x5c34('0x31')]);return _0x5af40e['getTeams'](_0x55e065);}})[_0x5c34('0x18')](function(_0x14cf16){if(_0x14cf16){_0x589128=_0x14cf16[_0x5c34('0x2e')];if(!_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x45')]('nolimit')){_0x55e065[_0x5c34('0x11')]=qs[_0x5c34('0x11')](_0x5b32f4['query'][_0x5c34('0x11')]);_0x55e065[_0x5c34('0x10')]=qs[_0x5c34('0x10')](_0x5b32f4[_0x5c34('0x23')][_0x5c34('0x10')]);}return _0x5af40e[_0x5c34('0x55')](_0x55e065);}})['then'](function(_0x55b410){if(_0x55b410){return _0x55b410?{'count':_0x589128,'rows':_0x55b410}:null;}})['then'](respondWithResult(_0x485000,null))[_0x5c34('0x26')](handleError(_0x485000,null));};exports[_0x5c34('0x56')]=function(_0x59166e,_0x457f90){var _0x20c16f=_0x59166e['body']['ids'];return db[_0x5c34('0x57')]['findAll']({'where':{'id':_0x20c16f},'attributes':['id'],'include':[{'model':db[_0x5c34('0x4c')],'as':'Agents','attributes':['id',_0x5c34('0x1a'),'online',_0x5c34('0x58'),_0x5c34('0x59')],'raw':!![]}]})[_0x5c34('0x18')](function(_0x529f8a){if(_0x529f8a){var _0x12fefd=_[_0x5c34('0x5a')](_0x529f8a,function(_0x40317d){var _0x489a85=_0x40317d[_0x5c34('0x36')]({'plain':!![]});return _0x489a85[_0x5c34('0x5b')];});return db['ChatQueue']['find']({'where':{'id':_0x59166e['params']['id']}})['then'](function(_0x54adbd){return db[_0x5c34('0x5c')][_0x5c34('0x5d')](function(_0x421921){return _0x54adbd[_0x5c34('0x56')](_0x20c16f,{'transaction':_0x421921})[_0x5c34('0x18')](function(){return BPromise[_0x5c34('0x5e')](_0x12fefd,function(_0x234944){return db[_0x5c34('0x44')][_0x5c34('0x5f')]({'where':{'UserId':_0x234944['id'],'ChatQueueId':_0x59166e[_0x5c34('0x28')]['id']},'transaction':_0x421921});});})[_0x5c34('0x18')](function(){_0x12fefd[_0x5c34('0x60')](function(_0x22d323){socket['emit'](_0x5c34('0x61'),{'UserId':_0x22d323['id'],'ChatQueueId':_0x54adbd['id']});});});});});}})[_0x5c34('0x18')](respondWithStatusCode(_0x457f90,null))[_0x5c34('0x26')](handleError(_0x457f90,null));};exports[_0x5c34('0x62')]=function(_0x50a783,_0x2fd187){return db[_0x5c34('0x57')][_0x5c34('0x24')]({'where':{'id':_0x50a783[_0x5c34('0x23')][_0x5c34('0x63')]},'attributes':['id'],'include':[{'model':db[_0x5c34('0x4c')],'as':_0x5c34('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x5c34('0x18')](handleEntityNotFound(_0x2fd187,null))[_0x5c34('0x18')](function(_0x59845d){var _0x35f14c=_[_0x5c34('0x1c')](_0x59845d,'id');var _0x5a079b=[];var _0x43ad93=[];var _0x109fb5=squel[_0x5c34('0x64')]();_0x109fb5[_0x5c34('0x65')]('tq.TeamId')[_0x5c34('0x66')](_0x5c34('0x67'),'tq')[_0x5c34('0x68')](_0x5c34('0x69'),'ut',_0x5c34('0x6a'))[_0x5c34('0x21')](_0x5c34('0x6b'),_0x50a783[_0x5c34('0x28')]['id']);for(var _0x3b6d2a=0x0;_0x3b6d2a<_0x59845d[_0x5c34('0x2e')];_0x3b6d2a+=0x1){let _0x3108f5=_0x59845d[_0x3b6d2a];for(var _0xce9f32=0x0;_0xce9f32<_0x3108f5[_0x5c34('0x5b')]['length'];_0xce9f32+=0x1){let _0x381439=_0x3108f5[_0x5c34('0x5b')][_0xce9f32];var _0x31f58b=_0x109fb5['clone']();_0x31f58b['where'](_0x5c34('0x6c'),_0x381439['id']);_0x43ad93[_0x5c34('0x6d')](db[_0x5c34('0x5c')][_0x5c34('0x23')](_0x31f58b[_0x5c34('0x6e')](),{'type':db['sequelize'][_0x5c34('0x6f')][_0x5c34('0x70')]})[_0x5c34('0x18')](function(_0x5dd622){if(_0x5dd622[_0x5c34('0x2e')]===0x1){return _0x381439['id'];}else{var _0x17ae92=_['every'](_[_0x5c34('0x1c')](_0x5dd622,'TeamId'),function(_0xa47491){return _['includes'](_0x35f14c,_0xa47491);});if(_0x17ae92){return _0x381439['id'];}}}));}}return BPromise[_0x5c34('0x71')](_0x43ad93)[_0x5c34('0x18')](function(_0x279a26){_0x5a079b=_(_0x5a079b)[_0x5c34('0x72')](_0x279a26)['compact']()[_0x5c34('0x73')]();return db[_0x5c34('0x1d')][_0x5c34('0x32')]({'where':{'id':_0x50a783['params']['id']}})[_0x5c34('0x18')](function(_0x584e0a){return db[_0x5c34('0x5c')][_0x5c34('0x5d')](function(_0x1ae9ea){return _0x584e0a[_0x5c34('0x62')](_0x50a783[_0x5c34('0x23')][_0x5c34('0x63')],{'transaction':_0x1ae9ea})['then'](function(){if(!_['isEmpty'](_0x5a079b)){return _0x584e0a[_0x5c34('0x74')](_0x5a079b,{'transaction':_0x1ae9ea});}})[_0x5c34('0x18')](function(){_0x5a079b['forEach'](function(_0x1d8872){socket[_0x5c34('0x75')](_0x5c34('0x76'),{'UserId':_0x1d8872,'ChatQueueId':_0x584e0a['id']});});});});});});})['then'](respondWithStatusCode(_0x2fd187,null))[_0x5c34('0x26')](handleError(_0x2fd187,null));};exports['addAgents']=function(_0x8f3380,_0x2fe01a){return db[_0x5c34('0x1d')][_0x5c34('0x32')]({'where':{'id':_0x8f3380[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x2fe01a,null))[_0x5c34('0x18')](function(_0x533eb5){if(_0x533eb5){return _0x533eb5[_0x5c34('0x77')](_0x8f3380[_0x5c34('0x34')][_0x5c34('0x63')],_[_0x5c34('0x78')](_0x8f3380[_0x5c34('0x34')],[_0x5c34('0x63'),'id'])||{})[_0x5c34('0x79')](function(_0x3f5953){for(var _0x3401ce=0x0;_0x3401ce<_0x8f3380[_0x5c34('0x34')][_0x5c34('0x63')][_0x5c34('0x2e')];_0x3401ce+=0x1){socket[_0x5c34('0x75')](_0x5c34('0x61'),{'UserId':Number(_0x8f3380[_0x5c34('0x34')]['ids'][_0x3401ce]),'ChatQueueId':Number(_0x8f3380[_0x5c34('0x28')]['id'])});}return _0x3f5953;});}})[_0x5c34('0x18')](respondWithResult(_0x2fe01a,null))[_0x5c34('0x26')](handleError(_0x2fe01a,null));};exports[_0x5c34('0x74')]=function(_0x9355dd,_0x5e563c){return db['ChatQueue'][_0x5c34('0x32')]({'where':{'id':_0x9355dd[_0x5c34('0x28')]['id']}})[_0x5c34('0x18')](handleEntityNotFound(_0x5e563c,null))['then'](function(_0x5cd3a7){if(_0x5cd3a7){return _0x5cd3a7[_0x5c34('0x74')](_0x9355dd[_0x5c34('0x23')]['ids'])['then'](function(){if(_[_0x5c34('0x7a')](_0x9355dd[_0x5c34('0x23')]['ids'])){for(var _0x4da249=0x0;_0x4da249<_0x9355dd[_0x5c34('0x23')]['ids'][_0x5c34('0x2e')];_0x4da249+=0x1){socket[_0x5c34('0x75')](_0x5c34('0x76'),{'UserId':Number(_0x9355dd[_0x5c34('0x23')][_0x5c34('0x63')][_0x4da249]),'ChatQueueId':Number(_0x9355dd['params']['id'])});}}else{socket[_0x5c34('0x75')]('userChatQueue:remove',{'UserId':Number(_0x9355dd['query'][_0x5c34('0x63')]),'ChatQueueId':Number(_0x9355dd[_0x5c34('0x28')]['id'])});}});}})[_0x5c34('0x18')](respondWithStatusCode(_0x5e563c,null))[_0x5c34('0x26')](handleError(_0x5e563c,null));};exports[_0x5c34('0x7b')]=function(_0x4c7ec5,_0x144579){var _0x1c7125={};var _0x2a1454={};var _0x17ca7d;var _0xc6f01d;return db[_0x5c34('0x1d')][_0x5c34('0x42')]({'where':{'id':_0x4c7ec5[_0x5c34('0x28')]['id']}})['then'](handleEntityNotFound(_0x144579,null))[_0x5c34('0x18')](function(_0x453f05){if(_0x453f05){_0x17ca7d=_0x453f05;_0x2a1454[_0x5c34('0x2c')]=_[_0x5c34('0x43')](db[_0x5c34('0x4c')]['rawAttributes']);_0x2a1454[_0x5c34('0x23')]=_[_0x5c34('0x43')](_0x4c7ec5[_0x5c34('0x23')]);_0x2a1454[_0x5c34('0x29')]=_[_0x5c34('0x2a')](_0x2a1454['model'],_0x2a1454[_0x5c34('0x23')]);_0x1c7125[_0x5c34('0x2b')]=_[_0x5c34('0x2a')](_0x2a1454['model'],qs[_0x5c34('0x2d')](_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x2d')]));_0x1c7125[_0x5c34('0x2b')]=_0x1c7125['attributes'][_0x5c34('0x2e')]?_0x1c7125['attributes']:_0x2a1454[_0x5c34('0x2c')];_0x1c7125[_0x5c34('0x47')]=qs[_0x5c34('0x48')](_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x48')]);_0x1c7125['where']=qs['filters'](_[_0x5c34('0x49')](_0x4c7ec5[_0x5c34('0x23')],_0x2a1454[_0x5c34('0x29')]));if(_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x4b')]){_0x1c7125['where']=_[_0x5c34('0x30')](_0x1c7125['where'],{'$or':_['map'](_0x1c7125['attributes'],function(_0x4eb074){var _0x2713cd={};_0x2713cd[_0x4eb074]={'$like':'%'+_0x4c7ec5[_0x5c34('0x23')]['filter']+'%'};return _0x2713cd;})});}_0x1c7125=_['merge']({},_0x1c7125,_0x4c7ec5['options']);return _0x17ca7d[_0x5c34('0x7b')](_0x1c7125);}})[_0x5c34('0x18')](function(_0x47fa0e){if(_0x47fa0e){_0xc6f01d=_0x47fa0e[_0x5c34('0x2e')];if(!_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x45')](_0x5c34('0x46'))){_0x1c7125[_0x5c34('0x11')]=qs[_0x5c34('0x11')](_0x4c7ec5[_0x5c34('0x23')]['limit']);_0x1c7125[_0x5c34('0x10')]=qs[_0x5c34('0x10')](_0x4c7ec5[_0x5c34('0x23')][_0x5c34('0x10')]);}return _0x17ca7d[_0x5c34('0x7b')](_0x1c7125);}})[_0x5c34('0x18')](function(_0x581e82){if(_0x581e82){return _0x581e82?{'count':_0xc6f01d,'rows':_0x581e82}:null;}})['then'](respondWithResult(_0x144579,null))[_0x5c34('0x26')](handleError(_0x144579,null));};
\ No newline at end of file
+var _0x115a=['spread','emit','userChatQueue:save','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','then','ChatQueues','UserProfileResource','end','error','name','send','ChatQueue','fieldName','type','key','getOptions','include','rows','catch','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','create','body','user','role','UserProfileSection','describe','findOne','get','UserChatQueue','hasOwnProperty','order','sort','where','ChatQueueId','filter','map','options','findAll','User','findAndCountAll','agent','updatedAt','format','%s/%s','chatPause','Team','pick','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','every','TeamId','includes','union','compact','value','find','isEmpty','removeAgents','userChatQueue:remove','addAgents'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0x115a,0x1d1));var _0xa115=function(_0x3a5e13,_0x3b89c6){_0x3a5e13=_0x3a5e13-0x0;var _0xe67c37=_0x115a[_0x3a5e13];return _0xe67c37;};'use strict';var BPromise=require(_0xa115('0x0'));var util=require(_0xa115('0x1'));var _=require(_0xa115('0x2'));var squel=require(_0xa115('0x3'));var Redis=require('ioredis');var qs=require(_0xa115('0x4'));var logger=require(_0xa115('0x5'))('api');var config=require('../../config/environment');var db=require(_0xa115('0x6'))['db'];config[_0xa115('0x7')]=_['defaults'](config['redis'],{'host':_0xa115('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa115('0x7')]));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x51440b,_0x24a5ba){_0x24a5ba=_0x24a5ba||0xcc;return function(_0x3fd2a2){if(_0x3fd2a2){return _0x51440b[_0xa115('0x9')](_0x24a5ba);}return _0x51440b[_0xa115('0xa')](_0x24a5ba)['end']();};}function respondWithResult(_0x225b46,_0x40e14d){_0x40e14d=_0x40e14d||0xc8;return function(_0x35b61c){if(_0x35b61c){return _0x225b46['status'](_0x40e14d)['json'](_0x35b61c);}};}function respondWithFilteredResult(_0x2b6441,_0x27864e){return function(_0x60f9b){if(_0x60f9b){var _0x4e0660=typeof _0x27864e[_0xa115('0xb')]==='undefined'&&typeof _0x27864e['limit']===_0xa115('0xc');var _0x4ffe54=_0x60f9b[_0xa115('0xd')];var _0x46e550=_0x4e0660?0x0:_0x27864e['offset'];var _0x2d1432=_0x4e0660?_0x60f9b[_0xa115('0xd')]:_0x27864e[_0xa115('0xb')]+_0x27864e[_0xa115('0xe')];var _0x41a46f;if(_0x2d1432>=_0x4ffe54){_0x2d1432=_0x4ffe54;_0x41a46f=0xc8;}else{_0x41a46f=0xce;}_0x2b6441[_0xa115('0xa')](_0x41a46f);return _0x2b6441[_0xa115('0xf')](_0xa115('0x10'),_0x46e550+'-'+_0x2d1432+'/'+_0x4ffe54)[_0xa115('0x11')](_0x60f9b);}return null;};}function saveUpdates(_0x2d07fd){return function(_0x3c58f1){if(_0x3c58f1){return _0x3c58f1[_0xa115('0x12')](_0x2d07fd)['then'](function(_0x26d328){return _0x26d328;});}return null;};}function removeEntity(_0x86fed3){return function(_0x183e6e){if(_0x183e6e){return _0x183e6e[_0xa115('0x13')]()[_0xa115('0x14')](function(){var _0x3514ac=_0x183e6e['get']({'plain':!![]});var _0x2d2bf5=_0xa115('0x15');return db[_0xa115('0x16')]['destroy']({'where':{'type':_0x2d2bf5,'resourceId':_0x3514ac['id']}})[_0xa115('0x14')](function(){return _0x183e6e;});})[_0xa115('0x14')](function(){_0x86fed3[_0xa115('0xa')](0xcc)[_0xa115('0x17')]();});}};}function handleEntityNotFound(_0x504d7c){return function(_0x3a620a){if(!_0x3a620a){_0x504d7c[_0xa115('0x9')](0x194);}return _0x3a620a;};}function handleError(_0x54a4ad,_0x28593d){_0x28593d=_0x28593d||0x1f4;return function(_0x3c679f){logger[_0xa115('0x18')](_0x3c679f['stack']);if(_0x3c679f[_0xa115('0x19')]){delete _0x3c679f[_0xa115('0x19')];}_0x54a4ad[_0xa115('0xa')](_0x28593d)[_0xa115('0x1a')](_0x3c679f);};}exports['index']=function(_0x12415e,_0x40f0cf){var _0x452cd3={};var _0x41eec1={'count':0x0,'rows':[]};var _0x51a666=_['map'](db[_0xa115('0x1b')]['rawAttributes'],function(_0x4c977b){return{'name':_0x4c977b[_0xa115('0x1c')],'type':_0x4c977b[_0xa115('0x1d')][_0xa115('0x1e')]};});_0x452cd3=qs[_0xa115('0x1f')](_0x51a666,_0x12415e);var _0x1b1eca={'where':_0x452cd3['where']};return db[_0xa115('0x1b')]['count'](_0x1b1eca)[_0xa115('0x14')](function(_0x1d2d73){_0x41eec1['count']=_0x1d2d73;_0x452cd3[_0xa115('0x20')]=qs['include'](_0x12415e['query']);return db[_0xa115('0x1b')]['findAll'](_0x452cd3);})[_0xa115('0x14')](function(_0xd95335){_0x41eec1[_0xa115('0x21')]=_0xd95335;return _0x41eec1;})[_0xa115('0x14')](respondWithFilteredResult(_0x40f0cf,_0x452cd3))[_0xa115('0x22')](handleError(_0x40f0cf,null));};exports[_0xa115('0x23')]=function(_0x52794a,_0x407bf3){var _0x62d4e4={'raw':!![],'where':{'id':_0x52794a[_0xa115('0x24')]['id']}},_0x3f45e6={};_0x3f45e6[_0xa115('0x25')]=_[_0xa115('0x26')](db[_0xa115('0x1b')][_0xa115('0x27')]);_0x3f45e6[_0xa115('0x28')]=_[_0xa115('0x26')](_0x52794a['query']);_0x3f45e6[_0xa115('0x29')]=_[_0xa115('0x2a')](_0x3f45e6[_0xa115('0x25')],_0x3f45e6[_0xa115('0x28')]);_0x62d4e4[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0x3f45e6[_0xa115('0x25')],qs[_0xa115('0x2c')](_0x52794a[_0xa115('0x28')][_0xa115('0x2c')]));_0x62d4e4[_0xa115('0x2b')]=_0x62d4e4[_0xa115('0x2b')][_0xa115('0x2d')]?_0x62d4e4[_0xa115('0x2b')]:_0x3f45e6[_0xa115('0x25')];if(_0x52794a[_0xa115('0x28')]['includeAll']){_0x62d4e4[_0xa115('0x20')]=[{'all':!![]}];}_0x62d4e4=_[_0xa115('0x2e')]({},_0x62d4e4,_0x52794a['options']);return db[_0xa115('0x1b')]['find'](_0x62d4e4)[_0xa115('0x14')](handleEntityNotFound(_0x407bf3,null))[_0xa115('0x14')](respondWithResult(_0x407bf3,null))[_0xa115('0x22')](handleError(_0x407bf3,null));};exports[_0xa115('0x2f')]=function(_0x14f525,_0x11153d){return db['ChatQueue']['create'](_0x14f525[_0xa115('0x30')],{})[_0xa115('0x14')](function(_0x385d7b){var _0x243426=_0x14f525[_0xa115('0x31')]['get']({'plain':!![]});if(!_0x243426)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x243426[_0xa115('0x32')]===_0xa115('0x31')){var _0x241c74=_0x385d7b['get']({'plain':!![]});var _0x259d71='ChatQueues';return db[_0xa115('0x33')]['find']({'where':{'name':_0x259d71,'userProfileId':_0x243426['userProfileId']},'raw':!![]})[_0xa115('0x14')](function(_0x19a16b){if(_0x19a16b&&_0x19a16b['autoAssociation']===0x0){return db['UserProfileResource'][_0xa115('0x2f')]({'name':_0x241c74[_0xa115('0x19')],'resourceId':_0x241c74['id'],'type':_0x19a16b[_0xa115('0x19')],'sectionId':_0x19a16b['id']},{})[_0xa115('0x14')](function(){return _0x385d7b;});}else{return _0x385d7b;}})[_0xa115('0x22')](function(_0x465b5d){logger[_0xa115('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x465b5d);throw _0x465b5d;});}return _0x385d7b;})[_0xa115('0x14')](respondWithResult(_0x11153d,0xc9))[_0xa115('0x22')](handleError(_0x11153d,null));};exports[_0xa115('0x12')]=function(_0x136dc4,_0xe430d6){if(_0x136dc4[_0xa115('0x30')]['id']){delete _0x136dc4['body']['id'];}return db[_0xa115('0x1b')]['find']({'where':{'id':_0x136dc4[_0xa115('0x24')]['id']}})[_0xa115('0x14')](handleEntityNotFound(_0xe430d6,null))[_0xa115('0x14')](saveUpdates(_0x136dc4[_0xa115('0x30')],null))[_0xa115('0x14')](respondWithResult(_0xe430d6,null))[_0xa115('0x22')](handleError(_0xe430d6,null));};exports[_0xa115('0x13')]=function(_0x3b65c8,_0x5aa5ef){return db[_0xa115('0x1b')]['find']({'where':{'id':_0x3b65c8[_0xa115('0x24')]['id']}})[_0xa115('0x14')](handleEntityNotFound(_0x5aa5ef,null))[_0xa115('0x14')](removeEntity(_0x5aa5ef,null))[_0xa115('0x22')](handleError(_0x5aa5ef,null));};exports[_0xa115('0x34')]=function(_0x427663,_0x5b74ce){return db[_0xa115('0x1b')][_0xa115('0x34')]()[_0xa115('0x14')](respondWithResult(_0x5b74ce,null))[_0xa115('0x22')](handleError(_0x5b74ce,null));};exports['getMembers']=function(_0x113bc9,_0xdc88f9){var _0x4cff11={'raw':!![],'where':{}},_0x425e94={},_0x1c4080;return db[_0xa115('0x1b')][_0xa115('0x35')]({'where':{'id':_0x113bc9[_0xa115('0x24')]['id']}})[_0xa115('0x14')](handleEntityNotFound(_0xdc88f9,null))[_0xa115('0x14')](function(_0x51940b){if(_0x51940b){_0x1c4080=_0x51940b[_0xa115('0x36')]({'plain':!![]});_0x425e94[_0xa115('0x25')]=_[_0xa115('0x26')](db[_0xa115('0x37')][_0xa115('0x27')]);_0x425e94['query']=_[_0xa115('0x26')](_0x113bc9['query']);_0x425e94[_0xa115('0x29')]=_['intersection'](_0x425e94[_0xa115('0x25')],_0x425e94[_0xa115('0x28')]);_0x4cff11[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0x425e94['model'],qs[_0xa115('0x2c')](_0x113bc9['query'][_0xa115('0x2c')]));_0x4cff11['attributes']=_0x4cff11[_0xa115('0x2b')][_0xa115('0x2d')]?_0x4cff11[_0xa115('0x2b')]:_0x425e94[_0xa115('0x25')];if(!_0x113bc9[_0xa115('0x28')][_0xa115('0x38')]('nolimit')){_0x4cff11[_0xa115('0xe')]=qs[_0xa115('0xe')](_0x113bc9[_0xa115('0x28')][_0xa115('0xe')]);_0x4cff11['offset']=qs[_0xa115('0xb')](_0x113bc9[_0xa115('0x28')]['offset']);}_0x4cff11[_0xa115('0x39')]=qs[_0xa115('0x3a')](_0x113bc9['query']['sort']);_0x4cff11['where']=qs['filters'](_['pick'](_0x113bc9[_0xa115('0x28')],_0x425e94[_0xa115('0x29')]));_0x4cff11[_0xa115('0x3b')][_0xa115('0x3c')]=_0x51940b['id'];if(_0x113bc9[_0xa115('0x28')][_0xa115('0x3d')]){_0x4cff11[_0xa115('0x3b')]=_[_0xa115('0x2e')](_0x4cff11[_0xa115('0x3b')],{'$or':_[_0xa115('0x3e')](_0x4cff11[_0xa115('0x2b')],function(_0x267e6b){var _0x3fd5c3={};_0x3fd5c3[_0x267e6b]={'$like':'%'+_0x113bc9[_0xa115('0x28')][_0xa115('0x3d')]+'%'};return _0x3fd5c3;})});}_0x4cff11=_[_0xa115('0x2e')]({},_0x4cff11,_0x113bc9[_0xa115('0x3f')]);return db[_0xa115('0x37')][_0xa115('0x40')](_0x4cff11);}})[_0xa115('0x14')](function(_0x28f64d){if(_0x28f64d){return db[_0xa115('0x41')][_0xa115('0x42')]({'where':{'id':_['map'](_0x28f64d,'UserId'),'role':_0xa115('0x43')},'attributes':['id',_0xa115('0x19'),'chatPause',_0xa115('0x44'),'createdAt']});}})[_0xa115('0x14')](function(_0x2ba5d5){if(_0x2ba5d5){return{'count':_0x2ba5d5[_0xa115('0xd')],'rows':_[_0xa115('0x3e')](_0x2ba5d5[_0xa115('0x21')],function(_0x1f58cf){return{'membername':_0x1f58cf[_0xa115('0x19')],'UserId':_0x1f58cf['id'],'queue_name':_0x1c4080['name'],'ChatQueueId':_0x1c4080['id'],'interface':util[_0xa115('0x45')](_0xa115('0x46'),'SIP',_0x1f58cf[_0xa115('0x19')]),'penalty':0x0,'paused':_0x1f58cf[_0xa115('0x47')],'createdAt':_0x1f58cf['createdAt'],'updatedAt':_0x1f58cf[_0xa115('0x44')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa115('0x14')](respondWithFilteredResult(_0xdc88f9,_0x4cff11))[_0xa115('0x22')](handleError(_0xdc88f9,null));};exports['getTeams']=function(_0x957ace,_0xe4961e){var _0x746d54={};var _0xed6839={};var _0x191ccc;var _0x585a7f;return db[_0xa115('0x1b')][_0xa115('0x35')]({'where':{'id':_0x957ace['params']['id']}})[_0xa115('0x14')](handleEntityNotFound(_0xe4961e,null))[_0xa115('0x14')](function(_0x385498){if(_0x385498){_0x191ccc=_0x385498;_0xed6839[_0xa115('0x25')]=_['keys'](db[_0xa115('0x48')][_0xa115('0x27')]);_0xed6839[_0xa115('0x28')]=_['keys'](_0x957ace[_0xa115('0x28')]);_0xed6839[_0xa115('0x29')]=_[_0xa115('0x2a')](_0xed6839['model'],_0xed6839[_0xa115('0x28')]);_0x746d54[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0xed6839[_0xa115('0x25')],qs[_0xa115('0x2c')](_0x957ace[_0xa115('0x28')]['fields']));_0x746d54[_0xa115('0x2b')]=_0x746d54['attributes'][_0xa115('0x2d')]?_0x746d54[_0xa115('0x2b')]:_0xed6839['model'];_0x746d54[_0xa115('0x39')]=qs[_0xa115('0x3a')](_0x957ace[_0xa115('0x28')][_0xa115('0x3a')]);_0x746d54['where']=qs[_0xa115('0x29')](_[_0xa115('0x49')](_0x957ace[_0xa115('0x28')],_0xed6839[_0xa115('0x29')]));if(_0x957ace[_0xa115('0x28')][_0xa115('0x3d')]){_0x746d54['where']=_[_0xa115('0x2e')](_0x746d54[_0xa115('0x3b')],{'$or':_[_0xa115('0x3e')](_0x746d54[_0xa115('0x2b')],function(_0x3d0c6b){var _0x55beb9={};_0x55beb9[_0x3d0c6b]={'$like':'%'+_0x957ace[_0xa115('0x28')][_0xa115('0x3d')]+'%'};return _0x55beb9;})});}_0x746d54=_[_0xa115('0x2e')]({},_0x746d54,_0x957ace[_0xa115('0x3f')]);return _0x191ccc[_0xa115('0x4a')](_0x746d54);}})[_0xa115('0x14')](function(_0x29ede4){if(_0x29ede4){_0x585a7f=_0x29ede4[_0xa115('0x2d')];if(!_0x957ace[_0xa115('0x28')][_0xa115('0x38')](_0xa115('0x4b'))){_0x746d54['limit']=qs[_0xa115('0xe')](_0x957ace[_0xa115('0x28')][_0xa115('0xe')]);_0x746d54[_0xa115('0xb')]=qs[_0xa115('0xb')](_0x957ace[_0xa115('0x28')][_0xa115('0xb')]);}return _0x191ccc[_0xa115('0x4a')](_0x746d54);}})[_0xa115('0x14')](function(_0xca918f){if(_0xca918f){return _0xca918f?{'count':_0x585a7f,'rows':_0xca918f}:null;}})['then'](respondWithResult(_0xe4961e,null))[_0xa115('0x22')](handleError(_0xe4961e,null));};exports[_0xa115('0x4c')]=function(_0x8845a0,_0x5e2b2f){var _0x1c9fcc=_0x8845a0[_0xa115('0x30')][_0xa115('0x4d')];return db[_0xa115('0x48')][_0xa115('0x40')]({'where':{'id':_0x1c9fcc},'attributes':['id'],'include':[{'model':db[_0xa115('0x41')],'as':_0xa115('0x4e'),'attributes':['id',_0xa115('0x19'),_0xa115('0x4f'),_0xa115('0x50'),_0xa115('0x51')],'raw':!![]}]})['then'](function(_0xa70db9){if(_0xa70db9){var _0x101f92=_[_0xa115('0x52')](_0xa70db9,function(_0x4dde33){var _0x34d3a7=_0x4dde33[_0xa115('0x36')]({'plain':!![]});return _0x34d3a7[_0xa115('0x4e')];});return db[_0xa115('0x1b')]['find']({'where':{'id':_0x8845a0[_0xa115('0x24')]['id']}})[_0xa115('0x14')](function(_0x59bf81){return db[_0xa115('0x53')][_0xa115('0x54')](function(_0x41b5e4){return _0x59bf81[_0xa115('0x4c')](_0x1c9fcc,{'transaction':_0x41b5e4})[_0xa115('0x14')](function(){return BPromise[_0xa115('0x55')](_0x101f92,function(_0x2a6274){return db['UserChatQueue'][_0xa115('0x56')]({'where':{'UserId':_0x2a6274['id'],'ChatQueueId':_0x8845a0[_0xa115('0x24')]['id']},'transaction':_0x41b5e4});});})['then'](function(){_0x101f92[_0xa115('0x57')](function(_0x29ddc9){socket['emit']('userChatQueue:save',{'UserId':_0x29ddc9['id'],'ChatQueueId':_0x59bf81['id']});});});});});}})['then'](respondWithStatusCode(_0x5e2b2f,null))['catch'](handleError(_0x5e2b2f,null));};exports[_0xa115('0x58')]=function(_0x22f7e0,_0x18b0c6){return db[_0xa115('0x48')]['findAll']({'where':{'id':_0x22f7e0[_0xa115('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa115('0x41')],'as':_0xa115('0x4e'),'attributes':['id'],'raw':!![]}]})[_0xa115('0x14')](handleEntityNotFound(_0x18b0c6,null))[_0xa115('0x14')](function(_0x46baae){var _0x1da862=_['map'](_0x46baae,'id');var _0x354c0e=[];var _0x5a45ab=[];var _0x40113c=squel[_0xa115('0x59')]();_0x40113c[_0xa115('0x5a')](_0xa115('0x5b'))[_0xa115('0x5c')](_0xa115('0x5d'),'tq')[_0xa115('0x5e')](_0xa115('0x5f'),'ut',_0xa115('0x60'))['where']('ChatQueueId\x20=\x20?',_0x22f7e0['params']['id']);for(var _0x573ea4=0x0;_0x573ea4<_0x46baae[_0xa115('0x2d')];_0x573ea4+=0x1){let _0x4645a7=_0x46baae[_0x573ea4];for(var _0xe96020=0x0;_0xe96020<_0x4645a7[_0xa115('0x4e')][_0xa115('0x2d')];_0xe96020+=0x1){let _0x4702c6=_0x4645a7['Agents'][_0xe96020];var _0x10a149=_0x40113c['clone']();_0x10a149[_0xa115('0x3b')](_0xa115('0x61'),_0x4702c6['id']);_0x5a45ab[_0xa115('0x62')](db[_0xa115('0x53')][_0xa115('0x28')](_0x10a149['toString'](),{'type':db[_0xa115('0x53')]['QueryTypes']['SELECT']})[_0xa115('0x14')](function(_0x14d7f4){if(_0x14d7f4[_0xa115('0x2d')]===0x1){return _0x4702c6['id'];}else{var _0x383c34=_[_0xa115('0x63')](_['map'](_0x14d7f4,_0xa115('0x64')),function(_0x8f2f29){return _[_0xa115('0x65')](_0x1da862,_0x8f2f29);});if(_0x383c34){return _0x4702c6['id'];}}}));}}return BPromise['all'](_0x5a45ab)[_0xa115('0x14')](function(_0x43dea5){_0x354c0e=_(_0x354c0e)[_0xa115('0x66')](_0x43dea5)[_0xa115('0x67')]()[_0xa115('0x68')]();return db[_0xa115('0x1b')][_0xa115('0x69')]({'where':{'id':_0x22f7e0[_0xa115('0x24')]['id']}})[_0xa115('0x14')](function(_0x2a3693){return db['sequelize'][_0xa115('0x54')](function(_0x2dfb31){return _0x2a3693[_0xa115('0x58')](_0x22f7e0[_0xa115('0x28')][_0xa115('0x4d')],{'transaction':_0x2dfb31})[_0xa115('0x14')](function(){if(!_[_0xa115('0x6a')](_0x354c0e)){return _0x2a3693[_0xa115('0x6b')](_0x354c0e,{'transaction':_0x2dfb31});}})[_0xa115('0x14')](function(){_0x354c0e[_0xa115('0x57')](function(_0x5ee327){socket['emit'](_0xa115('0x6c'),{'UserId':_0x5ee327,'ChatQueueId':_0x2a3693['id']});});});});});});})[_0xa115('0x14')](respondWithStatusCode(_0x18b0c6,null))['catch'](handleError(_0x18b0c6,null));};exports['addAgents']=function(_0x2adc87,_0x133f84){return db[_0xa115('0x1b')][_0xa115('0x69')]({'where':{'id':_0x2adc87[_0xa115('0x24')]['id']}})['then'](handleEntityNotFound(_0x133f84,null))[_0xa115('0x14')](function(_0x2d8635){if(_0x2d8635){return _0x2d8635[_0xa115('0x6d')](_0x2adc87[_0xa115('0x30')]['ids'],_['omit'](_0x2adc87[_0xa115('0x30')],['ids','id'])||{})[_0xa115('0x6e')](function(_0x3d2ee2){for(var _0x53bf58=0x0;_0x53bf58<_0x2adc87[_0xa115('0x30')][_0xa115('0x4d')][_0xa115('0x2d')];_0x53bf58+=0x1){socket[_0xa115('0x6f')](_0xa115('0x70'),{'UserId':Number(_0x2adc87['body'][_0xa115('0x4d')][_0x53bf58]),'ChatQueueId':Number(_0x2adc87['params']['id'])});}return _0x3d2ee2;});}})['then'](respondWithResult(_0x133f84,null))[_0xa115('0x22')](handleError(_0x133f84,null));};exports[_0xa115('0x6b')]=function(_0x301a7c,_0x2e274b){return db[_0xa115('0x1b')][_0xa115('0x69')]({'where':{'id':_0x301a7c['params']['id']}})[_0xa115('0x14')](handleEntityNotFound(_0x2e274b,null))['then'](function(_0x3e4618){if(_0x3e4618){return _0x3e4618[_0xa115('0x6b')](_0x301a7c['query'][_0xa115('0x4d')])['then'](function(){if(_[_0xa115('0x71')](_0x301a7c[_0xa115('0x28')][_0xa115('0x4d')])){for(var _0x14738b=0x0;_0x14738b<_0x301a7c[_0xa115('0x28')][_0xa115('0x4d')][_0xa115('0x2d')];_0x14738b+=0x1){socket['emit'](_0xa115('0x6c'),{'UserId':Number(_0x301a7c[_0xa115('0x28')]['ids'][_0x14738b]),'ChatQueueId':Number(_0x301a7c['params']['id'])});}}else{socket[_0xa115('0x6f')](_0xa115('0x6c'),{'UserId':Number(_0x301a7c[_0xa115('0x28')][_0xa115('0x4d')]),'ChatQueueId':Number(_0x301a7c[_0xa115('0x24')]['id'])});}});}})[_0xa115('0x14')](respondWithStatusCode(_0x2e274b,null))[_0xa115('0x22')](handleError(_0x2e274b,null));};exports[_0xa115('0x72')]=function(_0x1d004b,_0x241791){var _0x568615={};var _0x470925={};var _0x34417e;var _0x5a2832;return db[_0xa115('0x1b')][_0xa115('0x35')]({'where':{'id':_0x1d004b[_0xa115('0x24')]['id']}})['then'](handleEntityNotFound(_0x241791,null))['then'](function(_0x318a58){if(_0x318a58){_0x34417e=_0x318a58;_0x470925[_0xa115('0x25')]=_[_0xa115('0x26')](db[_0xa115('0x41')][_0xa115('0x27')]);_0x470925[_0xa115('0x28')]=_[_0xa115('0x26')](_0x1d004b['query']);_0x470925[_0xa115('0x29')]=_[_0xa115('0x2a')](_0x470925[_0xa115('0x25')],_0x470925[_0xa115('0x28')]);_0x568615[_0xa115('0x2b')]=_[_0xa115('0x2a')](_0x470925[_0xa115('0x25')],qs[_0xa115('0x2c')](_0x1d004b[_0xa115('0x28')]['fields']));_0x568615['attributes']=_0x568615[_0xa115('0x2b')]['length']?_0x568615['attributes']:_0x470925[_0xa115('0x25')];_0x568615['order']=qs[_0xa115('0x3a')](_0x1d004b['query']['sort']);_0x568615[_0xa115('0x3b')]=qs['filters'](_[_0xa115('0x49')](_0x1d004b[_0xa115('0x28')],_0x470925[_0xa115('0x29')]));if(_0x1d004b[_0xa115('0x28')]['filter']){_0x568615['where']=_['merge'](_0x568615['where'],{'$or':_[_0xa115('0x3e')](_0x568615['attributes'],function(_0x5c622e){var _0x4e9575={};_0x4e9575[_0x5c622e]={'$like':'%'+_0x1d004b[_0xa115('0x28')][_0xa115('0x3d')]+'%'};return _0x4e9575;})});}_0x568615=_[_0xa115('0x2e')]({},_0x568615,_0x1d004b[_0xa115('0x3f')]);return _0x34417e[_0xa115('0x72')](_0x568615);}})['then'](function(_0x29ce60){if(_0x29ce60){_0x5a2832=_0x29ce60[_0xa115('0x2d')];if(!_0x1d004b['query'][_0xa115('0x38')]('nolimit')){_0x568615[_0xa115('0xe')]=qs['limit'](_0x1d004b['query'][_0xa115('0xe')]);_0x568615['offset']=qs[_0xa115('0xb')](_0x1d004b['query'][_0xa115('0xb')]);}return _0x34417e[_0xa115('0x72')](_0x568615);}})[_0xa115('0x14')](function(_0x797ca){if(_0x797ca){return _0x797ca?{'count':_0x5a2832,'rows':_0x797ca}:null;}})['then'](respondWithResult(_0x241791,null))[_0xa115('0x22')](handleError(_0x241791,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1ac3a58..c093031 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 _0xda3d=['ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x423c82,_0x5293c6){var _0x25104c=function(_0x170f3e){while(--_0x170f3e){_0x423c82['push'](_0x423c82['shift']());}};_0x25104c(++_0x5293c6);}(_0xda3d,0x10f));var _0xdda3=function(_0x10e87a,_0x2739db){_0x10e87a=_0x10e87a-0x0;var _0x3008e7=_0xda3d[_0x10e87a];return _0x3008e7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xdda3('0x0'))['db'][_0xdda3('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdda3('0x2')](0x0);var events={'afterCreate':_0xdda3('0x3'),'afterUpdate':_0xdda3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x297c60){return function(_0x5af04e,_0x3f5a28,_0x10a555){ChatQueueEvents[_0xdda3('0x5')](_0x297c60+':'+_0x5af04e['id'],_0x5af04e);ChatQueueEvents['emit'](_0x297c60,_0x5af04e);_0x10a555(null);};}for(var e in events){if(events[_0xdda3('0x6')](e)){var event=events[e];ChatQueue[_0xdda3('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x0bca=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','update'];(function(_0x57bc96,_0x445aeb){var _0x56351f=function(_0x13515c){while(--_0x13515c){_0x57bc96['push'](_0x57bc96['shift']());}};_0x56351f(++_0x445aeb);}(_0x0bca,0xa7));var _0xa0bc=function(_0x207a0a,_0x10eceb){_0x207a0a=_0x207a0a-0x0;var _0x50445c=_0x0bca[_0x207a0a];return _0x50445c;};'use strict';var EventEmitter=require(_0xa0bc('0x0'));var ChatQueue=require(_0xa0bc('0x1'))['db'][_0xa0bc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0bc('0x3'),'afterDestroy':_0xa0bc('0x4')};function emitEvent(_0x529431){return function(_0x4c76a5,_0x549f88,_0xff60c0){ChatQueueEvents[_0xa0bc('0x5')](_0x529431+':'+_0x4c76a5['id'],_0x4c76a5);ChatQueueEvents[_0xa0bc('0x5')](_0x529431,_0x4c76a5);_0xff60c0(null);};}for(var e in events){if(events[_0xa0bc('0x6')](e)){var event=events[e];ChatQueue[_0xa0bc('0x7')](e,emitEvent(event));}}module[_0xa0bc('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index efcb9cc..6086cda 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 _0xa38c=['exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatQueue.attributes'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xa38c,0x117));var _0xca38=function(_0x4b08d3,_0x176175){_0x4b08d3=_0x4b08d3-0x0;var _0x11a556=_0xa38c[_0x4b08d3];return _0x11a556;};'use strict';var _=require(_0xca38('0x0'));var util=require(_0xca38('0x1'));var logger=require(_0xca38('0x2'))(_0xca38('0x3'));var moment=require(_0xca38('0x4'));var BPromise=require(_0xca38('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca38('0x6'));var rimraf=require('rimraf');var config=require(_0xca38('0x7'));var attributes=require(_0xca38('0x8'));module[_0xca38('0x9')]=function(_0xf36a14,_0x21245d){return _0xf36a14['define'](_0xca38('0xa'),attributes,{'tableName':_0xca38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x540d=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3c2004,_0x113d1c){var _0xe7b655=function(_0x476065){while(--_0x476065){_0x3c2004['push'](_0x3c2004['shift']());}};_0xe7b655(++_0x113d1c);}(_0x540d,0x19f));var _0xd540=function(_0x5e8bcc,_0x4bc996){_0x5e8bcc=_0x5e8bcc-0x0;var _0x2c23da=_0x540d[_0x5e8bcc];return _0x2c23da;};'use strict';var _=require(_0xd540('0x0'));var util=require('util');var logger=require(_0xd540('0x1'))(_0xd540('0x2'));var moment=require(_0xd540('0x3'));var BPromise=require(_0xd540('0x4'));var rp=require(_0xd540('0x5'));var fs=require('fs');var path=require(_0xd540('0x6'));var rimraf=require(_0xd540('0x7'));var config=require(_0xd540('0x8'));var attributes=require(_0xd540('0x9'));module[_0xd540('0xa')]=function(_0x33ac9b,_0x266354){return _0x33ac9b[_0xd540('0xb')](_0xd540('0xc'),attributes,{'tableName':_0xd540('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index b00e842..72d239b 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 _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','attributes','limit','include','model','map','debug','where','ShowChatQueue'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xef0f,0x168));var _0xfef0=function(_0x9b49da,_0x343d7a){_0x9b49da=_0x9b49da-0x0;var _0x2b171b=_0xef0f[_0x9b49da];return _0x2b171b;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config['redis'],{'host':_0xfef0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0xb')]));require(_0xfef0('0xe'))[_0xfef0('0xf')](socket);function respondWithRpcPromise(_0x2d42dc,_0x334e74,_0x402dff){return new BPromise(function(_0xc177db,_0x4bd6f2){return client[_0xfef0('0x10')](_0x2d42dc,_0x402dff)[_0xfef0('0x11')](function(_0x410234){logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,_0xfef0('0x14'));logger['debug'](_0xfef0('0x15'),_0x334e74,_0xfef0('0x14'),JSON[_0xfef0('0x16')](_0x410234));if(_0x410234[_0xfef0('0x17')]){if(_0x410234[_0xfef0('0x17')][_0xfef0('0x18')]===0x1f4){logger[_0xfef0('0x17')]('ChatQueue,\x20%s,\x20%s',_0x334e74,_0x410234[_0xfef0('0x17')]['message']);return _0x4bd6f2(_0x410234['error']['message']);}logger[_0xfef0('0x17')](_0xfef0('0x13'),_0x334e74,_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);return _0xc177db(_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);}else{logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,'request\x20sent');_0xc177db(_0x410234[_0xfef0('0x1a')][_0xfef0('0x19')]);}})[_0xfef0('0x1b')](function(_0x39f9d3){logger[_0xfef0('0x17')]('ChatQueue,\x20%s,\x20%s',_0x334e74,_0x39f9d3);_0x4bd6f2(_0x39f9d3);});});}exports[_0xfef0('0x1c')]=function(_0x4e24de){var _0x20826b=this;return new Promise(function(_0x1a0aa0,_0x28dee1){return db['ChatQueue'][_0xfef0('0x1d')]({'raw':_0x4e24de['options']?_0x4e24de[_0xfef0('0x1e')][_0xfef0('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e24de['options']?_0x4e24de['options']['where']||null:null,'attributes':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de['options'][_0xfef0('0x20')]||null:null,'limit':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')][_0xfef0('0x21')]||null:null,'include':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')]['include']?_['map'](_0x4e24de[_0xfef0('0x1e')][_0xfef0('0x22')],function(_0x924f6e){return{'model':db[_0x924f6e[_0xfef0('0x23')]],'as':_0x924f6e['as'],'attributes':_0x924f6e[_0xfef0('0x20')],'include':_0x924f6e[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x924f6e[_0xfef0('0x22')],function(_0x391279){return{'model':db[_0x391279['model']],'as':_0x391279['as'],'attributes':_0x391279[_0xfef0('0x20')],'include':_0x391279[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x391279[_0xfef0('0x22')],function(_0x37921f){return{'model':db[_0x37921f[_0xfef0('0x23')]],'as':_0x37921f['as'],'attributes':_0x37921f[_0xfef0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0x11')](function(_0x26cb9a){logger[_0xfef0('0x12')](_0xfef0('0x1c'),_0x4e24de);logger[_0xfef0('0x25')]('GetChatQueue',_0x4e24de,JSON[_0xfef0('0x16')](_0x26cb9a));_0x1a0aa0(_0x26cb9a);})['catch'](function(_0x4eaf74){logger[_0xfef0('0x17')](_0xfef0('0x1c'),_0x4eaf74['message'],_0x4e24de);_0x28dee1(_0x20826b['error'](0x1f4,_0x4eaf74['message']));});});};exports['ShowChatQueue']=function(_0x4cce8a){var _0x417535=this;return new Promise(function(_0x172d94,_0x2fffae){return db['ChatQueue']['find']({'raw':_0x4cce8a['options']?_0x4cce8a[_0xfef0('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4cce8a[_0xfef0('0x1e')]?_0x4cce8a[_0xfef0('0x1e')][_0xfef0('0x26')]||null:null,'attributes':_0x4cce8a['options']?_0x4cce8a[_0xfef0('0x1e')]['attributes']||null:null,'include':_0x4cce8a[_0xfef0('0x1e')]?_0x4cce8a[_0xfef0('0x1e')][_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x4cce8a[_0xfef0('0x1e')][_0xfef0('0x22')],function(_0x92d420){return{'model':db[_0x92d420[_0xfef0('0x23')]],'as':_0x92d420['as'],'attributes':_0x92d420['attributes'],'include':_0x92d420[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x92d420[_0xfef0('0x22')],function(_0x36b2d1){return{'model':db[_0x36b2d1[_0xfef0('0x23')]],'as':_0x36b2d1['as'],'attributes':_0x36b2d1[_0xfef0('0x20')],'include':_0x36b2d1[_0xfef0('0x22')]?_[_0xfef0('0x24')](_0x36b2d1[_0xfef0('0x22')],function(_0x109d0f){return{'model':db[_0x109d0f[_0xfef0('0x23')]],'as':_0x109d0f['as'],'attributes':_0x109d0f[_0xfef0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0x11')](function(_0x4a8af4){logger[_0xfef0('0x12')]('ShowChatQueue',_0x4cce8a);logger[_0xfef0('0x25')](_0xfef0('0x27'),_0x4cce8a,JSON[_0xfef0('0x16')](_0x4a8af4));_0x172d94(_0x4a8af4);})['catch'](function(_0x3f1597){logger[_0xfef0('0x17')](_0xfef0('0x27'),_0x3f1597['message'],_0x4cce8a);_0x2fffae(_0x417535[_0xfef0('0x17')](0x1f4,_0x3f1597[_0xfef0('0x19')]));});});};
\ No newline at end of file
+var _0xe99c=['ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','options','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x4162e6,_0x3f2dfd){var _0x50b0fc=function(_0x3d1ba0){while(--_0x3d1ba0){_0x4162e6['push'](_0x4162e6['shift']());}};_0x50b0fc(++_0x3f2dfd);}(_0xe99c,0x197));var _0xce99=function(_0x29b00a,_0x3a8303){_0x29b00a=_0x29b00a-0x0;var _0x1451c5=_0xe99c[_0x29b00a];return _0x1451c5;};'use strict';var _=require(_0xce99('0x0'));var util=require('util');var moment=require(_0xce99('0x1'));var BPromise=require(_0xce99('0x2'));var rs=require(_0xce99('0x3'));var fs=require('fs');var Redis=require(_0xce99('0x4'));var db=require(_0xce99('0x5'))['db'];var utils=require(_0xce99('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xce99('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce99('0x8')]['http']({'port':0x232a});config[_0xce99('0x9')]=_[_0xce99('0xa')](config[_0xce99('0x9')],{'host':_0xce99('0xb'),'port':0x18eb});var socket=require(_0xce99('0xc'))(new Redis(config[_0xce99('0x9')]));require(_0xce99('0xd'))[_0xce99('0xe')](socket);function respondWithRpcPromise(_0x5727f2,_0x3ceb6f,_0xed09d1){return new BPromise(function(_0x4c7423,_0x26ac93){return client[_0xce99('0xf')](_0x5727f2,_0xed09d1)[_0xce99('0x10')](function(_0x57a7f0){logger[_0xce99('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3ceb6f,_0xce99('0x12'));logger[_0xce99('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3ceb6f,'request\x20sent',JSON[_0xce99('0x14')](_0x57a7f0));if(_0x57a7f0[_0xce99('0x15')]){if(_0x57a7f0[_0xce99('0x15')]['code']===0x1f4){logger['error'](_0xce99('0x16'),_0x3ceb6f,_0x57a7f0['error'][_0xce99('0x17')]);return _0x26ac93(_0x57a7f0['error'][_0xce99('0x17')]);}logger[_0xce99('0x15')](_0xce99('0x16'),_0x3ceb6f,_0x57a7f0['error']['message']);return _0x4c7423(_0x57a7f0[_0xce99('0x15')][_0xce99('0x17')]);}else{logger[_0xce99('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3ceb6f,_0xce99('0x12'));_0x4c7423(_0x57a7f0[_0xce99('0x18')][_0xce99('0x17')]);}})[_0xce99('0x19')](function(_0x3f2427){logger[_0xce99('0x15')](_0xce99('0x16'),_0x3ceb6f,_0x3f2427);_0x26ac93(_0x3f2427);});});}exports['GetChatQueue']=function(_0x1de34e){var _0x5444b9=this;return new Promise(function(_0x1d55f0,_0x1c79a9){return db[_0xce99('0x1a')][_0xce99('0x1b')]({'raw':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')]['where']||null:null,'attributes':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')][_0xce99('0x1d')]||null:null,'limit':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')][_0xce99('0x1e')]||null:null,'include':_0x1de34e[_0xce99('0x1c')]?_0x1de34e[_0xce99('0x1c')][_0xce99('0x1f')]?_[_0xce99('0x20')](_0x1de34e[_0xce99('0x1c')][_0xce99('0x1f')],function(_0x223863){return{'model':db[_0x223863[_0xce99('0x21')]],'as':_0x223863['as'],'attributes':_0x223863[_0xce99('0x1d')],'include':_0x223863[_0xce99('0x1f')]?_[_0xce99('0x20')](_0x223863[_0xce99('0x1f')],function(_0x17a30f){return{'model':db[_0x17a30f[_0xce99('0x21')]],'as':_0x17a30f['as'],'attributes':_0x17a30f['attributes'],'include':_0x17a30f['include']?_[_0xce99('0x20')](_0x17a30f[_0xce99('0x1f')],function(_0x4139e4){return{'model':db[_0x4139e4['model']],'as':_0x4139e4['as'],'attributes':_0x4139e4[_0xce99('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xce99('0x10')](function(_0x1ce793){logger['info']('GetChatQueue',_0x1de34e);logger[_0xce99('0x13')]('GetChatQueue',_0x1de34e,JSON[_0xce99('0x14')](_0x1ce793));_0x1d55f0(_0x1ce793);})['catch'](function(_0x2e2d7b){logger[_0xce99('0x15')](_0xce99('0x22'),_0x2e2d7b['message'],_0x1de34e);_0x1c79a9(_0x5444b9[_0xce99('0x15')](0x1f4,_0x2e2d7b[_0xce99('0x17')]));});});};exports[_0xce99('0x23')]=function(_0x4ac587){var _0x521a82=this;return new Promise(function(_0x118070,_0x5203af){return db[_0xce99('0x1a')][_0xce99('0x24')]({'raw':_0x4ac587[_0xce99('0x1c')]?_0x4ac587[_0xce99('0x1c')][_0xce99('0x25')]===undefined?!![]:![]:!![],'where':_0x4ac587[_0xce99('0x1c')]?_0x4ac587[_0xce99('0x1c')][_0xce99('0x26')]||null:null,'attributes':_0x4ac587['options']?_0x4ac587[_0xce99('0x1c')][_0xce99('0x1d')]||null:null,'include':_0x4ac587[_0xce99('0x1c')]?_0x4ac587[_0xce99('0x1c')]['include']?_[_0xce99('0x20')](_0x4ac587['options'][_0xce99('0x1f')],function(_0x22e889){return{'model':db[_0x22e889[_0xce99('0x21')]],'as':_0x22e889['as'],'attributes':_0x22e889['attributes'],'include':_0x22e889[_0xce99('0x1f')]?_[_0xce99('0x20')](_0x22e889[_0xce99('0x1f')],function(_0x338250){return{'model':db[_0x338250[_0xce99('0x21')]],'as':_0x338250['as'],'attributes':_0x338250[_0xce99('0x1d')],'include':_0x338250[_0xce99('0x1f')]?_[_0xce99('0x20')](_0x338250['include'],function(_0x3fc690){return{'model':db[_0x3fc690[_0xce99('0x21')]],'as':_0x3fc690['as'],'attributes':_0x3fc690['attributes']};}):[]};}):[]};}):[]:[]})[_0xce99('0x10')](function(_0x3642c0){logger[_0xce99('0x11')]('ShowChatQueue',_0x4ac587);logger[_0xce99('0x13')]('ShowChatQueue',_0x4ac587,JSON[_0xce99('0x14')](_0x3642c0));_0x118070(_0x3642c0);})[_0xce99('0x19')](function(_0x4061ee){logger[_0xce99('0x15')](_0xce99('0x23'),_0x4061ee[_0xce99('0x17')],_0x4ac587);_0x5203af(_0x521a82['error'](0x1f4,_0x4061ee[_0xce99('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 5ac766f..981855c 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 _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x5e3c81,_0x252f3a){var _0x5dc1e3=function(_0x54f55a){while(--_0x54f55a){_0x5e3c81['push'](_0x5e3c81['shift']());}};_0x5dc1e3(++_0x252f3a);}(_0x22fb,0x192));var _0xb22f=function(_0xe70ed2,_0x2a2748){_0xe70ed2=_0xe70ed2-0x0;var _0xfd3c2e=_0x22fb[_0xe70ed2];return _0xfd3c2e;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}};
\ No newline at end of file
+var _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x56a761,_0x9fce38){var _0x248e40=function(_0x3d438d){while(--_0x3d438d){_0x56a761['push'](_0x56a761['shift']());}};_0x248e40(++_0x9fce38);}(_0x9b67,0xf6));var _0x79b6=function(_0x28d018,_0x5c5125){_0x28d018=_0x28d018-0x0;var _0x2626ba=_0x9b67[_0x28d018];return _0x2626ba;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 67d8c3a..45da786 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(_0x462a81,_0x3ba80a){var _0x9dcafb=function(_0x596481){while(--_0x596481){_0x462a81['push'](_0x462a81['shift']());}};_0x9dcafb(++_0x3ba80a);}(_0x008c,0x188));var _0xc008=function(_0x5b1097,_0x3ed62f){_0x5b1097=_0x5b1097-0x0;var _0x57979c=_0x008c[_0x5b1097];return _0x57979c;};'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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x267ae4,_0x58c7cf){var _0x519990=function(_0x42b0f3){while(--_0x42b0f3){_0x267ae4['push'](_0x267ae4['shift']());}};_0x519990(++_0x58c7cf);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 83e4f3c..7b0555e 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 _0x6a0c=['DATE','moment','exports','STRING'];(function(_0x28cc1c,_0x820852){var _0xc1284c=function(_0x285e50){while(--_0x285e50){_0x28cc1c['push'](_0x28cc1c['shift']());}};_0xc1284c(++_0x820852);}(_0x6a0c,0xb5));var _0xc6a0=function(_0xa1c8d1,_0x41920c){_0xa1c8d1=_0xa1c8d1-0x0;var _0x2dbe18=_0x6a0c[_0xa1c8d1];return _0x2dbe18;};'use strict';var moment=require(_0xc6a0('0x0'));var Sequelize=require('sequelize');module[_0xc6a0('0x1')]={'uniqueid':{'type':Sequelize[_0xc6a0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc6a0('0x2')]},'joinAt':{'type':Sequelize[_0xc6a0('0x3')]},'leaveAt':{'type':Sequelize[_0xc6a0('0x3')]},'acceptAt':{'type':Sequelize[_0xc6a0('0x3')]},'exitAt':{'type':Sequelize[_0xc6a0('0x3')]},'reason':{'type':Sequelize[_0xc6a0('0x2')]}};
\ No newline at end of file
+var _0xb501=['STRING','DATE','moment','exports'];(function(_0x7bb463,_0x1b100f){var _0xf95e1b=function(_0x26661f){while(--_0x26661f){_0x7bb463['push'](_0x7bb463['shift']());}};_0xf95e1b(++_0x1b100f);}(_0xb501,0x1ce));var _0x1b50=function(_0x3bab7f,_0x291900){_0x3bab7f=_0x3bab7f-0x0;var _0xc0648=_0xb501[_0x3bab7f];return _0xc0648;};'use strict';var moment=require(_0x1b50('0x0'));var Sequelize=require('sequelize');module[_0x1b50('0x1')]={'uniqueid':{'type':Sequelize[_0x1b50('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1b50('0x3')]},'leaveAt':{'type':Sequelize[_0x1b50('0x3')]},'acceptAt':{'type':Sequelize[_0x1b50('0x3')]},'exitAt':{'type':Sequelize['DATE']},'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 3f05065..3e6436f 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 _0xa6b0=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','index','map','ChatQueueReport','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5c6022,_0x2f4397){_0x5c6022=_0x5c6022-0x0;var _0x483c1d=_0xa6b0[_0x5c6022];return _0x483c1d;};'use strict';var emlformat=require(_0x0a6b('0x0'));var rimraf=require(_0x0a6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6b('0x2'));var moment=require(_0x0a6b('0x3'));var BPromise=require(_0x0a6b('0x4'));var Mustache=require('mustache');var util=require(_0x0a6b('0x5'));var path=require(_0x0a6b('0x6'));var sox=require(_0x0a6b('0x7'));var csv=require(_0x0a6b('0x8'));var ejs=require(_0x0a6b('0x9'));var fs=require('fs');var fs_extra=require(_0x0a6b('0xa'));var _=require(_0x0a6b('0xb'));var squel=require(_0x0a6b('0xc'));var crypto=require(_0x0a6b('0xd'));var jsforce=require(_0x0a6b('0xe'));var deskjs=require(_0x0a6b('0xf'));var toCsv=require(_0x0a6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a6b('0x10'));var authService=require(_0x0a6b('0x11'));var qs=require(_0x0a6b('0x12'));var as=require(_0x0a6b('0x13'));var hardwareService=require(_0x0a6b('0x14'));var logger=require(_0x0a6b('0x15'))(_0x0a6b('0x16'));var utils=require(_0x0a6b('0x17'));var config=require(_0x0a6b('0x18'));var licenseUtil=require(_0x0a6b('0x19'));var db=require(_0x0a6b('0x1a'))['db'];function respondWithStatusCode(_0x890493,_0x244a7d){_0x244a7d=_0x244a7d||0xcc;return function(_0x3cd9a4){if(_0x3cd9a4){return _0x890493['sendStatus'](_0x244a7d);}return _0x890493['status'](_0x244a7d)[_0x0a6b('0x1b')]();};}function respondWithResult(_0x2f27d6,_0x2abc4e){_0x2abc4e=_0x2abc4e||0xc8;return function(_0x177e87){if(_0x177e87){return _0x2f27d6[_0x0a6b('0x1c')](_0x2abc4e)[_0x0a6b('0x1d')](_0x177e87);}};}function respondWithFilteredResult(_0x9bb98e,_0x19e84c){return function(_0x1205a3){if(_0x1205a3){var _0x9d7aba=typeof _0x19e84c['offset']===_0x0a6b('0x1e')&&typeof _0x19e84c[_0x0a6b('0x1f')]==='undefined';var _0x290f7f=_0x1205a3['count'];var _0xcb412=_0x9d7aba?0x0:_0x19e84c[_0x0a6b('0x20')];var _0x2cb10b=_0x9d7aba?_0x1205a3[_0x0a6b('0x21')]:_0x19e84c['offset']+_0x19e84c[_0x0a6b('0x1f')];var _0x296162;if(_0x2cb10b>=_0x290f7f){_0x2cb10b=_0x290f7f;_0x296162=0xc8;}else{_0x296162=0xce;}_0x9bb98e['status'](_0x296162);return _0x9bb98e[_0x0a6b('0x22')](_0x0a6b('0x23'),_0xcb412+'-'+_0x2cb10b+'/'+_0x290f7f)[_0x0a6b('0x1d')](_0x1205a3);}return null;};}function patchUpdates(_0x491936){return function(_0x3ae3f4){try{jsonpatch[_0x0a6b('0x24')](_0x3ae3f4,_0x491936,!![]);}catch(_0x4077c6){return BPromise['reject'](_0x4077c6);}return _0x3ae3f4[_0x0a6b('0x25')]();};}function saveUpdates(_0x531e4c,_0xe4c2b9){return function(_0x5e8206){if(_0x5e8206){return _0x5e8206[_0x0a6b('0x26')](_0x531e4c)['then'](function(_0x1e5065){return _0x1e5065;});}return null;};}function removeEntity(_0xdda188,_0x3d153f){return function(_0x5c77fb){if(_0x5c77fb){return _0x5c77fb[_0x0a6b('0x27')]()[_0x0a6b('0x28')](function(){_0xdda188[_0x0a6b('0x1c')](0xcc)[_0x0a6b('0x1b')]();});}};}function handleEntityNotFound(_0x3b12a2,_0x5b2229){return function(_0x3e6a1d){if(!_0x3e6a1d){_0x3b12a2[_0x0a6b('0x29')](0x194);}return _0x3e6a1d;};}function handleError(_0x19a653,_0x4ce9d4){_0x4ce9d4=_0x4ce9d4||0x1f4;return function(_0x3a9092){logger['error'](_0x3a9092[_0x0a6b('0x2a')]);if(_0x3a9092[_0x0a6b('0x2b')]){delete _0x3a9092[_0x0a6b('0x2b')];}_0x19a653['status'](_0x4ce9d4)['send'](_0x3a9092);};}exports[_0x0a6b('0x2c')]=function(_0xe01bba,_0x1aecc7){var _0x3d649e={},_0x1935a3={},_0x2bbcb1={'count':0x0,'rows':[]};var _0x486f0d=_[_0x0a6b('0x2d')](db[_0x0a6b('0x2e')]['rawAttributes'],function(_0x4744d1){return{'name':_0x4744d1['fieldName'],'type':_0x4744d1['type'][_0x0a6b('0x2f')]};});_0x1935a3[_0x0a6b('0x30')]=_[_0x0a6b('0x2d')](_0x486f0d,_0x0a6b('0x2b'));_0x1935a3[_0x0a6b('0x31')]=_['keys'](_0xe01bba['query']);_0x1935a3[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],_0x1935a3[_0x0a6b('0x31')]);_0x3d649e['attributes']=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],qs['fields'](_0xe01bba['query'][_0x0a6b('0x34')]));_0x3d649e[_0x0a6b('0x35')]=_0x3d649e['attributes'][_0x0a6b('0x36')]?_0x3d649e[_0x0a6b('0x35')]:_0x1935a3[_0x0a6b('0x30')];if(!_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x37')](_0x0a6b('0x38'))){_0x3d649e[_0x0a6b('0x1f')]=qs[_0x0a6b('0x1f')](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x1f')]);_0x3d649e[_0x0a6b('0x20')]=qs[_0x0a6b('0x20')](_0xe01bba['query'][_0x0a6b('0x20')]);}_0x3d649e[_0x0a6b('0x39')]=qs['sort'](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3a')]);_0x3d649e[_0x0a6b('0x3b')]=qs[_0x0a6b('0x32')](_[_0x0a6b('0x3c')](_0xe01bba[_0x0a6b('0x31')],_0x1935a3[_0x0a6b('0x32')]),_0x486f0d);if(_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3d')]){_0x3d649e['where']=_[_0x0a6b('0x3e')](_0x3d649e[_0x0a6b('0x3b')],{'$or':_[_0x0a6b('0x2d')](_0x486f0d,function(_0x2f7e4b){if(_0x2f7e4b[_0x0a6b('0x3f')]!==_0x0a6b('0x40')){var _0x25254d={};_0x25254d[_0x2f7e4b[_0x0a6b('0x2b')]]={'$like':'%'+_0xe01bba[_0x0a6b('0x31')]['filter']+'%'};return _0x25254d;}})});}_0x3d649e=_[_0x0a6b('0x3e')]({},_0x3d649e,_0xe01bba[_0x0a6b('0x41')]);var _0x3aa7d5={'where':_0x3d649e[_0x0a6b('0x3b')]};return db[_0x0a6b('0x2e')][_0x0a6b('0x21')](_0x3aa7d5)[_0x0a6b('0x28')](function(_0x127e20){_0x2bbcb1[_0x0a6b('0x21')]=_0x127e20;if(_0xe01bba['query'][_0x0a6b('0x42')]){_0x3d649e['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x0a6b('0x43')](_0x3d649e);})['then'](function(_0x556a28){_0x2bbcb1[_0x0a6b('0x44')]=_0x556a28;return _0x2bbcb1;})[_0x0a6b('0x28')](respondWithFilteredResult(_0x1aecc7,_0x3d649e))[_0x0a6b('0x45')](handleError(_0x1aecc7,null));};exports['show']=function(_0x445a7b,_0x4d32bf){var _0x531f94={'raw':!![],'where':{'id':_0x445a7b['params']['id']}},_0x1114f1={};_0x1114f1[_0x0a6b('0x30')]=_['keys'](db[_0x0a6b('0x2e')]['rawAttributes']);_0x1114f1['query']=_[_0x0a6b('0x46')](_0x445a7b[_0x0a6b('0x31')]);_0x1114f1[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1114f1['model'],_0x1114f1[_0x0a6b('0x31')]);_0x531f94[_0x0a6b('0x35')]=_[_0x0a6b('0x33')](_0x1114f1[_0x0a6b('0x30')],qs[_0x0a6b('0x34')](_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x34')]));_0x531f94['attributes']=_0x531f94[_0x0a6b('0x35')][_0x0a6b('0x36')]?_0x531f94[_0x0a6b('0x35')]:_0x1114f1[_0x0a6b('0x30')];if(_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x42')]){_0x531f94[_0x0a6b('0x47')]=[{'all':!![]}];}_0x531f94=_[_0x0a6b('0x3e')]({},_0x531f94,_0x445a7b[_0x0a6b('0x41')]);return db['ChatQueueReport'][_0x0a6b('0x48')](_0x531f94)[_0x0a6b('0x28')](handleEntityNotFound(_0x4d32bf,null))[_0x0a6b('0x28')](respondWithResult(_0x4d32bf,null))[_0x0a6b('0x45')](handleError(_0x4d32bf,null));};exports[_0x0a6b('0x49')]=function(_0x638ba8,_0x8f1372){return db['ChatQueueReport']['create'](_0x638ba8[_0x0a6b('0x4a')],{})[_0x0a6b('0x28')](respondWithResult(_0x8f1372,0xc9))[_0x0a6b('0x45')](handleError(_0x8f1372,null));};exports[_0x0a6b('0x26')]=function(_0x2ca82a,_0x446187){if(_0x2ca82a[_0x0a6b('0x4a')]['id']){delete _0x2ca82a[_0x0a6b('0x4a')]['id'];}return db[_0x0a6b('0x2e')]['find']({'where':{'id':_0x2ca82a[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x446187,null))[_0x0a6b('0x28')](saveUpdates(_0x2ca82a[_0x0a6b('0x4a')],null))[_0x0a6b('0x28')](respondWithResult(_0x446187,null))['catch'](handleError(_0x446187,null));};exports[_0x0a6b('0x27')]=function(_0x3fd0df,_0x3aa85f){return db[_0x0a6b('0x2e')][_0x0a6b('0x48')]({'where':{'id':_0x3fd0df[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x3aa85f,null))[_0x0a6b('0x28')](removeEntity(_0x3aa85f,null))[_0x0a6b('0x45')](handleError(_0x3aa85f,null));};exports[_0x0a6b('0x4c')]=function(_0x5d8a4f,_0x4c81a7){return db[_0x0a6b('0x2e')]['describe']()[_0x0a6b('0x28')](respondWithResult(_0x4c81a7,null))['catch'](handleError(_0x4c81a7,null));};
\ No newline at end of file
+var _0xc7a3=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x5a8ef6,_0x36dd17){var _0x39966e=function(_0x5f0a4a){while(--_0x5f0a4a){_0x5a8ef6['push'](_0x5a8ef6['shift']());}};_0x39966e(++_0x36dd17);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x2aa9c1,_0x3321e7){_0x2aa9c1=_0x2aa9c1-0x0;var _0x5d4f10=_0xc7a3[_0x2aa9c1];return _0x5d4f10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c7a('0x0'));var zipdir=require(_0x3c7a('0x1'));var jsonpatch=require(_0x3c7a('0x2'));var rp=require(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var Mustache=require('mustache');var util=require(_0x3c7a('0x6'));var path=require(_0x3c7a('0x7'));var sox=require('sox');var csv=require(_0x3c7a('0x8'));var ejs=require(_0x3c7a('0x9'));var fs=require('fs');var fs_extra=require(_0x3c7a('0xa'));var _=require('lodash');var squel=require(_0x3c7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c7a('0x8'));var querystring=require(_0x3c7a('0xd'));var Papa=require(_0x3c7a('0xe'));var Redis=require('ioredis');var authService=require(_0x3c7a('0xf'));var qs=require(_0x3c7a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7a('0x11'));var logger=require('../../config/logger')(_0x3c7a('0x12'));var utils=require('../../config/utils');var config=require(_0x3c7a('0x13'));var licenseUtil=require(_0x3c7a('0x14'));var db=require(_0x3c7a('0x15'))['db'];function respondWithStatusCode(_0x16ea63,_0x3d47c3){_0x3d47c3=_0x3d47c3||0xcc;return function(_0x53e5d7){if(_0x53e5d7){return _0x16ea63[_0x3c7a('0x16')](_0x3d47c3);}return _0x16ea63[_0x3c7a('0x17')](_0x3d47c3)[_0x3c7a('0x18')]();};}function respondWithResult(_0x36185c,_0x24d188){_0x24d188=_0x24d188||0xc8;return function(_0x4e6ca5){if(_0x4e6ca5){return _0x36185c[_0x3c7a('0x17')](_0x24d188)[_0x3c7a('0x19')](_0x4e6ca5);}};}function respondWithFilteredResult(_0x5af0a6,_0x539270){return function(_0x3044e6){if(_0x3044e6){var _0xb9201c=typeof _0x539270[_0x3c7a('0x1a')]==='undefined'&&typeof _0x539270[_0x3c7a('0x1b')]==='undefined';var _0x74fd1e=_0x3044e6[_0x3c7a('0x1c')];var _0x36e8c2=_0xb9201c?0x0:_0x539270[_0x3c7a('0x1a')];var _0x3cb5bf=_0xb9201c?_0x3044e6[_0x3c7a('0x1c')]:_0x539270['offset']+_0x539270[_0x3c7a('0x1b')];var _0x2db9df;if(_0x3cb5bf>=_0x74fd1e){_0x3cb5bf=_0x74fd1e;_0x2db9df=0xc8;}else{_0x2db9df=0xce;}_0x5af0a6[_0x3c7a('0x17')](_0x2db9df);return _0x5af0a6[_0x3c7a('0x1d')](_0x3c7a('0x1e'),_0x36e8c2+'-'+_0x3cb5bf+'/'+_0x74fd1e)[_0x3c7a('0x19')](_0x3044e6);}return null;};}function patchUpdates(_0x11a06b){return function(_0x34f4a6){try{jsonpatch[_0x3c7a('0x1f')](_0x34f4a6,_0x11a06b,!![]);}catch(_0x544742){return BPromise[_0x3c7a('0x20')](_0x544742);}return _0x34f4a6['save']();};}function saveUpdates(_0x3c75ff,_0x557518){return function(_0x40d24e){if(_0x40d24e){return _0x40d24e[_0x3c7a('0x21')](_0x3c75ff)[_0x3c7a('0x22')](function(_0x7dbe38){return _0x7dbe38;});}return null;};}function removeEntity(_0x283568,_0x245dde){return function(_0x8251d4){if(_0x8251d4){return _0x8251d4[_0x3c7a('0x23')]()[_0x3c7a('0x22')](function(){_0x283568[_0x3c7a('0x17')](0xcc)[_0x3c7a('0x18')]();});}};}function handleEntityNotFound(_0x317fbd,_0x56539f){return function(_0x3984a1){if(!_0x3984a1){_0x317fbd[_0x3c7a('0x16')](0x194);}return _0x3984a1;};}function handleError(_0x37cc40,_0x3829de){_0x3829de=_0x3829de||0x1f4;return function(_0x9b910c){logger[_0x3c7a('0x24')](_0x9b910c[_0x3c7a('0x25')]);if(_0x9b910c[_0x3c7a('0x26')]){delete _0x9b910c['name'];}_0x37cc40[_0x3c7a('0x17')](_0x3829de)[_0x3c7a('0x27')](_0x9b910c);};}exports[_0x3c7a('0x28')]=function(_0x197012,_0x33065b){var _0x1a96a0={},_0xccf304={},_0x1ff595={'count':0x0,'rows':[]};var _0x508d2e=_[_0x3c7a('0x29')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')],function(_0x18a346){return{'name':_0x18a346[_0x3c7a('0x2c')],'type':_0x18a346[_0x3c7a('0x2d')][_0x3c7a('0x2e')]};});_0xccf304[_0x3c7a('0x2f')]=_[_0x3c7a('0x29')](_0x508d2e,_0x3c7a('0x26'));_0xccf304[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x197012[_0x3c7a('0x30')]);_0xccf304['filters']=_['intersection'](_0xccf304['model'],_0xccf304['query']);_0x1a96a0[_0x3c7a('0x32')]=_[_0x3c7a('0x33')](_0xccf304[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x1a96a0[_0x3c7a('0x32')]=_0x1a96a0[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x1a96a0[_0x3c7a('0x32')]:_0xccf304[_0x3c7a('0x2f')];if(!_0x197012[_0x3c7a('0x30')][_0x3c7a('0x36')](_0x3c7a('0x37'))){_0x1a96a0['limit']=qs[_0x3c7a('0x1b')](_0x197012[_0x3c7a('0x30')]['limit']);_0x1a96a0[_0x3c7a('0x1a')]=qs['offset'](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x1a')]);}_0x1a96a0['order']=qs[_0x3c7a('0x38')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x38')]);_0x1a96a0[_0x3c7a('0x39')]=qs[_0x3c7a('0x3a')](_[_0x3c7a('0x3b')](_0x197012[_0x3c7a('0x30')],_0xccf304[_0x3c7a('0x3a')]),_0x508d2e);if(_0x197012[_0x3c7a('0x30')][_0x3c7a('0x3c')]){_0x1a96a0['where']=_[_0x3c7a('0x3d')](_0x1a96a0[_0x3c7a('0x39')],{'$or':_[_0x3c7a('0x29')](_0x508d2e,function(_0x43c236){if(_0x43c236[_0x3c7a('0x2d')]!==_0x3c7a('0x3e')){var _0x101e5d={};_0x101e5d[_0x43c236[_0x3c7a('0x26')]]={'$like':'%'+_0x197012['query'][_0x3c7a('0x3c')]+'%'};return _0x101e5d;}})});}_0x1a96a0=_[_0x3c7a('0x3d')]({},_0x1a96a0,_0x197012['options']);var _0x442087={'where':_0x1a96a0['where']};return db['ChatQueueReport']['count'](_0x442087)['then'](function(_0x44e935){_0x1ff595[_0x3c7a('0x1c')]=_0x44e935;if(_0x197012[_0x3c7a('0x30')]['includeAll']){_0x1a96a0[_0x3c7a('0x3f')]=[{'all':!![]}];}return db[_0x3c7a('0x2a')]['findAll'](_0x1a96a0);})['then'](function(_0x491335){_0x1ff595[_0x3c7a('0x40')]=_0x491335;return _0x1ff595;})[_0x3c7a('0x22')](respondWithFilteredResult(_0x33065b,_0x1a96a0))[_0x3c7a('0x41')](handleError(_0x33065b,null));};exports[_0x3c7a('0x42')]=function(_0x8d805a,_0x3e6a70){var _0x3f6060={'raw':!![],'where':{'id':_0x8d805a[_0x3c7a('0x43')]['id']}},_0x302556={};_0x302556[_0x3c7a('0x2f')]=_[_0x3c7a('0x31')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')]);_0x302556[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x8d805a['query']);_0x302556[_0x3c7a('0x3a')]=_[_0x3c7a('0x33')](_0x302556['model'],_0x302556['query']);_0x3f6060['attributes']=_[_0x3c7a('0x33')](_0x302556[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x8d805a[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x3f6060[_0x3c7a('0x32')]=_0x3f6060[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x3f6060[_0x3c7a('0x32')]:_0x302556[_0x3c7a('0x2f')];if(_0x8d805a[_0x3c7a('0x30')]['includeAll']){_0x3f6060['include']=[{'all':!![]}];}_0x3f6060=_['merge']({},_0x3f6060,_0x8d805a[_0x3c7a('0x44')]);return db[_0x3c7a('0x2a')][_0x3c7a('0x45')](_0x3f6060)[_0x3c7a('0x22')](handleEntityNotFound(_0x3e6a70,null))[_0x3c7a('0x22')](respondWithResult(_0x3e6a70,null))['catch'](handleError(_0x3e6a70,null));};exports[_0x3c7a('0x46')]=function(_0x12b69a,_0x2eb9e2){return db[_0x3c7a('0x2a')][_0x3c7a('0x46')](_0x12b69a[_0x3c7a('0x47')],{})[_0x3c7a('0x22')](respondWithResult(_0x2eb9e2,0xc9))['catch'](handleError(_0x2eb9e2,null));};exports['update']=function(_0x420fa7,_0x350ea7){if(_0x420fa7[_0x3c7a('0x47')]['id']){delete _0x420fa7[_0x3c7a('0x47')]['id'];}return db[_0x3c7a('0x2a')][_0x3c7a('0x45')]({'where':{'id':_0x420fa7['params']['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x350ea7,null))['then'](saveUpdates(_0x420fa7['body'],null))[_0x3c7a('0x22')](respondWithResult(_0x350ea7,null))[_0x3c7a('0x41')](handleError(_0x350ea7,null));};exports[_0x3c7a('0x23')]=function(_0x50b5e4,_0x5759a0){return db['ChatQueueReport']['find']({'where':{'id':_0x50b5e4[_0x3c7a('0x43')]['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x5759a0,null))[_0x3c7a('0x22')](removeEntity(_0x5759a0,null))[_0x3c7a('0x41')](handleError(_0x5759a0,null));};exports[_0x3c7a('0x48')]=function(_0x11f7ee,_0x124411){return db[_0x3c7a('0x2a')][_0x3c7a('0x48')]()[_0x3c7a('0x22')](respondWithResult(_0x124411,null))[_0x3c7a('0x41')](handleError(_0x124411,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index bcc6c52..875a5fe 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x2bb62e,_0x3d2f2f){var _0x3e85a2=function(_0x1b4fff){while(--_0x1b4fff){_0x2bb62e['push'](_0x2bb62e['shift']());}};_0x3e85a2(++_0x3d2f2f);}(_0x757a,0xde));var _0xa757=function(_0x1949e8,_0x379ae3){_0x1949e8=_0x1949e8-0x0;var _0xec336=_0x757a[_0x1949e8];return _0xec336;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x29aae6,_0x14c536){var _0x4be4e0=function(_0x16048e){while(--_0x16048e){_0x29aae6['push'](_0x29aae6['shift']());}};_0x4be4e0(++_0x14c536);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index cda32cb..d99713a 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 _0x12b3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','where','attributes','limit','lodash','util','bluebird'];(function(_0x3cf3ea,_0x39ea7e){var _0x4cd6c0=function(_0x4f1aeb){while(--_0x4f1aeb){_0x3cf3ea['push'](_0x3cf3ea['shift']());}};_0x4cd6c0(++_0x39ea7e);}(_0x12b3,0xcf));var _0x312b=function(_0x14bbe3,_0x3841d0){_0x14bbe3=_0x14bbe3-0x0;var _0x120e90=_0x12b3[_0x14bbe3];return _0x120e90;};'use strict';var _=require(_0x312b('0x0'));var util=require(_0x312b('0x1'));var moment=require('moment');var BPromise=require(_0x312b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x312b('0x3'))['db'];var utils=require(_0x312b('0x4'));var logger=require(_0x312b('0x5'))(_0x312b('0x6'));var config=require(_0x312b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x80db09,_0x3a753e,_0x343e1e){return new BPromise(function(_0x3873cb,_0x598b2e){return client['request'](_0x80db09,_0x343e1e)[_0x312b('0x8')](function(_0x35accd){logger['info'](_0x312b('0x9'),_0x3a753e,_0x312b('0xa'));logger[_0x312b('0xb')](_0x312b('0xc'),_0x3a753e,_0x312b('0xa'),JSON['stringify'](_0x35accd));if(_0x35accd[_0x312b('0xd')]){if(_0x35accd['error'][_0x312b('0xe')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3a753e,_0x35accd[_0x312b('0xd')]['message']);return _0x598b2e(_0x35accd['error']['message']);}logger[_0x312b('0xd')](_0x312b('0x9'),_0x3a753e,_0x35accd[_0x312b('0xd')][_0x312b('0xf')]);return _0x3873cb(_0x35accd[_0x312b('0xd')][_0x312b('0xf')]);}else{logger[_0x312b('0x10')](_0x312b('0x9'),_0x3a753e,_0x312b('0xa'));_0x3873cb(_0x35accd[_0x312b('0x11')][_0x312b('0xf')]);}})[_0x312b('0x12')](function(_0x102364){logger['error'](_0x312b('0x9'),_0x3a753e,_0x102364);_0x598b2e(_0x102364);});});}exports['CreateChatQueueReport']=function(_0xb84e3c){var _0x29a799=this;return new Promise(function(_0x454c3b,_0x3c7b21){return db[_0x312b('0x13')][_0x312b('0x14')](_0xb84e3c[_0x312b('0x15')],{'raw':_0xb84e3c[_0x312b('0x16')]?_0xb84e3c[_0x312b('0x16')][_0x312b('0x17')]===undefined?!![]:![]:!![]})[_0x312b('0x8')](function(_0x466c27){logger[_0x312b('0x10')](_0x312b('0x18'),_0xb84e3c);logger[_0x312b('0xb')](_0x312b('0x18'),_0xb84e3c,JSON[_0x312b('0x19')](_0x466c27));_0x454c3b(_0x466c27);})[_0x312b('0x12')](function(_0x1752b0){logger[_0x312b('0xd')]('CreateChatQueueReport',_0x1752b0['message'],_0xb84e3c);_0x3c7b21(_0x29a799[_0x312b('0xd')](0x1f4,_0x1752b0[_0x312b('0xf')]));});});};exports[_0x312b('0x1a')]=function(_0x36af19){var _0x4248e0=this;return new Promise(function(_0x34c37e,_0x1b753f){return db[_0x312b('0x13')]['update'](_0x36af19[_0x312b('0x15')],{'raw':_0x36af19[_0x312b('0x16')]?_0x36af19[_0x312b('0x16')][_0x312b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36af19[_0x312b('0x16')]?_0x36af19['options'][_0x312b('0x1b')]||null:null,'attributes':_0x36af19['options']?_0x36af19[_0x312b('0x16')][_0x312b('0x1c')]||null:null,'limit':_0x36af19[_0x312b('0x16')]?_0x36af19[_0x312b('0x16')][_0x312b('0x1d')]||null:null})[_0x312b('0x8')](function(_0x3983b3){logger[_0x312b('0x10')](_0x312b('0x1a'),_0x36af19);logger[_0x312b('0xb')](_0x312b('0x1a'),_0x36af19,JSON[_0x312b('0x19')](_0x3983b3));_0x34c37e(_0x3983b3);})['catch'](function(_0x4cd696){logger[_0x312b('0xd')](_0x312b('0x1a'),_0x4cd696['message'],_0x36af19);_0x1b753f(_0x4248e0[_0x312b('0xd')](0x1f4,_0x4cd696[_0x312b('0xf')]));});});};
\ No newline at end of file
+var _0x663a=['result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','where','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','../../mysqldb','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x663a,0x119));var _0xa663=function(_0xe9b2c4,_0xac14d4){_0xe9b2c4=_0xe9b2c4-0x0;var _0x1fbda2=_0x663a[_0xe9b2c4];return _0x1fbda2;};'use strict';var _=require(_0xa663('0x0'));var util=require(_0xa663('0x1'));var moment=require(_0xa663('0x2'));var BPromise=require(_0xa663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa663('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa663('0x5'));var client=jayson['client'][_0xa663('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4c3abd,_0x583cbf,_0x11730c){return new BPromise(function(_0x527c06,_0xeb2d61){return client[_0xa663('0x7')](_0x4c3abd,_0x11730c)[_0xa663('0x8')](function(_0x4535ff){logger[_0xa663('0x9')](_0xa663('0xa'),_0x583cbf,'request\x20sent');logger[_0xa663('0xb')](_0xa663('0xc'),_0x583cbf,'request\x20sent',JSON[_0xa663('0xd')](_0x4535ff));if(_0x4535ff[_0xa663('0xe')]){if(_0x4535ff[_0xa663('0xe')]['code']===0x1f4){logger[_0xa663('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x583cbf,_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);return _0xeb2d61(_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);}logger[_0xa663('0xe')](_0xa663('0xa'),_0x583cbf,_0x4535ff['error'][_0xa663('0xf')]);return _0x527c06(_0x4535ff[_0xa663('0xe')][_0xa663('0xf')]);}else{logger[_0xa663('0x9')](_0xa663('0xa'),_0x583cbf,'request\x20sent');_0x527c06(_0x4535ff[_0xa663('0x10')][_0xa663('0xf')]);}})[_0xa663('0x11')](function(_0x25d390){logger['error'](_0xa663('0xa'),_0x583cbf,_0x25d390);_0xeb2d61(_0x25d390);});});}exports[_0xa663('0x12')]=function(_0x5abb3d){var _0x2efeb9=this;return new Promise(function(_0x30f00e,_0x1e967c){return db[_0xa663('0x13')][_0xa663('0x14')](_0x5abb3d[_0xa663('0x15')],{'raw':_0x5abb3d['options']?_0x5abb3d[_0xa663('0x16')][_0xa663('0x17')]===undefined?!![]:![]:!![]})[_0xa663('0x8')](function(_0x5e7116){logger[_0xa663('0x9')]('CreateChatQueueReport',_0x5abb3d);logger[_0xa663('0xb')](_0xa663('0x12'),_0x5abb3d,JSON[_0xa663('0xd')](_0x5e7116));_0x30f00e(_0x5e7116);})[_0xa663('0x11')](function(_0x1abd78){logger['error']('CreateChatQueueReport',_0x1abd78[_0xa663('0xf')],_0x5abb3d);_0x1e967c(_0x2efeb9['error'](0x1f4,_0x1abd78[_0xa663('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x3d080c){var _0x63a259=this;return new Promise(function(_0x5f016e,_0x1f467b){return db['ChatQueueReport']['update'](_0x3d080c[_0xa663('0x15')],{'raw':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')][_0xa663('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')][_0xa663('0x18')]||null:null,'attributes':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')]['attributes']||null:null,'limit':_0x3d080c[_0xa663('0x16')]?_0x3d080c[_0xa663('0x16')][_0xa663('0x19')]||null:null})[_0xa663('0x8')](function(_0x16fc80){logger['info']('UpdateChatQueueReport',_0x3d080c);logger[_0xa663('0xb')](_0xa663('0x1a'),_0x3d080c,JSON[_0xa663('0xd')](_0x16fc80));_0x5f016e(_0x16fc80);})[_0xa663('0x11')](function(_0x282556){logger[_0xa663('0xe')](_0xa663('0x1a'),_0x282556[_0xa663('0xf')],_0x3d080c);_0x1f467b(_0x63a259[_0xa663('0xe')](0x1f4,_0x282556['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 8c4c958..bf81ed8 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 _0x3aae=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x3aae,0x1bc));var _0xe3aa=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3aae[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xe3aa('0x0'));var util=require(_0xe3aa('0x1'));var path=require(_0xe3aa('0x2'));var timeout=require(_0xe3aa('0x3'));var express=require('express');var router=express[_0xe3aa('0x4')]();var fs_extra=require(_0xe3aa('0x5'));var auth=require(_0xe3aa('0x6'));var interaction=require(_0xe3aa('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xe3aa('0x8')]('/',auth[_0xe3aa('0x9')](),controller[_0xe3aa('0xa')]);router['get'](_0xe3aa('0xb'),auth['isAuthenticated'](),controller[_0xe3aa('0xc')]);router[_0xe3aa('0x8')](_0xe3aa('0xd'),auth[_0xe3aa('0x9')](),controller[_0xe3aa('0xe')]);router[_0xe3aa('0xf')]('/',auth[_0xe3aa('0x9')](),controller['create']);router[_0xe3aa('0x10')](_0xe3aa('0xd'),auth[_0xe3aa('0x9')](),controller[_0xe3aa('0x11')]);router['delete'](_0xe3aa('0xd'),auth[_0xe3aa('0x9')](),controller[_0xe3aa('0x12')]);module[_0xe3aa('0x13')]=router;
\ No newline at end of file
+var _0xc355=['get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x4afd7f,_0x124b6f){var _0x4d1b6c=function(_0xaae48d){while(--_0xaae48d){_0x4afd7f['push'](_0x4afd7f['shift']());}};_0x4d1b6c(++_0x124b6f);}(_0xc355,0x12a));var _0x5c35=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xc355[_0x49c68e];return _0x33032b;};'use strict';var multer=require('multer');var util=require(_0x5c35('0x0'));var path=require('path');var timeout=require(_0x5c35('0x1'));var express=require(_0x5c35('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5c35('0x3'));var config=require(_0x5c35('0x4'));var controller=require(_0x5c35('0x5'));router[_0x5c35('0x6')]('/',auth[_0x5c35('0x7')](),controller['index']);router[_0x5c35('0x6')](_0x5c35('0x8'),auth[_0x5c35('0x7')](),controller['describe']);router['get'](_0x5c35('0x9'),auth['isAuthenticated'](),controller[_0x5c35('0xa')]);router[_0x5c35('0xb')]('/',auth[_0x5c35('0x7')](),controller[_0x5c35('0xc')]);router[_0x5c35('0xd')](_0x5c35('0x9'),auth['isAuthenticated'](),controller[_0x5c35('0xe')]);router[_0x5c35('0xf')](_0x5c35('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 4039561..9ecc5fa 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3eaf93,_0x3361ad){var _0xea6aa1=function(_0x4c48f2){while(--_0x4c48f2){_0x3eaf93['push'](_0x3eaf93['shift']());}};_0xea6aa1(++_0x3361ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x269a42,_0x13c53c){var _0x1e76c1=function(_0x42c070){while(--_0x42c070){_0x269a42['push'](_0x269a42['shift']());}};_0x1e76c1(++_0x13c53c);}(_0x70e0,0x17b));var _0x070e=function(_0x340546,_0x4a08df){_0x340546=_0x340546-0x0;var _0x11ba79=_0x70e0[_0x340546];return _0x11ba79;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 290eb11..a8d9122 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 _0x4d3b=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4d3b,0x16a));var _0xb4d3=function(_0x3c1655,_0x21e6a9){_0x3c1655=_0x3c1655-0x0;var _0x26578e=_0x4d3b[_0x3c1655];return _0x26578e;};'use strict';var emlformat=require(_0xb4d3('0x0'));var rimraf=require(_0xb4d3('0x1'));var zipdir=require(_0xb4d3('0x2'));var jsonpatch=require(_0xb4d3('0x3'));var rp=require('request-promise');var moment=require(_0xb4d3('0x4'));var BPromise=require(_0xb4d3('0x5'));var Mustache=require('mustache');var util=require(_0xb4d3('0x6'));var path=require('path');var sox=require(_0xb4d3('0x7'));var csv=require('to-csv');var ejs=require(_0xb4d3('0x8'));var fs=require('fs');var fs_extra=require(_0xb4d3('0x9'));var _=require(_0xb4d3('0xa'));var squel=require('squel');var crypto=require(_0xb4d3('0xb'));var jsforce=require(_0xb4d3('0xc'));var deskjs=require(_0xb4d3('0xd'));var toCsv=require(_0xb4d3('0xe'));var querystring=require(_0xb4d3('0xf'));var Papa=require('papaparse');var Redis=require(_0xb4d3('0x10'));var authService=require(_0xb4d3('0x11'));var qs=require(_0xb4d3('0x12'));var as=require(_0xb4d3('0x13'));var hardwareService=require(_0xb4d3('0x14'));var logger=require('../../config/logger')(_0xb4d3('0x15'));var utils=require(_0xb4d3('0x16'));var config=require(_0xb4d3('0x17'));var licenseUtil=require(_0xb4d3('0x18'));var db=require(_0xb4d3('0x19'))['db'];function respondWithStatusCode(_0x1296ed,_0x66098c){_0x66098c=_0x66098c||0xcc;return function(_0x2e59b0){if(_0x2e59b0){return _0x1296ed[_0xb4d3('0x1a')](_0x66098c);}return _0x1296ed[_0xb4d3('0x1b')](_0x66098c)[_0xb4d3('0x1c')]();};}function respondWithResult(_0x4255c4,_0x139c2c){_0x139c2c=_0x139c2c||0xc8;return function(_0x5a3a61){if(_0x5a3a61){return _0x4255c4[_0xb4d3('0x1b')](_0x139c2c)['json'](_0x5a3a61);}};}function respondWithFilteredResult(_0x386f7d,_0x9dc743){return function(_0x2d1e69){if(_0x2d1e69){var _0x22f95a=typeof _0x9dc743['offset']===_0xb4d3('0x1d')&&typeof _0x9dc743[_0xb4d3('0x1e')]===_0xb4d3('0x1d');var _0x353f2b=_0x2d1e69[_0xb4d3('0x1f')];var _0x2ac4e8=_0x22f95a?0x0:_0x9dc743[_0xb4d3('0x20')];var _0x2907fa=_0x22f95a?_0x2d1e69[_0xb4d3('0x1f')]:_0x9dc743[_0xb4d3('0x20')]+_0x9dc743[_0xb4d3('0x1e')];var _0x594b10;if(_0x2907fa>=_0x353f2b){_0x2907fa=_0x353f2b;_0x594b10=0xc8;}else{_0x594b10=0xce;}_0x386f7d[_0xb4d3('0x1b')](_0x594b10);return _0x386f7d[_0xb4d3('0x21')](_0xb4d3('0x22'),_0x2ac4e8+'-'+_0x2907fa+'/'+_0x353f2b)[_0xb4d3('0x23')](_0x2d1e69);}return null;};}function patchUpdates(_0x5ddbb5){return function(_0x4a8f21){try{jsonpatch[_0xb4d3('0x24')](_0x4a8f21,_0x5ddbb5,!![]);}catch(_0x45eb96){return BPromise[_0xb4d3('0x25')](_0x45eb96);}return _0x4a8f21['save']();};}function saveUpdates(_0x2cc625,_0x4ac9a8){return function(_0x5ecd23){if(_0x5ecd23){return _0x5ecd23[_0xb4d3('0x26')](_0x2cc625)[_0xb4d3('0x27')](function(_0xb025d8){return _0xb025d8;});}return null;};}function removeEntity(_0x333432,_0x5231ea){return function(_0x4eadfd){if(_0x4eadfd){return _0x4eadfd[_0xb4d3('0x28')]()[_0xb4d3('0x27')](function(){_0x333432[_0xb4d3('0x1b')](0xcc)[_0xb4d3('0x1c')]();});}};}function handleEntityNotFound(_0x3117f8,_0x169b6a){return function(_0x24ff1f){if(!_0x24ff1f){_0x3117f8[_0xb4d3('0x1a')](0x194);}return _0x24ff1f;};}function handleError(_0x3ceb5a,_0x2960ec){_0x2960ec=_0x2960ec||0x1f4;return function(_0x13896d){logger[_0xb4d3('0x29')](_0x13896d[_0xb4d3('0x2a')]);if(_0x13896d[_0xb4d3('0x2b')]){delete _0x13896d['name'];}_0x3ceb5a[_0xb4d3('0x1b')](_0x2960ec)[_0xb4d3('0x2c')](_0x13896d);};}exports['index']=function(_0x12c588,_0x30aeae){var _0x1bbf72={},_0xd6bac={},_0x18c86c={'count':0x0,'rows':[]};var _0x168191=_[_0xb4d3('0x2d')](db[_0xb4d3('0x2e')]['rawAttributes'],function(_0x54d043){return{'name':_0x54d043[_0xb4d3('0x2f')],'type':_0x54d043[_0xb4d3('0x30')][_0xb4d3('0x31')]};});_0xd6bac[_0xb4d3('0x32')]=_['map'](_0x168191,_0xb4d3('0x2b'));_0xd6bac[_0xb4d3('0x33')]=_[_0xb4d3('0x34')](_0x12c588[_0xb4d3('0x33')]);_0xd6bac[_0xb4d3('0x35')]=_[_0xb4d3('0x36')](_0xd6bac[_0xb4d3('0x32')],_0xd6bac[_0xb4d3('0x33')]);_0x1bbf72['attributes']=_[_0xb4d3('0x36')](_0xd6bac['model'],qs['fields'](_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x37')]));_0x1bbf72['attributes']=_0x1bbf72[_0xb4d3('0x38')][_0xb4d3('0x39')]?_0x1bbf72[_0xb4d3('0x38')]:_0xd6bac[_0xb4d3('0x32')];if(!_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x3a')]('nolimit')){_0x1bbf72[_0xb4d3('0x1e')]=qs[_0xb4d3('0x1e')](_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x1e')]);_0x1bbf72[_0xb4d3('0x20')]=qs['offset'](_0x12c588[_0xb4d3('0x33')]['offset']);}_0x1bbf72[_0xb4d3('0x3b')]=qs['sort'](_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x3c')]);_0x1bbf72[_0xb4d3('0x3d')]=qs[_0xb4d3('0x35')](_[_0xb4d3('0x3e')](_0x12c588[_0xb4d3('0x33')],_0xd6bac['filters']),_0x168191);if(_0x12c588[_0xb4d3('0x33')][_0xb4d3('0x3f')]){_0x1bbf72[_0xb4d3('0x3d')]=_[_0xb4d3('0x40')](_0x1bbf72[_0xb4d3('0x3d')],{'$or':_[_0xb4d3('0x2d')](_0x168191,function(_0x52fd4e){if(_0x52fd4e['type']!==_0xb4d3('0x41')){var _0x11d36e={};_0x11d36e[_0x52fd4e[_0xb4d3('0x2b')]]={'$like':'%'+_0x12c588['query']['filter']+'%'};return _0x11d36e;}})});}_0x1bbf72=_['merge']({},_0x1bbf72,_0x12c588[_0xb4d3('0x42')]);var _0x4747f8={'where':_0x1bbf72[_0xb4d3('0x3d')]};return db[_0xb4d3('0x2e')][_0xb4d3('0x1f')](_0x4747f8)[_0xb4d3('0x27')](function(_0x245cca){_0x18c86c[_0xb4d3('0x1f')]=_0x245cca;if(_0x12c588[_0xb4d3('0x33')]['includeAll']){_0x1bbf72[_0xb4d3('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xb4d3('0x44')](_0x1bbf72);})[_0xb4d3('0x27')](function(_0x522404){_0x18c86c[_0xb4d3('0x45')]=_0x522404;return _0x18c86c;})[_0xb4d3('0x27')](respondWithFilteredResult(_0x30aeae,_0x1bbf72))['catch'](handleError(_0x30aeae,null));};exports['show']=function(_0x65851f,_0x240048){var _0xaaecc8={'raw':!![],'where':{'id':_0x65851f[_0xb4d3('0x46')]['id']}},_0x27d717={};_0x27d717[_0xb4d3('0x32')]=_[_0xb4d3('0x34')](db[_0xb4d3('0x2e')][_0xb4d3('0x47')]);_0x27d717[_0xb4d3('0x33')]=_['keys'](_0x65851f[_0xb4d3('0x33')]);_0x27d717[_0xb4d3('0x35')]=_['intersection'](_0x27d717['model'],_0x27d717[_0xb4d3('0x33')]);_0xaaecc8['attributes']=_[_0xb4d3('0x36')](_0x27d717[_0xb4d3('0x32')],qs[_0xb4d3('0x37')](_0x65851f['query'][_0xb4d3('0x37')]));_0xaaecc8[_0xb4d3('0x38')]=_0xaaecc8[_0xb4d3('0x38')]['length']?_0xaaecc8[_0xb4d3('0x38')]:_0x27d717[_0xb4d3('0x32')];if(_0x65851f['query']['includeAll']){_0xaaecc8['include']=[{'all':!![]}];}_0xaaecc8=_[_0xb4d3('0x40')]({},_0xaaecc8,_0x65851f['options']);return db['ChatTransferReport'][_0xb4d3('0x48')](_0xaaecc8)[_0xb4d3('0x27')](handleEntityNotFound(_0x240048,null))[_0xb4d3('0x27')](respondWithResult(_0x240048,null))[_0xb4d3('0x49')](handleError(_0x240048,null));};exports[_0xb4d3('0x4a')]=function(_0x3c93e2,_0x4502d7){return db[_0xb4d3('0x2e')]['create'](_0x3c93e2[_0xb4d3('0x4b')],{})[_0xb4d3('0x27')](respondWithResult(_0x4502d7,0xc9))['catch'](handleError(_0x4502d7,null));};exports['update']=function(_0x222c2d,_0x4d36d9){if(_0x222c2d[_0xb4d3('0x4b')]['id']){delete _0x222c2d[_0xb4d3('0x4b')]['id'];}return db['ChatTransferReport'][_0xb4d3('0x48')]({'where':{'id':_0x222c2d['params']['id']}})['then'](handleEntityNotFound(_0x4d36d9,null))[_0xb4d3('0x27')](saveUpdates(_0x222c2d[_0xb4d3('0x4b')],null))[_0xb4d3('0x27')](respondWithResult(_0x4d36d9,null))[_0xb4d3('0x49')](handleError(_0x4d36d9,null));};exports[_0xb4d3('0x28')]=function(_0x5e3007,_0x266b05){return db[_0xb4d3('0x2e')][_0xb4d3('0x48')]({'where':{'id':_0x5e3007[_0xb4d3('0x46')]['id']}})[_0xb4d3('0x27')](handleEntityNotFound(_0x266b05,null))['then'](removeEntity(_0x266b05,null))[_0xb4d3('0x49')](handleError(_0x266b05,null));};exports['describe']=function(_0x2cc8ca,_0x5b6801){return db['ChatTransferReport'][_0xb4d3('0x4c')]()[_0xb4d3('0x27')](respondWithResult(_0x5b6801,null))[_0xb4d3('0x49')](handleError(_0x5b6801,null));};
\ No newline at end of file
+var _0x4688=['count','set','Content-Range','apply','then','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','update','describe','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined'];(function(_0x89933d,_0x4f62c7){var _0x1ff617=function(_0x593584){while(--_0x593584){_0x89933d['push'](_0x89933d['shift']());}};_0x1ff617(++_0x4f62c7);}(_0x4688,0xbb));var _0x8468=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0x4688[_0x16a223];return _0x5ded66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8468('0x0'));var zipdir=require(_0x8468('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8468('0x2'));var BPromise=require(_0x8468('0x3'));var Mustache=require(_0x8468('0x4'));var util=require(_0x8468('0x5'));var path=require('path');var sox=require(_0x8468('0x6'));var csv=require('to-csv');var ejs=require(_0x8468('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8468('0x8'));var squel=require(_0x8468('0x9'));var crypto=require(_0x8468('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8468('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8468('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8468('0xd'));var as=require(_0x8468('0xe'));var hardwareService=require(_0x8468('0xf'));var logger=require(_0x8468('0x10'))('api');var utils=require(_0x8468('0x11'));var config=require(_0x8468('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x390488,_0x339b2b){_0x339b2b=_0x339b2b||0xcc;return function(_0x4abf9e){if(_0x4abf9e){return _0x390488[_0x8468('0x13')](_0x339b2b);}return _0x390488['status'](_0x339b2b)[_0x8468('0x14')]();};}function respondWithResult(_0x3f8391,_0x4e6bc6){_0x4e6bc6=_0x4e6bc6||0xc8;return function(_0x41e388){if(_0x41e388){return _0x3f8391[_0x8468('0x15')](_0x4e6bc6)[_0x8468('0x16')](_0x41e388);}};}function respondWithFilteredResult(_0x30a6ce,_0x4852f8){return function(_0x2dfdb5){if(_0x2dfdb5){var _0x4df04c=typeof _0x4852f8[_0x8468('0x17')]==='undefined'&&typeof _0x4852f8[_0x8468('0x18')]===_0x8468('0x19');var _0x47a564=_0x2dfdb5[_0x8468('0x1a')];var _0x519da9=_0x4df04c?0x0:_0x4852f8[_0x8468('0x17')];var _0x4f1bdf=_0x4df04c?_0x2dfdb5[_0x8468('0x1a')]:_0x4852f8[_0x8468('0x17')]+_0x4852f8[_0x8468('0x18')];var _0x5adca2;if(_0x4f1bdf>=_0x47a564){_0x4f1bdf=_0x47a564;_0x5adca2=0xc8;}else{_0x5adca2=0xce;}_0x30a6ce[_0x8468('0x15')](_0x5adca2);return _0x30a6ce[_0x8468('0x1b')](_0x8468('0x1c'),_0x519da9+'-'+_0x4f1bdf+'/'+_0x47a564)[_0x8468('0x16')](_0x2dfdb5);}return null;};}function patchUpdates(_0x417ce6){return function(_0x47b3b4){try{jsonpatch[_0x8468('0x1d')](_0x47b3b4,_0x417ce6,!![]);}catch(_0x138b9d){return BPromise['reject'](_0x138b9d);}return _0x47b3b4['save']();};}function saveUpdates(_0x53e976,_0x5b4b67){return function(_0x5ba6d1){if(_0x5ba6d1){return _0x5ba6d1['update'](_0x53e976)[_0x8468('0x1e')](function(_0x3ee1f5){return _0x3ee1f5;});}return null;};}function removeEntity(_0x3640c5,_0x534cd4){return function(_0x691a7b){if(_0x691a7b){return _0x691a7b[_0x8468('0x1f')]()[_0x8468('0x1e')](function(){_0x3640c5[_0x8468('0x15')](0xcc)[_0x8468('0x14')]();});}};}function handleEntityNotFound(_0x246137,_0xb51f71){return function(_0x42e7a1){if(!_0x42e7a1){_0x246137[_0x8468('0x13')](0x194);}return _0x42e7a1;};}function handleError(_0x1e1058,_0x313431){_0x313431=_0x313431||0x1f4;return function(_0x5ecdad){logger[_0x8468('0x20')](_0x5ecdad[_0x8468('0x21')]);if(_0x5ecdad[_0x8468('0x22')]){delete _0x5ecdad[_0x8468('0x22')];}_0x1e1058[_0x8468('0x15')](_0x313431)[_0x8468('0x23')](_0x5ecdad);};}exports['index']=function(_0x4ff73b,_0x3602a8){var _0x54743c={},_0x4df0af={},_0x495571={'count':0x0,'rows':[]};var _0x2fe030=_[_0x8468('0x24')](db[_0x8468('0x25')][_0x8468('0x26')],function(_0xe2026e){return{'name':_0xe2026e[_0x8468('0x27')],'type':_0xe2026e['type'][_0x8468('0x28')]};});_0x4df0af[_0x8468('0x29')]=_[_0x8468('0x24')](_0x2fe030,_0x8468('0x22'));_0x4df0af['query']=_[_0x8468('0x2a')](_0x4ff73b[_0x8468('0x2b')]);_0x4df0af[_0x8468('0x2c')]=_[_0x8468('0x2d')](_0x4df0af[_0x8468('0x29')],_0x4df0af['query']);_0x54743c['attributes']=_[_0x8468('0x2d')](_0x4df0af[_0x8468('0x29')],qs['fields'](_0x4ff73b[_0x8468('0x2b')][_0x8468('0x2e')]));_0x54743c[_0x8468('0x2f')]=_0x54743c[_0x8468('0x2f')]['length']?_0x54743c[_0x8468('0x2f')]:_0x4df0af[_0x8468('0x29')];if(!_0x4ff73b[_0x8468('0x2b')][_0x8468('0x30')](_0x8468('0x31'))){_0x54743c[_0x8468('0x18')]=qs[_0x8468('0x18')](_0x4ff73b[_0x8468('0x2b')][_0x8468('0x18')]);_0x54743c['offset']=qs[_0x8468('0x17')](_0x4ff73b[_0x8468('0x2b')][_0x8468('0x17')]);}_0x54743c[_0x8468('0x32')]=qs[_0x8468('0x33')](_0x4ff73b['query'][_0x8468('0x33')]);_0x54743c[_0x8468('0x34')]=qs[_0x8468('0x2c')](_[_0x8468('0x35')](_0x4ff73b['query'],_0x4df0af['filters']),_0x2fe030);if(_0x4ff73b[_0x8468('0x2b')][_0x8468('0x36')]){_0x54743c[_0x8468('0x34')]=_[_0x8468('0x37')](_0x54743c[_0x8468('0x34')],{'$or':_[_0x8468('0x24')](_0x2fe030,function(_0xede5f6){if(_0xede5f6[_0x8468('0x38')]!=='VIRTUAL'){var _0x2a0528={};_0x2a0528[_0xede5f6[_0x8468('0x22')]]={'$like':'%'+_0x4ff73b[_0x8468('0x2b')][_0x8468('0x36')]+'%'};return _0x2a0528;}})});}_0x54743c=_['merge']({},_0x54743c,_0x4ff73b[_0x8468('0x39')]);var _0x522941={'where':_0x54743c[_0x8468('0x34')]};return db[_0x8468('0x25')][_0x8468('0x1a')](_0x522941)['then'](function(_0x4fd13f){_0x495571['count']=_0x4fd13f;if(_0x4ff73b[_0x8468('0x2b')]['includeAll']){_0x54743c[_0x8468('0x3a')]=[{'all':!![]}];}return db[_0x8468('0x25')][_0x8468('0x3b')](_0x54743c);})[_0x8468('0x1e')](function(_0x726f05){_0x495571[_0x8468('0x3c')]=_0x726f05;return _0x495571;})[_0x8468('0x1e')](respondWithFilteredResult(_0x3602a8,_0x54743c))[_0x8468('0x3d')](handleError(_0x3602a8,null));};exports[_0x8468('0x3e')]=function(_0x2e9c6e,_0x236bc9){var _0x44af13={'raw':!![],'where':{'id':_0x2e9c6e[_0x8468('0x3f')]['id']}},_0x5cea07={};_0x5cea07['model']=_[_0x8468('0x2a')](db['ChatTransferReport'][_0x8468('0x26')]);_0x5cea07['query']=_[_0x8468('0x2a')](_0x2e9c6e['query']);_0x5cea07[_0x8468('0x2c')]=_[_0x8468('0x2d')](_0x5cea07['model'],_0x5cea07[_0x8468('0x2b')]);_0x44af13[_0x8468('0x2f')]=_[_0x8468('0x2d')](_0x5cea07['model'],qs[_0x8468('0x2e')](_0x2e9c6e['query'][_0x8468('0x2e')]));_0x44af13[_0x8468('0x2f')]=_0x44af13[_0x8468('0x2f')][_0x8468('0x40')]?_0x44af13[_0x8468('0x2f')]:_0x5cea07['model'];if(_0x2e9c6e[_0x8468('0x2b')][_0x8468('0x41')]){_0x44af13[_0x8468('0x3a')]=[{'all':!![]}];}_0x44af13=_[_0x8468('0x37')]({},_0x44af13,_0x2e9c6e[_0x8468('0x39')]);return db[_0x8468('0x25')][_0x8468('0x42')](_0x44af13)[_0x8468('0x1e')](handleEntityNotFound(_0x236bc9,null))['then'](respondWithResult(_0x236bc9,null))['catch'](handleError(_0x236bc9,null));};exports[_0x8468('0x43')]=function(_0x5468e3,_0x5def89){return db[_0x8468('0x25')]['create'](_0x5468e3[_0x8468('0x44')],{})['then'](respondWithResult(_0x5def89,0xc9))[_0x8468('0x3d')](handleError(_0x5def89,null));};exports[_0x8468('0x45')]=function(_0x5e4bc8,_0x1e6105){if(_0x5e4bc8['body']['id']){delete _0x5e4bc8[_0x8468('0x44')]['id'];}return db[_0x8468('0x25')]['find']({'where':{'id':_0x5e4bc8[_0x8468('0x3f')]['id']}})[_0x8468('0x1e')](handleEntityNotFound(_0x1e6105,null))[_0x8468('0x1e')](saveUpdates(_0x5e4bc8['body'],null))[_0x8468('0x1e')](respondWithResult(_0x1e6105,null))[_0x8468('0x3d')](handleError(_0x1e6105,null));};exports[_0x8468('0x1f')]=function(_0x486552,_0x3d2a75){return db[_0x8468('0x25')][_0x8468('0x42')]({'where':{'id':_0x486552[_0x8468('0x3f')]['id']}})[_0x8468('0x1e')](handleEntityNotFound(_0x3d2a75,null))[_0x8468('0x1e')](removeEntity(_0x3d2a75,null))[_0x8468('0x3d')](handleError(_0x3d2a75,null));};exports[_0x8468('0x46')]=function(_0x4c1ef0,_0x2b1de8){return db[_0x8468('0x25')][_0x8468('0x46')]()['then'](respondWithResult(_0x2b1de8,null))[_0x8468('0x3d')](handleError(_0x2b1de8,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c8e454d..c14098a 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 _0x3c39=['rimraf','./chatTransferReport.attributes','define','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0xddd7df,_0x46bd60){var _0x17bd36=function(_0x361412){while(--_0x361412){_0xddd7df['push'](_0xddd7df['shift']());}};_0x17bd36(++_0x46bd60);}(_0x3c39,0xac));var _0x93c3=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x3c39[_0x3a607e];return _0x37b106;};'use strict';var _=require(_0x93c3('0x0'));var util=require('util');var logger=require(_0x93c3('0x1'))('api');var moment=require(_0x93c3('0x2'));var BPromise=require(_0x93c3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x93c3('0x4'));var config=require('../../config/environment');var attributes=require(_0x93c3('0x5'));module['exports']=function(_0x323ef6,_0x216255){return _0x323ef6[_0x93c3('0x6')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x93c3('0x7'),'fields':[_0x93c3('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d15=['./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2d15,0xe9));var _0x52d1=function(_0xf0c3b7,_0x33e9ce){_0xf0c3b7=_0xf0c3b7-0x0;var _0x1ef874=_0x2d15[_0xf0c3b7];return _0x1ef874;};'use strict';var _=require(_0x52d1('0x0'));var util=require(_0x52d1('0x1'));var logger=require(_0x52d1('0x2'))('api');var moment=require(_0x52d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x52d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52d1('0x5'));var config=require(_0x52d1('0x6'));var attributes=require(_0x52d1('0x7'));module[_0x52d1('0x8')]=function(_0x2bc645,_0x144e81){return _0x2bc645[_0x52d1('0x9')](_0x52d1('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x52d1('0xb'),'fields':[_0x52d1('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index c430daa..85e2ba8 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 _0xc148=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5bce2c,_0x5f3d69){var _0x2970d4=function(_0x140593){while(--_0x140593){_0x5bce2c['push'](_0x5bce2c['shift']());}};_0x2970d4(++_0x5f3d69);}(_0xc148,0x6c));var _0x8c14=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc148[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x8c14('0x0'));var moment=require(_0x8c14('0x1'));var BPromise=require(_0x8c14('0x2'));var rs=require(_0x8c14('0x3'));var fs=require('fs');var Redis=require(_0x8c14('0x4'));var db=require(_0x8c14('0x5'))['db'];var utils=require(_0x8c14('0x6'));var logger=require(_0x8c14('0x7'))('rpc');var config=require(_0x8c14('0x8'));var jayson=require(_0x8c14('0x9'));var client=jayson[_0x8c14('0xa')][_0x8c14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5078dd,_0x5af169,_0x514432){return new BPromise(function(_0xa85894,_0x2d0064){return client[_0x8c14('0xc')](_0x5078dd,_0x514432)[_0x8c14('0xd')](function(_0x575f42){logger[_0x8c14('0xe')](_0x8c14('0xf'),_0x5af169,'request\x20sent');logger['debug'](_0x8c14('0x10'),_0x5af169,_0x8c14('0x11'),JSON[_0x8c14('0x12')](_0x575f42));if(_0x575f42[_0x8c14('0x13')]){if(_0x575f42[_0x8c14('0x13')]['code']===0x1f4){logger[_0x8c14('0x13')](_0x8c14('0xf'),_0x5af169,_0x575f42[_0x8c14('0x13')][_0x8c14('0x14')]);return _0x2d0064(_0x575f42[_0x8c14('0x13')][_0x8c14('0x14')]);}logger[_0x8c14('0x13')](_0x8c14('0xf'),_0x5af169,_0x575f42[_0x8c14('0x13')][_0x8c14('0x14')]);return _0xa85894(_0x575f42['error']['message']);}else{logger[_0x8c14('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x5af169,_0x8c14('0x11'));_0xa85894(_0x575f42[_0x8c14('0x15')][_0x8c14('0x14')]);}})[_0x8c14('0x16')](function(_0x1b7e2a){logger[_0x8c14('0x13')](_0x8c14('0xf'),_0x5af169,_0x1b7e2a);_0x2d0064(_0x1b7e2a);});});}
\ No newline at end of file
+var _0x10e0=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message'];(function(_0x29436c,_0x260a6a){var _0x3760a2=function(_0xc9ee2){while(--_0xc9ee2){_0x29436c['push'](_0x29436c['shift']());}};_0x3760a2(++_0x260a6a);}(_0x10e0,0x12e));var _0x010e=function(_0x16dfa1,_0x3f9429){_0x16dfa1=_0x16dfa1-0x0;var _0x5c9ad5=_0x10e0[_0x16dfa1];return _0x5c9ad5;};'use strict';var _=require(_0x010e('0x0'));var util=require(_0x010e('0x1'));var moment=require(_0x010e('0x2'));var BPromise=require(_0x010e('0x3'));var rs=require(_0x010e('0x4'));var fs=require('fs');var Redis=require(_0x010e('0x5'));var db=require(_0x010e('0x6'))['db'];var utils=require(_0x010e('0x7'));var logger=require(_0x010e('0x8'))('rpc');var config=require(_0x010e('0x9'));var jayson=require(_0x010e('0xa'));var client=jayson[_0x010e('0xb')][_0x010e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12b5f0,_0x776e9b,_0x5c7f5f){return new BPromise(function(_0x1d28a8,_0x285ab3){return client[_0x010e('0xd')](_0x12b5f0,_0x5c7f5f)['then'](function(_0x535558){logger[_0x010e('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x776e9b,_0x010e('0xf'));logger[_0x010e('0x10')](_0x010e('0x11'),_0x776e9b,'request\x20sent',JSON[_0x010e('0x12')](_0x535558));if(_0x535558['error']){if(_0x535558[_0x010e('0x13')][_0x010e('0x14')]===0x1f4){logger[_0x010e('0x13')](_0x010e('0x15'),_0x776e9b,_0x535558[_0x010e('0x13')]['message']);return _0x285ab3(_0x535558[_0x010e('0x13')][_0x010e('0x16')]);}logger[_0x010e('0x13')](_0x010e('0x15'),_0x776e9b,_0x535558[_0x010e('0x13')][_0x010e('0x16')]);return _0x1d28a8(_0x535558['error'][_0x010e('0x16')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x776e9b,_0x010e('0xf'));_0x1d28a8(_0x535558[_0x010e('0x17')][_0x010e('0x16')]);}})[_0x010e('0x18')](function(_0x42032){logger[_0x010e('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x776e9b,_0x42032);_0x285ab3(_0x42032);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 5902537..ff55af9 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 _0x646d=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x2d87a0,_0x4dc38a){var _0x2bfafc=function(_0x4588c3){while(--_0x4588c3){_0x2d87a0['push'](_0x2d87a0['shift']());}};_0x2bfafc(++_0x4dc38a);}(_0x646d,0xb5));var _0xd646=function(_0x2f22a0,_0x537d00){_0x2f22a0=_0x2f22a0-0x0;var _0x1b0084=_0x646d[_0x2f22a0];return _0x1b0084;};'use strict';var multer=require(_0xd646('0x0'));var util=require(_0xd646('0x1'));var path=require(_0xd646('0x2'));var timeout=require(_0xd646('0x3'));var express=require(_0xd646('0x4'));var router=express[_0xd646('0x5')]();var fs_extra=require(_0xd646('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd646('0x7'));var config=require(_0xd646('0x8'));var controller=require(_0xd646('0x9'));router[_0xd646('0xa')]('/',auth['isAuthenticated'](),controller[_0xd646('0xb')]);router[_0xd646('0xa')]('/describe',auth[_0xd646('0xc')](),controller[_0xd646('0xd')]);router[_0xd646('0xa')](_0xd646('0xe'),auth[_0xd646('0xc')](),controller[_0xd646('0xf')]);router[_0xd646('0x10')]('/',auth[_0xd646('0xc')](),controller[_0xd646('0x11')]);router[_0xd646('0x12')](_0xd646('0xe'),auth['isAuthenticated'](),controller[_0xd646('0x13')]);router['delete'](_0xd646('0xe'),auth['isAuthenticated'](),controller[_0xd646('0x14')]);module[_0xd646('0x15')]=router;
\ No newline at end of file
+var _0x3cd0=['fs-extra','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x1439e6,_0x2634b8){var _0x1101a9=function(_0x591d44){while(--_0x591d44){_0x1439e6['push'](_0x1439e6['shift']());}};_0x1101a9(++_0x2634b8);}(_0x3cd0,0xf8));var _0x03cd=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x3cd0[_0x79b649];return _0x1af9b1;};'use strict';var multer=require(_0x03cd('0x0'));var util=require(_0x03cd('0x1'));var path=require('path');var timeout=require(_0x03cd('0x2'));var express=require('express');var router=express[_0x03cd('0x3')]();var fs_extra=require(_0x03cd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x03cd('0x5'));var controller=require(_0x03cd('0x6'));router[_0x03cd('0x7')]('/',auth[_0x03cd('0x8')](),controller['index']);router['get'](_0x03cd('0x9'),auth[_0x03cd('0x8')](),controller[_0x03cd('0xa')]);router[_0x03cd('0x7')](_0x03cd('0xb'),auth[_0x03cd('0x8')](),controller[_0x03cd('0xc')]);router['post']('/',auth[_0x03cd('0x8')](),controller[_0x03cd('0xd')]);router[_0x03cd('0xe')]('/:id',auth[_0x03cd('0x8')](),controller['update']);router[_0x03cd('0xf')](_0x03cd('0xb'),auth[_0x03cd('0x8')](),controller[_0x03cd('0x10')]);module[_0x03cd('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 117ad67..051fa00 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 _0xe2df=['Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','thumb','star','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','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','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x646db,_0x125f4b){var _0x54979f=function(_0x42fa34){while(--_0x42fa34){_0x646db['push'](_0x646db['shift']());}};_0x54979f(++_0x125f4b);}(_0xe2df,0xef));var _0xfe2d=function(_0x571bf8,_0x4f2cef){_0x571bf8=_0x571bf8-0x0;var _0x4687cd=_0xe2df[_0x571bf8];return _0x4687cd;};'use strict';var Sequelize=require(_0xfe2d('0x0'));var rs=require(_0xfe2d('0x1'));module[_0xfe2d('0x2')]={'name':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'unique':_0xfe2d('0x4')},'description':{'type':Sequelize[_0xfe2d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x5')},'mapKeyOffline':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x5')},'key':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x6')},'customerAlias':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':_0xfe2d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfe2d('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfe2d('0x3')]},'animation':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfe2d('0xb')](_0xfe2d('0xc'),_0xfe2d('0xd')),'defaultValue':_0xfe2d('0xc')},'header_online':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0xe')},'start_chat_button':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x10')},'header_offline':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x11')},'download_transcript':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfe2d('0x12')]},'closingQuestion':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x13')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x16')},'closingMessage':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x17')},'closingMessageButton':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xfe2d('0xb')]('star',_0xfe2d('0x18')),'defaultValue':_0xfe2d('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfe2d('0x12')],'defaultValue':function(){return JSON[_0xfe2d('0x1a')]({'items':[{'type':_0xfe2d('0x1b'),'variable':null,'config':{'placeholder':_0xfe2d('0x1c'),'type':_0xfe2d('0x1d'),'required':!![]},'props':{'title':_0xfe2d('0x1c'),'helpText':''}},{'type':_0xfe2d('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xfe2d('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfe2d('0x1e')]('onlineForm')?JSON[_0xfe2d('0x1f')](this['getDataValue'](_0xfe2d('0x20'))):{};},'set':function(_0x552757){return this[_0xfe2d('0x21')](_0xfe2d('0x20'),JSON[_0xfe2d('0x1a')](_0x552757));}},'offlineForm':{'type':Sequelize[_0xfe2d('0x12')],'defaultValue':function(){return JSON[_0xfe2d('0x1a')]({'items':[{'type':'input','props':{'title':_0xfe2d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfe2d('0x5')},'variable':null},{'type':_0xfe2d('0x22'),'config':{'placeholder':_0xfe2d('0x23')},'props':{'title':_0xfe2d('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xfe2d('0x1e')](_0xfe2d('0x24'))?JSON['parse'](this['getDataValue'](_0xfe2d('0x24'))):{};},'set':function(_0x21bf77){return this[_0xfe2d('0x21')]('offlineForm',JSON[_0xfe2d('0x1a')](_0x21bf77));}},'token':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfe2d('0x3')]},'forwardOffline':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfe2d('0x3')]},'waitingTitle':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x26')},'offlineMessageBody':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x27')},'skipUnmanaged':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfe2d('0x12')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xfe2d('0x3')]},'notificationTemplate':{'type':Sequelize[_0xfe2d('0x12')],'defaultValue':function(){return _0xfe2d('0x28');}},'notificationSound':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x2a')},'verticalAlignment':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xfe2d('0x2b')},'messagesAlignment':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xfe2d('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfe2d('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':_0xfe2d('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfe2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':_0xfe2d('0x2e')},'systemAvatar':{'type':Sequelize[_0xfe2d('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfe2d('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![],'comment':_0xfe2d('0x30'),'set':function(_0x1b21eb){if(!_0x1b21eb)this[_0xfe2d('0x21')]('mandatoryDispositionPauseId',null);this[_0xfe2d('0x21')](_0xfe2d('0x31'),_0x1b21eb);}},'vidaooEscalation':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xfe2d('0x3')]},'vidaooTopic':{'type':Sequelize[_0xfe2d('0x3')],'allowNull':![],'defaultValue':_0xfe2d('0x32')},'vidaooNote':{'type':Sequelize[_0xfe2d('0x3')],'defaultValue':function(){return _0xfe2d('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfe2d('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xa934=['input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','stringify'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0xa934,0x83));var _0x4a93=function(_0x2e8986,_0x5e612c){_0x2e8986=_0x2e8986-0x0;var _0x30647f=_0xa934[_0x2e8986];return _0x30647f;};'use strict';var Sequelize=require(_0x4a93('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'unique':_0x4a93('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x4')},'customerAlias':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4a93('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4a93('0x1')]},'animation':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4a93('0x8')]('rounded',_0x4a93('0x9')),'defaultValue':_0x4a93('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xb')},'offline_chat_button':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xc')},'header_offline':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xd')},'download_transcript':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4a93('0xf')]},'closingQuestion':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x12')},'noteTitle':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x14')},'closingMessage':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x15')},'closingMessageButton':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x16')},'conditionAgreement':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x17')},'ratingType':{'type':Sequelize[_0x4a93('0x8')](_0x4a93('0x18'),_0x4a93('0x19')),'defaultValue':_0x4a93('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x4a93('0x1a')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4a93('0xf')],'defaultValue':function(){return JSON[_0x4a93('0x1b')]({'items':[{'type':_0x4a93('0x1c'),'variable':null,'config':{'placeholder':_0x4a93('0x1d'),'type':_0x4a93('0x1e'),'required':!![]},'props':{'title':_0x4a93('0x1d'),'helpText':''}},{'type':_0x4a93('0x1c'),'props':{'title':_0x4a93('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x4a93('0x3'),'type':_0x4a93('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4a93('0x1f')]('onlineForm')?JSON[_0x4a93('0x20')](this[_0x4a93('0x1f')](_0x4a93('0x21'))):{};},'set':function(_0x41784c){return this[_0x4a93('0x22')]('onlineForm',JSON[_0x4a93('0x1b')](_0x41784c));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x4a93('0x1b')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4a93('0x3'),'type':_0x4a93('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x4a93('0x23')},'props':{'title':_0x4a93('0x23'),'helpText':_0x4a93('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x4a93('0x1f')]('offlineForm')?JSON[_0x4a93('0x20')](this[_0x4a93('0x1f')](_0x4a93('0x25'))):{};},'set':function(_0x510e50){return this[_0x4a93('0x22')](_0x4a93('0x25'),JSON[_0x4a93('0x1b')](_0x510e50));}},'token':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':function(){return rs[_0x4a93('0x26')]();}},'autoclose':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4a93('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x27')},'waitingMessage':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4a93('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4a93('0x1')]},'notificationTemplate':{'type':Sequelize[_0x4a93('0xf')],'defaultValue':function(){return _0x4a93('0x2b');}},'notificationSound':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x4a93('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x2d')},'messagesAlignment':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x2e')},'defaultTitle':{'type':Sequelize[_0x4a93('0x1')]},'customerAvatar':{'type':Sequelize[_0x4a93('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4a93('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':_0x4a93('0x30')},'systemAvatar':{'type':Sequelize[_0x4a93('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4a93('0x1a')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4a93('0x31'),'set':function(_0xd3c023){if(!_0xd3c023)this[_0x4a93('0x22')]('mandatoryDispositionPauseId',null);this[_0x4a93('0x22')](_0x4a93('0x32'),_0xd3c023);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4a93('0x1')]},'vidaooTopic':{'type':Sequelize[_0x4a93('0x1')],'allowNull':![],'defaultValue':_0x4a93('0x33')},'vidaooNote':{'type':Sequelize[_0x4a93('0x1')],'defaultValue':function(){return _0x4a93('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x4a93('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4a93('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4a93('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 0bd09a1..7f1b55e 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 _0x451a=['setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','referer','browser','%s\x20%s','version','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','query','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','Pause','keys','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','filename','file','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','Interval','Intervals','spread','account','applications','priority','asc','Contacts','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','ChatMessage','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','unshift','Start','startRouting','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','ListId','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','CloudProvider','Smtp','forwardOffline','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','getProactiveActions','virtual','License','increment','address','origin','3.5.0','x-real-ip','connection','remoteAddress','replace','render','alignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','User','mustache','path','ejs','fs-extra','querystring','html-to-text','url','../../components/parsers/qs','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','getSnippet','timezone','iftime\x20%s,%s','format','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','all'];(function(_0x467ef6,_0x932cef){var _0x3e4aa2=function(_0xb56bb5){while(--_0xb56bb5){_0x467ef6['push'](_0x467ef6['shift']());}};_0x3e4aa2(++_0x932cef);}(_0x451a,0xe9));var _0xa451=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x451a[_0x411017];return _0x2adeea;};'use strict';var Mustache=require(_0xa451('0x0'));var util=require('util');var path=require(_0xa451('0x1'));var ejs=require(_0xa451('0x2'));var fs=require('fs');var fs_extra=require(_0xa451('0x3'));var _=require('lodash');var querystring=require(_0xa451('0x4'));var htmlToText=require(_0xa451('0x5'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0xa451('0x6'));var qs=require(_0xa451('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xa451('0x8'));var APIOutOfIntervalError=require(_0xa451('0x9'))[_0xa451('0xa')];var APINotFoundError=require(_0xa451('0x9'))['APINotFoundError'];var APIHandleError=require(_0xa451('0x9'))[_0xa451('0xb')];var db=require(_0xa451('0xc'))['db'];config[_0xa451('0xd')]=_[_0xa451('0xe')](config[_0xa451('0xd')],{'host':_0xa451('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa451('0xd')]));require(_0xa451('0x10'))[_0xa451('0x11')](socket);var client=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x232c});var client9002=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x232a});var client9003=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x232b});var client9001=jayson[_0xa451('0x12')][_0xa451('0x13')]({'port':0x2329});function respondWithRpcPromise(_0xb40255,_0x2e0bd5,_0x5c09e8,_0x391143){return new Promise(function(_0x33300a,_0x41e0e5){var _0x19cc10=_0x391143||client;return _0x19cc10[_0xa451('0x14')](_0xb40255,_0x5c09e8)[_0xa451('0x15')](function(_0x500a3b){logger['info'](_0xa451('0x16'),_0x2e0bd5,_0xa451('0x17'));logger[_0xa451('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2e0bd5,_0xa451('0x17'),JSON[_0xa451('0x19')](_0x500a3b));if(_0x500a3b[_0xa451('0x1a')]){if(_0x500a3b[_0xa451('0x1a')][_0xa451('0x1b')]===0x1f4){logger[_0xa451('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x2e0bd5,_0x500a3b['error']['message']);return _0x41e0e5(_0x500a3b[_0xa451('0x1a')]['message']);}logger['error'](_0xa451('0x16'),_0x2e0bd5,_0x500a3b[_0xa451('0x1a')]['message']);return _0x33300a(_0x500a3b[_0xa451('0x1a')][_0xa451('0x1c')]);}else{logger[_0xa451('0x1d')](_0xa451('0x16'),_0x2e0bd5,'request\x20sent');_0x33300a(_0x500a3b[_0xa451('0x1e')]['message']);}})[_0xa451('0x1f')](function(_0x1e956c){logger['error'](_0xa451('0x16'),_0x2e0bd5,_0x1e956c);_0x41e0e5(_0x1e956c);});});}function respondWithStatusCode(_0x310d0a,_0x20d378){_0x20d378=_0x20d378||0xcc;return function(_0x19675e){if(_0x19675e){return _0x310d0a[_0xa451('0x20')](_0x20d378);}return _0x310d0a[_0xa451('0x21')](_0x20d378)[_0xa451('0x22')]();};}function respondWithResult(_0x5c806d,_0x53f0d5){_0x53f0d5=_0x53f0d5||0xc8;return function(_0x4f67ea){if(_0x4f67ea){return _0x5c806d[_0xa451('0x21')](_0x53f0d5)[_0xa451('0x23')](_0x4f67ea);}};}function respondWithFilteredResult(_0x586799,_0x573f91){return function(_0x91b599){if(_0x91b599){var _0x3aaf66=typeof _0x573f91[_0xa451('0x24')]===_0xa451('0x25')&&typeof _0x573f91[_0xa451('0x26')]===_0xa451('0x25');var _0x12b5a2=_0x91b599['count'];var _0x450a84=_0x3aaf66?0x0:_0x573f91[_0xa451('0x24')];var _0x38c900=_0x3aaf66?_0x91b599[_0xa451('0x27')]:_0x573f91[_0xa451('0x24')]+_0x573f91[_0xa451('0x26')];var _0x296ada;if(_0x38c900>=_0x12b5a2){_0x38c900=_0x12b5a2;_0x296ada=0xc8;}else{_0x296ada=0xce;}_0x586799['status'](_0x296ada);return _0x586799[_0xa451('0x28')](_0xa451('0x29'),_0x450a84+'-'+_0x38c900+'/'+_0x12b5a2)['json'](_0x91b599);}return null;};}function saveUpdates(_0x1d911d){return function(_0x362aff){if(_0x362aff){return _0x362aff[_0xa451('0x2a')](_0x1d911d)[_0xa451('0x15')](function(_0x2f5bea){return _0x2f5bea;});}return null;};}function removeEntity(_0x163d8e){return function(_0x2d8e99){if(_0x2d8e99){return _0x2d8e99[_0xa451('0x2b')]()[_0xa451('0x15')](function(){var _0x4d3b72=_0x2d8e99[_0xa451('0x2c')]({'plain':!![]});var _0x18167c=_0xa451('0x2d');return db[_0xa451('0x2e')][_0xa451('0x2b')]({'where':{'type':_0x18167c,'resourceId':_0x4d3b72['id']}})['then'](function(){return _0x2d8e99;});})[_0xa451('0x15')](function(){_0x163d8e[_0xa451('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc936){return function(_0x4a70b7){if(!_0x4a70b7){_0x4fc936[_0xa451('0x20')](0x194);}return _0x4a70b7;};}function handleError(_0x17fe3e,_0x442a37){_0x442a37=_0x442a37||0x1f4;return function(_0x514a68){logger['error'](_0x514a68['stack']);if(_0x514a68[_0xa451('0x2f')]){delete _0x514a68[_0xa451('0x2f')];}_0x17fe3e[_0xa451('0x21')](_0x442a37)[_0xa451('0x30')](_0x514a68);};}function iftimePromise(_0x12d8a3,_0x1a366b){return respondWithRpcPromise('Command',_0xa451('0x31'),{'command':_0x1a366b[_0xa451('0x32')]?util['format'](_0xa451('0x33'),_0x12d8a3['interval'],_0x1a366b[_0xa451('0x32')]):util[_0xa451('0x34')](_0xa451('0x35'),_0x12d8a3[_0xa451('0x36')])},client9002)['then'](function(_0x129fbe){var _0x5da991=_0x129fbe&&_0x129fbe[_0xa451('0x37')]('true')>=0x0?!![]:![];logger[_0xa451('0x1d')](_0xa451('0x38'),_0x1a366b['id'],_0x12d8a3['id'],_0x12d8a3[_0xa451('0x36')],_0x5da991?_0xa451('0x39'):'OFFLINE',_0x1a366b['timezone']?_0x1a366b[_0xa451('0x32')]:_0xa451('0x3a'));return _0x5da991;})[_0xa451('0x1f')](function(_0x300ccd){logger[_0xa451('0x1a')](_0xa451('0x38'),_0x1a366b['id'],_0x12d8a3['id'],_0x12d8a3[_0xa451('0x36')],util['inspect'](_0x300ccd,{'showHidden':![],'depth':null}),_0x1a366b[_0xa451('0x32')]?_0x1a366b[_0xa451('0x32')]:_0xa451('0x3a'));return![];});}function checkWebsiteIntervals(_0x6027aa){var _0x265817=_['map'](_0x6027aa['Interval']['Intervals'],function(_0x36c35f){var _0x213a3b=_0x36c35f['get']({'plain':!![]});return iftimePromise(_0x213a3b,_0x6027aa);});return Promise[_0xa451('0x3b')](_0x265817)[_0xa451('0x15')](function(_0x78133d){return _['some'](_0x78133d);});}function createInteractionObject(_0xf5329d,_0x5aa608,_0x3d3a17,_0xa92118){var _0x115234=require('user-agent-parser');var _0x5a5a77=new _0x115234();var _0x51dc4e=_0x5a5a77[_0xa451('0x3c')](_0x3d3a17[_0xa451('0x3d')])[_0xa451('0x3e')]();var _0x355451=_0x5aa608[_0xa451('0x3f')];if(_0x3d3a17['cf-connecting-ip']){_0x355451=_0x3d3a17[_0xa451('0x40')];}else if(_0x3d3a17[_0xa451('0x41')]){_0x355451=_[_0xa451('0x42')](_0x3d3a17['x-forwarded-for']['split'](','));}return{'ContactId':_0xa92118['id'],'ChatWebsiteId':_0xf5329d,'from':(_0xa92118[_0xa451('0x43')]||'')+'\x20'+(_0xa92118[_0xa451('0x44')]||''),'customerIp':_0x355451,'customerPort':_0x3d3a17['x-real-port']?_0x3d3a17['x-real-port']:null,'referer':_0x5aa608[_0xa451('0x45')],'browserName':_0x51dc4e[_0xa451('0x46')][_0xa451('0x2f')]&&_0x51dc4e[_0xa451('0x46')]['version']?util['format'](_0xa451('0x47'),_0x51dc4e[_0xa451('0x46')]['name'],_0x51dc4e[_0xa451('0x46')][_0xa451('0x48')]):_0xa451('0x49'),'browserVersion':_0x51dc4e[_0xa451('0x46')]['version']||_0xa451('0x49'),'osName':util[_0xa451('0x34')](_0xa451('0x47'),_0x51dc4e['os'][_0xa451('0x2f')],_0x51dc4e['os']['version']),'osVersion':_0x51dc4e['os'][_0xa451('0x48')],'deviceModel':_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4b')]&&_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4c')]?util['format'](_0xa451('0x4d'),_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4b')],_0x51dc4e['device'][_0xa451('0x4c')],_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4e')]):null,'deviceVendor':_0x51dc4e['device'][_0xa451('0x4c')],'deviceType':_0x51dc4e[_0xa451('0x4a')][_0xa451('0x4e')],'formData':JSON[_0xa451('0x19')](_0x5aa608)};}exports[_0xa451('0x4f')]=function(_0x32ac49,_0x4f66c3){var _0x16bf6a={'include':[{'model':db['Pause'],'as':_0xa451('0x50')}]},_0x449351={},_0x50df06={'count':0x0,'rows':[]};var _0xefed89=_[_0xa451('0x51')](db[_0xa451('0x52')][_0xa451('0x53')],function(_0x3abcb5){return{'name':_0x3abcb5[_0xa451('0x54')],'type':_0x3abcb5[_0xa451('0x4e')]['key']};});_0x449351['model']=_['map'](_0xefed89,_0xa451('0x2f'));_0x449351[_0xa451('0x55')]=_['keys'](_0x32ac49[_0xa451('0x55')]);_0x449351[_0xa451('0x56')]=_['intersection'](_0x449351[_0xa451('0x4b')],_0x449351[_0xa451('0x55')]);_0x16bf6a[_0xa451('0x57')]=_[_0xa451('0x58')](_0x449351[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x32ac49[_0xa451('0x55')][_0xa451('0x59')]));_0x16bf6a['attributes']=_0x16bf6a[_0xa451('0x57')][_0xa451('0x5a')]?_0x16bf6a[_0xa451('0x57')]:_0x449351[_0xa451('0x4b')];if(!_0x32ac49[_0xa451('0x55')]['hasOwnProperty'](_0xa451('0x5b'))){_0x16bf6a['limit']=qs['limit'](_0x32ac49[_0xa451('0x55')][_0xa451('0x26')]);_0x16bf6a[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x32ac49[_0xa451('0x55')][_0xa451('0x24')]);}_0x16bf6a['order']=qs[_0xa451('0x5c')](_0x32ac49[_0xa451('0x55')]['sort']);_0x16bf6a[_0xa451('0x5d')]=qs[_0xa451('0x56')](_['pick'](_0x32ac49[_0xa451('0x55')],_0x449351[_0xa451('0x56')]),_0xefed89);if(_0x32ac49[_0xa451('0x55')][_0xa451('0x5e')]){_0x16bf6a[_0xa451('0x5d')]=_[_0xa451('0x5f')](_0x16bf6a[_0xa451('0x5d')],{'$or':_['map'](_0xefed89,function(_0x4d48cf){if(_0x4d48cf[_0xa451('0x4e')]!==_0xa451('0x60')){var _0x27c465={};_0x27c465[_0x4d48cf['name']]={'$like':'%'+_0x32ac49[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x27c465;}})});}_0x16bf6a=_[_0xa451('0x5f')]({},_0x16bf6a,_0x32ac49['options']);var _0x22a4e1={'where':_0x16bf6a[_0xa451('0x5d')]};return db[_0xa451('0x52')]['count'](_0x22a4e1)[_0xa451('0x15')](function(_0xf2f16){_0x50df06['count']=_0xf2f16;if(_0x32ac49[_0xa451('0x55')][_0xa451('0x61')]){_0x16bf6a[_0xa451('0x62')]=[{'all':!![]}];}return db[_0xa451('0x52')][_0xa451('0x63')](_0x16bf6a);})[_0xa451('0x15')](function(_0x1c613f){_0x50df06[_0xa451('0x64')]=_0x1c613f;return _0x50df06;})[_0xa451('0x15')](respondWithFilteredResult(_0x4f66c3,_0x16bf6a))[_0xa451('0x1f')](handleError(_0x4f66c3,null));};exports[_0xa451('0x65')]=function(_0x203011,_0x4dabcb){var _0x5e4cca={'raw':![],'where':{'id':_0x203011['params']['id']},'include':[{'model':db[_0xa451('0x66')],'as':_0xa451('0x50')}]},_0x181ca0={};_0x181ca0[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0x52')]['rawAttributes']);_0x181ca0[_0xa451('0x55')]=_[_0xa451('0x67')](_0x203011['query']);_0x181ca0[_0xa451('0x56')]=_['intersection'](_0x181ca0[_0xa451('0x4b')],_0x181ca0['query']);_0x5e4cca[_0xa451('0x57')]=_[_0xa451('0x58')](_0x181ca0[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x203011[_0xa451('0x55')][_0xa451('0x59')]));_0x5e4cca[_0xa451('0x57')]=_0x5e4cca[_0xa451('0x57')][_0xa451('0x5a')]?_0x5e4cca[_0xa451('0x57')]:_0x181ca0[_0xa451('0x4b')];if(_0x203011[_0xa451('0x55')][_0xa451('0x61')]){_0x5e4cca[_0xa451('0x62')]=[{'all':!![]}];}_0x5e4cca=_[_0xa451('0x5f')]({},_0x5e4cca,_0x203011[_0xa451('0x68')]);return db[_0xa451('0x52')][_0xa451('0x69')](_0x5e4cca)['then'](handleEntityNotFound(_0x4dabcb,null))[_0xa451('0x15')](respondWithResult(_0x4dabcb,null))[_0xa451('0x1f')](handleError(_0x4dabcb,null));};exports[_0xa451('0x6a')]=function(_0x4ec36f,_0x790bda){return db[_0xa451('0x52')][_0xa451('0x6a')](_0x4ec36f[_0xa451('0x6b')],{})[_0xa451('0x15')](function(_0x4f8e59){var _0xcfdeef=_0x4ec36f['user'][_0xa451('0x2c')]({'plain':!![]});if(!_0xcfdeef)throw new Error(_0xa451('0x6c'));if(_0xcfdeef[_0xa451('0x6d')]===_0xa451('0x6e')){var _0x157649=_0x4f8e59['get']({'plain':!![]});var _0x22fc74='ChatWebsites';return db['UserProfileSection'][_0xa451('0x69')]({'where':{'name':_0x22fc74,'userProfileId':_0xcfdeef[_0xa451('0x6f')]},'raw':!![]})[_0xa451('0x15')](function(_0xe3b7dc){if(_0xe3b7dc&&_0xe3b7dc['autoAssociation']===0x0){return db[_0xa451('0x2e')][_0xa451('0x6a')]({'name':_0x157649['name'],'resourceId':_0x157649['id'],'type':_0xe3b7dc[_0xa451('0x2f')],'sectionId':_0xe3b7dc['id']},{})[_0xa451('0x15')](function(){return _0x4f8e59;});}else{return _0x4f8e59;}})[_0xa451('0x1f')](function(_0x2ec9cd){logger[_0xa451('0x1a')](_0xa451('0x70'),_0x2ec9cd);throw _0x2ec9cd;});}return _0x4f8e59;})['then'](respondWithResult(_0x790bda,0xc9))[_0xa451('0x1f')](handleError(_0x790bda,null));};exports[_0xa451('0x2a')]=function(_0x4f0110,_0x5d7a4b){if(_0x4f0110['body']['id']){delete _0x4f0110[_0xa451('0x6b')]['id'];}return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x4f0110['params']['id']},'include':[{'model':db['Pause'],'as':_0xa451('0x50')}]})['then'](handleEntityNotFound(_0x5d7a4b,null))['then'](saveUpdates(_0x4f0110[_0xa451('0x6b')],null))[_0xa451('0x15')](respondWithResult(_0x5d7a4b,null))[_0xa451('0x1f')](handleError(_0x5d7a4b,null));};exports[_0xa451('0x2b')]=function(_0x30c008,_0x3e5e15){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x30c008[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x3e5e15,null))[_0xa451('0x15')](removeEntity(_0x3e5e15,null))['catch'](handleError(_0x3e5e15,null));};exports[_0xa451('0x72')]=function(_0x364d76,_0x2cabfd){return db[_0xa451('0x52')][_0xa451('0x72')]()[_0xa451('0x15')](respondWithResult(_0x2cabfd,null))[_0xa451('0x1f')](handleError(_0x2cabfd,null));};exports[_0xa451('0x73')]=function(_0x12a2f4,_0x705a3){if(_0x12a2f4[_0xa451('0x6b')]['id']){delete _0x12a2f4['body']['id'];}return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x12a2f4[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x705a3,null))[_0xa451('0x15')](function(_0x1c83bd){if(_0x1c83bd){_0x12a2f4[_0xa451('0x6b')][_0xa451('0x74')]=_0x1c83bd['id'];return db[_0xa451('0x75')]['create'](_0x12a2f4['body']);}})[_0xa451('0x15')](respondWithResult(_0x705a3,null))[_0xa451('0x1f')](handleError(_0x705a3,null));};exports['getDispositions']=function(_0x5931cc,_0x513a33){var _0x5a77eb={'raw':![],'where':{}};var _0x2775ab={};var _0x5b0322={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5931cc[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x513a33,null))[_0xa451('0x15')](function(_0x1c75a6){if(_0x1c75a6){_0x2775ab['model']=_[_0xa451('0x67')](db[_0xa451('0x75')][_0xa451('0x53')]);_0x2775ab[_0xa451('0x55')]=_['keys'](_0x5931cc[_0xa451('0x55')]);_0x2775ab[_0xa451('0x56')]=_[_0xa451('0x58')](_0x2775ab[_0xa451('0x4b')],_0x2775ab[_0xa451('0x55')]);_0x5a77eb[_0xa451('0x57')]=_[_0xa451('0x58')](_0x2775ab[_0xa451('0x4b')],qs['fields'](_0x5931cc['query']['fields']));_0x5a77eb['attributes']=_0x5a77eb['attributes'][_0xa451('0x5a')]?_0x5a77eb[_0xa451('0x57')]:_0x2775ab[_0xa451('0x4b')];if(!_0x5931cc[_0xa451('0x55')][_0xa451('0x76')](_0xa451('0x5b'))){_0x5a77eb[_0xa451('0x26')]=qs[_0xa451('0x26')](_0x5931cc[_0xa451('0x55')][_0xa451('0x26')]);_0x5a77eb[_0xa451('0x24')]=qs['offset'](_0x5931cc[_0xa451('0x55')][_0xa451('0x24')]);}_0x5a77eb[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x5931cc[_0xa451('0x55')]['sort']);_0x5a77eb[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x5931cc['query'],_0x2775ab['filters']));_0x5a77eb['where']['ChatWebsiteId']=_0x1c75a6['id'];if(_0x5931cc[_0xa451('0x55')][_0xa451('0x5e')]){_0x5a77eb['where']=_['merge'](_0x5a77eb['where'],{'$or':_[_0xa451('0x51')](_0x5a77eb[_0xa451('0x57')],function(_0x3585a3){var _0x32cf0c={};_0x32cf0c[_0x3585a3]={'$like':'%'+_0x5931cc[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x32cf0c;})});}_0x5a77eb=_['merge']({},_0x5a77eb,_0x5931cc[_0xa451('0x68')]);return db[_0xa451('0x75')]['count']({'where':_0x5a77eb[_0xa451('0x5d')]})[_0xa451('0x15')](function(_0x2b5886){_0x5b0322[_0xa451('0x27')]=_0x2b5886;if(_0x5931cc[_0xa451('0x55')][_0xa451('0x61')]){_0x5a77eb['include']=[{'all':!![]}];}return db[_0xa451('0x75')]['findAll'](_0x5a77eb);})[_0xa451('0x15')](function(_0x190d57){_0x5b0322[_0xa451('0x64')]=_0x190d57;return _0x5b0322;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x513a33,_0x5a77eb))['catch'](handleError(_0x513a33,null));};exports['removeDispositions']=function(_0x3c00e5,_0x286d0d){return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x3c00e5[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x286d0d,null))['then'](function(_0x51d705){if(_0x51d705){return _0x51d705[_0xa451('0x79')](_0x3c00e5['query'][_0xa451('0x7a')]);}})[_0xa451('0x15')](respondWithStatusCode(_0x286d0d,null))[_0xa451('0x1f')](handleError(_0x286d0d,null));};exports[_0xa451('0x7b')]=function(_0x4de97a,_0x5df075){if(_0x4de97a['body']['id']){delete _0x4de97a[_0xa451('0x6b')]['id'];}return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x4de97a[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x5df075,null))[_0xa451('0x15')](function(_0xb7442e){if(_0xb7442e){_0x4de97a[_0xa451('0x6b')][_0xa451('0x74')]=_0xb7442e['id'];return db[_0xa451('0x7c')][_0xa451('0x6a')](_0x4de97a[_0xa451('0x6b')]);}})[_0xa451('0x15')](respondWithResult(_0x5df075,null))[_0xa451('0x1f')](handleError(_0x5df075,null));};exports['getAnswers']=function(_0x1fcfa4,_0x2c7a7d){var _0x5037f2={'raw':![],'where':{}};var _0x1ae5dd={};var _0x2bfb6d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1fcfa4[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x2c7a7d,null))[_0xa451('0x15')](function(_0x504198){if(_0x504198){_0x1ae5dd[_0xa451('0x4b')]=_[_0xa451('0x67')](db['CannedAnswer'][_0xa451('0x53')]);_0x1ae5dd[_0xa451('0x55')]=_[_0xa451('0x67')](_0x1fcfa4[_0xa451('0x55')]);_0x1ae5dd[_0xa451('0x56')]=_['intersection'](_0x1ae5dd['model'],_0x1ae5dd[_0xa451('0x55')]);_0x5037f2[_0xa451('0x57')]=_[_0xa451('0x58')](_0x1ae5dd[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x1fcfa4[_0xa451('0x55')]['fields']));_0x5037f2[_0xa451('0x57')]=_0x5037f2[_0xa451('0x57')][_0xa451('0x5a')]?_0x5037f2['attributes']:_0x1ae5dd[_0xa451('0x4b')];if(!_0x1fcfa4[_0xa451('0x55')]['hasOwnProperty'](_0xa451('0x5b'))){_0x5037f2[_0xa451('0x26')]=qs['limit'](_0x1fcfa4['query'][_0xa451('0x26')]);_0x5037f2[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x1fcfa4[_0xa451('0x55')]['offset']);}_0x5037f2[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x1fcfa4[_0xa451('0x55')][_0xa451('0x5c')]);_0x5037f2['where']=qs['filters'](_[_0xa451('0x78')](_0x1fcfa4['query'],_0x1ae5dd[_0xa451('0x56')]));_0x5037f2[_0xa451('0x5d')][_0xa451('0x74')]=_0x504198['id'];if(_0x1fcfa4[_0xa451('0x55')][_0xa451('0x5e')]){_0x5037f2[_0xa451('0x5d')]=_['merge'](_0x5037f2[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x5037f2[_0xa451('0x57')],function(_0x16d0cf){var _0x5c1519={};_0x5c1519[_0x16d0cf]={'$like':'%'+_0x1fcfa4[_0xa451('0x55')]['filter']+'%'};return _0x5c1519;})});}_0x5037f2=_[_0xa451('0x5f')]({},_0x5037f2,_0x1fcfa4[_0xa451('0x68')]);return db[_0xa451('0x7c')]['count']({'where':_0x5037f2[_0xa451('0x5d')]})[_0xa451('0x15')](function(_0x49b049){_0x2bfb6d[_0xa451('0x27')]=_0x49b049;if(_0x1fcfa4[_0xa451('0x55')][_0xa451('0x61')]){_0x5037f2[_0xa451('0x62')]=[{'all':!![]}];}return db[_0xa451('0x7c')][_0xa451('0x63')](_0x5037f2);})['then'](function(_0x4fb984){_0x2bfb6d[_0xa451('0x64')]=_0x4fb984;return _0x2bfb6d;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x2c7a7d,_0x5037f2))[_0xa451('0x1f')](handleError(_0x2c7a7d,null));};exports[_0xa451('0x7d')]=function(_0x470e48,_0x4fc65a){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x470e48[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x4fc65a,null))[_0xa451('0x15')](function(_0x38e310){if(_0x38e310){return _0x38e310[_0xa451('0x7d')](_0x470e48['query'][_0xa451('0x7a')]);}})['then'](respondWithStatusCode(_0x4fc65a,null))[_0xa451('0x1f')](handleError(_0x4fc65a,null));};exports[_0xa451('0x7e')]=function(_0x2fac29,_0x1aa76d){_0x2fac29[_0xa451('0x6b')][_0xa451('0x7f')]=_0x2fac29['file']['filename'];return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x2fac29[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x1aa76d,null))[_0xa451('0x15')](saveUpdates(_0x2fac29[_0xa451('0x6b')],null))['then'](respondWithResult(_0x1aa76d,null))['catch'](handleError(_0x1aa76d,null));};exports[_0xa451('0x80')]=function(_0x169000,_0x5d9781){_0x169000[_0xa451('0x6b')][_0xa451('0x81')]=_0x169000['file'][_0xa451('0x82')];return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x169000[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x5d9781,null))[_0xa451('0x15')](saveUpdates(_0x169000[_0xa451('0x6b')],null))['then'](respondWithResult(_0x5d9781,null))[_0xa451('0x1f')](handleError(_0x5d9781,null));};exports['addCustomerAvatar']=function(_0x32e14c,_0x58d058){_0x32e14c[_0xa451('0x6b')]['customerAvatar']=_0x32e14c[_0xa451('0x83')][_0xa451('0x82')];return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x32e14c['params']['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x58d058,null))[_0xa451('0x15')](saveUpdates(_0x32e14c[_0xa451('0x6b')],null))[_0xa451('0x15')](respondWithResult(_0x58d058,null))[_0xa451('0x1f')](handleError(_0x58d058,null));};exports['addSystemAvatar']=function(_0x5e0230,_0x440c70){_0x5e0230['body'][_0xa451('0x84')]=_0x5e0230['file']['filename'];return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x5e0230[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x440c70,null))[_0xa451('0x15')](saveUpdates(_0x5e0230[_0xa451('0x6b')],null))[_0xa451('0x15')](respondWithResult(_0x440c70,null))[_0xa451('0x1f')](handleError(_0x440c70,null));};exports['getLogo']=function(_0x514a72,_0x54ed53){var _0x220502=path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x87'));var _0x4f3a02={'where':{'id':_0x514a72[_0xa451('0x71')]['id']},'attributes':['id',_0xa451('0x7f')],'raw':!![]};var _0x1b28d2=![];return require(_0xa451('0x88'))[_0xa451('0x89')]()['then'](function(_0x3e1950){if(_0x3e1950){_0x1b28d2=_0x3e1950[_0xa451('0x8a')];}})[_0xa451('0x15')](function(){return db[_0xa451('0x52')][_0xa451('0x69')](_0x4f3a02);})['then'](handleEntityNotFound(_0x54ed53,null))['then'](function(_0x358067){if(_0x358067){if(!_[_0xa451('0x8b')](_0x358067[_0xa451('0x7f')])){if(fs[_0xa451('0x8c')](path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x8d'),_0x358067['sitepic']))&&_0x1b28d2){_0x220502=path['join'](config[_0xa451('0x86')],'server/files/images/logos/',_0x358067[_0xa451('0x7f')]);}}return _0x54ed53['download'](_0x220502);}})[_0xa451('0x1f')](handleError(_0x54ed53,null));};exports['getAvatar']=function(_0x1f38be,_0x45dc39){var _0x357347=path[_0xa451('0x85')](config['root'],_0xa451('0x8e'));var _0x236743={'where':{'id':_0x1f38be[_0xa451('0x71')]['id']},'attributes':['id',_0xa451('0x81')],'raw':!![]};return db[_0xa451('0x52')][_0xa451('0x69')](_0x236743)[_0xa451('0x15')](handleEntityNotFound(_0x45dc39,null))[_0xa451('0x15')](function(_0x4b1f46){if(_0x4b1f46){if(!_[_0xa451('0x8b')](_0x4b1f46[_0xa451('0x81')])){if(fs['existsSync'](path[_0xa451('0x85')](config[_0xa451('0x86')],'server/files/images/avatars/',_0x4b1f46[_0xa451('0x81')]))){_0x357347=path[_0xa451('0x85')](config['root'],_0xa451('0x8f'),_0x4b1f46['agentAvatar']);}}return _0x45dc39[_0xa451('0x90')](_0x357347);}})[_0xa451('0x1f')](handleError(_0x45dc39,null));};exports['getCustomerAvatar']=function(_0x526c7e,_0x47de25){var _0x4c118b=path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x91'));var _0xe1540b={'where':{'id':_0x526c7e[_0xa451('0x71')]['id']},'attributes':['id',_0xa451('0x92'),_0xa451('0x93')],'raw':!![]};return db['ChatWebsite']['find'](_0xe1540b)[_0xa451('0x15')](handleEntityNotFound(_0x47de25,null))[_0xa451('0x15')](function(_0x596c90){if(_0x596c90){if(!_['isNil'](_0x596c90[_0xa451('0x92')])){if(fs[_0xa451('0x8c')](path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x8f'),_0x596c90[_0xa451('0x92')]))&&_0x596c90[_0xa451('0x93')]){_0x4c118b=path[_0xa451('0x85')](config['root'],_0xa451('0x8f'),_0x596c90[_0xa451('0x92')]);}}return _0x47de25[_0xa451('0x90')](_0x4c118b);}})[_0xa451('0x1f')](handleError(_0x47de25,null));};exports[_0xa451('0x94')]=function(_0xa7b90,_0xfb2ad1){var _0x3b3cd7=path[_0xa451('0x85')](config['root'],_0xa451('0x95'));var _0x3c1eeb={'where':{'id':_0xa7b90['params']['id']},'attributes':['id',_0xa451('0x84')],'raw':!![]};return db[_0xa451('0x52')]['find'](_0x3c1eeb)[_0xa451('0x15')](handleEntityNotFound(_0xfb2ad1,null))[_0xa451('0x15')](function(_0x369f08){if(_0x369f08){if(!_[_0xa451('0x8b')](_0x369f08['systemAvatar'])){if(fs[_0xa451('0x8c')](path[_0xa451('0x85')](config[_0xa451('0x86')],'server/files/images/avatars/',_0x369f08['systemAvatar']))){_0x3b3cd7=path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0x8f'),_0x369f08[_0xa451('0x84')]);}}return _0xfb2ad1['download'](_0x3b3cd7);}})[_0xa451('0x1f')](handleError(_0xfb2ad1,null));};exports[_0xa451('0x96')]=function(_0x2b4503,_0x3dab0e){var _0x794a4={'body':_0x2b4503[_0xa451('0x6b')],'channel':_0xa451('0x97')};var _0x308653=[];var _0x9697a8=[];var _0x4668ff={};var _0x51db81=![];return db[_0xa451('0x98')][_0xa451('0x72')]()['then'](function(_0x3bc965){if(!_0x3bc965){throw new db['Sequelize']['ValidationError'](_0xa451('0x99'));}_0x308653=_[_0xa451('0x9a')](_[_0xa451('0x67')](_0x3bc965),['createdAt',_0xa451('0x9b')]);_0x9697a8=_[_0xa451('0x9a')](_[_0xa451('0x67')](_0x3bc965),[_0xa451('0x9c'),'updatedAt','CompanyId','ListId']);if(_0x2b4503[_0xa451('0x6b')]['id']){delete _0x2b4503[_0xa451('0x6b')]['id'];}if(_[_0xa451('0x8b')](_0x2b4503['body'][_0xa451('0x9d')])){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xa0'));}if(_[_0xa451('0x8b')](_0x2b4503[_0xa451('0x6b')][_0xa451('0x6b')])||_0x2b4503[_0xa451('0x6b')][_0xa451('0x6b')]===''){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa451('0x8b')](_0x2b4503[_0xa451('0x6b')][_0xa451('0xa1')])){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xa2')+_0x9697a8);}if(!_[_0xa451('0xa3')](_0x9697a8,_0x2b4503[_0xa451('0x6b')][_0xa451('0xa1')])){throw new db[(_0xa451('0x9e'))]['ValidationError'](_0xa451('0xa4')+_0x9697a8);}_0x4668ff[_0x2b4503[_0xa451('0x6b')][_0xa451('0xa1')]]=_0x2b4503['body'][_0xa451('0x9d')];})[_0xa451('0x15')](function(){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x2b4503[_0xa451('0x71')]['id']},'include':[{'model':db['CmList'],'as':_0xa451('0xa5'),'include':[{'model':db[_0xa451('0x98')],'as':'Contacts','where':_0x4668ff,'limit':0x1,'order':[[_0xa451('0x9b'),_0xa451('0xa6')]]}]},{'model':db[_0xa451('0xa7')],'as':_0xa451('0xa8')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xa451('0xa9')],'as':_0xa451('0xaa'),'attributes':['id',_0xa451('0x36')],'raw':!![]}]}]});})[_0xa451('0x15')](function(_0x2f6934){if(!_0x2f6934)throw new APINotFoundError(util[_0xa451('0x34')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x2b4503['params']['id']));if(!_0x2f6934[_0xa451('0xa9')]||!_0x2f6934[_0xa451('0xa9')][_0xa451('0xaa')])return[_0x2f6934,!![]];return[_0x2f6934,checkWebsiteIntervals(_0x2f6934)];})[_0xa451('0xab')](function(_0x542fa8,_0x4517b9){if(!_0x4517b9)throw new APIOutOfIntervalError();if(!_0x542fa8['List'])return;_0x794a4[_0xa451('0xac')]=_0x542fa8;_0x794a4['list']=_0x542fa8[_0xa451('0xa5')];_0x794a4[_0xa451('0xad')]=_['orderBy'](_0x542fa8[_0xa451('0xa8')],[_0xa451('0xae')],[_0xa451('0xaf')]);if(_0x794a4[_0xa451('0xac')][_0xa451('0xa8')]){delete _0x794a4['account'][_0xa451('0xa8')];}if(_0x794a4['account'][_0xa451('0xa5')]&&_0x794a4[_0xa451('0xac')][_0xa451('0xa5')][_0xa451('0xb0')][_0xa451('0x5a')]){return _0x794a4[_0xa451('0xac')]['List'][_0xa451('0xb0')][0x0];}var _0x9cfca9=_[_0xa451('0xe')](_0x2b4503[_0xa451('0x6b')],{'firstName':_0x2b4503[_0xa451('0x6b')][_0xa451('0x9d')],'ListId':_0x542fa8['ListId']});_0x9cfca9[_0x2b4503['body'][_0xa451('0xa1')]]=_0x2b4503['body'][_0xa451('0x9d')];return db[_0xa451('0x98')]['create'](_0x9cfca9,{'fields':_0x308653,'raw':!![]});})[_0xa451('0x15')](function(_0x2a09ff){_0x794a4[_0xa451('0xb1')]=_0x2a09ff;var _0x59de77=createInteractionObject(_0x2b4503[_0xa451('0x71')]['id'],_0x2b4503[_0xa451('0x6b')],_0x2b4503[_0xa451('0xb2')],_0x2a09ff);var _0x22190={'ChatWebsiteId':_0x2b4503[_0xa451('0x71')]['id'],'closed':![]};if(_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')]){_0x22190[_0xa451('0xb3')]=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')];return db[_0xa451('0xb4')]['find']({'where':_0x22190})[_0xa451('0x15')](function(_0x1e23ef){if(_0x1e23ef){_0x51db81=!![];return _0x1e23ef;}_0x59de77['threadId']=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')];_0x59de77[_0xa451('0xb5')]=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb5')];return db[_0xa451('0xb4')][_0xa451('0x6a')](_0x59de77);});}_0x22190[_0xa451('0xb6')]=_0x2a09ff['id'];if(_0x2b4503[_0xa451('0x6b')][_0xa451('0xb7')]&&_0x2b4503[_0xa451('0x6b')][_0xa451('0xb7')]['id']){_0x22190['id']=_0x2b4503['body']['interaction']['id'];return db['ChatInteraction'][_0xa451('0x69')]({'where':_0x22190})[_0xa451('0x15')](function(_0x3593cd){if(_0x3593cd){_0x51db81=!![];return _0x3593cd;}return db['ChatInteraction']['create'](_0x59de77);});}return db['ChatInteraction'][_0xa451('0x6a')](_0x59de77);})[_0xa451('0x15')](function(_0x92b96d){if(!_0x51db81)return _0x92b96d;var _0xd99775={'from':(_0x794a4[_0xa451('0xb1')][_0xa451('0x43')]||'')+'\x20'+(_0x794a4[_0xa451('0xb1')][_0xa451('0x44')]||'')};if(_0x2b4503[_0xa451('0x6b')][_0xa451('0xb3')]&&_0x2b4503[_0xa451('0x6b')][_0xa451('0xb8')]&&_0x2b4503[_0xa451('0x6b')]['threadId']!=_0x2b4503[_0xa451('0x6b')][_0xa451('0xb8')]){_0xd99775['threadId']=_0x2b4503['body']['messageId'];}return _0x92b96d[_0xa451('0x2a')](_0xd99775);})['then'](function(_0x51de02){_0x794a4[_0xa451('0xb7')]=_0x51de02[_0xa451('0x2c')]({'plain':!![]});_0x794a4[_0xa451('0xb7')][_0xa451('0xb9')]=!_0x51db81;if(_0x794a4[_0xa451('0xb7')][_0xa451('0xb9')]){if(_0x794a4[_0xa451('0xac')][_0xa451('0xba')]){_0x794a4[_0xa451('0xad')]['push']({'id':0x0,'priority':_0x794a4[_0xa451('0xad')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xa451('0xbb')][_0xa451('0x6a')]({'body':_0x2b4503[_0xa451('0x6b')]['body'],'ChatWebsiteId':_0x2b4503[_0xa451('0x71')]['id'],'ChatInteractionId':_0x51de02['id'],'direction':'in','ContactId':_0x794a4[_0xa451('0xb1')]['id'],'AttachmentId':_0x2b4503[_0xa451('0x6b')]['AttachmentId']});})[_0xa451('0x15')](function(_0x28a88c){_0x794a4[_0xa451('0x1c')]=_0x28a88c;if(!_0x794a4[_0xa451('0xb7')][_0xa451('0xbc')]){return;}return db['User'][_0xa451('0x69')]({'attributes':['id',_0xa451('0x2f')],'where':{'id':_0x794a4[_0xa451('0xb7')][_0xa451('0xbc')]}});})[_0xa451('0x15')](function(_0x4f1e37){if(_0x4f1e37){_0x794a4[_0xa451('0xad')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa451('0xbd'),'appdata':_0x4f1e37[_0xa451('0x2f')]+','+(_0x794a4[_0xa451('0xac')][_0xa451('0xbe')]||0xa),'interval':_0xa451('0xbf')});_0x794a4[_0xa451('0xc0')]=!![];}if(!_0x794a4[_0xa451('0xb7')][_0xa451('0xc1')]){return;}return db[_0xa451('0xc2')][_0xa451('0x69')]({'attributes':['id',_0xa451('0x2f')],'where':{'id':_0x794a4['interaction']['queueId']}});})['then'](function(_0x31d072){if(_0x31d072){_0x794a4[_0xa451('0xad')][_0xa451('0xc3')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x31d072[_0xa451('0x2f')]+','+(_0x794a4[_0xa451('0xac')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa451('0xc4'),_0xa451('0xc5'),_0x794a4);})[_0xa451('0x15')](function(_0x3cd67a){respondWithRpcPromise('EventManager','EventManager',{'event':_0xa451('0x96'),'message':_0x3cd67a},client9002);return _0x3cd67a;})[_0xa451('0x15')](respondWithResult(_0x3dab0e,null))['catch'](APIHandleError(_0x3dab0e));};exports[_0xa451('0xc6')]=function(_0x46047f,_0x5c5d46){var _0x4b4c07,_0x1ea90f,_0x591dcb;var _0x4d3580=[];var _0x54ba85={};var _0x41d329=_0x46047f[_0xa451('0xc7')]||[];var _0x2595e9=[];var _0x2e5718;return db['CmContact'][_0xa451('0x72')]()[_0xa451('0x15')](function(_0x2459ca){if(!_0x2459ca){throw new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))]('no\x20available\x20attributes');}_0x4d3580=_['difference'](_[_0xa451('0x67')](_0x2459ca),[_0xa451('0x9c'),_0xa451('0x9b'),'CompanyId','ListId']);if(_0x46047f[_0xa451('0x6b')]['id']){delete _0x46047f[_0xa451('0x6b')]['id'];}if(_[_0xa451('0x8b')](_0x46047f['body'][_0xa451('0x9d')])){throw _0x5c5d46[_0xa451('0x21')](0x1f4)['send'](new db[(_0xa451('0x9e'))]['ValidationError'](_0xa451('0xa0')));}if(_[_0xa451('0x8b')](_0x46047f['body']['body'])||_0x46047f[_0xa451('0x6b')]['body']===''){throw _0x5c5d46[_0xa451('0x21')](0x1f4)[_0xa451('0x30')](new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xc8')));}if(_[_0xa451('0x8b')](_0x46047f[_0xa451('0x6b')]['mapKeyOffline'])){throw _0x5c5d46['status'](0x1f4)[_0xa451('0x30')](new db[(_0xa451('0x9e'))][(_0xa451('0x9f'))](_0xa451('0xc9')+_0x4d3580));}if(!_['includes'](_0x4d3580,_0x46047f[_0xa451('0x6b')][_0xa451('0xca')])){throw _0x5c5d46['status'](0x1f4)[_0xa451('0x30')](new db[(_0xa451('0x9e'))]['ValidationError'](_0xa451('0xcb')+_0x4d3580));}_0x54ba85[_0x46047f[_0xa451('0x6b')][_0xa451('0xca')]]=_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')];})[_0xa451('0x15')](function(){return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x46047f['params']['id']},'include':[{'model':db[_0xa451('0xcc')],'as':_0xa451('0xa5')},{'model':db[_0xa451('0xcd')],'as':_0xa451('0xcd')}]});})[_0xa451('0x15')](handleEntityNotFound(_0x5c5d46,null))[_0xa451('0x15')](function(_0x2f2009){if(_0x2f2009&&_0x2f2009['List']){_0x1ea90f=_0x2f2009;var _0x637458=_['defaults'](_0x46047f[_0xa451('0x6b')],{'firstName':_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')],'phone':_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')],'ListId':_0x2f2009[_0xa451('0xce')]});_0x637458[_0x46047f[_0xa451('0x6b')][_0xa451('0xca')]]=_0x46047f[_0xa451('0x6b')][_0xa451('0x9d')];return db[_0xa451('0x98')]['findOrCreate']({'where':_0x54ba85,'defaults':_0x637458});}})[_0xa451('0xab')](function(_0x2c58b6){if(_0x2c58b6){_0x591dcb=_0x2c58b6;var _0x58b158=fs[_0xa451('0xcf')](path[_0xa451('0x85')](config[_0xa451('0x86')],_0xa451('0xd0')),_0xa451('0xd1'));var _0x1c1d95=ejs['render'](_0x58b158,{'body':_[_0xa451('0xd2')](_0x46047f[_0xa451('0x6b')]['body']),'bodyTitle':_0x1ea90f[_0xa451('0xd3')]});return db[_0xa451('0xd4')][_0xa451('0x6a')]({'body':_0x1c1d95,'plainBody':htmlToText[_0xa451('0xd5')](_0x1c1d95),'ContactId':_0x2c58b6['id'],'ChatWebsiteId':_0x1ea90f['id']});}})[_0xa451('0x15')](function(_0x46cacf){_0x2e5718=_0x46cacf;if(_0x41d329[_0xa451('0x5a')]){var _0x4981e3=_0x41d329[_0xa451('0x51')](function(_0x4989b9){return{'name':_0x4989b9[_0xa451('0xd6')],'basename':_0x4989b9[_0xa451('0x82')],'type':_0x4989b9[_0xa451('0xd7')],'ChatOfflineMessageId':_0x46cacf['id']};});_0x2595e9=_0x4981e3[_0xa451('0x51')](_0x1ec2e4=>{var _0x4bb01d={'filename':_0x1ec2e4[_0xa451('0x2f')],'path':path['join'](config[_0xa451('0x86')],_0xa451('0xd8'),_0xa451('0xc7'),_0xa451('0xd9'),_0xa451('0xda'),_0x1ec2e4[_0xa451('0xdb')])};return _0x4bb01d;});if(!_0x1ea90f[_0xa451('0xdc')]){return db[_0xa451('0xdd')][_0xa451('0xde')](function(_0x470530){return db[_0xa451('0xdf')][_0xa451('0xe0')](_0x4981e3,{'transaction':_0x470530});});}}})[_0xa451('0x15')](function(){if(_0x2e5718){_0x4b4c07=_0x2e5718;return db[_0xa451('0xcd')][_0xa451('0xe1')]({'where':{'service':!![]},'include':[{'model':db[_0xa451('0xe2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa451('0xe3')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xa451('0x15')](function(_0x46d3f6){if(_0x46d3f6&&_0x46d3f6[_0xa451('0xe4')]&&_0x1ea90f[_0xa451('0xe5')]&&_0x1ea90f['forwardOfflineAddress']){var _0x113abb=_0x46d3f6['getSmtpOptions']();return respondWithRpcPromise(_0xa451('0xe6'),_0xa451('0xe7'),{'account':_0x113abb,'message':{'from':util[_0xa451('0x34')](_0xa451('0xe8'),_0x46d3f6[_0xa451('0x2f')],_0x46d3f6[_0xa451('0xe9')]||_0x46d3f6['Smtp'][_0xa451('0x6e')]),'to':_0x1ea90f[_0xa451('0xea')],'subject':_0x1ea90f[_0xa451('0xeb')],'html':_0x4b4c07[_0xa451('0x6b')],'attachments':_0x2595e9}},client9003)['then'](function(){return _0x4b4c07;})['catch'](function(_0x32e268){logger[_0xa451('0x1a')](_0x32e268);});}})[_0xa451('0x15')](function(){if(_0x1ea90f&&_0x1ea90f[_0xa451('0xdc')]&&_0x1ea90f[_0xa451('0xec')]){var _0x425b03=[];if(_0x41d329[_0xa451('0x5a')]){_0x425b03=_0x41d329[_0xa451('0x51')](function(_0x3b4348){return{'name':_0x3b4348[_0xa451('0xd6')],'basename':_0x3b4348[_0xa451('0x82')],'type':_0x3b4348[_0xa451('0xd7')],'ChatOfflineMessageId':_0x2e5718['id']};});}var _0x51ab28;if(!_[_0xa451('0x8b')](_0x1ea90f[_0xa451('0xed')])){var _0x3bd9a7=_['map'](_0x46047f['body'],function(_0x2aa17c){return _0x2aa17c;});var _0x50989b=_[_0xa451('0xee')](_0x3bd9a7)[0x0];var _0x2af2a6=_['mapValues'](_0x50989b,function(_0x19d33f){return _0x19d33f;});_0x51ab28=_0x2af2a6[0x1][_0x1ea90f['subjectOffline']];}var _0x122422={'from':_0x591dcb[_0xa451('0xe9')],'firstName':_0x591dcb['firstName'],'lastName':_0x591dcb[_0xa451('0x44')],'mapKey':'email','message':{'from':_0x591dcb[_0xa451('0xe9')],'to':_0x1ea90f[_0xa451('0xcd')][_0xa451('0xe9')],'cc':'','subject':_[_0xa451('0x8b')](_0x51ab28)?_0x1ea90f['offlineMessageSubject']:_0x51ab28,'messageId':'','sentAt':new Date(),'attach':_0x425b03['length'],'attachments':_0x425b03,'originChannel':'Chat','ChatWebsiteId':_0x1ea90f['id'],'ChatOfflineMessageId':_0x4b4c07['id'],'originTo':_0x1ea90f[_0xa451('0xcd')]['email']},'body':_0x4b4c07[_0xa451('0x6b')]};var _0x4b50ed={'account':{'id':_0x1ea90f['MailAccountId']},'body':_0x122422,'log':_0xa451('0xef')};return respondWithRpcPromise(_0xa451('0xef'),_0xa451('0xf0'),_0x4b50ed,client9001)[_0xa451('0x15')](function(){return _0x4b4c07;})[_0xa451('0x1f')](function(_0x5c7102){logger[_0xa451('0x1a')](_0x5c7102);});}return;})[_0xa451('0x15')](function(){if(_0x4b4c07){return _0x4b4c07;}})[_0xa451('0x15')](respondWithResult(_0x5c5d46,null))[_0xa451('0x1f')](function(){for(var _0x8da88e of _0x41d329){var _0x3f6704=path['join'](config[_0xa451('0x86')],_0xa451('0xd8'),_0xa451('0xc7'),'attachments',_0xa451('0xda'),_0x8da88e[_0xa451('0x82')]);fs_extra[_0xa451('0xf1')](_0x3f6704)[_0xa451('0x1f')](function(_0x954420){logger[_0xa451('0x1a')](_0xa451('0xf2'),_0x3f6704,_0x954420);});}});};exports[_0xa451('0xf3')]=function(_0x2bbabe,_0x4c6a1f){return db[_0xa451('0xb4')][_0xa451('0x69')]({'where':{'id':_0x2bbabe[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x4c6a1f,null))[_0xa451('0x15')](function(_0x22094b){if(_0x22094b){return _0x22094b[_0xa451('0xf3')](_0x2bbabe['body']['ids'],_[_0xa451('0xf4')](_0x2bbabe[_0xa451('0x6b')],[_0xa451('0x7a'),'id'])||{});}})[_0xa451('0x15')](respondWithResult(_0x4c6a1f,null))[_0xa451('0x1f')](handleError(_0x4c6a1f,null));};exports[_0xa451('0xf5')]=function(_0x277624,_0x411c25){var _0x216e5c={'raw':![],'where':{}};var _0x32d330={};var _0x340046={'count':0x0,'rows':[]};return db[_0xa451('0x52')][_0xa451('0xe1')]({'where':{'id':_0x277624[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x411c25,null))[_0xa451('0x15')](function(_0x156a3e){if(_0x156a3e){_0x32d330[_0xa451('0x4b')]=_['keys'](db[_0xa451('0xb4')][_0xa451('0x53')]);_0x32d330[_0xa451('0x55')]=_['keys'](_0x277624['query']);_0x32d330[_0xa451('0x56')]=_[_0xa451('0x58')](_0x32d330[_0xa451('0x4b')],_0x32d330[_0xa451('0x55')]);_0x216e5c[_0xa451('0x57')]=_['intersection'](_0x32d330['model'],qs[_0xa451('0x59')](_0x277624['query']['fields']));_0x216e5c['attributes']=_0x216e5c['attributes'][_0xa451('0x5a')]?_0x216e5c[_0xa451('0x57')]:_0x32d330[_0xa451('0x4b')];if(!_0x277624['query'][_0xa451('0x76')]('nolimit')){_0x216e5c[_0xa451('0x26')]=qs['limit'](_0x277624['query'][_0xa451('0x26')]);_0x216e5c[_0xa451('0x24')]=qs['offset'](_0x277624[_0xa451('0x55')][_0xa451('0x24')]);}_0x216e5c[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x277624['query'][_0xa451('0x5c')]);_0x216e5c[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x277624['query'],_0x32d330[_0xa451('0x56')]));_0x216e5c[_0xa451('0x5d')][_0xa451('0x74')]=_0x156a3e['id'];if(_0x277624['query'][_0xa451('0x5e')]){_0x216e5c[_0xa451('0x5d')]=_['merge'](_0x216e5c['where'],{'$or':_[_0xa451('0x51')](_0x216e5c[_0xa451('0x57')],function(_0x2c92f8){var _0x50636b={};_0x50636b[_0x2c92f8]={'$like':'%'+_0x277624[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x50636b;})});}_0x216e5c=_[_0xa451('0x5f')]({},_0x216e5c,_0x277624['options']);return db[_0xa451('0xb4')]['count']({'where':_0x216e5c['where']})['then'](function(_0x119ebc){_0x340046[_0xa451('0x27')]=_0x119ebc;if(_0x277624[_0xa451('0x55')][_0xa451('0x61')]){_0x216e5c[_0xa451('0x62')]=[{'model':db[_0xa451('0x98')],'as':_0xa451('0xf6'),'required':![]},{'model':db['User'],'as':_0xa451('0xf7'),'attributes':[_0xa451('0x2f'),_0xa451('0xf8'),'internal'],'required':![]},{'model':db[_0xa451('0xf9')],'as':_0xa451('0xfa'),'attributes':['id',_0xa451('0x2f'),_0xa451('0xfb')],'where':_0x277624[_0xa451('0x55')][_0xa451('0xfc')]?{'id':_0x277624['query'][_0xa451('0xfc')]}:undefined,'required':_0x277624[_0xa451('0x55')][_0xa451('0xfc')]?!![]:![]}];}return db[_0xa451('0xb4')][_0xa451('0x63')](_0x216e5c);})[_0xa451('0x15')](function(_0x455542){_0x340046[_0xa451('0x64')]=_0x455542;return _0x340046;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x411c25,_0x216e5c))[_0xa451('0x1f')](handleError(_0x411c25,null));};exports[_0xa451('0x31')]=function(_0x58d166,_0x22b771){var _0x510d70=0x0;var _0xa02d97=0x0;var _0x545920=![];var _0x1b7fb0;var _0x11e5ae;return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x58d166[_0xa451('0x71')]['id']},'include':[{'model':db['Interval'],'as':_0xa451('0xa9'),'include':[{'model':db['Interval'],'as':_0xa451('0xaa'),'attributes':['id',_0xa451('0x36')]}]}]})[_0xa451('0x15')](handleEntityNotFound(_0x22b771,null))[_0xa451('0x15')](function(_0x2d104f){if(_0x2d104f){_0x1b7fb0=_0x2d104f;return _0x2d104f[_0xa451('0xfd')]({'raw':!![]});}})['then'](function(_0x46ca16){if(_0x1b7fb0){if(_0x46ca16){_0x11e5ae=_0x46ca16;}}return require(_0xa451('0x88'))[_0xa451('0x89')]();})[_0xa451('0x15')](function(_0x5cd83d){if(_0x5cd83d){_0xa02d97=_0x5cd83d[_0xa451('0xfe')];_0x545920=_0x5cd83d[_0xa451('0x8a')];}})[_0xa451('0x15')](function(){return db[_0xa451('0xb4')]['count']({'where':{'closed':![]}});})[_0xa451('0x15')](function(_0x115d5b){_0x510d70=_0x115d5b;if(_0xa02d97&&_0x115d5b>_0xa02d97){return db[_0xa451('0xff')][_0xa451('0xe1')]({'where':{'id':0x1}})[_0xa451('0x15')](function(_0x5e89bb){if(_0x5e89bb){_0x5e89bb[_0xa451('0x100')]('chatLicenseExceeded');}});}})[_0xa451('0x15')](function(){if(!_0x1b7fb0[_0xa451('0xa9')]||!_0x1b7fb0['Interval']['Intervals'])return!![];return checkWebsiteIntervals(_0x1b7fb0);})[_0xa451('0x15')](function(_0x4882ed){var _0x2c22c5=fs[_0xa451('0xcf')](path[_0xa451('0x85')](config['root'],'server/files/chat/iframe.ejs'),_0xa451('0xd1'));var _0x2f05a9=new url['URL'](_0x1b7fb0[_0xa451('0x101')])[_0xa451('0x102')];var _0xdaee2d=_0xa451('0x103');var _0x2d91e9=![];var _0x189c91={'chatVersion':_0xdaee2d,'chatWebsiteAddressOrigin':_0x2f05a9,'remote':_0x1b7fb0['remote'],'query':querystring['stringify'](_[_0xa451('0x5f')](_0x1b7fb0['get']({'plain':!![]}),{'customerIp':_0x58d166[_0xa451('0xb2')][_0xa451('0x41')]||_0x58d166[_0xa451('0xb2')][_0xa451('0x104')]||_0x58d166[_0xa451('0x105')][_0xa451('0x106')]||_0x58d166['ip'],'referer':_0x58d166[_0xa451('0xb2')][_0xa451('0x45')],'openedInteractions':_0x510d70,'maxInteractions':_0xa02d97,'virtual':_0x545920[_0xa451('0xfe')],'online':_0x4882ed,'custom':_0x545920}))[_0xa451('0x107')](/'/g,'\x5c\x27')};_0x22b771['send'](ejs[_0xa451('0x108')](Mustache[_0xa451('0x108')](_0x2c22c5,_0x189c91),{'proactiveActions':_0x11e5ae,'alignment':_0x1b7fb0[_0xa451('0x109')],'verticalAlignment':_0x1b7fb0['verticalAlignment'],'div_color':_0x1b7fb0[_0xa451('0xfb')],'labelText':_0x1b7fb0['labelText'],'text_color':_0x1b7fb0[_0xa451('0x10a')],'text_button_color':_0x1b7fb0[_0xa451('0x10b')],'button_color':_0x1b7fb0[_0xa451('0x10c')],'background_color':_0x1b7fb0[_0xa451('0x10d')],'hideWhenOffline':_0x1b7fb0[_0xa451('0x10e')],'intervalId':_0x1b7fb0[_0xa451('0x10f')],'isDevelopment':_0x2d91e9,'chatVersion':_0xdaee2d}));})[_0xa451('0x1f')](handleError(_0x22b771,null));};exports[_0xa451('0x110')]=function(_0x4b02a7,_0x1d06c8){var _0x5ced96=_0x4b02a7['params']['id'];var _0x5a11c2=_0x4b02a7['body'];var _0x4e79f2=0xc8;var _0x3c5158=null;return db[_0xa451('0xdd')][_0xa451('0xde')]({'isolationLevel':db[_0xa451('0xdd')][_0xa451('0x111')][_0xa451('0x112')][_0xa451('0x113')]},function(_0x167ae1){return db[_0xa451('0x52')]['findOne']({'where':{'id':_0x5ced96},'transaction':_0x167ae1})[_0xa451('0x15')](function(_0x4bd096){if(_0x4bd096){return db[_0xa451('0xa7')][_0xa451('0x2b')]({'where':{'ChatWebsiteId':_0x5ced96},'transaction':_0x167ae1})[_0xa451('0x15')](function(){var _0x26ce7e=_[_0xa451('0x51')](_0x5a11c2,function(_0x582998){_0x582998[_0xa451('0x74')]=_0x5ced96;return _0x582998;});return db[_0xa451('0xa7')][_0xa451('0xe0')](_0x26ce7e,{'transaction':_0x167ae1});});}else{_0x4e79f2=0x194;_0x3c5158=[];}});})[_0xa451('0x15')](function(){if(_0x4e79f2!==0x194){return db[_0xa451('0xa7')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5ced96},'order':_0xa451('0xae')})[_0xa451('0x15')](function(_0x14bf4d){_0x3c5158=_0x14bf4d;});}})[_0xa451('0x1f')](function(_0x5af255){_0x4e79f2=0x1f4;logger[_0xa451('0x1a')](_0x5af255[_0xa451('0x114')]);if(_0x5af255[_0xa451('0x2f')]){delete _0x5af255[_0xa451('0x2f')];}_0x3c5158=_0x5af255;})[_0xa451('0x115')](function(){if(_0x3c5158===null){_0x1d06c8[_0xa451('0x20')](_0x4e79f2);}else{if(_0x4e79f2===0x1f4){_0x1d06c8[_0xa451('0x21')](_0x4e79f2)[_0xa451('0x30')](_0x3c5158);}else{_0x1d06c8[_0xa451('0x21')](_0x4e79f2)[_0xa451('0x23')](_0x3c5158);}}});};exports[_0xa451('0x116')]=function(_0x40d4d3,_0x538511){var _0x115536={};var _0xfc1cb7={};var _0x54814f;var _0x50f675;return db['ChatWebsite']['findOne']({'where':{'id':_0x40d4d3[_0xa451('0x71')]['id']}})['then'](handleEntityNotFound(_0x538511,null))['then'](function(_0x2d5d30){if(_0x2d5d30){_0x54814f=_0x2d5d30;_0xfc1cb7[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0xa7')][_0xa451('0x53')]);_0xfc1cb7[_0xa451('0x55')]=_[_0xa451('0x67')](_0x40d4d3['query']);_0xfc1cb7[_0xa451('0x56')]=_[_0xa451('0x58')](_0xfc1cb7[_0xa451('0x4b')],_0xfc1cb7['query']);_0x115536['attributes']=_[_0xa451('0x58')](_0xfc1cb7[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x40d4d3[_0xa451('0x55')][_0xa451('0x59')]));_0x115536[_0xa451('0x57')]=_0x115536[_0xa451('0x57')][_0xa451('0x5a')]?_0x115536['attributes']:_0xfc1cb7[_0xa451('0x4b')];_0x115536[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x40d4d3[_0xa451('0x55')]['sort']);_0x115536['where']=qs['filters'](_[_0xa451('0x78')](_0x40d4d3[_0xa451('0x55')],_0xfc1cb7[_0xa451('0x56')]));if(_0x40d4d3['query']['filter']){_0x115536['where']=_[_0xa451('0x5f')](_0x115536[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x115536[_0xa451('0x57')],function(_0x3b950d){var _0x16707c={};_0x16707c[_0x3b950d]={'$like':'%'+_0x40d4d3['query'][_0xa451('0x5e')]+'%'};return _0x16707c;})});}_0x115536=_['merge']({},_0x115536,_0x40d4d3[_0xa451('0x68')]);return _0x54814f[_0xa451('0x116')](_0x115536);}})[_0xa451('0x15')](function(_0x5e66ca){if(_0x5e66ca){_0x50f675=_0x5e66ca[_0xa451('0x5a')];if(!_0x40d4d3['query'][_0xa451('0x76')](_0xa451('0x5b'))){_0x115536['limit']=qs['limit'](_0x40d4d3[_0xa451('0x55')][_0xa451('0x26')]);_0x115536['offset']=qs[_0xa451('0x24')](_0x40d4d3['query'][_0xa451('0x24')]);}return _0x54814f['getApplications'](_0x115536);}})[_0xa451('0x15')](function(_0x347408){if(_0x347408){return _0x347408?{'count':_0x50f675,'rows':_0x347408}:null;}})[_0xa451('0x15')](respondWithResult(_0x538511,null))[_0xa451('0x1f')](handleError(_0x538511,null));};exports[_0xa451('0x117')]=function(_0x56d491,_0x54bcb0){return db[_0xa451('0x118')][_0xa451('0x69')]({'where':{'id':_0x56d491[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x54bcb0,null))[_0xa451('0x15')](function(_0x1a5ae2){if(_0x1a5ae2){return _0x1a5ae2[_0xa451('0x117')](_0x56d491[_0xa451('0x6b')][_0xa451('0x7a')],_[_0xa451('0xf4')](_0x56d491[_0xa451('0x6b')],[_0xa451('0x7a'),'id'])||{});}})[_0xa451('0x15')](respondWithResult(_0x54bcb0,null))[_0xa451('0x1f')](handleError(_0x54bcb0,null));};exports[_0xa451('0xfd')]=function(_0x142e3e,_0x3dc180){var _0x470c4e={};var _0x4f48ab={};var _0xe22270;var _0x34e459;return db[_0xa451('0x52')][_0xa451('0xe1')]({'where':{'id':_0x142e3e[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x3dc180,null))[_0xa451('0x15')](function(_0xc58a24){if(_0xc58a24){_0xe22270=_0xc58a24;_0x4f48ab[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0x119')][_0xa451('0x53')]);_0x4f48ab['query']=_[_0xa451('0x67')](_0x142e3e[_0xa451('0x55')]);_0x4f48ab[_0xa451('0x56')]=_[_0xa451('0x58')](_0x4f48ab[_0xa451('0x4b')],_0x4f48ab[_0xa451('0x55')]);_0x470c4e[_0xa451('0x57')]=_[_0xa451('0x58')](_0x4f48ab[_0xa451('0x4b')],qs['fields'](_0x142e3e['query'][_0xa451('0x59')]));_0x470c4e['attributes']=_0x470c4e['attributes']['length']?_0x470c4e[_0xa451('0x57')]:_0x4f48ab[_0xa451('0x4b')];_0x470c4e[_0xa451('0x77')]=qs['sort'](_0x142e3e[_0xa451('0x55')][_0xa451('0x5c')]);_0x470c4e['where']=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x142e3e['query'],_0x4f48ab[_0xa451('0x56')]));if(_0x142e3e[_0xa451('0x55')][_0xa451('0x5e')]){_0x470c4e[_0xa451('0x5d')]=_['merge'](_0x470c4e[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x470c4e[_0xa451('0x57')],function(_0x2d6e15){var _0x4ba9f7={};_0x4ba9f7[_0x2d6e15]={'$like':'%'+_0x142e3e['query'][_0xa451('0x5e')]+'%'};return _0x4ba9f7;})});}_0x470c4e=_[_0xa451('0x5f')]({},_0x470c4e,_0x142e3e[_0xa451('0x68')]);return _0xe22270[_0xa451('0xfd')](_0x470c4e);}})[_0xa451('0x15')](function(_0xd47bde){if(_0xd47bde){_0x34e459=_0xd47bde[_0xa451('0x5a')];if(!_0x142e3e[_0xa451('0x55')][_0xa451('0x76')]('nolimit')){_0x470c4e[_0xa451('0x26')]=qs[_0xa451('0x26')](_0x142e3e[_0xa451('0x55')][_0xa451('0x26')]);_0x470c4e[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x142e3e[_0xa451('0x55')]['offset']);}return _0xe22270[_0xa451('0xfd')](_0x470c4e);}})[_0xa451('0x15')](function(_0x203e5b){if(_0x203e5b){return _0x203e5b?{'count':_0x34e459,'rows':_0x203e5b}:null;}})[_0xa451('0x15')](respondWithResult(_0x3dc180,null))['catch'](handleError(_0x3dc180,null));};exports['getFields']=function(_0x5b90d3,_0x1850c6){var _0x31b1e2=_0x5b90d3[_0xa451('0x55')][_0xa451('0x11a')]==='false'?'offlineForm':'onlineForm';return db[_0xa451('0x52')]['find']({'attributes':['id',_0x31b1e2],'where':{'id':_0x5b90d3[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x1850c6,null))['then'](function(_0x28ac76){if(_0x28ac76){var _0x5b47e7=_0x28ac76[_0x31b1e2];var _0xc1f47d=_0x5b47e7&&_0x5b47e7[_0xa451('0x11b')]?_0x5b47e7[_0xa451('0x11b')]:[];_0x1850c6[_0xa451('0x30')]({'fromKey':_[_0xa451('0x8b')](_0x5b47e7[_0xa451('0x11c')])?undefined:_0x5b47e7['fromKey'],'count':_0xc1f47d['length'],'rows':_0xc1f47d});}})[_0xa451('0x1f')](handleError(_0x1850c6,null));};exports[_0xa451('0x11d')]=function(_0x2decbc,_0x12d6c8){var _0x5bdf4b={'raw':![],'where':{}};var _0x5b74f4={};var _0x15847d={'count':0x0,'rows':[]};return db[_0xa451('0x52')][_0xa451('0xe1')]({'where':{'id':_0x2decbc[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x12d6c8,null))[_0xa451('0x15')](function(_0xab5a50){if(_0xab5a50){_0x5b74f4[_0xa451('0x4b')]=_[_0xa451('0x67')](db[_0xa451('0xd4')][_0xa451('0x53')]);_0x5b74f4[_0xa451('0x55')]=_[_0xa451('0x67')](_0x2decbc['query']);_0x5b74f4[_0xa451('0x56')]=_[_0xa451('0x58')](_0x5b74f4[_0xa451('0x4b')],_0x5b74f4['query']);_0x5bdf4b[_0xa451('0x57')]=_[_0xa451('0x58')](_0x5b74f4['model'],qs[_0xa451('0x59')](_0x2decbc['query']['fields']));_0x5bdf4b['attributes']=_0x5bdf4b[_0xa451('0x57')][_0xa451('0x5a')]?_0x5bdf4b[_0xa451('0x57')]:_0x5b74f4[_0xa451('0x4b')];if(!_0x2decbc[_0xa451('0x55')]['hasOwnProperty'](_0xa451('0x5b'))){_0x5bdf4b[_0xa451('0x26')]=qs['limit'](_0x2decbc[_0xa451('0x55')][_0xa451('0x26')]);_0x5bdf4b[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x2decbc['query']['offset']);}_0x5bdf4b[_0xa451('0x77')]=qs[_0xa451('0x5c')](_0x2decbc[_0xa451('0x55')][_0xa451('0x5c')]);_0x5bdf4b[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x2decbc[_0xa451('0x55')],_0x5b74f4['filters']));_0x5bdf4b[_0xa451('0x5d')]['ChatWebsiteId']=_0xab5a50['id'];if(_0x2decbc['query'][_0xa451('0x5e')]){_0x5bdf4b['where']=_['merge'](_0x5bdf4b[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x5bdf4b[_0xa451('0x57')],function(_0x2b63ec){var _0x53bd6d={};_0x53bd6d[_0x2b63ec]={'$like':'%'+_0x2decbc['query']['filter']+'%'};return _0x53bd6d;})});}_0x5bdf4b=_[_0xa451('0x5f')]({},_0x5bdf4b,_0x2decbc[_0xa451('0x68')]);return db[_0xa451('0xd4')]['count']({'where':_0x5bdf4b[_0xa451('0x5d')]})['then'](function(_0x32fe2c){_0x15847d[_0xa451('0x27')]=_0x32fe2c;if(_0x2decbc[_0xa451('0x55')]['includeAll']){_0x5bdf4b['include']=[{'all':!![]}];}else{_0x5bdf4b[_0xa451('0x62')]=[{'model':db[_0xa451('0x98')],'as':_0xa451('0xf6'),'required':![]},{'model':db[_0xa451('0xdf')],'as':'Attachments','required':![]}];}return db[_0xa451('0xd4')][_0xa451('0x63')](_0x5bdf4b);})[_0xa451('0x15')](function(_0x362ec){_0x15847d[_0xa451('0x64')]=_0x362ec;return _0x15847d;});}})[_0xa451('0x15')](respondWithFilteredResult(_0x12d6c8,_0x5bdf4b))[_0xa451('0x1f')](handleError(_0x12d6c8,null));};exports[_0xa451('0x11e')]=function(_0x38a4e7,_0x435400){return db[_0xa451('0x52')][_0xa451('0x69')]({'where':{'id':_0x38a4e7['params']['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x435400,null))[_0xa451('0x15')](function(_0x2e5b7c){if(_0x2e5b7c){return _0x2e5b7c[_0xa451('0x11e')](_0x38a4e7[_0xa451('0x6b')][_0xa451('0x7a')],_[_0xa451('0xf4')](_0x38a4e7[_0xa451('0x6b')],['ids','id'])||{})['spread'](function(_0x271603){for(var _0x24a7bb=0x0;_0x24a7bb<_0x38a4e7[_0xa451('0x6b')]['ids']['length'];_0x24a7bb+=0x1){socket[_0xa451('0x11f')](_0xa451('0x120'),{'UserId':Number(_0x38a4e7[_0xa451('0x6b')]['ids'][_0x24a7bb]),'ChatWebsiteId':Number(_0x38a4e7['params']['id'])});}return _0x271603;});}})[_0xa451('0x15')](respondWithResult(_0x435400,null))[_0xa451('0x1f')](handleError(_0x435400,null));};exports[_0xa451('0x121')]=function(_0x3baa50,_0x47a054){return db['ChatWebsite'][_0xa451('0x69')]({'where':{'id':_0x3baa50['params']['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x47a054,null))['then'](function(_0x4c31e0){if(_0x4c31e0){return _0x4c31e0['removeAgents'](_0x3baa50[_0xa451('0x55')][_0xa451('0x7a')])[_0xa451('0x15')](function(){if(_['isArray'](_0x3baa50[_0xa451('0x55')]['ids'])){for(var _0x2f7e4d=0x0;_0x2f7e4d<_0x3baa50[_0xa451('0x55')][_0xa451('0x7a')][_0xa451('0x5a')];_0x2f7e4d+=0x1){socket[_0xa451('0x11f')](_0xa451('0x122'),{'UserId':Number(_0x3baa50[_0xa451('0x55')]['ids'][_0x2f7e4d]),'ChatWebsiteId':Number(_0x3baa50[_0xa451('0x71')]['id'])});}}else{socket[_0xa451('0x11f')](_0xa451('0x122'),{'UserId':Number(_0x3baa50[_0xa451('0x55')]['ids']),'ChatWebsiteId':Number(_0x3baa50[_0xa451('0x71')]['id'])});}});}})[_0xa451('0x15')](respondWithStatusCode(_0x47a054,null))[_0xa451('0x1f')](handleError(_0x47a054,null));};exports[_0xa451('0x123')]=function(_0x57abf8,_0x56573e){var _0x2eda2c={};var _0x32229a={};var _0x25be2a;var _0x1208e5;return db[_0xa451('0x52')]['findOne']({'where':{'id':_0x57abf8[_0xa451('0x71')]['id']}})[_0xa451('0x15')](handleEntityNotFound(_0x56573e,null))[_0xa451('0x15')](function(_0x58acb4){if(_0x58acb4){_0x25be2a=_0x58acb4;_0x32229a['model']=_['keys'](db[_0xa451('0x124')][_0xa451('0x53')]);_0x32229a[_0xa451('0x55')]=_[_0xa451('0x67')](_0x57abf8['query']);_0x32229a[_0xa451('0x56')]=_[_0xa451('0x58')](_0x32229a[_0xa451('0x4b')],_0x32229a[_0xa451('0x55')]);_0x2eda2c[_0xa451('0x57')]=_['intersection'](_0x32229a[_0xa451('0x4b')],qs[_0xa451('0x59')](_0x57abf8[_0xa451('0x55')][_0xa451('0x59')]));_0x2eda2c[_0xa451('0x57')]=_0x2eda2c[_0xa451('0x57')]['length']?_0x2eda2c[_0xa451('0x57')]:_0x32229a[_0xa451('0x4b')];_0x2eda2c['order']=qs[_0xa451('0x5c')](_0x57abf8[_0xa451('0x55')]['sort']);_0x2eda2c[_0xa451('0x5d')]=qs[_0xa451('0x56')](_[_0xa451('0x78')](_0x57abf8['query'],_0x32229a[_0xa451('0x56')]));if(_0x57abf8[_0xa451('0x55')]['filter']){_0x2eda2c[_0xa451('0x5d')]=_[_0xa451('0x5f')](_0x2eda2c[_0xa451('0x5d')],{'$or':_[_0xa451('0x51')](_0x2eda2c[_0xa451('0x57')],function(_0x38d123){var _0x3f3c2b={};_0x3f3c2b[_0x38d123]={'$like':'%'+_0x57abf8[_0xa451('0x55')][_0xa451('0x5e')]+'%'};return _0x3f3c2b;})});}_0x2eda2c=_[_0xa451('0x5f')]({},_0x2eda2c,_0x57abf8['options']);return _0x25be2a[_0xa451('0x123')](_0x2eda2c);}})[_0xa451('0x15')](function(_0x91a95d){if(_0x91a95d){_0x1208e5=_0x91a95d[_0xa451('0x5a')];if(!_0x57abf8[_0xa451('0x55')][_0xa451('0x76')](_0xa451('0x5b'))){_0x2eda2c[_0xa451('0x26')]=qs[_0xa451('0x26')](_0x57abf8[_0xa451('0x55')]['limit']);_0x2eda2c[_0xa451('0x24')]=qs[_0xa451('0x24')](_0x57abf8[_0xa451('0x55')][_0xa451('0x24')]);}return _0x25be2a[_0xa451('0x123')](_0x2eda2c);}})['then'](function(_0x21d789){if(_0x21d789){return _0x21d789?{'count':_0x1208e5,'rows':_0x21d789}:null;}})[_0xa451('0x15')](respondWithResult(_0x56573e,null))[_0xa451('0x1f')](handleError(_0x56573e,null));};
\ No newline at end of file
+var _0x4a5a=['addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','handleError','redis','defaults','localhost','socket.io-emitter','client','http','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','map','Interval','all','user-agent-parser','setUA','user-agent','getResult','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','model','%s\x20%s\x20%s','vendor','type','stringify','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','describe','ChatWebsiteId','Disposition','getDispositions','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','systemAvatar','file','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','Intervals','spread','list','applications','orderBy','Applications','priority','asc','account','Contacts','contact','headers','threadId','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','openNewInteraction','transaction','Attachment','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','Tags','color','tag','getProactiveActions','virtual','License','URL','address','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','ChatApplication','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','online','false','items','fromKey','getOfflineMessages','Attachments'];(function(_0x24e18e,_0x52ce1b){var _0x35263a=function(_0x170d56){while(--_0x170d56){_0x24e18e['push'](_0x24e18e['shift']());}};_0x35263a(++_0x52ce1b);}(_0x4a5a,0x12f));var _0xa4a5=function(_0x1204dd,_0x30c6e0){_0x1204dd=_0x1204dd-0x0;var _0x482b6d=_0x4a5a[_0x1204dd];return _0x482b6d;};'use strict';var Mustache=require(_0xa4a5('0x0'));var util=require(_0xa4a5('0x1'));var path=require(_0xa4a5('0x2'));var ejs=require(_0xa4a5('0x3'));var fs=require('fs');var fs_extra=require(_0xa4a5('0x4'));var _=require(_0xa4a5('0x5'));var querystring=require('querystring');var htmlToText=require(_0xa4a5('0x6'));var Redis=require('ioredis');var jayson=require(_0xa4a5('0x7'));var url=require(_0xa4a5('0x8'));var qs=require(_0xa4a5('0x9'));var logger=require(_0xa4a5('0xa'))(_0xa4a5('0xb'));var config=require(_0xa4a5('0xc'));var APIOutOfIntervalError=require(_0xa4a5('0xd'))['APIOutOfIntervalError'];var APINotFoundError=require(_0xa4a5('0xd'))[_0xa4a5('0xe')];var APIHandleError=require('../../errors/api')[_0xa4a5('0xf')];var db=require('../../mysqldb')['db'];config[_0xa4a5('0x10')]=_[_0xa4a5('0x11')](config[_0xa4a5('0x10')],{'host':_0xa4a5('0x12'),'port':0x18eb});var socket=require(_0xa4a5('0x13'))(new Redis(config[_0xa4a5('0x10')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0xa4a5('0x14')][_0xa4a5('0x15')]({'port':0x232c});var client9002=jayson['client'][_0xa4a5('0x15')]({'port':0x232a});var client9003=jayson[_0xa4a5('0x14')][_0xa4a5('0x15')]({'port':0x232b});var client9001=jayson['client'][_0xa4a5('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x48944e,_0x4e679f,_0x188444,_0x490948){return new Promise(function(_0x5cd4bc,_0x1afc39){var _0x163907=_0x490948||client;return _0x163907['request'](_0x48944e,_0x188444)['then'](function(_0x32387e){logger['info'](_0xa4a5('0x16'),_0x4e679f,_0xa4a5('0x17'));logger[_0xa4a5('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4e679f,_0xa4a5('0x17'),JSON['stringify'](_0x32387e));if(_0x32387e[_0xa4a5('0x19')]){if(_0x32387e[_0xa4a5('0x19')]['code']===0x1f4){logger[_0xa4a5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e679f,_0x32387e[_0xa4a5('0x19')][_0xa4a5('0x1a')]);return _0x1afc39(_0x32387e[_0xa4a5('0x19')][_0xa4a5('0x1a')]);}logger[_0xa4a5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e679f,_0x32387e['error']['message']);return _0x5cd4bc(_0x32387e[_0xa4a5('0x19')]['message']);}else{logger['info'](_0xa4a5('0x16'),_0x4e679f,_0xa4a5('0x17'));_0x5cd4bc(_0x32387e[_0xa4a5('0x1b')]['message']);}})[_0xa4a5('0x1c')](function(_0x283428){logger[_0xa4a5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x4e679f,_0x283428);_0x1afc39(_0x283428);});});}function respondWithStatusCode(_0x42ecbe,_0x2e0301){_0x2e0301=_0x2e0301||0xcc;return function(_0x5e5009){if(_0x5e5009){return _0x42ecbe[_0xa4a5('0x1d')](_0x2e0301);}return _0x42ecbe[_0xa4a5('0x1e')](_0x2e0301)[_0xa4a5('0x1f')]();};}function respondWithResult(_0x538bac,_0x272e4e){_0x272e4e=_0x272e4e||0xc8;return function(_0x1e02c1){if(_0x1e02c1){return _0x538bac[_0xa4a5('0x1e')](_0x272e4e)['json'](_0x1e02c1);}};}function respondWithFilteredResult(_0x439243,_0x1d0d1d){return function(_0x5deb77){if(_0x5deb77){var _0x423189=typeof _0x1d0d1d[_0xa4a5('0x20')]===_0xa4a5('0x21')&&typeof _0x1d0d1d[_0xa4a5('0x22')]===_0xa4a5('0x21');var _0x1d7df8=_0x5deb77['count'];var _0x5c7357=_0x423189?0x0:_0x1d0d1d[_0xa4a5('0x20')];var _0x2c887f=_0x423189?_0x5deb77[_0xa4a5('0x23')]:_0x1d0d1d['offset']+_0x1d0d1d[_0xa4a5('0x22')];var _0x3aa9ed;if(_0x2c887f>=_0x1d7df8){_0x2c887f=_0x1d7df8;_0x3aa9ed=0xc8;}else{_0x3aa9ed=0xce;}_0x439243['status'](_0x3aa9ed);return _0x439243[_0xa4a5('0x24')]('Content-Range',_0x5c7357+'-'+_0x2c887f+'/'+_0x1d7df8)[_0xa4a5('0x25')](_0x5deb77);}return null;};}function saveUpdates(_0x475f8d){return function(_0x306b58){if(_0x306b58){return _0x306b58[_0xa4a5('0x26')](_0x475f8d)[_0xa4a5('0x27')](function(_0x68e4c3){return _0x68e4c3;});}return null;};}function removeEntity(_0x17448a){return function(_0x3bc3ad){if(_0x3bc3ad){return _0x3bc3ad[_0xa4a5('0x28')]()[_0xa4a5('0x27')](function(){var _0x5bda0a=_0x3bc3ad[_0xa4a5('0x29')]({'plain':!![]});var _0x20544d=_0xa4a5('0x2a');return db[_0xa4a5('0x2b')]['destroy']({'where':{'type':_0x20544d,'resourceId':_0x5bda0a['id']}})[_0xa4a5('0x27')](function(){return _0x3bc3ad;});})[_0xa4a5('0x27')](function(){_0x17448a[_0xa4a5('0x1e')](0xcc)[_0xa4a5('0x1f')]();});}};}function handleEntityNotFound(_0x41eaa2){return function(_0x305c73){if(!_0x305c73){_0x41eaa2[_0xa4a5('0x1d')](0x194);}return _0x305c73;};}function handleError(_0x4facda,_0x383396){_0x383396=_0x383396||0x1f4;return function(_0x45ec64){logger[_0xa4a5('0x19')](_0x45ec64[_0xa4a5('0x2c')]);if(_0x45ec64[_0xa4a5('0x2d')]){delete _0x45ec64[_0xa4a5('0x2d')];}_0x4facda[_0xa4a5('0x1e')](_0x383396)[_0xa4a5('0x2e')](_0x45ec64);};}function iftimePromise(_0x321ca6,_0x1677ac){return respondWithRpcPromise(_0xa4a5('0x2f'),_0xa4a5('0x30'),{'command':_0x1677ac[_0xa4a5('0x31')]?util['format'](_0xa4a5('0x32'),_0x321ca6[_0xa4a5('0x33')],_0x1677ac[_0xa4a5('0x31')]):util['format']('iftime\x20%s',_0x321ca6[_0xa4a5('0x33')])},client9002)[_0xa4a5('0x27')](function(_0x13f0e5){var _0x43b888=_0x13f0e5&&_0x13f0e5[_0xa4a5('0x34')](_0xa4a5('0x35'))>=0x0?!![]:![];logger[_0xa4a5('0x36')](_0xa4a5('0x37'),_0x1677ac['id'],_0x321ca6['id'],_0x321ca6[_0xa4a5('0x33')],_0x43b888?_0xa4a5('0x38'):_0xa4a5('0x39'),_0x1677ac[_0xa4a5('0x31')]?_0x1677ac['timezone']:'No\x20timezone');return _0x43b888;})['catch'](function(_0x4ff844){logger[_0xa4a5('0x19')](_0xa4a5('0x37'),_0x1677ac['id'],_0x321ca6['id'],_0x321ca6[_0xa4a5('0x33')],util[_0xa4a5('0x3a')](_0x4ff844,{'showHidden':![],'depth':null}),_0x1677ac[_0xa4a5('0x31')]?_0x1677ac[_0xa4a5('0x31')]:_0xa4a5('0x3b'));return![];});}function checkWebsiteIntervals(_0x1641e3){var _0x2a38fd=_[_0xa4a5('0x3c')](_0x1641e3[_0xa4a5('0x3d')]['Intervals'],function(_0xf6c31){var _0x14fcbb=_0xf6c31[_0xa4a5('0x29')]({'plain':!![]});return iftimePromise(_0x14fcbb,_0x1641e3);});return Promise[_0xa4a5('0x3e')](_0x2a38fd)[_0xa4a5('0x27')](function(_0x3a0dc7){return _['some'](_0x3a0dc7);});}function createInteractionObject(_0x41d178,_0x411c33,_0x43ba53,_0x3aecfa){var _0x15fc03=require(_0xa4a5('0x3f'));var _0x17a86d=new _0x15fc03();var _0x10ac15=_0x17a86d[_0xa4a5('0x40')](_0x43ba53[_0xa4a5('0x41')])[_0xa4a5('0x42')]();var _0x18ea4b=_0x411c33['customerIp'];if(_0x43ba53['cf-connecting-ip']){_0x18ea4b=_0x43ba53['cf-connecting-ip'];}else if(_0x43ba53[_0xa4a5('0x43')]){_0x18ea4b=_['first'](_0x43ba53['x-forwarded-for'][_0xa4a5('0x44')](','));}return{'ContactId':_0x3aecfa['id'],'ChatWebsiteId':_0x41d178,'from':(_0x3aecfa[_0xa4a5('0x45')]||'')+'\x20'+(_0x3aecfa[_0xa4a5('0x46')]||''),'customerIp':_0x18ea4b,'customerPort':_0x43ba53['x-real-port']?_0x43ba53[_0xa4a5('0x47')]:null,'referer':_0x411c33[_0xa4a5('0x48')],'browserName':_0x10ac15['browser'][_0xa4a5('0x2d')]&&_0x10ac15[_0xa4a5('0x49')]['version']?util[_0xa4a5('0x4a')](_0xa4a5('0x4b'),_0x10ac15['browser'][_0xa4a5('0x2d')],_0x10ac15[_0xa4a5('0x49')][_0xa4a5('0x4c')]):_0xa4a5('0x4d'),'browserVersion':_0x10ac15[_0xa4a5('0x49')][_0xa4a5('0x4c')]||_0xa4a5('0x4d'),'osName':util[_0xa4a5('0x4a')](_0xa4a5('0x4b'),_0x10ac15['os']['name'],_0x10ac15['os']['version']),'osVersion':_0x10ac15['os']['version'],'deviceModel':_0x10ac15[_0xa4a5('0x4e')][_0xa4a5('0x4f')]&&_0x10ac15['device']['vendor']?util[_0xa4a5('0x4a')](_0xa4a5('0x50'),_0x10ac15[_0xa4a5('0x4e')]['model'],_0x10ac15[_0xa4a5('0x4e')][_0xa4a5('0x51')],_0x10ac15['device'][_0xa4a5('0x52')]):null,'deviceVendor':_0x10ac15[_0xa4a5('0x4e')]['vendor'],'deviceType':_0x10ac15[_0xa4a5('0x4e')][_0xa4a5('0x52')],'formData':JSON[_0xa4a5('0x53')](_0x411c33)};}exports[_0xa4a5('0x54')]=function(_0x2460f3,_0x4613b4){var _0xb381ff={'include':[{'model':db[_0xa4a5('0x55')],'as':_0xa4a5('0x56')}]},_0x48aa89={},_0x6f47c9={'count':0x0,'rows':[]};var _0x8e41be=_['map'](db[_0xa4a5('0x57')][_0xa4a5('0x58')],function(_0x56fb51){return{'name':_0x56fb51[_0xa4a5('0x59')],'type':_0x56fb51[_0xa4a5('0x52')][_0xa4a5('0x5a')]};});_0x48aa89[_0xa4a5('0x4f')]=_[_0xa4a5('0x3c')](_0x8e41be,'name');_0x48aa89['query']=_[_0xa4a5('0x5b')](_0x2460f3['query']);_0x48aa89[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x48aa89[_0xa4a5('0x4f')],_0x48aa89['query']);_0xb381ff[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x48aa89[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x2460f3[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0xb381ff[_0xa4a5('0x5e')]=_0xb381ff[_0xa4a5('0x5e')][_0xa4a5('0x61')]?_0xb381ff[_0xa4a5('0x5e')]:_0x48aa89[_0xa4a5('0x4f')];if(!_0x2460f3['query'][_0xa4a5('0x62')]('nolimit')){_0xb381ff['limit']=qs['limit'](_0x2460f3[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0xb381ff[_0xa4a5('0x20')]=qs['offset'](_0x2460f3['query']['offset']);}_0xb381ff[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x2460f3[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0xb381ff[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x2460f3['query'],_0x48aa89[_0xa4a5('0x5c')]),_0x8e41be);if(_0x2460f3['query'][_0xa4a5('0x67')]){_0xb381ff[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0xb381ff['where'],{'$or':_[_0xa4a5('0x3c')](_0x8e41be,function(_0x2696a3){if(_0x2696a3['type']!==_0xa4a5('0x69')){var _0x3accce={};_0x3accce[_0x2696a3['name']]={'$like':'%'+_0x2460f3['query'][_0xa4a5('0x67')]+'%'};return _0x3accce;}})});}_0xb381ff=_[_0xa4a5('0x68')]({},_0xb381ff,_0x2460f3[_0xa4a5('0x6a')]);var _0x326388={'where':_0xb381ff[_0xa4a5('0x65')]};return db[_0xa4a5('0x57')][_0xa4a5('0x23')](_0x326388)[_0xa4a5('0x27')](function(_0x5e0006){_0x6f47c9[_0xa4a5('0x23')]=_0x5e0006;if(_0x2460f3[_0xa4a5('0x60')]['includeAll']){_0xb381ff['include']=[{'all':!![]}];}return db[_0xa4a5('0x57')][_0xa4a5('0x6b')](_0xb381ff);})[_0xa4a5('0x27')](function(_0x178b68){_0x6f47c9[_0xa4a5('0x6c')]=_0x178b68;return _0x6f47c9;})[_0xa4a5('0x27')](respondWithFilteredResult(_0x4613b4,_0xb381ff))[_0xa4a5('0x1c')](handleError(_0x4613b4,null));};exports['show']=function(_0x176397,_0x112fea){var _0x5539d4={'raw':![],'where':{'id':_0x176397[_0xa4a5('0x6d')]['id']},'include':[{'model':db[_0xa4a5('0x55')],'as':_0xa4a5('0x56')}]},_0x31eb7b={};_0x31eb7b[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['ChatWebsite'][_0xa4a5('0x58')]);_0x31eb7b[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x176397[_0xa4a5('0x60')]);_0x31eb7b['filters']=_[_0xa4a5('0x5d')](_0x31eb7b['model'],_0x31eb7b[_0xa4a5('0x60')]);_0x5539d4['attributes']=_['intersection'](_0x31eb7b[_0xa4a5('0x4f')],qs['fields'](_0x176397['query'][_0xa4a5('0x5f')]));_0x5539d4[_0xa4a5('0x5e')]=_0x5539d4['attributes']['length']?_0x5539d4[_0xa4a5('0x5e')]:_0x31eb7b[_0xa4a5('0x4f')];if(_0x176397['query'][_0xa4a5('0x6e')]){_0x5539d4[_0xa4a5('0x6f')]=[{'all':!![]}];}_0x5539d4=_[_0xa4a5('0x68')]({},_0x5539d4,_0x176397[_0xa4a5('0x6a')]);return db[_0xa4a5('0x57')][_0xa4a5('0x70')](_0x5539d4)[_0xa4a5('0x27')](handleEntityNotFound(_0x112fea,null))[_0xa4a5('0x27')](respondWithResult(_0x112fea,null))[_0xa4a5('0x1c')](handleError(_0x112fea,null));};exports[_0xa4a5('0x71')]=function(_0xd9687d,_0x18b396){return db['ChatWebsite'][_0xa4a5('0x71')](_0xd9687d[_0xa4a5('0x72')],{})[_0xa4a5('0x27')](function(_0x2996db){var _0x5bfba6=_0xd9687d[_0xa4a5('0x73')][_0xa4a5('0x29')]({'plain':!![]});if(!_0x5bfba6)throw new Error(_0xa4a5('0x74'));if(_0x5bfba6[_0xa4a5('0x75')]===_0xa4a5('0x73')){var _0x3e78bb=_0x2996db[_0xa4a5('0x29')]({'plain':!![]});var _0x188343='ChatWebsites';return db['UserProfileSection'][_0xa4a5('0x70')]({'where':{'name':_0x188343,'userProfileId':_0x5bfba6[_0xa4a5('0x76')]},'raw':!![]})[_0xa4a5('0x27')](function(_0xb3b114){if(_0xb3b114&&_0xb3b114['autoAssociation']===0x0){return db['UserProfileResource'][_0xa4a5('0x71')]({'name':_0x3e78bb[_0xa4a5('0x2d')],'resourceId':_0x3e78bb['id'],'type':_0xb3b114['name'],'sectionId':_0xb3b114['id']},{})['then'](function(){return _0x2996db;});}else{return _0x2996db;}})[_0xa4a5('0x1c')](function(_0x164257){logger[_0xa4a5('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x164257);throw _0x164257;});}return _0x2996db;})['then'](respondWithResult(_0x18b396,0xc9))[_0xa4a5('0x1c')](handleError(_0x18b396,null));};exports[_0xa4a5('0x26')]=function(_0x8016f7,_0x43c8c7){if(_0x8016f7[_0xa4a5('0x72')]['id']){delete _0x8016f7[_0xa4a5('0x72')]['id'];}return db['ChatWebsite'][_0xa4a5('0x70')]({'where':{'id':_0x8016f7['params']['id']},'include':[{'model':db[_0xa4a5('0x55')],'as':_0xa4a5('0x56')}]})[_0xa4a5('0x27')](handleEntityNotFound(_0x43c8c7,null))[_0xa4a5('0x27')](saveUpdates(_0x8016f7[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x43c8c7,null))['catch'](handleError(_0x43c8c7,null));};exports[_0xa4a5('0x28')]=function(_0x2ff662,_0x5aee3a){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x2ff662['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x5aee3a,null))[_0xa4a5('0x27')](removeEntity(_0x5aee3a,null))[_0xa4a5('0x1c')](handleError(_0x5aee3a,null));};exports['describe']=function(_0x44631a,_0xe52a94){return db['ChatWebsite'][_0xa4a5('0x77')]()[_0xa4a5('0x27')](respondWithResult(_0xe52a94,null))[_0xa4a5('0x1c')](handleError(_0xe52a94,null));};exports['addDisposition']=function(_0x2d98fd,_0x17eb88){if(_0x2d98fd['body']['id']){delete _0x2d98fd[_0xa4a5('0x72')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2d98fd[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x17eb88,null))[_0xa4a5('0x27')](function(_0x3727f8){if(_0x3727f8){_0x2d98fd[_0xa4a5('0x72')][_0xa4a5('0x78')]=_0x3727f8['id'];return db[_0xa4a5('0x79')][_0xa4a5('0x71')](_0x2d98fd[_0xa4a5('0x72')]);}})[_0xa4a5('0x27')](respondWithResult(_0x17eb88,null))[_0xa4a5('0x1c')](handleError(_0x17eb88,null));};exports[_0xa4a5('0x7a')]=function(_0x902ae,_0x557484){var _0x27a34a={'raw':![],'where':{}};var _0x52e0b1={};var _0x15fcd4={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')]['findOne']({'where':{'id':_0x902ae[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x557484,null))['then'](function(_0x4ef480){if(_0x4ef480){_0x52e0b1[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db[_0xa4a5('0x79')][_0xa4a5('0x58')]);_0x52e0b1['query']=_['keys'](_0x902ae['query']);_0x52e0b1[_0xa4a5('0x5c')]=_['intersection'](_0x52e0b1[_0xa4a5('0x4f')],_0x52e0b1[_0xa4a5('0x60')]);_0x27a34a[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x52e0b1[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x902ae['query'][_0xa4a5('0x5f')]));_0x27a34a[_0xa4a5('0x5e')]=_0x27a34a[_0xa4a5('0x5e')]['length']?_0x27a34a[_0xa4a5('0x5e')]:_0x52e0b1[_0xa4a5('0x4f')];if(!_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x27a34a[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x27a34a['offset']=qs[_0xa4a5('0x20')](_0x902ae['query'][_0xa4a5('0x20')]);}_0x27a34a['order']=qs[_0xa4a5('0x64')](_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x27a34a[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x902ae[_0xa4a5('0x60')],_0x52e0b1[_0xa4a5('0x5c')]));_0x27a34a[_0xa4a5('0x65')][_0xa4a5('0x78')]=_0x4ef480['id'];if(_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x27a34a[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x27a34a[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x27a34a[_0xa4a5('0x5e')],function(_0x4f50eb){var _0x1d0e64={};_0x1d0e64[_0x4f50eb]={'$like':'%'+_0x902ae[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x1d0e64;})});}_0x27a34a=_[_0xa4a5('0x68')]({},_0x27a34a,_0x902ae[_0xa4a5('0x6a')]);return db['Disposition'][_0xa4a5('0x23')]({'where':_0x27a34a[_0xa4a5('0x65')]})[_0xa4a5('0x27')](function(_0x48aaaf){_0x15fcd4[_0xa4a5('0x23')]=_0x48aaaf;if(_0x902ae[_0xa4a5('0x60')]['includeAll']){_0x27a34a['include']=[{'all':!![]}];}return db[_0xa4a5('0x79')][_0xa4a5('0x6b')](_0x27a34a);})['then'](function(_0xac1aa3){_0x15fcd4[_0xa4a5('0x6c')]=_0xac1aa3;return _0x15fcd4;});}})[_0xa4a5('0x27')](respondWithFilteredResult(_0x557484,_0x27a34a))[_0xa4a5('0x1c')](handleError(_0x557484,null));};exports['removeDispositions']=function(_0xd91077,_0x4ffe55){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0xd91077[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4ffe55,null))[_0xa4a5('0x27')](function(_0x35e77e){if(_0x35e77e){return _0x35e77e[_0xa4a5('0x7c')](_0xd91077[_0xa4a5('0x60')][_0xa4a5('0x7d')]);}})[_0xa4a5('0x27')](respondWithStatusCode(_0x4ffe55,null))['catch'](handleError(_0x4ffe55,null));};exports['addAnswer']=function(_0x4cfc5a,_0x468f70){if(_0x4cfc5a[_0xa4a5('0x72')]['id']){delete _0x4cfc5a[_0xa4a5('0x72')]['id'];}return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x4cfc5a[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x468f70,null))['then'](function(_0xd4cad1){if(_0xd4cad1){_0x4cfc5a[_0xa4a5('0x72')][_0xa4a5('0x78')]=_0xd4cad1['id'];return db[_0xa4a5('0x7e')][_0xa4a5('0x71')](_0x4cfc5a[_0xa4a5('0x72')]);}})['then'](respondWithResult(_0x468f70,null))['catch'](handleError(_0x468f70,null));};exports[_0xa4a5('0x7f')]=function(_0x563947,_0x2d8f0c){var _0x153385={'raw':![],'where':{}};var _0x532332={};var _0x1ae6d8={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')]['findOne']({'where':{'id':_0x563947[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x2d8f0c,null))[_0xa4a5('0x27')](function(_0x9a3be){if(_0x9a3be){_0x532332[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['CannedAnswer'][_0xa4a5('0x58')]);_0x532332['query']=_[_0xa4a5('0x5b')](_0x563947['query']);_0x532332['filters']=_[_0xa4a5('0x5d')](_0x532332[_0xa4a5('0x4f')],_0x532332['query']);_0x153385[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x532332[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x563947['query'][_0xa4a5('0x5f')]));_0x153385[_0xa4a5('0x5e')]=_0x153385[_0xa4a5('0x5e')]['length']?_0x153385[_0xa4a5('0x5e')]:_0x532332[_0xa4a5('0x4f')];if(!_0x563947[_0xa4a5('0x60')]['hasOwnProperty'](_0xa4a5('0x7b'))){_0x153385[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x563947['query'][_0xa4a5('0x22')]);_0x153385[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0x563947[_0xa4a5('0x60')][_0xa4a5('0x20')]);}_0x153385[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x563947[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x153385[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x563947['query'],_0x532332[_0xa4a5('0x5c')]));_0x153385[_0xa4a5('0x65')][_0xa4a5('0x78')]=_0x9a3be['id'];if(_0x563947[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x153385[_0xa4a5('0x65')]=_['merge'](_0x153385[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x153385[_0xa4a5('0x5e')],function(_0x3a273e){var _0x526624={};_0x526624[_0x3a273e]={'$like':'%'+_0x563947[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x526624;})});}_0x153385=_['merge']({},_0x153385,_0x563947['options']);return db[_0xa4a5('0x7e')][_0xa4a5('0x23')]({'where':_0x153385[_0xa4a5('0x65')]})[_0xa4a5('0x27')](function(_0x52f0c1){_0x1ae6d8[_0xa4a5('0x23')]=_0x52f0c1;if(_0x563947[_0xa4a5('0x60')]['includeAll']){_0x153385[_0xa4a5('0x6f')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa4a5('0x6b')](_0x153385);})[_0xa4a5('0x27')](function(_0x31b915){_0x1ae6d8['rows']=_0x31b915;return _0x1ae6d8;});}})['then'](respondWithFilteredResult(_0x2d8f0c,_0x153385))['catch'](handleError(_0x2d8f0c,null));};exports[_0xa4a5('0x80')]=function(_0x35aa50,_0x4ff4bd){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x35aa50[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x4ff4bd,null))[_0xa4a5('0x27')](function(_0x55b408){if(_0x55b408){return _0x55b408[_0xa4a5('0x80')](_0x35aa50[_0xa4a5('0x60')]['ids']);}})[_0xa4a5('0x27')](respondWithStatusCode(_0x4ff4bd,null))[_0xa4a5('0x1c')](handleError(_0x4ff4bd,null));};exports['addLogo']=function(_0x37203a,_0x5803cc){_0x37203a[_0xa4a5('0x72')][_0xa4a5('0x81')]=_0x37203a['file'][_0xa4a5('0x82')];return db[_0xa4a5('0x57')]['find']({'where':{'id':_0x37203a[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x5803cc,null))[_0xa4a5('0x27')](saveUpdates(_0x37203a[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x5803cc,null))['catch'](handleError(_0x5803cc,null));};exports[_0xa4a5('0x83')]=function(_0x33ba91,_0x14022c){_0x33ba91['body'][_0xa4a5('0x84')]=_0x33ba91['file']['filename'];return db['ChatWebsite'][_0xa4a5('0x70')]({'where':{'id':_0x33ba91['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x14022c,null))[_0xa4a5('0x27')](saveUpdates(_0x33ba91[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x14022c,null))[_0xa4a5('0x1c')](handleError(_0x14022c,null));};exports[_0xa4a5('0x85')]=function(_0x1360c6,_0x6c00cc){_0x1360c6[_0xa4a5('0x72')]['customerAvatar']=_0x1360c6['file'][_0xa4a5('0x82')];return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x1360c6['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x6c00cc,null))[_0xa4a5('0x27')](saveUpdates(_0x1360c6[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0x6c00cc,null))[_0xa4a5('0x1c')](handleError(_0x6c00cc,null));};exports['addSystemAvatar']=function(_0x1d774f,_0xd02afc){_0x1d774f[_0xa4a5('0x72')][_0xa4a5('0x86')]=_0x1d774f[_0xa4a5('0x87')][_0xa4a5('0x82')];return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x1d774f['params']['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0xd02afc,null))[_0xa4a5('0x27')](saveUpdates(_0x1d774f[_0xa4a5('0x72')],null))[_0xa4a5('0x27')](respondWithResult(_0xd02afc,null))[_0xa4a5('0x1c')](handleError(_0xd02afc,null));};exports['getLogo']=function(_0x39c9b1,_0x291608){var _0xe2e176=path[_0xa4a5('0x88')](config['root'],_0xa4a5('0x89'));var _0x155408={'where':{'id':_0x39c9b1[_0xa4a5('0x6d')]['id']},'attributes':['id',_0xa4a5('0x81')],'raw':!![]};var _0x3b7c85=![];return require(_0xa4a5('0x8a'))[_0xa4a5('0x8b')]()[_0xa4a5('0x27')](function(_0x3fca8b){if(_0x3fca8b){_0x3b7c85=_0x3fca8b[_0xa4a5('0x8c')];}})['then'](function(){return db[_0xa4a5('0x57')][_0xa4a5('0x70')](_0x155408);})['then'](handleEntityNotFound(_0x291608,null))[_0xa4a5('0x27')](function(_0x98b92b){if(_0x98b92b){if(!_['isNil'](_0x98b92b['sitepic'])){if(fs[_0xa4a5('0x8d')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],'server/files/images/logos/',_0x98b92b['sitepic']))&&_0x3b7c85){_0xe2e176=path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x8f'),_0x98b92b[_0xa4a5('0x81')]);}}return _0x291608['download'](_0xe2e176);}})[_0xa4a5('0x1c')](handleError(_0x291608,null));};exports[_0xa4a5('0x90')]=function(_0x160975,_0x278dd8){var _0x3bd042=path['join'](config[_0xa4a5('0x8e')],_0xa4a5('0x91'));var _0x26b2f6={'where':{'id':_0x160975['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xa4a5('0x57')][_0xa4a5('0x70')](_0x26b2f6)[_0xa4a5('0x27')](handleEntityNotFound(_0x278dd8,null))[_0xa4a5('0x27')](function(_0x35c09f){if(_0x35c09f){if(!_[_0xa4a5('0x92')](_0x35c09f[_0xa4a5('0x84')])){if(fs[_0xa4a5('0x8d')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x93'),_0x35c09f[_0xa4a5('0x84')]))){_0x3bd042=path['join'](config['root'],'server/files/images/avatars/',_0x35c09f[_0xa4a5('0x84')]);}}return _0x278dd8[_0xa4a5('0x94')](_0x3bd042);}})['catch'](handleError(_0x278dd8,null));};exports[_0xa4a5('0x95')]=function(_0xade522,_0x2c07a7){var _0x12080c=path['join'](config['root'],_0xa4a5('0x96'));var _0x2f9d68={'where':{'id':_0xade522['params']['id']},'attributes':['id',_0xa4a5('0x97'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xa4a5('0x70')](_0x2f9d68)[_0xa4a5('0x27')](handleEntityNotFound(_0x2c07a7,null))[_0xa4a5('0x27')](function(_0xa2ba5){if(_0xa2ba5){if(!_[_0xa4a5('0x92')](_0xa2ba5[_0xa4a5('0x97')])){if(fs['existsSync'](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x93'),_0xa2ba5[_0xa4a5('0x97')]))&&_0xa2ba5['showCustomerAvatar']){_0x12080c=path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],'server/files/images/avatars/',_0xa2ba5[_0xa4a5('0x97')]);}}return _0x2c07a7[_0xa4a5('0x94')](_0x12080c);}})[_0xa4a5('0x1c')](handleError(_0x2c07a7,null));};exports[_0xa4a5('0x98')]=function(_0x415331,_0x10a2fd){var _0x512272=path[_0xa4a5('0x88')](config['root'],_0xa4a5('0x99'));var _0xbe88d3={'where':{'id':_0x415331[_0xa4a5('0x6d')]['id']},'attributes':['id',_0xa4a5('0x86')],'raw':!![]};return db['ChatWebsite']['find'](_0xbe88d3)['then'](handleEntityNotFound(_0x10a2fd,null))[_0xa4a5('0x27')](function(_0x301217){if(_0x301217){if(!_[_0xa4a5('0x92')](_0x301217[_0xa4a5('0x86')])){if(fs[_0xa4a5('0x8d')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],'server/files/images/avatars/',_0x301217[_0xa4a5('0x86')]))){_0x512272=path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0x93'),_0x301217[_0xa4a5('0x86')]);}}return _0x10a2fd['download'](_0x512272);}})['catch'](handleError(_0x10a2fd,null));};exports[_0xa4a5('0x9a')]=function(_0x5375e9,_0xec46fb){var _0x234cbe={'body':_0x5375e9['body'],'channel':_0xa4a5('0x9b')};var _0x3cc69b=[];var _0x3454a3=[];var _0x29de26={};var _0x32719f=![];return db[_0xa4a5('0x9c')][_0xa4a5('0x77')]()['then'](function(_0x2b4c32){if(!_0x2b4c32){throw new db['Sequelize'][(_0xa4a5('0x9d'))](_0xa4a5('0x9e'));}_0x3cc69b=_[_0xa4a5('0x9f')](_[_0xa4a5('0x5b')](_0x2b4c32),['createdAt',_0xa4a5('0xa0')]);_0x3454a3=_[_0xa4a5('0x9f')](_['keys'](_0x2b4c32),[_0xa4a5('0xa1'),'updatedAt',_0xa4a5('0xa2'),_0xa4a5('0xa3')]);if(_0x5375e9[_0xa4a5('0x72')]['id']){delete _0x5375e9[_0xa4a5('0x72')]['id'];}if(_[_0xa4a5('0x92')](_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xa4')])){throw new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0x72')])||_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0x72')]===''){throw new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xa6'));}if(_['isNil'](_0x5375e9['body']['mapKey'])){throw new db['Sequelize'][(_0xa4a5('0x9d'))](_0xa4a5('0xa7')+_0x3454a3);}if(!_[_0xa4a5('0xa8')](_0x3454a3,_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xa9')])){throw new db['Sequelize']['ValidationError'](_0xa4a5('0xaa')+_0x3454a3);}_0x29de26[_0x5375e9['body'][_0xa4a5('0xa9')]]=_0x5375e9[_0xa4a5('0x72')]['from'];})['then'](function(){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x5375e9[_0xa4a5('0x6d')]['id']},'include':[{'model':db['CmList'],'as':_0xa4a5('0xab'),'include':[{'model':db[_0xa4a5('0x9c')],'as':'Contacts','where':_0x29de26,'limit':0x1,'order':[['updatedAt',_0xa4a5('0xac')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0x3d'),'include':[{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0xad'),'attributes':['id',_0xa4a5('0x33')],'raw':!![]}]}]});})[_0xa4a5('0x27')](function(_0x40b617){if(!_0x40b617)throw new APINotFoundError(util[_0xa4a5('0x4a')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x5375e9['params']['id']));if(!_0x40b617[_0xa4a5('0x3d')]||!_0x40b617[_0xa4a5('0x3d')]['Intervals'])return[_0x40b617,!![]];return[_0x40b617,checkWebsiteIntervals(_0x40b617)];})[_0xa4a5('0xae')](function(_0x5148c7,_0xd42e9a){if(!_0xd42e9a)throw new APIOutOfIntervalError();if(!_0x5148c7[_0xa4a5('0xab')])return;_0x234cbe['account']=_0x5148c7;_0x234cbe[_0xa4a5('0xaf')]=_0x5148c7[_0xa4a5('0xab')];_0x234cbe[_0xa4a5('0xb0')]=_[_0xa4a5('0xb1')](_0x5148c7[_0xa4a5('0xb2')],[_0xa4a5('0xb3')],[_0xa4a5('0xb4')]);if(_0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xb2')]){delete _0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xb2')];}if(_0x234cbe['account'][_0xa4a5('0xab')]&&_0x234cbe[_0xa4a5('0xb5')]['List'][_0xa4a5('0xb6')][_0xa4a5('0x61')]){return _0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xab')][_0xa4a5('0xb6')][0x0];}var _0x57122c=_[_0xa4a5('0x11')](_0x5375e9[_0xa4a5('0x72')],{'firstName':_0x5375e9[_0xa4a5('0x72')]['from'],'ListId':_0x5148c7[_0xa4a5('0xa3')]});_0x57122c[_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xa9')]]=_0x5375e9[_0xa4a5('0x72')]['from'];return db[_0xa4a5('0x9c')][_0xa4a5('0x71')](_0x57122c,{'fields':_0x3cc69b,'raw':!![]});})[_0xa4a5('0x27')](function(_0x3b93a0){_0x234cbe[_0xa4a5('0xb7')]=_0x3b93a0;var _0x331722=createInteractionObject(_0x5375e9[_0xa4a5('0x6d')]['id'],_0x5375e9[_0xa4a5('0x72')],_0x5375e9[_0xa4a5('0xb8')],_0x3b93a0);var _0x16e72d={'ChatWebsiteId':_0x5375e9[_0xa4a5('0x6d')]['id'],'closed':![]};if(_0x5375e9[_0xa4a5('0x72')]['threadId']){_0x16e72d[_0xa4a5('0xb9')]=_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xb9')];return db['ChatInteraction'][_0xa4a5('0x70')]({'where':_0x16e72d})[_0xa4a5('0x27')](function(_0x5065b7){if(_0x5065b7){_0x32719f=!![];return _0x5065b7;}_0x331722[_0xa4a5('0xb9')]=_0x5375e9[_0xa4a5('0x72')]['threadId'];_0x331722['externalUrl']=_0x5375e9[_0xa4a5('0x72')]['externalUrl'];return db[_0xa4a5('0xba')][_0xa4a5('0x71')](_0x331722);});}_0x16e72d[_0xa4a5('0xbb')]=_0x3b93a0['id'];if(_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbc')]&&_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbc')]['id']){_0x16e72d['id']=_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbc')]['id'];return db['ChatInteraction'][_0xa4a5('0x70')]({'where':_0x16e72d})[_0xa4a5('0x27')](function(_0x336530){if(_0x336530){_0x32719f=!![];return _0x336530;}return db[_0xa4a5('0xba')][_0xa4a5('0x71')](_0x331722);});}return db[_0xa4a5('0xba')][_0xa4a5('0x71')](_0x331722);})[_0xa4a5('0x27')](function(_0x1d2da0){if(!_0x32719f)return _0x1d2da0;var _0x4de047={'from':(_0x234cbe[_0xa4a5('0xb7')][_0xa4a5('0x45')]||'')+'\x20'+(_0x234cbe[_0xa4a5('0xb7')][_0xa4a5('0x46')]||'')};if(_0x5375e9[_0xa4a5('0x72')]['threadId']&&_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbd')]&&_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xb9')]!=_0x5375e9[_0xa4a5('0x72')]['messageId']){_0x4de047[_0xa4a5('0xb9')]=_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0xbd')];}return _0x1d2da0['update'](_0x4de047);})[_0xa4a5('0x27')](function(_0x1e3de2){_0x234cbe[_0xa4a5('0xbc')]=_0x1e3de2[_0xa4a5('0x29')]({'plain':!![]});_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xbe')]=!_0x32719f;if(_0x234cbe['interaction'][_0xa4a5('0xbe')]){if(_0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xbf')]){_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0xc0')]({'id':0x0,'priority':_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0x61')]+0x1,'app':_0xa4a5('0xc1'),'appdata':_0xa4a5('0xc2'),'interval':_0xa4a5('0xc3')});}}return db[_0xa4a5('0xc4')][_0xa4a5('0x71')]({'body':_0x5375e9[_0xa4a5('0x72')][_0xa4a5('0x72')],'ChatWebsiteId':_0x5375e9[_0xa4a5('0x6d')]['id'],'ChatInteractionId':_0x1e3de2['id'],'direction':'in','ContactId':_0x234cbe[_0xa4a5('0xb7')]['id'],'AttachmentId':_0x5375e9['body']['AttachmentId']});})[_0xa4a5('0x27')](function(_0xcc5246){_0x234cbe[_0xa4a5('0x1a')]=_0xcc5246;if(!_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xc5')]){return;}return db[_0xa4a5('0xc6')][_0xa4a5('0x70')]({'attributes':['id',_0xa4a5('0x2d')],'where':{'id':_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xc5')]}});})[_0xa4a5('0x27')](function(_0x1636bf){if(_0x1636bf){_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1636bf['name']+','+(_0x234cbe[_0xa4a5('0xb5')][_0xa4a5('0xc8')]||0xa),'interval':_0xa4a5('0xc3')});_0x234cbe[_0xa4a5('0xc9')]=!![];}if(!_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xca')]){return;}return db[_0xa4a5('0xcb')]['find']({'attributes':['id',_0xa4a5('0x2d')],'where':{'id':_0x234cbe[_0xa4a5('0xbc')][_0xa4a5('0xca')]}});})[_0xa4a5('0x27')](function(_0xdd7647){if(_0xdd7647){_0x234cbe[_0xa4a5('0xb0')][_0xa4a5('0xc7')]({'id':0x0,'priority':0x1,'app':_0xa4a5('0xcc'),'appdata':_0xdd7647[_0xa4a5('0x2d')]+','+(_0x234cbe['account'][_0xa4a5('0xcd')]||0x12c),'interval':_0xa4a5('0xc3')});}return respondWithRpcPromise(_0xa4a5('0xce'),'startRouting',_0x234cbe);})[_0xa4a5('0x27')](function(_0x2a4d31){respondWithRpcPromise(_0xa4a5('0xcf'),_0xa4a5('0xcf'),{'event':'notify','message':_0x2a4d31},client9002);return _0x2a4d31;})[_0xa4a5('0x27')](respondWithResult(_0xec46fb,null))['catch'](APIHandleError(_0xec46fb));};exports['offline']=function(_0x2f5f16,_0x44450c){var _0x1c6969,_0x527b8d,_0x180ff4;var _0x1e0b61=[];var _0x38ab89={};var _0x290370=_0x2f5f16[_0xa4a5('0xd0')]||[];var _0x55551b=[];var _0xb32507;return db[_0xa4a5('0x9c')]['describe']()[_0xa4a5('0x27')](function(_0x682607){if(!_0x682607){throw new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))]('no\x20available\x20attributes');}_0x1e0b61=_[_0xa4a5('0x9f')](_[_0xa4a5('0x5b')](_0x682607),[_0xa4a5('0xa1'),'updatedAt',_0xa4a5('0xa2'),_0xa4a5('0xa3')]);if(_0x2f5f16[_0xa4a5('0x72')]['id']){delete _0x2f5f16['body']['id'];}if(_[_0xa4a5('0x92')](_0x2f5f16[_0xa4a5('0x72')]['from'])){throw _0x44450c[_0xa4a5('0x1e')](0x1f4)['send'](new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xd1')));}if(_[_0xa4a5('0x92')](_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0x72')])||_0x2f5f16['body'][_0xa4a5('0x72')]===''){throw _0x44450c['status'](0x1f4)[_0xa4a5('0x2e')](new db[(_0xa4a5('0xa5'))]['ValidationError'](_0xa4a5('0xa6')));}if(_[_0xa4a5('0x92')](_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')])){throw _0x44450c[_0xa4a5('0x1e')](0x1f4)[_0xa4a5('0x2e')](new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xd3')+_0x1e0b61));}if(!_[_0xa4a5('0xa8')](_0x1e0b61,_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')])){throw _0x44450c['status'](0x1f4)[_0xa4a5('0x2e')](new db[(_0xa4a5('0xa5'))][(_0xa4a5('0x9d'))](_0xa4a5('0xd4')+_0x1e0b61));}_0x38ab89[_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')]]=_0x2f5f16[_0xa4a5('0x72')]['from'];})[_0xa4a5('0x27')](function(){return db[_0xa4a5('0x57')]['find']({'where':{'id':_0x2f5f16['params']['id']},'include':[{'model':db[_0xa4a5('0xd5')],'as':'List'},{'model':db[_0xa4a5('0xd6')],'as':_0xa4a5('0xd6')}]});})[_0xa4a5('0x27')](handleEntityNotFound(_0x44450c,null))['then'](function(_0x6cc227){if(_0x6cc227&&_0x6cc227[_0xa4a5('0xab')]){_0x527b8d=_0x6cc227;var _0x1894b1=_['defaults'](_0x2f5f16[_0xa4a5('0x72')],{'firstName':_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xa4')],'phone':_0x2f5f16['body'][_0xa4a5('0xa4')],'ListId':_0x6cc227[_0xa4a5('0xa3')]});_0x1894b1[_0x2f5f16[_0xa4a5('0x72')][_0xa4a5('0xd2')]]=_0x2f5f16['body']['from'];return db[_0xa4a5('0x9c')][_0xa4a5('0xd7')]({'where':_0x38ab89,'defaults':_0x1894b1});}})['spread'](function(_0x5ba75b){if(_0x5ba75b){_0x180ff4=_0x5ba75b;var _0x150fb0=fs[_0xa4a5('0xd8')](path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0xd9')),_0xa4a5('0xda'));var _0x1fcc8b=ejs[_0xa4a5('0xdb')](_0x150fb0,{'body':_[_0xa4a5('0xdc')](_0x2f5f16['body']['body']),'bodyTitle':_0x527b8d['offlineMessageBody']});return db[_0xa4a5('0xdd')]['create']({'body':_0x1fcc8b,'plainBody':htmlToText[_0xa4a5('0xde')](_0x1fcc8b),'ContactId':_0x5ba75b['id'],'ChatWebsiteId':_0x527b8d['id']});}})[_0xa4a5('0x27')](function(_0x484f61){_0xb32507=_0x484f61;if(_0x290370[_0xa4a5('0x61')]){var _0x16c485=_0x290370[_0xa4a5('0x3c')](function(_0x448182){return{'name':_0x448182[_0xa4a5('0xdf')],'basename':_0x448182[_0xa4a5('0x82')],'type':_0x448182[_0xa4a5('0xe0')],'ChatOfflineMessageId':_0x484f61['id']};});_0x55551b=_0x16c485['map'](_0x4581c0=>{var _0x5e550a={'filename':_0x4581c0[_0xa4a5('0x2d')],'path':path[_0xa4a5('0x88')](config[_0xa4a5('0x8e')],_0xa4a5('0xe1'),_0xa4a5('0xd0'),_0xa4a5('0xe2'),'offline-chat',_0x4581c0['basename'])};return _0x5e550a;});if(!_0x527b8d[_0xa4a5('0xe3')]){return db['sequelize'][_0xa4a5('0xe4')](function(_0x142cfd){return db[_0xa4a5('0xe5')]['bulkCreate'](_0x16c485,{'transaction':_0x142cfd});});}}})['then'](function(){if(_0xb32507){_0x1c6969=_0xb32507;return db[_0xa4a5('0xd6')][_0xa4a5('0xe6')]({'where':{'service':!![]},'include':[{'model':db[_0xa4a5('0xe7')],'as':_0xa4a5('0xe8'),'raw':!![],'include':[{'model':db[_0xa4a5('0xe9')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xa4a5('0x27')](function(_0x1c67d8){if(_0x1c67d8&&_0x1c67d8[_0xa4a5('0xe8')]&&_0x527b8d[_0xa4a5('0xea')]&&_0x527b8d[_0xa4a5('0xeb')]){var _0x3bc88e=_0x1c67d8[_0xa4a5('0xec')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3bc88e,'message':{'from':util[_0xa4a5('0x4a')]('\x22%s\x22\x20<%s>',_0x1c67d8[_0xa4a5('0x2d')],_0x1c67d8[_0xa4a5('0xed')]||_0x1c67d8[_0xa4a5('0xe8')][_0xa4a5('0x73')]),'to':_0x527b8d[_0xa4a5('0xeb')],'subject':_0x527b8d[_0xa4a5('0xee')],'html':_0x1c6969['body'],'attachments':_0x55551b}},client9003)[_0xa4a5('0x27')](function(){return _0x1c6969;})[_0xa4a5('0x1c')](function(_0x56d0bd){logger[_0xa4a5('0x19')](_0x56d0bd);});}})[_0xa4a5('0x27')](function(){if(_0x527b8d&&_0x527b8d[_0xa4a5('0xe3')]&&_0x527b8d[_0xa4a5('0xef')]){var _0x2858c8=[];if(_0x290370['length']){_0x2858c8=_0x290370['map'](function(_0x4b06fc){return{'name':_0x4b06fc[_0xa4a5('0xdf')],'basename':_0x4b06fc[_0xa4a5('0x82')],'type':_0x4b06fc[_0xa4a5('0xe0')],'ChatOfflineMessageId':_0xb32507['id']};});}var _0x121e25;if(!_[_0xa4a5('0x92')](_0x527b8d[_0xa4a5('0xf0')])){var _0x53de59=_[_0xa4a5('0x3c')](_0x2f5f16[_0xa4a5('0x72')],function(_0x455aec){return _0x455aec;});var _0xbfc3e3=_[_0xa4a5('0xf1')](_0x53de59)[0x0];var _0x57361d=_[_0xa4a5('0xf2')](_0xbfc3e3,function(_0x50331e){return _0x50331e;});_0x121e25=_0x57361d[0x1][_0x527b8d[_0xa4a5('0xf0')]];}var _0x25d2ed={'from':_0x180ff4[_0xa4a5('0xed')],'firstName':_0x180ff4[_0xa4a5('0x45')],'lastName':_0x180ff4[_0xa4a5('0x46')],'mapKey':_0xa4a5('0xed'),'message':{'from':_0x180ff4[_0xa4a5('0xed')],'to':_0x527b8d[_0xa4a5('0xd6')]['email'],'cc':'','subject':_[_0xa4a5('0x92')](_0x121e25)?_0x527b8d[_0xa4a5('0xee')]:_0x121e25,'messageId':'','sentAt':new Date(),'attach':_0x2858c8[_0xa4a5('0x61')],'attachments':_0x2858c8,'originChannel':_0xa4a5('0xf3'),'ChatWebsiteId':_0x527b8d['id'],'ChatOfflineMessageId':_0x1c6969['id'],'originTo':_0x527b8d[_0xa4a5('0xd6')][_0xa4a5('0xed')]},'body':_0x1c6969[_0xa4a5('0x72')]};var _0x3225a6={'account':{'id':_0x527b8d[_0xa4a5('0xef')]},'body':_0x25d2ed,'log':_0xa4a5('0xf4')};return respondWithRpcPromise(_0xa4a5('0xf4'),_0xa4a5('0xf5'),_0x3225a6,client9001)[_0xa4a5('0x27')](function(){return _0x1c6969;})[_0xa4a5('0x1c')](function(_0x29740c){logger[_0xa4a5('0x19')](_0x29740c);});}return;})['then'](function(){if(_0x1c6969){return _0x1c6969;}})['then'](respondWithResult(_0x44450c,null))[_0xa4a5('0x1c')](function(){for(var _0xbee19e of _0x290370){var _0x1be088=path['join'](config[_0xa4a5('0x8e')],_0xa4a5('0xe1'),_0xa4a5('0xd0'),'attachments',_0xa4a5('0xf6'),_0xbee19e[_0xa4a5('0x82')]);fs_extra[_0xa4a5('0xf7')](_0x1be088)[_0xa4a5('0x1c')](function(_0x215afc){logger[_0xa4a5('0x19')](_0xa4a5('0xf8'),_0x1be088,_0x215afc);});}});};exports[_0xa4a5('0xf9')]=function(_0x502541,_0x4d4c37){return db[_0xa4a5('0xba')][_0xa4a5('0x70')]({'where':{'id':_0x502541[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x4d4c37,null))[_0xa4a5('0x27')](function(_0x3996c4){if(_0x3996c4){return _0x3996c4[_0xa4a5('0xf9')](_0x502541[_0xa4a5('0x72')][_0xa4a5('0x7d')],_[_0xa4a5('0xfa')](_0x502541[_0xa4a5('0x72')],[_0xa4a5('0x7d'),'id'])||{});}})[_0xa4a5('0x27')](respondWithResult(_0x4d4c37,null))[_0xa4a5('0x1c')](handleError(_0x4d4c37,null));};exports[_0xa4a5('0xfb')]=function(_0x17ed3e,_0x6cbe37){var _0x4e2098={'raw':![],'where':{}};var _0x4bd425={};var _0x1da67b={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x17ed3e[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x6cbe37,null))[_0xa4a5('0x27')](function(_0x4aa109){if(_0x4aa109){_0x4bd425[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db[_0xa4a5('0xba')][_0xa4a5('0x58')]);_0x4bd425[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x17ed3e['query']);_0x4bd425[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x4bd425[_0xa4a5('0x4f')],_0x4bd425['query']);_0x4e2098[_0xa4a5('0x5e')]=_[_0xa4a5('0x5d')](_0x4bd425[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x4e2098[_0xa4a5('0x5e')]=_0x4e2098['attributes'][_0xa4a5('0x61')]?_0x4e2098['attributes']:_0x4bd425['model'];if(!_0x17ed3e['query'][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x4e2098[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x4e2098[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x20')]);}_0x4e2098[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x17ed3e[_0xa4a5('0x60')]['sort']);_0x4e2098[_0xa4a5('0x65')]=qs[_0xa4a5('0x5c')](_['pick'](_0x17ed3e[_0xa4a5('0x60')],_0x4bd425[_0xa4a5('0x5c')]));_0x4e2098[_0xa4a5('0x65')][_0xa4a5('0x78')]=_0x4aa109['id'];if(_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x4e2098[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x4e2098[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x4e2098['attributes'],function(_0x1d01be){var _0x59178f={};_0x59178f[_0x1d01be]={'$like':'%'+_0x17ed3e['query']['filter']+'%'};return _0x59178f;})});}_0x4e2098=_[_0xa4a5('0x68')]({},_0x4e2098,_0x17ed3e[_0xa4a5('0x6a')]);return db[_0xa4a5('0xba')][_0xa4a5('0x23')]({'where':_0x4e2098[_0xa4a5('0x65')]})[_0xa4a5('0x27')](function(_0x1ecc43){_0x1da67b[_0xa4a5('0x23')]=_0x1ecc43;if(_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0x6e')]){_0x4e2098['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa4a5('0xc6')],'as':_0xa4a5('0xfc'),'attributes':[_0xa4a5('0x2d'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xa4a5('0xfd'),'attributes':['id',_0xa4a5('0x2d'),_0xa4a5('0xfe')],'where':_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0xff')]?{'id':_0x17ed3e[_0xa4a5('0x60')][_0xa4a5('0xff')]}:undefined,'required':_0x17ed3e[_0xa4a5('0x60')]['tag']?!![]:![]}];}return db[_0xa4a5('0xba')]['findAll'](_0x4e2098);})[_0xa4a5('0x27')](function(_0x1cb9eb){_0x1da67b[_0xa4a5('0x6c')]=_0x1cb9eb;return _0x1da67b;});}})[_0xa4a5('0x27')](respondWithFilteredResult(_0x6cbe37,_0x4e2098))[_0xa4a5('0x1c')](handleError(_0x6cbe37,null));};exports[_0xa4a5('0x30')]=function(_0xa97daf,_0x4f9ccc){var _0x23393a=0x0;var _0x1755a5=0x0;var _0x58cd81=![];var _0x49226b;var _0x2691c6;return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0xa97daf[_0xa4a5('0x6d')]['id']},'include':[{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0x3d'),'include':[{'model':db[_0xa4a5('0x3d')],'as':_0xa4a5('0xad'),'attributes':['id',_0xa4a5('0x33')]}]}]})[_0xa4a5('0x27')](handleEntityNotFound(_0x4f9ccc,null))[_0xa4a5('0x27')](function(_0x49e451){if(_0x49e451){_0x49226b=_0x49e451;return _0x49e451[_0xa4a5('0x100')]({'raw':!![]});}})[_0xa4a5('0x27')](function(_0x822841){if(_0x49226b){if(_0x822841){_0x2691c6=_0x822841;}}return require('../../config/license/util')[_0xa4a5('0x8b')]();})['then'](function(_0x50d3f3){if(_0x50d3f3){_0x1755a5=_0x50d3f3[_0xa4a5('0x101')];_0x58cd81=_0x50d3f3[_0xa4a5('0x8c')];}})[_0xa4a5('0x27')](function(){return db['ChatInteraction'][_0xa4a5('0x23')]({'where':{'closed':![]}});})[_0xa4a5('0x27')](function(_0x582071){_0x23393a=_0x582071;if(_0x1755a5&&_0x582071>_0x1755a5){return db[_0xa4a5('0x102')]['findOne']({'where':{'id':0x1}})[_0xa4a5('0x27')](function(_0x1cc639){if(_0x1cc639){_0x1cc639['increment']('chatLicenseExceeded');}});}})[_0xa4a5('0x27')](function(){if(!_0x49226b['Interval']||!_0x49226b[_0xa4a5('0x3d')][_0xa4a5('0xad')])return!![];return checkWebsiteIntervals(_0x49226b);})['then'](function(_0x185f9a){var _0x3e2f94=fs['readFileSync'](path[_0xa4a5('0x88')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0xe8e81e=new url[(_0xa4a5('0x103'))](_0x49226b[_0xa4a5('0x104')])[_0xa4a5('0x105')];var _0x5e191a=_0xa4a5('0x106');var _0x202cf7=![];var _0x13bd94={'chatVersion':_0x5e191a,'chatWebsiteAddressOrigin':_0xe8e81e,'remote':_0x49226b[_0xa4a5('0x107')],'query':querystring['stringify'](_[_0xa4a5('0x68')](_0x49226b[_0xa4a5('0x29')]({'plain':!![]}),{'customerIp':_0xa97daf[_0xa4a5('0xb8')][_0xa4a5('0x43')]||_0xa97daf[_0xa4a5('0xb8')][_0xa4a5('0x108')]||_0xa97daf[_0xa4a5('0x109')][_0xa4a5('0x10a')]||_0xa97daf['ip'],'referer':_0xa97daf[_0xa4a5('0xb8')][_0xa4a5('0x48')],'openedInteractions':_0x23393a,'maxInteractions':_0x1755a5,'virtual':_0x58cd81[_0xa4a5('0x101')],'online':_0x185f9a,'custom':_0x58cd81}))[_0xa4a5('0x10b')](/'/g,'\x5c\x27')};_0x4f9ccc[_0xa4a5('0x2e')](ejs[_0xa4a5('0xdb')](Mustache[_0xa4a5('0xdb')](_0x3e2f94,_0x13bd94),{'proactiveActions':_0x2691c6,'alignment':_0x49226b['alignment'],'verticalAlignment':_0x49226b['verticalAlignment'],'div_color':_0x49226b[_0xa4a5('0xfe')],'labelText':_0x49226b[_0xa4a5('0x10c')],'text_color':_0x49226b[_0xa4a5('0x10d')],'text_button_color':_0x49226b[_0xa4a5('0x10e')],'button_color':_0x49226b[_0xa4a5('0x10f')],'background_color':_0x49226b[_0xa4a5('0x110')],'hideWhenOffline':_0x49226b[_0xa4a5('0x111')],'intervalId':_0x49226b[_0xa4a5('0x112')],'isDevelopment':_0x202cf7,'chatVersion':_0x5e191a}));})[_0xa4a5('0x1c')](handleError(_0x4f9ccc,null));};exports[_0xa4a5('0x113')]=function(_0x12e97e,_0xe1ded6){var _0x16c733=_0x12e97e[_0xa4a5('0x6d')]['id'];var _0x2e379d=_0x12e97e[_0xa4a5('0x72')];var _0x2777a3=0xc8;var _0x5a2c6e=null;return db[_0xa4a5('0x114')][_0xa4a5('0xe4')]({'isolationLevel':db['sequelize'][_0xa4a5('0x115')][_0xa4a5('0x116')]['READ_COMMITTED']},function(_0xf25743){return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x16c733},'transaction':_0xf25743})[_0xa4a5('0x27')](function(_0xfcfbb7){if(_0xfcfbb7){return db[_0xa4a5('0x117')][_0xa4a5('0x28')]({'where':{'ChatWebsiteId':_0x16c733},'transaction':_0xf25743})[_0xa4a5('0x27')](function(){var _0x2fc572=_[_0xa4a5('0x3c')](_0x2e379d,function(_0x3c8297){_0x3c8297[_0xa4a5('0x78')]=_0x16c733;return _0x3c8297;});return db[_0xa4a5('0x117')][_0xa4a5('0x118')](_0x2fc572,{'transaction':_0xf25743});});}else{_0x2777a3=0x194;_0x5a2c6e=[];}});})['then'](function(){if(_0x2777a3!==0x194){return db[_0xa4a5('0x117')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x16c733},'order':_0xa4a5('0xb3')})[_0xa4a5('0x27')](function(_0x525a30){_0x5a2c6e=_0x525a30;});}})[_0xa4a5('0x1c')](function(_0x3d7782){_0x2777a3=0x1f4;logger[_0xa4a5('0x19')](_0x3d7782[_0xa4a5('0x2c')]);if(_0x3d7782[_0xa4a5('0x2d')]){delete _0x3d7782[_0xa4a5('0x2d')];}_0x5a2c6e=_0x3d7782;})[_0xa4a5('0x119')](function(){if(_0x5a2c6e===null){_0xe1ded6[_0xa4a5('0x1d')](_0x2777a3);}else{if(_0x2777a3===0x1f4){_0xe1ded6[_0xa4a5('0x1e')](_0x2777a3)[_0xa4a5('0x2e')](_0x5a2c6e);}else{_0xe1ded6['status'](_0x2777a3)[_0xa4a5('0x25')](_0x5a2c6e);}}});};exports['getApplications']=function(_0x474f34,_0x19c315){var _0x5c8508={};var _0x4c71f4={};var _0x1dbb32;var _0x3568b8;return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x474f34[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x19c315,null))['then'](function(_0x29b71d){if(_0x29b71d){_0x1dbb32=_0x29b71d;_0x4c71f4[_0xa4a5('0x4f')]=_['keys'](db[_0xa4a5('0x117')][_0xa4a5('0x58')]);_0x4c71f4[_0xa4a5('0x60')]=_['keys'](_0x474f34[_0xa4a5('0x60')]);_0x4c71f4[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x4c71f4[_0xa4a5('0x4f')],_0x4c71f4[_0xa4a5('0x60')]);_0x5c8508[_0xa4a5('0x5e')]=_['intersection'](_0x4c71f4['model'],qs[_0xa4a5('0x5f')](_0x474f34[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x5c8508[_0xa4a5('0x5e')]=_0x5c8508[_0xa4a5('0x5e')][_0xa4a5('0x61')]?_0x5c8508[_0xa4a5('0x5e')]:_0x4c71f4['model'];_0x5c8508[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x474f34[_0xa4a5('0x60')]['sort']);_0x5c8508[_0xa4a5('0x65')]=qs['filters'](_[_0xa4a5('0x66')](_0x474f34[_0xa4a5('0x60')],_0x4c71f4[_0xa4a5('0x5c')]));if(_0x474f34['query'][_0xa4a5('0x67')]){_0x5c8508[_0xa4a5('0x65')]=_['merge'](_0x5c8508[_0xa4a5('0x65')],{'$or':_['map'](_0x5c8508['attributes'],function(_0xb44f0a){var _0x4fbeb2={};_0x4fbeb2[_0xb44f0a]={'$like':'%'+_0x474f34['query'][_0xa4a5('0x67')]+'%'};return _0x4fbeb2;})});}_0x5c8508=_[_0xa4a5('0x68')]({},_0x5c8508,_0x474f34[_0xa4a5('0x6a')]);return _0x1dbb32[_0xa4a5('0x11a')](_0x5c8508);}})[_0xa4a5('0x27')](function(_0x1e558f){if(_0x1e558f){_0x3568b8=_0x1e558f['length'];if(!_0x474f34[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x5c8508[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x474f34[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x5c8508[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0x474f34[_0xa4a5('0x60')]['offset']);}return _0x1dbb32['getApplications'](_0x5c8508);}})[_0xa4a5('0x27')](function(_0x21905e){if(_0x21905e){return _0x21905e?{'count':_0x3568b8,'rows':_0x21905e}:null;}})['then'](respondWithResult(_0x19c315,null))[_0xa4a5('0x1c')](handleError(_0x19c315,null));};exports[_0xa4a5('0x11b')]=function(_0x35f250,_0x3e9f5a){return db[_0xa4a5('0x11c')][_0xa4a5('0x70')]({'where':{'id':_0x35f250[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3e9f5a,null))[_0xa4a5('0x27')](function(_0x130480){if(_0x130480){return _0x130480[_0xa4a5('0x11b')](_0x35f250[_0xa4a5('0x72')][_0xa4a5('0x7d')],_[_0xa4a5('0xfa')](_0x35f250['body'],[_0xa4a5('0x7d'),'id'])||{});}})['then'](respondWithResult(_0x3e9f5a,null))[_0xa4a5('0x1c')](handleError(_0x3e9f5a,null));};exports[_0xa4a5('0x100')]=function(_0xd77566,_0x3afac4){var _0x5eaa2b={};var _0x29a039={};var _0x321ade;var _0x119e28;return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0xd77566[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3afac4,null))[_0xa4a5('0x27')](function(_0xd76c83){if(_0xd76c83){_0x321ade=_0xd76c83;_0x29a039['model']=_[_0xa4a5('0x5b')](db['ChatProactiveAction']['rawAttributes']);_0x29a039[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0xd77566[_0xa4a5('0x60')]);_0x29a039[_0xa4a5('0x5c')]=_['intersection'](_0x29a039[_0xa4a5('0x4f')],_0x29a039['query']);_0x5eaa2b[_0xa4a5('0x5e')]=_['intersection'](_0x29a039[_0xa4a5('0x4f')],qs[_0xa4a5('0x5f')](_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x5eaa2b[_0xa4a5('0x5e')]=_0x5eaa2b[_0xa4a5('0x5e')][_0xa4a5('0x61')]?_0x5eaa2b['attributes']:_0x29a039[_0xa4a5('0x4f')];_0x5eaa2b[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x5eaa2b[_0xa4a5('0x65')]=qs['filters'](_['pick'](_0xd77566['query'],_0x29a039[_0xa4a5('0x5c')]));if(_0xd77566['query'][_0xa4a5('0x67')]){_0x5eaa2b[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x5eaa2b[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x5eaa2b[_0xa4a5('0x5e')],function(_0x1ac9d5){var _0x3e80f8={};_0x3e80f8[_0x1ac9d5]={'$like':'%'+_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x3e80f8;})});}_0x5eaa2b=_[_0xa4a5('0x68')]({},_0x5eaa2b,_0xd77566[_0xa4a5('0x6a')]);return _0x321ade['getProactiveActions'](_0x5eaa2b);}})[_0xa4a5('0x27')](function(_0x480cd4){if(_0x480cd4){_0x119e28=_0x480cd4[_0xa4a5('0x61')];if(!_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x5eaa2b['limit']=qs[_0xa4a5('0x22')](_0xd77566[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x5eaa2b[_0xa4a5('0x20')]=qs[_0xa4a5('0x20')](_0xd77566['query'][_0xa4a5('0x20')]);}return _0x321ade[_0xa4a5('0x100')](_0x5eaa2b);}})['then'](function(_0x2db12a){if(_0x2db12a){return _0x2db12a?{'count':_0x119e28,'rows':_0x2db12a}:null;}})[_0xa4a5('0x27')](respondWithResult(_0x3afac4,null))[_0xa4a5('0x1c')](handleError(_0x3afac4,null));};exports['getFields']=function(_0x3340b7,_0x4e041c){var _0x3d7d51=_0x3340b7[_0xa4a5('0x60')][_0xa4a5('0x11d')]===_0xa4a5('0x11e')?'offlineForm':'onlineForm';return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'attributes':['id',_0x3d7d51],'where':{'id':_0x3340b7[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x4e041c,null))[_0xa4a5('0x27')](function(_0x21608d){if(_0x21608d){var _0x228236=_0x21608d[_0x3d7d51];var _0x15229b=_0x228236&&_0x228236[_0xa4a5('0x11f')]?_0x228236[_0xa4a5('0x11f')]:[];_0x4e041c[_0xa4a5('0x2e')]({'fromKey':_[_0xa4a5('0x92')](_0x228236[_0xa4a5('0x120')])?undefined:_0x228236[_0xa4a5('0x120')],'count':_0x15229b[_0xa4a5('0x61')],'rows':_0x15229b});}})[_0xa4a5('0x1c')](handleError(_0x4e041c,null));};exports[_0xa4a5('0x121')]=function(_0x18e10f,_0xdf727d){var _0x477724={'raw':![],'where':{}};var _0x2f557f={};var _0x589a76={'count':0x0,'rows':[]};return db[_0xa4a5('0x57')][_0xa4a5('0xe6')]({'where':{'id':_0x18e10f[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0xdf727d,null))['then'](function(_0x1ce8d1){if(_0x1ce8d1){_0x2f557f[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['ChatOfflineMessage'][_0xa4a5('0x58')]);_0x2f557f[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x18e10f[_0xa4a5('0x60')]);_0x2f557f['filters']=_['intersection'](_0x2f557f[_0xa4a5('0x4f')],_0x2f557f[_0xa4a5('0x60')]);_0x477724['attributes']=_[_0xa4a5('0x5d')](_0x2f557f[_0xa4a5('0x4f')],qs['fields'](_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x477724['attributes']=_0x477724['attributes'][_0xa4a5('0x61')]?_0x477724[_0xa4a5('0x5e')]:_0x2f557f[_0xa4a5('0x4f')];if(!_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x477724[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x18e10f[_0xa4a5('0x60')]['limit']);_0x477724[_0xa4a5('0x20')]=qs['offset'](_0x18e10f[_0xa4a5('0x60')]['offset']);}_0x477724[_0xa4a5('0x63')]=qs[_0xa4a5('0x64')](_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x64')]);_0x477724[_0xa4a5('0x65')]=qs[_0xa4a5('0x5c')](_['pick'](_0x18e10f[_0xa4a5('0x60')],_0x2f557f[_0xa4a5('0x5c')]));_0x477724['where'][_0xa4a5('0x78')]=_0x1ce8d1['id'];if(_0x18e10f[_0xa4a5('0x60')]['filter']){_0x477724[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x477724[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x477724['attributes'],function(_0x509bad){var _0x144a58={};_0x144a58[_0x509bad]={'$like':'%'+_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x144a58;})});}_0x477724=_[_0xa4a5('0x68')]({},_0x477724,_0x18e10f[_0xa4a5('0x6a')]);return db[_0xa4a5('0xdd')][_0xa4a5('0x23')]({'where':_0x477724[_0xa4a5('0x65')]})['then'](function(_0x2fe416){_0x589a76[_0xa4a5('0x23')]=_0x2fe416;if(_0x18e10f[_0xa4a5('0x60')][_0xa4a5('0x6e')]){_0x477724[_0xa4a5('0x6f')]=[{'all':!![]}];}else{_0x477724[_0xa4a5('0x6f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa4a5('0xe5')],'as':_0xa4a5('0x122'),'required':![]}];}return db[_0xa4a5('0xdd')][_0xa4a5('0x6b')](_0x477724);})[_0xa4a5('0x27')](function(_0x3eaa09){_0x589a76[_0xa4a5('0x6c')]=_0x3eaa09;return _0x589a76;});}})[_0xa4a5('0x27')](respondWithFilteredResult(_0xdf727d,_0x477724))[_0xa4a5('0x1c')](handleError(_0xdf727d,null));};exports[_0xa4a5('0x123')]=function(_0x476d53,_0x30e324){return db[_0xa4a5('0x57')]['find']({'where':{'id':_0x476d53['params']['id']}})['then'](handleEntityNotFound(_0x30e324,null))[_0xa4a5('0x27')](function(_0x4ddb3c){if(_0x4ddb3c){return _0x4ddb3c[_0xa4a5('0x123')](_0x476d53[_0xa4a5('0x72')][_0xa4a5('0x7d')],_[_0xa4a5('0xfa')](_0x476d53['body'],[_0xa4a5('0x7d'),'id'])||{})[_0xa4a5('0xae')](function(_0x14614a){for(var _0x492b7a=0x0;_0x492b7a<_0x476d53['body'][_0xa4a5('0x7d')][_0xa4a5('0x61')];_0x492b7a+=0x1){socket[_0xa4a5('0x124')]('userChatWebsite:save',{'UserId':Number(_0x476d53['body'][_0xa4a5('0x7d')][_0x492b7a]),'ChatWebsiteId':Number(_0x476d53[_0xa4a5('0x6d')]['id'])});}return _0x14614a;});}})['then'](respondWithResult(_0x30e324,null))[_0xa4a5('0x1c')](handleError(_0x30e324,null));};exports[_0xa4a5('0x125')]=function(_0x1a9003,_0x40ab83){return db[_0xa4a5('0x57')][_0xa4a5('0x70')]({'where':{'id':_0x1a9003[_0xa4a5('0x6d')]['id']}})[_0xa4a5('0x27')](handleEntityNotFound(_0x40ab83,null))[_0xa4a5('0x27')](function(_0x42c5d0){if(_0x42c5d0){return _0x42c5d0[_0xa4a5('0x125')](_0x1a9003[_0xa4a5('0x60')][_0xa4a5('0x7d')])[_0xa4a5('0x27')](function(){if(_[_0xa4a5('0x126')](_0x1a9003[_0xa4a5('0x60')][_0xa4a5('0x7d')])){for(var _0x3838ed=0x0;_0x3838ed<_0x1a9003[_0xa4a5('0x60')][_0xa4a5('0x7d')][_0xa4a5('0x61')];_0x3838ed+=0x1){socket[_0xa4a5('0x124')](_0xa4a5('0x127'),{'UserId':Number(_0x1a9003['query'][_0xa4a5('0x7d')][_0x3838ed]),'ChatWebsiteId':Number(_0x1a9003[_0xa4a5('0x6d')]['id'])});}}else{socket[_0xa4a5('0x124')](_0xa4a5('0x127'),{'UserId':Number(_0x1a9003[_0xa4a5('0x60')]['ids']),'ChatWebsiteId':Number(_0x1a9003['params']['id'])});}});}})[_0xa4a5('0x27')](respondWithStatusCode(_0x40ab83,null))['catch'](handleError(_0x40ab83,null));};exports[_0xa4a5('0x128')]=function(_0x5ef8f9,_0x4a81ca){var _0x190208={};var _0x354782={};var _0x1a4d98;var _0x511794;return db['ChatWebsite'][_0xa4a5('0xe6')]({'where':{'id':_0x5ef8f9[_0xa4a5('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4a81ca,null))[_0xa4a5('0x27')](function(_0x20da55){if(_0x20da55){_0x1a4d98=_0x20da55;_0x354782[_0xa4a5('0x4f')]=_[_0xa4a5('0x5b')](db['User'][_0xa4a5('0x58')]);_0x354782[_0xa4a5('0x60')]=_[_0xa4a5('0x5b')](_0x5ef8f9['query']);_0x354782[_0xa4a5('0x5c')]=_[_0xa4a5('0x5d')](_0x354782['model'],_0x354782[_0xa4a5('0x60')]);_0x190208['attributes']=_[_0xa4a5('0x5d')](_0x354782[_0xa4a5('0x4f')],qs['fields'](_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x5f')]));_0x190208[_0xa4a5('0x5e')]=_0x190208[_0xa4a5('0x5e')]['length']?_0x190208['attributes']:_0x354782[_0xa4a5('0x4f')];_0x190208[_0xa4a5('0x63')]=qs['sort'](_0x5ef8f9[_0xa4a5('0x60')]['sort']);_0x190208['where']=qs['filters'](_[_0xa4a5('0x66')](_0x5ef8f9[_0xa4a5('0x60')],_0x354782[_0xa4a5('0x5c')]));if(_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x67')]){_0x190208[_0xa4a5('0x65')]=_[_0xa4a5('0x68')](_0x190208[_0xa4a5('0x65')],{'$or':_[_0xa4a5('0x3c')](_0x190208[_0xa4a5('0x5e')],function(_0x12ef64){var _0x306ed4={};_0x306ed4[_0x12ef64]={'$like':'%'+_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x67')]+'%'};return _0x306ed4;})});}_0x190208=_[_0xa4a5('0x68')]({},_0x190208,_0x5ef8f9[_0xa4a5('0x6a')]);return _0x1a4d98[_0xa4a5('0x128')](_0x190208);}})[_0xa4a5('0x27')](function(_0xcc9d){if(_0xcc9d){_0x511794=_0xcc9d[_0xa4a5('0x61')];if(!_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x62')](_0xa4a5('0x7b'))){_0x190208[_0xa4a5('0x22')]=qs[_0xa4a5('0x22')](_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x22')]);_0x190208[_0xa4a5('0x20')]=qs['offset'](_0x5ef8f9[_0xa4a5('0x60')][_0xa4a5('0x20')]);}return _0x1a4d98[_0xa4a5('0x128')](_0x190208);}})['then'](function(_0x35ab93){if(_0x35ab93){return _0x35ab93?{'count':_0x511794,'rows':_0x35ab93}:null;}})[_0xa4a5('0x27')](respondWithResult(_0x4a81ca,null))['catch'](handleError(_0x4a81ca,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 040ca68..e59ad5d 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 _0xfaec=['remove','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite'];(function(_0x3a5ac9,_0xd6b08b){var _0x428e4a=function(_0x5f172d){while(--_0x5f172d){_0x3a5ac9['push'](_0x3a5ac9['shift']());}};_0x428e4a(++_0xd6b08b);}(_0xfaec,0x12f));var _0xcfae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfaec[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xcfae('0x0'));var ChatWebsite=require(_0xcfae('0x1'))['db'][_0xcfae('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcfae('0x3')};function emitEvent(_0x2c5d89){return function(_0xa45aee,_0x3035db,_0x23ea5e){ChatWebsiteEvents['emit'](_0x2c5d89+':'+_0xa45aee['id'],_0xa45aee);ChatWebsiteEvents['emit'](_0x2c5d89,_0xa45aee);_0x23ea5e(null);};}for(var e in events){if(events[_0xcfae('0x4')](e)){var event=events[e];ChatWebsite[_0xcfae('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2d17=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x2d17,0x17e));var _0x72d1=function(_0x45b43b,_0x1037a9){_0x45b43b=_0x45b43b-0x0;var _0x41f6c7=_0x2d17[_0x45b43b];return _0x41f6c7;};'use strict';var EventEmitter=require(_0x72d1('0x0'));var ChatWebsite=require(_0x72d1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x72d1('0x2')](0x0);var events={'afterCreate':_0x72d1('0x3'),'afterUpdate':'update','afterDestroy':_0x72d1('0x4')};function emitEvent(_0x38fec7){return function(_0x55b722,_0x1dd6d8,_0x4dfee1){ChatWebsiteEvents[_0x72d1('0x5')](_0x38fec7+':'+_0x55b722['id'],_0x55b722);ChatWebsiteEvents['emit'](_0x38fec7,_0x55b722);_0x4dfee1(null);};}for(var e in events){if(events[_0x72d1('0x6')](e)){var event=events[e];ChatWebsite[_0x72d1('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index d7a1f02..9f63dc5 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 _0x8e45=['exports','define','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8e45,0x12f));var _0x58e4=function(_0x437257,_0x4b33b9){_0x437257=_0x437257-0x0;var _0x378721=_0x8e45[_0x437257];return _0x378721;};'use strict';var _=require(_0x58e4('0x0'));var util=require(_0x58e4('0x1'));var logger=require(_0x58e4('0x2'))(_0x58e4('0x3'));var moment=require('moment');var BPromise=require(_0x58e4('0x4'));var rp=require(_0x58e4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58e4('0x6'));var config=require(_0x58e4('0x7'));var attributes=require(_0x58e4('0x8'));module[_0x58e4('0x9')]=function(_0x3638d0,_0x56c7dc){return _0x3638d0[_0x58e4('0xa')]('ChatWebsite',attributes,{'tableName':_0x58e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe80e=['moment','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe80e,0x12a));var _0xee80=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xe80e[_0x236d24];return _0x1574cf;};'use strict';var _=require('lodash');var util=require(_0xee80('0x0'));var logger=require('../../config/logger')(_0xee80('0x1'));var moment=require(_0xee80('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee80('0x3'));var rimraf=require(_0xee80('0x4'));var config=require(_0xee80('0x5'));var attributes=require(_0xee80('0x6'));module[_0xee80('0x7')]=function(_0x10e12a,_0x36c211){return _0x10e12a[_0xee80('0x8')]('ChatWebsite',attributes,{'tableName':_0xee80('0x9'),'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 9d16503..db028f9 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 _0xb79e=['code','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb79e,0x17e));var _0xeb79=function(_0x8533ec,_0x5f2114){_0x8533ec=_0x8533ec-0x0;var _0x4e123a=_0xb79e[_0x8533ec];return _0x4e123a;};'use strict';var _=require('lodash');var util=require(_0xeb79('0x0'));var moment=require(_0xeb79('0x1'));var BPromise=require(_0xeb79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb79('0x3'));var db=require(_0xeb79('0x4'))['db'];var utils=require(_0xeb79('0x5'));var logger=require(_0xeb79('0x6'))(_0xeb79('0x7'));var config=require(_0xeb79('0x8'));var jayson=require(_0xeb79('0x9'));var client=jayson[_0xeb79('0xa')][_0xeb79('0xb')]({'port':0x232a});config['redis']=_[_0xeb79('0xc')](config[_0xeb79('0xd')],{'host':_0xeb79('0xe'),'port':0x18eb});var socket=require(_0xeb79('0xf'))(new Redis(config[_0xeb79('0xd')]));require(_0xeb79('0x10'))[_0xeb79('0x11')](socket);function respondWithRpcPromise(_0x217b64,_0x36fe0f,_0x2e0706){return new BPromise(function(_0x39f153,_0x2f8f89){return client['request'](_0x217b64,_0x2e0706)[_0xeb79('0x12')](function(_0x2ac5dc){logger['info'](_0xeb79('0x13'),_0x36fe0f,_0xeb79('0x14'));logger[_0xeb79('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x36fe0f,_0xeb79('0x14'),JSON['stringify'](_0x2ac5dc));if(_0x2ac5dc[_0xeb79('0x16')]){if(_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x17')]===0x1f4){logger['error'](_0xeb79('0x13'),_0x36fe0f,_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);return _0x2f8f89(_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);}logger[_0xeb79('0x16')](_0xeb79('0x13'),_0x36fe0f,_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);return _0x39f153(_0x2ac5dc[_0xeb79('0x16')][_0xeb79('0x18')]);}else{logger[_0xeb79('0x19')](_0xeb79('0x13'),_0x36fe0f,_0xeb79('0x14'));_0x39f153(_0x2ac5dc['result'][_0xeb79('0x18')]);}})[_0xeb79('0x1a')](function(_0x39c447){logger[_0xeb79('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x36fe0f,_0x39c447);_0x2f8f89(_0x39c447);});});}
\ No newline at end of file
+var _0x0246=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/environment','client','redis','defaults','localhost','./chatWebsite.socket','then'];(function(_0x240c03,_0x132524){var _0x455f30=function(_0x4912f4){while(--_0x4912f4){_0x240c03['push'](_0x240c03['shift']());}};_0x455f30(++_0x132524);}(_0x0246,0xa9));var _0x6024=function(_0x2229d4,_0x366868){_0x2229d4=_0x2229d4-0x0;var _0x5ae869=_0x0246[_0x2229d4];return _0x5ae869;};'use strict';var _=require('lodash');var util=require(_0x6024('0x0'));var moment=require('moment');var BPromise=require(_0x6024('0x1'));var rs=require(_0x6024('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6024('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6024('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x6024('0x5')]['http']({'port':0x232a});config[_0x6024('0x6')]=_[_0x6024('0x7')](config['redis'],{'host':_0x6024('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6024('0x6')]));require(_0x6024('0x9'))['register'](socket);function respondWithRpcPromise(_0x4ed962,_0x5823bf,_0x397dbf){return new BPromise(function(_0x21278a,_0x288965){return client['request'](_0x4ed962,_0x397dbf)[_0x6024('0xa')](function(_0x4c1e33){logger[_0x6024('0xb')](_0x6024('0xc'),_0x5823bf,_0x6024('0xd'));logger['debug'](_0x6024('0xe'),_0x5823bf,_0x6024('0xd'),JSON[_0x6024('0xf')](_0x4c1e33));if(_0x4c1e33['error']){if(_0x4c1e33['error']['code']===0x1f4){logger[_0x6024('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5823bf,_0x4c1e33[_0x6024('0x10')][_0x6024('0x11')]);return _0x288965(_0x4c1e33['error'][_0x6024('0x11')]);}logger[_0x6024('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5823bf,_0x4c1e33[_0x6024('0x10')][_0x6024('0x11')]);return _0x21278a(_0x4c1e33[_0x6024('0x10')][_0x6024('0x11')]);}else{logger['info'](_0x6024('0xc'),_0x5823bf,'request\x20sent');_0x21278a(_0x4c1e33[_0x6024('0x12')][_0x6024('0x11')]);}})[_0x6024('0x13')](function(_0x169f9e){logger['error'](_0x6024('0xc'),_0x5823bf,_0x169f9e);_0x288965(_0x169f9e);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8155194..268cb3e 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 _0xc883=['length','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0xc883,0x122));var _0x3c88=function(_0x35fd98,_0x11e58b){_0x35fd98=_0x35fd98-0x0;var _0x139fe8=_0xc883[_0x35fd98];return _0x139fe8;};'use strict';var ChatWebsiteEvents=require(_0x3c88('0x0'));var events=[_0x3c88('0x1'),'remove',_0x3c88('0x2')];function createListener(_0x44d44a,_0x5f4aef){return function(_0x498e26){_0x5f4aef[_0x3c88('0x3')](_0x44d44a,_0x498e26);};}function removeListener(_0x5547e1,_0x8e0934){return function(){ChatWebsiteEvents['removeListener'](_0x5547e1,_0x8e0934);};}exports['register']=function(_0x412275){for(var _0x50ff89=0x0,_0x49fe5b=events[_0x3c88('0x4')];_0x50ff89<_0x49fe5b;_0x50ff89++){var _0x111c93=events[_0x50ff89];var _0x510691=createListener(_0x3c88('0x5')+_0x111c93,_0x412275);ChatWebsiteEvents['on'](_0x111c93,_0x510691);}};
\ No newline at end of file
+var _0x26ba=['update','removeListener','./chatWebsite.events','save','remove'];(function(_0x512132,_0x360c5c){var _0x2a6fab=function(_0x542bac){while(--_0x542bac){_0x512132['push'](_0x512132['shift']());}};_0x2a6fab(++_0x360c5c);}(_0x26ba,0x1ba));var _0xa26b=function(_0x54af0d,_0x3e5db0){_0x54af0d=_0x54af0d-0x0;var _0x57b08d=_0x26ba[_0x54af0d];return _0x57b08d;};'use strict';var ChatWebsiteEvents=require(_0xa26b('0x0'));var events=[_0xa26b('0x1'),_0xa26b('0x2'),_0xa26b('0x3')];function createListener(_0x14674a,_0x4abec5){return function(_0x700185){_0x4abec5['emit'](_0x14674a,_0x700185);};}function removeListener(_0x426635,_0x51c119){return function(){ChatWebsiteEvents[_0xa26b('0x4')](_0x426635,_0x51c119);};}exports['register']=function(_0x104f55){for(var _0x5a099d=0x0,_0x5a08b8=events['length'];_0x5a099d<_0x5a08b8;_0x5a099d++){var _0x16b406=events[_0x5a099d];var _0x39cafb=createListener('chatWebsite:'+_0x16b406,_0x104f55);ChatWebsiteEvents['on'](_0x16b406,_0x39cafb);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 9130f5c..8c7165f 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 _0x0ff2=['getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','addDisposition','post','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','addAvatar','single','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','describe','get','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar'];(function(_0xb2423a,_0x71b6a3){var _0x3b88ba=function(_0x1cc533){while(--_0x1cc533){_0xb2423a['push'](_0xb2423a['shift']());}};_0x3b88ba(++_0x71b6a3);}(_0x0ff2,0xc9));var _0x20ff=function(_0x46d39b,_0x57b6dd){_0x46d39b=_0x46d39b-0x0;var _0x342d09=_0x0ff2[_0x46d39b];return _0x342d09;};'use strict';var multer=require('multer');var util=require(_0x20ff('0x0'));var path=require(_0x20ff('0x1'));var timeout=require(_0x20ff('0x2'));var express=require('express');var router=express[_0x20ff('0x3')]();var fs_extra=require(_0x20ff('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x20ff('0x5'));var config=require(_0x20ff('0x6'));var controller=require(_0x20ff('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x20ff('0x8')]);router['get'](_0x20ff('0x9'),auth['isAuthenticated'](),controller[_0x20ff('0xa')]);router[_0x20ff('0xb')](_0x20ff('0xc'),auth[_0x20ff('0xd')](),controller['show']);router[_0x20ff('0xb')](_0x20ff('0xe'),auth[_0x20ff('0xd')](),controller[_0x20ff('0xf')]);router[_0x20ff('0xb')](_0x20ff('0x10'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x11')]);router['get']('/:id/logo',controller[_0x20ff('0x12')]);router[_0x20ff('0xb')](_0x20ff('0x13'),controller[_0x20ff('0x14')]);router[_0x20ff('0xb')](_0x20ff('0x15'),controller[_0x20ff('0x16')]);router[_0x20ff('0xb')](_0x20ff('0x17'),controller[_0x20ff('0x18')]);router[_0x20ff('0xb')](_0x20ff('0x19'),auth[_0x20ff('0xd')](),controller['getInteractions']);router[_0x20ff('0xb')](_0x20ff('0x1a'),controller[_0x20ff('0x1b')]);router[_0x20ff('0xb')](_0x20ff('0x1c'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x1d')]);router[_0x20ff('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x20ff('0x1e')]);router[_0x20ff('0xb')](_0x20ff('0x1f'),controller[_0x20ff('0x20')]);router['get'](_0x20ff('0x21'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x22')]);router[_0x20ff('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0x20ff('0x23')]);router['post']('/',auth['isAuthenticated'](),controller[_0x20ff('0x24')]);router['post']('/:id/dispositions',auth[_0x20ff('0xd')](),controller[_0x20ff('0x25')]);router[_0x20ff('0x26')](_0x20ff('0x10'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x4c05e4,_0x4aec6e,_0x350042){_0x350042(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],_0x20ff('0x2a')));},'filename':function(_0x3db28b,_0x123560,_0x22e397){_0x22e397(null,util[_0x20ff('0x2b')](_0x20ff('0x2c'),Date[_0x20ff('0x2d')](),_0x123560[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')]('/:id/logo',upload['single'](_0x20ff('0x2f')),controller[_0x20ff('0x30')]);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x2d7865,_0x514a53,_0x297b3e){_0x297b3e(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],_0x20ff('0x31')));},'filename':function(_0x306c25,_0x4958b7,_0x35aa2c){_0x35aa2c(null,util[_0x20ff('0x2b')](_0x20ff('0x2c'),Date[_0x20ff('0x2d')](),_0x4958b7[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')](_0x20ff('0x13'),upload['single'](_0x20ff('0x2f')),controller[_0x20ff('0x32')]);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x122417,_0x3ae439,_0x396094){_0x396094(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],'server/files/images/avatars/'));},'filename':function(_0x11b5c4,_0x47cdf3,_0x1c92cf){_0x1c92cf(null,util[_0x20ff('0x2b')]('%s-%s',Date[_0x20ff('0x2d')](),_0x47cdf3[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')](_0x20ff('0x15'),upload[_0x20ff('0x33')](_0x20ff('0x2f')),controller[_0x20ff('0x34')]);var upload=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x1ab4b5,_0xeaeced,_0x5bb27b){_0x5bb27b(null,path[_0x20ff('0x28')](config[_0x20ff('0x29')],'server/files/images/avatars/'));},'filename':function(_0x4e6449,_0x75e292,_0x194d16){_0x194d16(null,util[_0x20ff('0x2b')](_0x20ff('0x2c'),Date[_0x20ff('0x2d')](),_0x75e292[_0x20ff('0x2e')]));}})});router[_0x20ff('0x26')](_0x20ff('0x17'),upload[_0x20ff('0x33')](_0x20ff('0x2f')),controller[_0x20ff('0x35')]);router[_0x20ff('0x26')]('/:id/notify',controller[_0x20ff('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x20ff('0x27')]({'destination':function(_0x38fdbd,_0x4fc388,_0x56df99){const _0x1925ad=path[_0x20ff('0x28')](config[_0x20ff('0x29')],_0x20ff('0x37'),_0x20ff('0x38'),'offline-chat');fs_extra[_0x20ff('0x39')](_0x1925ad,function(){_0x56df99(null,_0x1925ad);});},'filename':function(_0x527a22,_0xeb29a7,_0x3ac585){const _0x3a876e=_0xeb29a7[_0x20ff('0x2e')][_0x20ff('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x32315c=path[_0x20ff('0x3b')](_0x3a876e);const _0x299577=Date[_0x20ff('0x2d')]()+'-'+_0x3a876e[_0x20ff('0x3a')](_0x32315c,'')+_0x32315c;_0x3ac585(null,_0x299577);}})});router[_0x20ff('0x26')](_0x20ff('0x3c'),offlineUploadMulter[_0x20ff('0x3d')](),controller[_0x20ff('0x3e')]);router['post'](_0x20ff('0x19'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x3f')]);router['post'](_0x20ff('0x1c'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x40')]);router['post']('/:id/proactive_actions',auth[_0x20ff('0xd')](),controller[_0x20ff('0x41')]);router[_0x20ff('0x26')](_0x20ff('0x42'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x43')]);router[_0x20ff('0x44')](_0x20ff('0xc'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x45')]);router[_0x20ff('0x46')](_0x20ff('0xc'),auth[_0x20ff('0xd')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x20ff('0xd')](),controller[_0x20ff('0x47')]);router[_0x20ff('0x46')](_0x20ff('0x10'),auth[_0x20ff('0xd')](),controller[_0x20ff('0x48')]);router['delete']('/:id/users',auth[_0x20ff('0xd')](),controller[_0x20ff('0x49')]);module[_0x20ff('0x4a')]=router;
\ No newline at end of file
+var _0xc3a3=['addApplications','addProactiveActions','addAgents','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','show','/:id/canned_answers','isAuthenticated','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction'];(function(_0x12f56b,_0x534bf4){var _0x10e4e4=function(_0x49b772){while(--_0x49b772){_0x12f56b['push'](_0x12f56b['shift']());}};_0x10e4e4(++_0x534bf4);}(_0xc3a3,0x9a));var _0x3c3a=function(_0x4004e1,_0x4a241d){_0x4004e1=_0x4004e1-0x0;var _0x360efb=_0xc3a3[_0x4004e1];return _0x360efb;};'use strict';var multer=require(_0x3c3a('0x0'));var util=require(_0x3c3a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3c3a('0x2'));var router=express[_0x3c3a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3c3a('0x4'));var interaction=require(_0x3c3a('0x5'));var config=require(_0x3c3a('0x6'));var controller=require(_0x3c3a('0x7'));router[_0x3c3a('0x8')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0x9')]);router[_0x3c3a('0x8')](_0x3c3a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3c3a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3c3a('0xb')]);router[_0x3c3a('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x3c3a('0xc'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0xe')]);router['get'](_0x3c3a('0xf'),controller[_0x3c3a('0x10')]);router[_0x3c3a('0x8')](_0x3c3a('0x11'),controller[_0x3c3a('0x12')]);router[_0x3c3a('0x8')](_0x3c3a('0x13'),controller[_0x3c3a('0x14')]);router[_0x3c3a('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x3c3a('0x8')](_0x3c3a('0x15'),auth['isAuthenticated'](),controller[_0x3c3a('0x16')]);router['get'](_0x3c3a('0x17'),controller[_0x3c3a('0x18')]);router[_0x3c3a('0x8')](_0x3c3a('0x19'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x1a')]);router[_0x3c3a('0x8')](_0x3c3a('0x1b'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x1c')]);router[_0x3c3a('0x8')]('/:id/fields',controller['getFields']);router[_0x3c3a('0x8')](_0x3c3a('0x1d'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x1e')]);router[_0x3c3a('0x8')](_0x3c3a('0x1f'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x20')]);router[_0x3c3a('0x21')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0x22')]);router['post'](_0x3c3a('0x23'),auth['isAuthenticated'](),controller[_0x3c3a('0x24')]);router['post'](_0x3c3a('0xc'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x25')]);var upload=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x2ebb12,_0x10a9eb,_0x5750f8){_0x5750f8(null,path['join'](config[_0x3c3a('0x27')],_0x3c3a('0x28')));},'filename':function(_0x46d87f,_0x2f1b22,_0x5292cf){_0x5292cf(null,util[_0x3c3a('0x29')](_0x3c3a('0x2a'),Date[_0x3c3a('0x2b')](),_0x2f1b22[_0x3c3a('0x2c')]));}})});router[_0x3c3a('0x21')]('/:id/logo',upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller[_0x3c3a('0x2f')]);var upload=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x537d7a,_0x43afb0,_0x582966){_0x582966(null,path[_0x3c3a('0x30')](config[_0x3c3a('0x27')],_0x3c3a('0x31')));},'filename':function(_0x51c602,_0x5d4f47,_0x57ff31){_0x57ff31(null,util['format']('%s-%s',Date[_0x3c3a('0x2b')](),_0x5d4f47[_0x3c3a('0x2c')]));}})});router[_0x3c3a('0x21')](_0x3c3a('0x11'),upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller[_0x3c3a('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52a8f3,_0x3e8557,_0x129442){_0x129442(null,path[_0x3c3a('0x30')](config[_0x3c3a('0x27')],_0x3c3a('0x31')));},'filename':function(_0x139264,_0x3859f2,_0x12cde3){_0x12cde3(null,util['format']('%s-%s',Date[_0x3c3a('0x2b')](),_0x3859f2[_0x3c3a('0x2c')]));}})});router['post'](_0x3c3a('0x13'),upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller[_0x3c3a('0x33')]);var upload=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x144788,_0x91486b,_0x884e6d){_0x884e6d(null,path['join'](config[_0x3c3a('0x27')],_0x3c3a('0x31')));},'filename':function(_0x25fa49,_0x1e5d74,_0x272693){_0x272693(null,util[_0x3c3a('0x29')](_0x3c3a('0x2a'),Date[_0x3c3a('0x2b')](),_0x1e5d74[_0x3c3a('0x2c')]));}})});router['post']('/:id/system_avatar',upload[_0x3c3a('0x2d')](_0x3c3a('0x2e')),controller['addSystemAvatar']);router[_0x3c3a('0x21')](_0x3c3a('0x34'),controller[_0x3c3a('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x3c3a('0x26')]({'destination':function(_0x24009d,_0x48bef8,_0x29f3e2){const _0x4dc6c0=path[_0x3c3a('0x30')](config[_0x3c3a('0x27')],_0x3c3a('0x36'),'attachments',_0x3c3a('0x37'));fs_extra[_0x3c3a('0x38')](_0x4dc6c0,function(){_0x29f3e2(null,_0x4dc6c0);});},'filename':function(_0x29f1ba,_0x458dfb,_0x30251e){const _0x1c5494=_0x458dfb['originalname'][_0x3c3a('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x42ebd7=path['extname'](_0x1c5494);const _0x1802b5=Date['now']()+'-'+_0x1c5494[_0x3c3a('0x39')](_0x42ebd7,'')+_0x42ebd7;_0x30251e(null,_0x1802b5);}})});router[_0x3c3a('0x21')](_0x3c3a('0x3a'),offlineUploadMulter[_0x3c3a('0x3b')](),controller[_0x3c3a('0x3c')]);router['post'](_0x3c3a('0x15'),auth['isAuthenticated'](),controller[_0x3c3a('0x3d')]);router['post'](_0x3c3a('0x19'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x3e')]);router[_0x3c3a('0x21')](_0x3c3a('0x1b'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x3f')]);router[_0x3c3a('0x21')](_0x3c3a('0x1f'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x40')]);router['put'](_0x3c3a('0x41'),auth[_0x3c3a('0xd')](),controller['update']);router[_0x3c3a('0x42')](_0x3c3a('0x41'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x43')]);router[_0x3c3a('0x42')](_0x3c3a('0x23'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x44')]);router[_0x3c3a('0x42')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3c3a('0x45')]);router['delete'](_0x3c3a('0x1f'),auth[_0x3c3a('0xd')](),controller[_0x3c3a('0x46')]);module[_0x3c3a('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index df39792..5e03972 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 _0xc52a=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production','app'];(function(_0xee4cde,_0xec9c59){var _0x4fd9f0=function(_0x24a6ff){while(--_0x24a6ff){_0xee4cde['push'](_0xee4cde['shift']());}};_0x4fd9f0(++_0xec9c59);}(_0xc52a,0x181));var _0xac52=function(_0x44a573,_0x1e6efc){_0x44a573=_0x44a573-0x0;var _0x4babc6=_0xc52a[_0x44a573];return _0x4babc6;};var beaverLogger=require(_0xac52('0x0'));var express=require('express');var auth=require(_0xac52('0x1'));var config=require(_0xac52('0x2'));var router=express[_0xac52('0x3')]();var isProduction=config[_0xac52('0x4')]===_0xac52('0x5')||![];function clientSideLogs(_0x502d75,_0x3c42ad,_0x29f9e1){var _0x3328da=_0x502d75[_0xac52('0x6')][_0xac52('0x7')](_0xac52('0x8'));if(!_0x3328da){throw new Error(_0xac52('0x9'));}return beaverLogger[_0xac52('0xa')]({'uri':_0xac52('0xb'),'logger':_0x3328da,'enableCors':!isProduction})(_0x502d75,_0x3c42ad,_0x29f9e1);}router['use'](auth[_0xac52('0xc')](),clientSideLogs);module[_0xac52('0xd')]=router;
\ No newline at end of file
+var _0x1942=['beaver-logger/server','express','../config/environment','Router','env','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports'];(function(_0x8774d0,_0x5989f9){var _0x27ebed=function(_0x296fc7){while(--_0x296fc7){_0x8774d0['push'](_0x8774d0['shift']());}};_0x27ebed(++_0x5989f9);}(_0x1942,0x179));var _0x2194=function(_0x271d63,_0x40ca6f){_0x271d63=_0x271d63-0x0;var _0x16d485=_0x1942[_0x271d63];return _0x16d485;};var beaverLogger=require(_0x2194('0x0'));var express=require(_0x2194('0x1'));var auth=require('../components/auth/service');var config=require(_0x2194('0x2'));var router=express[_0x2194('0x3')]();var isProduction=config[_0x2194('0x4')]==='production'||![];function clientSideLogs(_0x459464,_0x526c81,_0x5571b9){var _0x390bd7=_0x459464[_0x2194('0x5')]['get'](_0x2194('0x6'));if(!_0x390bd7){throw new Error(_0x2194('0x7'));}return beaverLogger[_0x2194('0x8')]({'uri':_0x2194('0x9'),'logger':_0x390bd7,'enableCors':!isProduction})(_0x459464,_0x526c81,_0x5571b9);}router[_0x2194('0xa')](auth[_0x2194('0xb')](),clientSideLogs);module[_0x2194('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 07fd55c..fa89edb 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 _0x10ad=['AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM'];(function(_0xecc8f4,_0x350061){var _0x1cc0bc=function(_0x57f0f0){while(--_0x57f0f0){_0xecc8f4['push'](_0xecc8f4['shift']());}};_0x1cc0bc(++_0x350061);}(_0x10ad,0x19d));var _0xd10a=function(_0x2fe439,_0x5bf629){_0x2fe439=_0x2fe439-0x0;var _0x1db61a=_0x10ad[_0x2fe439];return _0x1db61a;};'use strict';var Sequelize=require('sequelize');module[_0xd10a('0x0')]={'name':{'type':Sequelize[_0xd10a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd10a('0x2')](_0xd10a('0x3'),_0xd10a('0x4'),_0xd10a('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd10a('0x6'),_0xd10a('0x7'))},'data1':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0x8')},'data2':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0x9')},'data3':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0xa')},'data4':{'type':Sequelize[_0xd10a('0x1')],'comment':_0xd10a('0xb')},'data5':{'type':Sequelize[_0xd10a('0xc')],'comment':_0xd10a('0xd')},'data6':{'type':Sequelize[_0xd10a('0xc')],'comment':_0xd10a('0xe')},'data7':{'type':Sequelize[_0xd10a('0xc')],'comment':_0xd10a('0xf')}};
\ No newline at end of file
+var _0x759d=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token'];(function(_0x2d2ff4,_0x1f59bc){var _0x18513a=function(_0x19d6e6){while(--_0x19d6e6){_0x2d2ff4['push'](_0x2d2ff4['shift']());}};_0x18513a(++_0x1f59bc);}(_0x759d,0x161));var _0xd759=function(_0x2bc84e,_0x1fcf67){_0x2bc84e=_0x2bc84e-0x0;var _0x4ad0b9=_0x759d[_0x2bc84e];return _0x4ad0b9;};'use strict';var Sequelize=require(_0xd759('0x0'));module[_0xd759('0x1')]={'name':{'type':Sequelize[_0xd759('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd759('0x3')](_0xd759('0x4'),'Google',_0xd759('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd759('0x3')](_0xd759('0x6'),_0xd759('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0xd759('0x8')},'data2':{'type':Sequelize[_0xd759('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xd759('0x2')],'comment':_0xd759('0x9')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0xd759('0xa')},'data6':{'type':Sequelize[_0xd759('0xb')],'comment':_0xd759('0xc')},'data7':{'type':Sequelize[_0xd759('0xb')],'comment':_0xd759('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 8fa4088..6706975 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 _0x81ec=['json','offset','undefined','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','MicrosoftAzure','decryptString','data3','show','params','find','catch','create','Name\x20parameter\x20not\x20specified','body','service','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','status','end'];(function(_0xfbfe1a,_0x3e9459){var _0xba1312=function(_0x4f2a2f){while(--_0x4f2a2f){_0xfbfe1a['push'](_0xfbfe1a['shift']());}};_0xba1312(++_0x3e9459);}(_0x81ec,0x170));var _0xc81e=function(_0x4073b6,_0x3bdde9){_0x4073b6=_0x4073b6-0x0;var _0x464a51=_0x81ec[_0x4073b6];return _0x464a51;};'use strict';var _=require('lodash');var Redis=require(_0xc81e('0x0'));var qs=require(_0xc81e('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0xc81e('0x2'));var logger=require(_0xc81e('0x3'))(_0xc81e('0x4'));var db=require(_0xc81e('0x5'))['db'];var oauth=require(_0xc81e('0x6'));config[_0xc81e('0x7')]=_['defaults'](config[_0xc81e('0x7')],{'host':_0xc81e('0x8'),'port':0x18eb});var socket=require(_0xc81e('0x9'))(new Redis(config[_0xc81e('0x7')]));var redis=new Redis(config[_0xc81e('0x7')]);function respondWithStatusCode(_0xa20fbe,_0x57d124){_0x57d124=_0x57d124||0xcc;return function(_0x28989c){if(_0x28989c){return _0xa20fbe['sendStatus'](_0x57d124);}return _0xa20fbe[_0xc81e('0xa')](_0x57d124)[_0xc81e('0xb')]();};}function respondWithResult(_0x5ab8c8,_0x4916bc){_0x4916bc=_0x4916bc||0xc8;return function(_0x1c1098){if(_0x1c1098){return _0x5ab8c8['status'](_0x4916bc)[_0xc81e('0xc')](_0x1c1098);}};}function respondWithFilteredResult(_0xfcecf0,_0xa40378){return function(_0x84f562){if(_0x84f562){var _0x439f68=typeof _0xa40378[_0xc81e('0xd')]===_0xc81e('0xe')&&typeof _0xa40378['limit']===_0xc81e('0xe');var _0x4625b9=_0x84f562['count'];var _0x5d26f2=_0x439f68?0x0:_0xa40378[_0xc81e('0xd')];var _0x4d5477=_0x439f68?_0x84f562[_0xc81e('0xf')]:_0xa40378['offset']+_0xa40378['limit'];var _0x3837ce;if(_0x4d5477>=_0x4625b9){_0x4d5477=_0x4625b9;_0x3837ce=0xc8;}else{_0x3837ce=0xce;}_0xfcecf0[_0xc81e('0xa')](_0x3837ce);return _0xfcecf0[_0xc81e('0x10')](_0xc81e('0x11'),_0x5d26f2+'-'+_0x4d5477+'/'+_0x4625b9)['json'](_0x84f562);}return null;};}function saveUpdates(_0x1c19d6){return function(_0x2ca32a){if(_0x2ca32a){return _0x2ca32a[_0xc81e('0x12')](_0x1c19d6)[_0xc81e('0x13')](function(_0x5e1385){return _0x5e1385;});}return null;};}function removeEntity(_0xb29b47){return function(_0x5e33f7){if(_0x5e33f7){return _0x5e33f7[_0xc81e('0x14')]()[_0xc81e('0x13')](function(){_0xb29b47[_0xc81e('0xa')](0xcc)[_0xc81e('0xb')]();});}};}function handleEntityNotFound(_0x14522f){return function(_0x3b919e){if(!_0x3b919e){_0x14522f[_0xc81e('0x15')](0x194);}return _0x3b919e;};}function handleError(_0x4a4be0,_0x4cd469){_0x4cd469=_0x4cd469||0x1f4;return function(_0x2109f2){logger[_0xc81e('0x16')](_0x2109f2[_0xc81e('0x17')]);if(_0x2109f2[_0xc81e('0x18')]){delete _0x2109f2[_0xc81e('0x18')];}_0x4a4be0[_0xc81e('0xa')](_0x4cd469)[_0xc81e('0x19')](_0x2109f2);};}function maskClientSecret(_0x158987){return _[_0xc81e('0x1a')](_0x158987[_0xc81e('0x1b')](0x0,0x3),0x14,'*');}exports[_0xc81e('0x1c')]=function(_0x16e67a,_0x3d1608){var _0x5307fd={},_0xfefc02={},_0x6eb361={'count':0x0,'rows':[]};var _0x234517=_[_0xc81e('0x1d')](db[_0xc81e('0x1e')][_0xc81e('0x1f')],function(_0x27a7e2){return{'name':_0x27a7e2['fieldName'],'type':_0x27a7e2[_0xc81e('0x20')][_0xc81e('0x21')]};});_0xfefc02[_0xc81e('0x22')]=_['map'](_0x234517,'name');_0xfefc02[_0xc81e('0x23')]=_[_0xc81e('0x24')](_0x16e67a[_0xc81e('0x23')]);_0xfefc02[_0xc81e('0x25')]=_[_0xc81e('0x26')](_0xfefc02[_0xc81e('0x22')],_0xfefc02[_0xc81e('0x23')]);_0x5307fd[_0xc81e('0x27')]=_['intersection'](_0xfefc02['model'],qs[_0xc81e('0x28')](_0x16e67a[_0xc81e('0x23')]['fields']));_0x5307fd['attributes']=_0x5307fd[_0xc81e('0x27')][_0xc81e('0x29')]?_0x5307fd[_0xc81e('0x27')]:_0xfefc02['model'];if(!_0x16e67a[_0xc81e('0x23')][_0xc81e('0x2a')]('nolimit')){_0x5307fd['limit']=qs[_0xc81e('0x2b')](_0x16e67a[_0xc81e('0x23')][_0xc81e('0x2b')]);_0x5307fd[_0xc81e('0xd')]=qs[_0xc81e('0xd')](_0x16e67a[_0xc81e('0x23')][_0xc81e('0xd')]);}_0x5307fd[_0xc81e('0x2c')]=qs[_0xc81e('0x2d')](_0x16e67a[_0xc81e('0x23')]['sort']);_0x5307fd[_0xc81e('0x2e')]=qs[_0xc81e('0x25')](_[_0xc81e('0x2f')](_0x16e67a[_0xc81e('0x23')],_0xfefc02[_0xc81e('0x25')]),_0x234517);if(_0x16e67a[_0xc81e('0x23')][_0xc81e('0x30')]){_0x5307fd[_0xc81e('0x2e')]=_[_0xc81e('0x31')](_0x5307fd[_0xc81e('0x2e')],{'$or':_[_0xc81e('0x1d')](_0x234517,function(_0x2eda2f){if(_0x2eda2f['type']!=='VIRTUAL'){var _0x183f58={};_0x183f58[_0x2eda2f[_0xc81e('0x18')]]={'$like':'%'+_0x16e67a[_0xc81e('0x23')][_0xc81e('0x30')]+'%'};return _0x183f58;}})});}_0x5307fd=_[_0xc81e('0x31')]({},_0x5307fd,_0x16e67a[_0xc81e('0x32')]);var _0x46f4d1={'where':_0x5307fd[_0xc81e('0x2e')]};return db[_0xc81e('0x1e')][_0xc81e('0xf')](_0x46f4d1)[_0xc81e('0x13')](function(_0x591a96){_0x6eb361[_0xc81e('0xf')]=_0x591a96;if(_0x16e67a['query'][_0xc81e('0x33')]){_0x5307fd[_0xc81e('0x34')]=[{'all':!![]}];}return db['CloudProvider'][_0xc81e('0x35')](_0x5307fd);})['then'](function(_0x5441e9){_0x6eb361['rows']=_['map'](_0x5441e9,function(_0x21a91f){if(_0x21a91f['service']===_0xc81e('0x36')){var _0x30024c=encryptor[_0xc81e('0x37')](_0x21a91f[_0xc81e('0x38')]);_0x21a91f['data3']=maskClientSecret(_0x30024c);}return _0x21a91f;});return _0x6eb361;})[_0xc81e('0x13')](respondWithFilteredResult(_0x3d1608,_0x5307fd))['catch'](handleError(_0x3d1608,null));};exports[_0xc81e('0x39')]=function(_0xfd2524,_0x3572ee){var _0x30d251={'raw':!![],'where':{'id':_0xfd2524[_0xc81e('0x3a')]['id']}},_0x494fbe={};_0x494fbe[_0xc81e('0x22')]=_[_0xc81e('0x24')](db['CloudProvider'][_0xc81e('0x1f')]);_0x494fbe[_0xc81e('0x23')]=_[_0xc81e('0x24')](_0xfd2524[_0xc81e('0x23')]);_0x494fbe[_0xc81e('0x25')]=_[_0xc81e('0x26')](_0x494fbe[_0xc81e('0x22')],_0x494fbe['query']);_0x30d251['attributes']=_[_0xc81e('0x26')](_0x494fbe[_0xc81e('0x22')],qs[_0xc81e('0x28')](_0xfd2524[_0xc81e('0x23')][_0xc81e('0x28')]));_0x30d251[_0xc81e('0x27')]=_0x30d251['attributes']['length']?_0x30d251[_0xc81e('0x27')]:_0x494fbe[_0xc81e('0x22')];if(_0xfd2524['query'][_0xc81e('0x33')]){_0x30d251[_0xc81e('0x34')]=[{'all':!![]}];}_0x30d251=_[_0xc81e('0x31')]({},_0x30d251,_0xfd2524[_0xc81e('0x32')]);return db[_0xc81e('0x1e')][_0xc81e('0x3b')](_0x30d251)[_0xc81e('0x13')](handleEntityNotFound(_0x3572ee,null))[_0xc81e('0x13')](function(_0x53adff){if(_0x53adff['service']===_0xc81e('0x36')){var _0x4b9c4a=encryptor[_0xc81e('0x37')](_0x53adff['data3']);_0x53adff['data3']=maskClientSecret(_0x4b9c4a);}return _0x53adff;})['then'](respondWithResult(_0x3572ee,null))[_0xc81e('0x3c')](handleError(_0x3572ee,null));};exports[_0xc81e('0x3d')]=function(_0x5837b0,_0x20f7a9){if(!_0x5837b0['body'][_0xc81e('0x18')])throw new Error(_0xc81e('0x3e'));if(!_0x5837b0[_0xc81e('0x3f')][_0xc81e('0x40')])throw new Error(_0xc81e('0x41'));var _0x20001f=db['CloudProvider'][_0xc81e('0x1f')]['service'][_0xc81e('0x42')];if(!_0x20001f[_0xc81e('0x43')](_0x5837b0[_0xc81e('0x3f')]['service']))throw new Error(_0xc81e('0x44')+_0x20001f['join'](',\x20'));if(_0x5837b0[_0xc81e('0x3f')][_0xc81e('0x40')]===_0xc81e('0x36')&&_0x5837b0['body']['data3']){_0x5837b0['body'][_0xc81e('0x38')]=encryptor[_0xc81e('0x45')](_0x5837b0[_0xc81e('0x3f')][_0xc81e('0x38')]);}return db['CloudProvider'][_0xc81e('0x3d')](_0x5837b0[_0xc81e('0x3f')],{})[_0xc81e('0x13')](respondWithResult(_0x20f7a9,0xc9))[_0xc81e('0x3c')](handleError(_0x20f7a9,null));};exports[_0xc81e('0x12')]=function(_0x59a93f,_0x339be2){if(_0x59a93f[_0xc81e('0x3f')]['id']){delete _0x59a93f[_0xc81e('0x3f')]['id'];}return db[_0xc81e('0x1e')]['find']({'where':{'id':_0x59a93f[_0xc81e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x339be2,null))[_0xc81e('0x13')](function(_0x595c61){if(_0x595c61['service']==='MicrosoftAzure'&&_0x59a93f[_0xc81e('0x3f')][_0xc81e('0x38')]){_0x59a93f[_0xc81e('0x3f')][_0xc81e('0x38')]=encryptor[_0xc81e('0x45')](_0x59a93f['body'][_0xc81e('0x38')]);}return _0x595c61;})[_0xc81e('0x13')](saveUpdates(_0x59a93f[_0xc81e('0x3f')],null))['then'](respondWithResult(_0x339be2,null))[_0xc81e('0x3c')](handleError(_0x339be2,null));};exports[_0xc81e('0x14')]=function(_0xe36f5f,_0x42af3b){return db['CloudProvider'][_0xc81e('0x3b')]({'where':{'id':_0xe36f5f[_0xc81e('0x3a')]['id']}})[_0xc81e('0x13')](handleEntityNotFound(_0x42af3b,null))[_0xc81e('0x13')](removeEntity(_0x42af3b,null))[_0xc81e('0x3c')](handleError(_0x42af3b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x27756a,_0x2aa5c1){return db[_0xc81e('0x1e')]['findOne']({'where':{'id':_0x27756a[_0xc81e('0x3a')]['id']},'raw':!![]})['then'](function(_0x17df22){if(!_0x17df22)return _0x2aa5c1[_0xc81e('0x15')](0x194);return{'url':oauth[_0xc81e('0x46')](_0x17df22,_0x27756a[_0xc81e('0x47')]['id'])};})[_0xc81e('0x13')](respondWithResult(_0x2aa5c1,null))[_0xc81e('0x3c')](handleError(_0x2aa5c1,null));};exports[_0xc81e('0x48')]=function(_0x502250,_0x42a5f1){var _0xa1ce6f=_0x502250[_0xc81e('0x3f')];var _0x1cb249;var _0x4250cd;if(_0xa1ce6f[_0xc81e('0x16')])throw _0xa1ce6f;redis[_0xc81e('0x49')](_0xa1ce6f[_0xc81e('0x4a')])['then'](function(_0x551965){if(!_0x551965)throw new Error(_0xc81e('0x4b'));_0x1cb249=JSON[_0xc81e('0x4c')](_0x551965);var _0x5736ac=Buffer['from'](_0xa1ce6f[_0xc81e('0x4a')],_0xc81e('0x4d'))[_0xc81e('0x4e')]('ascii');_0x4250cd=JSON[_0xc81e('0x4c')](_0x5736ac);if(!oauth[_0xc81e('0x4f')](_0xa1ce6f[_0xc81e('0x50')],_0x1cb249[_0xc81e('0x51')]))throw new Error(_0xc81e('0x52'));redis[_0xc81e('0x53')](_0xa1ce6f[_0xc81e('0x4a')]);return oauth[_0xc81e('0x54')](_0xa1ce6f[_0xc81e('0x55')],_0x1cb249);})[_0xc81e('0x13')](function(_0x4c672e){_0x1cb249[_0xc81e('0x56')]=_0x4c672e[_0xc81e('0x57')];_0x1cb249[_0xc81e('0x58')]=_0x4c672e['refresh_token'];return db[_0xc81e('0x1e')][_0xc81e('0x12')]({'data5':_0x1cb249[_0xc81e('0x56')],'data6':_0x1cb249[_0xc81e('0x58')]},{'where':{'id':_0x1cb249['id']}});})[_0xc81e('0x13')](function(){oauth['startRefreshInterval'](_0x1cb249);socket[_0xc81e('0x59')](_0xc81e('0x5a'),{'id':_0x4250cd['id']});return;})[_0xc81e('0x13')](respondWithStatusCode(_0x42a5f1,null))['catch'](function(_0xe85cc5){if(_0x4250cd){socket[_0xc81e('0x59')](_0xc81e('0x5b'),{'id':_0x4250cd['id']});}if(!_0x1cb249){logger[_0xc81e('0x16')](_0xc81e('0x5c'),_0xe85cc5);return _0x42a5f1[_0xc81e('0xa')](0x1f4)[_0xc81e('0x19')](_0xe85cc5[_0xc81e('0x5d')]);}logger[_0xc81e('0x16')](_0xc81e('0x5e'),_0x1cb249['id'],JSON['stringify'](_0xe85cc5));});};
\ No newline at end of file
+var _0xaa80=['update','then','destroy','end','sendStatus','error','name','send','padEnd','map','CloudProvider','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','rawAttributes','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','status','offset','undefined','limit','count','set','json'];(function(_0x49a94c,_0xd3fe12){var _0x1e57e9=function(_0x3f4585){while(--_0x3f4585){_0x49a94c['push'](_0x49a94c['shift']());}};_0x1e57e9(++_0xd3fe12);}(_0xaa80,0x1d0));var _0x0aa8=function(_0x54f03d,_0x5a6ce8){_0x54f03d=_0x54f03d-0x0;var _0x568f29=_0xaa80[_0x54f03d];return _0x568f29;};'use strict';var _=require('lodash');var Redis=require(_0x0aa8('0x0'));var qs=require(_0x0aa8('0x1'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x0aa8('0x2'))(_0x0aa8('0x3'));var db=require(_0x0aa8('0x4'))['db'];var oauth=require(_0x0aa8('0x5'));config[_0x0aa8('0x6')]=_[_0x0aa8('0x7')](config[_0x0aa8('0x6')],{'host':_0x0aa8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0aa8('0x6')]));var redis=new Redis(config[_0x0aa8('0x6')]);function respondWithStatusCode(_0x285923,_0x1c8df9){_0x1c8df9=_0x1c8df9||0xcc;return function(_0x3954b6){if(_0x3954b6){return _0x285923['sendStatus'](_0x1c8df9);}return _0x285923['status'](_0x1c8df9)['end']();};}function respondWithResult(_0x17abf7,_0x4a8d03){_0x4a8d03=_0x4a8d03||0xc8;return function(_0x218e64){if(_0x218e64){return _0x17abf7[_0x0aa8('0x9')](_0x4a8d03)['json'](_0x218e64);}};}function respondWithFilteredResult(_0x3cba6b,_0x250fd7){return function(_0x1cdaa6){if(_0x1cdaa6){var _0x1bac96=typeof _0x250fd7[_0x0aa8('0xa')]===_0x0aa8('0xb')&&typeof _0x250fd7[_0x0aa8('0xc')]===_0x0aa8('0xb');var _0x2dd6fc=_0x1cdaa6[_0x0aa8('0xd')];var _0x37a56d=_0x1bac96?0x0:_0x250fd7[_0x0aa8('0xa')];var _0x3603a6=_0x1bac96?_0x1cdaa6['count']:_0x250fd7[_0x0aa8('0xa')]+_0x250fd7[_0x0aa8('0xc')];var _0x485f87;if(_0x3603a6>=_0x2dd6fc){_0x3603a6=_0x2dd6fc;_0x485f87=0xc8;}else{_0x485f87=0xce;}_0x3cba6b[_0x0aa8('0x9')](_0x485f87);return _0x3cba6b[_0x0aa8('0xe')]('Content-Range',_0x37a56d+'-'+_0x3603a6+'/'+_0x2dd6fc)[_0x0aa8('0xf')](_0x1cdaa6);}return null;};}function saveUpdates(_0x2a0773){return function(_0x33c3d9){if(_0x33c3d9){return _0x33c3d9[_0x0aa8('0x10')](_0x2a0773)[_0x0aa8('0x11')](function(_0x29b053){return _0x29b053;});}return null;};}function removeEntity(_0x11d8e6){return function(_0x14cff9){if(_0x14cff9){return _0x14cff9[_0x0aa8('0x12')]()['then'](function(){_0x11d8e6['status'](0xcc)[_0x0aa8('0x13')]();});}};}function handleEntityNotFound(_0x17fa59){return function(_0x515abc){if(!_0x515abc){_0x17fa59[_0x0aa8('0x14')](0x194);}return _0x515abc;};}function handleError(_0x2b8bb2,_0x1dca15){_0x1dca15=_0x1dca15||0x1f4;return function(_0x5169d3){logger[_0x0aa8('0x15')](_0x5169d3['stack']);if(_0x5169d3[_0x0aa8('0x16')]){delete _0x5169d3['name'];}_0x2b8bb2[_0x0aa8('0x9')](_0x1dca15)[_0x0aa8('0x17')](_0x5169d3);};}function maskClientSecret(_0x3c84c7){return _[_0x0aa8('0x18')](_0x3c84c7['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x57c36a,_0x5b4685){var _0x109d72={},_0x134c2e={},_0x5d0262={'count':0x0,'rows':[]};var _0x1ef9c9=_[_0x0aa8('0x19')](db[_0x0aa8('0x1a')]['rawAttributes'],function(_0x8dc5e4){return{'name':_0x8dc5e4[_0x0aa8('0x1b')],'type':_0x8dc5e4[_0x0aa8('0x1c')][_0x0aa8('0x1d')]};});_0x134c2e[_0x0aa8('0x1e')]=_[_0x0aa8('0x19')](_0x1ef9c9,'name');_0x134c2e[_0x0aa8('0x1f')]=_[_0x0aa8('0x20')](_0x57c36a[_0x0aa8('0x1f')]);_0x134c2e['filters']=_[_0x0aa8('0x21')](_0x134c2e[_0x0aa8('0x1e')],_0x134c2e[_0x0aa8('0x1f')]);_0x109d72['attributes']=_[_0x0aa8('0x21')](_0x134c2e[_0x0aa8('0x1e')],qs[_0x0aa8('0x22')](_0x57c36a['query'][_0x0aa8('0x22')]));_0x109d72[_0x0aa8('0x23')]=_0x109d72['attributes'][_0x0aa8('0x24')]?_0x109d72[_0x0aa8('0x23')]:_0x134c2e[_0x0aa8('0x1e')];if(!_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x25')](_0x0aa8('0x26'))){_0x109d72[_0x0aa8('0xc')]=qs[_0x0aa8('0xc')](_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0xc')]);_0x109d72[_0x0aa8('0xa')]=qs['offset'](_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0xa')]);}_0x109d72['order']=qs[_0x0aa8('0x27')](_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x27')]);_0x109d72[_0x0aa8('0x28')]=qs[_0x0aa8('0x29')](_[_0x0aa8('0x2a')](_0x57c36a[_0x0aa8('0x1f')],_0x134c2e[_0x0aa8('0x29')]),_0x1ef9c9);if(_0x57c36a['query'][_0x0aa8('0x2b')]){_0x109d72[_0x0aa8('0x28')]=_[_0x0aa8('0x2c')](_0x109d72['where'],{'$or':_[_0x0aa8('0x19')](_0x1ef9c9,function(_0x2af270){if(_0x2af270['type']!=='VIRTUAL'){var _0x123ecf={};_0x123ecf[_0x2af270[_0x0aa8('0x16')]]={'$like':'%'+_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x2b')]+'%'};return _0x123ecf;}})});}_0x109d72=_[_0x0aa8('0x2c')]({},_0x109d72,_0x57c36a[_0x0aa8('0x2d')]);var _0x48eaf2={'where':_0x109d72[_0x0aa8('0x28')]};return db[_0x0aa8('0x1a')][_0x0aa8('0xd')](_0x48eaf2)['then'](function(_0x10b5de){_0x5d0262[_0x0aa8('0xd')]=_0x10b5de;if(_0x57c36a[_0x0aa8('0x1f')][_0x0aa8('0x2e')]){_0x109d72[_0x0aa8('0x2f')]=[{'all':!![]}];}return db[_0x0aa8('0x1a')][_0x0aa8('0x30')](_0x109d72);})[_0x0aa8('0x11')](function(_0x417051){_0x5d0262[_0x0aa8('0x31')]=_[_0x0aa8('0x19')](_0x417051,function(_0x1684cb){if(_0x1684cb[_0x0aa8('0x32')]==='MicrosoftAzure'){var _0x1db669=encryptor[_0x0aa8('0x33')](_0x1684cb['data3']);_0x1684cb[_0x0aa8('0x34')]=maskClientSecret(_0x1db669);}return _0x1684cb;});return _0x5d0262;})[_0x0aa8('0x11')](respondWithFilteredResult(_0x5b4685,_0x109d72))[_0x0aa8('0x35')](handleError(_0x5b4685,null));};exports[_0x0aa8('0x36')]=function(_0x57f299,_0x208026){var _0x19b46e={'raw':!![],'where':{'id':_0x57f299['params']['id']}},_0x53ec36={};_0x53ec36[_0x0aa8('0x1e')]=_[_0x0aa8('0x20')](db['CloudProvider'][_0x0aa8('0x37')]);_0x53ec36['query']=_[_0x0aa8('0x20')](_0x57f299[_0x0aa8('0x1f')]);_0x53ec36[_0x0aa8('0x29')]=_[_0x0aa8('0x21')](_0x53ec36['model'],_0x53ec36[_0x0aa8('0x1f')]);_0x19b46e[_0x0aa8('0x23')]=_[_0x0aa8('0x21')](_0x53ec36[_0x0aa8('0x1e')],qs[_0x0aa8('0x22')](_0x57f299[_0x0aa8('0x1f')]['fields']));_0x19b46e[_0x0aa8('0x23')]=_0x19b46e['attributes'][_0x0aa8('0x24')]?_0x19b46e[_0x0aa8('0x23')]:_0x53ec36[_0x0aa8('0x1e')];if(_0x57f299[_0x0aa8('0x1f')]['includeAll']){_0x19b46e['include']=[{'all':!![]}];}_0x19b46e=_[_0x0aa8('0x2c')]({},_0x19b46e,_0x57f299[_0x0aa8('0x2d')]);return db[_0x0aa8('0x1a')][_0x0aa8('0x38')](_0x19b46e)[_0x0aa8('0x11')](handleEntityNotFound(_0x208026,null))[_0x0aa8('0x11')](function(_0x1d32ad){if(_0x1d32ad[_0x0aa8('0x32')]===_0x0aa8('0x39')){var _0x3b8e60=encryptor['decryptString'](_0x1d32ad['data3']);_0x1d32ad['data3']=maskClientSecret(_0x3b8e60);}return _0x1d32ad;})[_0x0aa8('0x11')](respondWithResult(_0x208026,null))[_0x0aa8('0x35')](handleError(_0x208026,null));};exports[_0x0aa8('0x3a')]=function(_0x475c2a,_0x54661a){if(!_0x475c2a[_0x0aa8('0x3b')]['name'])throw new Error(_0x0aa8('0x3c'));if(!_0x475c2a[_0x0aa8('0x3b')]['service'])throw new Error(_0x0aa8('0x3d'));var _0x238bb1=db[_0x0aa8('0x1a')]['rawAttributes']['service'][_0x0aa8('0x3e')];if(!_0x238bb1[_0x0aa8('0x3f')](_0x475c2a[_0x0aa8('0x3b')][_0x0aa8('0x32')]))throw new Error(_0x0aa8('0x40')+_0x238bb1[_0x0aa8('0x41')](',\x20'));if(_0x475c2a[_0x0aa8('0x3b')][_0x0aa8('0x32')]===_0x0aa8('0x39')&&_0x475c2a[_0x0aa8('0x3b')][_0x0aa8('0x34')]){_0x475c2a['body'][_0x0aa8('0x34')]=encryptor[_0x0aa8('0x42')](_0x475c2a['body'][_0x0aa8('0x34')]);}return db['CloudProvider'][_0x0aa8('0x3a')](_0x475c2a[_0x0aa8('0x3b')],{})[_0x0aa8('0x11')](respondWithResult(_0x54661a,0xc9))[_0x0aa8('0x35')](handleError(_0x54661a,null));};exports[_0x0aa8('0x10')]=function(_0x4efb32,_0x30165a){if(_0x4efb32['body']['id']){delete _0x4efb32[_0x0aa8('0x3b')]['id'];}return db[_0x0aa8('0x1a')]['find']({'where':{'id':_0x4efb32[_0x0aa8('0x43')]['id']}})[_0x0aa8('0x11')](handleEntityNotFound(_0x30165a,null))[_0x0aa8('0x11')](function(_0x116ecb){if(_0x116ecb['service']===_0x0aa8('0x39')&&_0x4efb32['body'][_0x0aa8('0x34')]){_0x4efb32[_0x0aa8('0x3b')][_0x0aa8('0x34')]=encryptor[_0x0aa8('0x42')](_0x4efb32['body'][_0x0aa8('0x34')]);}return _0x116ecb;})[_0x0aa8('0x11')](saveUpdates(_0x4efb32['body'],null))[_0x0aa8('0x11')](respondWithResult(_0x30165a,null))[_0x0aa8('0x35')](handleError(_0x30165a,null));};exports[_0x0aa8('0x12')]=function(_0x5724b1,_0x53dda7){return db['CloudProvider']['find']({'where':{'id':_0x5724b1[_0x0aa8('0x43')]['id']}})['then'](handleEntityNotFound(_0x53dda7,null))[_0x0aa8('0x11')](removeEntity(_0x53dda7,null))[_0x0aa8('0x35')](handleError(_0x53dda7,null));};exports[_0x0aa8('0x44')]=function(_0x20d6c8,_0x4c38ee){return db['CloudProvider'][_0x0aa8('0x45')]({'where':{'id':_0x20d6c8[_0x0aa8('0x43')]['id']},'raw':!![]})[_0x0aa8('0x11')](function(_0x15e861){if(!_0x15e861)return _0x4c38ee[_0x0aa8('0x14')](0x194);return{'url':oauth[_0x0aa8('0x46')](_0x15e861,_0x20d6c8[_0x0aa8('0x47')]['id'])};})[_0x0aa8('0x11')](respondWithResult(_0x4c38ee,null))[_0x0aa8('0x35')](handleError(_0x4c38ee,null));};exports[_0x0aa8('0x48')]=function(_0x562609,_0x3fd1d3){var _0x53048c=_0x562609[_0x0aa8('0x3b')];var _0x415602;var _0x272a34;if(_0x53048c['error'])throw _0x53048c;redis['get'](_0x53048c[_0x0aa8('0x49')])[_0x0aa8('0x11')](function(_0x39a3f0){if(!_0x39a3f0)throw new Error(_0x0aa8('0x4a'));_0x415602=JSON['parse'](_0x39a3f0);var _0x270680=Buffer[_0x0aa8('0x4b')](_0x53048c[_0x0aa8('0x49')],_0x0aa8('0x4c'))[_0x0aa8('0x4d')](_0x0aa8('0x4e'));_0x272a34=JSON['parse'](_0x270680);if(!oauth[_0x0aa8('0x4f')](_0x53048c['id_token'],_0x415602[_0x0aa8('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x0aa8('0x51')](_0x53048c[_0x0aa8('0x49')]);return oauth[_0x0aa8('0x52')](_0x53048c[_0x0aa8('0x53')],_0x415602);})['then'](function(_0x3ca306){_0x415602[_0x0aa8('0x54')]=_0x3ca306[_0x0aa8('0x55')];_0x415602[_0x0aa8('0x56')]=_0x3ca306[_0x0aa8('0x57')];return db['CloudProvider']['update']({'data5':_0x415602['data5'],'data6':_0x415602[_0x0aa8('0x56')]},{'where':{'id':_0x415602['id']}});})[_0x0aa8('0x11')](function(){oauth[_0x0aa8('0x58')](_0x415602);socket[_0x0aa8('0x59')](_0x0aa8('0x5a'),{'id':_0x272a34['id']});return;})[_0x0aa8('0x11')](respondWithStatusCode(_0x3fd1d3,null))[_0x0aa8('0x35')](function(_0x352466){if(_0x272a34){socket[_0x0aa8('0x59')](_0x0aa8('0x5b'),{'id':_0x272a34['id']});}if(!_0x415602){logger[_0x0aa8('0x15')](_0x0aa8('0x5c'),_0x352466);return _0x3fd1d3[_0x0aa8('0x9')](0x1f4)['send'](_0x352466[_0x0aa8('0x5d')]);}logger[_0x0aa8('0x15')](_0x0aa8('0x5e'),_0x415602['id'],JSON[_0x0aa8('0x5f')](_0x352466));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index f4b9443..7402aa0 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 _0x4baf=['define','CloudProvider','cloud_providers','lodash','api','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4baf,0x1d9));var _0xf4ba=function(_0x69a354,_0x2e75a0){_0x69a354=_0x69a354-0x0;var _0x18c30a=_0x4baf[_0x69a354];return _0x18c30a;};'use strict';var _=require(_0xf4ba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf4ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ba('0x2'));var rimraf=require(_0xf4ba('0x3'));var config=require(_0xf4ba('0x4'));var attributes=require(_0xf4ba('0x5'));module[_0xf4ba('0x6')]=function(_0x544595,_0x45a2f9){return _0x544595[_0xf4ba('0x7')](_0xf4ba('0x8'),attributes,{'tableName':_0xf4ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39c0=['cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider'];(function(_0x3b80c0,_0x48642f){var _0x5e497a=function(_0x5ca4eb){while(--_0x5ca4eb){_0x3b80c0['push'](_0x3b80c0['shift']());}};_0x5e497a(++_0x48642f);}(_0x39c0,0x10b));var _0x039c=function(_0x3d3b5d,_0x2deb32){_0x3d3b5d=_0x3d3b5d-0x0;var _0x147b76=_0x39c0[_0x3d3b5d];return _0x147b76;};'use strict';var _=require(_0x039c('0x0'));var util=require(_0x039c('0x1'));var logger=require(_0x039c('0x2'))(_0x039c('0x3'));var moment=require(_0x039c('0x4'));var BPromise=require(_0x039c('0x5'));var rp=require(_0x039c('0x6'));var fs=require('fs');var path=require(_0x039c('0x7'));var rimraf=require(_0x039c('0x8'));var config=require(_0x039c('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x039c('0xa')]=function(_0x37182d,_0x25c52d){return _0x37182d[_0x039c('0xb')](_0x039c('0xc'),attributes,{'tableName':_0x039c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index bce74e3..53e9356 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 _0xf719=['code','id_token','toString','randomBytes','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','stringify','decode','payload','iss','issuer','audience','isAfter','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','POST','access_token','update','data5','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','all','inspect','error','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf719,0x11c));var _0x9f71=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xf719[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x9f71('0x0'));var crypto=require(_0x9f71('0x1'));var jwt=require(_0x9f71('0x2'));var moment=require(_0x9f71('0x3'));var Redis=require(_0x9f71('0x4'));var rp=require(_0x9f71('0x5'));var util=require(_0x9f71('0x6'));var encryptor=require(_0x9f71('0x7'));var config=require('../../config/environment');var logger=require(_0x9f71('0x8'))(_0x9f71('0x9'));var schedule=require(_0x9f71('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9f71('0xb')](config[_0x9f71('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x9f71('0xc')]);var MICROSOFT_AUTH_URL=_0x9f71('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9f71('0xe'),_0x9f71('0xf'),_0x9f71('0x10'),_0x9f71('0x11'),_0x9f71('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x9f71('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x9f71('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x12c7ae){var _0x57858e=_[_0x9f71('0x15')](AZURE_AUTH_SCOPES[_0x12c7ae['type']]);if(_0x12c7ae[_0x9f71('0x16')]===_0x9f71('0x17'))_0x57858e[_0x9f71('0x18')](_0x12c7ae[_0x9f71('0x19')]+_0x9f71('0x1a'));return _0x57858e[_0x9f71('0x1b')]('\x20');}function getAccessTokenScope(_0x40f634){if(_0x40f634['type']===_0x9f71('0x1c'))return _0x9f71('0x11');if(_0x40f634[_0x9f71('0x16')]==='Dynamics365')return _0x40f634[_0x9f71('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x35c71a,_0x4f20e1){var _0x5c1dfb=MICROSOFT_AUTH_URL[_0x9f71('0x1d')](_0x9f71('0x1e'),_0x35c71a[_0x9f71('0x1f')]);var _0x46fe40=[_0x9f71('0x20'),_0x9f71('0x21')];var _0xcec2dd=Buffer['from'](JSON['stringify']({'id':_0x4f20e1}))[_0x9f71('0x22')]('base64');var _0x27bb1a=crypto[_0x9f71('0x23')](0x10)[_0x9f71('0x22')]('hex');var _0x37f8da=getAuthorizationScopes(_0x35c71a);var _0x49ea59=[{'key':'client_id','value':_0x35c71a[_0x9f71('0x24')]},{'key':_0x9f71('0x25'),'value':encodeURIComponent(_0x46fe40['join']('\x20'))},{'key':_0x9f71('0x26'),'value':_0x35c71a[_0x9f71('0x27')]},{'key':_0x9f71('0x28'),'value':_0x9f71('0x29')},{'key':'scope','value':encodeURIComponent(_0x37f8da)},{'key':_0x9f71('0x2a'),'value':_0xcec2dd},{'key':_0x9f71('0x2b'),'value':_0x27bb1a},{'key':_0x9f71('0x2c'),'value':_0x9f71('0x2d')}];var _0x3a8b0=_0x5c1dfb+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x49ea59,function(_0x27927c){return _0x27927c[_0x9f71('0x2e')]+'='+_0x27927c[_0x9f71('0x2f')];})[_0x9f71('0x1b')]('&');_0x35c71a[_0x9f71('0x30')]={'issuer':_0x5c1dfb[_0x9f71('0x1d')](_0x9f71('0x31'),''),'audience':_0x35c71a[_0x9f71('0x24')],'state':_0xcec2dd,'nonce':_0x27bb1a};redis[_0x9f71('0x32')](_0xcec2dd,JSON[_0x9f71('0x33')](_0x35c71a));return _0x3a8b0;}function isValidIdToken(_0xaba088,_0x3a7d57){try{var _0x37091f=jwt[_0x9f71('0x34')](_0xaba088,{'complete':!![]});var _0xc68ec8=_0x37091f[_0x9f71('0x35')];if(_0xc68ec8[_0x9f71('0x36')]!==_0x3a7d57[_0x9f71('0x37')])return![];if(_0xc68ec8['aud']!==_0x3a7d57[_0x9f71('0x38')])return![];if(_0xc68ec8[_0x9f71('0x2b')]!==_0x3a7d57[_0x9f71('0x2b')])return![];if(moment()[_0x9f71('0x39')](moment['unix'](_0xc68ec8['exp'])))return![];return!![];}catch(_0x48bcbd){throw _0x48bcbd;}}function refreshOauth2MicrosoftAccessToken(_0x11491c){return Promise[_0x9f71('0x3a')]()[_0x9f71('0x3b')](function(){if(_0x11491c[_0x9f71('0x3c')])return _0x11491c;return db[_0x9f71('0x3d')][_0x9f71('0x3e')]({'where':{'id':_0x11491c['id']},'raw':!![]});})['then'](function(_0x474bcf){var _0x1c2764={'grant_type':_0x9f71('0x3f'),'refresh_token':_0x474bcf[_0x9f71('0x40')],'scope':getAccessTokenScope(_0x474bcf),'redirect_uri':_0x474bcf[_0x9f71('0x27')],'client_id':_0x474bcf[_0x9f71('0x24')],'client_secret':encryptor['decryptString'](_0x474bcf['data3'])};var _0xad25f9={'method':_0x9f71('0x41'),'uri':MICROSOFT_AUTH_URL['replace'](_0x9f71('0x1e'),_0x474bcf['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1c2764,'json':!![]};return rp(_0xad25f9);})['then'](function(_0x48d9d1){_0x11491c['data5']=_0x48d9d1[_0x9f71('0x42')];_0x11491c[_0x9f71('0x40')]=_0x48d9d1[_0x9f71('0x3f')];return db[_0x9f71('0x3d')][_0x9f71('0x43')]({'data5':_0x11491c[_0x9f71('0x44')],'data6':_0x11491c[_0x9f71('0x40')]},{'where':{'id':_0x11491c['id']}});})[_0x9f71('0x3b')](function(){return _0x11491c;})[_0x9f71('0x45')](function(_0x4e7b02){logger['error'](_0x9f71('0x46'),_0x11491c['id'],_0x4e7b02);});}function getOauth2MicrosoftAccessToken(_0x531e20,_0x368016){var _0x261b02={'grant_type':_0x9f71('0x47'),'code':_0x531e20,'scope':getAccessTokenScope(_0x368016),'redirect_uri':_0x368016['data4'],'client_id':_0x368016[_0x9f71('0x24')],'client_secret':encryptor[_0x9f71('0x48')](_0x368016[_0x9f71('0x3c')])};var _0x4d347c={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x9f71('0x1e'),_0x368016['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x261b02,'json':!![]};return rp(_0x4d347c);}function startRefreshInterval(_0x4f3467){var _0x4dc3f4=schedule[_0x9f71('0x49')];if(_0x4dc3f4[_0x4f3467['id']])clearInterval(_0x4dc3f4[_0x4f3467['id']]);_0x4dc3f4[_0x4f3467['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9f71('0x4a')](this,{'id':_0x4f3467['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9f71('0x49')]=_0x4dc3f4;}function startAllRefreshIntervals(){return db[_0x9f71('0x3d')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9f71('0x3b')](function(_0x22dac2){var _0x5bae28=_0x22dac2[_0x9f71('0x15')](function(_0x3676ee){return refreshOauth2MicrosoftAccessToken(_0x3676ee)[_0x9f71('0x3b')](function(_0x543cbd){startRefreshInterval(_0x543cbd);});});return Promise[_0x9f71('0x4b')](_0x5bae28);})[_0x9f71('0x45')](function(_0x4c01fe){var _0x43fae2=_0x4c01fe?util[_0x9f71('0x4c')](_0x4c01fe,{'showHidden':![],'depth':null}):'';logger[_0x9f71('0x4d')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x43fae2);});}module[_0x9f71('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1dcc=['code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','data1','response_type','join','data4','form_post','state','login','key','value','set','decode','issuer','aud','audience','nonce','isAfter','exp','resolve','then','data3','findOne','refresh_token','decryptString','POST','data2','data5','access_token','data6','CloudProvider','update','catch','error','authorization_code','intervals','bind','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','/.default','Outlook365','Dynamics365','replace','{TENANT_ID}'];(function(_0x1c3c09,_0x5ed170){var _0x28a78e=function(_0x43d486){while(--_0x43d486){_0x1c3c09['push'](_0x1c3c09['shift']());}};_0x28a78e(++_0x5ed170);}(_0x1dcc,0x79));var _0xc1dc=function(_0x5c0251,_0xc32d67){_0x5c0251=_0x5c0251-0x0;var _0x3fe699=_0x1dcc[_0x5c0251];return _0x3fe699;};'use strict';var _=require(_0xc1dc('0x0'));var crypto=require('crypto');var jwt=require(_0xc1dc('0x1'));var moment=require(_0xc1dc('0x2'));var Redis=require('ioredis');var rp=require(_0xc1dc('0x3'));var util=require(_0xc1dc('0x4'));var encryptor=require(_0xc1dc('0x5'));var config=require(_0xc1dc('0x6'));var logger=require('../../config/logger')(_0xc1dc('0x7'));var schedule=require(_0xc1dc('0x8'));var db=require('../../mysqldb')['db'];config[_0xc1dc('0x9')]=_[_0xc1dc('0xa')](config[_0xc1dc('0x9')],{'host':_0xc1dc('0xb'),'port':0x18eb});var redis=new Redis(config[_0xc1dc('0x9')]);var MICROSOFT_AUTH_URL=_0xc1dc('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xc1dc('0xd'),'profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xc1dc('0xe'),_0xc1dc('0xf')],'Dynamics365':[_0xc1dc('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xc1dc('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0xc1dc('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d503e){var _0x44a348=_[_0xc1dc('0x12')](AZURE_AUTH_SCOPES[_0x2d503e['type']]);if(_0x2d503e[_0xc1dc('0x13')]==='Dynamics365')_0x44a348[_0xc1dc('0x14')](_0x2d503e[_0xc1dc('0x15')]+_0xc1dc('0x16'));return _0x44a348['join']('\x20');}function getAccessTokenScope(_0x572cdb){if(_0x572cdb[_0xc1dc('0x13')]===_0xc1dc('0x17'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x572cdb[_0xc1dc('0x13')]===_0xc1dc('0x18'))return _0x572cdb[_0xc1dc('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x489ed2,_0x1750a5){var _0x40bf64=MICROSOFT_AUTH_URL[_0xc1dc('0x19')](_0xc1dc('0x1a'),_0x489ed2['data2']);var _0x424c3f=[_0xc1dc('0x1b'),_0xc1dc('0x1c')];var _0x41f31c=Buffer[_0xc1dc('0x1d')](JSON[_0xc1dc('0x1e')]({'id':_0x1750a5}))['toString'](_0xc1dc('0x1f'));var _0x2803a8=crypto[_0xc1dc('0x20')](0x10)[_0xc1dc('0x21')](_0xc1dc('0x22'));var _0x22a689=getAuthorizationScopes(_0x489ed2);var _0x1949a5=[{'key':_0xc1dc('0x23'),'value':_0x489ed2[_0xc1dc('0x24')]},{'key':_0xc1dc('0x25'),'value':encodeURIComponent(_0x424c3f[_0xc1dc('0x26')]('\x20'))},{'key':'redirect_uri','value':_0x489ed2[_0xc1dc('0x27')]},{'key':'response_mode','value':_0xc1dc('0x28')},{'key':'scope','value':encodeURIComponent(_0x22a689)},{'key':_0xc1dc('0x29'),'value':_0x41f31c},{'key':'nonce','value':_0x2803a8},{'key':'prompt','value':_0xc1dc('0x2a')}];var _0x3a3479=_0x40bf64+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1949a5,function(_0x1f6d64){return _0x1f6d64[_0xc1dc('0x2b')]+'='+_0x1f6d64[_0xc1dc('0x2c')];})[_0xc1dc('0x26')]('&');_0x489ed2['oauth2Claims']={'issuer':_0x40bf64['replace']('oauth2/',''),'audience':_0x489ed2[_0xc1dc('0x24')],'state':_0x41f31c,'nonce':_0x2803a8};redis[_0xc1dc('0x2d')](_0x41f31c,JSON[_0xc1dc('0x1e')](_0x489ed2));return _0x3a3479;}function isValidIdToken(_0x3aa0b2,_0x49a9a9){try{var _0x1b8993=jwt[_0xc1dc('0x2e')](_0x3aa0b2,{'complete':!![]});var _0x59bc61=_0x1b8993['payload'];if(_0x59bc61['iss']!==_0x49a9a9[_0xc1dc('0x2f')])return![];if(_0x59bc61[_0xc1dc('0x30')]!==_0x49a9a9[_0xc1dc('0x31')])return![];if(_0x59bc61['nonce']!==_0x49a9a9[_0xc1dc('0x32')])return![];if(moment()[_0xc1dc('0x33')](moment['unix'](_0x59bc61[_0xc1dc('0x34')])))return![];return!![];}catch(_0x1d12ac){throw _0x1d12ac;}}function refreshOauth2MicrosoftAccessToken(_0x43a699){return Promise[_0xc1dc('0x35')]()[_0xc1dc('0x36')](function(){if(_0x43a699[_0xc1dc('0x37')])return _0x43a699;return db['CloudProvider'][_0xc1dc('0x38')]({'where':{'id':_0x43a699['id']},'raw':!![]});})[_0xc1dc('0x36')](function(_0x5cff2f){var _0x3f0c78={'grant_type':_0xc1dc('0x39'),'refresh_token':_0x5cff2f['data6'],'scope':getAccessTokenScope(_0x5cff2f),'redirect_uri':_0x5cff2f[_0xc1dc('0x27')],'client_id':_0x5cff2f[_0xc1dc('0x24')],'client_secret':encryptor[_0xc1dc('0x3a')](_0x5cff2f[_0xc1dc('0x37')])};var _0x3e8cd3={'method':_0xc1dc('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xc1dc('0x19')](_0xc1dc('0x1a'),_0x5cff2f[_0xc1dc('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f0c78,'json':!![]};return rp(_0x3e8cd3);})[_0xc1dc('0x36')](function(_0x2810dc){_0x43a699[_0xc1dc('0x3d')]=_0x2810dc[_0xc1dc('0x3e')];_0x43a699[_0xc1dc('0x3f')]=_0x2810dc[_0xc1dc('0x39')];return db[_0xc1dc('0x40')][_0xc1dc('0x41')]({'data5':_0x43a699[_0xc1dc('0x3d')],'data6':_0x43a699[_0xc1dc('0x3f')]},{'where':{'id':_0x43a699['id']}});})['then'](function(){return _0x43a699;})[_0xc1dc('0x42')](function(_0x1a03b1){logger[_0xc1dc('0x43')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x43a699['id'],_0x1a03b1);});}function getOauth2MicrosoftAccessToken(_0x5d0ae4,_0x4e1387){var _0x302826={'grant_type':_0xc1dc('0x44'),'code':_0x5d0ae4,'scope':getAccessTokenScope(_0x4e1387),'redirect_uri':_0x4e1387[_0xc1dc('0x27')],'client_id':_0x4e1387[_0xc1dc('0x24')],'client_secret':encryptor['decryptString'](_0x4e1387[_0xc1dc('0x37')])};var _0x2c6dcf={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xc1dc('0x19')]('{TENANT_ID}',_0x4e1387['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x302826,'json':!![]};return rp(_0x2c6dcf);}function startRefreshInterval(_0x24d756){var _0x723f3e=schedule[_0xc1dc('0x45')];if(_0x723f3e[_0x24d756['id']])clearInterval(_0x723f3e[_0x24d756['id']]);_0x723f3e[_0x24d756['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc1dc('0x46')](this,{'id':_0x24d756['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc1dc('0x45')]=_0x723f3e;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xc1dc('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc1dc('0x36')](function(_0x27a87b){var _0x573c74=_0x27a87b[_0xc1dc('0x12')](function(_0x4d0340){return refreshOauth2MicrosoftAccessToken(_0x4d0340)['then'](function(_0x36d173){startRefreshInterval(_0x36d173);});});return Promise['all'](_0x573c74);})[_0xc1dc('0x42')](function(_0x9f7ed8){var _0x391a05=_0x9f7ed8?util[_0xc1dc('0x48')](_0x9f7ed8,{'showHidden':![],'depth':null}):'';logger['error'](_0xc1dc('0x49'),_0x391a05);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 4eea749..caa51bd 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 _0x471a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x471a,0x18d));var _0xa471=function(_0xa31086,_0xdc718a){_0xa31086=_0xa31086-0x0;var _0x732df0=_0x471a[_0xa31086];return _0x732df0;};'use strict';var _=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var moment=require(_0xa471('0x2'));var BPromise=require('bluebird');var rs=require(_0xa471('0x3'));var fs=require('fs');var Redis=require(_0xa471('0x4'));var db=require(_0xa471('0x5'))['db'];var utils=require(_0xa471('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa471('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5eb32c,_0x310613,_0x233b28){return new BPromise(function(_0x25f238,_0x50c1c4){return client[_0xa471('0x8')](_0x5eb32c,_0x233b28)['then'](function(_0x5b0a2b){logger[_0xa471('0x9')](_0xa471('0xa'),_0x310613,_0xa471('0xb'));logger[_0xa471('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x310613,_0xa471('0xb'),JSON[_0xa471('0xd')](_0x5b0a2b));if(_0x5b0a2b[_0xa471('0xe')]){if(_0x5b0a2b[_0xa471('0xe')][_0xa471('0xf')]===0x1f4){logger[_0xa471('0xe')]('CloudProvider,\x20%s,\x20%s',_0x310613,_0x5b0a2b[_0xa471('0xe')]['message']);return _0x50c1c4(_0x5b0a2b[_0xa471('0xe')]['message']);}logger[_0xa471('0xe')](_0xa471('0xa'),_0x310613,_0x5b0a2b[_0xa471('0xe')][_0xa471('0x10')]);return _0x25f238(_0x5b0a2b[_0xa471('0xe')][_0xa471('0x10')]);}else{logger['info'](_0xa471('0xa'),_0x310613,_0xa471('0xb'));_0x25f238(_0x5b0a2b[_0xa471('0x11')][_0xa471('0x10')]);}})[_0xa471('0x12')](function(_0x5730c3){logger[_0xa471('0xe')](_0xa471('0xa'),_0x310613,_0x5730c3);_0x50c1c4(_0x5730c3);});});}
\ No newline at end of file
+var _0x36fe=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then'];(function(_0x381080,_0x2ed325){var _0x529ae7=function(_0x3e8197){while(--_0x3e8197){_0x381080['push'](_0x381080['shift']());}};_0x529ae7(++_0x2ed325);}(_0x36fe,0x127));var _0xe36f=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x36fe[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var moment=require(_0xe36f('0x2'));var BPromise=require(_0xe36f('0x3'));var rs=require(_0xe36f('0x4'));var fs=require('fs');var Redis=require(_0xe36f('0x5'));var db=require(_0xe36f('0x6'))['db'];var utils=require(_0xe36f('0x7'));var logger=require(_0xe36f('0x8'))(_0xe36f('0x9'));var config=require(_0xe36f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x349c9e,_0xdae131,_0x5a0d3c){return new BPromise(function(_0x1ecd6b,_0x21f2a5){return client['request'](_0x349c9e,_0x5a0d3c)[_0xe36f('0xc')](function(_0x386c00){logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,_0xe36f('0xf'));logger['debug'](_0xe36f('0x10'),_0xdae131,'request\x20sent',JSON[_0xe36f('0x11')](_0x386c00));if(_0x386c00[_0xe36f('0x12')]){if(_0x386c00[_0xe36f('0x12')]['code']===0x1f4){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x386c00['error'][_0xe36f('0x13')]);return _0x21f2a5(_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);}logger[_0xe36f('0x12')]('CloudProvider,\x20%s,\x20%s',_0xdae131,_0x386c00[_0xe36f('0x12')][_0xe36f('0x13')]);return _0x1ecd6b(_0x386c00[_0xe36f('0x12')]['message']);}else{logger[_0xe36f('0xd')](_0xe36f('0xe'),_0xdae131,'request\x20sent');_0x1ecd6b(_0x386c00[_0xe36f('0x14')][_0xe36f('0x13')]);}})[_0xe36f('0x15')](function(_0x3f8f9f){logger[_0xe36f('0x12')](_0xe36f('0xe'),_0xdae131,_0x3f8f9f);_0x21f2a5(_0x3f8f9f);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 46a2920..a408557 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x1261,0x144));var _0x1126=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x1261[_0x51674a];return _0x13fca6;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x5f2f,0x73));var _0xf5f2=function(_0x23e1f6,_0x3b658f){_0x23e1f6=_0x23e1f6-0x0;var _0x33de91=_0x5f2f[_0x23e1f6];return _0x33de91;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index f124ff1..98c1175 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 _0xce1b=['STRING','sequelize','exports'];(function(_0x507056,_0xe16b72){var _0x4eaecc=function(_0x440b91){while(--_0x440b91){_0x507056['push'](_0x507056['shift']());}};_0x4eaecc(++_0xe16b72);}(_0xce1b,0x151));var _0xbce1=function(_0x2402d5,_0x37a7d5){_0x2402d5=_0x2402d5-0x0;var _0x103053=_0xce1b[_0x2402d5];return _0x103053;};'use strict';var Sequelize=require(_0xbce1('0x0'));module[_0xbce1('0x1')]={'name':{'type':Sequelize[_0xbce1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbce1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xbce1('0x2')]},'fax':{'type':Sequelize[_0xbce1('0x2')]},'type':{'type':Sequelize[_0xbce1('0x2')]},'street':{'type':Sequelize[_0xbce1('0x2')]},'postalCode':{'type':Sequelize[_0xbce1('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbce1('0x2')]},'email':{'type':Sequelize[_0xbce1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbce1('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xbce1('0x2')]},'sCountry':{'type':Sequelize[_0xbce1('0x2')]},'description':{'type':Sequelize[_0xbce1('0x2')]}};
\ No newline at end of file
+var _0x0d1a=['sequelize','exports','STRING'];(function(_0x1562a3,_0x2c6cad){var _0x58476f=function(_0x225512){while(--_0x225512){_0x1562a3['push'](_0x1562a3['shift']());}};_0x58476f(++_0x2c6cad);}(_0x0d1a,0x1e6));var _0xa0d1=function(_0x933730,_0x197943){_0x933730=_0x933730-0x0;var _0x5543e1=_0x0d1a[_0x933730];return _0x5543e1;};'use strict';var Sequelize=require(_0xa0d1('0x0'));module[_0xa0d1('0x1')]={'name':{'type':Sequelize[_0xa0d1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa0d1('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xa0d1('0x2')]},'phone':{'type':Sequelize[_0xa0d1('0x2')]},'fax':{'type':Sequelize[_0xa0d1('0x2')]},'type':{'type':Sequelize[_0xa0d1('0x2')]},'street':{'type':Sequelize[_0xa0d1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa0d1('0x2')]},'country':{'type':Sequelize[_0xa0d1('0x2')]},'email':{'type':Sequelize[_0xa0d1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa0d1('0x2')]},'sStreet':{'type':Sequelize[_0xa0d1('0x2')]},'sPostalCode':{'type':Sequelize[_0xa0d1('0x2')]},'sCity':{'type':Sequelize[_0xa0d1('0x2')]},'sCountry':{'type':Sequelize[_0xa0d1('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index b9a3817..11e9b9a 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 _0x5257=['fast-json-patch','moment','bluebird','mustache','util','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','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','map','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','CmContact','pick','getContacts','eml-format','zip-dir'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5257,0x1ac));var _0x7525=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x5257[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0x7525('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7525('0x1'));var jsonpatch=require(_0x7525('0x2'));var rp=require('request-promise');var moment=require(_0x7525('0x3'));var BPromise=require(_0x7525('0x4'));var Mustache=require(_0x7525('0x5'));var util=require(_0x7525('0x6'));var path=require('path');var sox=require(_0x7525('0x7'));var csv=require(_0x7525('0x8'));var ejs=require(_0x7525('0x9'));var fs=require('fs');var fs_extra=require(_0x7525('0xa'));var _=require(_0x7525('0xb'));var squel=require(_0x7525('0xc'));var crypto=require(_0x7525('0xd'));var jsforce=require(_0x7525('0xe'));var deskjs=require(_0x7525('0xf'));var toCsv=require(_0x7525('0x8'));var querystring=require('querystring');var Papa=require(_0x7525('0x10'));var Redis=require(_0x7525('0x11'));var authService=require(_0x7525('0x12'));var qs=require(_0x7525('0x13'));var as=require(_0x7525('0x14'));var hardwareService=require(_0x7525('0x15'));var logger=require(_0x7525('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7525('0x17'));var licenseUtil=require(_0x7525('0x18'));var db=require(_0x7525('0x19'))['db'];function respondWithStatusCode(_0x257def,_0x389011){_0x389011=_0x389011||0xcc;return function(_0x2adbe5){if(_0x2adbe5){return _0x257def['sendStatus'](_0x389011);}return _0x257def[_0x7525('0x1a')](_0x389011)[_0x7525('0x1b')]();};}function respondWithResult(_0x20f54d,_0x3bbf28){_0x3bbf28=_0x3bbf28||0xc8;return function(_0x129cc5){if(_0x129cc5){return _0x20f54d[_0x7525('0x1a')](_0x3bbf28)[_0x7525('0x1c')](_0x129cc5);}};}function respondWithFilteredResult(_0x19a26b,_0x373f1d){return function(_0x5686d9){if(_0x5686d9){var _0x5036a5=typeof _0x373f1d['offset']===_0x7525('0x1d')&&typeof _0x373f1d[_0x7525('0x1e')]===_0x7525('0x1d');var _0x3cf76a=_0x5686d9[_0x7525('0x1f')];var _0x2881c1=_0x5036a5?0x0:_0x373f1d[_0x7525('0x20')];var _0x325298=_0x5036a5?_0x5686d9[_0x7525('0x1f')]:_0x373f1d[_0x7525('0x20')]+_0x373f1d[_0x7525('0x1e')];var _0xe43945;if(_0x325298>=_0x3cf76a){_0x325298=_0x3cf76a;_0xe43945=0xc8;}else{_0xe43945=0xce;}_0x19a26b[_0x7525('0x1a')](_0xe43945);return _0x19a26b['set'](_0x7525('0x21'),_0x2881c1+'-'+_0x325298+'/'+_0x3cf76a)[_0x7525('0x1c')](_0x5686d9);}return null;};}function patchUpdates(_0x2074da){return function(_0x198b72){try{jsonpatch[_0x7525('0x22')](_0x198b72,_0x2074da,!![]);}catch(_0x366512){return BPromise['reject'](_0x366512);}return _0x198b72[_0x7525('0x23')]();};}function saveUpdates(_0x4ee82a,_0x370f17){return function(_0x88ad8f){if(_0x88ad8f){return _0x88ad8f[_0x7525('0x24')](_0x4ee82a)[_0x7525('0x25')](function(_0x2077db){return _0x2077db;});}return null;};}function removeEntity(_0x53ceba,_0x62ce76){return function(_0x55fced){if(_0x55fced){return _0x55fced[_0x7525('0x26')]()['then'](function(){var _0x376a21=_0x55fced[_0x7525('0x27')]({'plain':!![]});var _0x2be39c=_0x7525('0x28');return db['UserProfileResource'][_0x7525('0x26')]({'where':{'type':_0x2be39c,'resourceId':_0x376a21['id']}})[_0x7525('0x25')](function(){return _0x55fced;});})['then'](function(){_0x53ceba[_0x7525('0x1a')](0xcc)[_0x7525('0x1b')]();});}};}function handleEntityNotFound(_0x107e68,_0x4abb8b){return function(_0x49abf1){if(!_0x49abf1){_0x107e68[_0x7525('0x29')](0x194);}return _0x49abf1;};}function handleError(_0x5cc8b4,_0x1e16c3){_0x1e16c3=_0x1e16c3||0x1f4;return function(_0x127474){logger[_0x7525('0x2a')](_0x127474[_0x7525('0x2b')]);if(_0x127474['name']){delete _0x127474[_0x7525('0x2c')];}_0x5cc8b4[_0x7525('0x1a')](_0x1e16c3)[_0x7525('0x2d')](_0x127474);};}exports[_0x7525('0x2e')]=function(_0x3888f3,_0x3b1698){var _0x1fec70={},_0x3f5068={},_0x225f44={'count':0x0,'rows':[]};return db[_0x7525('0x2f')][_0x7525('0x30')]()[_0x7525('0x25')](function(_0x315c73){_0x3f5068['model']=_[_0x7525('0x31')](_0x315c73);_0x3f5068[_0x7525('0x32')]=_[_0x7525('0x31')](_0x3888f3['query']);_0x3f5068['filters']=_['intersection'](_0x3f5068[_0x7525('0x33')],_0x3f5068['query']);_0x1fec70[_0x7525('0x34')]=_[_0x7525('0x35')](_0x3f5068[_0x7525('0x33')],qs[_0x7525('0x36')](_0x3888f3[_0x7525('0x32')][_0x7525('0x36')]));_0x1fec70[_0x7525('0x34')]=_0x1fec70[_0x7525('0x34')][_0x7525('0x37')]?_0x1fec70[_0x7525('0x34')]:_0x3f5068[_0x7525('0x33')];if(!_0x3888f3['query'][_0x7525('0x38')](_0x7525('0x39'))){_0x1fec70['limit']=qs[_0x7525('0x1e')](_0x3888f3[_0x7525('0x32')][_0x7525('0x1e')]);_0x1fec70[_0x7525('0x20')]=qs['offset'](_0x3888f3[_0x7525('0x32')]['offset']);}_0x1fec70['order']=qs['sort'](_0x3888f3['query'][_0x7525('0x3a')]);_0x1fec70[_0x7525('0x3b')]=qs['filters'](_['pick'](_0x3888f3[_0x7525('0x32')],_0x3f5068[_0x7525('0x3c')]),_0x315c73);if(_0x3888f3[_0x7525('0x32')]['filter']){_0x1fec70[_0x7525('0x3b')]=_[_0x7525('0x3d')](_0x1fec70[_0x7525('0x3b')],{'$or':_[_0x7525('0x3e')](_0x1fec70[_0x7525('0x34')],function(_0x36674b){var _0x301114={};_0x301114[_0x36674b]={'$like':'%'+_0x3888f3[_0x7525('0x32')][_0x7525('0x3f')]+'%'};return _0x301114;})});}_0x1fec70=_[_0x7525('0x3d')]({},_0x1fec70,_0x3888f3[_0x7525('0x40')]);var _0x47e3ba={'where':_0x1fec70[_0x7525('0x3b')]};return db['CmCompany'][_0x7525('0x1f')](_0x47e3ba)[_0x7525('0x25')](function(_0x387382){_0x225f44[_0x7525('0x1f')]=_0x387382;if(_0x3888f3['query'][_0x7525('0x41')]){_0x1fec70[_0x7525('0x42')]=[{'all':!![]}];}return db[_0x7525('0x2f')][_0x7525('0x43')](_0x1fec70);})['then'](function(_0xbe8e7a){_0x225f44[_0x7525('0x44')]=_0xbe8e7a;return _0x225f44;})['then'](respondWithFilteredResult(_0x3b1698,_0x1fec70))[_0x7525('0x45')](handleError(_0x3b1698,null));})['catch'](handleError(_0x3b1698,null));};exports['show']=function(_0x1d97c9,_0x1ad51a){var _0x4b61b7={'raw':![],'where':{'id':_0x1d97c9[_0x7525('0x46')]['id']}},_0x485644={};_0x485644[_0x7525('0x33')]=_[_0x7525('0x31')](db['CmCompany'][_0x7525('0x47')]);_0x485644['query']=_[_0x7525('0x31')](_0x1d97c9[_0x7525('0x32')]);_0x485644[_0x7525('0x3c')]=_[_0x7525('0x35')](_0x485644['model'],_0x485644[_0x7525('0x32')]);_0x4b61b7[_0x7525('0x34')]=_[_0x7525('0x35')](_0x485644['model'],qs['fields'](_0x1d97c9['query']['fields']));_0x4b61b7['attributes']=_0x4b61b7[_0x7525('0x34')][_0x7525('0x37')]?_0x4b61b7[_0x7525('0x34')]:_0x485644['model'];if(_0x1d97c9['query'][_0x7525('0x41')]){_0x4b61b7[_0x7525('0x42')]=[{'all':!![]}];}_0x4b61b7=_[_0x7525('0x3d')]({},_0x4b61b7,_0x1d97c9[_0x7525('0x40')]);return db[_0x7525('0x2f')][_0x7525('0x48')](_0x4b61b7)[_0x7525('0x25')](handleEntityNotFound(_0x1ad51a,null))[_0x7525('0x25')](respondWithResult(_0x1ad51a,null))[_0x7525('0x45')](handleError(_0x1ad51a,null));};exports['create']=function(_0x910a50,_0x5231dd){return db[_0x7525('0x2f')][_0x7525('0x49')](_0x910a50[_0x7525('0x4a')],{})[_0x7525('0x25')](function(_0x173593){var _0x1bad46=_0x910a50[_0x7525('0x4b')][_0x7525('0x27')]({'plain':!![]});if(!_0x1bad46)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bad46[_0x7525('0x4c')]==='user'){var _0x44ad6e=_0x173593[_0x7525('0x27')]({'plain':!![]});var _0x2c1729=_0x7525('0x28');return db['UserProfileSection'][_0x7525('0x48')]({'where':{'name':_0x2c1729,'userProfileId':_0x1bad46['userProfileId']},'raw':!![]})['then'](function(_0x3bfe06){if(_0x3bfe06&&_0x3bfe06[_0x7525('0x4d')]===0x0){return db[_0x7525('0x4e')][_0x7525('0x49')]({'name':_0x44ad6e['name'],'resourceId':_0x44ad6e['id'],'type':_0x3bfe06[_0x7525('0x2c')],'sectionId':_0x3bfe06['id']},{})[_0x7525('0x25')](function(){return _0x173593;});}else{return _0x173593;}})[_0x7525('0x45')](function(_0x290511){logger[_0x7525('0x2a')](_0x7525('0x4f'),_0x290511);throw _0x290511;});}return _0x173593;})['then'](respondWithResult(_0x5231dd,0xc9))[_0x7525('0x45')](handleError(_0x5231dd,null));};exports[_0x7525('0x24')]=function(_0x434c62,_0x485717){if(_0x434c62[_0x7525('0x4a')]['id']){delete _0x434c62[_0x7525('0x4a')]['id'];}return db[_0x7525('0x2f')][_0x7525('0x48')]({'where':{'id':_0x434c62[_0x7525('0x46')]['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x485717,null))['then'](saveUpdates(_0x434c62[_0x7525('0x4a')],null))[_0x7525('0x25')](respondWithResult(_0x485717,null))[_0x7525('0x45')](handleError(_0x485717,null));};exports[_0x7525('0x26')]=function(_0x55c825,_0x3fd650){return db[_0x7525('0x2f')]['find']({'where':{'id':_0x55c825['params']['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x3fd650,null))[_0x7525('0x25')](removeEntity(_0x3fd650,null))[_0x7525('0x45')](handleError(_0x3fd650,null));};exports[_0x7525('0x30')]=function(_0x4d147a,_0x17870f){return db[_0x7525('0x2f')][_0x7525('0x30')]()[_0x7525('0x25')](respondWithResult(_0x17870f,null))['catch'](handleError(_0x17870f,null));};exports['addContacts']=function(_0x1b489c,_0x19de97,_0x3f1480){return db['CmContact']['find']({'where':{'id':_0x1b489c[_0x7525('0x46')]['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x19de97,null))[_0x7525('0x25')](function(_0x6bc388){if(_0x6bc388){return _0x6bc388[_0x7525('0x50')](_0x1b489c[_0x7525('0x4a')][_0x7525('0x51')],_[_0x7525('0x52')](_0x1b489c[_0x7525('0x4a')],[_0x7525('0x51'),'id'])||{});}})[_0x7525('0x25')](respondWithResult(_0x19de97,null))[_0x7525('0x45')](handleError(_0x19de97,null));};exports['getContacts']=function(_0x246fce,_0x415ac9,_0x35ac31){var _0x36ed3a={};var _0x35ef41={};var _0x547dc0;var _0x13430a;return db[_0x7525('0x2f')]['findOne']({'where':{'id':_0x246fce[_0x7525('0x46')]['id']}})[_0x7525('0x25')](handleEntityNotFound(_0x415ac9,null))[_0x7525('0x25')](function(_0x587e2e){if(_0x587e2e){_0x547dc0=_0x587e2e;_0x35ef41[_0x7525('0x33')]=_['keys'](db[_0x7525('0x53')][_0x7525('0x47')]);_0x35ef41[_0x7525('0x32')]=_[_0x7525('0x31')](_0x246fce[_0x7525('0x32')]);_0x35ef41[_0x7525('0x3c')]=_[_0x7525('0x35')](_0x35ef41[_0x7525('0x33')],_0x35ef41[_0x7525('0x32')]);_0x36ed3a[_0x7525('0x34')]=_[_0x7525('0x35')](_0x35ef41[_0x7525('0x33')],qs[_0x7525('0x36')](_0x246fce[_0x7525('0x32')]['fields']));_0x36ed3a[_0x7525('0x34')]=_0x36ed3a[_0x7525('0x34')]['length']?_0x36ed3a['attributes']:_0x35ef41[_0x7525('0x33')];_0x36ed3a['order']=qs[_0x7525('0x3a')](_0x246fce['query'][_0x7525('0x3a')]);_0x36ed3a[_0x7525('0x3b')]=qs['filters'](_[_0x7525('0x54')](_0x246fce[_0x7525('0x32')],_0x35ef41[_0x7525('0x3c')]));if(_0x246fce['query']['filter']){_0x36ed3a[_0x7525('0x3b')]=_[_0x7525('0x3d')](_0x36ed3a['where'],{'$or':_[_0x7525('0x3e')](_0x36ed3a[_0x7525('0x34')],function(_0x127431){var _0x2072cf={};_0x2072cf[_0x127431]={'$like':'%'+_0x246fce[_0x7525('0x32')][_0x7525('0x3f')]+'%'};return _0x2072cf;})});}_0x36ed3a=_[_0x7525('0x3d')]({},_0x36ed3a,_0x246fce[_0x7525('0x40')]);return _0x547dc0[_0x7525('0x55')](_0x36ed3a);}})[_0x7525('0x25')](function(_0x28dc1a){if(_0x28dc1a){_0x13430a=_0x28dc1a[_0x7525('0x37')];if(!_0x246fce['query'][_0x7525('0x38')](_0x7525('0x39'))){_0x36ed3a[_0x7525('0x1e')]=qs[_0x7525('0x1e')](_0x246fce['query']['limit']);_0x36ed3a[_0x7525('0x20')]=qs[_0x7525('0x20')](_0x246fce[_0x7525('0x32')][_0x7525('0x20')]);}return _0x547dc0['getContacts'](_0x36ed3a);}})[_0x7525('0x25')](function(_0x15aab8){if(_0x15aab8){return _0x15aab8?{'count':_0x13430a,'rows':_0x15aab8}:null;}})[_0x7525('0x25')](respondWithResult(_0x415ac9,null))[_0x7525('0x45')](handleError(_0x415ac9,null));};
\ No newline at end of file
+var _0xe06e=['sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','CmContact','omit','ids','getContacts','findOne','map','nolimit','rimraf','request-promise','bluebird','mustache','util','path'];(function(_0x2e6859,_0xc33939){var _0x6077ab=function(_0x3d63ec){while(--_0x3d63ec){_0x2e6859['push'](_0x2e6859['shift']());}};_0x6077ab(++_0xc33939);}(_0xe06e,0x98));var _0xee06=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0xe06e[_0x5bf2b3];return _0x5e8a9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee06('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xee06('0x1'));var moment=require('moment');var BPromise=require(_0xee06('0x2'));var Mustache=require(_0xee06('0x3'));var util=require(_0xee06('0x4'));var path=require(_0xee06('0x5'));var sox=require(_0xee06('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee06('0x7'));var squel=require(_0xee06('0x8'));var crypto=require('crypto');var jsforce=require(_0xee06('0x9'));var deskjs=require(_0xee06('0xa'));var toCsv=require('to-csv');var querystring=require(_0xee06('0xb'));var Papa=require(_0xee06('0xc'));var Redis=require(_0xee06('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xee06('0xe'));var as=require(_0xee06('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee06('0x10'))('api');var utils=require(_0xee06('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xee06('0x12'));var db=require(_0xee06('0x13'))['db'];function respondWithStatusCode(_0x4b27c4,_0x1281ee){_0x1281ee=_0x1281ee||0xcc;return function(_0x2cb778){if(_0x2cb778){return _0x4b27c4[_0xee06('0x14')](_0x1281ee);}return _0x4b27c4['status'](_0x1281ee)[_0xee06('0x15')]();};}function respondWithResult(_0x5c24df,_0x390694){_0x390694=_0x390694||0xc8;return function(_0x1aa41e){if(_0x1aa41e){return _0x5c24df[_0xee06('0x16')](_0x390694)['json'](_0x1aa41e);}};}function respondWithFilteredResult(_0x1d91de,_0xb86363){return function(_0x1fae04){if(_0x1fae04){var _0x3a42bf=typeof _0xb86363['offset']==='undefined'&&typeof _0xb86363[_0xee06('0x17')]==='undefined';var _0x36b559=_0x1fae04[_0xee06('0x18')];var _0x4c6f9c=_0x3a42bf?0x0:_0xb86363[_0xee06('0x19')];var _0x545d9f=_0x3a42bf?_0x1fae04[_0xee06('0x18')]:_0xb86363['offset']+_0xb86363[_0xee06('0x17')];var _0x3665bc;if(_0x545d9f>=_0x36b559){_0x545d9f=_0x36b559;_0x3665bc=0xc8;}else{_0x3665bc=0xce;}_0x1d91de[_0xee06('0x16')](_0x3665bc);return _0x1d91de['set'](_0xee06('0x1a'),_0x4c6f9c+'-'+_0x545d9f+'/'+_0x36b559)[_0xee06('0x1b')](_0x1fae04);}return null;};}function patchUpdates(_0x54f6bc){return function(_0x329d21){try{jsonpatch[_0xee06('0x1c')](_0x329d21,_0x54f6bc,!![]);}catch(_0x3a7851){return BPromise['reject'](_0x3a7851);}return _0x329d21[_0xee06('0x1d')]();};}function saveUpdates(_0x48bb57,_0x1023b6){return function(_0x57cb8e){if(_0x57cb8e){return _0x57cb8e[_0xee06('0x1e')](_0x48bb57)[_0xee06('0x1f')](function(_0x106500){return _0x106500;});}return null;};}function removeEntity(_0x16f3b4,_0x34e9a9){return function(_0x489e31){if(_0x489e31){return _0x489e31[_0xee06('0x20')]()['then'](function(){var _0x3ae4b2=_0x489e31[_0xee06('0x21')]({'plain':!![]});var _0x395338=_0xee06('0x22');return db[_0xee06('0x23')][_0xee06('0x20')]({'where':{'type':_0x395338,'resourceId':_0x3ae4b2['id']}})['then'](function(){return _0x489e31;});})['then'](function(){_0x16f3b4[_0xee06('0x16')](0xcc)[_0xee06('0x15')]();});}};}function handleEntityNotFound(_0x2369ef,_0x5c897b){return function(_0x16f506){if(!_0x16f506){_0x2369ef[_0xee06('0x14')](0x194);}return _0x16f506;};}function handleError(_0x2232ff,_0x5c29c5){_0x5c29c5=_0x5c29c5||0x1f4;return function(_0x23e1fb){logger[_0xee06('0x24')](_0x23e1fb[_0xee06('0x25')]);if(_0x23e1fb[_0xee06('0x26')]){delete _0x23e1fb[_0xee06('0x26')];}_0x2232ff[_0xee06('0x16')](_0x5c29c5)[_0xee06('0x27')](_0x23e1fb);};}exports['index']=function(_0x1cf26c,_0x436596){var _0x320e29={},_0x3fa44b={},_0x1e5382={'count':0x0,'rows':[]};return db[_0xee06('0x28')][_0xee06('0x29')]()[_0xee06('0x1f')](function(_0x12b866){_0x3fa44b[_0xee06('0x2a')]=_[_0xee06('0x2b')](_0x12b866);_0x3fa44b[_0xee06('0x2c')]=_[_0xee06('0x2b')](_0x1cf26c[_0xee06('0x2c')]);_0x3fa44b[_0xee06('0x2d')]=_['intersection'](_0x3fa44b[_0xee06('0x2a')],_0x3fa44b['query']);_0x320e29[_0xee06('0x2e')]=_[_0xee06('0x2f')](_0x3fa44b[_0xee06('0x2a')],qs[_0xee06('0x30')](_0x1cf26c['query'][_0xee06('0x30')]));_0x320e29[_0xee06('0x2e')]=_0x320e29[_0xee06('0x2e')]['length']?_0x320e29[_0xee06('0x2e')]:_0x3fa44b['model'];if(!_0x1cf26c[_0xee06('0x2c')][_0xee06('0x31')]('nolimit')){_0x320e29[_0xee06('0x17')]=qs[_0xee06('0x17')](_0x1cf26c[_0xee06('0x2c')][_0xee06('0x17')]);_0x320e29[_0xee06('0x19')]=qs[_0xee06('0x19')](_0x1cf26c[_0xee06('0x2c')][_0xee06('0x19')]);}_0x320e29[_0xee06('0x32')]=qs[_0xee06('0x33')](_0x1cf26c[_0xee06('0x2c')]['sort']);_0x320e29[_0xee06('0x34')]=qs[_0xee06('0x2d')](_[_0xee06('0x35')](_0x1cf26c['query'],_0x3fa44b[_0xee06('0x2d')]),_0x12b866);if(_0x1cf26c['query'][_0xee06('0x36')]){_0x320e29['where']=_[_0xee06('0x37')](_0x320e29['where'],{'$or':_['map'](_0x320e29[_0xee06('0x2e')],function(_0x8e8a0b){var _0xcd3e0f={};_0xcd3e0f[_0x8e8a0b]={'$like':'%'+_0x1cf26c[_0xee06('0x2c')][_0xee06('0x36')]+'%'};return _0xcd3e0f;})});}_0x320e29=_[_0xee06('0x37')]({},_0x320e29,_0x1cf26c[_0xee06('0x38')]);var _0x383ce2={'where':_0x320e29[_0xee06('0x34')]};return db[_0xee06('0x28')]['count'](_0x383ce2)['then'](function(_0x4635a9){_0x1e5382['count']=_0x4635a9;if(_0x1cf26c[_0xee06('0x2c')][_0xee06('0x39')]){_0x320e29[_0xee06('0x3a')]=[{'all':!![]}];}return db[_0xee06('0x28')]['findAll'](_0x320e29);})['then'](function(_0x5badcf){_0x1e5382['rows']=_0x5badcf;return _0x1e5382;})[_0xee06('0x1f')](respondWithFilteredResult(_0x436596,_0x320e29))[_0xee06('0x3b')](handleError(_0x436596,null));})[_0xee06('0x3b')](handleError(_0x436596,null));};exports[_0xee06('0x3c')]=function(_0xba88d7,_0x32c6f7){var _0x33a6c3={'raw':![],'where':{'id':_0xba88d7[_0xee06('0x3d')]['id']}},_0x4af1df={};_0x4af1df['model']=_['keys'](db[_0xee06('0x28')][_0xee06('0x3e')]);_0x4af1df[_0xee06('0x2c')]=_[_0xee06('0x2b')](_0xba88d7[_0xee06('0x2c')]);_0x4af1df[_0xee06('0x2d')]=_[_0xee06('0x2f')](_0x4af1df[_0xee06('0x2a')],_0x4af1df[_0xee06('0x2c')]);_0x33a6c3[_0xee06('0x2e')]=_[_0xee06('0x2f')](_0x4af1df[_0xee06('0x2a')],qs['fields'](_0xba88d7[_0xee06('0x2c')][_0xee06('0x30')]));_0x33a6c3[_0xee06('0x2e')]=_0x33a6c3[_0xee06('0x2e')][_0xee06('0x3f')]?_0x33a6c3[_0xee06('0x2e')]:_0x4af1df['model'];if(_0xba88d7['query'][_0xee06('0x39')]){_0x33a6c3[_0xee06('0x3a')]=[{'all':!![]}];}_0x33a6c3=_['merge']({},_0x33a6c3,_0xba88d7[_0xee06('0x38')]);return db[_0xee06('0x28')][_0xee06('0x40')](_0x33a6c3)[_0xee06('0x1f')](handleEntityNotFound(_0x32c6f7,null))['then'](respondWithResult(_0x32c6f7,null))['catch'](handleError(_0x32c6f7,null));};exports[_0xee06('0x41')]=function(_0x4626ac,_0x3055b6){return db[_0xee06('0x28')][_0xee06('0x41')](_0x4626ac[_0xee06('0x42')],{})[_0xee06('0x1f')](function(_0x1d0f82){var _0x3524ee=_0x4626ac[_0xee06('0x43')][_0xee06('0x21')]({'plain':!![]});if(!_0x3524ee)throw new Error(_0xee06('0x44'));if(_0x3524ee['role']===_0xee06('0x43')){var _0x59844c=_0x1d0f82['get']({'plain':!![]});var _0xdfdc94='Companies';return db[_0xee06('0x45')][_0xee06('0x40')]({'where':{'name':_0xdfdc94,'userProfileId':_0x3524ee[_0xee06('0x46')]},'raw':!![]})[_0xee06('0x1f')](function(_0x2ce0ea){if(_0x2ce0ea&&_0x2ce0ea[_0xee06('0x47')]===0x0){return db[_0xee06('0x23')][_0xee06('0x41')]({'name':_0x59844c['name'],'resourceId':_0x59844c['id'],'type':_0x2ce0ea[_0xee06('0x26')],'sectionId':_0x2ce0ea['id']},{})[_0xee06('0x1f')](function(){return _0x1d0f82;});}else{return _0x1d0f82;}})[_0xee06('0x3b')](function(_0x4bd131){logger[_0xee06('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bd131);throw _0x4bd131;});}return _0x1d0f82;})[_0xee06('0x1f')](respondWithResult(_0x3055b6,0xc9))[_0xee06('0x3b')](handleError(_0x3055b6,null));};exports[_0xee06('0x1e')]=function(_0x1bd580,_0x455a2f){if(_0x1bd580[_0xee06('0x42')]['id']){delete _0x1bd580[_0xee06('0x42')]['id'];}return db[_0xee06('0x28')][_0xee06('0x40')]({'where':{'id':_0x1bd580['params']['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x455a2f,null))[_0xee06('0x1f')](saveUpdates(_0x1bd580[_0xee06('0x42')],null))[_0xee06('0x1f')](respondWithResult(_0x455a2f,null))[_0xee06('0x3b')](handleError(_0x455a2f,null));};exports[_0xee06('0x20')]=function(_0xa569b3,_0x31fc5d){return db['CmCompany'][_0xee06('0x40')]({'where':{'id':_0xa569b3['params']['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x31fc5d,null))[_0xee06('0x1f')](removeEntity(_0x31fc5d,null))[_0xee06('0x3b')](handleError(_0x31fc5d,null));};exports[_0xee06('0x29')]=function(_0x5bfae6,_0x59d310){return db[_0xee06('0x28')][_0xee06('0x29')]()[_0xee06('0x1f')](respondWithResult(_0x59d310,null))['catch'](handleError(_0x59d310,null));};exports['addContacts']=function(_0x356dd2,_0x138564,_0x11b4f9){return db[_0xee06('0x48')]['find']({'where':{'id':_0x356dd2[_0xee06('0x3d')]['id']}})[_0xee06('0x1f')](handleEntityNotFound(_0x138564,null))[_0xee06('0x1f')](function(_0x5c6b05){if(_0x5c6b05){return _0x5c6b05['addContacts'](_0x356dd2[_0xee06('0x42')]['ids'],_[_0xee06('0x49')](_0x356dd2[_0xee06('0x42')],[_0xee06('0x4a'),'id'])||{});}})[_0xee06('0x1f')](respondWithResult(_0x138564,null))[_0xee06('0x3b')](handleError(_0x138564,null));};exports[_0xee06('0x4b')]=function(_0x5a8c45,_0x3d9b8b,_0xdd9dbc){var _0x578405={};var _0x570d1b={};var _0x98a245;var _0x4d37af;return db[_0xee06('0x28')][_0xee06('0x4c')]({'where':{'id':_0x5a8c45[_0xee06('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3d9b8b,null))[_0xee06('0x1f')](function(_0x42608d){if(_0x42608d){_0x98a245=_0x42608d;_0x570d1b[_0xee06('0x2a')]=_[_0xee06('0x2b')](db[_0xee06('0x48')][_0xee06('0x3e')]);_0x570d1b['query']=_[_0xee06('0x2b')](_0x5a8c45['query']);_0x570d1b[_0xee06('0x2d')]=_[_0xee06('0x2f')](_0x570d1b[_0xee06('0x2a')],_0x570d1b[_0xee06('0x2c')]);_0x578405[_0xee06('0x2e')]=_[_0xee06('0x2f')](_0x570d1b[_0xee06('0x2a')],qs[_0xee06('0x30')](_0x5a8c45[_0xee06('0x2c')][_0xee06('0x30')]));_0x578405[_0xee06('0x2e')]=_0x578405[_0xee06('0x2e')][_0xee06('0x3f')]?_0x578405['attributes']:_0x570d1b[_0xee06('0x2a')];_0x578405['order']=qs[_0xee06('0x33')](_0x5a8c45[_0xee06('0x2c')]['sort']);_0x578405[_0xee06('0x34')]=qs['filters'](_[_0xee06('0x35')](_0x5a8c45[_0xee06('0x2c')],_0x570d1b['filters']));if(_0x5a8c45[_0xee06('0x2c')][_0xee06('0x36')]){_0x578405[_0xee06('0x34')]=_[_0xee06('0x37')](_0x578405[_0xee06('0x34')],{'$or':_[_0xee06('0x4d')](_0x578405[_0xee06('0x2e')],function(_0x373b03){var _0x452049={};_0x452049[_0x373b03]={'$like':'%'+_0x5a8c45[_0xee06('0x2c')][_0xee06('0x36')]+'%'};return _0x452049;})});}_0x578405=_[_0xee06('0x37')]({},_0x578405,_0x5a8c45[_0xee06('0x38')]);return _0x98a245[_0xee06('0x4b')](_0x578405);}})['then'](function(_0x179622){if(_0x179622){_0x4d37af=_0x179622[_0xee06('0x3f')];if(!_0x5a8c45['query'][_0xee06('0x31')](_0xee06('0x4e'))){_0x578405[_0xee06('0x17')]=qs[_0xee06('0x17')](_0x5a8c45[_0xee06('0x2c')][_0xee06('0x17')]);_0x578405[_0xee06('0x19')]=qs['offset'](_0x5a8c45['query'][_0xee06('0x19')]);}return _0x98a245[_0xee06('0x4b')](_0x578405);}})[_0xee06('0x1f')](function(_0x422798){if(_0x422798){return _0x422798?{'count':_0x4d37af,'rows':_0x422798}:null;}})[_0xee06('0x1f')](respondWithResult(_0x3d9b8b,null))['catch'](handleError(_0x3d9b8b,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 3fe282a..7103984 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 _0xa2a2=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','util','../../config/logger','moment'];(function(_0x3833c4,_0x24e37a){var _0x4d7c15=function(_0x54676c){while(--_0x54676c){_0x3833c4['push'](_0x3833c4['shift']());}};_0x4d7c15(++_0x24e37a);}(_0xa2a2,0x1dd));var _0x2a2a=function(_0x4a8cf1,_0x9e18ac){_0x4a8cf1=_0x4a8cf1-0x0;var _0x214bb2=_0xa2a2[_0x4a8cf1];return _0x214bb2;};'use strict';var _=require('lodash');var util=require(_0x2a2a('0x0'));var logger=require(_0x2a2a('0x1'))('api');var moment=require(_0x2a2a('0x2'));var BPromise=require(_0x2a2a('0x3'));var rp=require(_0x2a2a('0x4'));var fs=require('fs');var path=require(_0x2a2a('0x5'));var rimraf=require(_0x2a2a('0x6'));var config=require(_0x2a2a('0x7'));var attributes=require(_0x2a2a('0x8'));module['exports']=function(_0x5bac23,_0x11ee4a){return _0x5bac23[_0x2a2a('0x9')](_0x2a2a('0xa'),attributes,{'tableName':_0x2a2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc327=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x260468,_0x27498d){var _0x1f8c7f=function(_0x5ad4dd){while(--_0x5ad4dd){_0x260468['push'](_0x260468['shift']());}};_0x1f8c7f(++_0x27498d);}(_0xc327,0x1ac));var _0x7c32=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xc327[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x7c32('0x0'));var util=require(_0x7c32('0x1'));var logger=require(_0x7c32('0x2'))(_0x7c32('0x3'));var moment=require(_0x7c32('0x4'));var BPromise=require(_0x7c32('0x5'));var rp=require(_0x7c32('0x6'));var fs=require('fs');var path=require(_0x7c32('0x7'));var rimraf=require(_0x7c32('0x8'));var config=require(_0x7c32('0x9'));var attributes=require(_0x7c32('0xa'));module[_0x7c32('0xb')]=function(_0x1090c5,_0x118706){return _0x1090c5[_0x7c32('0xc')](_0x7c32('0xd'),attributes,{'tableName':'cm_companies','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 72978a1..01222e4 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 _0xae6a=['error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xae6a,0xeb));var _0xaae6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xae6a[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xaae6('0x0'));var util=require(_0xaae6('0x1'));var moment=require('moment');var BPromise=require(_0xaae6('0x2'));var rs=require(_0xaae6('0x3'));var fs=require('fs');var Redis=require(_0xaae6('0x4'));var db=require(_0xaae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaae6('0x6'))(_0xaae6('0x7'));var config=require('../../config/environment');var jayson=require(_0xaae6('0x8'));var client=jayson[_0xaae6('0x9')][_0xaae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0dc0,_0x4753b9,_0x4f91a1){return new BPromise(function(_0xdd6ded,_0x19807c){return client[_0xaae6('0xb')](_0x2e0dc0,_0x4f91a1)[_0xaae6('0xc')](function(_0x2049da){logger['info'](_0xaae6('0xd'),_0x4753b9,_0xaae6('0xe'));logger[_0xaae6('0xf')](_0xaae6('0x10'),_0x4753b9,_0xaae6('0xe'),JSON[_0xaae6('0x11')](_0x2049da));if(_0x2049da[_0xaae6('0x12')]){if(_0x2049da[_0xaae6('0x12')][_0xaae6('0x13')]===0x1f4){logger['error'](_0xaae6('0xd'),_0x4753b9,_0x2049da['error'][_0xaae6('0x14')]);return _0x19807c(_0x2049da[_0xaae6('0x12')]['message']);}logger[_0xaae6('0x12')](_0xaae6('0xd'),_0x4753b9,_0x2049da['error']['message']);return _0xdd6ded(_0x2049da[_0xaae6('0x12')][_0xaae6('0x14')]);}else{logger[_0xaae6('0x15')](_0xaae6('0xd'),_0x4753b9,_0xaae6('0xe'));_0xdd6ded(_0x2049da[_0xaae6('0x16')]['message']);}})['catch'](function(_0x21dacb){logger[_0xaae6('0x12')](_0xaae6('0xd'),_0x4753b9,_0x21dacb);_0x19807c(_0x21dacb);});});}
\ No newline at end of file
+var _0xd248=['../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x20ea5b,_0x663129){var _0x45c501=function(_0x10743d){while(--_0x10743d){_0x20ea5b['push'](_0x20ea5b['shift']());}};_0x45c501(++_0x663129);}(_0xd248,0xe9));var _0x8d24=function(_0x5627a2,_0x43c8ce){_0x5627a2=_0x5627a2-0x0;var _0x3f8e87=_0xd248[_0x5627a2];return _0x3f8e87;};'use strict';var _=require(_0x8d24('0x0'));var util=require(_0x8d24('0x1'));var moment=require(_0x8d24('0x2'));var BPromise=require(_0x8d24('0x3'));var rs=require(_0x8d24('0x4'));var fs=require('fs');var Redis=require(_0x8d24('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d24('0x6'));var logger=require(_0x8d24('0x7'))(_0x8d24('0x8'));var config=require(_0x8d24('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d24('0xa')][_0x8d24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f480d,_0xac1fa6,_0x15e272){return new BPromise(function(_0xbc5696,_0x3cea27){return client[_0x8d24('0xc')](_0x4f480d,_0x15e272)[_0x8d24('0xd')](function(_0x40eeb0){logger['info'](_0x8d24('0xe'),_0xac1fa6,_0x8d24('0xf'));logger[_0x8d24('0x10')](_0x8d24('0x11'),_0xac1fa6,_0x8d24('0xf'),JSON['stringify'](_0x40eeb0));if(_0x40eeb0[_0x8d24('0x12')]){if(_0x40eeb0[_0x8d24('0x12')][_0x8d24('0x13')]===0x1f4){logger[_0x8d24('0x12')](_0x8d24('0xe'),_0xac1fa6,_0x40eeb0[_0x8d24('0x12')][_0x8d24('0x14')]);return _0x3cea27(_0x40eeb0[_0x8d24('0x12')][_0x8d24('0x14')]);}logger['error'](_0x8d24('0xe'),_0xac1fa6,_0x40eeb0['error'][_0x8d24('0x14')]);return _0xbc5696(_0x40eeb0['error'][_0x8d24('0x14')]);}else{logger['info'](_0x8d24('0xe'),_0xac1fa6,_0x8d24('0xf'));_0xbc5696(_0x40eeb0['result']['message']);}})[_0x8d24('0x15')](function(_0x1b5d3d){logger['error'](_0x8d24('0xe'),_0xac1fa6,_0x1b5d3d);_0x3cea27(_0x1b5d3d);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index de67736..9e3ff0c 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 _0x7363=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/contacts','getContacts','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4a5946,_0x262f3a){var _0x3b7562=function(_0x1054e9){while(--_0x1054e9){_0x4a5946['push'](_0x4a5946['shift']());}};_0x3b7562(++_0x262f3a);}(_0x7363,0x1c8));var _0x3736=function(_0x37cb44,_0x117aa5){_0x37cb44=_0x37cb44-0x0;var _0x5c16e6=_0x7363[_0x37cb44];return _0x5c16e6;};'use strict';var multer=require(_0x3736('0x0'));var util=require(_0x3736('0x1'));var path=require(_0x3736('0x2'));var timeout=require(_0x3736('0x3'));var express=require(_0x3736('0x4'));var router=express['Router']();var fs_extra=require(_0x3736('0x5'));var auth=require(_0x3736('0x6'));var interaction=require(_0x3736('0x7'));var config=require(_0x3736('0x8'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x3736('0x9')](),controller['index']);router[_0x3736('0xa')]('/describe',auth[_0x3736('0x9')](),controller['describe']);router['get'](_0x3736('0xb'),auth[_0x3736('0x9')](),controller[_0x3736('0xc')]);router[_0x3736('0xa')](_0x3736('0xd'),auth[_0x3736('0x9')](),controller[_0x3736('0xe')]);router[_0x3736('0xf')]('/',auth[_0x3736('0x9')](),controller[_0x3736('0x10')]);router[_0x3736('0xf')](_0x3736('0xd'),auth[_0x3736('0x9')](),controller['addContacts']);router[_0x3736('0x11')]('/:id',auth[_0x3736('0x9')](),controller[_0x3736('0x12')]);router[_0x3736('0x13')](_0x3736('0xb'),auth[_0x3736('0x9')](),controller[_0x3736('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x82f7=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','delete','destroy'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x82f7,0x8b));var _0x782f=function(_0xe2f1bc,_0x4eb312){_0xe2f1bc=_0xe2f1bc-0x0;var _0x8cf39d=_0x82f7[_0xe2f1bc];return _0x8cf39d;};'use strict';var multer=require(_0x782f('0x0'));var util=require(_0x782f('0x1'));var path=require(_0x782f('0x2'));var timeout=require(_0x782f('0x3'));var express=require(_0x782f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x782f('0x5'));var interaction=require(_0x782f('0x6'));var config=require(_0x782f('0x7'));var controller=require(_0x782f('0x8'));router[_0x782f('0x9')]('/',auth['isAuthenticated'](),controller[_0x782f('0xa')]);router['get']('/describe',auth[_0x782f('0xb')](),controller[_0x782f('0xc')]);router['get'](_0x782f('0xd'),auth[_0x782f('0xb')](),controller[_0x782f('0xe')]);router['get'](_0x782f('0xf'),auth['isAuthenticated'](),controller[_0x782f('0x10')]);router[_0x782f('0x11')]('/',auth[_0x782f('0xb')](),controller['create']);router[_0x782f('0x11')](_0x782f('0xf'),auth['isAuthenticated'](),controller[_0x782f('0x12')]);router[_0x782f('0x13')](_0x782f('0xd'),auth[_0x782f('0xb')](),controller['update']);router[_0x782f('0x14')](_0x782f('0xd'),auth[_0x782f('0xb')](),controller[_0x782f('0x15')]);module[_0x782f('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 657dfa7..b012755 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 _0x9bc5=['STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x89ed41,_0xdae94b){var _0x159a10=function(_0x563697){while(--_0x563697){_0x89ed41['push'](_0x89ed41['shift']());}};_0x159a10(++_0xdae94b);}(_0x9bc5,0x1c2));var _0x59bc=function(_0x18ba79,_0x4c55ec){_0x18ba79=_0x18ba79-0x0;var _0xb208d2=_0x9bc5[_0x18ba79];return _0xb208d2;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x59bc('0x0')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x59bc('0x0')]},'description':{'type':Sequelize[_0x59bc('0x1')]},'phone':{'type':Sequelize[_0x59bc('0x0')]},'mobile':{'type':Sequelize[_0x59bc('0x0')]},'fax':{'type':Sequelize[_0x59bc('0x0')]},'email':{'type':Sequelize[_0x59bc('0x0')]},'url':{'type':Sequelize[_0x59bc('0x0')]},'facebook':{'type':Sequelize[_0x59bc('0x0')]},'fb_data':{'type':Sequelize[_0x59bc('0x0')]},'twitter':{'type':Sequelize[_0x59bc('0x0')]},'skype':{'type':Sequelize[_0x59bc('0x0')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x59bc('0x0')]},'line':{'type':Sequelize[_0x59bc('0x0')]},'wechat':{'type':Sequelize[_0x59bc('0x0')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x59bc('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x59bc('0x0')]},'priority':{'type':Sequelize[_0x59bc('0x2')](0x2)[_0x59bc('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x59bc('0x4')]},'dialTimezone':{'type':Sequelize[_0x59bc('0x0')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0291=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x3134c9,_0x5670c8){var _0x19b94a=function(_0x2c68de){while(--_0x2c68de){_0x3134c9['push'](_0x3134c9['shift']());}};_0x19b94a(++_0x5670c8);}(_0x0291,0xad));var _0x1029=function(_0x3bc179,_0x392c5b){_0x3bc179=_0x3bc179-0x0;var _0x25dfb4=_0x0291[_0x3bc179];return _0x25dfb4;};'use strict';var _=require(_0x1029('0x0'));var Sequelize=require(_0x1029('0x1'));module[_0x1029('0x2')]={'firstName':{'type':Sequelize[_0x1029('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1029('0x3')]},'street':{'type':Sequelize[_0x1029('0x3')]},'postalCode':{'type':Sequelize[_0x1029('0x3')]},'city':{'type':Sequelize[_0x1029('0x3')]},'country':{'type':Sequelize[_0x1029('0x3')]},'dateOfBirth':{'type':Sequelize[_0x1029('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1029('0x3')]},'mobile':{'type':Sequelize[_0x1029('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1029('0x3')]},'url':{'type':Sequelize[_0x1029('0x3')]},'facebook':{'type':Sequelize[_0x1029('0x3')]},'fb_data':{'type':Sequelize[_0x1029('0x3')]},'twitter':{'type':Sequelize[_0x1029('0x3')]},'skype':{'type':Sequelize[_0x1029('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1029('0x3')]},'line':{'type':Sequelize[_0x1029('0x3')]},'wechat':{'type':Sequelize[_0x1029('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1029('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x1029('0x3')]},'priority':{'type':Sequelize[_0x1029('0x4')](0x2)[_0x1029('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1029('0x6')],'defaultValue':Sequelize[_0x1029('0x7')]},'dialTimezone':{'type':Sequelize[_0x1029('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 7b34145..fe2b568 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 _0x0b7c=['values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','update','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','tag','Phones','ItemType','sequelize','literal','$and','omit','map','cf_%d','find','pickBy','format','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','model','Tag','rawAttributes','filters','intersection','attributes','order','sort','pick','filter','options','hasOwnProperty','nolimit','setTags','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','bulkCreate','rescheduleAdditionalPhones','hopperId','getHoppers','fields','ContactId','includeAll','include','getHopperHistories','rows','getHopperFinals','getJscriptySessions','JscriptySessionReport','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','import','binding','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','User','agent','No\x20phone\x20column\x20specified','child_process','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','DESC','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','fullname','Tags','color','customerPort','osName','ratingMessage','ratingType','ratingValue','subject','substatus','externalUrl','threadId','Interaction','findAndCountAll','Owner','flatten','reverse','slice','moment','bluebird','path','lodash','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','destroy','then','error','stack','name','send','describe','getOptions','findAll','query','user','catch','CmContact','params','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','alias','custom','type'];(function(_0x33d365,_0xb09985){var _0x587f65=function(_0x1c49f1){while(--_0x1c49f1){_0x33d365['push'](_0x33d365['shift']());}};_0x587f65(++_0xb09985);}(_0x0b7c,0xd3));var _0xc0b7=function(_0x1081a3,_0x2ac784){_0x1081a3=_0x1081a3-0x0;var _0x5696a2=_0x0b7c[_0x1081a3];return _0x5696a2;};'use strict';var moment=require(_0xc0b7('0x0'));var BPromise=require(_0xc0b7('0x1'));var util=require('util');var path=require(_0xc0b7('0x2'));var fs=require('fs');var _=require(_0xc0b7('0x3'));var squel=require('squel');var Papa=require(_0xc0b7('0x4'));var Redis=require('ioredis');var contacts=require(_0xc0b7('0x5'));var qs=require(_0xc0b7('0x6'));var logger=require(_0xc0b7('0x7'))(_0xc0b7('0x8'));var config=require(_0xc0b7('0x9'));var shared=require(_0xc0b7('0xa'));var db=require('../../mysqldb')['db'];config[_0xc0b7('0xb')]=_[_0xc0b7('0xc')](config[_0xc0b7('0xb')],{'host':_0xc0b7('0xd'),'port':0x18eb});var socket=require(_0xc0b7('0xe'))(new Redis(config[_0xc0b7('0xb')]));require(_0xc0b7('0xf'))[_0xc0b7('0x10')](socket);function respondWithResult(_0x5f3d3b,_0x55d42f){_0x55d42f=_0x55d42f||0xc8;return function(_0x4fc92e){if(_0x4fc92e){return _0x5f3d3b[_0xc0b7('0x11')](_0x55d42f)[_0xc0b7('0x12')](_0x4fc92e);}};}function respondWithFilteredResult(_0x5bfcf8,_0x578853){return function(_0x12ffc3){if(_0x12ffc3){var _0x3ceb61=typeof _0x578853['offset']==='undefined'&&typeof _0x578853[_0xc0b7('0x13')]===_0xc0b7('0x14');var _0x5c8aac=_0x12ffc3[_0xc0b7('0x15')];var _0x387db8=_0x3ceb61?0x0:_0x578853[_0xc0b7('0x16')];var _0x5e53c8=_0x3ceb61?_0x12ffc3[_0xc0b7('0x15')]:_0x578853[_0xc0b7('0x16')]+_0x578853[_0xc0b7('0x13')];var _0x46f1d5;if(_0x5e53c8>=_0x5c8aac){_0x5e53c8=_0x5c8aac;_0x46f1d5=0xc8;}else{_0x46f1d5=0xce;}_0x5bfcf8[_0xc0b7('0x11')](_0x46f1d5);return _0x5bfcf8[_0xc0b7('0x17')](_0xc0b7('0x18'),_0x387db8+'-'+_0x5e53c8+'/'+_0x5c8aac)['json'](_0x12ffc3);}return null;};}function saveUpdates(_0x15e765){return function(_0x2dc40e){if(_0x2dc40e){return _0x2dc40e['update'](_0x15e765)['then'](function(_0x558b0d){return _0x558b0d;});}return null;};}function removeEntity(_0x45b60d){return function(_0x1578ce){if(_0x1578ce){return _0x1578ce[_0xc0b7('0x19')]()[_0xc0b7('0x1a')](function(){_0x45b60d[_0xc0b7('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b048a){return function(_0x141dec){if(!_0x141dec){_0x1b048a['sendStatus'](0x194);}return _0x141dec;};}function handleError(_0x19579c,_0x17c9fc){_0x17c9fc=_0x17c9fc||0x1f4;return function(_0x568fc6){logger[_0xc0b7('0x1b')](_0x568fc6[_0xc0b7('0x1c')]);if(_0x568fc6[_0xc0b7('0x1d')]){delete _0x568fc6['name'];}_0x19579c[_0xc0b7('0x11')](_0x17c9fc)[_0xc0b7('0x1e')](_0x568fc6);};}exports['index']=function(_0x19df0d,_0x3e70e3){var _0x4ca581={};return contacts[_0xc0b7('0x1f')]()[_0xc0b7('0x1a')](function(_0x3731dc){_0x4ca581=qs[_0xc0b7('0x20')](_0x3731dc,_0x19df0d);return contacts[_0xc0b7('0x21')](_0x19df0d[_0xc0b7('0x22')],_0x19df0d[_0xc0b7('0x23')],_0x4ca581,_0x3731dc);})[_0xc0b7('0x1a')](respondWithFilteredResult(_0x3e70e3,_0x4ca581))[_0xc0b7('0x24')](handleError(_0x3e70e3,null));};exports[_0xc0b7('0x19')]=function(_0x48ac3b,_0x1379d7){return db[_0xc0b7('0x25')]['find']({'where':{'id':_0x48ac3b[_0xc0b7('0x26')]['id']}})[_0xc0b7('0x1a')](handleEntityNotFound(_0x1379d7,null))[_0xc0b7('0x1a')](removeEntity(_0x1379d7,null))[_0xc0b7('0x24')](handleError(_0x1379d7,null));};exports[_0xc0b7('0x1f')]=function(_0x23ec59,_0x215325){return db['CmContact'][_0xc0b7('0x1f')]()[_0xc0b7('0x1a')](function(_0xda1c00){delete _0xda1c00['tags'];for(var _0x4abf78=0x0;_0x4abf78
','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','join','utf-8','toString','base64','lodash','moment','path','node-tnef','../../../config/logger','value','address','anonymous','head','name','substring','indexOf','split','length','slice','Anonymous'];(function(_0x271d2f,_0x421a09){var _0x152e10=function(_0x1d6f56){while(--_0x1d6f56){_0x271d2f['push'](_0x271d2f['shift']());}};_0x152e10(++_0x421a09);}(_0x63db,0x1e8));var _0xb63d=function(_0x524a18,_0xfe22aa){_0x524a18=_0x524a18-0x0;var _0x51dc67=_0x63db[_0x524a18];return _0x51dc67;};'use strict';var _=require(_0xb63d('0x0'));var moment=require(_0xb63d('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xb63d('0x2'));var util=require('util');var tnef=require(_0xb63d('0x3'));var logger=require(_0xb63d('0x4'))('email');var config=require('../../../config/environment');function getAddress(_0xf20524){var _0x11d8d9=_['head'](_0xf20524[_0xb63d('0x5')]);return _0x11d8d9&&_0x11d8d9[_0xb63d('0x6')]?_0x11d8d9[_0xb63d('0x6')]:_0xb63d('0x7')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x4b688a){var _0x48a81d=_[_0xb63d('0x8')](_0x4b688a[_0xb63d('0x5')]);if(_0x48a81d&&_0x48a81d['name']){if(_0x48a81d[_0xb63d('0x9')]==_0x48a81d[_0xb63d('0x6')]){return _0x48a81d[_0xb63d('0x9')][_0xb63d('0xa')](0x0,_0x48a81d['name'][_0xb63d('0xb')]('@'));}var _0x44a289=_0x48a81d[_0xb63d('0x9')][_0xb63d('0xc')](/\s+/);return _0x44a289[_0xb63d('0xd')]>0x1?_0x44a289[_0xb63d('0xe')](0x0,-0x1)['join']('\x20'):_0x48a81d[_0xb63d('0x9')];}return _0xb63d('0xf');}function getLastName(_0x5bf51c){var _0x2b471e=_[_0xb63d('0x8')](_0x5bf51c['value']);if(_0x2b471e&&_0x2b471e['name']){var _0x55d9a6=_0x2b471e['name'][_0xb63d('0xc')](/\s+/);return _0x55d9a6['length']>0x1?_0x55d9a6[_0xb63d('0x10')]():'';}return'';}function getMails(_0x57c242,_0x4e7d73){var _0x517d4a='';for(var _0x3c14ab=0x0;_0x3c14ab<_0x4e7d73[_0xb63d('0x5')][_0xb63d('0xd')];_0x3c14ab+=0x1){if(_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x6')]!==_0x57c242){if(!_[_0xb63d('0x11')](_0x517d4a)){_0x517d4a+=',';}_0x517d4a+=_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x9')]||_0x4e7d73['value'][_0x3c14ab][_0xb63d('0x6')]||'';_0x517d4a+='\x20<';_0x517d4a+=_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x6')]?_0x4e7d73[_0xb63d('0x5')][_0x3c14ab][_0xb63d('0x6')]:_0xb63d('0x7')+random[_0xb63d('0x12')](0x6)+_0xb63d('0x13');_0x517d4a+='>';}}return _0x517d4a;}function parseEmail(_0xb232a0,_0x58a785,_0xcfc86a){if(_0x58a785[_0xb63d('0x14')]){var _0x117ec8=/