From: support
Date: Thu, 2 Feb 2023 09:48:44 +0000 (+0000)
Subject: Built motion from commit f25620e4.|2.6.30
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=bc59f2d963e2dc9b6dd9215521802d26529ccb55;p=motion2.git
Built motion from commit f25620e4.|2.6.30
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index b7a017c..b744a27 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-02T09:08:11.555Z",
+ "time": "2023-02-02T09:39:28.183Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index f55c105..ddf2410 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-02T09:08:11.555Z",
+ "time": "2023-02-02T09:39:28.183Z",
"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 c1e79c0..837a877 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 _0xe86b=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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]','TEXT','urlForward[body]','sequelize','VIRTUAL','action','STRING','integration','jscripty','urlForward'];(function(_0x420fab,_0x362358){var _0xe66988=function(_0x3c2a6f){while(--_0x3c2a6f){_0x420fab['push'](_0x420fab['shift']());}};_0xe66988(++_0x362358);}(_0xe86b,0x173));var _0xbe86=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe86b[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xbe86('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe86('0x1')],'get':function(_0x1b02a6){return this['getDataValue'](_0xbe86('0x2'));}},'action':{'type':Sequelize[_0xbe86('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbe86('0x4'),'motionbar',_0xbe86('0x5'),_0xbe86('0x6'),_0xbe86('0x7'),_0xbe86('0x8'),_0xbe86('0x9')]],'msg':_0xbe86('0xa')}},'comment':_0xbe86('0xa')},'data1':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comment':_0xbe86('0xb')},'data2':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comment':_0xbe86('0xc')},'data4':{'type':Sequelize[_0xbe86('0x3')](0x1000),'comments':_0xbe86('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xbe86('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0xbe86('0xf')},'data7':{'type':Sequelize[_0xbe86('0x10')],'comments':_0xbe86('0x11')}};
\ No newline at end of file
+var _0xf65a=['motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x4a48e5,_0x36daf4){var _0x1921b8=function(_0x205ac5){while(--_0x205ac5){_0x4a48e5['push'](_0x4a48e5['shift']());}};_0x1921b8(++_0x36daf4);}(_0xf65a,0x19b));var _0xaf65=function(_0x4a30f7,_0x1ff5f6){_0x4a30f7=_0x4a30f7-0x0;var _0x2b6a7b=_0xf65a[_0x4a30f7];return _0x2b6a7b;};'use strict';var Sequelize=require(_0xaf65('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf65('0x1')],'get':function(_0x5db5fb){return this[_0xaf65('0x2')](_0xaf65('0x3'));}},'action':{'type':Sequelize[_0xaf65('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xaf65('0x5'),_0xaf65('0x6'),_0xaf65('0x7'),'jscripty',_0xaf65('0x8'),_0xaf65('0x9'),_0xaf65('0xa'),_0xaf65('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xaf65('0xc')},'data1':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comment':_0xaf65('0xd')},'data2':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comment':_0xaf65('0xe')},'data3':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comment':_0xaf65('0xf')},'data4':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xaf65('0x4')](0x1000),'comments':_0xaf65('0x10')},'data6':{'type':Sequelize[_0xaf65('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xaf65('0x11')],'comments':_0xaf65('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 78e717e..82ceeb0 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 _0x4eb9=['sendStatus','status','end','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','body','find','params','catch','Action','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x4eb9,0x1a1));var _0x94eb=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x4eb9[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94eb('0x0'));var zipdir=require(_0x94eb('0x1'));var jsonpatch=require(_0x94eb('0x2'));var rp=require('request-promise');var moment=require(_0x94eb('0x3'));var BPromise=require(_0x94eb('0x4'));var Mustache=require(_0x94eb('0x5'));var util=require(_0x94eb('0x6'));var path=require(_0x94eb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x94eb('0x8'));var fs=require('fs');var fs_extra=require(_0x94eb('0x9'));var _=require(_0x94eb('0xa'));var squel=require(_0x94eb('0xb'));var crypto=require(_0x94eb('0xc'));var jsforce=require(_0x94eb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x94eb('0xe'));var Papa=require(_0x94eb('0xf'));var Redis=require(_0x94eb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x94eb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x94eb('0x12'));var logger=require(_0x94eb('0x13'))(_0x94eb('0x14'));var utils=require('../../config/utils');var config=require(_0x94eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x94eb('0x16'))['db'];function respondWithStatusCode(_0x1eb73a,_0x28726e){_0x28726e=_0x28726e||0xcc;return function(_0x545eb4){if(_0x545eb4){return _0x1eb73a[_0x94eb('0x17')](_0x28726e);}return _0x1eb73a[_0x94eb('0x18')](_0x28726e)[_0x94eb('0x19')]();};}function respondWithResult(_0x3c631a,_0x16d1bd){_0x16d1bd=_0x16d1bd||0xc8;return function(_0x3187eb){if(_0x3187eb){return _0x3c631a['status'](_0x16d1bd)['json'](_0x3187eb);}};}function respondWithFilteredResult(_0x5f4770,_0x45a7d8){return function(_0x3be9c3){if(_0x3be9c3){var _0xed2058=typeof _0x45a7d8[_0x94eb('0x1a')]==='undefined'&&typeof _0x45a7d8[_0x94eb('0x1b')]==='undefined';var _0x1704ed=_0x3be9c3[_0x94eb('0x1c')];var _0x3a508d=_0xed2058?0x0:_0x45a7d8[_0x94eb('0x1a')];var _0x1f4d62=_0xed2058?_0x3be9c3['count']:_0x45a7d8[_0x94eb('0x1a')]+_0x45a7d8['limit'];var _0x142d7d;if(_0x1f4d62>=_0x1704ed){_0x1f4d62=_0x1704ed;_0x142d7d=0xc8;}else{_0x142d7d=0xce;}_0x5f4770[_0x94eb('0x18')](_0x142d7d);return _0x5f4770[_0x94eb('0x1d')](_0x94eb('0x1e'),_0x3a508d+'-'+_0x1f4d62+'/'+_0x1704ed)['json'](_0x3be9c3);}return null;};}function patchUpdates(_0xaed0ae){return function(_0x4abb08){try{jsonpatch[_0x94eb('0x1f')](_0x4abb08,_0xaed0ae,!![]);}catch(_0xffb6ff){return BPromise['reject'](_0xffb6ff);}return _0x4abb08[_0x94eb('0x20')]();};}function saveUpdates(_0x5c6ffc,_0x1e968f){return function(_0x4517dc){if(_0x4517dc){return _0x4517dc[_0x94eb('0x21')](_0x5c6ffc)[_0x94eb('0x22')](function(_0x596328){return _0x596328;});}return null;};}function removeEntity(_0x27839b,_0x1e45d9){return function(_0x5862a){if(_0x5862a){return _0x5862a[_0x94eb('0x23')]()['then'](function(){_0x27839b[_0x94eb('0x18')](0xcc)[_0x94eb('0x19')]();});}};}function handleEntityNotFound(_0x175d4d,_0x27388e){return function(_0x2b4c4d){if(!_0x2b4c4d){_0x175d4d[_0x94eb('0x17')](0x194);}return _0x2b4c4d;};}function handleError(_0x1aef78,_0x471ca6){_0x471ca6=_0x471ca6||0x1f4;return function(_0xdf5a4){logger[_0x94eb('0x24')](_0xdf5a4['stack']);if(_0xdf5a4[_0x94eb('0x25')]){delete _0xdf5a4[_0x94eb('0x25')];}_0x1aef78[_0x94eb('0x18')](_0x471ca6)[_0x94eb('0x26')](_0xdf5a4);};}exports[_0x94eb('0x21')]=function(_0x526db5,_0x48f0a5){if(_0x526db5[_0x94eb('0x27')]['id']){delete _0x526db5[_0x94eb('0x27')]['id'];}return db['Action'][_0x94eb('0x28')]({'where':{'id':_0x526db5[_0x94eb('0x29')]['id']}})[_0x94eb('0x22')](handleEntityNotFound(_0x48f0a5,null))[_0x94eb('0x22')](saveUpdates(_0x526db5[_0x94eb('0x27')],null))['then'](respondWithResult(_0x48f0a5,null))[_0x94eb('0x2a')](handleError(_0x48f0a5,null));};exports[_0x94eb('0x23')]=function(_0x310579,_0x5d35b9){return db[_0x94eb('0x2b')][_0x94eb('0x28')]({'where':{'id':_0x310579[_0x94eb('0x29')]['id']}})[_0x94eb('0x22')](handleEntityNotFound(_0x5d35b9,null))[_0x94eb('0x22')](removeEntity(_0x5d35b9,null))[_0x94eb('0x2a')](handleError(_0x5d35b9,null));};
\ No newline at end of file
+var _0x0dc2=['catch','rimraf','zip-dir','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','body','Action','find','params'];(function(_0x1cc294,_0x5d677d){var _0x9af5f=function(_0x55a876){while(--_0x55a876){_0x1cc294['push'](_0x1cc294['shift']());}};_0x9af5f(++_0x5d677d);}(_0x0dc2,0x151));var _0x20dc=function(_0x3c3910,_0x478282){_0x3c3910=_0x3c3910-0x0;var _0x5d34de=_0x0dc2[_0x3c3910];return _0x5d34de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20dc('0x0'));var zipdir=require(_0x20dc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x20dc('0x2'));var BPromise=require(_0x20dc('0x3'));var Mustache=require('mustache');var util=require(_0x20dc('0x4'));var path=require(_0x20dc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20dc('0x6'));var fs=require('fs');var fs_extra=require(_0x20dc('0x7'));var _=require(_0x20dc('0x8'));var squel=require('squel');var crypto=require(_0x20dc('0x9'));var jsforce=require(_0x20dc('0xa'));var deskjs=require(_0x20dc('0xb'));var toCsv=require(_0x20dc('0xc'));var querystring=require(_0x20dc('0xd'));var Papa=require(_0x20dc('0xe'));var Redis=require(_0x20dc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x20dc('0x10'));var as=require(_0x20dc('0x11'));var hardwareService=require(_0x20dc('0x12'));var logger=require(_0x20dc('0x13'))(_0x20dc('0x14'));var utils=require(_0x20dc('0x15'));var config=require(_0x20dc('0x16'));var licenseUtil=require(_0x20dc('0x17'));var db=require(_0x20dc('0x18'))['db'];function respondWithStatusCode(_0x31d909,_0x1b88fb){_0x1b88fb=_0x1b88fb||0xcc;return function(_0x273051){if(_0x273051){return _0x31d909[_0x20dc('0x19')](_0x1b88fb);}return _0x31d909['status'](_0x1b88fb)['end']();};}function respondWithResult(_0x5e9f1a,_0xc4054e){_0xc4054e=_0xc4054e||0xc8;return function(_0x5ccbc0){if(_0x5ccbc0){return _0x5e9f1a[_0x20dc('0x1a')](_0xc4054e)[_0x20dc('0x1b')](_0x5ccbc0);}};}function respondWithFilteredResult(_0xfba911,_0x38a6ee){return function(_0x6fb4ed){if(_0x6fb4ed){var _0x4624a2=typeof _0x38a6ee[_0x20dc('0x1c')]===_0x20dc('0x1d')&&typeof _0x38a6ee[_0x20dc('0x1e')]==='undefined';var _0x565f98=_0x6fb4ed['count'];var _0x3b2948=_0x4624a2?0x0:_0x38a6ee['offset'];var _0x28223b=_0x4624a2?_0x6fb4ed[_0x20dc('0x1f')]:_0x38a6ee[_0x20dc('0x1c')]+_0x38a6ee[_0x20dc('0x1e')];var _0x2493de;if(_0x28223b>=_0x565f98){_0x28223b=_0x565f98;_0x2493de=0xc8;}else{_0x2493de=0xce;}_0xfba911[_0x20dc('0x1a')](_0x2493de);return _0xfba911[_0x20dc('0x20')](_0x20dc('0x21'),_0x3b2948+'-'+_0x28223b+'/'+_0x565f98)[_0x20dc('0x1b')](_0x6fb4ed);}return null;};}function patchUpdates(_0x52a408){return function(_0x124e21){try{jsonpatch[_0x20dc('0x22')](_0x124e21,_0x52a408,!![]);}catch(_0x33839f){return BPromise['reject'](_0x33839f);}return _0x124e21['save']();};}function saveUpdates(_0x53d3b1,_0x3ce9f1){return function(_0x1479bf){if(_0x1479bf){return _0x1479bf[_0x20dc('0x23')](_0x53d3b1)[_0x20dc('0x24')](function(_0x5be23f){return _0x5be23f;});}return null;};}function removeEntity(_0x24c7c0,_0xb2efc6){return function(_0x373452){if(_0x373452){return _0x373452[_0x20dc('0x25')]()[_0x20dc('0x24')](function(){_0x24c7c0['status'](0xcc)[_0x20dc('0x26')]();});}};}function handleEntityNotFound(_0x224037,_0x44cdf4){return function(_0x56bbf2){if(!_0x56bbf2){_0x224037[_0x20dc('0x19')](0x194);}return _0x56bbf2;};}function handleError(_0x363262,_0x57b172){_0x57b172=_0x57b172||0x1f4;return function(_0x47bace){logger[_0x20dc('0x27')](_0x47bace[_0x20dc('0x28')]);if(_0x47bace[_0x20dc('0x29')]){delete _0x47bace[_0x20dc('0x29')];}_0x363262[_0x20dc('0x1a')](_0x57b172)[_0x20dc('0x2a')](_0x47bace);};}exports['update']=function(_0x268818,_0x43b703){if(_0x268818[_0x20dc('0x2b')]['id']){delete _0x268818[_0x20dc('0x2b')]['id'];}return db[_0x20dc('0x2c')][_0x20dc('0x2d')]({'where':{'id':_0x268818[_0x20dc('0x2e')]['id']}})[_0x20dc('0x24')](handleEntityNotFound(_0x43b703,null))[_0x20dc('0x24')](saveUpdates(_0x268818['body'],null))['then'](respondWithResult(_0x43b703,null))['catch'](handleError(_0x43b703,null));};exports[_0x20dc('0x25')]=function(_0x7e87c,_0x4f8756){return db[_0x20dc('0x2c')][_0x20dc('0x2d')]({'where':{'id':_0x7e87c[_0x20dc('0x2e')]['id']}})['then'](handleEntityNotFound(_0x4f8756,null))[_0x20dc('0x24')](removeEntity(_0x4f8756,null))[_0x20dc('0x2f')](handleError(_0x4f8756,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index f011f13..2f6901f 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 _0x482b=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x1118ad,_0x3db984){var _0x590d28=function(_0x1dfffd){while(--_0x1dfffd){_0x1118ad['push'](_0x1118ad['shift']());}};_0x590d28(++_0x3db984);}(_0x482b,0x12a));var _0xb482=function(_0x451f99,_0x36ead2){_0x451f99=_0x451f99-0x0;var _0x8a8ae7=_0x482b[_0x451f99];return _0x8a8ae7;};'use strict';var _=require(_0xb482('0x0'));var util=require(_0xb482('0x1'));var logger=require(_0xb482('0x2'))('api');var moment=require(_0xb482('0x3'));var BPromise=require('bluebird');var rp=require(_0xb482('0x4'));var fs=require('fs');var path=require(_0xb482('0x5'));var rimraf=require(_0xb482('0x6'));var config=require(_0xb482('0x7'));var attributes=require('./action.attributes');module[_0xb482('0x8')]=function(_0x3a6412,_0x254284){return _0x3a6412[_0xb482('0x9')](_0xb482('0xa'),attributes,{'tableName':_0xb482('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x08e8=['./action.attributes','exports','Action','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x08e8,0xc9));var _0x808e=function(_0x5c82b9,_0x16999c){_0x5c82b9=_0x5c82b9-0x0;var _0x4a0829=_0x08e8[_0x5c82b9];return _0x4a0829;};'use strict';var _=require('lodash');var util=require(_0x808e('0x0'));var logger=require('../../config/logger')(_0x808e('0x1'));var moment=require(_0x808e('0x2'));var BPromise=require(_0x808e('0x3'));var rp=require(_0x808e('0x4'));var fs=require('fs');var path=require(_0x808e('0x5'));var rimraf=require(_0x808e('0x6'));var config=require(_0x808e('0x7'));var attributes=require(_0x808e('0x8'));module[_0x808e('0x9')]=function(_0xb4cdbe,_0x5c4278){return _0xb4cdbe['define'](_0x808e('0xa'),attributes,{'tableName':'tools_actions','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 44e980a..f0efddd 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x65331c,_0x176927){var _0x401e4c=function(_0x191f01){while(--_0x191f01){_0x65331c['push'](_0x65331c['shift']());}};_0x401e4c(++_0x176927);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x7fbe[_0xaf29da];return _0x295c51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0xf494,0x1c6));var _0x4f49=function(_0x1843f1,_0x175a27){_0x1843f1=_0x1843f1-0x0;var _0x341bb3=_0xf494[_0x1843f1];return _0x341bb3;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7aa62f5..ee1c2ec 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 _0x1d55=['put','/:id','isAuthenticated','update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x2ed55c,_0x146490){var _0x52122b=function(_0x1dc8fd){while(--_0x1dc8fd){_0x2ed55c['push'](_0x2ed55c['shift']());}};_0x52122b(++_0x146490);}(_0x1d55,0x11f));var _0x51d5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1d55[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51d5('0x0'));var timeout=require('connect-timeout');var express=require(_0x51d5('0x1'));var router=express['Router']();var fs_extra=require(_0x51d5('0x2'));var auth=require(_0x51d5('0x3'));var interaction=require(_0x51d5('0x4'));var config=require(_0x51d5('0x5'));var controller=require(_0x51d5('0x6'));router[_0x51d5('0x7')](_0x51d5('0x8'),auth[_0x51d5('0x9')](),controller[_0x51d5('0xa')]);router[_0x51d5('0xb')](_0x51d5('0x8'),auth[_0x51d5('0x9')](),controller[_0x51d5('0xc')]);module[_0x51d5('0xd')]=router;
\ No newline at end of file
+var _0x5cb5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','destroy','exports','multer','path','express'];(function(_0xef6c0d,_0x698c54){var _0x568b1c=function(_0x23b136){while(--_0x23b136){_0xef6c0d['push'](_0xef6c0d['shift']());}};_0x568b1c(++_0x698c54);}(_0x5cb5,0x1cb));var _0x55cb=function(_0x166c52,_0x208d0f){_0x166c52=_0x166c52-0x0;var _0x2c526d=_0x5cb5[_0x166c52];return _0x2c526d;};'use strict';var multer=require(_0x55cb('0x0'));var util=require('util');var path=require(_0x55cb('0x1'));var timeout=require('connect-timeout');var express=require(_0x55cb('0x2'));var router=express[_0x55cb('0x3')]();var fs_extra=require(_0x55cb('0x4'));var auth=require(_0x55cb('0x5'));var interaction=require(_0x55cb('0x6'));var config=require(_0x55cb('0x7'));var controller=require(_0x55cb('0x8'));router[_0x55cb('0x9')](_0x55cb('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x55cb('0xa'),auth[_0x55cb('0xb')](),controller[_0x55cb('0xc')]);module[_0x55cb('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 458a5d4..0a30b96 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x535250,_0x1127f7){var _0x16ffe8=function(_0x3062dc){while(--_0x3062dc){_0x535250['push'](_0x535250['shift']());}};_0x16ffe8(++_0x1127f7);}(_0x425d,0x1e0));var _0xd425=function(_0xb70791,_0x1d91d6){_0xb70791=_0xb70791-0x0;var _0x48f939=_0x425d[_0xb70791];return _0x48f939;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x6d1c65,_0x22df6e){var _0x1e96b4=function(_0xc1aac4){while(--_0xc1aac4){_0x6d1c65['push'](_0x6d1c65['shift']());}};_0x1e96b4(++_0x22df6e);}(_0x5fab,0x177));var _0xb5fa=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x5fab[_0x4f35f4];return _0x2e9a70;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index bb8e198..2c674ab 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 _0x52fb=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','type','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','SEC_TO_TIME(%s)','ROUND(%s)','metric','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','ValidationErrorItem','Limited\x20Query:'];(function(_0x22e09f,_0x5f1211){var _0x3c96cb=function(_0x28dcf0){while(--_0x28dcf0){_0x22e09f['push'](_0x22e09f['shift']());}};_0x3c96cb(++_0x5f1211);}(_0x52fb,0xa8));var _0xb52f=function(_0x2a5bb0,_0x32b8fd){_0x2a5bb0=_0x2a5bb0-0x0;var _0x103464=_0x52fb[_0x2a5bb0];return _0x103464;};'use strict';var emlformat=require(_0xb52f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb52f('0x1'));var jsonpatch=require(_0xb52f('0x2'));var rp=require(_0xb52f('0x3'));var moment=require('moment');var BPromise=require(_0xb52f('0x4'));var Mustache=require(_0xb52f('0x5'));var util=require('util');var path=require(_0xb52f('0x6'));var sox=require('sox');var csv=require(_0xb52f('0x7'));var ejs=require(_0xb52f('0x8'));var fs=require('fs');var fs_extra=require(_0xb52f('0x9'));var _=require('lodash');var squel=require(_0xb52f('0xa'));var crypto=require('crypto');var jsforce=require(_0xb52f('0xb'));var deskjs=require(_0xb52f('0xc'));var toCsv=require(_0xb52f('0x7'));var querystring=require(_0xb52f('0xd'));var Papa=require(_0xb52f('0xe'));var Redis=require(_0xb52f('0xf'));var authService=require(_0xb52f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb52f('0x11'));var hardwareService=require(_0xb52f('0x12'));var logger=require(_0xb52f('0x13'))(_0xb52f('0x14'));var utils=require(_0xb52f('0x15'));var config=require(_0xb52f('0x16'));var licenseUtil=require(_0xb52f('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb52f('0x18'))['dbH'];function respondWithStatusCode(_0x10d473,_0x3ac766){_0x3ac766=_0x3ac766||0xcc;return function(_0x14def7){if(_0x14def7){return _0x10d473[_0xb52f('0x19')](_0x3ac766);}return _0x10d473[_0xb52f('0x1a')](_0x3ac766)[_0xb52f('0x1b')]();};}function respondWithResult(_0x1059ab,_0x29f95a){_0x29f95a=_0x29f95a||0xc8;return function(_0x490676){if(_0x490676){return _0x1059ab['status'](_0x29f95a)[_0xb52f('0x1c')](_0x490676);}};}function respondWithFilteredResult(_0x32e6ca,_0x593ab0){return function(_0x410f79){if(_0x410f79){var _0x3c211c=typeof _0x593ab0[_0xb52f('0x1d')]===_0xb52f('0x1e')&&typeof _0x593ab0[_0xb52f('0x1f')]===_0xb52f('0x1e');var _0x5b2417=_0x410f79[_0xb52f('0x20')];var _0x5c9cb6=_0x3c211c?0x0:_0x593ab0[_0xb52f('0x1d')];var _0x41454d=_0x3c211c?_0x410f79['count']:_0x593ab0[_0xb52f('0x1d')]+_0x593ab0['limit'];var _0x2dd0c6;if(_0x41454d>=_0x5b2417){_0x41454d=_0x5b2417;_0x2dd0c6=0xc8;}else{_0x2dd0c6=0xce;}_0x32e6ca[_0xb52f('0x1a')](_0x2dd0c6);return _0x32e6ca[_0xb52f('0x21')](_0xb52f('0x22'),_0x5c9cb6+'-'+_0x41454d+'/'+_0x5b2417)[_0xb52f('0x1c')](_0x410f79);}return null;};}function patchUpdates(_0x341536){return function(_0xeaca37){try{jsonpatch[_0xb52f('0x23')](_0xeaca37,_0x341536,!![]);}catch(_0x4fccc4){return BPromise[_0xb52f('0x24')](_0x4fccc4);}return _0xeaca37[_0xb52f('0x25')]();};}function saveUpdates(_0x314919,_0x4ea31b){return function(_0x3fa3f5){if(_0x3fa3f5){return _0x3fa3f5[_0xb52f('0x26')](_0x314919)[_0xb52f('0x27')](function(_0x3d8b06){return _0x3d8b06;});}return null;};}function removeEntity(_0x36341a,_0x788d3e){return function(_0x56c318){if(_0x56c318){return _0x56c318[_0xb52f('0x28')]()[_0xb52f('0x27')](function(){var _0xadd653=_0x56c318[_0xb52f('0x29')]({'plain':!![]});var _0xbf0dd2=_0xb52f('0x2a');return db[_0xb52f('0x2b')][_0xb52f('0x28')]({'where':{'type':_0xbf0dd2,'resourceId':_0xadd653['id']}})['then'](function(){return _0x56c318;});})[_0xb52f('0x27')](function(){_0x36341a['status'](0xcc)[_0xb52f('0x1b')]();});}};}function handleEntityNotFound(_0x48e06b,_0x27596c){return function(_0x32e9e6){if(!_0x32e9e6){_0x48e06b[_0xb52f('0x19')](0x194);}return _0x32e9e6;};}function handleError(_0x5d0072,_0x3ffc97){_0x3ffc97=_0x3ffc97||0x1f4;return function(_0x5bf407){logger[_0xb52f('0x2c')](_0x5bf407['stack']);if(_0x5bf407[_0xb52f('0x2d')]){delete _0x5bf407[_0xb52f('0x2d')];}_0x5d0072[_0xb52f('0x1a')](_0x3ffc97)[_0xb52f('0x2e')](_0x5bf407);};}exports[_0xb52f('0x2f')]=function(_0x1f87aa,_0x23caf9){var _0x533354={},_0x4c7ce5={},_0x55c6a1={'count':0x0,'rows':[]};var _0x86f6a6=_['map'](db[_0xb52f('0x30')][_0xb52f('0x31')],function(_0x1f3261){return{'name':_0x1f3261[_0xb52f('0x32')],'type':_0x1f3261['type'][_0xb52f('0x33')]};});_0x4c7ce5[_0xb52f('0x34')]=_[_0xb52f('0x35')](_0x86f6a6,_0xb52f('0x2d'));_0x4c7ce5[_0xb52f('0x36')]=_[_0xb52f('0x37')](_0x1f87aa[_0xb52f('0x36')]);_0x4c7ce5[_0xb52f('0x38')]=_['intersection'](_0x4c7ce5[_0xb52f('0x34')],_0x4c7ce5[_0xb52f('0x36')]);_0x533354['attributes']=_[_0xb52f('0x39')](_0x4c7ce5[_0xb52f('0x34')],qs['fields'](_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x3a')]));_0x533354['attributes']=_0x533354[_0xb52f('0x3b')][_0xb52f('0x3c')]?_0x533354['attributes']:_0x4c7ce5[_0xb52f('0x34')];if(!_0x1f87aa[_0xb52f('0x36')]['hasOwnProperty']('nolimit')){_0x533354[_0xb52f('0x1f')]=qs[_0xb52f('0x1f')](_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x1f')]);_0x533354[_0xb52f('0x1d')]=qs['offset'](_0x1f87aa['query']['offset']);}_0x533354[_0xb52f('0x3d')]=qs[_0xb52f('0x3e')](_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x3e')]);_0x533354[_0xb52f('0x3f')]=qs[_0xb52f('0x38')](_[_0xb52f('0x40')](_0x1f87aa['query'],_0x4c7ce5[_0xb52f('0x38')]),_0x86f6a6);if(_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x41')]){_0x533354[_0xb52f('0x3f')]=_['merge'](_0x533354['where'],{'$or':_[_0xb52f('0x35')](_0x86f6a6,function(_0x558d14){if(_0x558d14[_0xb52f('0x42')]!=='VIRTUAL'){var _0x58fed3={};_0x58fed3[_0x558d14[_0xb52f('0x2d')]]={'$like':'%'+_0x1f87aa[_0xb52f('0x36')][_0xb52f('0x41')]+'%'};return _0x58fed3;}})});}_0x533354=_[_0xb52f('0x43')]({},_0x533354,_0x1f87aa[_0xb52f('0x44')]);var _0xafa15d={'where':_0x533354['where']};return db[_0xb52f('0x30')]['count'](_0xafa15d)[_0xb52f('0x27')](function(_0x5a8ce2){_0x55c6a1[_0xb52f('0x20')]=_0x5a8ce2;if(_0x1f87aa[_0xb52f('0x36')]['includeAll']){_0x533354[_0xb52f('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xb52f('0x46')](_0x533354);})[_0xb52f('0x27')](function(_0x180873){_0x55c6a1[_0xb52f('0x47')]=_0x180873;return _0x55c6a1;})['then'](respondWithFilteredResult(_0x23caf9,_0x533354))[_0xb52f('0x48')](handleError(_0x23caf9,null));};exports[_0xb52f('0x49')]=function(_0x9d4bfe,_0x531fbc){var _0x444933={'raw':![],'where':{'id':_0x9d4bfe[_0xb52f('0x4a')]['id']}},_0xda8ba5={};_0xda8ba5[_0xb52f('0x34')]=_[_0xb52f('0x37')](db[_0xb52f('0x30')][_0xb52f('0x31')]);_0xda8ba5[_0xb52f('0x36')]=_[_0xb52f('0x37')](_0x9d4bfe['query']);_0xda8ba5[_0xb52f('0x38')]=_[_0xb52f('0x39')](_0xda8ba5[_0xb52f('0x34')],_0xda8ba5[_0xb52f('0x36')]);_0x444933[_0xb52f('0x3b')]=_[_0xb52f('0x39')](_0xda8ba5[_0xb52f('0x34')],qs[_0xb52f('0x3a')](_0x9d4bfe[_0xb52f('0x36')][_0xb52f('0x3a')]));_0x444933['attributes']=_0x444933[_0xb52f('0x3b')][_0xb52f('0x3c')]?_0x444933[_0xb52f('0x3b')]:_0xda8ba5[_0xb52f('0x34')];if(_0x9d4bfe[_0xb52f('0x36')][_0xb52f('0x4b')]){_0x444933[_0xb52f('0x45')]=[{'all':!![]}];}_0x444933=_[_0xb52f('0x43')]({},_0x444933,_0x9d4bfe[_0xb52f('0x44')]);return db[_0xb52f('0x30')][_0xb52f('0x4c')](_0x444933)['then'](handleEntityNotFound(_0x531fbc,null))[_0xb52f('0x27')](respondWithResult(_0x531fbc,null))['catch'](handleError(_0x531fbc,null));};exports[_0xb52f('0x4d')]=function(_0xe8416d,_0x4b9318){return db[_0xb52f('0x30')][_0xb52f('0x4d')](_0xe8416d[_0xb52f('0x4e')],{})['then'](function(_0x2f1ffc){var _0x2953a1=_0xe8416d['user'][_0xb52f('0x29')]({'plain':!![]});if(!_0x2953a1)throw new Error(_0xb52f('0x4f'));if(_0x2953a1[_0xb52f('0x50')]==='user'){var _0x3dc54f=_0x2f1ffc['get']({'plain':!![]});var _0x2ce0f4=_0xb52f('0x51');return db['UserProfileSection'][_0xb52f('0x4c')]({'where':{'name':_0x2ce0f4,'userProfileId':_0x2953a1[_0xb52f('0x52')]},'raw':!![]})['then'](function(_0x36999c){if(_0x36999c&&_0x36999c['autoAssociation']===0x0){return db[_0xb52f('0x2b')][_0xb52f('0x4d')]({'name':_0x3dc54f['name'],'resourceId':_0x3dc54f['id'],'type':'CustomReports','sectionId':_0x36999c['id']},{})[_0xb52f('0x27')](function(){return _0x2f1ffc;});}else{return _0x2f1ffc;}})['catch'](function(_0x365a03){logger[_0xb52f('0x2c')](_0xb52f('0x53'),_0x365a03);throw _0x365a03;});}return _0x2f1ffc;})[_0xb52f('0x27')](respondWithResult(_0x4b9318,0xc9))[_0xb52f('0x48')](handleError(_0x4b9318,null));};exports['update']=function(_0x1a52f2,_0x4907e3){if(_0x1a52f2[_0xb52f('0x4e')]['id']){delete _0x1a52f2[_0xb52f('0x4e')]['id'];}return db[_0xb52f('0x30')][_0xb52f('0x4c')]({'where':{'id':_0x1a52f2[_0xb52f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4907e3,null))[_0xb52f('0x27')](saveUpdates(_0x1a52f2['body'],null))[_0xb52f('0x27')](respondWithResult(_0x4907e3,null))[_0xb52f('0x48')](handleError(_0x4907e3,null));};exports[_0xb52f('0x28')]=function(_0x8f9691,_0x16b8c2){return db[_0xb52f('0x30')]['find']({'where':{'id':_0x8f9691[_0xb52f('0x4a')]['id']}})[_0xb52f('0x27')](handleEntityNotFound(_0x16b8c2,null))['then'](removeEntity(_0x16b8c2,null))[_0xb52f('0x48')](handleError(_0x16b8c2,null));};exports[_0xb52f('0x54')]=function(_0x4871ba,_0x3aed6b){var _0x11fd6d=0xa;var _0x2b3abc=[_0xb52f('0x55'),_0xb52f('0x56'),_0xb52f('0x57'),_0xb52f('0x58')];var _0x3df563={'SUM':'SUM(%s)','COUNT':_0xb52f('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xb52f('0x5a'),'AVG':_0xb52f('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb52f('0x5c'),'GROUP_CONCAT DESC':_0xb52f('0x5d')};var _0x72d2e5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb52f('0x5e'),'HOUR':_0xb52f('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb52f('0x60')};var _0x3d6bc3=function(_0x37569d){return!_[_0xb52f('0x61')]([_0xb52f('0x62'),_0xb52f('0x63'),_0xb52f('0x64'),_0xb52f('0x65')],_0x37569d);};var _0x372fca=function(_0x32bb70){if(!_0x32bb70||!_0x32bb70[_0xb52f('0x66')][_0xb52f('0x3c')]){return'';}for(var _0x244dac='(',_0x24c5b5=0x0;_0x24c5b5<_0x32bb70[_0xb52f('0x66')]['length'];_0x24c5b5+=0x1){_0x24c5b5>0x0&&(_0x244dac+='\x20'+_0x32bb70[_0xb52f('0x67')]+'\x20');_0x244dac+=_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x68')]?_0x372fca(_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x68')]):_0x32bb70[_0xb52f('0x66')][_0x24c5b5]['field']+'\x20'+_0x32bb70['rules'][_0x24c5b5][_0xb52f('0x69')]+(_0x3d6bc3(_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x69')])?'\x20'+_0x32bb70[_0xb52f('0x66')][_0x24c5b5][_0xb52f('0x6a')]:'');}return _0x244dac+')';};var _0x5ef886={'where':{'id':_0x4871ba[_0xb52f('0x4a')]['id']}},_0x6a5c4c,_0x4ec04b,_0x4e909c,_0x306521,_0x54c971;_0x5ef886=_[_0xb52f('0x43')]({},_0x5ef886,_0x4871ba['options']);return db[_0xb52f('0x30')]['find'](_0x5ef886)[_0xb52f('0x27')](function(_0x1aaa3e){if(_0x1aaa3e){_0x6a5c4c=_0x1aaa3e;return _0x1aaa3e[_0xb52f('0x6b')]();}return null;})[_0xb52f('0x27')](function(_0x528a5b){if(_0x528a5b){if(!_0x528a5b[_0xb52f('0x3c')]){throw new db[(_0xb52f('0x6c'))]['ValidationErrorItem'](_0xb52f('0x6d'),0x193);}_0x4ec04b=_0x528a5b;return db[_0xb52f('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xb52f('0x27')](function(_0x3a725c){if(_0x3a725c){_0x4e909c=_[_0xb52f('0x6f')](_0x3a725c,'id');var _0x5f0d0f;var _0x351524=squel[_0xb52f('0x70')]();_0x351524[_0xb52f('0x71')](_0x6a5c4c[_0xb52f('0x72')]);for(var _0x4fdb60=0x0;_0x4fdb60<_0x4ec04b['length'];_0x4fdb60+=0x1){_0x5f0d0f=_0x4ec04b[_0x4fdb60][_0xb52f('0x73')]?_0x4e909c[_0x4ec04b[_0x4fdb60]['MetricId']]['metric']:_0x4ec04b[_0x4fdb60]['field'];_0x5f0d0f=_0x4ec04b[_0x4fdb60][_0xb52f('0x74')]?_[_0xb52f('0x75')](_0x3df563[_0x4ec04b[_0x4fdb60][_0xb52f('0x74')]],'%s',_0x5f0d0f):_0x5f0d0f;_0x5f0d0f=_0x4ec04b[_0x4fdb60][_0xb52f('0x76')]?_['replace'](_0x72d2e5[_0x4ec04b[_0x4fdb60][_0xb52f('0x76')]],'%s',_0x5f0d0f):_0x5f0d0f;if(_0x4ec04b[_0x4fdb60][_0xb52f('0x77')]){_0x351524[_0xb52f('0x68')](_0x5f0d0f);}_0x4ec04b[_0x4fdb60][_0xb52f('0x78')]&&_0x351524[_0xb52f('0x3d')](_0x5f0d0f,_0x4ec04b[_0x4fdb60][_0xb52f('0x78')]===_0xb52f('0x79')?![]:!![]);_0x351524[_0xb52f('0x7a')](_0x5f0d0f,_0x4ec04b[_0x4fdb60][_0xb52f('0x7b')]||_0x5f0d0f);}if(_0x6a5c4c[_0xb52f('0x7c')]){_0x6a5c4c[_0xb52f('0x7c')]=JSON[_0xb52f('0x7d')](_0x6a5c4c[_0xb52f('0x7c')]);for(var _0x417bc1=0x0;_0x417bc1<_0x6a5c4c[_0xb52f('0x7c')][_0xb52f('0x3c')];_0x417bc1+=0x1){if(_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x42')]&&_[_0xb52f('0x61')](_0x2b3abc,_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1][_0xb52f('0x42')])&&_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x7e')]&&_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1]['foreignTable']&&_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x7f')]){_0x351524[_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1][_0xb52f('0x42')]](_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1][_0xb52f('0x80')],null,util[_0xb52f('0x76')](_0xb52f('0x81'),_0x6a5c4c[_0xb52f('0x72')],_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x7e')],_0x6a5c4c['joins'][_0x417bc1][_0xb52f('0x80')],_0x6a5c4c[_0xb52f('0x7c')][_0x417bc1]['foreignKey']));}}}if(_0x6a5c4c['conditions']){_0x6a5c4c[_0xb52f('0x82')]=JSON[_0xb52f('0x7d')](_0x6a5c4c[_0xb52f('0x82')]);_0x351524[_0xb52f('0x3f')](_0x372fca(_0x6a5c4c['conditions'][_0xb52f('0x68')]));}_0x54c971=_0x351524[_0xb52f('0x83')]();_0x351524[_0xb52f('0x1f')](_0x11fd6d);_0x351524['offset'](0x0);logger[_0xb52f('0x84')]('Limited\x20Query:',_0x351524[_0xb52f('0x85')]());return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0x351524[_0xb52f('0x85')](),{'type':dbH[_0xb52f('0x86')][_0xb52f('0x87')][_0xb52f('0x88')]});}})['then'](respondWithResult(_0x3aed6b,null))['catch'](handleError(_0x3aed6b,null));};function runReport(_0x18f5d9,_0x2c2f76,_0x36bb4a){var _0x29f5ba=_0x2c2f76[_0xb52f('0x2d')];var _0x3718f2=0xa;var _0x5d9a42=['join',_0xb52f('0x56'),_0xb52f('0x57'),'cross_join'];var _0x45060c={'SUM':_0xb52f('0x89'),'COUNT':_0xb52f('0x59'),'COUNT DISTINCT':_0xb52f('0x8a'),'MAX':_0xb52f('0x8b'),'MIN':'MIN(%s)','AVG':_0xb52f('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb52f('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb60b8c={'SEC_TO_TIME':_0xb52f('0x8c'),'DATE':_0xb52f('0x5e'),'HOUR':_0xb52f('0x5f'),'ROUND':_0xb52f('0x8d'),'UNIX_TIMESTAMP':_0xb52f('0x60')};var _0x586c68=function(_0x1475e1){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb52f('0x64'),_0xb52f('0x65')],_0x1475e1);};var _0x2450a6=function(_0x132adf){if(!_0x132adf||!_0x132adf[_0xb52f('0x66')]['length']){return'';}for(var _0x1a83d2='(',_0x542930=0x0;_0x542930<_0x132adf[_0xb52f('0x66')][_0xb52f('0x3c')];_0x542930+=0x1){_0x542930>0x0&&(_0x1a83d2+='\x20'+_0x132adf['operator']+'\x20');_0x1a83d2+=_0x132adf[_0xb52f('0x66')][_0x542930]['group']?_0x2450a6(_0x132adf[_0xb52f('0x66')][_0x542930][_0xb52f('0x68')]):_0x132adf['rules'][_0x542930][_0xb52f('0x7a')]+'\x20'+_0x132adf[_0xb52f('0x66')][_0x542930][_0xb52f('0x69')]+(_0x586c68(_0x132adf[_0xb52f('0x66')][_0x542930][_0xb52f('0x69')])?'\x20'+_0x132adf[_0xb52f('0x66')][_0x542930]['value']:'');}return _0x1a83d2+')';};var _0x250866={'where':{'id':_0x18f5d9['id']}},_0x500d0a,_0x318d76,_0x45b1e3,_0xf3015e,_0xee78e2;_0x250866=_['merge']({},_0x250866,_0x36bb4a);return db['AnalyticCustomReport'][_0xb52f('0x4c')](_0x250866)[_0xb52f('0x27')](function(_0x181998){if(_0x181998){_0x500d0a=_0x181998;return _0x181998[_0xb52f('0x6b')]();}return null;})[_0xb52f('0x27')](function(_0x49233d){if(_0x49233d){if(!_0x49233d[_0xb52f('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xb52f('0x6d'),0x193);}_0x318d76=_0x49233d;return db[_0xb52f('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xb52f('0x27')](function(_0x3d89b7){if(_0x3d89b7){_0x45b1e3=_[_0xb52f('0x6f')](_0x3d89b7,'id');var _0x520163;var _0x4c0f08=squel['select']();_0x4c0f08[_0xb52f('0x71')](_0x500d0a[_0xb52f('0x72')]);for(var _0x2cb195=0x0;_0x2cb195<_0x318d76[_0xb52f('0x3c')];_0x2cb195+=0x1){_0x520163=_0x318d76[_0x2cb195][_0xb52f('0x73')]?_0x45b1e3[_0x318d76[_0x2cb195][_0xb52f('0x73')]][_0xb52f('0x8e')]:_0x318d76[_0x2cb195]['field'];_0x520163=_0x318d76[_0x2cb195][_0xb52f('0x74')]?_['replace'](_0x45060c[_0x318d76[_0x2cb195][_0xb52f('0x74')]],'%s',_0x520163):_0x520163;_0x520163=_0x318d76[_0x2cb195][_0xb52f('0x76')]?_[_0xb52f('0x75')](_0xb60b8c[_0x318d76[_0x2cb195]['format']],'%s',_0x520163):_0x520163;if(_0x318d76[_0x2cb195]['groupBy']){_0x4c0f08[_0xb52f('0x68')](_0x520163);}_0x318d76[_0x2cb195][_0xb52f('0x78')]&&_0x4c0f08[_0xb52f('0x3d')](_0x520163,_0x318d76[_0x2cb195]['orderBy']===_0xb52f('0x79')?![]:!![]);_0x4c0f08[_0xb52f('0x7a')](_0x520163,_0x318d76[_0x2cb195]['alias']||_0x520163);}if(_0x500d0a[_0xb52f('0x7c')]){_0x500d0a[_0xb52f('0x7c')]=JSON[_0xb52f('0x7d')](_0x500d0a[_0xb52f('0x7c')]);for(var _0x30b034=0x0;_0x30b034<_0x500d0a[_0xb52f('0x7c')][_0xb52f('0x3c')];_0x30b034+=0x1){if(_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x42')]&&_[_0xb52f('0x61')](_0x5d9a42,_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x42')])&&_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x7e')]&&_0x500d0a['joins'][_0x30b034][_0xb52f('0x80')]&&_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x7f')]){_0x4c0f08[_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x42')]](_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x80')],null,util[_0xb52f('0x76')](_0xb52f('0x81'),_0x500d0a['table'],_0x500d0a[_0xb52f('0x7c')][_0x30b034]['parentKey'],_0x500d0a[_0xb52f('0x7c')][_0x30b034]['foreignTable'],_0x500d0a[_0xb52f('0x7c')][_0x30b034][_0xb52f('0x7f')]));}}}if(_0x500d0a[_0xb52f('0x82')]){_0x500d0a['conditions']=JSON[_0xb52f('0x7d')](_0x500d0a['conditions']);_0x4c0f08[_0xb52f('0x3f')](_0x2450a6(_0x500d0a[_0xb52f('0x82')][_0xb52f('0x68')]));}_0xee78e2=_0x4c0f08[_0xb52f('0x83')]();_0x4c0f08[_0xb52f('0x1f')](_0x3718f2);_0x4c0f08[_0xb52f('0x1d')](0x0);return;}})[_0xb52f('0x27')](function(){if(_0x2c2f76[_0xb52f('0x8f')]==='web'){return null;}var _0x3b122f=_['merge'](_0x2c2f76,{'name':_0x2c2f76[_0xb52f('0x90')]||_0x2c2f76['name']||_0x500d0a['name'],'basename':_0x29f5ba,'savename':util[_0xb52f('0x76')](_0xb52f('0x91'),_0x2c2f76[_0xb52f('0x2d')]||_0x500d0a[_0xb52f('0x2d')],require(_0xb52f('0x92'))[_0xb52f('0x93')](0x4),_0x2c2f76[_0xb52f('0x8f')]||_0xb52f('0x94')),'reportId':_0x500d0a['id'],'reportType':_0xb52f('0x95')});return db[_0xb52f('0x96')][_0xb52f('0x4d')](_0x3b122f,{'raw':!![]});})[_0xb52f('0x27')](function(_0x469f0d){if(_0x500d0a['table']===_0xb52f('0x97')){_0xee78e2['where'](_0x500d0a[_0xb52f('0x72')]+_0xb52f('0x98'),_0x2c2f76[_0xb52f('0x99')],_0x2c2f76[_0xb52f('0x9a')]);}else{_0xee78e2[_0xb52f('0x3f')](_0x500d0a['table']+_0xb52f('0x9b'),_0x2c2f76['startDate'],_0x2c2f76[_0xb52f('0x9a')]);}if(_0x469f0d){logger[_0xb52f('0x9c')](_0xb52f('0x9d'),_0xee78e2[_0xb52f('0x85')]());require(_0xb52f('0x9e'))['fork'](path['join'](__dirname,'../../components/export/',_0x469f0d[_0xb52f('0x8f')]),[_0x469f0d['id'],_0xee78e2[_0xb52f('0x85')](),path[_0xb52f('0x55')](__dirname,_0xb52f('0x9f'),_0x469f0d[_0xb52f('0xa0')]),_0x29f5ba]);return _0x469f0d;}else{var _0x223e5c=squel[_0xb52f('0x70')]();_0x223e5c[_0xb52f('0x71')]('('+_0xee78e2[_0xb52f('0x85')]()+')',_0xb52f('0xa1'));_0x223e5c['field'](_0xb52f('0xa2'),'count');_0xee78e2[_0xb52f('0x1f')](_0x2c2f76[_0xb52f('0x1f')]||_0x3718f2);_0xee78e2['offset'](_0x2c2f76[_0xb52f('0x1d')]||0x0);return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0x223e5c[_0xb52f('0x85')](),{'type':dbH[_0xb52f('0x86')][_0xb52f('0x87')][_0xb52f('0x88')]})['then'](function(_0x5a89de){if(!_0x5a89de[_0xb52f('0x3c')]){_0xf3015e=0x0;}else{_0xf3015e=_0x5a89de[0x0][_0xb52f('0x20')]||0x0;}return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0xee78e2[_0xb52f('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xb52f('0x88')]});})[_0xb52f('0x27')](function(_0x4330bc){return{'rows':_0x4330bc||[],'count':_0xf3015e};});}});}exports[_0xb52f('0xa3')]=function(_0x1256df,_0x1c72ba){return runReport(_0x1256df['params'],_0x1256df[_0xb52f('0x36')],_0x1256df[_0xb52f('0x44')])[_0xb52f('0x27')](respondWithResult(_0x1c72ba,null))[_0xb52f('0x48')](handleError(_0x1c72ba,null));};exports[_0xb52f('0xa4')]=runReport;exports[_0xb52f('0x36')]=function(_0xe631b3,_0x342e06){var _0x129146=0xa;var _0x2f9f2c=[_0xb52f('0x55'),_0xb52f('0x56'),_0xb52f('0x57'),_0xb52f('0x58')];var _0xc159e2={'SUM':_0xb52f('0x89'),'COUNT':_0xb52f('0x59'),'COUNT DISTINCT':_0xb52f('0x8a'),'MAX':_0xb52f('0x8b'),'MIN':_0xb52f('0x5a'),'AVG':_0xb52f('0x5b'),'GROUP_CONCAT':_0xb52f('0xa5'),'GROUP_CONCAT ASC':_0xb52f('0x5c'),'GROUP_CONCAT DESC':_0xb52f('0x5d')};var _0x53313c={'SEC_TO_TIME':_0xb52f('0x8c'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb52f('0x60')};var _0x521b58=function(_0x407c22){return!_[_0xb52f('0x61')]([_0xb52f('0x62'),'IS\x20NOT\x20NULL',_0xb52f('0x64'),_0xb52f('0x65')],_0x407c22);};var _0x34e416=function(_0x2fa0f5){if(!_0x2fa0f5||!_0x2fa0f5[_0xb52f('0x66')][_0xb52f('0x3c')]){return'';}for(var _0x5058c4='(',_0x2933e7=0x0;_0x2933e7<_0x2fa0f5['rules']['length'];_0x2933e7+=0x1){_0x2933e7>0x0&&(_0x5058c4+='\x20'+_0x2fa0f5[_0xb52f('0x67')]+'\x20');_0x5058c4+=_0x2fa0f5[_0xb52f('0x66')][_0x2933e7]['group']?_0x34e416(_0x2fa0f5[_0xb52f('0x66')][_0x2933e7][_0xb52f('0x68')]):_0x2fa0f5['rules'][_0x2933e7][_0xb52f('0x7a')]+'\x20'+_0x2fa0f5[_0xb52f('0x66')][_0x2933e7][_0xb52f('0x69')]+(_0x521b58(_0x2fa0f5[_0xb52f('0x66')][_0x2933e7][_0xb52f('0x69')])?'\x20'+_0x2fa0f5['rules'][_0x2933e7][_0xb52f('0x6a')]:'');}return _0x5058c4+')';};var _0x3b61ea={'where':{'id':_0xe631b3[_0xb52f('0x4a')]['id']}},_0x1c1d13,_0x39600d,_0x2b7f56,_0x56897,_0x5930b9;_0x3b61ea=_[_0xb52f('0x43')]({},_0x3b61ea,_0xe631b3[_0xb52f('0x44')]);return db['AnalyticCustomReport'][_0xb52f('0x4c')](_0x3b61ea)[_0xb52f('0x27')](function(_0x480f4e){if(_0x480f4e){_0x1c1d13=_0x480f4e;return _0x480f4e[_0xb52f('0x6b')]();}return null;})['then'](function(_0x21b2e2){if(_0x21b2e2){if(!_0x21b2e2['length']){throw new db[(_0xb52f('0x6c'))][(_0xb52f('0xa6'))](_0xb52f('0x6d'),0x193);}_0x39600d=_0x21b2e2;return db[_0xb52f('0x6e')][_0xb52f('0x46')]({'raw':!![]});}return null;})[_0xb52f('0x27')](function(_0x25cd29){if(_0x25cd29){_0x2b7f56=_[_0xb52f('0x6f')](_0x25cd29,'id');var _0x520bda;var _0x1db6cf=squel['select']();_0x1db6cf['from'](_0x1c1d13['table']);for(var _0x3f533e=0x0;_0x3f533e<_0x39600d['length'];_0x3f533e+=0x1){_0x520bda=_0x39600d[_0x3f533e]['MetricId']?_0x2b7f56[_0x39600d[_0x3f533e][_0xb52f('0x73')]][_0xb52f('0x8e')]:_0x39600d[_0x3f533e]['field'];_0x520bda=_0x39600d[_0x3f533e]['function']?_[_0xb52f('0x75')](_0xc159e2[_0x39600d[_0x3f533e][_0xb52f('0x74')]],'%s',_0x520bda):_0x520bda;_0x520bda=_0x39600d[_0x3f533e]['format']?_[_0xb52f('0x75')](_0x53313c[_0x39600d[_0x3f533e][_0xb52f('0x76')]],'%s',_0x520bda):_0x520bda;if(_0x39600d[_0x3f533e][_0xb52f('0x77')]){_0x1db6cf[_0xb52f('0x68')](_0x520bda);}_0x39600d[_0x3f533e]['orderBy']&&_0x1db6cf[_0xb52f('0x3d')](_0x520bda,_0x39600d[_0x3f533e][_0xb52f('0x78')]===_0xb52f('0x79')?![]:!![]);_0x1db6cf[_0xb52f('0x7a')](_0x520bda,_0x39600d[_0x3f533e]['alias']||_0x520bda);}if(_0x1c1d13[_0xb52f('0x7c')]){_0x1c1d13[_0xb52f('0x7c')]=JSON[_0xb52f('0x7d')](_0x1c1d13['joins']);for(var _0x286a8c=0x0;_0x286a8c<_0x1c1d13[_0xb52f('0x7c')]['length'];_0x286a8c+=0x1){if(_0x1c1d13['joins'][_0x286a8c][_0xb52f('0x42')]&&_[_0xb52f('0x61')](_0x2f9f2c,_0x1c1d13['joins'][_0x286a8c][_0xb52f('0x42')])&&_0x1c1d13['joins'][_0x286a8c]['parentKey']&&_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x80')]&&_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x7f')]){_0x1db6cf[_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x42')]](_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x80')],null,util[_0xb52f('0x76')](_0xb52f('0x81'),_0x1c1d13[_0xb52f('0x72')],_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x7e')],_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x80')],_0x1c1d13[_0xb52f('0x7c')][_0x286a8c][_0xb52f('0x7f')]));}}}if(_0x1c1d13[_0xb52f('0x82')]){_0x1c1d13[_0xb52f('0x82')]=JSON[_0xb52f('0x7d')](_0x1c1d13['conditions']);_0x1db6cf[_0xb52f('0x3f')](_0x34e416(_0x1c1d13[_0xb52f('0x82')]['group']));}_0x5930b9=_0x1db6cf[_0xb52f('0x83')]();_0x1db6cf[_0xb52f('0x1f')](_0x129146);_0x1db6cf[_0xb52f('0x1d')](0x0);logger[_0xb52f('0x84')](_0xb52f('0xa7'),_0x1db6cf[_0xb52f('0x85')]());return dbH[_0xb52f('0x86')][_0xb52f('0x36')](_0x1db6cf[_0xb52f('0x85')](),{'type':dbH[_0xb52f('0x86')][_0xb52f('0x87')][_0xb52f('0x88')]});}})[_0xb52f('0x27')](function(){return{'sql':_0x5930b9['toString']()};})[_0xb52f('0x27')](respondWithResult(_0x342e06,null))['catch'](handleError(_0x342e06,null));};
\ No newline at end of file
+var _0xfb0e=['startDate','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','SEC_TO_TIME(%s)','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','type','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','MetricId','function','replace','format','groupBy','orderBy','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','AnalyticMetric','select','from','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','create','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb0e,0x1e8));var _0xefb0=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0xfb0e[_0x49a57c];return _0x4e0316;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefb0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefb0('0x1'));var rp=require(_0xefb0('0x2'));var moment=require(_0xefb0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xefb0('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xefb0('0x5'));var ejs=require(_0xefb0('0x6'));var fs=require('fs');var fs_extra=require(_0xefb0('0x7'));var _=require(_0xefb0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xefb0('0x5'));var querystring=require(_0xefb0('0x9'));var Papa=require(_0xefb0('0xa'));var Redis=require(_0xefb0('0xb'));var authService=require(_0xefb0('0xc'));var qs=require(_0xefb0('0xd'));var as=require(_0xefb0('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefb0('0xf'))(_0xefb0('0x10'));var utils=require(_0xefb0('0x11'));var config=require(_0xefb0('0x12'));var licenseUtil=require(_0xefb0('0x13'));var db=require(_0xefb0('0x14'))['db'];var dbH=require('../../mysqldb')[_0xefb0('0x15')];function respondWithStatusCode(_0x672f33,_0xc8f08){_0xc8f08=_0xc8f08||0xcc;return function(_0x30a511){if(_0x30a511){return _0x672f33['sendStatus'](_0xc8f08);}return _0x672f33[_0xefb0('0x16')](_0xc8f08)[_0xefb0('0x17')]();};}function respondWithResult(_0x6e0ba1,_0x2ec684){_0x2ec684=_0x2ec684||0xc8;return function(_0x4d9f93){if(_0x4d9f93){return _0x6e0ba1[_0xefb0('0x16')](_0x2ec684)[_0xefb0('0x18')](_0x4d9f93);}};}function respondWithFilteredResult(_0x13d939,_0x440abb){return function(_0x14eba8){if(_0x14eba8){var _0x43cfc1=typeof _0x440abb[_0xefb0('0x19')]==='undefined'&&typeof _0x440abb['limit']===_0xefb0('0x1a');var _0x4d40a7=_0x14eba8[_0xefb0('0x1b')];var _0x8655d=_0x43cfc1?0x0:_0x440abb[_0xefb0('0x19')];var _0x270c80=_0x43cfc1?_0x14eba8[_0xefb0('0x1b')]:_0x440abb[_0xefb0('0x19')]+_0x440abb[_0xefb0('0x1c')];var _0x114910;if(_0x270c80>=_0x4d40a7){_0x270c80=_0x4d40a7;_0x114910=0xc8;}else{_0x114910=0xce;}_0x13d939['status'](_0x114910);return _0x13d939['set'](_0xefb0('0x1d'),_0x8655d+'-'+_0x270c80+'/'+_0x4d40a7)[_0xefb0('0x18')](_0x14eba8);}return null;};}function patchUpdates(_0x3f843c){return function(_0x49d5df){try{jsonpatch[_0xefb0('0x1e')](_0x49d5df,_0x3f843c,!![]);}catch(_0x1750d1){return BPromise[_0xefb0('0x1f')](_0x1750d1);}return _0x49d5df[_0xefb0('0x20')]();};}function saveUpdates(_0x258754,_0x5aaae7){return function(_0x2145a8){if(_0x2145a8){return _0x2145a8[_0xefb0('0x21')](_0x258754)[_0xefb0('0x22')](function(_0x3ab5e1){return _0x3ab5e1;});}return null;};}function removeEntity(_0xa4960d,_0x146e71){return function(_0x1ec043){if(_0x1ec043){return _0x1ec043[_0xefb0('0x23')]()['then'](function(){var _0x3c460c=_0x1ec043[_0xefb0('0x24')]({'plain':!![]});var _0x3f291a=_0xefb0('0x25');return db[_0xefb0('0x26')][_0xefb0('0x23')]({'where':{'type':_0x3f291a,'resourceId':_0x3c460c['id']}})[_0xefb0('0x22')](function(){return _0x1ec043;});})[_0xefb0('0x22')](function(){_0xa4960d['status'](0xcc)[_0xefb0('0x17')]();});}};}function handleEntityNotFound(_0x174723,_0xa68bda){return function(_0x56a601){if(!_0x56a601){_0x174723[_0xefb0('0x27')](0x194);}return _0x56a601;};}function handleError(_0x5187cc,_0x539d05){_0x539d05=_0x539d05||0x1f4;return function(_0x5435f6){logger[_0xefb0('0x28')](_0x5435f6[_0xefb0('0x29')]);if(_0x5435f6['name']){delete _0x5435f6[_0xefb0('0x2a')];}_0x5187cc[_0xefb0('0x16')](_0x539d05)['send'](_0x5435f6);};}exports[_0xefb0('0x2b')]=function(_0x3debda,_0x7e3e50){var _0x518afe={},_0x4e887c={},_0x34ab6b={'count':0x0,'rows':[]};var _0x4b1ea1=_[_0xefb0('0x2c')](db[_0xefb0('0x2d')][_0xefb0('0x2e')],function(_0x1a1b93){return{'name':_0x1a1b93['fieldName'],'type':_0x1a1b93[_0xefb0('0x2f')]['key']};});_0x4e887c['model']=_[_0xefb0('0x2c')](_0x4b1ea1,_0xefb0('0x2a'));_0x4e887c['query']=_[_0xefb0('0x30')](_0x3debda['query']);_0x4e887c[_0xefb0('0x31')]=_[_0xefb0('0x32')](_0x4e887c[_0xefb0('0x33')],_0x4e887c['query']);_0x518afe[_0xefb0('0x34')]=_[_0xefb0('0x32')](_0x4e887c[_0xefb0('0x33')],qs['fields'](_0x3debda[_0xefb0('0x35')][_0xefb0('0x36')]));_0x518afe['attributes']=_0x518afe['attributes'][_0xefb0('0x37')]?_0x518afe[_0xefb0('0x34')]:_0x4e887c[_0xefb0('0x33')];if(!_0x3debda[_0xefb0('0x35')][_0xefb0('0x38')](_0xefb0('0x39'))){_0x518afe['limit']=qs['limit'](_0x3debda[_0xefb0('0x35')]['limit']);_0x518afe[_0xefb0('0x19')]=qs[_0xefb0('0x19')](_0x3debda[_0xefb0('0x35')]['offset']);}_0x518afe[_0xefb0('0x3a')]=qs[_0xefb0('0x3b')](_0x3debda[_0xefb0('0x35')][_0xefb0('0x3b')]);_0x518afe[_0xefb0('0x3c')]=qs[_0xefb0('0x31')](_['pick'](_0x3debda['query'],_0x4e887c[_0xefb0('0x31')]),_0x4b1ea1);if(_0x3debda[_0xefb0('0x35')][_0xefb0('0x3d')]){_0x518afe[_0xefb0('0x3c')]=_[_0xefb0('0x3e')](_0x518afe[_0xefb0('0x3c')],{'$or':_[_0xefb0('0x2c')](_0x4b1ea1,function(_0x5159c4){if(_0x5159c4[_0xefb0('0x2f')]!==_0xefb0('0x3f')){var _0x45daff={};_0x45daff[_0x5159c4[_0xefb0('0x2a')]]={'$like':'%'+_0x3debda['query']['filter']+'%'};return _0x45daff;}})});}_0x518afe=_[_0xefb0('0x3e')]({},_0x518afe,_0x3debda['options']);var _0x2fec1b={'where':_0x518afe['where']};return db['AnalyticCustomReport']['count'](_0x2fec1b)[_0xefb0('0x22')](function(_0x33f45d){_0x34ab6b[_0xefb0('0x1b')]=_0x33f45d;if(_0x3debda['query']['includeAll']){_0x518afe['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xefb0('0x40')](_0x518afe);})[_0xefb0('0x22')](function(_0x1490ca){_0x34ab6b['rows']=_0x1490ca;return _0x34ab6b;})[_0xefb0('0x22')](respondWithFilteredResult(_0x7e3e50,_0x518afe))[_0xefb0('0x41')](handleError(_0x7e3e50,null));};exports[_0xefb0('0x42')]=function(_0x275d5a,_0xd1fa96){var _0x59cdcd={'raw':![],'where':{'id':_0x275d5a[_0xefb0('0x43')]['id']}},_0x4c0c53={};_0x4c0c53[_0xefb0('0x33')]=_[_0xefb0('0x30')](db['AnalyticCustomReport'][_0xefb0('0x2e')]);_0x4c0c53['query']=_[_0xefb0('0x30')](_0x275d5a[_0xefb0('0x35')]);_0x4c0c53[_0xefb0('0x31')]=_['intersection'](_0x4c0c53[_0xefb0('0x33')],_0x4c0c53[_0xefb0('0x35')]);_0x59cdcd[_0xefb0('0x34')]=_[_0xefb0('0x32')](_0x4c0c53[_0xefb0('0x33')],qs['fields'](_0x275d5a[_0xefb0('0x35')][_0xefb0('0x36')]));_0x59cdcd['attributes']=_0x59cdcd[_0xefb0('0x34')][_0xefb0('0x37')]?_0x59cdcd[_0xefb0('0x34')]:_0x4c0c53[_0xefb0('0x33')];if(_0x275d5a[_0xefb0('0x35')][_0xefb0('0x44')]){_0x59cdcd[_0xefb0('0x45')]=[{'all':!![]}];}_0x59cdcd=_[_0xefb0('0x3e')]({},_0x59cdcd,_0x275d5a[_0xefb0('0x46')]);return db['AnalyticCustomReport'][_0xefb0('0x47')](_0x59cdcd)['then'](handleEntityNotFound(_0xd1fa96,null))[_0xefb0('0x22')](respondWithResult(_0xd1fa96,null))[_0xefb0('0x41')](handleError(_0xd1fa96,null));};exports['create']=function(_0x495183,_0x80e43a){return db['AnalyticCustomReport']['create'](_0x495183[_0xefb0('0x48')],{})[_0xefb0('0x22')](function(_0x146607){var _0x15b5f7=_0x495183[_0xefb0('0x49')][_0xefb0('0x24')]({'plain':!![]});if(!_0x15b5f7)throw new Error(_0xefb0('0x4a'));if(_0x15b5f7[_0xefb0('0x4b')]==='user'){var _0x2e0df3=_0x146607['get']({'plain':!![]});var _0x3a0558=_0xefb0('0x4c');return db[_0xefb0('0x4d')][_0xefb0('0x47')]({'where':{'name':_0x3a0558,'userProfileId':_0x15b5f7[_0xefb0('0x4e')]},'raw':!![]})[_0xefb0('0x22')](function(_0x795892){if(_0x795892&&_0x795892['autoAssociation']===0x0){return db[_0xefb0('0x26')]['create']({'name':_0x2e0df3[_0xefb0('0x2a')],'resourceId':_0x2e0df3['id'],'type':_0xefb0('0x25'),'sectionId':_0x795892['id']},{})[_0xefb0('0x22')](function(){return _0x146607;});}else{return _0x146607;}})[_0xefb0('0x41')](function(_0x4e968f){logger[_0xefb0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e968f);throw _0x4e968f;});}return _0x146607;})['then'](respondWithResult(_0x80e43a,0xc9))[_0xefb0('0x41')](handleError(_0x80e43a,null));};exports[_0xefb0('0x21')]=function(_0x23ec09,_0x4013dd){if(_0x23ec09[_0xefb0('0x48')]['id']){delete _0x23ec09[_0xefb0('0x48')]['id'];}return db[_0xefb0('0x2d')][_0xefb0('0x47')]({'where':{'id':_0x23ec09[_0xefb0('0x43')]['id']}})[_0xefb0('0x22')](handleEntityNotFound(_0x4013dd,null))[_0xefb0('0x22')](saveUpdates(_0x23ec09['body'],null))[_0xefb0('0x22')](respondWithResult(_0x4013dd,null))[_0xefb0('0x41')](handleError(_0x4013dd,null));};exports[_0xefb0('0x23')]=function(_0x299c73,_0x9f3019){return db[_0xefb0('0x2d')][_0xefb0('0x47')]({'where':{'id':_0x299c73['params']['id']}})[_0xefb0('0x22')](handleEntityNotFound(_0x9f3019,null))['then'](removeEntity(_0x9f3019,null))[_0xefb0('0x41')](handleError(_0x9f3019,null));};exports['preview']=function(_0xbea280,_0x59eb72){var _0x40f485=0xa;var _0x299195=[_0xefb0('0x4f'),_0xefb0('0x50'),_0xefb0('0x51'),_0xefb0('0x52')];var _0x5832a8={'SUM':_0xefb0('0x53'),'COUNT':_0xefb0('0x54'),'COUNT DISTINCT':_0xefb0('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xefb0('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xefb0('0x57')};var _0x4d1c66={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xefb0('0x58'),'ROUND':_0xefb0('0x59'),'UNIX_TIMESTAMP':_0xefb0('0x5a')};var _0x359a2d=function(_0x393a5e){return!_[_0xefb0('0x5b')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xefb0('0x5c')],_0x393a5e);};var _0x15188d=function(_0x431c73){if(!_0x431c73||!_0x431c73[_0xefb0('0x5d')][_0xefb0('0x37')]){return'';}for(var _0x56ab3c='(',_0x1e66f9=0x0;_0x1e66f9<_0x431c73[_0xefb0('0x5d')][_0xefb0('0x37')];_0x1e66f9+=0x1){_0x1e66f9>0x0&&(_0x56ab3c+='\x20'+_0x431c73[_0xefb0('0x5e')]+'\x20');_0x56ab3c+=_0x431c73[_0xefb0('0x5d')][_0x1e66f9][_0xefb0('0x5f')]?_0x15188d(_0x431c73['rules'][_0x1e66f9][_0xefb0('0x5f')]):_0x431c73['rules'][_0x1e66f9][_0xefb0('0x60')]+'\x20'+_0x431c73[_0xefb0('0x5d')][_0x1e66f9]['condition']+(_0x359a2d(_0x431c73[_0xefb0('0x5d')][_0x1e66f9][_0xefb0('0x61')])?'\x20'+_0x431c73[_0xefb0('0x5d')][_0x1e66f9][_0xefb0('0x62')]:'');}return _0x56ab3c+')';};var _0x10ec95={'where':{'id':_0xbea280[_0xefb0('0x43')]['id']}},_0x461a47,_0x255fb4,_0x3c7f92,_0x1d95a4,_0x459534;_0x10ec95=_[_0xefb0('0x3e')]({},_0x10ec95,_0xbea280[_0xefb0('0x46')]);return db[_0xefb0('0x2d')][_0xefb0('0x47')](_0x10ec95)['then'](function(_0x121970){if(_0x121970){_0x461a47=_0x121970;return _0x121970[_0xefb0('0x63')]();}return null;})[_0xefb0('0x22')](function(_0x190c5c){if(_0x190c5c){if(!_0x190c5c[_0xefb0('0x37')]){throw new db[(_0xefb0('0x64'))][(_0xefb0('0x65'))](_0xefb0('0x66'),0x193);}_0x255fb4=_0x190c5c;return db['AnalyticMetric'][_0xefb0('0x40')]({'raw':!![]});}return null;})['then'](function(_0xfac1b6){if(_0xfac1b6){_0x3c7f92=_[_0xefb0('0x67')](_0xfac1b6,'id');var _0x39b117;var _0x3b44f0=squel['select']();_0x3b44f0['from'](_0x461a47['table']);for(var _0x50000e=0x0;_0x50000e<_0x255fb4[_0xefb0('0x37')];_0x50000e+=0x1){_0x39b117=_0x255fb4[_0x50000e][_0xefb0('0x68')]?_0x3c7f92[_0x255fb4[_0x50000e]['MetricId']]['metric']:_0x255fb4[_0x50000e][_0xefb0('0x60')];_0x39b117=_0x255fb4[_0x50000e][_0xefb0('0x69')]?_[_0xefb0('0x6a')](_0x5832a8[_0x255fb4[_0x50000e][_0xefb0('0x69')]],'%s',_0x39b117):_0x39b117;_0x39b117=_0x255fb4[_0x50000e][_0xefb0('0x6b')]?_[_0xefb0('0x6a')](_0x4d1c66[_0x255fb4[_0x50000e]['format']],'%s',_0x39b117):_0x39b117;if(_0x255fb4[_0x50000e][_0xefb0('0x6c')]){_0x3b44f0[_0xefb0('0x5f')](_0x39b117);}_0x255fb4[_0x50000e][_0xefb0('0x6d')]&&_0x3b44f0[_0xefb0('0x3a')](_0x39b117,_0x255fb4[_0x50000e]['orderBy']==='DESC'?![]:!![]);_0x3b44f0[_0xefb0('0x60')](_0x39b117,_0x255fb4[_0x50000e]['alias']||_0x39b117);}if(_0x461a47[_0xefb0('0x6e')]){_0x461a47[_0xefb0('0x6e')]=JSON[_0xefb0('0x6f')](_0x461a47[_0xefb0('0x6e')]);for(var _0x583a25=0x0;_0x583a25<_0x461a47[_0xefb0('0x6e')][_0xefb0('0x37')];_0x583a25+=0x1){if(_0x461a47[_0xefb0('0x6e')][_0x583a25]['type']&&_[_0xefb0('0x5b')](_0x299195,_0x461a47['joins'][_0x583a25][_0xefb0('0x2f')])&&_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x70')]&&_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x71')]&&_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x72')]){_0x3b44f0[_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x2f')]](_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x71')],null,util[_0xefb0('0x6b')]('%s.%s\x20=\x20%s.%s',_0x461a47[_0xefb0('0x73')],_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x70')],_0x461a47[_0xefb0('0x6e')][_0x583a25][_0xefb0('0x71')],_0x461a47[_0xefb0('0x6e')][_0x583a25]['foreignKey']));}}}if(_0x461a47[_0xefb0('0x74')]){_0x461a47[_0xefb0('0x74')]=JSON[_0xefb0('0x6f')](_0x461a47[_0xefb0('0x74')]);_0x3b44f0[_0xefb0('0x3c')](_0x15188d(_0x461a47[_0xefb0('0x74')][_0xefb0('0x5f')]));}_0x459534=_0x3b44f0[_0xefb0('0x75')]();_0x3b44f0[_0xefb0('0x1c')](_0x40f485);_0x3b44f0[_0xefb0('0x19')](0x0);logger[_0xefb0('0x76')](_0xefb0('0x77'),_0x3b44f0[_0xefb0('0x78')]());return dbH[_0xefb0('0x79')][_0xefb0('0x35')](_0x3b44f0[_0xefb0('0x78')](),{'type':dbH['sequelize'][_0xefb0('0x7a')][_0xefb0('0x7b')]});}})[_0xefb0('0x22')](respondWithResult(_0x59eb72,null))[_0xefb0('0x41')](handleError(_0x59eb72,null));};function runReport(_0x5a4894,_0x202eda,_0x59b9ac){var _0x3b36a9=_0x202eda['name'];var _0xd04d61=0xa;var _0x4025b9=[_0xefb0('0x4f'),_0xefb0('0x50'),'right_join','cross_join'];var _0x1045d3={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xefb0('0x55'),'MAX':_0xefb0('0x7c'),'MIN':_0xefb0('0x7d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xefb0('0x7e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5c9191={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xefb0('0x7f'),'HOUR':_0xefb0('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xefb0('0x5a')};var _0xd93750=function(_0x3c9441){return!_['includes']([_0xefb0('0x80'),_0xefb0('0x81'),_0xefb0('0x82'),_0xefb0('0x5c')],_0x3c9441);};var _0x20f385=function(_0x36c5fb){if(!_0x36c5fb||!_0x36c5fb[_0xefb0('0x5d')][_0xefb0('0x37')]){return'';}for(var _0x543d3f='(',_0xcd3911=0x0;_0xcd3911<_0x36c5fb['rules'][_0xefb0('0x37')];_0xcd3911+=0x1){_0xcd3911>0x0&&(_0x543d3f+='\x20'+_0x36c5fb[_0xefb0('0x5e')]+'\x20');_0x543d3f+=_0x36c5fb[_0xefb0('0x5d')][_0xcd3911][_0xefb0('0x5f')]?_0x20f385(_0x36c5fb[_0xefb0('0x5d')][_0xcd3911][_0xefb0('0x5f')]):_0x36c5fb['rules'][_0xcd3911][_0xefb0('0x60')]+'\x20'+_0x36c5fb[_0xefb0('0x5d')][_0xcd3911][_0xefb0('0x61')]+(_0xd93750(_0x36c5fb['rules'][_0xcd3911][_0xefb0('0x61')])?'\x20'+_0x36c5fb['rules'][_0xcd3911][_0xefb0('0x62')]:'');}return _0x543d3f+')';};var _0x4c9fca={'where':{'id':_0x5a4894['id']}},_0xef57a0,_0x3869be,_0x10c13c,_0x5b9334,_0x502f18;_0x4c9fca=_[_0xefb0('0x3e')]({},_0x4c9fca,_0x59b9ac);return db[_0xefb0('0x2d')]['find'](_0x4c9fca)['then'](function(_0x37c211){if(_0x37c211){_0xef57a0=_0x37c211;return _0x37c211['getFields']();}return null;})[_0xefb0('0x22')](function(_0x40de47){if(_0x40de47){if(!_0x40de47['length']){throw new db[(_0xefb0('0x64'))][(_0xefb0('0x65'))](_0xefb0('0x66'),0x193);}_0x3869be=_0x40de47;return db[_0xefb0('0x83')][_0xefb0('0x40')]({'raw':!![]});}return null;})[_0xefb0('0x22')](function(_0x30d973){if(_0x30d973){_0x10c13c=_['keyBy'](_0x30d973,'id');var _0x25a3d0;var _0xaf967a=squel[_0xefb0('0x84')]();_0xaf967a[_0xefb0('0x85')](_0xef57a0['table']);for(var _0x5375b0=0x0;_0x5375b0<_0x3869be[_0xefb0('0x37')];_0x5375b0+=0x1){_0x25a3d0=_0x3869be[_0x5375b0][_0xefb0('0x68')]?_0x10c13c[_0x3869be[_0x5375b0][_0xefb0('0x68')]]['metric']:_0x3869be[_0x5375b0][_0xefb0('0x60')];_0x25a3d0=_0x3869be[_0x5375b0][_0xefb0('0x69')]?_[_0xefb0('0x6a')](_0x1045d3[_0x3869be[_0x5375b0][_0xefb0('0x69')]],'%s',_0x25a3d0):_0x25a3d0;_0x25a3d0=_0x3869be[_0x5375b0][_0xefb0('0x6b')]?_['replace'](_0x5c9191[_0x3869be[_0x5375b0][_0xefb0('0x6b')]],'%s',_0x25a3d0):_0x25a3d0;if(_0x3869be[_0x5375b0][_0xefb0('0x6c')]){_0xaf967a[_0xefb0('0x5f')](_0x25a3d0);}_0x3869be[_0x5375b0][_0xefb0('0x6d')]&&_0xaf967a[_0xefb0('0x3a')](_0x25a3d0,_0x3869be[_0x5375b0]['orderBy']===_0xefb0('0x86')?![]:!![]);_0xaf967a[_0xefb0('0x60')](_0x25a3d0,_0x3869be[_0x5375b0][_0xefb0('0x87')]||_0x25a3d0);}if(_0xef57a0[_0xefb0('0x6e')]){_0xef57a0[_0xefb0('0x6e')]=JSON['parse'](_0xef57a0[_0xefb0('0x6e')]);for(var _0x576eb7=0x0;_0x576eb7<_0xef57a0['joins'][_0xefb0('0x37')];_0x576eb7+=0x1){if(_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x2f')]&&_[_0xefb0('0x5b')](_0x4025b9,_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x2f')])&&_0xef57a0['joins'][_0x576eb7][_0xefb0('0x70')]&&_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x71')]&&_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x72')]){_0xaf967a[_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x2f')]](_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x71')],null,util[_0xefb0('0x6b')]('%s.%s\x20=\x20%s.%s',_0xef57a0[_0xefb0('0x73')],_0xef57a0[_0xefb0('0x6e')][_0x576eb7]['parentKey'],_0xef57a0[_0xefb0('0x6e')][_0x576eb7]['foreignTable'],_0xef57a0[_0xefb0('0x6e')][_0x576eb7][_0xefb0('0x72')]));}}}if(_0xef57a0[_0xefb0('0x74')]){_0xef57a0[_0xefb0('0x74')]=JSON[_0xefb0('0x6f')](_0xef57a0['conditions']);_0xaf967a[_0xefb0('0x3c')](_0x20f385(_0xef57a0['conditions'][_0xefb0('0x5f')]));}_0x502f18=_0xaf967a[_0xefb0('0x75')]();_0xaf967a[_0xefb0('0x1c')](_0xd04d61);_0xaf967a[_0xefb0('0x19')](0x0);return;}})[_0xefb0('0x22')](function(){if(_0x202eda[_0xefb0('0x88')]===_0xefb0('0x89')){return null;}var _0x1c8166=_[_0xefb0('0x3e')](_0x202eda,{'name':_0x202eda[_0xefb0('0x8a')]||_0x202eda['name']||_0xef57a0[_0xefb0('0x2a')],'basename':_0x3b36a9,'savename':util[_0xefb0('0x6b')](_0xefb0('0x8b'),_0x202eda[_0xefb0('0x2a')]||_0xef57a0[_0xefb0('0x2a')],require(_0xefb0('0x8c'))[_0xefb0('0x8d')](0x4),_0x202eda['output']||'csv'),'reportId':_0xef57a0['id'],'reportType':'custom'});return db[_0xefb0('0x8e')][_0xefb0('0x8f')](_0x1c8166,{'raw':!![]});})[_0xefb0('0x22')](function(_0x59e730){if(_0xef57a0['table']===_0xefb0('0x90')){_0x502f18[_0xefb0('0x3c')](_0xef57a0[_0xefb0('0x73')]+_0xefb0('0x91'),_0x202eda['startDate'],_0x202eda[_0xefb0('0x92')]);}else{_0x502f18[_0xefb0('0x3c')](_0xef57a0[_0xefb0('0x73')]+_0xefb0('0x93'),_0x202eda[_0xefb0('0x94')],_0x202eda[_0xefb0('0x92')]);}if(_0x59e730){logger['info']('Run\x20Query:',_0x502f18[_0xefb0('0x78')]());require(_0xefb0('0x95'))[_0xefb0('0x96')](path['join'](__dirname,_0xefb0('0x97'),_0x59e730[_0xefb0('0x88')]),[_0x59e730['id'],_0x502f18[_0xefb0('0x78')](),path[_0xefb0('0x4f')](__dirname,_0xefb0('0x98'),_0x59e730[_0xefb0('0x99')]),_0x3b36a9]);return _0x59e730;}else{var _0x55ddc2=squel[_0xefb0('0x84')]();_0x55ddc2[_0xefb0('0x85')]('('+_0x502f18[_0xefb0('0x78')]()+')',_0xefb0('0x9a'));_0x55ddc2[_0xefb0('0x60')](_0xefb0('0x9b'),_0xefb0('0x1b'));_0x502f18[_0xefb0('0x1c')](_0x202eda[_0xefb0('0x1c')]||_0xd04d61);_0x502f18[_0xefb0('0x19')](_0x202eda['offset']||0x0);return dbH[_0xefb0('0x79')][_0xefb0('0x35')](_0x55ddc2[_0xefb0('0x78')](),{'type':dbH[_0xefb0('0x79')]['QueryTypes'][_0xefb0('0x7b')]})[_0xefb0('0x22')](function(_0x5a1092){if(!_0x5a1092['length']){_0x5b9334=0x0;}else{_0x5b9334=_0x5a1092[0x0][_0xefb0('0x1b')]||0x0;}return dbH[_0xefb0('0x79')][_0xefb0('0x35')](_0x502f18[_0xefb0('0x78')](),{'type':dbH[_0xefb0('0x79')][_0xefb0('0x7a')][_0xefb0('0x7b')]});})[_0xefb0('0x22')](function(_0x307842){return{'rows':_0x307842||[],'count':_0x5b9334};});}});}exports[_0xefb0('0x9c')]=function(_0x1b5a83,_0x2ae20d){return runReport(_0x1b5a83['params'],_0x1b5a83[_0xefb0('0x35')],_0x1b5a83[_0xefb0('0x46')])['then'](respondWithResult(_0x2ae20d,null))[_0xefb0('0x41')](handleError(_0x2ae20d,null));};exports[_0xefb0('0x9d')]=runReport;exports[_0xefb0('0x35')]=function(_0x312e8a,_0x29be49){var _0xdb6827=0xa;var _0x5cea4f=[_0xefb0('0x4f'),_0xefb0('0x50'),_0xefb0('0x51'),_0xefb0('0x52')];var _0x159654={'SUM':'SUM(%s)','COUNT':_0xefb0('0x54'),'COUNT DISTINCT':_0xefb0('0x55'),'MAX':_0xefb0('0x7c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xefb0('0x57')};var _0x542f86={'SEC_TO_TIME':_0xefb0('0x9e'),'DATE':'DATE(%s)','HOUR':_0xefb0('0x58'),'ROUND':_0xefb0('0x59'),'UNIX_TIMESTAMP':_0xefb0('0x5a')};var _0x577de8=function(_0xd8d5fd){return!_[_0xefb0('0x5b')]([_0xefb0('0x80'),_0xefb0('0x81'),'IS\x20EMPTY',_0xefb0('0x5c')],_0xd8d5fd);};var _0x1f4f0c=function(_0x555020){if(!_0x555020||!_0x555020[_0xefb0('0x5d')][_0xefb0('0x37')]){return'';}for(var _0x5243e7='(',_0x5001f7=0x0;_0x5001f7<_0x555020[_0xefb0('0x5d')][_0xefb0('0x37')];_0x5001f7+=0x1){_0x5001f7>0x0&&(_0x5243e7+='\x20'+_0x555020[_0xefb0('0x5e')]+'\x20');_0x5243e7+=_0x555020['rules'][_0x5001f7][_0xefb0('0x5f')]?_0x1f4f0c(_0x555020[_0xefb0('0x5d')][_0x5001f7]['group']):_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x60')]+'\x20'+_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x61')]+(_0x577de8(_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x61')])?'\x20'+_0x555020[_0xefb0('0x5d')][_0x5001f7][_0xefb0('0x62')]:'');}return _0x5243e7+')';};var _0x229d1c={'where':{'id':_0x312e8a['params']['id']}},_0x390547,_0x2b4243,_0x50511f,_0x3c6f4f,_0x37e49c;_0x229d1c=_[_0xefb0('0x3e')]({},_0x229d1c,_0x312e8a[_0xefb0('0x46')]);return db[_0xefb0('0x2d')][_0xefb0('0x47')](_0x229d1c)['then'](function(_0x4488b1){if(_0x4488b1){_0x390547=_0x4488b1;return _0x4488b1[_0xefb0('0x63')]();}return null;})[_0xefb0('0x22')](function(_0x5176f4){if(_0x5176f4){if(!_0x5176f4[_0xefb0('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xefb0('0x66'),0x193);}_0x2b4243=_0x5176f4;return db[_0xefb0('0x83')]['findAll']({'raw':!![]});}return null;})[_0xefb0('0x22')](function(_0x55f485){if(_0x55f485){_0x50511f=_[_0xefb0('0x67')](_0x55f485,'id');var _0x5365db;var _0x203582=squel[_0xefb0('0x84')]();_0x203582[_0xefb0('0x85')](_0x390547['table']);for(var _0x19403d=0x0;_0x19403d<_0x2b4243[_0xefb0('0x37')];_0x19403d+=0x1){_0x5365db=_0x2b4243[_0x19403d][_0xefb0('0x68')]?_0x50511f[_0x2b4243[_0x19403d]['MetricId']]['metric']:_0x2b4243[_0x19403d]['field'];_0x5365db=_0x2b4243[_0x19403d][_0xefb0('0x69')]?_['replace'](_0x159654[_0x2b4243[_0x19403d]['function']],'%s',_0x5365db):_0x5365db;_0x5365db=_0x2b4243[_0x19403d][_0xefb0('0x6b')]?_['replace'](_0x542f86[_0x2b4243[_0x19403d][_0xefb0('0x6b')]],'%s',_0x5365db):_0x5365db;if(_0x2b4243[_0x19403d][_0xefb0('0x6c')]){_0x203582[_0xefb0('0x5f')](_0x5365db);}_0x2b4243[_0x19403d]['orderBy']&&_0x203582['order'](_0x5365db,_0x2b4243[_0x19403d][_0xefb0('0x6d')]===_0xefb0('0x86')?![]:!![]);_0x203582[_0xefb0('0x60')](_0x5365db,_0x2b4243[_0x19403d][_0xefb0('0x87')]||_0x5365db);}if(_0x390547[_0xefb0('0x6e')]){_0x390547[_0xefb0('0x6e')]=JSON[_0xefb0('0x6f')](_0x390547[_0xefb0('0x6e')]);for(var _0x4582ab=0x0;_0x4582ab<_0x390547['joins'][_0xefb0('0x37')];_0x4582ab+=0x1){if(_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x2f')]&&_['includes'](_0x5cea4f,_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x2f')])&&_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x70')]&&_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x71')]&&_0x390547['joins'][_0x4582ab][_0xefb0('0x72')]){_0x203582[_0x390547['joins'][_0x4582ab]['type']](_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x71')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x390547['table'],_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x70')],_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x71')],_0x390547[_0xefb0('0x6e')][_0x4582ab][_0xefb0('0x72')]));}}}if(_0x390547[_0xefb0('0x74')]){_0x390547['conditions']=JSON[_0xefb0('0x6f')](_0x390547['conditions']);_0x203582[_0xefb0('0x3c')](_0x1f4f0c(_0x390547['conditions']['group']));}_0x37e49c=_0x203582[_0xefb0('0x75')]();_0x203582[_0xefb0('0x1c')](_0xdb6827);_0x203582['offset'](0x0);logger['debug'](_0xefb0('0x77'),_0x203582['toString']());return dbH['sequelize']['query'](_0x203582['toString'](),{'type':dbH[_0xefb0('0x79')][_0xefb0('0x7a')][_0xefb0('0x7b')]});}})[_0xefb0('0x22')](function(){return{'sql':_0x37e49c[_0xefb0('0x78')]()};})[_0xefb0('0x22')](respondWithResult(_0x29be49,null))['catch'](handleError(_0x29be49,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index b46e76b..fbe24cc 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 _0x69dc=['analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport'];(function(_0x505d44,_0x5d1152){var _0x461166=function(_0xb0848d){while(--_0xb0848d){_0x505d44['push'](_0x505d44['shift']());}};_0x461166(++_0x5d1152);}(_0x69dc,0x1bd));var _0xc69d=function(_0x2cab80,_0x4f59d8){_0x2cab80=_0x2cab80-0x0;var _0x411205=_0x69dc[_0x2cab80];return _0x411205;};'use strict';var _=require(_0xc69d('0x0'));var util=require(_0xc69d('0x1'));var logger=require(_0xc69d('0x2'))(_0xc69d('0x3'));var moment=require('moment');var BPromise=require(_0xc69d('0x4'));var rp=require(_0xc69d('0x5'));var fs=require('fs');var path=require(_0xc69d('0x6'));var rimraf=require(_0xc69d('0x7'));var config=require(_0xc69d('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xc69d('0x9')]=function(_0x167137,_0x4f1544){return _0x167137['define'](_0xc69d('0xa'),attributes,{'tableName':_0xc69d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa092=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x33e172,_0x2b4d45){var _0x31427f=function(_0x353e2a){while(--_0x353e2a){_0x33e172['push'](_0x33e172['shift']());}};_0x31427f(++_0x2b4d45);}(_0xa092,0x1cc));var _0x2a09=function(_0x3c5cc7,_0x447374){_0x3c5cc7=_0x3c5cc7-0x0;var _0x2aef2a=_0xa092[_0x3c5cc7];return _0x2aef2a;};'use strict';var _=require(_0x2a09('0x0'));var util=require(_0x2a09('0x1'));var logger=require(_0x2a09('0x2'))(_0x2a09('0x3'));var moment=require(_0x2a09('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a09('0x5'));var fs=require('fs');var path=require(_0x2a09('0x6'));var rimraf=require(_0x2a09('0x7'));var config=require(_0x2a09('0x8'));var attributes=require(_0x2a09('0x9'));module[_0x2a09('0xa')]=function(_0x352692,_0x562c35){return _0x352692[_0x2a09('0xb')](_0x2a09('0xc'),attributes,{'tableName':_0x2a09('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index dc664fb..c97d613 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 _0xca80=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x406fbb,_0x1093e5){var _0x8e921d=function(_0x410517){while(--_0x410517){_0x406fbb['push'](_0x406fbb['shift']());}};_0x8e921d(++_0x1093e5);}(_0xca80,0xdb));var _0x0ca8=function(_0x5f133a,_0x258967){_0x5f133a=_0x5f133a-0x0;var _0x548f1f=_0xca80[_0x5f133a];return _0x548f1f;};'use strict';var _=require('lodash');var util=require(_0x0ca8('0x0'));var moment=require(_0x0ca8('0x1'));var BPromise=require(_0x0ca8('0x2'));var rs=require(_0x0ca8('0x3'));var fs=require('fs');var Redis=require(_0x0ca8('0x4'));var db=require(_0x0ca8('0x5'))['db'];var utils=require(_0x0ca8('0x6'));var logger=require(_0x0ca8('0x7'))(_0x0ca8('0x8'));var config=require('../../config/environment');var jayson=require(_0x0ca8('0x9'));var client=jayson[_0x0ca8('0xa')][_0x0ca8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x428d6b,_0x3bfdb4,_0x2e6237){return new BPromise(function(_0x1fd1e2,_0xef60bd){return client['request'](_0x428d6b,_0x2e6237)[_0x0ca8('0xc')](function(_0xb1a7d9){logger[_0x0ca8('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3bfdb4,_0x0ca8('0xe'));logger[_0x0ca8('0xf')](_0x0ca8('0x10'),_0x3bfdb4,_0x0ca8('0xe'),JSON[_0x0ca8('0x11')](_0xb1a7d9));if(_0xb1a7d9['error']){if(_0xb1a7d9[_0x0ca8('0x12')][_0x0ca8('0x13')]===0x1f4){logger['error'](_0x0ca8('0x14'),_0x3bfdb4,_0xb1a7d9['error']['message']);return _0xef60bd(_0xb1a7d9['error']['message']);}logger[_0x0ca8('0x12')](_0x0ca8('0x14'),_0x3bfdb4,_0xb1a7d9[_0x0ca8('0x12')]['message']);return _0x1fd1e2(_0xb1a7d9[_0x0ca8('0x12')][_0x0ca8('0x15')]);}else{logger[_0x0ca8('0xd')](_0x0ca8('0x14'),_0x3bfdb4,_0x0ca8('0xe'));_0x1fd1e2(_0xb1a7d9[_0x0ca8('0x16')][_0x0ca8('0x15')]);}})[_0x0ca8('0x17')](function(_0x3e8c11){logger[_0x0ca8('0x12')](_0x0ca8('0x14'),_0x3bfdb4,_0x3e8c11);_0xef60bd(_0x3e8c11);});});}
\ No newline at end of file
+var _0x0047=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x10ddc5,_0x384456){var _0x3de8fa=function(_0x3be021){while(--_0x3be021){_0x10ddc5['push'](_0x10ddc5['shift']());}};_0x3de8fa(++_0x384456);}(_0x0047,0x111));var _0x7004=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x0047[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var moment=require('moment');var BPromise=require(_0x7004('0x2'));var rs=require(_0x7004('0x3'));var fs=require('fs');var Redis=require(_0x7004('0x4'));var db=require(_0x7004('0x5'))['db'];var utils=require(_0x7004('0x6'));var logger=require('../../config/logger')(_0x7004('0x7'));var config=require(_0x7004('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7004('0x9')][_0x7004('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3aa2d9,_0x14377a,_0x4a0731){return new BPromise(function(_0x227bc6,_0x5f41cd){return client['request'](_0x3aa2d9,_0x4a0731)[_0x7004('0xb')](function(_0x4b004a){logger['info'](_0x7004('0xc'),_0x14377a,_0x7004('0xd'));logger[_0x7004('0xe')](_0x7004('0xf'),_0x14377a,_0x7004('0xd'),JSON[_0x7004('0x10')](_0x4b004a));if(_0x4b004a[_0x7004('0x11')]){if(_0x4b004a[_0x7004('0x11')]['code']===0x1f4){logger[_0x7004('0x11')](_0x7004('0xc'),_0x14377a,_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);return _0x5f41cd(_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);}logger[_0x7004('0x11')](_0x7004('0xc'),_0x14377a,_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);return _0x227bc6(_0x4b004a[_0x7004('0x11')][_0x7004('0x12')]);}else{logger[_0x7004('0x13')](_0x7004('0xc'),_0x14377a,_0x7004('0xd'));_0x227bc6(_0x4b004a[_0x7004('0x14')][_0x7004('0x12')]);}})[_0x7004('0x15')](function(_0x2d55fd){logger[_0x7004('0x11')](_0x7004('0xc'),_0x14377a,_0x2d55fd);_0x5f41cd(_0x2d55fd);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 6b221b5..82f6394 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 _0x1518=['preview','/:id/run','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','/:id','show','get','/:id/preview'];(function(_0x39abd1,_0x48aea7){var _0x4b1b6e=function(_0x2e96b2){while(--_0x2e96b2){_0x39abd1['push'](_0x39abd1['shift']());}};_0x4b1b6e(++_0x48aea7);}(_0x1518,0xef));var _0x8151=function(_0x576fd3,_0x19bfbc){_0x576fd3=_0x576fd3-0x0;var _0x3331cb=_0x1518[_0x576fd3];return _0x3331cb;};'use strict';var multer=require(_0x8151('0x0'));var util=require(_0x8151('0x1'));var path=require(_0x8151('0x2'));var timeout=require(_0x8151('0x3'));var express=require('express');var router=express[_0x8151('0x4')]();var fs_extra=require(_0x8151('0x5'));var auth=require(_0x8151('0x6'));var interaction=require(_0x8151('0x7'));var config=require('../../config/environment');var controller=require(_0x8151('0x8'));router['get']('/',auth[_0x8151('0x9')](),controller['index']);router['get'](_0x8151('0xa'),auth[_0x8151('0x9')](),controller[_0x8151('0xb')]);router[_0x8151('0xc')](_0x8151('0xd'),auth[_0x8151('0x9')](),controller[_0x8151('0xe')]);router['get'](_0x8151('0xf'),auth[_0x8151('0x9')](),controller['run']);router['get']('/:id/query',auth[_0x8151('0x9')](),controller[_0x8151('0x10')]);router[_0x8151('0x11')]('/',auth[_0x8151('0x9')](),controller['create']);router[_0x8151('0x12')](_0x8151('0xa'),auth[_0x8151('0x9')](),controller[_0x8151('0x13')]);router[_0x8151('0x14')](_0x8151('0xa'),auth[_0x8151('0x9')](),controller[_0x8151('0x15')]);module[_0x8151('0x16')]=router;
\ No newline at end of file
+var _0x5b52=['../../config/environment','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c3e1c,_0x2130a5){var _0x4e34eb=function(_0x7274c1){while(--_0x7274c1){_0x2c3e1c['push'](_0x2c3e1c['shift']());}};_0x4e34eb(++_0x2130a5);}(_0x5b52,0xa2));var _0x25b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5b52[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x25b5('0x0'));var path=require(_0x25b5('0x1'));var timeout=require('connect-timeout');var express=require(_0x25b5('0x2'));var router=express['Router']();var fs_extra=require(_0x25b5('0x3'));var auth=require(_0x25b5('0x4'));var interaction=require(_0x25b5('0x5'));var config=require(_0x25b5('0x6'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x25b5('0x7')](),controller[_0x25b5('0x8')]);router[_0x25b5('0x9')](_0x25b5('0xa'),auth[_0x25b5('0x7')](),controller['show']);router['get'](_0x25b5('0xb'),auth[_0x25b5('0x7')](),controller[_0x25b5('0xc')]);router[_0x25b5('0x9')](_0x25b5('0xd'),auth[_0x25b5('0x7')](),controller['run']);router[_0x25b5('0x9')](_0x25b5('0xe'),auth[_0x25b5('0x7')](),controller[_0x25b5('0xf')]);router[_0x25b5('0x10')]('/',auth[_0x25b5('0x7')](),controller['create']);router[_0x25b5('0x11')]('/:id',auth[_0x25b5('0x7')](),controller[_0x25b5('0x12')]);router['delete'](_0x25b5('0xa'),auth[_0x25b5('0x7')](),controller[_0x25b5('0x13')]);module[_0x25b5('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 8879923..c2af0be 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x14d584,_0x17c262){var _0x52bb57=function(_0x35ed62){while(--_0x35ed62){_0x14d584['push'](_0x14d584['shift']());}};_0x52bb57(++_0x17c262);}(_0xeda8,0x104));var _0x8eda=function(_0x1cf899,_0x3c818b){_0x1cf899=_0x1cf899-0x0;var _0x5f730f=_0xeda8[_0x1cf899];return _0x5f730f;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
+var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf858e,_0x51b0f1){_0xf858e=_0xf858e-0x0;var _0x5344d8=_0xfdbd[_0xf858e];return _0x5344d8;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 144d0bc..e45108b 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 _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x326f,0xd1));var _0xf326=function(_0xdc8987,_0x5ec847){_0xdc8987=_0xdc8987-0x0;var _0xb6891c=_0x326f[_0xdc8987];return _0xb6891c;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x43cba0,_0x5073a0){var _0x31fd30=function(_0x1fae64){while(--_0x1fae64){_0x43cba0['push'](_0x43cba0['shift']());}};_0x31fd30(++_0x5073a0);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a054827..8b65c75 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 _0xeefb=['../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','../../config/logger','api','moment','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xeefb,0x16c));var _0xbeef=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xeefb[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xbeef('0x0'));var util=require('util');var logger=require(_0xbeef('0x1'))(_0xbeef('0x2'));var moment=require(_0xbeef('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbeef('0x4'));var rimraf=require('rimraf');var config=require(_0xbeef('0x5'));var attributes=require(_0xbeef('0x6'));module[_0xbeef('0x7')]=function(_0x54cd1e,_0x3ac063){return _0x54cd1e['define']('AnalyticDefaultReport',attributes,{'tableName':_0xbeef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x83f0=['bluebird','request-promise','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x5ea242,_0x29cee7){var _0x5709ae=function(_0xc3df16){while(--_0xc3df16){_0x5ea242['push'](_0x5ea242['shift']());}};_0x5709ae(++_0x29cee7);}(_0x83f0,0xfa));var _0x083f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x83f0[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var logger=require(_0x083f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x083f('0x3'));var rp=require(_0x083f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x083f('0x5'));var attributes=require(_0x083f('0x6'));module[_0x083f('0x7')]=function(_0x4a71c9,_0x1089ae){return _0x4a71c9[_0x083f('0x8')](_0x083f('0x9'),attributes,{'tableName':_0x083f('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 3f500f6..0c63150 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 _0x8cb0=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8cb0,0xa4));var _0x08cb=function(_0x5a8d4a,_0x4b352d){_0x5a8d4a=_0x5a8d4a-0x0;var _0x4163c7=_0x8cb0[_0x5a8d4a];return _0x4163c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x08cb('0x0'));var BPromise=require(_0x08cb('0x1'));var rs=require(_0x08cb('0x2'));var fs=require('fs');var Redis=require(_0x08cb('0x3'));var db=require(_0x08cb('0x4'))['db'];var utils=require(_0x08cb('0x5'));var logger=require(_0x08cb('0x6'))(_0x08cb('0x7'));var config=require(_0x08cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x08cb('0x9')][_0x08cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bee7,_0x401c6d,_0x6cbfad){return new BPromise(function(_0x247c5a,_0x1e08ab){return client[_0x08cb('0xb')](_0x25bee7,_0x6cbfad)[_0x08cb('0xc')](function(_0x3c2035){logger[_0x08cb('0xd')](_0x08cb('0xe'),_0x401c6d,_0x08cb('0xf'));logger['debug'](_0x08cb('0x10'),_0x401c6d,_0x08cb('0xf'),JSON[_0x08cb('0x11')](_0x3c2035));if(_0x3c2035['error']){if(_0x3c2035['error'][_0x08cb('0x12')]===0x1f4){logger[_0x08cb('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x401c6d,_0x3c2035['error'][_0x08cb('0x14')]);return _0x1e08ab(_0x3c2035[_0x08cb('0x13')]['message']);}logger[_0x08cb('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x401c6d,_0x3c2035[_0x08cb('0x13')][_0x08cb('0x14')]);return _0x247c5a(_0x3c2035[_0x08cb('0x13')][_0x08cb('0x14')]);}else{logger['info'](_0x08cb('0xe'),_0x401c6d,_0x08cb('0xf'));_0x247c5a(_0x3c2035[_0x08cb('0x15')][_0x08cb('0x14')]);}})[_0x08cb('0x16')](function(_0x21b562){logger[_0x08cb('0x13')](_0x08cb('0xe'),_0x401c6d,_0x21b562);_0x1e08ab(_0x21b562);});});}
\ No newline at end of file
+var _0x35cf=['util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash'];(function(_0x47317f,_0x24ec5a){var _0x8a8794=function(_0x1a48ad){while(--_0x1a48ad){_0x47317f['push'](_0x47317f['shift']());}};_0x8a8794(++_0x24ec5a);}(_0x35cf,0x155));var _0xf35c=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x35cf[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var moment=require(_0xf35c('0x2'));var BPromise=require(_0xf35c('0x3'));var rs=require(_0xf35c('0x4'));var fs=require('fs');var Redis=require(_0xf35c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf35c('0x6'));var config=require('../../config/environment');var jayson=require(_0xf35c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bd436,_0x5c9ec6,_0xcaf151){return new BPromise(function(_0x40d1e7,_0x31b590){return client[_0xf35c('0x8')](_0x4bd436,_0xcaf151)[_0xf35c('0x9')](function(_0xa17514){logger[_0xf35c('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5c9ec6,_0xf35c('0xb'));logger[_0xf35c('0xc')](_0xf35c('0xd'),_0x5c9ec6,_0xf35c('0xb'),JSON['stringify'](_0xa17514));if(_0xa17514[_0xf35c('0xe')]){if(_0xa17514[_0xf35c('0xe')]['code']===0x1f4){logger[_0xf35c('0xe')](_0xf35c('0xf'),_0x5c9ec6,_0xa17514[_0xf35c('0xe')][_0xf35c('0x10')]);return _0x31b590(_0xa17514[_0xf35c('0xe')][_0xf35c('0x10')]);}logger[_0xf35c('0xe')](_0xf35c('0xf'),_0x5c9ec6,_0xa17514[_0xf35c('0xe')][_0xf35c('0x10')]);return _0x40d1e7(_0xa17514[_0xf35c('0xe')]['message']);}else{logger['info'](_0xf35c('0xf'),_0x5c9ec6,_0xf35c('0xb'));_0x40d1e7(_0xa17514[_0xf35c('0x11')][_0xf35c('0x10')]);}})['catch'](function(_0x48785f){logger[_0xf35c('0xe')](_0xf35c('0xf'),_0x5c9ec6,_0x48785f);_0x31b590(_0x48785f);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a196dde..0f40650 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 _0xdefa=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xdefa,0xce));var _0xadef=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdefa[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xadef('0x0'));var util=require(_0xadef('0x1'));var path=require(_0xadef('0x2'));var timeout=require('connect-timeout');var express=require(_0xadef('0x3'));var router=express[_0xadef('0x4')]();var fs_extra=require(_0xadef('0x5'));var auth=require(_0xadef('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xadef('0x7'));router[_0xadef('0x8')]('/',auth[_0xadef('0x9')](),controller[_0xadef('0xa')]);router[_0xadef('0x8')](_0xadef('0xb'),auth[_0xadef('0x9')](),controller[_0xadef('0xc')]);router['get'](_0xadef('0xd'),auth[_0xadef('0x9')](),controller[_0xadef('0xe')]);router[_0xadef('0x8')](_0xadef('0xf'),auth[_0xadef('0x9')](),controller[_0xadef('0x10')]);router['get'](_0xadef('0x11'),auth[_0xadef('0x9')](),controller[_0xadef('0x12')]);router[_0xadef('0x13')]('/',auth[_0xadef('0x9')](),controller['create']);router['put'](_0xadef('0xb'),auth[_0xadef('0x9')](),controller[_0xadef('0x14')]);router[_0xadef('0x15')]('/:id',auth[_0xadef('0x9')](),controller[_0xadef('0x16')]);module[_0xadef('0x17')]=router;
\ No newline at end of file
+var _0x2678=['update','delete','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2678,0x1bb));var _0x8267=function(_0x3743c6,_0x27d62c){_0x3743c6=_0x3743c6-0x0;var _0xafb07b=_0x2678[_0x3743c6];return _0xafb07b;};'use strict';var multer=require('multer');var util=require(_0x8267('0x0'));var path=require(_0x8267('0x1'));var timeout=require(_0x8267('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8267('0x3'));var interaction=require(_0x8267('0x4'));var config=require(_0x8267('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x8267('0x6')]('/',auth[_0x8267('0x7')](),controller[_0x8267('0x8')]);router[_0x8267('0x6')](_0x8267('0x9'),auth[_0x8267('0x7')](),controller[_0x8267('0xa')]);router[_0x8267('0x6')]('/:id/preview',auth[_0x8267('0x7')](),controller[_0x8267('0xb')]);router['get'](_0x8267('0xc'),auth[_0x8267('0x7')](),controller[_0x8267('0xd')]);router[_0x8267('0x6')](_0x8267('0xe'),auth['isAuthenticated'](),controller[_0x8267('0xf')]);router[_0x8267('0x10')]('/',auth[_0x8267('0x7')](),controller[_0x8267('0x11')]);router[_0x8267('0x12')](_0x8267('0x9'),auth[_0x8267('0x7')](),controller[_0x8267('0x13')]);router[_0x8267('0x14')](_0x8267('0x9'),auth[_0x8267('0x7')](),controller['destroy']);module[_0x8267('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 1ea8e49..cb66c3f 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 _0xaa3a=['xlsx','csv','DATE','ENUM','manual','scheduled','INTEGER','sequelize','exports','STRING','pdf'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xaa3a,0xe3));var _0xaaa3=function(_0x2b6c01,_0x4a1d39){_0x2b6c01=_0x2b6c01-0x0;var _0x4c051e=_0xaa3a[_0x2b6c01];return _0x4c051e;};'use strict';var Sequelize=require(_0xaaa3('0x0'));var moment=require('moment');module[_0xaaa3('0x1')]={'name':{'type':Sequelize[_0xaaa3('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xaaa3('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xaaa3('0x3'),_0xaaa3('0x4')),'allowNull':![],'defaultValue':_0xaaa3('0x5')},'savename':{'type':Sequelize[_0xaaa3('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xaaa3('0x6')]},'status':{'type':Sequelize[_0xaaa3('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xaaa3('0x7')](_0xaaa3('0x8'),_0xaaa3('0x9')),'allowNull':![],'defaultValue':_0xaaa3('0x8')},'reportId':{'type':Sequelize[_0xaaa3('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xaaa3('0x2')]}};
\ No newline at end of file
+var _0xa012=['xlsx','DATE','STRING','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','ENUM','csv','pdf'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0xa012,0x164));var _0x2a01=function(_0x847809,_0x51e79e){_0x847809=_0x847809-0x0;var _0x598c3f=_0xa012[_0x847809];return _0x598c3f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2a01('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2a01('0x1')](_0x2a01('0x2'),_0x2a01('0x3'),_0x2a01('0x4')),'allowNull':![],'defaultValue':_0x2a01('0x2')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x2a01('0x5')]},'endDate':{'type':Sequelize[_0x2a01('0x5')]},'status':{'type':Sequelize[_0x2a01('0x6')],'defaultValue':_0x2a01('0x7')},'type':{'type':Sequelize[_0x2a01('0x1')](_0x2a01('0x8'),_0x2a01('0x9')),'allowNull':![],'defaultValue':_0x2a01('0x8')},'reportId':{'type':Sequelize[_0x2a01('0xa')](0xb)[_0x2a01('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 683cec6..b1583d1 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 _0xbadb=['merge','options','AnalyticExtractedReport','include','findAll','rows','catch','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL'];(function(_0x261caf,_0x28a159){var _0x54d8d0=function(_0x3534b2){while(--_0x3534b2){_0x261caf['push'](_0x261caf['shift']());}};_0x54d8d0(++_0x28a159);}(_0xbadb,0x7a));var _0xbbad=function(_0x159d72,_0x2f17b5){_0x159d72=_0x159d72-0x0;var _0x499d86=_0xbadb[_0x159d72];return _0x499d86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbbad('0x0'));var jsonpatch=require(_0xbbad('0x1'));var rp=require('request-promise');var moment=require(_0xbbad('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbbad('0x3'));var util=require(_0xbbad('0x4'));var path=require(_0xbbad('0x5'));var sox=require(_0xbbad('0x6'));var csv=require(_0xbbad('0x7'));var ejs=require(_0xbbad('0x8'));var fs=require('fs');var fs_extra=require(_0xbbad('0x9'));var _=require('lodash');var squel=require(_0xbbad('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbbad('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbbad('0xc'));var Papa=require(_0xbbad('0xd'));var Redis=require(_0xbbad('0xe'));var authService=require(_0xbbad('0xf'));var qs=require(_0xbbad('0x10'));var as=require(_0xbbad('0x11'));var hardwareService=require(_0xbbad('0x12'));var logger=require('../../config/logger')(_0xbbad('0x13'));var utils=require('../../config/utils');var config=require(_0xbbad('0x14'));var licenseUtil=require(_0xbbad('0x15'));var db=require(_0xbbad('0x16'))['db'];function respondWithStatusCode(_0x1ac846,_0x2a65ed){_0x2a65ed=_0x2a65ed||0xcc;return function(_0x180821){if(_0x180821){return _0x1ac846[_0xbbad('0x17')](_0x2a65ed);}return _0x1ac846['status'](_0x2a65ed)['end']();};}function respondWithResult(_0x4ce1a2,_0x3efc20){_0x3efc20=_0x3efc20||0xc8;return function(_0x465f30){if(_0x465f30){return _0x4ce1a2['status'](_0x3efc20)['json'](_0x465f30);}};}function respondWithFilteredResult(_0xe920d5,_0x1f7759){return function(_0x1536fa){if(_0x1536fa){var _0x5a099d=typeof _0x1f7759[_0xbbad('0x18')]===_0xbbad('0x19')&&typeof _0x1f7759[_0xbbad('0x1a')]===_0xbbad('0x19');var _0x51fd3c=_0x1536fa[_0xbbad('0x1b')];var _0x35ee0b=_0x5a099d?0x0:_0x1f7759[_0xbbad('0x18')];var _0x1a6f94=_0x5a099d?_0x1536fa[_0xbbad('0x1b')]:_0x1f7759[_0xbbad('0x18')]+_0x1f7759['limit'];var _0x30978c;if(_0x1a6f94>=_0x51fd3c){_0x1a6f94=_0x51fd3c;_0x30978c=0xc8;}else{_0x30978c=0xce;}_0xe920d5[_0xbbad('0x1c')](_0x30978c);return _0xe920d5['set'](_0xbbad('0x1d'),_0x35ee0b+'-'+_0x1a6f94+'/'+_0x51fd3c)[_0xbbad('0x1e')](_0x1536fa);}return null;};}function patchUpdates(_0x30ccd6){return function(_0x14d4a0){try{jsonpatch[_0xbbad('0x1f')](_0x14d4a0,_0x30ccd6,!![]);}catch(_0x37bfcf){return BPromise[_0xbbad('0x20')](_0x37bfcf);}return _0x14d4a0[_0xbbad('0x21')]();};}function saveUpdates(_0x2c436f,_0x13adbb){return function(_0x4056c7){if(_0x4056c7){return _0x4056c7[_0xbbad('0x22')](_0x2c436f)[_0xbbad('0x23')](function(_0x30576f){return _0x30576f;});}return null;};}function removeEntity(_0x3a8bbc,_0x29eb21){return function(_0x40716f){if(_0x40716f){return _0x40716f['destroy']()[_0xbbad('0x23')](function(){var _0x1a3717=_0x40716f[_0xbbad('0x24')]({'plain':!![]});var _0x5cd3f9=_0xbbad('0x25');return db[_0xbbad('0x26')]['destroy']({'where':{'type':_0x5cd3f9,'resourceId':_0x1a3717['id']}})[_0xbbad('0x23')](function(){return _0x40716f;});})[_0xbbad('0x23')](function(){_0x3a8bbc[_0xbbad('0x1c')](0xcc)[_0xbbad('0x27')]();});}};}function handleEntityNotFound(_0x431aba,_0x1e6e6b){return function(_0x1958e4){if(!_0x1958e4){_0x431aba[_0xbbad('0x17')](0x194);}return _0x1958e4;};}function handleError(_0xf4ad71,_0xd7a501){_0xd7a501=_0xd7a501||0x1f4;return function(_0x132def){logger[_0xbbad('0x28')](_0x132def[_0xbbad('0x29')]);if(_0x132def[_0xbbad('0x2a')]){delete _0x132def[_0xbbad('0x2a')];}_0xf4ad71[_0xbbad('0x1c')](_0xd7a501)['send'](_0x132def);};}exports[_0xbbad('0x2b')]=function(_0x27db72,_0x37d187){var _0x11cbe7={},_0x1597a0={},_0x541c9f={'count':0x0,'rows':[]};var _0x2c2956=_[_0xbbad('0x2c')](db['AnalyticExtractedReport'][_0xbbad('0x2d')],function(_0x48fb00){return{'name':_0x48fb00[_0xbbad('0x2e')],'type':_0x48fb00['type'][_0xbbad('0x2f')]};});_0x1597a0['model']=_[_0xbbad('0x2c')](_0x2c2956,'name');_0x1597a0[_0xbbad('0x30')]=_['keys'](_0x27db72[_0xbbad('0x30')]);_0x1597a0[_0xbbad('0x31')]=_[_0xbbad('0x32')](_0x1597a0[_0xbbad('0x33')],_0x1597a0[_0xbbad('0x30')]);_0x11cbe7[_0xbbad('0x34')]=_['intersection'](_0x1597a0[_0xbbad('0x33')],qs['fields'](_0x27db72['query'][_0xbbad('0x35')]));_0x11cbe7[_0xbbad('0x34')]=_0x11cbe7['attributes'][_0xbbad('0x36')]?_0x11cbe7[_0xbbad('0x34')]:_0x1597a0['model'];if(!_0x27db72[_0xbbad('0x30')][_0xbbad('0x37')]('nolimit')){_0x11cbe7[_0xbbad('0x1a')]=qs['limit'](_0x27db72[_0xbbad('0x30')][_0xbbad('0x1a')]);_0x11cbe7[_0xbbad('0x18')]=qs[_0xbbad('0x18')](_0x27db72['query']['offset']);}_0x11cbe7[_0xbbad('0x38')]=qs[_0xbbad('0x39')](_0x27db72[_0xbbad('0x30')][_0xbbad('0x39')]);_0x11cbe7[_0xbbad('0x3a')]=qs['filters'](_['pick'](_0x27db72[_0xbbad('0x30')],_0x1597a0['filters']),_0x2c2956);if(_0x27db72[_0xbbad('0x30')][_0xbbad('0x3b')]){_0x11cbe7[_0xbbad('0x3a')]=_['merge'](_0x11cbe7['where'],{'$or':_['map'](_0x2c2956,function(_0x46de10){if(_0x46de10[_0xbbad('0x3c')]!==_0xbbad('0x3d')){var _0x120d39={};_0x120d39[_0x46de10[_0xbbad('0x2a')]]={'$like':'%'+_0x27db72[_0xbbad('0x30')][_0xbbad('0x3b')]+'%'};return _0x120d39;}})});}_0x11cbe7=_[_0xbbad('0x3e')]({},_0x11cbe7,_0x27db72[_0xbbad('0x3f')]);var _0x3c6670={'where':_0x11cbe7['where']};return db[_0xbbad('0x40')]['count'](_0x3c6670)[_0xbbad('0x23')](function(_0x2964aa){_0x541c9f[_0xbbad('0x1b')]=_0x2964aa;if(_0x27db72[_0xbbad('0x30')]['includeAll']){_0x11cbe7[_0xbbad('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xbbad('0x42')](_0x11cbe7);})[_0xbbad('0x23')](function(_0x521619){_0x541c9f[_0xbbad('0x43')]=_0x521619;return _0x541c9f;})[_0xbbad('0x23')](respondWithFilteredResult(_0x37d187,_0x11cbe7))[_0xbbad('0x44')](handleError(_0x37d187,null));};exports['show']=function(_0x54a8c4,_0x1a6249){var _0x185bf9={'raw':!![],'where':{'id':_0x54a8c4['params']['id']}},_0x5dfb72={};_0x5dfb72[_0xbbad('0x33')]=_[_0xbbad('0x45')](db[_0xbbad('0x40')][_0xbbad('0x2d')]);_0x5dfb72[_0xbbad('0x30')]=_['keys'](_0x54a8c4['query']);_0x5dfb72['filters']=_[_0xbbad('0x32')](_0x5dfb72[_0xbbad('0x33')],_0x5dfb72['query']);_0x185bf9[_0xbbad('0x34')]=_['intersection'](_0x5dfb72[_0xbbad('0x33')],qs[_0xbbad('0x35')](_0x54a8c4[_0xbbad('0x30')][_0xbbad('0x35')]));_0x185bf9[_0xbbad('0x34')]=_0x185bf9[_0xbbad('0x34')][_0xbbad('0x36')]?_0x185bf9[_0xbbad('0x34')]:_0x5dfb72[_0xbbad('0x33')];if(_0x54a8c4[_0xbbad('0x30')]['includeAll']){_0x185bf9[_0xbbad('0x41')]=[{'all':!![]}];}_0x185bf9=_[_0xbbad('0x3e')]({},_0x185bf9,_0x54a8c4[_0xbbad('0x3f')]);return db['AnalyticExtractedReport'][_0xbbad('0x46')](_0x185bf9)[_0xbbad('0x23')](handleEntityNotFound(_0x1a6249,null))['then'](respondWithResult(_0x1a6249,null))['catch'](handleError(_0x1a6249,null));};exports[_0xbbad('0x47')]=function(_0x2da1dc,_0x5252bc){return db[_0xbbad('0x40')]['create'](_0x2da1dc[_0xbbad('0x48')],{})[_0xbbad('0x23')](function(_0x36bf25){var _0xf7c0a1=_0x2da1dc[_0xbbad('0x49')][_0xbbad('0x24')]({'plain':!![]});if(!_0xf7c0a1)throw new Error(_0xbbad('0x4a'));if(_0xf7c0a1[_0xbbad('0x4b')]===_0xbbad('0x49')){var _0x110301=_0x36bf25[_0xbbad('0x24')]({'plain':!![]});var _0x59f015='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x59f015,'userProfileId':_0xf7c0a1[_0xbbad('0x4c')]},'raw':!![]})[_0xbbad('0x23')](function(_0x7ec275){if(_0x7ec275&&_0x7ec275[_0xbbad('0x4d')]===0x0){return db[_0xbbad('0x26')][_0xbbad('0x47')]({'name':_0x110301[_0xbbad('0x2a')],'resourceId':_0x110301['id'],'type':_0x7ec275[_0xbbad('0x2a')],'sectionId':_0x7ec275['id']},{})[_0xbbad('0x23')](function(){return _0x36bf25;});}else{return _0x36bf25;}})[_0xbbad('0x44')](function(_0x37d151){logger[_0xbbad('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37d151);throw _0x37d151;});}return _0x36bf25;})[_0xbbad('0x23')](respondWithResult(_0x5252bc,0xc9))[_0xbbad('0x44')](handleError(_0x5252bc,null));};exports[_0xbbad('0x22')]=function(_0x308542,_0x39c7f9){if(_0x308542[_0xbbad('0x48')]['id']){delete _0x308542[_0xbbad('0x48')]['id'];}return db[_0xbbad('0x40')]['find']({'where':{'id':_0x308542[_0xbbad('0x4e')]['id']}})['then'](handleEntityNotFound(_0x39c7f9,null))[_0xbbad('0x23')](saveUpdates(_0x308542['body'],null))[_0xbbad('0x23')](respondWithResult(_0x39c7f9,null))[_0xbbad('0x44')](handleError(_0x39c7f9,null));};exports['destroy']=function(_0x540922,_0x55825a){return db[_0xbbad('0x40')]['find']({'where':{'id':_0x540922[_0xbbad('0x4e')]['id']}})[_0xbbad('0x23')](handleEntityNotFound(_0x55825a,null))[_0xbbad('0x23')](removeEntity(_0x55825a,null))[_0xbbad('0x44')](handleError(_0x55825a,null));};exports[_0xbbad('0x4f')]=function(_0x43c667,_0x280340,_0x293123){return db[_0xbbad('0x40')][_0xbbad('0x46')]({'where':{'id':_0x43c667[_0xbbad('0x4e')]['id']},'attributes':[_0xbbad('0x2a'),_0xbbad('0x50'),_0xbbad('0x51'),_0xbbad('0x52')],'raw':!![]})[_0xbbad('0x23')](handleEntityNotFound(_0x280340,null))[_0xbbad('0x23')](function(_0x5c8b28){if(_0x5c8b28){if(!fs[_0xbbad('0x53')](path[_0xbbad('0x54')](config[_0xbbad('0x55')],_0xbbad('0x56'),_0x5c8b28[_0xbbad('0x51')]))){throw new db['Sequelize'][(_0xbbad('0x57'))](_0xbbad('0x58'));}if(_0x43c667[_0xbbad('0x30')][_0xbbad('0x59')]){return _0x280340['sendStatus'](0xc8);}return _0x280340[_0xbbad('0x4f')](path['join'](config[_0xbbad('0x55')],_0xbbad('0x56'),_0x5c8b28[_0xbbad('0x51')]),util[_0xbbad('0x5a')](_0xbbad('0x5b'),_0x5c8b28[_0xbbad('0x50')]||_0x5c8b28[_0xbbad('0x2a')],_0x5c8b28[_0xbbad('0x52')]['toLowerCase']()));}})[_0xbbad('0x44')](handleError(_0x280340,null));};
\ No newline at end of file
+var _0x7bcd=['sort','where','pick','filters','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','root','server/files/reports','savename','Sequelize','ValidationError','exists','join','format','%s.%s','toLowerCase','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','name','send','AnalyticExtractedReport','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit'];(function(_0x26307f,_0x28a0a4){var _0x50e950=function(_0x557639){while(--_0x557639){_0x26307f['push'](_0x26307f['shift']());}};_0x50e950(++_0x28a0a4);}(_0x7bcd,0xd8));var _0xd7bc=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x7bcd[_0x3b76f7];return _0x43984e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd7bc('0x1'));var rp=require('request-promise');var moment=require(_0xd7bc('0x2'));var BPromise=require(_0xd7bc('0x3'));var Mustache=require('mustache');var util=require(_0xd7bc('0x4'));var path=require(_0xd7bc('0x5'));var sox=require(_0xd7bc('0x6'));var csv=require(_0xd7bc('0x7'));var ejs=require(_0xd7bc('0x8'));var fs=require('fs');var fs_extra=require(_0xd7bc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd7bc('0xa'));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(_0xd7bc('0xb'));var authService=require(_0xd7bc('0xc'));var qs=require(_0xd7bc('0xd'));var as=require(_0xd7bc('0xe'));var hardwareService=require(_0xd7bc('0xf'));var logger=require(_0xd7bc('0x10'))(_0xd7bc('0x11'));var utils=require(_0xd7bc('0x12'));var config=require(_0xd7bc('0x13'));var licenseUtil=require(_0xd7bc('0x14'));var db=require(_0xd7bc('0x15'))['db'];function respondWithStatusCode(_0x65209,_0x255b22){_0x255b22=_0x255b22||0xcc;return function(_0x361a71){if(_0x361a71){return _0x65209['sendStatus'](_0x255b22);}return _0x65209['status'](_0x255b22)['end']();};}function respondWithResult(_0x369653,_0x393ee6){_0x393ee6=_0x393ee6||0xc8;return function(_0x71434a){if(_0x71434a){return _0x369653[_0xd7bc('0x16')](_0x393ee6)[_0xd7bc('0x17')](_0x71434a);}};}function respondWithFilteredResult(_0x3503ee,_0x12438d){return function(_0x27fa86){if(_0x27fa86){var _0x430f70=typeof _0x12438d[_0xd7bc('0x18')]===_0xd7bc('0x19')&&typeof _0x12438d[_0xd7bc('0x1a')]==='undefined';var _0x8de1cc=_0x27fa86['count'];var _0x28f2ca=_0x430f70?0x0:_0x12438d[_0xd7bc('0x18')];var _0x239b72=_0x430f70?_0x27fa86[_0xd7bc('0x1b')]:_0x12438d[_0xd7bc('0x18')]+_0x12438d[_0xd7bc('0x1a')];var _0x4c7b7a;if(_0x239b72>=_0x8de1cc){_0x239b72=_0x8de1cc;_0x4c7b7a=0xc8;}else{_0x4c7b7a=0xce;}_0x3503ee[_0xd7bc('0x16')](_0x4c7b7a);return _0x3503ee[_0xd7bc('0x1c')]('Content-Range',_0x28f2ca+'-'+_0x239b72+'/'+_0x8de1cc)[_0xd7bc('0x17')](_0x27fa86);}return null;};}function patchUpdates(_0x3c624a){return function(_0x262278){try{jsonpatch[_0xd7bc('0x1d')](_0x262278,_0x3c624a,!![]);}catch(_0x436985){return BPromise[_0xd7bc('0x1e')](_0x436985);}return _0x262278[_0xd7bc('0x1f')]();};}function saveUpdates(_0x5cffed,_0x4f5942){return function(_0x3a0d2d){if(_0x3a0d2d){return _0x3a0d2d[_0xd7bc('0x20')](_0x5cffed)[_0xd7bc('0x21')](function(_0x3ff5e0){return _0x3ff5e0;});}return null;};}function removeEntity(_0x26858c,_0x4440eb){return function(_0x2bc508){if(_0x2bc508){return _0x2bc508[_0xd7bc('0x22')]()[_0xd7bc('0x21')](function(){var _0x5ae931=_0x2bc508[_0xd7bc('0x23')]({'plain':!![]});var _0x44fa03=_0xd7bc('0x24');return db[_0xd7bc('0x25')]['destroy']({'where':{'type':_0x44fa03,'resourceId':_0x5ae931['id']}})[_0xd7bc('0x21')](function(){return _0x2bc508;});})[_0xd7bc('0x21')](function(){_0x26858c[_0xd7bc('0x16')](0xcc)[_0xd7bc('0x26')]();});}};}function handleEntityNotFound(_0x1909d6,_0x2585f7){return function(_0x2394fb){if(!_0x2394fb){_0x1909d6[_0xd7bc('0x27')](0x194);}return _0x2394fb;};}function handleError(_0x3d5440,_0x421795){_0x421795=_0x421795||0x1f4;return function(_0x5db73a){logger[_0xd7bc('0x28')](_0x5db73a['stack']);if(_0x5db73a[_0xd7bc('0x29')]){delete _0x5db73a['name'];}_0x3d5440[_0xd7bc('0x16')](_0x421795)[_0xd7bc('0x2a')](_0x5db73a);};}exports['index']=function(_0x4ad6f1,_0x3bed7c){var _0xe85fd={},_0x50d50f={},_0x5702a6={'count':0x0,'rows':[]};var _0x28a07f=_['map'](db[_0xd7bc('0x2b')][_0xd7bc('0x2c')],function(_0x7eab7){return{'name':_0x7eab7[_0xd7bc('0x2d')],'type':_0x7eab7['type']['key']};});_0x50d50f[_0xd7bc('0x2e')]=_['map'](_0x28a07f,_0xd7bc('0x29'));_0x50d50f[_0xd7bc('0x2f')]=_[_0xd7bc('0x30')](_0x4ad6f1['query']);_0x50d50f['filters']=_[_0xd7bc('0x31')](_0x50d50f['model'],_0x50d50f[_0xd7bc('0x2f')]);_0xe85fd[_0xd7bc('0x32')]=_[_0xd7bc('0x31')](_0x50d50f[_0xd7bc('0x2e')],qs[_0xd7bc('0x33')](_0x4ad6f1['query']['fields']));_0xe85fd['attributes']=_0xe85fd[_0xd7bc('0x32')][_0xd7bc('0x34')]?_0xe85fd[_0xd7bc('0x32')]:_0x50d50f[_0xd7bc('0x2e')];if(!_0x4ad6f1[_0xd7bc('0x2f')]['hasOwnProperty'](_0xd7bc('0x35'))){_0xe85fd[_0xd7bc('0x1a')]=qs[_0xd7bc('0x1a')](_0x4ad6f1['query'][_0xd7bc('0x1a')]);_0xe85fd[_0xd7bc('0x18')]=qs[_0xd7bc('0x18')](_0x4ad6f1['query'][_0xd7bc('0x18')]);}_0xe85fd['order']=qs['sort'](_0x4ad6f1[_0xd7bc('0x2f')][_0xd7bc('0x36')]);_0xe85fd[_0xd7bc('0x37')]=qs['filters'](_[_0xd7bc('0x38')](_0x4ad6f1[_0xd7bc('0x2f')],_0x50d50f[_0xd7bc('0x39')]),_0x28a07f);if(_0x4ad6f1['query'][_0xd7bc('0x3a')]){_0xe85fd[_0xd7bc('0x37')]=_[_0xd7bc('0x3b')](_0xe85fd[_0xd7bc('0x37')],{'$or':_[_0xd7bc('0x3c')](_0x28a07f,function(_0x414a50){if(_0x414a50['type']!==_0xd7bc('0x3d')){var _0x5819c4={};_0x5819c4[_0x414a50['name']]={'$like':'%'+_0x4ad6f1[_0xd7bc('0x2f')][_0xd7bc('0x3a')]+'%'};return _0x5819c4;}})});}_0xe85fd=_[_0xd7bc('0x3b')]({},_0xe85fd,_0x4ad6f1['options']);var _0x2ea762={'where':_0xe85fd[_0xd7bc('0x37')]};return db[_0xd7bc('0x2b')][_0xd7bc('0x1b')](_0x2ea762)[_0xd7bc('0x21')](function(_0x3d5bfb){_0x5702a6['count']=_0x3d5bfb;if(_0x4ad6f1[_0xd7bc('0x2f')][_0xd7bc('0x3e')]){_0xe85fd[_0xd7bc('0x3f')]=[{'all':!![]}];}return db[_0xd7bc('0x2b')][_0xd7bc('0x40')](_0xe85fd);})['then'](function(_0x324873){_0x5702a6[_0xd7bc('0x41')]=_0x324873;return _0x5702a6;})[_0xd7bc('0x21')](respondWithFilteredResult(_0x3bed7c,_0xe85fd))[_0xd7bc('0x42')](handleError(_0x3bed7c,null));};exports[_0xd7bc('0x43')]=function(_0x47570b,_0x1914fb){var _0x1dce8c={'raw':!![],'where':{'id':_0x47570b[_0xd7bc('0x44')]['id']}},_0x462eb2={};_0x462eb2[_0xd7bc('0x2e')]=_[_0xd7bc('0x30')](db['AnalyticExtractedReport'][_0xd7bc('0x2c')]);_0x462eb2[_0xd7bc('0x2f')]=_[_0xd7bc('0x30')](_0x47570b['query']);_0x462eb2[_0xd7bc('0x39')]=_['intersection'](_0x462eb2['model'],_0x462eb2[_0xd7bc('0x2f')]);_0x1dce8c[_0xd7bc('0x32')]=_[_0xd7bc('0x31')](_0x462eb2[_0xd7bc('0x2e')],qs[_0xd7bc('0x33')](_0x47570b['query'][_0xd7bc('0x33')]));_0x1dce8c[_0xd7bc('0x32')]=_0x1dce8c[_0xd7bc('0x32')][_0xd7bc('0x34')]?_0x1dce8c[_0xd7bc('0x32')]:_0x462eb2[_0xd7bc('0x2e')];if(_0x47570b['query'][_0xd7bc('0x3e')]){_0x1dce8c[_0xd7bc('0x3f')]=[{'all':!![]}];}_0x1dce8c=_[_0xd7bc('0x3b')]({},_0x1dce8c,_0x47570b[_0xd7bc('0x45')]);return db[_0xd7bc('0x2b')][_0xd7bc('0x46')](_0x1dce8c)[_0xd7bc('0x21')](handleEntityNotFound(_0x1914fb,null))[_0xd7bc('0x21')](respondWithResult(_0x1914fb,null))[_0xd7bc('0x42')](handleError(_0x1914fb,null));};exports['create']=function(_0x4b44a6,_0x3d6160){return db[_0xd7bc('0x2b')][_0xd7bc('0x47')](_0x4b44a6[_0xd7bc('0x48')],{})[_0xd7bc('0x21')](function(_0x58167a){var _0x5e06a1=_0x4b44a6['user'][_0xd7bc('0x23')]({'plain':!![]});if(!_0x5e06a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e06a1['role']===_0xd7bc('0x49')){var _0x5c5c82=_0x58167a[_0xd7bc('0x23')]({'plain':!![]});var _0x204e3a=_0xd7bc('0x24');return db[_0xd7bc('0x4a')][_0xd7bc('0x46')]({'where':{'name':_0x204e3a,'userProfileId':_0x5e06a1['userProfileId']},'raw':!![]})['then'](function(_0x4145fd){if(_0x4145fd&&_0x4145fd[_0xd7bc('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c5c82['name'],'resourceId':_0x5c5c82['id'],'type':_0x4145fd[_0xd7bc('0x29')],'sectionId':_0x4145fd['id']},{})[_0xd7bc('0x21')](function(){return _0x58167a;});}else{return _0x58167a;}})['catch'](function(_0x48fd4a){logger[_0xd7bc('0x28')](_0xd7bc('0x4c'),_0x48fd4a);throw _0x48fd4a;});}return _0x58167a;})[_0xd7bc('0x21')](respondWithResult(_0x3d6160,0xc9))[_0xd7bc('0x42')](handleError(_0x3d6160,null));};exports[_0xd7bc('0x20')]=function(_0x1740e2,_0x4a1931){if(_0x1740e2['body']['id']){delete _0x1740e2[_0xd7bc('0x48')]['id'];}return db['AnalyticExtractedReport'][_0xd7bc('0x46')]({'where':{'id':_0x1740e2[_0xd7bc('0x44')]['id']}})[_0xd7bc('0x21')](handleEntityNotFound(_0x4a1931,null))[_0xd7bc('0x21')](saveUpdates(_0x1740e2[_0xd7bc('0x48')],null))[_0xd7bc('0x21')](respondWithResult(_0x4a1931,null))[_0xd7bc('0x42')](handleError(_0x4a1931,null));};exports[_0xd7bc('0x22')]=function(_0x5f07a4,_0x30b921){return db[_0xd7bc('0x2b')][_0xd7bc('0x46')]({'where':{'id':_0x5f07a4['params']['id']}})[_0xd7bc('0x21')](handleEntityNotFound(_0x30b921,null))[_0xd7bc('0x21')](removeEntity(_0x30b921,null))[_0xd7bc('0x42')](handleError(_0x30b921,null));};exports[_0xd7bc('0x4d')]=function(_0xb5c89e,_0x52afae,_0x373bb5){return db[_0xd7bc('0x2b')][_0xd7bc('0x46')]({'where':{'id':_0xb5c89e[_0xd7bc('0x44')]['id']},'attributes':[_0xd7bc('0x29'),_0xd7bc('0x4e'),'savename',_0xd7bc('0x4f')],'raw':!![]})[_0xd7bc('0x21')](handleEntityNotFound(_0x52afae,null))[_0xd7bc('0x21')](function(_0x59f4e4){if(_0x59f4e4){if(!fs['existsSync'](path['join'](config[_0xd7bc('0x50')],_0xd7bc('0x51'),_0x59f4e4[_0xd7bc('0x52')]))){throw new db[(_0xd7bc('0x53'))][(_0xd7bc('0x54'))]('Report\x20not\x20found\x20or\x20empty');}if(_0xb5c89e['query'][_0xd7bc('0x55')]){return _0x52afae[_0xd7bc('0x27')](0xc8);}return _0x52afae['download'](path[_0xd7bc('0x56')](config['root'],_0xd7bc('0x51'),_0x59f4e4[_0xd7bc('0x52')]),util[_0xd7bc('0x57')](_0xd7bc('0x58'),_0x59f4e4['basename']||_0x59f4e4[_0xd7bc('0x29')],_0x59f4e4['output'][_0xd7bc('0x59')]()));}})[_0xd7bc('0x42')](handleError(_0x52afae,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 4ecedc0..44a70e1 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 _0xc04d=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1315cb,_0x14ed5f){var _0x30f6df=function(_0x16d9fa){while(--_0x16d9fa){_0x1315cb['push'](_0x1315cb['shift']());}};_0x30f6df(++_0x14ed5f);}(_0xc04d,0x1d1));var _0xdc04=function(_0x4a4d88,_0x2be95a){_0x4a4d88=_0x4a4d88-0x0;var _0x479329=_0xc04d[_0x4a4d88];return _0x479329;};'use strict';var _=require(_0xdc04('0x0'));var util=require('util');var logger=require(_0xdc04('0x1'))(_0xdc04('0x2'));var moment=require('moment');var BPromise=require(_0xdc04('0x3'));var rp=require(_0xdc04('0x4'));var fs=require('fs');var path=require(_0xdc04('0x5'));var rimraf=require(_0xdc04('0x6'));var config=require(_0xdc04('0x7'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x6401b8,_0x3cd840){return _0x6401b8[_0xdc04('0x8')](_0xdc04('0x9'),attributes,{'tableName':_0xdc04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e89=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x489646,_0x2fed71){var _0x45de80=function(_0x15b10e){while(--_0x15b10e){_0x489646['push'](_0x489646['shift']());}};_0x45de80(++_0x2fed71);}(_0x5e89,0xc8));var _0x95e8=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5e89[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x95e8('0x0'));var util=require(_0x95e8('0x1'));var logger=require(_0x95e8('0x2'))(_0x95e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x95e8('0x4'));var fs=require('fs');var path=require(_0x95e8('0x5'));var rimraf=require(_0x95e8('0x6'));var config=require('../../config/environment');var attributes=require(_0x95e8('0x7'));module['exports']=function(_0x577578,_0x1930a6){return _0x577578[_0x95e8('0x8')](_0x95e8('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 76637e7..cda3074 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 _0xbfba=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug'];(function(_0x82e71a,_0x2f5f68){var _0x34a5d4=function(_0x5eaec6){while(--_0x5eaec6){_0x82e71a['push'](_0x82e71a['shift']());}};_0x34a5d4(++_0x2f5f68);}(_0xbfba,0x1ac));var _0xabfb=function(_0x5ee08e,_0x19127){_0x5ee08e=_0x5ee08e-0x0;var _0x12ce20=_0xbfba[_0x5ee08e];return _0x12ce20;};'use strict';var _=require(_0xabfb('0x0'));var util=require(_0xabfb('0x1'));var moment=require(_0xabfb('0x2'));var BPromise=require(_0xabfb('0x3'));var rs=require(_0xabfb('0x4'));var fs=require('fs');var Redis=require(_0xabfb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xabfb('0x6'));var logger=require('../../config/logger')(_0xabfb('0x7'));var config=require(_0xabfb('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aed1e,_0x1f992a,_0x3af781){return new BPromise(function(_0x1d5320,_0x3e2904){return client[_0xabfb('0x9')](_0x5aed1e,_0x3af781)['then'](function(_0x42d549){logger[_0xabfb('0xa')](_0xabfb('0xb'),_0x1f992a,'request\x20sent');logger[_0xabfb('0xc')](_0xabfb('0xd'),_0x1f992a,_0xabfb('0xe'),JSON[_0xabfb('0xf')](_0x42d549));if(_0x42d549['error']){if(_0x42d549[_0xabfb('0x10')][_0xabfb('0x11')]===0x1f4){logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);return _0x3e2904(_0x42d549[_0xabfb('0x10')]['message']);}logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549['error'][_0xabfb('0x12')]);return _0x1d5320(_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);}else{logger['info'](_0xabfb('0xb'),_0x1f992a,_0xabfb('0xe'));_0x1d5320(_0x42d549[_0xabfb('0x13')][_0xabfb('0x12')]);}})[_0xabfb('0x14')](function(_0x327708){logger[_0xabfb('0x10')](_0xabfb('0xb'),_0x1f992a,_0x327708);_0x3e2904(_0x327708);});});}
\ No newline at end of file
+var _0xf969=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0xf969,0x1ca));var _0x9f96=function(_0x4defd4,_0x368412){_0x4defd4=_0x4defd4-0x0;var _0x1cbe41=_0xf969[_0x4defd4];return _0x1cbe41;};'use strict';var _=require(_0x9f96('0x0'));var util=require('util');var moment=require(_0x9f96('0x1'));var BPromise=require(_0x9f96('0x2'));var rs=require(_0x9f96('0x3'));var fs=require('fs');var Redis=require(_0x9f96('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f96('0x5'));var logger=require(_0x9f96('0x6'))('rpc');var config=require(_0x9f96('0x7'));var jayson=require(_0x9f96('0x8'));var client=jayson['client'][_0x9f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8b6f,_0x107a92,_0x4a410b){return new BPromise(function(_0x35ea7a,_0x377c6e){return client[_0x9f96('0xa')](_0x1d8b6f,_0x4a410b)[_0x9f96('0xb')](function(_0x5f5ce){logger[_0x9f96('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x107a92,_0x9f96('0xd'));logger[_0x9f96('0xe')](_0x9f96('0xf'),_0x107a92,_0x9f96('0xd'),JSON[_0x9f96('0x10')](_0x5f5ce));if(_0x5f5ce[_0x9f96('0x11')]){if(_0x5f5ce[_0x9f96('0x11')][_0x9f96('0x12')]===0x1f4){logger[_0x9f96('0x11')](_0x9f96('0x13'),_0x107a92,_0x5f5ce['error']['message']);return _0x377c6e(_0x5f5ce[_0x9f96('0x11')][_0x9f96('0x14')]);}logger[_0x9f96('0x11')](_0x9f96('0x13'),_0x107a92,_0x5f5ce[_0x9f96('0x11')]['message']);return _0x35ea7a(_0x5f5ce[_0x9f96('0x11')]['message']);}else{logger[_0x9f96('0xc')](_0x9f96('0x13'),_0x107a92,_0x9f96('0xd'));_0x35ea7a(_0x5f5ce[_0x9f96('0x15')]['message']);}})[_0x9f96('0x16')](function(_0x2b34f0){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x107a92,_0x2b34f0);_0x377c6e(_0x2b34f0);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a209ec7..e2b4317 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 _0x14f2=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create'];(function(_0xa38a2f,_0x3c15a8){var _0x5cf5b3=function(_0x2064ca){while(--_0x2064ca){_0xa38a2f['push'](_0xa38a2f['shift']());}};_0x5cf5b3(++_0x3c15a8);}(_0x14f2,0x130));var _0x214f=function(_0x53e6ca,_0x579281){_0x53e6ca=_0x53e6ca-0x0;var _0x53bb15=_0x14f2[_0x53e6ca];return _0x53bb15;};'use strict';var multer=require('multer');var util=require(_0x214f('0x0'));var path=require(_0x214f('0x1'));var timeout=require(_0x214f('0x2'));var express=require(_0x214f('0x3'));var router=express[_0x214f('0x4')]();var fs_extra=require(_0x214f('0x5'));var auth=require(_0x214f('0x6'));var interaction=require(_0x214f('0x7'));var config=require('../../config/environment');var controller=require(_0x214f('0x8'));router[_0x214f('0x9')]('/',auth[_0x214f('0xa')](),controller[_0x214f('0xb')]);router['get'](_0x214f('0xc'),auth[_0x214f('0xa')](),controller[_0x214f('0xd')]);router['get'](_0x214f('0xe'),auth[_0x214f('0xa')](),controller[_0x214f('0xf')]);router[_0x214f('0x10')]('/',auth[_0x214f('0xa')](),controller[_0x214f('0x11')]);router[_0x214f('0x12')](_0x214f('0xc'),auth[_0x214f('0xa')](),controller[_0x214f('0x13')]);router[_0x214f('0x14')]('/:id',auth[_0x214f('0xa')](),controller[_0x214f('0x15')]);module[_0x214f('0x16')]=router;
\ No newline at end of file
+var _0xbf06=['download','post','create','put','update','delete','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','show','/:id/download','isAuthenticated'];(function(_0x4e0cc9,_0x1149ef){var _0x1925ee=function(_0x2173cb){while(--_0x2173cb){_0x4e0cc9['push'](_0x4e0cc9['shift']());}};_0x1925ee(++_0x1149ef);}(_0xbf06,0x9f));var _0x6bf0=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xbf06[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x6bf0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6bf0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6bf0('0x2'));var auth=require(_0x6bf0('0x3'));var interaction=require(_0x6bf0('0x4'));var config=require(_0x6bf0('0x5'));var controller=require(_0x6bf0('0x6'));router[_0x6bf0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6bf0('0x8'),auth['isAuthenticated'](),controller[_0x6bf0('0x9')]);router[_0x6bf0('0x7')](_0x6bf0('0xa'),auth[_0x6bf0('0xb')](),controller[_0x6bf0('0xc')]);router[_0x6bf0('0xd')]('/',auth[_0x6bf0('0xb')](),controller[_0x6bf0('0xe')]);router[_0x6bf0('0xf')](_0x6bf0('0x8'),auth['isAuthenticated'](),controller[_0x6bf0('0x10')]);router[_0x6bf0('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6bf0('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 2f7e9ff..19d1458 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 _0x8b5c=['STRING','BOOLEAN','exports','TEXT'];(function(_0x3f7b63,_0x570f89){var _0x42f648=function(_0x50b5d1){while(--_0x50b5d1){_0x3f7b63['push'](_0x3f7b63['shift']());}};_0x42f648(++_0x570f89);}(_0x8b5c,0xde));var _0xc8b5=function(_0x5347c8,_0x55f10b){_0x5347c8=_0x5347c8-0x0;var _0x5440c2=_0x8b5c[_0x5347c8];return _0x5440c2;};'use strict';var Sequelize=require('sequelize');module[_0xc8b5('0x0')]={'field':{'type':Sequelize[_0xc8b5('0x1')]},'alias':{'type':Sequelize[_0xc8b5('0x2')]},'function':{'type':Sequelize[_0xc8b5('0x2')]},'format':{'type':Sequelize[_0xc8b5('0x2')]},'groupBy':{'type':Sequelize[_0xc8b5('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc8b5('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xafbd=['STRING','BOOLEAN','exports'];(function(_0x589743,_0x604ac1){var _0x41ac38=function(_0x539303){while(--_0x539303){_0x589743['push'](_0x589743['shift']());}};_0x41ac38(++_0x604ac1);}(_0xafbd,0x9e));var _0xdafb=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xafbd[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require('sequelize');module[_0xdafb('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdafb('0x1')]},'function':{'type':Sequelize[_0xdafb('0x1')]},'format':{'type':Sequelize[_0xdafb('0x1')]},'groupBy':{'type':Sequelize[_0xdafb('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdafb('0x1')]},'custom':{'type':Sequelize[_0xdafb('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 2b9032c..8a44fc1 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 _0xd433=['include','find','create','body','bulkCreate','params','addFields','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','count','includeAll','findAll','catch','AnalyticFieldReport'];(function(_0x56058a,_0x1bf6bb){var _0x43eb1b=function(_0x571532){while(--_0x571532){_0x56058a['push'](_0x56058a['shift']());}};_0x43eb1b(++_0x1bf6bb);}(_0xd433,0xf7));var _0x3d43=function(_0x18978a,_0x230acf){_0x18978a=_0x18978a-0x0;var _0x3dc130=_0xd433[_0x18978a];return _0x3dc130;};'use strict';var emlformat=require(_0x3d43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d43('0x1'));var jsonpatch=require(_0x3d43('0x2'));var rp=require(_0x3d43('0x3'));var moment=require(_0x3d43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d43('0x5'));var util=require(_0x3d43('0x6'));var path=require(_0x3d43('0x7'));var sox=require(_0x3d43('0x8'));var csv=require(_0x3d43('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d43('0xa'));var squel=require('squel');var crypto=require(_0x3d43('0xb'));var jsforce=require(_0x3d43('0xc'));var deskjs=require(_0x3d43('0xd'));var toCsv=require(_0x3d43('0x9'));var querystring=require(_0x3d43('0xe'));var Papa=require(_0x3d43('0xf'));var Redis=require(_0x3d43('0x10'));var authService=require(_0x3d43('0x11'));var qs=require(_0x3d43('0x12'));var as=require(_0x3d43('0x13'));var hardwareService=require(_0x3d43('0x14'));var logger=require(_0x3d43('0x15'))('api');var utils=require(_0x3d43('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3d43('0x17'))['db'];function respondWithStatusCode(_0x56510f,_0x49bf5b){_0x49bf5b=_0x49bf5b||0xcc;return function(_0x257a66){if(_0x257a66){return _0x56510f['sendStatus'](_0x49bf5b);}return _0x56510f[_0x3d43('0x18')](_0x49bf5b)[_0x3d43('0x19')]();};}function respondWithResult(_0x1665fc,_0x33f05f){_0x33f05f=_0x33f05f||0xc8;return function(_0x2e774d){if(_0x2e774d){return _0x1665fc[_0x3d43('0x18')](_0x33f05f)[_0x3d43('0x1a')](_0x2e774d);}};}function respondWithFilteredResult(_0x440094,_0x114663){return function(_0x2921c2){if(_0x2921c2){var _0x517d0a=typeof _0x114663[_0x3d43('0x1b')]==='undefined'&&typeof _0x114663[_0x3d43('0x1c')]===_0x3d43('0x1d');var _0x17d349=_0x2921c2['count'];var _0x4fd3ac=_0x517d0a?0x0:_0x114663[_0x3d43('0x1b')];var _0x1bddb7=_0x517d0a?_0x2921c2['count']:_0x114663[_0x3d43('0x1b')]+_0x114663[_0x3d43('0x1c')];var _0x15d6f9;if(_0x1bddb7>=_0x17d349){_0x1bddb7=_0x17d349;_0x15d6f9=0xc8;}else{_0x15d6f9=0xce;}_0x440094[_0x3d43('0x18')](_0x15d6f9);return _0x440094[_0x3d43('0x1e')]('Content-Range',_0x4fd3ac+'-'+_0x1bddb7+'/'+_0x17d349)[_0x3d43('0x1a')](_0x2921c2);}return null;};}function patchUpdates(_0x261b23){return function(_0x2622a6){try{jsonpatch[_0x3d43('0x1f')](_0x2622a6,_0x261b23,!![]);}catch(_0x24004e){return BPromise[_0x3d43('0x20')](_0x24004e);}return _0x2622a6[_0x3d43('0x21')]();};}function saveUpdates(_0x50c27b,_0x5af74d){return function(_0x28f8f8){if(_0x28f8f8){return _0x28f8f8[_0x3d43('0x22')](_0x50c27b)[_0x3d43('0x23')](function(_0x4767e9){return _0x4767e9;});}return null;};}function removeEntity(_0x5b5a7c,_0x485419){return function(_0x2f15d7){if(_0x2f15d7){return _0x2f15d7[_0x3d43('0x24')]()[_0x3d43('0x23')](function(){_0x5b5a7c['status'](0xcc)[_0x3d43('0x19')]();});}};}function handleEntityNotFound(_0x4c79a9,_0x1d5be7){return function(_0x438399){if(!_0x438399){_0x4c79a9[_0x3d43('0x25')](0x194);}return _0x438399;};}function handleError(_0x1084ad,_0x7d672){_0x7d672=_0x7d672||0x1f4;return function(_0x5a8f77){logger[_0x3d43('0x26')](_0x5a8f77[_0x3d43('0x27')]);if(_0x5a8f77[_0x3d43('0x28')]){delete _0x5a8f77[_0x3d43('0x28')];}_0x1084ad['status'](_0x7d672)[_0x3d43('0x29')](_0x5a8f77);};}exports[_0x3d43('0x2a')]=function(_0x44bea7,_0x43e223){var _0xde0f62={},_0x47852b={},_0x9fb5ff={'count':0x0,'rows':[]};var _0x5e11ea=_[_0x3d43('0x2b')](db['AnalyticFieldReport'][_0x3d43('0x2c')],function(_0x55be06){return{'name':_0x55be06[_0x3d43('0x2d')],'type':_0x55be06['type'][_0x3d43('0x2e')]};});_0x47852b[_0x3d43('0x2f')]=_[_0x3d43('0x2b')](_0x5e11ea,_0x3d43('0x28'));_0x47852b['query']=_[_0x3d43('0x30')](_0x44bea7[_0x3d43('0x31')]);_0x47852b['filters']=_['intersection'](_0x47852b['model'],_0x47852b['query']);_0xde0f62['attributes']=_[_0x3d43('0x32')](_0x47852b[_0x3d43('0x2f')],qs[_0x3d43('0x33')](_0x44bea7[_0x3d43('0x31')]['fields']));_0xde0f62['attributes']=_0xde0f62[_0x3d43('0x34')][_0x3d43('0x35')]?_0xde0f62[_0x3d43('0x34')]:_0x47852b[_0x3d43('0x2f')];if(!_0x44bea7[_0x3d43('0x31')][_0x3d43('0x36')](_0x3d43('0x37'))){_0xde0f62[_0x3d43('0x1c')]=qs[_0x3d43('0x1c')](_0x44bea7['query'][_0x3d43('0x1c')]);_0xde0f62[_0x3d43('0x1b')]=qs['offset'](_0x44bea7['query'][_0x3d43('0x1b')]);}_0xde0f62[_0x3d43('0x38')]=qs[_0x3d43('0x39')](_0x44bea7[_0x3d43('0x31')][_0x3d43('0x39')]);_0xde0f62[_0x3d43('0x3a')]=qs[_0x3d43('0x3b')](_[_0x3d43('0x3c')](_0x44bea7['query'],_0x47852b[_0x3d43('0x3b')]),_0x5e11ea);if(_0x44bea7[_0x3d43('0x31')][_0x3d43('0x3d')]){_0xde0f62['where']=_['merge'](_0xde0f62['where'],{'$or':_[_0x3d43('0x2b')](_0x5e11ea,function(_0x5f4774){if(_0x5f4774[_0x3d43('0x3e')]!==_0x3d43('0x3f')){var _0x10783d={};_0x10783d[_0x5f4774[_0x3d43('0x28')]]={'$like':'%'+_0x44bea7[_0x3d43('0x31')]['filter']+'%'};return _0x10783d;}})});}_0xde0f62=_['merge']({},_0xde0f62,_0x44bea7['options']);var _0x9ed10b={'where':_0xde0f62[_0x3d43('0x3a')]};return db['AnalyticFieldReport'][_0x3d43('0x40')](_0x9ed10b)[_0x3d43('0x23')](function(_0x40b2b1){_0x9fb5ff['count']=_0x40b2b1;if(_0x44bea7[_0x3d43('0x31')][_0x3d43('0x41')]){_0xde0f62['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3d43('0x42')](_0xde0f62);})['then'](function(_0x29018b){_0x9fb5ff['rows']=_0x29018b;return _0x9fb5ff;})[_0x3d43('0x23')](respondWithFilteredResult(_0x43e223,_0xde0f62))[_0x3d43('0x43')](handleError(_0x43e223,null));};exports['show']=function(_0x1c602a,_0x1a675f){var _0x241b07={'raw':![],'where':{'id':_0x1c602a['params']['id']}},_0x13906b={};_0x13906b['model']=_['keys'](db[_0x3d43('0x44')][_0x3d43('0x2c')]);_0x13906b['query']=_[_0x3d43('0x30')](_0x1c602a[_0x3d43('0x31')]);_0x13906b['filters']=_[_0x3d43('0x32')](_0x13906b[_0x3d43('0x2f')],_0x13906b[_0x3d43('0x31')]);_0x241b07[_0x3d43('0x34')]=_['intersection'](_0x13906b[_0x3d43('0x2f')],qs[_0x3d43('0x33')](_0x1c602a['query'][_0x3d43('0x33')]));_0x241b07[_0x3d43('0x34')]=_0x241b07[_0x3d43('0x34')][_0x3d43('0x35')]?_0x241b07[_0x3d43('0x34')]:_0x13906b['model'];if(_0x1c602a[_0x3d43('0x31')]['includeAll']){_0x241b07[_0x3d43('0x45')]=[{'all':!![]}];}_0x241b07=_['merge']({},_0x241b07,_0x1c602a['options']);return db['AnalyticFieldReport'][_0x3d43('0x46')](_0x241b07)[_0x3d43('0x23')](handleEntityNotFound(_0x1a675f,null))[_0x3d43('0x23')](respondWithResult(_0x1a675f,null))['catch'](handleError(_0x1a675f,null));};exports[_0x3d43('0x47')]=function(_0x2f8ea1,_0x71fd2){return db[_0x3d43('0x44')][_0x3d43('0x47')](_0x2f8ea1[_0x3d43('0x48')],{})[_0x3d43('0x23')](respondWithResult(_0x71fd2,0xc9))[_0x3d43('0x43')](handleError(_0x71fd2,null));};exports[_0x3d43('0x49')]=function(_0x5a98b4,_0x2a3258){return db['AnalyticFieldReport'][_0x3d43('0x49')](_0x5a98b4[_0x3d43('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2a3258,0xc9))[_0x3d43('0x43')](handleError(_0x2a3258,null));};exports[_0x3d43('0x22')]=function(_0x20fb5f,_0x111f98){if(_0x20fb5f['body']['id']){delete _0x20fb5f[_0x3d43('0x48')]['id'];}return db[_0x3d43('0x44')][_0x3d43('0x46')]({'where':{'id':_0x20fb5f[_0x3d43('0x4a')]['id']}})[_0x3d43('0x23')](handleEntityNotFound(_0x111f98,null))['then'](saveUpdates(_0x20fb5f[_0x3d43('0x48')],null))[_0x3d43('0x23')](respondWithResult(_0x111f98,null))[_0x3d43('0x43')](handleError(_0x111f98,null));};exports[_0x3d43('0x24')]=function(_0x563448,_0x1765bc){return db[_0x3d43('0x44')][_0x3d43('0x46')]({'where':{'id':_0x563448['params']['id']}})[_0x3d43('0x23')](handleEntityNotFound(_0x1765bc,null))['then'](removeEntity(_0x1765bc,null))[_0x3d43('0x43')](handleError(_0x1765bc,null));};exports['bulkDestroy']=function(_0x76da55,_0x450b51){return db['AnalyticFieldReport'][_0x3d43('0x24')]({'where':{'id':_0x76da55['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3d43('0x23')](respondWithResult(_0x450b51,0xcc))[_0x3d43('0x43')](handleError(_0x450b51,null));};exports[_0x3d43('0x4b')]=function(_0x2a5886,_0x37ccde,_0x5e19f7){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x2a5886[_0x3d43('0x4a')]['id']}})[_0x3d43('0x23')](handleEntityNotFound(_0x37ccde,null))[_0x3d43('0x23')](function(_0x50d032){if(_0x50d032){return db[_0x3d43('0x4c')][_0x3d43('0x4d')](function(_0x2980ed){return db[_0x3d43('0x44')]['destroy']({'where':{'CustomReportId':_0x2a5886[_0x3d43('0x4a')]['id']},'transaction':_0x2980ed})[_0x3d43('0x23')](function(_0x35ca0c){var _0x1debcd=_[_0x3d43('0x2b')](_0x2a5886['body'],function(_0x5390ba){delete _0x5390ba['id'];_0x5390ba[_0x3d43('0x4e')]=_0x2a5886[_0x3d43('0x4a')]['id'];return _0x5390ba;});return db[_0x3d43('0x44')][_0x3d43('0x49')](_0x1debcd,{'transaction':_0x2980ed});});})[_0x3d43('0x23')](function(){return db[_0x3d43('0x44')]['findAll']({'where':{'CustomReportId':_0x2a5886[_0x3d43('0x4a')]['id']}});});}})[_0x3d43('0x23')](respondWithResult(_0x37ccde,null))['catch'](handleError(_0x37ccde,null));};
\ No newline at end of file
+var _0xf2a1=['includeAll','body','bulkCreate','find','ids','AnalyticCustomReport','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes'];(function(_0x12a782,_0x3ce187){var _0x57b567=function(_0x5959e8){while(--_0x5959e8){_0x12a782['push'](_0x12a782['shift']());}};_0x57b567(++_0x3ce187);}(_0xf2a1,0x1dd));var _0x1f2a=function(_0x5c71bf,_0x501bfd){_0x5c71bf=_0x5c71bf-0x0;var _0x19b316=_0xf2a1[_0x5c71bf];return _0x19b316;};'use strict';var emlformat=require(_0x1f2a('0x0'));var rimraf=require(_0x1f2a('0x1'));var zipdir=require(_0x1f2a('0x2'));var jsonpatch=require(_0x1f2a('0x3'));var rp=require(_0x1f2a('0x4'));var moment=require(_0x1f2a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1f2a('0x6'));var util=require(_0x1f2a('0x7'));var path=require('path');var sox=require(_0x1f2a('0x8'));var csv=require(_0x1f2a('0x9'));var ejs=require(_0x1f2a('0xa'));var fs=require('fs');var fs_extra=require(_0x1f2a('0xb'));var _=require(_0x1f2a('0xc'));var squel=require(_0x1f2a('0xd'));var crypto=require(_0x1f2a('0xe'));var jsforce=require(_0x1f2a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1f2a('0x10'));var Papa=require(_0x1f2a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f2a('0x12'));var as=require(_0x1f2a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f2a('0x14'))(_0x1f2a('0x15'));var utils=require('../../config/utils');var config=require(_0x1f2a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f2a('0x17'))['db'];function respondWithStatusCode(_0x2f6055,_0xd39ef8){_0xd39ef8=_0xd39ef8||0xcc;return function(_0x3eb8ee){if(_0x3eb8ee){return _0x2f6055[_0x1f2a('0x18')](_0xd39ef8);}return _0x2f6055[_0x1f2a('0x19')](_0xd39ef8)[_0x1f2a('0x1a')]();};}function respondWithResult(_0x15d716,_0x233e21){_0x233e21=_0x233e21||0xc8;return function(_0x3f7956){if(_0x3f7956){return _0x15d716['status'](_0x233e21)['json'](_0x3f7956);}};}function respondWithFilteredResult(_0x1fab8a,_0x408fbf){return function(_0x18b7ff){if(_0x18b7ff){var _0x3dcbc9=typeof _0x408fbf[_0x1f2a('0x1b')]===_0x1f2a('0x1c')&&typeof _0x408fbf[_0x1f2a('0x1d')]===_0x1f2a('0x1c');var _0x44ada5=_0x18b7ff[_0x1f2a('0x1e')];var _0x4a548f=_0x3dcbc9?0x0:_0x408fbf[_0x1f2a('0x1b')];var _0x4d6953=_0x3dcbc9?_0x18b7ff[_0x1f2a('0x1e')]:_0x408fbf[_0x1f2a('0x1b')]+_0x408fbf[_0x1f2a('0x1d')];var _0x523398;if(_0x4d6953>=_0x44ada5){_0x4d6953=_0x44ada5;_0x523398=0xc8;}else{_0x523398=0xce;}_0x1fab8a[_0x1f2a('0x19')](_0x523398);return _0x1fab8a[_0x1f2a('0x1f')](_0x1f2a('0x20'),_0x4a548f+'-'+_0x4d6953+'/'+_0x44ada5)['json'](_0x18b7ff);}return null;};}function patchUpdates(_0x466107){return function(_0x387399){try{jsonpatch[_0x1f2a('0x21')](_0x387399,_0x466107,!![]);}catch(_0x5b88ce){return BPromise[_0x1f2a('0x22')](_0x5b88ce);}return _0x387399['save']();};}function saveUpdates(_0x9a02ab,_0x55288c){return function(_0x886a74){if(_0x886a74){return _0x886a74[_0x1f2a('0x23')](_0x9a02ab)[_0x1f2a('0x24')](function(_0x1aebce){return _0x1aebce;});}return null;};}function removeEntity(_0x3a63a3,_0x340c5b){return function(_0x6489f0){if(_0x6489f0){return _0x6489f0[_0x1f2a('0x25')]()[_0x1f2a('0x24')](function(){_0x3a63a3['status'](0xcc)[_0x1f2a('0x1a')]();});}};}function handleEntityNotFound(_0x562724,_0x4aad69){return function(_0x129778){if(!_0x129778){_0x562724[_0x1f2a('0x18')](0x194);}return _0x129778;};}function handleError(_0x42c038,_0x1ed45f){_0x1ed45f=_0x1ed45f||0x1f4;return function(_0x38f8fb){logger[_0x1f2a('0x26')](_0x38f8fb[_0x1f2a('0x27')]);if(_0x38f8fb[_0x1f2a('0x28')]){delete _0x38f8fb[_0x1f2a('0x28')];}_0x42c038[_0x1f2a('0x19')](_0x1ed45f)[_0x1f2a('0x29')](_0x38f8fb);};}exports['index']=function(_0x1511f1,_0x528bb7){var _0x1af31f={},_0xcf4d27={},_0x28948d={'count':0x0,'rows':[]};var _0xf5a696=_[_0x1f2a('0x2a')](db[_0x1f2a('0x2b')]['rawAttributes'],function(_0x2eba74){return{'name':_0x2eba74[_0x1f2a('0x2c')],'type':_0x2eba74['type'][_0x1f2a('0x2d')]};});_0xcf4d27[_0x1f2a('0x2e')]=_[_0x1f2a('0x2a')](_0xf5a696,'name');_0xcf4d27[_0x1f2a('0x2f')]=_[_0x1f2a('0x30')](_0x1511f1[_0x1f2a('0x2f')]);_0xcf4d27[_0x1f2a('0x31')]=_[_0x1f2a('0x32')](_0xcf4d27[_0x1f2a('0x2e')],_0xcf4d27[_0x1f2a('0x2f')]);_0x1af31f[_0x1f2a('0x33')]=_['intersection'](_0xcf4d27[_0x1f2a('0x2e')],qs[_0x1f2a('0x34')](_0x1511f1[_0x1f2a('0x2f')]['fields']));_0x1af31f[_0x1f2a('0x33')]=_0x1af31f[_0x1f2a('0x33')][_0x1f2a('0x35')]?_0x1af31f[_0x1f2a('0x33')]:_0xcf4d27['model'];if(!_0x1511f1['query'][_0x1f2a('0x36')](_0x1f2a('0x37'))){_0x1af31f[_0x1f2a('0x1d')]=qs[_0x1f2a('0x1d')](_0x1511f1[_0x1f2a('0x2f')][_0x1f2a('0x1d')]);_0x1af31f[_0x1f2a('0x1b')]=qs[_0x1f2a('0x1b')](_0x1511f1[_0x1f2a('0x2f')][_0x1f2a('0x1b')]);}_0x1af31f[_0x1f2a('0x38')]=qs[_0x1f2a('0x39')](_0x1511f1[_0x1f2a('0x2f')]['sort']);_0x1af31f[_0x1f2a('0x3a')]=qs[_0x1f2a('0x31')](_['pick'](_0x1511f1[_0x1f2a('0x2f')],_0xcf4d27['filters']),_0xf5a696);if(_0x1511f1[_0x1f2a('0x2f')][_0x1f2a('0x3b')]){_0x1af31f[_0x1f2a('0x3a')]=_[_0x1f2a('0x3c')](_0x1af31f[_0x1f2a('0x3a')],{'$or':_['map'](_0xf5a696,function(_0x97f9b2){if(_0x97f9b2['type']!==_0x1f2a('0x3d')){var _0x1e0c74={};_0x1e0c74[_0x97f9b2['name']]={'$like':'%'+_0x1511f1[_0x1f2a('0x2f')]['filter']+'%'};return _0x1e0c74;}})});}_0x1af31f=_[_0x1f2a('0x3c')]({},_0x1af31f,_0x1511f1[_0x1f2a('0x3e')]);var _0x51b0a7={'where':_0x1af31f['where']};return db[_0x1f2a('0x2b')][_0x1f2a('0x1e')](_0x51b0a7)[_0x1f2a('0x24')](function(_0x4ec1aa){_0x28948d[_0x1f2a('0x1e')]=_0x4ec1aa;if(_0x1511f1[_0x1f2a('0x2f')]['includeAll']){_0x1af31f[_0x1f2a('0x3f')]=[{'all':!![]}];}return db[_0x1f2a('0x2b')]['findAll'](_0x1af31f);})[_0x1f2a('0x24')](function(_0x37133b){_0x28948d[_0x1f2a('0x40')]=_0x37133b;return _0x28948d;})[_0x1f2a('0x24')](respondWithFilteredResult(_0x528bb7,_0x1af31f))[_0x1f2a('0x41')](handleError(_0x528bb7,null));};exports[_0x1f2a('0x42')]=function(_0x466fc2,_0x3b4234){var _0x481e1a={'raw':![],'where':{'id':_0x466fc2[_0x1f2a('0x43')]['id']}},_0x2d2704={};_0x2d2704['model']=_[_0x1f2a('0x30')](db[_0x1f2a('0x2b')][_0x1f2a('0x44')]);_0x2d2704['query']=_[_0x1f2a('0x30')](_0x466fc2[_0x1f2a('0x2f')]);_0x2d2704[_0x1f2a('0x31')]=_[_0x1f2a('0x32')](_0x2d2704[_0x1f2a('0x2e')],_0x2d2704['query']);_0x481e1a[_0x1f2a('0x33')]=_['intersection'](_0x2d2704[_0x1f2a('0x2e')],qs[_0x1f2a('0x34')](_0x466fc2[_0x1f2a('0x2f')][_0x1f2a('0x34')]));_0x481e1a[_0x1f2a('0x33')]=_0x481e1a[_0x1f2a('0x33')]['length']?_0x481e1a[_0x1f2a('0x33')]:_0x2d2704[_0x1f2a('0x2e')];if(_0x466fc2[_0x1f2a('0x2f')][_0x1f2a('0x45')]){_0x481e1a[_0x1f2a('0x3f')]=[{'all':!![]}];}_0x481e1a=_[_0x1f2a('0x3c')]({},_0x481e1a,_0x466fc2[_0x1f2a('0x3e')]);return db[_0x1f2a('0x2b')]['find'](_0x481e1a)[_0x1f2a('0x24')](handleEntityNotFound(_0x3b4234,null))[_0x1f2a('0x24')](respondWithResult(_0x3b4234,null))[_0x1f2a('0x41')](handleError(_0x3b4234,null));};exports['create']=function(_0x2e26bd,_0x2679e9){return db['AnalyticFieldReport']['create'](_0x2e26bd[_0x1f2a('0x46')],{})['then'](respondWithResult(_0x2679e9,0xc9))[_0x1f2a('0x41')](handleError(_0x2679e9,null));};exports[_0x1f2a('0x47')]=function(_0x2b5c42,_0x53bff5){return db['AnalyticFieldReport'][_0x1f2a('0x47')](_0x2b5c42[_0x1f2a('0x46')],{'raw':![],'individualHooks':!![]})[_0x1f2a('0x24')](respondWithResult(_0x53bff5,0xc9))[_0x1f2a('0x41')](handleError(_0x53bff5,null));};exports['update']=function(_0x17dfdb,_0x4c9ae9){if(_0x17dfdb['body']['id']){delete _0x17dfdb[_0x1f2a('0x46')]['id'];}return db[_0x1f2a('0x2b')][_0x1f2a('0x48')]({'where':{'id':_0x17dfdb['params']['id']}})['then'](handleEntityNotFound(_0x4c9ae9,null))[_0x1f2a('0x24')](saveUpdates(_0x17dfdb[_0x1f2a('0x46')],null))['then'](respondWithResult(_0x4c9ae9,null))[_0x1f2a('0x41')](handleError(_0x4c9ae9,null));};exports[_0x1f2a('0x25')]=function(_0x357664,_0x59508c){return db[_0x1f2a('0x2b')]['find']({'where':{'id':_0x357664[_0x1f2a('0x43')]['id']}})[_0x1f2a('0x24')](handleEntityNotFound(_0x59508c,null))['then'](removeEntity(_0x59508c,null))[_0x1f2a('0x41')](handleError(_0x59508c,null));};exports['bulkDestroy']=function(_0x125fb8,_0x3d8ea2){return db[_0x1f2a('0x2b')][_0x1f2a('0x25')]({'where':{'id':_0x125fb8[_0x1f2a('0x2f')][_0x1f2a('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x1f2a('0x24')](respondWithResult(_0x3d8ea2,0xcc))[_0x1f2a('0x41')](handleError(_0x3d8ea2,null));};exports['addFields']=function(_0x114806,_0x24cd2a,_0x5c0654){return db[_0x1f2a('0x4a')]['findOne']({'where':{'id':_0x114806[_0x1f2a('0x43')]['id']}})[_0x1f2a('0x24')](handleEntityNotFound(_0x24cd2a,null))[_0x1f2a('0x24')](function(_0x1178e1){if(_0x1178e1){return db['sequelize'][_0x1f2a('0x4b')](function(_0x58f84a){return db[_0x1f2a('0x2b')]['destroy']({'where':{'CustomReportId':_0x114806[_0x1f2a('0x43')]['id']},'transaction':_0x58f84a})[_0x1f2a('0x24')](function(_0x40c193){var _0x2258e7=_['map'](_0x114806['body'],function(_0x198226){delete _0x198226['id'];_0x198226[_0x1f2a('0x4c')]=_0x114806[_0x1f2a('0x43')]['id'];return _0x198226;});return db[_0x1f2a('0x2b')][_0x1f2a('0x47')](_0x2258e7,{'transaction':_0x58f84a});});})['then'](function(){return db['AnalyticFieldReport'][_0x1f2a('0x4d')]({'where':{'CustomReportId':_0x114806['params']['id']}});});}})['then'](respondWithResult(_0x24cd2a,null))['catch'](handleError(_0x24cd2a,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 6636a33..3a03305 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 _0xaaaa=['lodash','util','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x5ba4e7,_0x5a23e1){var _0x506678=function(_0x5e5de2){while(--_0x5e5de2){_0x5ba4e7['push'](_0x5ba4e7['shift']());}};_0x506678(++_0x5a23e1);}(_0xaaaa,0x9a));var _0xaaaa=function(_0x2827b5,_0x1f963c){_0x2827b5=_0x2827b5-0x0;var _0x5560d5=_0xaaaa[_0x2827b5];return _0x5560d5;};'use strict';var _=require(_0xaaaa('0x0'));var util=require(_0xaaaa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaaaa('0x2'));var BPromise=require('bluebird');var rp=require(_0xaaaa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaaaa('0x4'));var config=require(_0xaaaa('0x5'));var attributes=require(_0xaaaa('0x6'));module[_0xaaaa('0x7')]=function(_0x20e43a,_0x45eb90){return _0x20e43a[_0xaaaa('0x8')](_0xaaaa('0x9'),attributes,{'tableName':_0xaaaa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x337b=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x337b,0x1d2));var _0xb337=function(_0x5eee8b,_0x53af12){_0x5eee8b=_0x5eee8b-0x0;var _0x1cc3d1=_0x337b[_0x5eee8b];return _0x1cc3d1;};'use strict';var _=require(_0xb337('0x0'));var util=require(_0xb337('0x1'));var logger=require(_0xb337('0x2'))('api');var moment=require(_0xb337('0x3'));var BPromise=require(_0xb337('0x4'));var rp=require(_0xb337('0x5'));var fs=require('fs');var path=require(_0xb337('0x6'));var rimraf=require(_0xb337('0x7'));var config=require(_0xb337('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xb337('0x9')]=function(_0xed119a,_0x29025d){return _0xed119a[_0xb337('0xa')](_0xb337('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 0050554..21c2d10 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 _0x37af=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1b4057,_0x58212a){var _0x1d749a=function(_0x1fa30b){while(--_0x1fa30b){_0x1b4057['push'](_0x1b4057['shift']());}};_0x1d749a(++_0x58212a);}(_0x37af,0x10d));var _0xf37a=function(_0x58aa57,_0x32d905){_0x58aa57=_0x58aa57-0x0;var _0x2f134e=_0x37af[_0x58aa57];return _0x2f134e;};'use strict';var _=require('lodash');var util=require(_0xf37a('0x0'));var moment=require(_0xf37a('0x1'));var BPromise=require(_0xf37a('0x2'));var rs=require(_0xf37a('0x3'));var fs=require('fs');var Redis=require(_0xf37a('0x4'));var db=require(_0xf37a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf37a('0x6'));var config=require(_0xf37a('0x7'));var jayson=require(_0xf37a('0x8'));var client=jayson[_0xf37a('0x9')][_0xf37a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1da835,_0x576698,_0x15e8dc){return new BPromise(function(_0x16f7b1,_0x2f8e85){return client[_0xf37a('0xb')](_0x1da835,_0x15e8dc)[_0xf37a('0xc')](function(_0x1db587){logger[_0xf37a('0xd')](_0xf37a('0xe'),_0x576698,_0xf37a('0xf'));logger[_0xf37a('0x10')](_0xf37a('0x11'),_0x576698,_0xf37a('0xf'),JSON[_0xf37a('0x12')](_0x1db587));if(_0x1db587[_0xf37a('0x13')]){if(_0x1db587['error'][_0xf37a('0x14')]===0x1f4){logger[_0xf37a('0x13')](_0xf37a('0xe'),_0x576698,_0x1db587[_0xf37a('0x13')][_0xf37a('0x15')]);return _0x2f8e85(_0x1db587[_0xf37a('0x13')][_0xf37a('0x15')]);}logger[_0xf37a('0x13')](_0xf37a('0xe'),_0x576698,_0x1db587[_0xf37a('0x13')][_0xf37a('0x15')]);return _0x16f7b1(_0x1db587['error'][_0xf37a('0x15')]);}else{logger['info'](_0xf37a('0xe'),_0x576698,'request\x20sent');_0x16f7b1(_0x1db587['result'][_0xf37a('0x15')]);}})[_0xf37a('0x16')](function(_0x5d58df){logger[_0xf37a('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x576698,_0x5d58df);_0x2f8e85(_0x5d58df);});});}
\ No newline at end of file
+var _0xc2e2=['code','message','info','result','catch','util','moment','ioredis','rpc','../../config/environment','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e6c5a,_0x5eabdf){var _0x1c5215=function(_0xfdb779){while(--_0xfdb779){_0x3e6c5a['push'](_0x3e6c5a['shift']());}};_0x1c5215(++_0x5eabdf);}(_0xc2e2,0x194));var _0x2c2e=function(_0x4922ea,_0x2b16c6){_0x4922ea=_0x4922ea-0x0;var _0x5785f9=_0xc2e2[_0x4922ea];return _0x5785f9;};'use strict';var _=require('lodash');var util=require(_0x2c2e('0x0'));var moment=require(_0x2c2e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c2e('0x3'));var config=require(_0x2c2e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2c2e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55e1f4,_0x140348,_0x15ec0f){return new BPromise(function(_0x1b7982,_0x17d7ef){return client[_0x2c2e('0x6')](_0x55e1f4,_0x15ec0f)[_0x2c2e('0x7')](function(_0x129ed6){logger['info'](_0x2c2e('0x8'),_0x140348,_0x2c2e('0x9'));logger[_0x2c2e('0xa')](_0x2c2e('0xb'),_0x140348,_0x2c2e('0x9'),JSON[_0x2c2e('0xc')](_0x129ed6));if(_0x129ed6[_0x2c2e('0xd')]){if(_0x129ed6[_0x2c2e('0xd')][_0x2c2e('0xe')]===0x1f4){logger['error'](_0x2c2e('0x8'),_0x140348,_0x129ed6[_0x2c2e('0xd')]['message']);return _0x17d7ef(_0x129ed6['error']['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x140348,_0x129ed6[_0x2c2e('0xd')][_0x2c2e('0xf')]);return _0x1b7982(_0x129ed6[_0x2c2e('0xd')][_0x2c2e('0xf')]);}else{logger[_0x2c2e('0x10')](_0x2c2e('0x8'),_0x140348,_0x2c2e('0x9'));_0x1b7982(_0x129ed6[_0x2c2e('0x11')][_0x2c2e('0xf')]);}})[_0x2c2e('0x12')](function(_0x2f4ecf){logger[_0x2c2e('0xd')](_0x2c2e('0x8'),_0x140348,_0x2f4ecf);_0x17d7ef(_0x2f4ecf);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 9e243b5..9f89d2d 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(_0x36d20c,_0x3bafd5){var _0x2140af=function(_0x9c8bb7){while(--_0x9c8bb7){_0x36d20c['push'](_0x36d20c['shift']());}};_0x2140af(++_0x3bafd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x33ae55,_0x14989b){var _0x182a50=function(_0x131e60){while(--_0x131e60){_0x33ae55['push'](_0x33ae55['shift']());}};_0x182a50(++_0x14989b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 54aa2e4..cb12019 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 _0x980c=['TEXT','sequelize','exports','STRING','name'];(function(_0x397dcc,_0x51100c){var _0x2cd154=function(_0x3b14){while(--_0x3b14){_0x397dcc['push'](_0x397dcc['shift']());}};_0x2cd154(++_0x51100c);}(_0x980c,0x100));var _0xc980=function(_0x1e7157,_0x2659ba){_0x1e7157=_0x1e7157-0x0;var _0x595593=_0x980c[_0x1e7157];return _0x595593;};'use strict';var Sequelize=require(_0xc980('0x0'));module[_0xc980('0x1')]={'name':{'type':Sequelize[_0xc980('0x2')],'allowNull':![],'unique':_0xc980('0x3')},'table':{'type':Sequelize[_0xc980('0x2')]},'metric':{'type':Sequelize[_0xc980('0x4')]},'description':{'type':Sequelize[_0xc980('0x2')]}};
\ No newline at end of file
+var _0x9e0d=['name','TEXT','sequelize','exports','STRING'];(function(_0x4c02dd,_0x4f427e){var _0x42a36d=function(_0x593bcc){while(--_0x593bcc){_0x4c02dd['push'](_0x4c02dd['shift']());}};_0x42a36d(++_0x4f427e);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x492b13,_0x4c39fa){_0x492b13=_0x492b13-0x0;var _0x3f6508=_0x9e0d[_0x492b13];return _0x3f6508;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'name':{'type':Sequelize[_0xd9e0('0x2')],'allowNull':![],'unique':_0xd9e0('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd9e0('0x4')]},'description':{'type':Sequelize[_0xd9e0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index d6b2f3d..fec7b02 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x292f0d,_0x528c4c){var _0x2412f9=function(_0x722ed0){while(--_0x722ed0){_0x292f0d['push'](_0x292f0d['shift']());}};_0x2412f9(++_0x528c4c);}(_0x55ca,0x126));var _0xa55c=function(_0x55e28f,_0x20cedb){_0x55e28f=_0x55e28f-0x0;var _0xee48e9=_0x55ca[_0x55e28f];return _0xee48e9;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
+var _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x1132a5,_0x22a6a2){var _0x53b53e=function(_0x1a582f){while(--_0x1a582f){_0x1132a5['push'](_0x1132a5['shift']());}};_0x53b53e(++_0x22a6a2);}(_0xa41a,0x6b));var _0xaa41=function(_0x514879,_0x548f62){_0x514879=_0x514879-0x0;var _0x4e0e68=_0xa41a[_0x514879];return _0x4e0e68;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 3b9a957..bb01eac 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 _0xa7be=['analytics_metrics','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0xa7be,0xfd));var _0xea7b=function(_0x7bd69d,_0x4839ac){_0x7bd69d=_0x7bd69d-0x0;var _0x41b6ac=_0xa7be[_0x7bd69d];return _0x41b6ac;};'use strict';var _=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var logger=require(_0xea7b('0x2'))(_0xea7b('0x3'));var moment=require(_0xea7b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea7b('0x5'));var rimraf=require(_0xea7b('0x6'));var config=require(_0xea7b('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xea7b('0x8')]=function(_0x1bf6cb,_0x3078c9){return _0x1bf6cb[_0xea7b('0x9')](_0xea7b('0xa'),attributes,{'tableName':_0xea7b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1f6=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','exports'];(function(_0x4afd2c,_0x5d6800){var _0x33074e=function(_0x1045d0){while(--_0x1045d0){_0x4afd2c['push'](_0x4afd2c['shift']());}};_0x33074e(++_0x5d6800);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0xa1f6[_0x4c2f17];return _0x20919e;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var logger=require(_0x6a1f('0x2'))(_0x6a1f('0x3'));var moment=require(_0x6a1f('0x4'));var BPromise=require(_0x6a1f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x6a1f('0x6')]=function(_0x426ae1,_0xa1c928){return _0x426ae1[_0x6a1f('0x7')](_0x6a1f('0x8'),attributes,{'tableName':_0x6a1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index ea004a2..d0f32b0 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 _0x916a=['message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s'];(function(_0xdfa8a6,_0x2b5761){var _0x19e515=function(_0xa24538){while(--_0xa24538){_0xdfa8a6['push'](_0xdfa8a6['shift']());}};_0x19e515(++_0x2b5761);}(_0x916a,0x1a5));var _0xa916=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0x916a[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0xa916('0x0'));var util=require(_0xa916('0x1'));var moment=require(_0xa916('0x2'));var BPromise=require('bluebird');var rs=require(_0xa916('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa916('0x4'))['db'];var utils=require(_0xa916('0x5'));var logger=require(_0xa916('0x6'))(_0xa916('0x7'));var config=require(_0xa916('0x8'));var jayson=require(_0xa916('0x9'));var client=jayson[_0xa916('0xa')][_0xa916('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x374e00,_0x1dc6e6,_0x3997a7){return new BPromise(function(_0x54791a,_0x96dfa9){return client[_0xa916('0xc')](_0x374e00,_0x3997a7)[_0xa916('0xd')](function(_0x2d04f0){logger[_0xa916('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x1dc6e6,'request\x20sent');logger[_0xa916('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1dc6e6,_0xa916('0x10'),JSON[_0xa916('0x11')](_0x2d04f0));if(_0x2d04f0[_0xa916('0x12')]){if(_0x2d04f0[_0xa916('0x12')]['code']===0x1f4){logger[_0xa916('0x12')](_0xa916('0x13'),_0x1dc6e6,_0x2d04f0['error'][_0xa916('0x14')]);return _0x96dfa9(_0x2d04f0[_0xa916('0x12')][_0xa916('0x14')]);}logger['error'](_0xa916('0x13'),_0x1dc6e6,_0x2d04f0['error'][_0xa916('0x14')]);return _0x54791a(_0x2d04f0['error'][_0xa916('0x14')]);}else{logger[_0xa916('0xe')](_0xa916('0x13'),_0x1dc6e6,_0xa916('0x10'));_0x54791a(_0x2d04f0['result'][_0xa916('0x14')]);}})['catch'](function(_0x531003){logger[_0xa916('0x12')](_0xa916('0x13'),_0x1dc6e6,_0x531003);_0x96dfa9(_0x531003);});});}
\ No newline at end of file
+var _0xdbc9=['then','info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2ac368,_0x53a579){var _0x22e9f7=function(_0x517d19){while(--_0x517d19){_0x2ac368['push'](_0x2ac368['shift']());}};_0x22e9f7(++_0x53a579);}(_0xdbc9,0x1d6));var _0x9dbc=function(_0x33b1ff,_0x383ab4){_0x33b1ff=_0x33b1ff-0x0;var _0x5d6e19=_0xdbc9[_0x33b1ff];return _0x5d6e19;};'use strict';var _=require(_0x9dbc('0x0'));var util=require(_0x9dbc('0x1'));var moment=require(_0x9dbc('0x2'));var BPromise=require(_0x9dbc('0x3'));var rs=require(_0x9dbc('0x4'));var fs=require('fs');var Redis=require(_0x9dbc('0x5'));var db=require(_0x9dbc('0x6'))['db'];var utils=require(_0x9dbc('0x7'));var logger=require(_0x9dbc('0x8'))('rpc');var config=require(_0x9dbc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9dbc('0xa')][_0x9dbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5a4b,_0x1463c2,_0xbbe283){return new BPromise(function(_0x5e27fe,_0x25aabb){return client[_0x9dbc('0xc')](_0x1d5a4b,_0xbbe283)[_0x9dbc('0xd')](function(_0x3c1dde){logger[_0x9dbc('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x1463c2,_0x9dbc('0xf'));logger[_0x9dbc('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1463c2,_0x9dbc('0xf'),JSON[_0x9dbc('0x11')](_0x3c1dde));if(_0x3c1dde['error']){if(_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x13')]===0x1f4){logger[_0x9dbc('0x12')](_0x9dbc('0x14'),_0x1463c2,_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);return _0x25aabb(_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);}logger[_0x9dbc('0x12')](_0x9dbc('0x14'),_0x1463c2,_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);return _0x5e27fe(_0x3c1dde[_0x9dbc('0x12')][_0x9dbc('0x15')]);}else{logger[_0x9dbc('0xe')](_0x9dbc('0x14'),_0x1463c2,_0x9dbc('0xf'));_0x5e27fe(_0x3c1dde['result'][_0x9dbc('0x15')]);}})[_0x9dbc('0x16')](function(_0xd8851e){logger[_0x9dbc('0x12')](_0x9dbc('0x14'),_0x1463c2,_0xd8851e);_0x25aabb(_0xd8851e);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index f95d034..d61a48a 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 _0x0619=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1a9e8f,_0x22831f){var _0x1cd6ee=function(_0x28eb2c){while(--_0x28eb2c){_0x1a9e8f['push'](_0x1a9e8f['shift']());}};_0x1cd6ee(++_0x22831f);}(_0x0619,0x90));var _0x9061=function(_0x2c2439,_0x2462bc){_0x2c2439=_0x2c2439-0x0;var _0xa81182=_0x0619[_0x2c2439];return _0xa81182;};'use strict';var multer=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var path=require(_0x9061('0x2'));var timeout=require(_0x9061('0x3'));var express=require('express');var router=express[_0x9061('0x4')]();var fs_extra=require(_0x9061('0x5'));var auth=require(_0x9061('0x6'));var interaction=require(_0x9061('0x7'));var config=require(_0x9061('0x8'));var controller=require(_0x9061('0x9'));router[_0x9061('0xa')]('/',auth[_0x9061('0xb')](),controller[_0x9061('0xc')]);router[_0x9061('0xa')](_0x9061('0xd'),auth['isAuthenticated'](),controller[_0x9061('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9061('0xf')]);router[_0x9061('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9061('0x11')]);router[_0x9061('0x12')](_0x9061('0xd'),auth[_0x9061('0xb')](),controller[_0x9061('0x13')]);module[_0x9061('0x14')]=router;
\ No newline at end of file
+var _0x2159=['update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','/:id'];(function(_0x45158b,_0x27eae9){var _0x21cf31=function(_0x57798b){while(--_0x57798b){_0x45158b['push'](_0x45158b['shift']());}};_0x21cf31(++_0x27eae9);}(_0x2159,0x17f));var _0x9215=function(_0x51f67c,_0x1977ec){_0x51f67c=_0x51f67c-0x0;var _0x3888c5=_0x2159[_0x51f67c];return _0x3888c5;};'use strict';var multer=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var path=require(_0x9215('0x2'));var timeout=require(_0x9215('0x3'));var express=require('express');var router=express[_0x9215('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9215('0x5'));var interaction=require(_0x9215('0x6'));var config=require(_0x9215('0x7'));var controller=require(_0x9215('0x8'));router[_0x9215('0x9')]('/',auth[_0x9215('0xa')](),controller[_0x9215('0xb')]);router[_0x9215('0x9')]('/:id',auth[_0x9215('0xa')](),controller[_0x9215('0xc')]);router[_0x9215('0xd')]('/',auth[_0x9215('0xa')](),controller[_0x9215('0xe')]);router['put'](_0x9215('0xf'),auth[_0x9215('0xa')](),controller[_0x9215('0x10')]);router[_0x9215('0x11')]('/:id',auth[_0x9215('0xa')](),controller[_0x9215('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index b3f5d67..d9e882c 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 _0x9464=['exports','TEXT','sequelize'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9464,0x10d));var _0x4946=function(_0x1c7137,_0x4c7c26){_0x1c7137=_0x1c7137-0x0;var _0xeb4432=_0x9464[_0x1c7137];return _0xeb4432;};'use strict';var Sequelize=require(_0x4946('0x0'));module[_0x4946('0x1')]={'tree':{'type':Sequelize[_0x4946('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x1fc5=['exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1fc5,0x98));var _0x51fc=function(_0x5585f9,_0x492ef7){_0x5585f9=_0x5585f9-0x0;var _0x25cd7b=_0x1fc5[_0x5585f9];return _0x25cd7b;};'use strict';var Sequelize=require('sequelize');module[_0x51fc('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 68a4b72..4f952fc 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 _0x03c5=['update','destroy','then','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x03c5,0x190));var _0x503c=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x03c5[_0x14e27a];return _0x288688;};'use strict';var emlformat=require(_0x503c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x503c('0x1'));var rp=require(_0x503c('0x2'));var moment=require(_0x503c('0x3'));var BPromise=require(_0x503c('0x4'));var Mustache=require(_0x503c('0x5'));var util=require('util');var path=require(_0x503c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x503c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x503c('0x8'));var squel=require(_0x503c('0x9'));var crypto=require('crypto');var jsforce=require(_0x503c('0xa'));var deskjs=require(_0x503c('0xb'));var toCsv=require(_0x503c('0xc'));var querystring=require(_0x503c('0xd'));var Papa=require(_0x503c('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x503c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x503c('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x503c('0x11'));var db=require(_0x503c('0x12'))['db'];function respondWithStatusCode(_0x17a5e8,_0x40b6d1){_0x40b6d1=_0x40b6d1||0xcc;return function(_0x2be185){if(_0x2be185){return _0x17a5e8[_0x503c('0x13')](_0x40b6d1);}return _0x17a5e8['status'](_0x40b6d1)[_0x503c('0x14')]();};}function respondWithResult(_0x29ab2b,_0x5b237d){_0x5b237d=_0x5b237d||0xc8;return function(_0x2f229e){if(_0x2f229e){return _0x29ab2b['status'](_0x5b237d)[_0x503c('0x15')](_0x2f229e);}};}function respondWithFilteredResult(_0x37d75d,_0x1da073){return function(_0x3bbae8){if(_0x3bbae8){var _0x290fc3=typeof _0x1da073[_0x503c('0x16')]==='undefined'&&typeof _0x1da073['limit']===_0x503c('0x17');var _0x701666=_0x3bbae8[_0x503c('0x18')];var _0x56ae58=_0x290fc3?0x0:_0x1da073[_0x503c('0x16')];var _0x2eaf12=_0x290fc3?_0x3bbae8['count']:_0x1da073[_0x503c('0x16')]+_0x1da073[_0x503c('0x19')];var _0xebff17;if(_0x2eaf12>=_0x701666){_0x2eaf12=_0x701666;_0xebff17=0xc8;}else{_0xebff17=0xce;}_0x37d75d[_0x503c('0x1a')](_0xebff17);return _0x37d75d[_0x503c('0x1b')](_0x503c('0x1c'),_0x56ae58+'-'+_0x2eaf12+'/'+_0x701666)[_0x503c('0x15')](_0x3bbae8);}return null;};}function patchUpdates(_0x4abbcf){return function(_0x41c166){try{jsonpatch[_0x503c('0x1d')](_0x41c166,_0x4abbcf,!![]);}catch(_0x540c18){return BPromise[_0x503c('0x1e')](_0x540c18);}return _0x41c166[_0x503c('0x1f')]();};}function saveUpdates(_0x124356,_0x436442){return function(_0x515e9c){if(_0x515e9c){return _0x515e9c[_0x503c('0x20')](_0x124356)['then'](function(_0x1b97ab){return _0x1b97ab;});}return null;};}function removeEntity(_0x20d618,_0x82562e){return function(_0x4f4f02){if(_0x4f4f02){return _0x4f4f02[_0x503c('0x21')]()[_0x503c('0x22')](function(){_0x20d618['status'](0xcc)[_0x503c('0x14')]();});}};}function handleEntityNotFound(_0x132e9e,_0x4355dc){return function(_0x207d3f){if(!_0x207d3f){_0x132e9e[_0x503c('0x13')](0x194);}return _0x207d3f;};}function handleError(_0x4f7bcb,_0x1aa099){_0x1aa099=_0x1aa099||0x1f4;return function(_0x59ecdd){logger['error'](_0x59ecdd[_0x503c('0x23')]);if(_0x59ecdd[_0x503c('0x24')]){delete _0x59ecdd['name'];}_0x4f7bcb[_0x503c('0x1a')](_0x1aa099)[_0x503c('0x25')](_0x59ecdd);};}exports[_0x503c('0x26')]=function(_0x5c8066,_0x6b7d42){var _0x35fe88={},_0x25b15c={},_0x4b75bd={'count':0x0,'rows':[]};var _0x1d84e9=_[_0x503c('0x27')](db[_0x503c('0x28')][_0x503c('0x29')],function(_0x27c0a7){return{'name':_0x27c0a7['fieldName'],'type':_0x27c0a7[_0x503c('0x2a')][_0x503c('0x2b')]};});_0x25b15c[_0x503c('0x2c')]=_[_0x503c('0x27')](_0x1d84e9,_0x503c('0x24'));_0x25b15c['query']=_['keys'](_0x5c8066[_0x503c('0x2d')]);_0x25b15c[_0x503c('0x2e')]=_[_0x503c('0x2f')](_0x25b15c[_0x503c('0x2c')],_0x25b15c['query']);_0x35fe88[_0x503c('0x30')]=_[_0x503c('0x2f')](_0x25b15c[_0x503c('0x2c')],qs[_0x503c('0x31')](_0x5c8066[_0x503c('0x2d')]['fields']));_0x35fe88[_0x503c('0x30')]=_0x35fe88[_0x503c('0x30')][_0x503c('0x32')]?_0x35fe88[_0x503c('0x30')]:_0x25b15c[_0x503c('0x2c')];if(!_0x5c8066[_0x503c('0x2d')][_0x503c('0x33')](_0x503c('0x34'))){_0x35fe88[_0x503c('0x19')]=qs[_0x503c('0x19')](_0x5c8066[_0x503c('0x2d')]['limit']);_0x35fe88[_0x503c('0x16')]=qs[_0x503c('0x16')](_0x5c8066[_0x503c('0x2d')][_0x503c('0x16')]);}_0x35fe88[_0x503c('0x35')]=qs[_0x503c('0x36')](_0x5c8066[_0x503c('0x2d')][_0x503c('0x36')]);_0x35fe88[_0x503c('0x37')]=qs['filters'](_[_0x503c('0x38')](_0x5c8066['query'],_0x25b15c[_0x503c('0x2e')]),_0x1d84e9);if(_0x5c8066[_0x503c('0x2d')][_0x503c('0x39')]){_0x35fe88[_0x503c('0x37')]=_[_0x503c('0x3a')](_0x35fe88['where'],{'$or':_['map'](_0x1d84e9,function(_0x59b690){if(_0x59b690['type']!==_0x503c('0x3b')){var _0x3949b0={};_0x3949b0[_0x59b690[_0x503c('0x24')]]={'$like':'%'+_0x5c8066['query'][_0x503c('0x39')]+'%'};return _0x3949b0;}})});}_0x35fe88=_[_0x503c('0x3a')]({},_0x35fe88,_0x5c8066[_0x503c('0x3c')]);var _0x1fadd0={'where':_0x35fe88['where']};return db[_0x503c('0x28')]['count'](_0x1fadd0)[_0x503c('0x22')](function(_0x21c9ab){_0x4b75bd[_0x503c('0x18')]=_0x21c9ab;if(_0x5c8066[_0x503c('0x2d')][_0x503c('0x3d')]){_0x35fe88[_0x503c('0x3e')]=[{'all':!![]}];}return db[_0x503c('0x28')][_0x503c('0x3f')](_0x35fe88);})['then'](function(_0x2178cc){_0x4b75bd[_0x503c('0x40')]=_0x2178cc;return _0x4b75bd;})[_0x503c('0x22')](respondWithFilteredResult(_0x6b7d42,_0x35fe88))[_0x503c('0x41')](handleError(_0x6b7d42,null));};exports[_0x503c('0x42')]=function(_0xbcbb22,_0x171231){var _0x35a569={'raw':!![],'where':{'id':_0xbcbb22['params']['id']}},_0x235a46={};_0x235a46['model']=_[_0x503c('0x43')](db['AnalyticTreeReport']['rawAttributes']);_0x235a46[_0x503c('0x2d')]=_[_0x503c('0x43')](_0xbcbb22[_0x503c('0x2d')]);_0x235a46[_0x503c('0x2e')]=_[_0x503c('0x2f')](_0x235a46[_0x503c('0x2c')],_0x235a46[_0x503c('0x2d')]);_0x35a569['attributes']=_[_0x503c('0x2f')](_0x235a46[_0x503c('0x2c')],qs[_0x503c('0x31')](_0xbcbb22['query'][_0x503c('0x31')]));_0x35a569[_0x503c('0x30')]=_0x35a569['attributes'][_0x503c('0x32')]?_0x35a569[_0x503c('0x30')]:_0x235a46[_0x503c('0x2c')];if(_0xbcbb22[_0x503c('0x2d')]['includeAll']){_0x35a569[_0x503c('0x3e')]=[{'all':!![]}];}_0x35a569=_[_0x503c('0x3a')]({},_0x35a569,_0xbcbb22['options']);return db['AnalyticTreeReport'][_0x503c('0x44')](_0x35a569)[_0x503c('0x22')](handleEntityNotFound(_0x171231,null))[_0x503c('0x22')](respondWithResult(_0x171231,null))[_0x503c('0x41')](handleError(_0x171231,null));};exports[_0x503c('0x45')]=function(_0x1a8f46,_0x5b8918){return db[_0x503c('0x28')][_0x503c('0x45')](_0x1a8f46[_0x503c('0x46')],{})[_0x503c('0x22')](respondWithResult(_0x5b8918,0xc9))['catch'](handleError(_0x5b8918,null));};exports['update']=function(_0x36bee6,_0x1af4c3){if(_0x36bee6[_0x503c('0x46')]['id']){delete _0x36bee6[_0x503c('0x46')]['id'];}return db[_0x503c('0x28')][_0x503c('0x44')]({'where':{'id':_0x36bee6[_0x503c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1af4c3,null))[_0x503c('0x22')](saveUpdates(_0x36bee6[_0x503c('0x46')],null))[_0x503c('0x22')](respondWithResult(_0x1af4c3,null))[_0x503c('0x41')](handleError(_0x1af4c3,null));};exports['destroy']=function(_0xff8bc2,_0x3aa8ce){return db[_0x503c('0x28')][_0x503c('0x44')]({'where':{'id':_0xff8bc2[_0x503c('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa8ce,null))['then'](removeEntity(_0x3aa8ce,null))['catch'](handleError(_0x3aa8ce,null));};
\ No newline at end of file
+var _0xdc36=['length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','AnalyticTreeReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x31ef43,_0x401a87){var _0x3f9960=function(_0x12b57e){while(--_0x12b57e){_0x31ef43['push'](_0x31ef43['shift']());}};_0x3f9960(++_0x401a87);}(_0xdc36,0xee));var _0x6dc3=function(_0x434392,_0x548f1d){_0x434392=_0x434392-0x0;var _0x113261=_0xdc36[_0x434392];return _0x113261;};'use strict';var emlformat=require(_0x6dc3('0x0'));var rimraf=require(_0x6dc3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc3('0x2'));var rp=require(_0x6dc3('0x3'));var moment=require('moment');var BPromise=require(_0x6dc3('0x4'));var Mustache=require(_0x6dc3('0x5'));var util=require('util');var path=require(_0x6dc3('0x6'));var sox=require(_0x6dc3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6dc3('0x8'));var squel=require(_0x6dc3('0x9'));var crypto=require(_0x6dc3('0xa'));var jsforce=require(_0x6dc3('0xb'));var deskjs=require(_0x6dc3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6dc3('0xd'));var Redis=require(_0x6dc3('0xe'));var authService=require(_0x6dc3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6dc3('0x10'));var hardwareService=require(_0x6dc3('0x11'));var logger=require(_0x6dc3('0x12'))(_0x6dc3('0x13'));var utils=require(_0x6dc3('0x14'));var config=require(_0x6dc3('0x15'));var licenseUtil=require(_0x6dc3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x498ee5,_0x5d124e){_0x5d124e=_0x5d124e||0xcc;return function(_0xcfb607){if(_0xcfb607){return _0x498ee5['sendStatus'](_0x5d124e);}return _0x498ee5['status'](_0x5d124e)['end']();};}function respondWithResult(_0x5804ca,_0x364a1c){_0x364a1c=_0x364a1c||0xc8;return function(_0x52deca){if(_0x52deca){return _0x5804ca[_0x6dc3('0x17')](_0x364a1c)[_0x6dc3('0x18')](_0x52deca);}};}function respondWithFilteredResult(_0x16dafe,_0x3a63f6){return function(_0x457621){if(_0x457621){var _0x584654=typeof _0x3a63f6[_0x6dc3('0x19')]===_0x6dc3('0x1a')&&typeof _0x3a63f6['limit']===_0x6dc3('0x1a');var _0x8f7b1f=_0x457621[_0x6dc3('0x1b')];var _0x68a4de=_0x584654?0x0:_0x3a63f6[_0x6dc3('0x19')];var _0xca02ec=_0x584654?_0x457621[_0x6dc3('0x1b')]:_0x3a63f6[_0x6dc3('0x19')]+_0x3a63f6[_0x6dc3('0x1c')];var _0xe148f7;if(_0xca02ec>=_0x8f7b1f){_0xca02ec=_0x8f7b1f;_0xe148f7=0xc8;}else{_0xe148f7=0xce;}_0x16dafe[_0x6dc3('0x17')](_0xe148f7);return _0x16dafe[_0x6dc3('0x1d')](_0x6dc3('0x1e'),_0x68a4de+'-'+_0xca02ec+'/'+_0x8f7b1f)[_0x6dc3('0x18')](_0x457621);}return null;};}function patchUpdates(_0x5c628){return function(_0x213cdf){try{jsonpatch['apply'](_0x213cdf,_0x5c628,!![]);}catch(_0x55469b){return BPromise[_0x6dc3('0x1f')](_0x55469b);}return _0x213cdf[_0x6dc3('0x20')]();};}function saveUpdates(_0x1631ce,_0x3658a7){return function(_0x504d70){if(_0x504d70){return _0x504d70[_0x6dc3('0x21')](_0x1631ce)[_0x6dc3('0x22')](function(_0x4efc4a){return _0x4efc4a;});}return null;};}function removeEntity(_0x33f682,_0x8f2512){return function(_0x452e17){if(_0x452e17){return _0x452e17[_0x6dc3('0x23')]()['then'](function(){_0x33f682[_0x6dc3('0x17')](0xcc)[_0x6dc3('0x24')]();});}};}function handleEntityNotFound(_0x4a2a0a,_0x3a118a){return function(_0x28cedc){if(!_0x28cedc){_0x4a2a0a[_0x6dc3('0x25')](0x194);}return _0x28cedc;};}function handleError(_0x21eaed,_0x549407){_0x549407=_0x549407||0x1f4;return function(_0x235be2){logger[_0x6dc3('0x26')](_0x235be2[_0x6dc3('0x27')]);if(_0x235be2[_0x6dc3('0x28')]){delete _0x235be2[_0x6dc3('0x28')];}_0x21eaed['status'](_0x549407)['send'](_0x235be2);};}exports[_0x6dc3('0x29')]=function(_0x1409d7,_0x76dcc8){var _0x5a4b3e={},_0x10950f={},_0x3f54af={'count':0x0,'rows':[]};var _0x6c481f=_[_0x6dc3('0x2a')](db[_0x6dc3('0x2b')]['rawAttributes'],function(_0x39a42b){return{'name':_0x39a42b[_0x6dc3('0x2c')],'type':_0x39a42b[_0x6dc3('0x2d')][_0x6dc3('0x2e')]};});_0x10950f['model']=_[_0x6dc3('0x2a')](_0x6c481f,_0x6dc3('0x28'));_0x10950f[_0x6dc3('0x2f')]=_[_0x6dc3('0x30')](_0x1409d7['query']);_0x10950f[_0x6dc3('0x31')]=_[_0x6dc3('0x32')](_0x10950f[_0x6dc3('0x33')],_0x10950f[_0x6dc3('0x2f')]);_0x5a4b3e['attributes']=_[_0x6dc3('0x32')](_0x10950f[_0x6dc3('0x33')],qs['fields'](_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x34')]));_0x5a4b3e[_0x6dc3('0x35')]=_0x5a4b3e[_0x6dc3('0x35')][_0x6dc3('0x36')]?_0x5a4b3e[_0x6dc3('0x35')]:_0x10950f[_0x6dc3('0x33')];if(!_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x37')]('nolimit')){_0x5a4b3e['limit']=qs[_0x6dc3('0x1c')](_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x1c')]);_0x5a4b3e['offset']=qs['offset'](_0x1409d7[_0x6dc3('0x2f')]['offset']);}_0x5a4b3e[_0x6dc3('0x38')]=qs[_0x6dc3('0x39')](_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x39')]);_0x5a4b3e['where']=qs[_0x6dc3('0x31')](_[_0x6dc3('0x3a')](_0x1409d7[_0x6dc3('0x2f')],_0x10950f[_0x6dc3('0x31')]),_0x6c481f);if(_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x3b')]){_0x5a4b3e[_0x6dc3('0x3c')]=_[_0x6dc3('0x3d')](_0x5a4b3e[_0x6dc3('0x3c')],{'$or':_[_0x6dc3('0x2a')](_0x6c481f,function(_0x6b6d78){if(_0x6b6d78[_0x6dc3('0x2d')]!==_0x6dc3('0x3e')){var _0x2fb97f={};_0x2fb97f[_0x6b6d78['name']]={'$like':'%'+_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x3b')]+'%'};return _0x2fb97f;}})});}_0x5a4b3e=_[_0x6dc3('0x3d')]({},_0x5a4b3e,_0x1409d7[_0x6dc3('0x3f')]);var _0x463c4f={'where':_0x5a4b3e[_0x6dc3('0x3c')]};return db[_0x6dc3('0x2b')][_0x6dc3('0x1b')](_0x463c4f)[_0x6dc3('0x22')](function(_0x2ab6ec){_0x3f54af['count']=_0x2ab6ec;if(_0x1409d7[_0x6dc3('0x2f')][_0x6dc3('0x40')]){_0x5a4b3e[_0x6dc3('0x41')]=[{'all':!![]}];}return db[_0x6dc3('0x2b')]['findAll'](_0x5a4b3e);})[_0x6dc3('0x22')](function(_0x423ec4){_0x3f54af[_0x6dc3('0x42')]=_0x423ec4;return _0x3f54af;})[_0x6dc3('0x22')](respondWithFilteredResult(_0x76dcc8,_0x5a4b3e))[_0x6dc3('0x43')](handleError(_0x76dcc8,null));};exports[_0x6dc3('0x44')]=function(_0x2c159d,_0x52c0d8){var _0x5718ab={'raw':!![],'where':{'id':_0x2c159d['params']['id']}},_0x5b23a8={};_0x5b23a8[_0x6dc3('0x33')]=_['keys'](db[_0x6dc3('0x2b')][_0x6dc3('0x45')]);_0x5b23a8[_0x6dc3('0x2f')]=_[_0x6dc3('0x30')](_0x2c159d[_0x6dc3('0x2f')]);_0x5b23a8[_0x6dc3('0x31')]=_[_0x6dc3('0x32')](_0x5b23a8[_0x6dc3('0x33')],_0x5b23a8[_0x6dc3('0x2f')]);_0x5718ab[_0x6dc3('0x35')]=_['intersection'](_0x5b23a8[_0x6dc3('0x33')],qs[_0x6dc3('0x34')](_0x2c159d['query']['fields']));_0x5718ab[_0x6dc3('0x35')]=_0x5718ab[_0x6dc3('0x35')]['length']?_0x5718ab[_0x6dc3('0x35')]:_0x5b23a8[_0x6dc3('0x33')];if(_0x2c159d[_0x6dc3('0x2f')][_0x6dc3('0x40')]){_0x5718ab['include']=[{'all':!![]}];}_0x5718ab=_[_0x6dc3('0x3d')]({},_0x5718ab,_0x2c159d[_0x6dc3('0x3f')]);return db['AnalyticTreeReport'][_0x6dc3('0x46')](_0x5718ab)[_0x6dc3('0x22')](handleEntityNotFound(_0x52c0d8,null))[_0x6dc3('0x22')](respondWithResult(_0x52c0d8,null))['catch'](handleError(_0x52c0d8,null));};exports[_0x6dc3('0x47')]=function(_0x3f130d,_0x315644){return db[_0x6dc3('0x2b')][_0x6dc3('0x47')](_0x3f130d[_0x6dc3('0x48')],{})[_0x6dc3('0x22')](respondWithResult(_0x315644,0xc9))[_0x6dc3('0x43')](handleError(_0x315644,null));};exports['update']=function(_0x31ec0c,_0x366ba0){if(_0x31ec0c[_0x6dc3('0x48')]['id']){delete _0x31ec0c['body']['id'];}return db[_0x6dc3('0x2b')][_0x6dc3('0x46')]({'where':{'id':_0x31ec0c['params']['id']}})[_0x6dc3('0x22')](handleEntityNotFound(_0x366ba0,null))['then'](saveUpdates(_0x31ec0c[_0x6dc3('0x48')],null))['then'](respondWithResult(_0x366ba0,null))[_0x6dc3('0x43')](handleError(_0x366ba0,null));};exports['destroy']=function(_0x2f6ebc,_0x455ed9){return db[_0x6dc3('0x2b')]['find']({'where':{'id':_0x2f6ebc['params']['id']}})['then'](handleEntityNotFound(_0x455ed9,null))['then'](removeEntity(_0x455ed9,null))['catch'](handleError(_0x455ed9,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 287a8fc..ada6103 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 _0x05c4=['moment','bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','lodash','util','api'];(function(_0x285cf1,_0x47e330){var _0x2fea93=function(_0x4129d6){while(--_0x4129d6){_0x285cf1['push'](_0x285cf1['shift']());}};_0x2fea93(++_0x47e330);}(_0x05c4,0x1bf));var _0x405c=function(_0x3c7434,_0x3a1789){_0x3c7434=_0x3c7434-0x0;var _0x327695=_0x05c4[_0x3c7434];return _0x327695;};'use strict';var _=require(_0x405c('0x0'));var util=require(_0x405c('0x1'));var logger=require('../../config/logger')(_0x405c('0x2'));var moment=require(_0x405c('0x3'));var BPromise=require(_0x405c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x405c('0x5'));var config=require(_0x405c('0x6'));var attributes=require(_0x405c('0x7'));module[_0x405c('0x8')]=function(_0x482657,_0xf10793){return _0x482657['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8de8=['moment','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','lodash','util','../../config/logger','api'];(function(_0x396b94,_0x151de5){var _0xec6fa2=function(_0x454c26){while(--_0x454c26){_0x396b94['push'](_0x396b94['shift']());}};_0xec6fa2(++_0x151de5);}(_0x8de8,0xb0));var _0x88de=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8de8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x88de('0x0'));var util=require(_0x88de('0x1'));var logger=require(_0x88de('0x2'))(_0x88de('0x3'));var moment=require(_0x88de('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x88de('0x5'));var config=require('../../config/environment');var attributes=require(_0x88de('0x6'));module['exports']=function(_0x317b9c,_0x344973){return _0x317b9c[_0x88de('0x7')](_0x88de('0x8'),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 e6ec3d3..96f051d 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1ed052,_0xa3a348){var _0xcbd823=function(_0xee8588){while(--_0xee8588){_0x1ed052['push'](_0x1ed052['shift']());}};_0xcbd823(++_0xa3a348);}(_0xdb28,0x106));var _0x8db2=function(_0x16ac32,_0x48b274){_0x16ac32=_0x16ac32-0x0;var _0x1ad273=_0xdb28[_0x16ac32];return _0x1ad273;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ 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(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0xadb5,0xad));var _0x5adb=function(_0x2ca2bd,_0x53bb08){_0x2ca2bd=_0x2ca2bd-0x0;var _0x275f99=_0xadb5[_0x2ca2bd];return _0x275f99;};'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 4275bf3..c4802fe 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 _0xfacc=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfacc,0x1b0));var _0xcfac=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xfacc[_0x3b5049];return _0x12454e;};'use strict';var multer=require(_0xcfac('0x0'));var util=require(_0xcfac('0x1'));var path=require(_0xcfac('0x2'));var timeout=require(_0xcfac('0x3'));var express=require(_0xcfac('0x4'));var router=express['Router']();var fs_extra=require(_0xcfac('0x5'));var auth=require(_0xcfac('0x6'));var interaction=require(_0xcfac('0x7'));var config=require(_0xcfac('0x8'));var controller=require('./analyticTreeReport.controller');router[_0xcfac('0x9')]('/',auth[_0xcfac('0xa')](),controller['index']);router[_0xcfac('0x9')]('/:id',auth[_0xcfac('0xa')](),controller[_0xcfac('0xb')]);router['post']('/',auth[_0xcfac('0xa')](),controller[_0xcfac('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcfac('0xd')]);router['delete']('/:id',auth[_0xcfac('0xa')](),controller[_0xcfac('0xe')]);module[_0xcfac('0xf')]=router;
\ No newline at end of file
+var _0x32e5=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x3c40f4,_0x500b8a){var _0x1209d=function(_0x46b429){while(--_0x46b429){_0x3c40f4['push'](_0x3c40f4['shift']());}};_0x1209d(++_0x500b8a);}(_0x32e5,0x10c));var _0x532e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x32e5[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x532e('0x0'));var util=require(_0x532e('0x1'));var path=require(_0x532e('0x2'));var timeout=require(_0x532e('0x3'));var express=require(_0x532e('0x4'));var router=express[_0x532e('0x5')]();var fs_extra=require(_0x532e('0x6'));var auth=require(_0x532e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x532e('0x8'));var controller=require(_0x532e('0x9'));router[_0x532e('0xa')]('/',auth[_0x532e('0xb')](),controller[_0x532e('0xc')]);router[_0x532e('0xa')]('/:id',auth[_0x532e('0xb')](),controller[_0x532e('0xd')]);router[_0x532e('0xe')]('/',auth['isAuthenticated'](),controller[_0x532e('0xf')]);router[_0x532e('0x10')]('/:id',auth[_0x532e('0xb')](),controller[_0x532e('0x11')]);router[_0x532e('0x12')](_0x532e('0x13'),auth[_0x532e('0xb')](),controller[_0x532e('0x14')]);module[_0x532e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index e9032bf..aa64926 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 _0xcee0=['STRING','sequelize','exports'];(function(_0x166f54,_0x467e5c){var _0x41fc2b=function(_0x2481e3){while(--_0x2481e3){_0x166f54['push'](_0x166f54['shift']());}};_0x41fc2b(++_0x467e5c);}(_0xcee0,0x1e1));var _0x0cee=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0xcee0[_0x548200];return _0x1a6d74;};'use strict';var Sequelize=require(_0x0cee('0x0'));module[_0x0cee('0x1')]={'name':{'type':Sequelize[_0x0cee('0x2')]},'basename':{'type':Sequelize[_0x0cee('0x2')]},'type':{'type':Sequelize[_0x0cee('0x2')]}};
\ No newline at end of file
+var _0x9f75=['sequelize','STRING'];(function(_0x227b09,_0x2ea7ae){var _0x5f3571=function(_0x5916ae){while(--_0x5916ae){_0x227b09['push'](_0x227b09['shift']());}};_0x5f3571(++_0x2ea7ae);}(_0x9f75,0x15a));var _0x59f7=function(_0x2047a0,_0x18bde3){_0x2047a0=_0x2047a0-0x0;var _0x3c4bc1=_0x9f75[_0x2047a0];return _0x3c4bc1;};'use strict';var Sequelize=require(_0x59f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x59f7('0x1')]},'basename':{'type':Sequelize[_0x59f7('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 4b4c023..6903f5a 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 _0xc4ad=['../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','Attachment','rawAttributes','type','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','clone','get','omit','createdAt','updatedAt','body','create','destroy','originalname','file','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4ad,0x199));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdc4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc4a('0x1'));var jsonpatch=require(_0xdc4a('0x2'));var rp=require(_0xdc4a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdc4a('0x4'));var util=require('util');var path=require(_0xdc4a('0x5'));var sox=require('sox');var csv=require(_0xdc4a('0x6'));var ejs=require(_0xdc4a('0x7'));var fs=require('fs');var fs_extra=require(_0xdc4a('0x8'));var _=require(_0xdc4a('0x9'));var squel=require(_0xdc4a('0xa'));var crypto=require(_0xdc4a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdc4a('0xc'));var toCsv=require(_0xdc4a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdc4a('0xd'));var qs=require(_0xdc4a('0xe'));var as=require(_0xdc4a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc4a('0x10'))('api');var utils=require(_0xdc4a('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xdc4a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5712a2,_0x21a86f){_0x21a86f=_0x21a86f||0xcc;return function(_0x3c339c){if(_0x3c339c){return _0x5712a2[_0xdc4a('0x13')](_0x21a86f);}return _0x5712a2[_0xdc4a('0x14')](_0x21a86f)[_0xdc4a('0x15')]();};}function respondWithResult(_0x96b871,_0x4fc2b5){_0x4fc2b5=_0x4fc2b5||0xc8;return function(_0x41f8bf){if(_0x41f8bf){return _0x96b871[_0xdc4a('0x14')](_0x4fc2b5)[_0xdc4a('0x16')](_0x41f8bf);}};}function respondWithFilteredResult(_0x1e6685,_0x44d043){return function(_0x1981e3){if(_0x1981e3){var _0x24b290=typeof _0x44d043[_0xdc4a('0x17')]===_0xdc4a('0x18')&&typeof _0x44d043['limit']==='undefined';var _0x2dba72=_0x1981e3[_0xdc4a('0x19')];var _0x4ab303=_0x24b290?0x0:_0x44d043[_0xdc4a('0x17')];var _0xc7797a=_0x24b290?_0x1981e3['count']:_0x44d043['offset']+_0x44d043[_0xdc4a('0x1a')];var _0x39394c;if(_0xc7797a>=_0x2dba72){_0xc7797a=_0x2dba72;_0x39394c=0xc8;}else{_0x39394c=0xce;}_0x1e6685['status'](_0x39394c);return _0x1e6685[_0xdc4a('0x1b')](_0xdc4a('0x1c'),_0x4ab303+'-'+_0xc7797a+'/'+_0x2dba72)[_0xdc4a('0x16')](_0x1981e3);}return null;};}function patchUpdates(_0x461046){return function(_0x576bd6){try{jsonpatch[_0xdc4a('0x1d')](_0x576bd6,_0x461046,!![]);}catch(_0x3b9dea){return BPromise['reject'](_0x3b9dea);}return _0x576bd6[_0xdc4a('0x1e')]();};}function saveUpdates(_0x513daf,_0x3b0eb9){return function(_0x1d1ce0){if(_0x1d1ce0){return _0x1d1ce0[_0xdc4a('0x1f')](_0x513daf)[_0xdc4a('0x20')](function(_0x2884b8){return _0x2884b8;});}return null;};}function removeEntity(_0x566941,_0x11db05){return function(_0x5cf1cf){if(_0x5cf1cf){return _0x5cf1cf['destroy']()[_0xdc4a('0x20')](function(){_0x566941['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x587800,_0x1a8033){return function(_0x387c8a){if(!_0x387c8a){_0x587800[_0xdc4a('0x13')](0x194);}return _0x387c8a;};}function handleError(_0x4cf1cc,_0x3f89ab){_0x3f89ab=_0x3f89ab||0x1f4;return function(_0x52eaaa){logger[_0xdc4a('0x21')](_0x52eaaa[_0xdc4a('0x22')]);if(_0x52eaaa[_0xdc4a('0x23')]){delete _0x52eaaa[_0xdc4a('0x23')];}_0x4cf1cc[_0xdc4a('0x14')](_0x3f89ab)[_0xdc4a('0x24')](_0x52eaaa);};}exports[_0xdc4a('0x25')]=function(_0x4551be,_0x4ed91a){var _0xa2bc={},_0x5ad3a7={},_0x51dc1e={'count':0x0,'rows':[]};var _0x15d586=_[_0xdc4a('0x26')](db[_0xdc4a('0x27')][_0xdc4a('0x28')],function(_0x42540a){return{'name':_0x42540a['fieldName'],'type':_0x42540a[_0xdc4a('0x29')]['key']};});_0x5ad3a7[_0xdc4a('0x2a')]=_[_0xdc4a('0x26')](_0x15d586,'name');_0x5ad3a7[_0xdc4a('0x2b')]=_['keys'](_0x4551be[_0xdc4a('0x2b')]);_0x5ad3a7[_0xdc4a('0x2c')]=_['intersection'](_0x5ad3a7[_0xdc4a('0x2a')],_0x5ad3a7[_0xdc4a('0x2b')]);_0xa2bc[_0xdc4a('0x2d')]=_['intersection'](_0x5ad3a7['model'],qs[_0xdc4a('0x2e')](_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x2e')]));_0xa2bc[_0xdc4a('0x2d')]=_0xa2bc[_0xdc4a('0x2d')][_0xdc4a('0x2f')]?_0xa2bc[_0xdc4a('0x2d')]:_0x5ad3a7[_0xdc4a('0x2a')];if(!_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x30')]('nolimit')){_0xa2bc[_0xdc4a('0x1a')]=qs[_0xdc4a('0x1a')](_0x4551be[_0xdc4a('0x2b')]['limit']);_0xa2bc[_0xdc4a('0x17')]=qs[_0xdc4a('0x17')](_0x4551be['query'][_0xdc4a('0x17')]);}_0xa2bc['order']=qs['sort'](_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x31')]);_0xa2bc[_0xdc4a('0x32')]=qs[_0xdc4a('0x2c')](_[_0xdc4a('0x33')](_0x4551be[_0xdc4a('0x2b')],_0x5ad3a7[_0xdc4a('0x2c')]),_0x15d586);if(_0x4551be[_0xdc4a('0x2b')]['filter']){_0xa2bc[_0xdc4a('0x32')]=_[_0xdc4a('0x34')](_0xa2bc[_0xdc4a('0x32')],{'$or':_[_0xdc4a('0x26')](_0x15d586,function(_0x16e225){if(_0x16e225[_0xdc4a('0x29')]!==_0xdc4a('0x35')){var _0x5c3a9={};_0x5c3a9[_0x16e225[_0xdc4a('0x23')]]={'$like':'%'+_0x4551be['query'][_0xdc4a('0x36')]+'%'};return _0x5c3a9;}})});}_0xa2bc=_['merge']({},_0xa2bc,_0x4551be[_0xdc4a('0x37')]);var _0x593a24={'where':_0xa2bc[_0xdc4a('0x32')]};return db['Attachment'][_0xdc4a('0x19')](_0x593a24)[_0xdc4a('0x20')](function(_0x16d86a){_0x51dc1e[_0xdc4a('0x19')]=_0x16d86a;if(_0x4551be[_0xdc4a('0x2b')][_0xdc4a('0x38')]){_0xa2bc[_0xdc4a('0x39')]=[{'all':!![]}];}return db[_0xdc4a('0x27')][_0xdc4a('0x3a')](_0xa2bc);})['then'](function(_0x1ef02c){_0x51dc1e[_0xdc4a('0x3b')]=_0x1ef02c;return _0x51dc1e;})[_0xdc4a('0x20')](respondWithFilteredResult(_0x4ed91a,_0xa2bc))[_0xdc4a('0x3c')](handleError(_0x4ed91a,null));};exports[_0xdc4a('0x3d')]=function(_0x1a52f7,_0x453c58){var _0x169bfe={'raw':!![],'where':{'id':_0x1a52f7[_0xdc4a('0x3e')]['id']}},_0x5c54c5={};_0x5c54c5['model']=_[_0xdc4a('0x3f')](db[_0xdc4a('0x27')][_0xdc4a('0x28')]);_0x5c54c5['query']=_[_0xdc4a('0x3f')](_0x1a52f7['query']);_0x5c54c5[_0xdc4a('0x2c')]=_[_0xdc4a('0x40')](_0x5c54c5[_0xdc4a('0x2a')],_0x5c54c5[_0xdc4a('0x2b')]);_0x169bfe[_0xdc4a('0x2d')]=_[_0xdc4a('0x40')](_0x5c54c5[_0xdc4a('0x2a')],qs[_0xdc4a('0x2e')](_0x1a52f7[_0xdc4a('0x2b')][_0xdc4a('0x2e')]));_0x169bfe[_0xdc4a('0x2d')]=_0x169bfe[_0xdc4a('0x2d')]['length']?_0x169bfe[_0xdc4a('0x2d')]:_0x5c54c5['model'];if(_0x1a52f7['query'][_0xdc4a('0x38')]){_0x169bfe['include']=[{'all':!![]}];}_0x169bfe=_[_0xdc4a('0x34')]({},_0x169bfe,_0x1a52f7[_0xdc4a('0x37')]);return db[_0xdc4a('0x27')][_0xdc4a('0x41')](_0x169bfe)[_0xdc4a('0x20')](handleEntityNotFound(_0x453c58,null))[_0xdc4a('0x20')](respondWithResult(_0x453c58,null))[_0xdc4a('0x3c')](handleError(_0x453c58,null));};exports[_0xdc4a('0x42')]=function(_0x31e725,_0x54fac0){var _0x1f07cb={'where':{'id':_0x31e725['params']['id']}},_0x2cbb74={};_0x2cbb74[_0xdc4a('0x2a')]=_[_0xdc4a('0x3f')](db[_0xdc4a('0x27')]['rawAttributes']);_0x1f07cb[_0xdc4a('0x2d')]=_[_0xdc4a('0x40')](_0x2cbb74[_0xdc4a('0x2a')],qs[_0xdc4a('0x2e')](_0x31e725[_0xdc4a('0x2b')][_0xdc4a('0x2e')]));_0x1f07cb[_0xdc4a('0x2d')]=_0x1f07cb[_0xdc4a('0x2d')][_0xdc4a('0x2f')]?_0x1f07cb[_0xdc4a('0x2d')]:_0x2cbb74[_0xdc4a('0x2a')];if(_0x31e725[_0xdc4a('0x2b')]['includeAll']){_0x1f07cb[_0xdc4a('0x39')]=[{'all':!![]}];}_0x1f07cb=_[_0xdc4a('0x34')]({},_0x1f07cb,_0x31e725[_0xdc4a('0x37')]);return db['Attachment']['find'](_0x1f07cb)[_0xdc4a('0x20')](handleEntityNotFound(_0x54fac0,null))[_0xdc4a('0x20')](function(_0x1a1b35){if(_0x1a1b35){var _0x5d11a9=_0x1a1b35[_0xdc4a('0x43')]({'plain':!![]});_0x5d11a9=qs[_0xdc4a('0x44')](_0x5d11a9,['id',_0xdc4a('0x45'),_0xdc4a('0x46')]);_0x31e725[_0xdc4a('0x47')]=_['omit'](_0x31e725[_0xdc4a('0x47')],['id',_0xdc4a('0x45'),_0xdc4a('0x46')]);return db[_0xdc4a('0x27')][_0xdc4a('0x48')](_[_0xdc4a('0x34')](_0x5d11a9,_0x31e725[_0xdc4a('0x47')]),{'include':_0x31e725[_0xdc4a('0x2b')][_0xdc4a('0x38')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x54fac0,0xc9))[_0xdc4a('0x3c')](handleError(_0x54fac0,null));};exports[_0xdc4a('0x1f')]=function(_0x557d12,_0xa9a24b){if(_0x557d12['body']['id']){delete _0x557d12[_0xdc4a('0x47')]['id'];}return db[_0xdc4a('0x27')][_0xdc4a('0x41')]({'where':{'id':_0x557d12['params']['id']}})['then'](handleEntityNotFound(_0xa9a24b,null))[_0xdc4a('0x20')](saveUpdates(_0x557d12['body'],null))[_0xdc4a('0x20')](respondWithResult(_0xa9a24b,null))['catch'](handleError(_0xa9a24b,null));};exports[_0xdc4a('0x49')]=function(_0x1e3368,_0x3323b3){return db[_0xdc4a('0x27')][_0xdc4a('0x41')]({'where':{'id':_0x1e3368['params']['id']}})[_0xdc4a('0x20')](handleEntityNotFound(_0x3323b3,null))[_0xdc4a('0x20')](removeEntity(_0x3323b3,null))['catch'](handleError(_0x3323b3,null));};exports[_0xdc4a('0x48')]=function(_0x111e1f,_0x3fe274,_0x46c29e){_0x111e1f['body'][_0xdc4a('0x23')]=_0x111e1f['file'][_0xdc4a('0x4a')];_0x111e1f[_0xdc4a('0x47')]['basename']=_0x111e1f[_0xdc4a('0x4b')][_0xdc4a('0x4c')];_0x111e1f['body'][_0xdc4a('0x29')]=_0x111e1f['file'][_0xdc4a('0x4d')];return db[_0xdc4a('0x27')][_0xdc4a('0x48')](_0x111e1f[_0xdc4a('0x47')])[_0xdc4a('0x20')](respondWithResult(_0x3fe274,0xc9))[_0xdc4a('0x3c')](handleError(_0x3fe274,null));};exports['download']=function(_0x19047d,_0xc72d68,_0x40b5ca){return db[_0xdc4a('0x27')][_0xdc4a('0x4e')]({'where':{'id':_0x19047d[_0xdc4a('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xc72d68,null))[_0xdc4a('0x20')](function(_0x2a0a53){if(_0x2a0a53){var _0x50d01a=_0x2a0a53[_0xdc4a('0x4f')]!==null;var _0x4dc2ad=path[_0xdc4a('0x50')](config[_0xdc4a('0x51')],_0xdc4a('0x52'));if(_0x50d01a){_0x4dc2ad=path[_0xdc4a('0x50')](_0x4dc2ad,_0xdc4a('0x53'));}var _0x450ac4=path[_0xdc4a('0x50')](_0x4dc2ad,_0x2a0a53[_0xdc4a('0x54')]);return _0xc72d68['download'](_0x450ac4);}})[_0xdc4a('0x3c')](handleError(_0xc72d68,null));};
\ No newline at end of file
+var _0xcd09=['server/files/attachments/','join','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','api','../../config/utils','../../config/environment','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','sendStatus','stack','name','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','clone','get','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','findOne','root'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0xcd09,0x146));var _0x9cd0=function(_0x4b9806,_0x1517c0){_0x4b9806=_0x4b9806-0x0;var _0x12f4d4=_0xcd09[_0x4b9806];return _0x12f4d4;};'use strict';var emlformat=require(_0x9cd0('0x0'));var rimraf=require(_0x9cd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9cd0('0x2'));var moment=require('moment');var BPromise=require(_0x9cd0('0x3'));var Mustache=require('mustache');var util=require(_0x9cd0('0x4'));var path=require(_0x9cd0('0x5'));var sox=require(_0x9cd0('0x6'));var csv=require(_0x9cd0('0x7'));var ejs=require(_0x9cd0('0x8'));var fs=require('fs');var fs_extra=require(_0x9cd0('0x9'));var _=require(_0x9cd0('0xa'));var squel=require(_0x9cd0('0xb'));var crypto=require(_0x9cd0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9cd0('0xd'));var Redis=require(_0x9cd0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9cd0('0xf'));var utils=require(_0x9cd0('0x10'));var config=require(_0x9cd0('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50125e,_0x5ba17e){_0x5ba17e=_0x5ba17e||0xcc;return function(_0x32f2a6){if(_0x32f2a6){return _0x50125e['sendStatus'](_0x5ba17e);}return _0x50125e[_0x9cd0('0x12')](_0x5ba17e)['end']();};}function respondWithResult(_0x4d3e52,_0x49af7f){_0x49af7f=_0x49af7f||0xc8;return function(_0x3f46f8){if(_0x3f46f8){return _0x4d3e52['status'](_0x49af7f)[_0x9cd0('0x13')](_0x3f46f8);}};}function respondWithFilteredResult(_0x3087bf,_0x10e357){return function(_0x1b9dba){if(_0x1b9dba){var _0x56eb29=typeof _0x10e357['offset']===_0x9cd0('0x14')&&typeof _0x10e357[_0x9cd0('0x15')]===_0x9cd0('0x14');var _0x1c27a0=_0x1b9dba[_0x9cd0('0x16')];var _0x46f1eb=_0x56eb29?0x0:_0x10e357[_0x9cd0('0x17')];var _0xcd9223=_0x56eb29?_0x1b9dba[_0x9cd0('0x16')]:_0x10e357[_0x9cd0('0x17')]+_0x10e357[_0x9cd0('0x15')];var _0x42bd72;if(_0xcd9223>=_0x1c27a0){_0xcd9223=_0x1c27a0;_0x42bd72=0xc8;}else{_0x42bd72=0xce;}_0x3087bf[_0x9cd0('0x12')](_0x42bd72);return _0x3087bf[_0x9cd0('0x18')](_0x9cd0('0x19'),_0x46f1eb+'-'+_0xcd9223+'/'+_0x1c27a0)[_0x9cd0('0x13')](_0x1b9dba);}return null;};}function patchUpdates(_0x102a21){return function(_0x5041bd){try{jsonpatch[_0x9cd0('0x1a')](_0x5041bd,_0x102a21,!![]);}catch(_0x1b3f36){return BPromise['reject'](_0x1b3f36);}return _0x5041bd[_0x9cd0('0x1b')]();};}function saveUpdates(_0x1ef0a2,_0x129660){return function(_0x418a3a){if(_0x418a3a){return _0x418a3a['update'](_0x1ef0a2)[_0x9cd0('0x1c')](function(_0x4c62a7){return _0x4c62a7;});}return null;};}function removeEntity(_0x5c39b7,_0x44b83c){return function(_0x52697a){if(_0x52697a){return _0x52697a[_0x9cd0('0x1d')]()[_0x9cd0('0x1c')](function(){_0x5c39b7[_0x9cd0('0x12')](0xcc)[_0x9cd0('0x1e')]();});}};}function handleEntityNotFound(_0x51dee5,_0x3e3cc9){return function(_0x4cb856){if(!_0x4cb856){_0x51dee5[_0x9cd0('0x1f')](0x194);}return _0x4cb856;};}function handleError(_0x5cfd36,_0x11b0fe){_0x11b0fe=_0x11b0fe||0x1f4;return function(_0x50e319){logger['error'](_0x50e319[_0x9cd0('0x20')]);if(_0x50e319[_0x9cd0('0x21')]){delete _0x50e319['name'];}_0x5cfd36[_0x9cd0('0x12')](_0x11b0fe)['send'](_0x50e319);};}exports[_0x9cd0('0x22')]=function(_0x2c7d17,_0x583597){var _0x3216de={},_0x1c4591={},_0x537b51={'count':0x0,'rows':[]};var _0x59dec4=_['map'](db[_0x9cd0('0x23')][_0x9cd0('0x24')],function(_0x499d03){return{'name':_0x499d03[_0x9cd0('0x25')],'type':_0x499d03[_0x9cd0('0x26')]['key']};});_0x1c4591[_0x9cd0('0x27')]=_[_0x9cd0('0x28')](_0x59dec4,_0x9cd0('0x21'));_0x1c4591[_0x9cd0('0x29')]=_[_0x9cd0('0x2a')](_0x2c7d17['query']);_0x1c4591[_0x9cd0('0x2b')]=_[_0x9cd0('0x2c')](_0x1c4591[_0x9cd0('0x27')],_0x1c4591[_0x9cd0('0x29')]);_0x3216de[_0x9cd0('0x2d')]=_[_0x9cd0('0x2c')](_0x1c4591[_0x9cd0('0x27')],qs[_0x9cd0('0x2e')](_0x2c7d17[_0x9cd0('0x29')]['fields']));_0x3216de['attributes']=_0x3216de['attributes'][_0x9cd0('0x2f')]?_0x3216de[_0x9cd0('0x2d')]:_0x1c4591['model'];if(!_0x2c7d17['query'][_0x9cd0('0x30')](_0x9cd0('0x31'))){_0x3216de[_0x9cd0('0x15')]=qs['limit'](_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x15')]);_0x3216de[_0x9cd0('0x17')]=qs[_0x9cd0('0x17')](_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x17')]);}_0x3216de[_0x9cd0('0x32')]=qs[_0x9cd0('0x33')](_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x33')]);_0x3216de[_0x9cd0('0x34')]=qs['filters'](_[_0x9cd0('0x35')](_0x2c7d17[_0x9cd0('0x29')],_0x1c4591['filters']),_0x59dec4);if(_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x36')]){_0x3216de[_0x9cd0('0x34')]=_['merge'](_0x3216de[_0x9cd0('0x34')],{'$or':_[_0x9cd0('0x28')](_0x59dec4,function(_0x3f1bf3){if(_0x3f1bf3[_0x9cd0('0x26')]!=='VIRTUAL'){var _0x4b6ec={};_0x4b6ec[_0x3f1bf3[_0x9cd0('0x21')]]={'$like':'%'+_0x2c7d17[_0x9cd0('0x29')]['filter']+'%'};return _0x4b6ec;}})});}_0x3216de=_[_0x9cd0('0x37')]({},_0x3216de,_0x2c7d17[_0x9cd0('0x38')]);var _0x41749f={'where':_0x3216de[_0x9cd0('0x34')]};return db['Attachment'][_0x9cd0('0x16')](_0x41749f)[_0x9cd0('0x1c')](function(_0x3ad458){_0x537b51['count']=_0x3ad458;if(_0x2c7d17[_0x9cd0('0x29')][_0x9cd0('0x39')]){_0x3216de[_0x9cd0('0x3a')]=[{'all':!![]}];}return db[_0x9cd0('0x23')][_0x9cd0('0x3b')](_0x3216de);})[_0x9cd0('0x1c')](function(_0x45b468){_0x537b51[_0x9cd0('0x3c')]=_0x45b468;return _0x537b51;})[_0x9cd0('0x1c')](respondWithFilteredResult(_0x583597,_0x3216de))[_0x9cd0('0x3d')](handleError(_0x583597,null));};exports['show']=function(_0x438cc7,_0x9a7855){var _0x4ab421={'raw':!![],'where':{'id':_0x438cc7[_0x9cd0('0x3e')]['id']}},_0x589c69={};_0x589c69[_0x9cd0('0x27')]=_[_0x9cd0('0x2a')](db[_0x9cd0('0x23')][_0x9cd0('0x24')]);_0x589c69['query']=_[_0x9cd0('0x2a')](_0x438cc7['query']);_0x589c69[_0x9cd0('0x2b')]=_[_0x9cd0('0x2c')](_0x589c69[_0x9cd0('0x27')],_0x589c69[_0x9cd0('0x29')]);_0x4ab421[_0x9cd0('0x2d')]=_[_0x9cd0('0x2c')](_0x589c69[_0x9cd0('0x27')],qs[_0x9cd0('0x2e')](_0x438cc7[_0x9cd0('0x29')]['fields']));_0x4ab421[_0x9cd0('0x2d')]=_0x4ab421['attributes'][_0x9cd0('0x2f')]?_0x4ab421[_0x9cd0('0x2d')]:_0x589c69[_0x9cd0('0x27')];if(_0x438cc7[_0x9cd0('0x29')][_0x9cd0('0x39')]){_0x4ab421[_0x9cd0('0x3a')]=[{'all':!![]}];}_0x4ab421=_[_0x9cd0('0x37')]({},_0x4ab421,_0x438cc7[_0x9cd0('0x38')]);return db['Attachment'][_0x9cd0('0x3f')](_0x4ab421)[_0x9cd0('0x1c')](handleEntityNotFound(_0x9a7855,null))[_0x9cd0('0x1c')](respondWithResult(_0x9a7855,null))[_0x9cd0('0x3d')](handleError(_0x9a7855,null));};exports[_0x9cd0('0x40')]=function(_0xf724c5,_0x3268d4){var _0x8531e6={'where':{'id':_0xf724c5['params']['id']}},_0x241b69={};_0x241b69[_0x9cd0('0x27')]=_[_0x9cd0('0x2a')](db['Attachment']['rawAttributes']);_0x8531e6[_0x9cd0('0x2d')]=_[_0x9cd0('0x2c')](_0x241b69[_0x9cd0('0x27')],qs[_0x9cd0('0x2e')](_0xf724c5[_0x9cd0('0x29')][_0x9cd0('0x2e')]));_0x8531e6[_0x9cd0('0x2d')]=_0x8531e6[_0x9cd0('0x2d')][_0x9cd0('0x2f')]?_0x8531e6[_0x9cd0('0x2d')]:_0x241b69[_0x9cd0('0x27')];if(_0xf724c5[_0x9cd0('0x29')]['includeAll']){_0x8531e6[_0x9cd0('0x3a')]=[{'all':!![]}];}_0x8531e6=_[_0x9cd0('0x37')]({},_0x8531e6,_0xf724c5['options']);return db[_0x9cd0('0x23')]['find'](_0x8531e6)[_0x9cd0('0x1c')](handleEntityNotFound(_0x3268d4,null))[_0x9cd0('0x1c')](function(_0x2e0cc4){if(_0x2e0cc4){var _0x246c85=_0x2e0cc4[_0x9cd0('0x41')]({'plain':!![]});_0x246c85=qs[_0x9cd0('0x42')](_0x246c85,['id',_0x9cd0('0x43'),_0x9cd0('0x44')]);_0xf724c5[_0x9cd0('0x45')]=_[_0x9cd0('0x42')](_0xf724c5[_0x9cd0('0x45')],['id',_0x9cd0('0x43'),_0x9cd0('0x44')]);return db['Attachment']['create'](_['merge'](_0x246c85,_0xf724c5[_0x9cd0('0x45')]),{'include':_0xf724c5[_0x9cd0('0x29')][_0x9cd0('0x39')]?[{'all':!![]}]:undefined});}})[_0x9cd0('0x1c')](respondWithResult(_0x3268d4,0xc9))['catch'](handleError(_0x3268d4,null));};exports[_0x9cd0('0x46')]=function(_0x965d9f,_0x4ff14f){if(_0x965d9f['body']['id']){delete _0x965d9f[_0x9cd0('0x45')]['id'];}return db[_0x9cd0('0x23')][_0x9cd0('0x3f')]({'where':{'id':_0x965d9f[_0x9cd0('0x3e')]['id']}})[_0x9cd0('0x1c')](handleEntityNotFound(_0x4ff14f,null))[_0x9cd0('0x1c')](saveUpdates(_0x965d9f[_0x9cd0('0x45')],null))[_0x9cd0('0x1c')](respondWithResult(_0x4ff14f,null))[_0x9cd0('0x3d')](handleError(_0x4ff14f,null));};exports['destroy']=function(_0x35fe31,_0x5c0a6f){return db[_0x9cd0('0x23')][_0x9cd0('0x3f')]({'where':{'id':_0x35fe31[_0x9cd0('0x3e')]['id']}})[_0x9cd0('0x1c')](handleEntityNotFound(_0x5c0a6f,null))['then'](removeEntity(_0x5c0a6f,null))[_0x9cd0('0x3d')](handleError(_0x5c0a6f,null));};exports[_0x9cd0('0x47')]=function(_0x414eb4,_0x5daa2f,_0x83af03){_0x414eb4[_0x9cd0('0x45')][_0x9cd0('0x21')]=_0x414eb4[_0x9cd0('0x48')][_0x9cd0('0x49')];_0x414eb4[_0x9cd0('0x45')][_0x9cd0('0x4a')]=_0x414eb4['file'][_0x9cd0('0x4b')];_0x414eb4['body'][_0x9cd0('0x26')]=_0x414eb4[_0x9cd0('0x48')][_0x9cd0('0x4c')];return db[_0x9cd0('0x23')][_0x9cd0('0x47')](_0x414eb4[_0x9cd0('0x45')])[_0x9cd0('0x1c')](respondWithResult(_0x5daa2f,0xc9))['catch'](handleError(_0x5daa2f,null));};exports['download']=function(_0x2f09d6,_0x10c9c2,_0x5d9832){return db['Attachment'][_0x9cd0('0x4d')]({'where':{'id':_0x2f09d6[_0x9cd0('0x3e')]['id']},'raw':!![]})[_0x9cd0('0x1c')](handleEntityNotFound(_0x10c9c2,null))[_0x9cd0('0x1c')](function(_0x3bd1d1){if(_0x3bd1d1){var _0x15a351=_0x3bd1d1['ChatOfflineMessageId']!==null;var _0x50e1dc=path['join'](config[_0x9cd0('0x4e')],_0x9cd0('0x4f'));if(_0x15a351){_0x50e1dc=path['join'](_0x50e1dc,'offline-chat/');}var _0xe33c6a=path[_0x9cd0('0x50')](_0x50e1dc,_0x3bd1d1[_0x9cd0('0x4a')]);return _0x10c9c2['download'](_0xe33c6a);}})[_0x9cd0('0x3d')](handleError(_0x10c9c2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 204f77c..8182b62 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 _0xb0ec=['./attachment.attributes','exports','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3441e9,_0x269c8a){var _0x7f9ada=function(_0x4e62fd){while(--_0x4e62fd){_0x3441e9['push'](_0x3441e9['shift']());}};_0x7f9ada(++_0x269c8a);}(_0xb0ec,0x1f2));var _0xcb0e=function(_0x449c1f,_0x535bdb){_0x449c1f=_0x449c1f-0x0;var _0x1167e1=_0xb0ec[_0x449c1f];return _0x1167e1;};'use strict';var _=require(_0xcb0e('0x0'));var util=require(_0xcb0e('0x1'));var logger=require(_0xcb0e('0x2'))('api');var moment=require(_0xcb0e('0x3'));var BPromise=require(_0xcb0e('0x4'));var rp=require(_0xcb0e('0x5'));var fs=require('fs');var path=require(_0xcb0e('0x6'));var rimraf=require('rimraf');var config=require(_0xcb0e('0x7'));var attributes=require(_0xcb0e('0x8'));module[_0xcb0e('0x9')]=function(_0x42ec6d,_0x419391){return _0x42ec6d['define']('Attachment',attributes,{'tableName':_0xcb0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2e2=['bluebird','path','rimraf','../../config/environment','exports','define','attachments','util','../../config/logger','api','moment'];(function(_0x4547d5,_0x91d898){var _0x81ad1f=function(_0x593655){while(--_0x593655){_0x4547d5['push'](_0x4547d5['shift']());}};_0x81ad1f(++_0x91d898);}(_0xe2e2,0x10f));var _0x2e2e=function(_0x3b6413,_0x46403a){_0x3b6413=_0x3b6413-0x0;var _0x3da71a=_0xe2e2[_0x3b6413];return _0x3da71a;};'use strict';var _=require('lodash');var util=require(_0x2e2e('0x0'));var logger=require(_0x2e2e('0x1'))(_0x2e2e('0x2'));var moment=require(_0x2e2e('0x3'));var BPromise=require(_0x2e2e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e2e('0x5'));var rimraf=require(_0x2e2e('0x6'));var config=require(_0x2e2e('0x7'));var attributes=require('./attachment.attributes');module[_0x2e2e('0x8')]=function(_0x2ada93,_0x5e25ed){return _0x2ada93[_0x2e2e('0x9')]('Attachment',attributes,{'tableName':_0x2e2e('0xa'),'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 afa15f5..fedac5c 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 _0x131e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','Attachment,\x20%s,\x20%s','catch','Attachment','create','options','raw','CreateAttachment','bluebird','randomstring'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x131e,0x1ec));var _0xe131=function(_0x5ab086,_0x416037){_0x5ab086=_0x5ab086-0x0;var _0x44d263=_0x131e[_0x5ab086];return _0x44d263;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe131('0x0'));var rs=require(_0xe131('0x1'));var fs=require('fs');var Redis=require(_0xe131('0x2'));var db=require(_0xe131('0x3'))['db'];var utils=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('rpc');var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')][_0xe131('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1002a6,_0x48a90e,_0x5c4eb5){return new BPromise(function(_0x562617,_0x4bf386){return client[_0xe131('0xa')](_0x1002a6,_0x5c4eb5)[_0xe131('0xb')](function(_0x530ecb){logger[_0xe131('0xc')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0xe131('0xd'));logger[_0xe131('0xe')](_0xe131('0xf'),_0x48a90e,_0xe131('0xd'),JSON[_0xe131('0x10')](_0x530ecb));if(_0x530ecb[_0xe131('0x11')]){if(_0x530ecb[_0xe131('0x11')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x48a90e,_0x530ecb['error'][_0xe131('0x12')]);return _0x4bf386(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}logger[_0xe131('0x11')](_0xe131('0x13'),_0x48a90e,_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);return _0x562617(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x48a90e,'request\x20sent');_0x562617(_0x530ecb['result']['message']);}})[_0xe131('0x14')](function(_0x32091b){logger[_0xe131('0x11')]('Attachment,\x20%s,\x20%s',_0x48a90e,_0x32091b);_0x4bf386(_0x32091b);});});}exports['CreateAttachment']=function(_0x400f6b){var _0x2e2bf8=this;return new Promise(function(_0x3bbca8,_0x1a1e03){return db[_0xe131('0x15')][_0xe131('0x16')](_0x400f6b['body'],{'raw':_0x400f6b[_0xe131('0x17')]?_0x400f6b[_0xe131('0x17')][_0xe131('0x18')]===undefined?!![]:![]:!![]})[_0xe131('0xb')](function(_0x2d6c6b){logger['info']('CreateAttachment',_0x400f6b);logger[_0xe131('0xe')](_0xe131('0x19'),_0x400f6b,JSON['stringify'](_0x2d6c6b));_0x3bbca8(_0x2d6c6b);})[_0xe131('0x14')](function(_0x55b0c5){logger['error'](_0xe131('0x19'),_0x55b0c5[_0xe131('0x12')],_0x400f6b);_0x1a1e03(_0x2e2bf8[_0xe131('0x11')](0x1f4,_0x55b0c5[_0xe131('0x12')]));});});};
\ No newline at end of file
+var _0x3a25=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3c29bd,_0x3b2dd){var _0x451ecd=function(_0x2b6033){while(--_0x2b6033){_0x3c29bd['push'](_0x3c29bd['shift']());}};_0x451ecd(++_0x3b2dd);}(_0x3a25,0x15d));var _0x53a2=function(_0x23fc84,_0x2faf64){_0x23fc84=_0x23fc84-0x0;var _0x81fb8=_0x3a25[_0x23fc84];return _0x81fb8;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var moment=require(_0x53a2('0x2'));var BPromise=require(_0x53a2('0x3'));var rs=require(_0x53a2('0x4'));var fs=require('fs');var Redis=require(_0x53a2('0x5'));var db=require(_0x53a2('0x6'))['db'];var utils=require(_0x53a2('0x7'));var logger=require(_0x53a2('0x8'))(_0x53a2('0x9'));var config=require(_0x53a2('0xa'));var jayson=require(_0x53a2('0xb'));var client=jayson[_0x53a2('0xc')][_0x53a2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409fff,_0x4d53b8,_0x3ee956){return new BPromise(function(_0x5dc70e,_0x17aa09){return client[_0x53a2('0xe')](_0x409fff,_0x3ee956)[_0x53a2('0xf')](function(_0x42bf42){logger[_0x53a2('0x10')](_0x53a2('0x11'),_0x4d53b8,_0x53a2('0x12'));logger[_0x53a2('0x13')](_0x53a2('0x14'),_0x4d53b8,_0x53a2('0x12'),JSON['stringify'](_0x42bf42));if(_0x42bf42['error']){if(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x16')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x17aa09(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x5dc70e(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}else{logger[_0x53a2('0x10')]('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x53a2('0x12'));_0x5dc70e(_0x42bf42[_0x53a2('0x18')][_0x53a2('0x17')]);}})[_0x53a2('0x19')](function(_0x34c7de){logger['error']('Attachment,\x20%s,\x20%s',_0x4d53b8,_0x34c7de);_0x17aa09(_0x34c7de);});});}exports[_0x53a2('0x1a')]=function(_0x446b71){var _0x443c6e=this;return new Promise(function(_0x104fb6,_0x1d23f2){return db[_0x53a2('0x1b')]['create'](_0x446b71['body'],{'raw':_0x446b71[_0x53a2('0x1c')]?_0x446b71[_0x53a2('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x53a2('0xf')](function(_0x3fb15b){logger[_0x53a2('0x10')](_0x53a2('0x1a'),_0x446b71);logger['debug'](_0x53a2('0x1a'),_0x446b71,JSON[_0x53a2('0x1d')](_0x3fb15b));_0x104fb6(_0x3fb15b);})[_0x53a2('0x19')](function(_0x2cda68){logger[_0x53a2('0x15')](_0x53a2('0x1a'),_0x2cda68[_0x53a2('0x17')],_0x446b71);_0x1d23f2(_0x443c6e[_0x53a2('0x15')](0x1f4,_0x2cda68['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 945284f..b2ba38f 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f109c,_0xd9952e){_0x1f109c=_0x1f109c-0x0;var _0x3984e8=_0x0b0e[_0x1f109c];return _0x3984e8;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 1bd57a3..fc07271 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 _0xea1e=['minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','name','add'];(function(_0x179b61,_0x25ea0a){var _0x267877=function(_0x52973f){while(--_0x52973f){_0x179b61['push'](_0x179b61['shift']());}};_0x267877(++_0x25ea0a);}(_0xea1e,0x1e2));var _0xeea1=function(_0x19f424,_0x2cfb24){_0x19f424=_0x19f424-0x0;var _0x36977b=_0xea1e[_0x19f424];return _0x36977b;};'use strict';var passport=require(_0xeea1('0x0'));var LocalStrategy=require(_0xeea1('0x1'))['Strategy'];var moment=require(_0xeea1('0x2'));var ActiveDirectory=require(_0xeea1('0x3'));var BPromise=require(_0xeea1('0x4'));var util=require(_0xeea1('0x5'));var db=require(_0xeea1('0x6'))['db'];var authService=require(_0xeea1('0x7'));var utils=require(_0xeea1('0x8'));var config=require(_0xeea1('0x9'));var logger=require(_0xeea1('0xa'))(_0xeea1('0xb'));function isActiveDirectoryConfigured(_0x1b1047){var _0x36e1f0=![];if(typeof _0x1b1047[_0xeea1('0xc')]!==_0xeea1('0xd')){_0x36e1f0=_0x1b1047[_0xeea1('0xc')]['baseDN']&&_0x1b1047[_0xeea1('0xc')][_0xeea1('0xe')]&&_0x1b1047[_0xeea1('0xc')][_0xeea1('0xf')];}return _0x36e1f0;}function adAuthenticate(_0x238700,_0x406090,_0x5b0278){return new BPromise(function(_0x342b3f,_0x5875a5){try{var _0x48860c=new ActiveDirectory(_0x238700);_0x48860c[_0xeea1('0x10')](_0x406090,_0x5b0278,function(_0x3cee1b,_0x7414d9){if(_0x3cee1b){logger[_0xeea1('0x11')](_0xeea1('0x12'),_0x406090,util['inspect'](_0x3cee1b,{'showHidden':![],'depth':null}));_0x5875a5(_0xeea1('0x13'));}else if(!_0x7414d9){logger[_0xeea1('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x406090);_0x5875a5(_0xeea1('0x13'));}else{_0x342b3f(_0x7414d9);}});}catch(_0x1e4560){_0x5875a5(_0x1e4560);}});}function ActiveDirectoryAuthenticate(_0x2345ff,_0x326d3b,_0xf27be2,_0x1d0ccc){var _0x249f9f,_0x48ecdd;if(!isActiveDirectoryConfigured(config)){logger[_0xeea1('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x326d3b);return _0x1d0ccc(null,![],{'message':_0xeea1('0x13')});}return db[_0xeea1('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xeea1('0x15'),_0xeea1('0x16')],'raw':!![]})[_0xeea1('0x17')](function(_0x48b9c7){_0x249f9f=_0x48b9c7;if(!_0x249f9f[_0xeea1('0x15')]){logger['error'](_0xeea1('0x18'),_0x326d3b);throw new Error(_0xeea1('0x13'));}return _0x2345ff[_0xeea1('0x19')]({'attributes':['id','name',_0xeea1('0x1a'),_0xeea1('0x1b'),_0xeea1('0x1c'),_0xeea1('0x1d'),_0xeea1('0x1e'),_0xeea1('0x1f'),_0xeea1('0x20')],'where':{'name':_0x326d3b,'role':{'$or':[_0xeea1('0x21'),_0xeea1('0x22'),_0xeea1('0x23')]},'adSsoEnabled':!![]}});})[_0xeea1('0x17')](function(_0x534b71){if(!_0x534b71||_0x534b71&&_0x534b71[_0xeea1('0x24')]!==_0x326d3b){throw new Error(_0xeea1('0x13'));}_0x48ecdd=_0x534b71;var _0x4d50cb=_0x48ecdd['name']+'@'+config[_0xeea1('0xc')][_0xeea1('0xf')];return adAuthenticate(config[_0xeea1('0xc')],_0x4d50cb,_0xf27be2);})[_0xeea1('0x17')](function(_0x1604ff){if(_0x48ecdd[_0xeea1('0x1d')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x249f9f[_0xeea1('0x16')]>0x0){if(_0x48ecdd[_0xeea1('0x1e')]){if(moment(_0x48ecdd[_0xeea1('0x1f')])[_0xeea1('0x25')](_0x249f9f[_0xeea1('0x16')],_0xeea1('0x26'))>moment()){throw new Error(_0xeea1('0x13'));}return utils[_0xeea1('0x27')](_0x48ecdd,0x0,![],null)[_0xeea1('0x17')](function(){return utils['getLicense'](_0x48ecdd);})[_0xeea1('0x17')](function(){return _0x1d0ccc(null,_0x48ecdd);});}else{return utils['getLicense'](_0x48ecdd)['then'](function(){return _0x1d0ccc(null,_0x48ecdd);});}}else{return utils[_0xeea1('0x28')](_0x48ecdd)[_0xeea1('0x17')](function(){return _0x1d0ccc(null,_0x48ecdd);});}})[_0xeea1('0x29')](function(_0x45b8ff){return _0x1d0ccc(null,![],_0x45b8ff);});}function handleError(_0x44c26b,_0x4170b8,_0x3c1de8){return _0x44c26b[_0xeea1('0x2a')](_0x4170b8||0x1f4)[_0xeea1('0x2b')]({'message':_0x3c1de8?_0x3c1de8[_0xeea1('0x2c')]||_0x3c1de8:''});}exports[_0xeea1('0x2d')]=function(_0x4554a7,_0x44f98e,_0x20607d){passport[_0xeea1('0x10')](_0xeea1('0x2e'),function(_0xca38f2,_0x4cb210,_0x4a7d88){var _0xaae880=_0xca38f2||_0x4a7d88;if(_0xaae880){return handleError(_0x44f98e,0x191,_0xaae880);}if(!_0x4cb210){return handleError(_0x44f98e,0x194,{'message':_0xeea1('0x2f')});}else{var _0x1bbaed={'payload':{'id':_0x4cb210['id'],'role':_0x4cb210[_0xeea1('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xeea1('0x30')](_0x1bbaed)[_0xeea1('0x17')](function(_0x7a899e){_0x44f98e[_0xeea1('0x31')]({'id':_0x4cb210['id'],'token':_0x7a899e,'statusCall':'','isAlreadyLogged':_0x4cb210[_0xeea1('0x20')]});});}})(_0x4554a7,_0x44f98e,_0x20607d);};passport[_0xeea1('0x32')](_0xeea1('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x4c8449,_0x205b2e,_0x436e3d){return ActiveDirectoryAuthenticate(db[_0xeea1('0x33')],_0x4c8449,_0x205b2e,_0x436e3d);}));
\ No newline at end of file
+var _0x229e=['activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','blockDuration','then','adSsoEnabled','password','role','blocked','blockedAt','admin','agent','name','disabled','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','moment'];(function(_0x2dc954,_0xd124a){var _0x4dd96a=function(_0x3084f2){while(--_0x3084f2){_0x2dc954['push'](_0x2dc954['shift']());}};_0x4dd96a(++_0xd124a);}(_0x229e,0x12f));var _0xe229=function(_0x46b96d,_0x261e67){_0x46b96d=_0x46b96d-0x0;var _0x1a60e2=_0x229e[_0x46b96d];return _0x1a60e2;};'use strict';var passport=require(_0xe229('0x0'));var LocalStrategy=require(_0xe229('0x1'))['Strategy'];var moment=require(_0xe229('0x2'));var ActiveDirectory=require(_0xe229('0x3'));var BPromise=require(_0xe229('0x4'));var util=require(_0xe229('0x5'));var db=require(_0xe229('0x6'))['db'];var authService=require(_0xe229('0x7'));var utils=require(_0xe229('0x8'));var config=require(_0xe229('0x9'));var logger=require(_0xe229('0xa'))(_0xe229('0xb'));function isActiveDirectoryConfigured(_0x1d55e0){var _0x109044=![];if(typeof _0x1d55e0[_0xe229('0xc')]!==_0xe229('0xd')){_0x109044=_0x1d55e0[_0xe229('0xc')][_0xe229('0xe')]&&_0x1d55e0['activedirectory'][_0xe229('0xf')]&&_0x1d55e0['activedirectory'][_0xe229('0x10')];}return _0x109044;}function adAuthenticate(_0x3efa43,_0xa8197c,_0x52980e){return new BPromise(function(_0xb577b9,_0x331a41){try{var _0x1b8ae5=new ActiveDirectory(_0x3efa43);_0x1b8ae5['authenticate'](_0xa8197c,_0x52980e,function(_0x69c952,_0x499a7d){if(_0x69c952){logger[_0xe229('0x11')](_0xe229('0x12'),_0xa8197c,util[_0xe229('0x13')](_0x69c952,{'showHidden':![],'depth':null}));_0x331a41('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x499a7d){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xa8197c);_0x331a41('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xb577b9(_0x499a7d);}});}catch(_0xd0c4ef){_0x331a41(_0xd0c4ef);}});}function ActiveDirectoryAuthenticate(_0x462808,_0x54b4e4,_0x239a29,_0x2d2102){var _0x24eb1b,_0x3f8d1e;if(!isActiveDirectoryConfigured(config)){logger[_0xe229('0x11')](_0xe229('0x14'),_0x54b4e4);return _0x2d2102(null,![],{'message':_0xe229('0x15')});}return db[_0xe229('0x16')][_0xe229('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xe229('0x18')],'raw':!![]})[_0xe229('0x19')](function(_0x58f7c5){_0x24eb1b=_0x58f7c5;if(!_0x24eb1b[_0xe229('0x1a')]){logger[_0xe229('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x54b4e4);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x462808[_0xe229('0x17')]({'attributes':['id','name',_0xe229('0x1b'),'salt',_0xe229('0x1c'),'disabled',_0xe229('0x1d'),_0xe229('0x1e'),'online'],'where':{'name':_0x54b4e4,'role':{'$or':[_0xe229('0x1f'),'user',_0xe229('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x2bc8b3){if(!_0x2bc8b3||_0x2bc8b3&&_0x2bc8b3[_0xe229('0x21')]!==_0x54b4e4){throw new Error(_0xe229('0x15'));}_0x3f8d1e=_0x2bc8b3;var _0x14c927=_0x3f8d1e[_0xe229('0x21')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xe229('0xc')],_0x14c927,_0x239a29);})[_0xe229('0x19')](function(_0x466c05){if(_0x3f8d1e[_0xe229('0x22')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x24eb1b['blockDuration']>0x0){if(_0x3f8d1e[_0xe229('0x1d')]){if(moment(_0x3f8d1e[_0xe229('0x1e')])[_0xe229('0x23')](_0x24eb1b[_0xe229('0x18')],_0xe229('0x24'))>moment()){throw new Error(_0xe229('0x15'));}return utils[_0xe229('0x25')](_0x3f8d1e,0x0,![],null)['then'](function(){return utils[_0xe229('0x26')](_0x3f8d1e);})[_0xe229('0x19')](function(){return _0x2d2102(null,_0x3f8d1e);});}else{return utils['getLicense'](_0x3f8d1e)[_0xe229('0x19')](function(){return _0x2d2102(null,_0x3f8d1e);});}}else{return utils[_0xe229('0x26')](_0x3f8d1e)[_0xe229('0x19')](function(){return _0x2d2102(null,_0x3f8d1e);});}})[_0xe229('0x27')](function(_0x5a8d5b){return _0x2d2102(null,![],_0x5a8d5b);});}function handleError(_0x44be0e,_0x2aedef,_0x2a429a){return _0x44be0e[_0xe229('0x28')](_0x2aedef||0x1f4)[_0xe229('0x29')]({'message':_0x2a429a?_0x2a429a[_0xe229('0x2a')]||_0x2a429a:''});}exports[_0xe229('0x2b')]=function(_0x2a5977,_0x3d532c,_0xe2c571){passport[_0xe229('0x2c')](_0xe229('0x2d'),function(_0x315fd8,_0x4eeb5b,_0x516ec2){var _0x2734a0=_0x315fd8||_0x516ec2;if(_0x2734a0){return handleError(_0x3d532c,0x191,_0x2734a0);}if(!_0x4eeb5b){return handleError(_0x3d532c,0x194,{'message':_0xe229('0x2e')});}else{var _0x4a48eb={'payload':{'id':_0x4eeb5b['id'],'role':_0x4eeb5b['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4a48eb)[_0xe229('0x19')](function(_0x582589){_0x3d532c[_0xe229('0x2f')]({'id':_0x4eeb5b['id'],'token':_0x582589,'statusCall':'','isAlreadyLogged':_0x4eeb5b[_0xe229('0x30')]});});}})(_0x2a5977,_0x3d532c,_0xe2c571);};passport[_0xe229('0x31')](_0xe229('0x2d'),new LocalStrategy({'usernameField':_0xe229('0x21'),'passwordField':_0xe229('0x1b')},function(_0x570b0c,_0x589078,_0x1465fc){return ActiveDirectoryAuthenticate(db[_0xe229('0x32')],_0x570b0c,_0x589078,_0x1465fc);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index ece38da..11bd273 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 _0xb0e1=['Router','./authActiveDirectory.controller','login','express'];(function(_0x55ff79,_0x3d45e7){var _0x579067=function(_0x3650e4){while(--_0x3650e4){_0x55ff79['push'](_0x55ff79['shift']());}};_0x579067(++_0x3d45e7);}(_0xb0e1,0x1bf));var _0x1b0e=function(_0x22e482,_0x84f6fa){_0x22e482=_0x22e482-0x0;var _0x422831=_0xb0e1[_0x22e482];return _0x422831;};'use strict';var express=require(_0x1b0e('0x0'));var router=express[_0x1b0e('0x1')]();var controller=require(_0x1b0e('0x2'));router['post']('/',controller[_0x1b0e('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0x9b0a=['./authActiveDirectory.controller','post','exports'];(function(_0x4e59ea,_0x3a9ec7){var _0x59e499=function(_0x212203){while(--_0x212203){_0x4e59ea['push'](_0x4e59ea['shift']());}};_0x59e499(++_0x3a9ec7);}(_0x9b0a,0x19e));var _0xa9b0=function(_0x1a7fa7,_0x231925){_0x1a7fa7=_0x1a7fa7-0x0;var _0x4051de=_0x9b0a[_0x1a7fa7];return _0x4051de;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa9b0('0x0'));router[_0xa9b0('0x1')]('/',controller['login']);module[_0xa9b0('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index ba1dd2e..6526e5c 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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x123c18,_0x19fcbf){_0x123c18=_0x123c18-0x0;var _0x245224=_0x7a54[_0x123c18];return _0x245224;};'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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x58f8d3,_0x4cfe56){var _0x32c52b=function(_0x5203d8){while(--_0x5203d8){_0x58f8d3['push'](_0x58f8d3['shift']());}};_0x32c52b(++_0x4cfe56);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 7183a7e..9090024 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 _0x5146=['../user/user.controller.js','../../components/auth/service','get','setTokenCookie','express','passport','Router'];(function(_0x5a3b69,_0xe3f11e){var _0x3bf016=function(_0x270344){while(--_0x270344){_0x5a3b69['push'](_0x5a3b69['shift']());}};_0x3bf016(++_0xe3f11e);}(_0x5146,0xc8));var _0x6514=function(_0x25fa85,_0x41e865){_0x25fa85=_0x25fa85-0x0;var _0x2fbfc4=_0x5146[_0x25fa85];return _0x2fbfc4;};'use strict';var express=require(_0x6514('0x0'));var passport=require(_0x6514('0x1'));var router=express[_0x6514('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x6514('0x3'));var authService=require(_0x6514('0x4'));router[_0x6514('0x5')]('/',controller['login']);router['get']('/callback',controller['callback'],authService['isMiddleware'],userController['login'],authService[_0x6514('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x786b=['passport','Router','../user/user.controller.js','../../components/auth/service','get','login','setTokenCookie','exports','express'];(function(_0x2608f2,_0x30abd2){var _0x478ee6=function(_0x570e28){while(--_0x570e28){_0x2608f2['push'](_0x2608f2['shift']());}};_0x478ee6(++_0x30abd2);}(_0x786b,0x74));var _0xb786=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x786b[_0x456fb1];return _0x4083d6;};'use strict';var express=require(_0xb786('0x0'));var passport=require(_0xb786('0x1'));var router=express[_0xb786('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xb786('0x3'));var authService=require(_0xb786('0x4'));router[_0xb786('0x5')]('/',controller[_0xb786('0x6')]);router[_0xb786('0x5')]('/callback',controller['callback'],authService['isMiddleware'],userController[_0xb786('0x6')],authService[_0xb786('0x7')]);module[_0xb786('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index edfe3d1..a7f65b7 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 _0xc66a=['add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','use','local-login','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked'];(function(_0x3f3514,_0x4dbfea){var _0x1203de=function(_0x3e4603){while(--_0x3e4603){_0x3f3514['push'](_0x3f3514['shift']());}};_0x1203de(++_0x4dbfea);}(_0xc66a,0xd5));var _0xac66=function(_0x4fe0f0,_0x1ce43e){_0x4fe0f0=_0x4fe0f0-0x0;var _0x52f107=_0xc66a[_0x4fe0f0];return _0x52f107;};'use strict';var util=require('util');var passport=require(_0xac66('0x0'));var LocalStrategy=require(_0xac66('0x1'))[_0xac66('0x2')];var jayson=require(_0xac66('0x3'));var _=require(_0xac66('0x4'));var rs=require(_0xac66('0x5'));var moment=require(_0xac66('0x6'));var db=require(_0xac66('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xac66('0x8'));var client=jayson[_0xac66('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x4a6764,_0x680195,_0x3c376b,_0x2d90f5){var _0x26330f,_0x43715e;return db[_0xac66('0xa')][_0xac66('0xb')]({'where':{'id':0x1},'attributes':[_0xac66('0xc'),_0xac66('0xd')],'raw':!![]})[_0xac66('0xe')](function(_0xde3da2){_0x26330f=_0xde3da2;return _0x4a6764[_0xac66('0xb')]({'attributes':['id',_0xac66('0xf'),_0xac66('0x10'),'salt',_0xac66('0x11'),_0xac66('0x12'),'blocked',_0xac66('0x13'),_0xac66('0x14')],'where':{'name':_0x680195,'role':{'$or':[_0xac66('0x15'),_0xac66('0x16'),_0xac66('0x17')]}}});})[_0xac66('0xe')](function(_0x746bb9){if(!_0x746bb9||_0x746bb9&&_0x746bb9['name']!==_0x680195){throw new Error(_0xac66('0x18'));}else{_0x43715e=_0x746bb9;return _0x43715e;}})[_0xac66('0xe')](function(){_0x43715e[_0xac66('0x19')](_0x3c376b,function(_0x207fe7,_0x33d9c8){var _0x46d7cf=_0x43715e[_0xac66('0x14')]+0x1;if(_0x207fe7){return _0x2d90f5(_0x207fe7);}else if(!_0x33d9c8){if(_0x43715e['disabled']){return _0x2d90f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x26330f[_0xac66('0xc')]>0x0){if(_0x43715e[_0xac66('0x1a')]){if(_0x26330f['blockDuration']>0x0){if(moment(_0x43715e[_0xac66('0x13')])[_0xac66('0x1b')](_0x26330f[_0xac66('0xd')],_0xac66('0x1c'))>moment()){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else{return utils['clearBlockUser'](_0x43715e,_0x46d7cf,![],null)[_0xac66('0xe')](function(){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});});}}else{return _0x2d90f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x46d7cf>=_0x26330f[_0xac66('0xc')]){return utils[_0xac66('0x1d')](_0x43715e,0x0,!![],moment())['then'](function(){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});});}else{return utils['clearBlockUser'](_0x43715e,_0x46d7cf,![],null)['then'](function(){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});});}}}else{return _0x2d90f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x43715e[_0xac66('0x12')]){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else if(_0x26330f[_0xac66('0xc')]>0x0){if(_0x43715e[_0xac66('0x1a')]){if(_0x26330f[_0xac66('0xd')]>0x0){if(moment(_0x43715e[_0xac66('0x13')])['add'](_0x26330f[_0xac66('0xd')],_0xac66('0x1c'))>moment()){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else{return utils[_0xac66('0x1d')](_0x43715e,0x0,![],null)['then'](function(){return utils[_0xac66('0x1e')](_0x43715e);})[_0xac66('0xe')](function(){return _0x2d90f5(null,_0x43715e);});}}else{return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}}else{return utils[_0xac66('0x1d')](_0x43715e,0x0,![],null)[_0xac66('0xe')](function(){return utils[_0xac66('0x1e')](_0x43715e);})[_0xac66('0xe')](function(){return _0x2d90f5(null,_0x43715e);})[_0xac66('0x1f')](function(_0x3c8c3d){return _0x2d90f5(null,![],_0x3c8c3d);});}}else{if(_0x43715e[_0xac66('0x1a')]){return _0x2d90f5(null,![],{'message':_0xac66('0x18')});}else{return utils['getLicense'](_0x43715e)[_0xac66('0xe')](function(){return _0x2d90f5(null,_0x43715e);});}}}});})[_0xac66('0x1f')](function(_0x34b758){return _0x2d90f5(null,![],_0x34b758);});}function sendServiceMail(_0x3e802c){return db[_0xac66('0x20')][_0xac66('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xac66('0x22'),'include':[{'model':db[_0xac66('0x23')],'as':_0xac66('0x23')}]}]})[_0xac66('0xe')](function(_0x1535a2){if(!_0x1535a2){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x24dcb3=_0x1535a2[_0xac66('0x24')]();var _0x4a54fd={'account':_0x24dcb3,'message':_['merge']({'from':util[_0xac66('0x25')](_0xac66('0x26'),_0x1535a2['name'],_0x1535a2[_0xac66('0x27')]||_0x1535a2['Smtp'][_0xac66('0x16')])},_0x3e802c)};return client[_0xac66('0x28')](_0xac66('0x29'),_0x4a54fd);})['then'](function(_0x52e075){if(_0x52e075[_0xac66('0x2a')]){throw new Error(util['format'](_0xac66('0x2b'),_0x52e075['error'][_0xac66('0x2c')]||JSON[_0xac66('0x2d')](_0x52e075[_0xac66('0x2a')])));}return!![];});}function handleError(_0x3f24c5,_0x108d27,_0x4a899b){return _0x3f24c5[_0xac66('0x2e')](_0x108d27||0x1f4)[_0xac66('0x2f')]({'message':_0x4a899b?_0x4a899b[_0xac66('0x2c')]||_0x4a899b:''});}exports[_0xac66('0x30')]=function(_0x1a6710,_0x953559,_0x4ab467){passport['authenticate']('local-login',function(_0x21178c,_0x3beade,_0x5ca875){var _0x2661f3=_0x21178c||_0x5ca875;if(_0x2661f3){return handleError(_0x953559,0x191,_0x2661f3);}if(!_0x3beade){return handleError(_0x953559,0x194,{'message':_0xac66('0x31')});}else{var _0x4107cd={'payload':{'id':_0x3beade['id'],'role':_0x3beade['role']},'options':{'expiresIn':0x15180}};return authService[_0xac66('0x32')](_0x4107cd)[_0xac66('0xe')](function(_0x22d262){_0x953559['json']({'id':_0x3beade['id'],'token':_0x22d262,'statusCall':'','isAlreadyLogged':_0x3beade['online']});});}})(_0x1a6710,_0x953559,_0x4ab467);};exports[_0xac66('0x33')]=function(_0x131157,_0x151ba2){if(!_0x131157[_0xac66('0x34')][_0xac66('0x27')]){return handleError(_0x151ba2,0x1f4,{'message':_0xac66('0x35')});}var _0xb3632e=rs['generate']();_0x131157[_0xac66('0x34')]['email']=_0x131157['body'][_0xac66('0x27')][_0xac66('0x36')]()[_0xac66('0x37')]();var _0x7c1cb1;return db[_0xac66('0xa')][_0xac66('0xb')]({'where':{'id':0x1},'attributes':[_0xac66('0xc'),_0xac66('0xd')],'raw':!![]})[_0xac66('0xe')](function(_0x1fd5c2){_0x7c1cb1=_0x1fd5c2;return db[_0xac66('0x38')][_0xac66('0x21')]({'where':{'email':_0x131157['body'][_0xac66('0x27')]}});})[_0xac66('0xe')](function(_0x50c3cb){if(!_0x50c3cb){throw new Error(_0xac66('0x39'));}if(_0x50c3cb['disabled']){throw new Error(_0xac66('0x3a'));}if(_0x50c3cb[_0xac66('0x1a')]){if(moment(_0x50c3cb[_0xac66('0x13')])['add'](_0x7c1cb1[_0xac66('0xd')],'minutes')>moment()){throw new Error(_0xac66('0x3b'));}else{_0x50c3cb[_0xac66('0x1a')]=![];_0x50c3cb[_0xac66('0x13')]=null;}}_0x50c3cb[_0xac66('0x3c')]=_0xb3632e;_0x50c3cb[_0xac66('0x3d')]=Date['now']()+0x36ee80;return _0x50c3cb[_0xac66('0x3e')]();})[_0xac66('0xe')](function(){return sendServiceMail({'to':_0x131157[_0xac66('0x34')][_0xac66('0x27')],'subject':_0xac66('0x3f'),'text':_0xac66('0x40')+_0xac66('0x41')+_0xac66('0x42')+_0x131157[_0xac66('0x43')]['host']+'/reset/'+_0xb3632e+'\x0a\x0a'+_0xac66('0x44')});})[_0xac66('0xe')](function(){_0x151ba2[_0xac66('0x2e')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x260a83){return handleError(_0x151ba2,0x1f4,_0x260a83);});};exports[_0xac66('0x45')]=function(_0x448f36,_0x467233){return db['User']['find']({'where':{'resetPasswordToken':_0x448f36[_0xac66('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0xac66('0x47')]()}}})[_0xac66('0xe')](function(_0x381bfd){if(!_0x381bfd){throw new Error(_0xac66('0x48'));}return db[_0xac66('0xa')][_0xac66('0xb')]({'attributes':['id',_0xac66('0x49'),_0xac66('0x4a'),_0xac66('0x4b')]})[_0xac66('0xe')](function(_0x37937d){if(_0x37937d[_0xac66('0x49')])authService['validatePasswordPattern'](_0x448f36[_0xac66('0x34')][_0xac66('0x10')]);if(!_0x37937d[_0xac66('0x4a')]||!_0x381bfd[_0xac66('0x4c')])return _0x381bfd;authService[_0xac66('0x4d')](_0x448f36[_0xac66('0x34')]['password'],_0x381bfd[_0xac66('0x4c')],_0x37937d[_0xac66('0x4b')]);return _0x381bfd;})[_0xac66('0xe')](function(){_0x381bfd['password']=_0x448f36[_0xac66('0x34')][_0xac66('0x10')];_0x381bfd[_0xac66('0x3c')]=null;_0x381bfd[_0xac66('0x3d')]=null;return _0x381bfd[_0xac66('0x3e')]();});})[_0xac66('0xe')](function(){_0x467233['status'](0xc8)[_0xac66('0x2f')]({'message':'Password\x20reset!'});})[_0xac66('0x1f')](function(_0x3050f){return handleError(_0x467233,0x1f4,_0x3050f);});};passport[_0xac66('0x4e')](_0xac66('0x4f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x2c60a4,_0x417717,_0x44c4e0){return localAuthenticate(db[_0xac66('0x38')],_0x2c60a4,_0x417717,_0x44c4e0);}));
\ No newline at end of file
+var _0x6c6c=['login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','Smtp','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send'];(function(_0x430b69,_0xe239db){var _0x46cf15=function(_0x2baecd){while(--_0x2baecd){_0x430b69['push'](_0x430b69['shift']());}};_0x46cf15(++_0xe239db);}(_0x6c6c,0xd0));var _0xc6c6=function(_0x52e38c,_0x2f1f97){_0x52e38c=_0x52e38c-0x0;var _0xfd46c6=_0x6c6c[_0x52e38c];return _0xfd46c6;};'use strict';var util=require(_0xc6c6('0x0'));var passport=require(_0xc6c6('0x1'));var LocalStrategy=require(_0xc6c6('0x2'))['Strategy'];var jayson=require(_0xc6c6('0x3'));var _=require(_0xc6c6('0x4'));var rs=require('randomstring');var moment=require(_0xc6c6('0x5'));var db=require(_0xc6c6('0x6'))['db'];var authService=require(_0xc6c6('0x7'));var utils=require(_0xc6c6('0x8'));var client=jayson[_0xc6c6('0x9')][_0xc6c6('0xa')]({'port':0x232b});function localAuthenticate(_0x5e7be3,_0x4b8d54,_0x1b4dc8,_0x4dbe0a){var _0x2f7ba2,_0x44276e;return db[_0xc6c6('0xb')][_0xc6c6('0xc')]({'where':{'id':0x1},'attributes':[_0xc6c6('0xd'),_0xc6c6('0xe')],'raw':!![]})[_0xc6c6('0xf')](function(_0x20ad59){_0x2f7ba2=_0x20ad59;return _0x5e7be3[_0xc6c6('0xc')]({'attributes':['id',_0xc6c6('0x10'),_0xc6c6('0x11'),_0xc6c6('0x12'),_0xc6c6('0x13'),_0xc6c6('0x14'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x4b8d54,'role':{'$or':[_0xc6c6('0x15'),_0xc6c6('0x16'),_0xc6c6('0x17')]}}});})[_0xc6c6('0xf')](function(_0x2a4646){if(!_0x2a4646||_0x2a4646&&_0x2a4646[_0xc6c6('0x10')]!==_0x4b8d54){throw new Error(_0xc6c6('0x18'));}else{_0x44276e=_0x2a4646;return _0x44276e;}})[_0xc6c6('0xf')](function(){_0x44276e['authenticate'](_0x1b4dc8,function(_0x5601b5,_0x595d36){var _0x1e355f=_0x44276e[_0xc6c6('0x19')]+0x1;if(_0x5601b5){return _0x4dbe0a(_0x5601b5);}else if(!_0x595d36){if(_0x44276e[_0xc6c6('0x14')]){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else if(_0x2f7ba2[_0xc6c6('0xd')]>0x0){if(_0x44276e[_0xc6c6('0x1a')]){if(_0x2f7ba2[_0xc6c6('0xe')]>0x0){if(moment(_0x44276e[_0xc6c6('0x1b')])[_0xc6c6('0x1c')](_0x2f7ba2['blockDuration'],_0xc6c6('0x1d'))>moment()){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else{return utils[_0xc6c6('0x1e')](_0x44276e,_0x1e355f,![],null)['then'](function(){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});});}}else{return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}}else{if(_0x1e355f>=_0x2f7ba2['allowedLoginAttempts']){return utils[_0xc6c6('0x1e')](_0x44276e,0x0,!![],moment())[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});});}else{return utils[_0xc6c6('0x1e')](_0x44276e,_0x1e355f,![],null)['then'](function(){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});});}}}else{return _0x4dbe0a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x44276e[_0xc6c6('0x14')]){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else if(_0x2f7ba2[_0xc6c6('0xd')]>0x0){if(_0x44276e[_0xc6c6('0x1a')]){if(_0x2f7ba2[_0xc6c6('0xe')]>0x0){if(moment(_0x44276e[_0xc6c6('0x1b')])[_0xc6c6('0x1c')](_0x2f7ba2['blockDuration'],'minutes')>moment()){return _0x4dbe0a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc6c6('0x1e')](_0x44276e,0x0,![],null)[_0xc6c6('0xf')](function(){return utils['getLicense'](_0x44276e);})[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,_0x44276e);});}}else{return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}}else{return utils[_0xc6c6('0x1e')](_0x44276e,0x0,![],null)[_0xc6c6('0xf')](function(){return utils[_0xc6c6('0x1f')](_0x44276e);})[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,_0x44276e);})[_0xc6c6('0x20')](function(_0x53b653){return _0x4dbe0a(null,![],_0x53b653);});}}else{if(_0x44276e[_0xc6c6('0x1a')]){return _0x4dbe0a(null,![],{'message':_0xc6c6('0x18')});}else{return utils['getLicense'](_0x44276e)[_0xc6c6('0xf')](function(){return _0x4dbe0a(null,_0x44276e);});}}}});})[_0xc6c6('0x20')](function(_0x4e8731){return _0x4dbe0a(null,![],_0x4e8731);});}function sendServiceMail(_0x47d904){return db[_0xc6c6('0x21')][_0xc6c6('0x22')]({'where':{'service':!![]},'attributes':['id',_0xc6c6('0x10'),'email'],'include':[{'model':db[_0xc6c6('0x23')],'as':'Smtp','include':[{'model':db[_0xc6c6('0x24')],'as':_0xc6c6('0x24')}]}]})['then'](function(_0x3b7d9b){if(!_0x3b7d9b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3bc4e2=_0x3b7d9b[_0xc6c6('0x25')]();var _0x110931={'account':_0x3bc4e2,'message':_[_0xc6c6('0x26')]({'from':util[_0xc6c6('0x27')](_0xc6c6('0x28'),_0x3b7d9b[_0xc6c6('0x10')],_0x3b7d9b[_0xc6c6('0x29')]||_0x3b7d9b[_0xc6c6('0x2a')][_0xc6c6('0x16')])},_0x47d904)};return client['request'](_0xc6c6('0x2b'),_0x110931);})[_0xc6c6('0xf')](function(_0x1ac9f6){if(_0x1ac9f6[_0xc6c6('0x2c')]){throw new Error(util[_0xc6c6('0x27')](_0xc6c6('0x2d'),_0x1ac9f6[_0xc6c6('0x2c')][_0xc6c6('0x2e')]||JSON[_0xc6c6('0x2f')](_0x1ac9f6[_0xc6c6('0x2c')])));}return!![];});}function handleError(_0x228970,_0x1f191e,_0x41a4ae){return _0x228970[_0xc6c6('0x30')](_0x1f191e||0x1f4)[_0xc6c6('0x31')]({'message':_0x41a4ae?_0x41a4ae['message']||_0x41a4ae:''});}exports[_0xc6c6('0x32')]=function(_0x3246b3,_0x303dff,_0x44c2f5){passport[_0xc6c6('0x33')](_0xc6c6('0x34'),function(_0x5830bd,_0x2d77db,_0x2c0ce5){var _0x35a752=_0x5830bd||_0x2c0ce5;if(_0x35a752){return handleError(_0x303dff,0x191,_0x35a752);}if(!_0x2d77db){return handleError(_0x303dff,0x194,{'message':_0xc6c6('0x35')});}else{var _0x2a29d3={'payload':{'id':_0x2d77db['id'],'role':_0x2d77db[_0xc6c6('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xc6c6('0x36')](_0x2a29d3)[_0xc6c6('0xf')](function(_0x524284){_0x303dff['json']({'id':_0x2d77db['id'],'token':_0x524284,'statusCall':'','isAlreadyLogged':_0x2d77db[_0xc6c6('0x37')]});});}})(_0x3246b3,_0x303dff,_0x44c2f5);};exports[_0xc6c6('0x38')]=function(_0x26e2fe,_0x39a191){if(!_0x26e2fe[_0xc6c6('0x39')][_0xc6c6('0x29')]){return handleError(_0x39a191,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x444f55=rs[_0xc6c6('0x3a')]();_0x26e2fe['body']['email']=_0x26e2fe[_0xc6c6('0x39')][_0xc6c6('0x29')][_0xc6c6('0x3b')]()['toLowerCase']();var _0x1d1af3;return db[_0xc6c6('0xb')][_0xc6c6('0xc')]({'where':{'id':0x1},'attributes':[_0xc6c6('0xd'),_0xc6c6('0xe')],'raw':!![]})['then'](function(_0x28fe5b){_0x1d1af3=_0x28fe5b;return db[_0xc6c6('0x3c')]['find']({'where':{'email':_0x26e2fe[_0xc6c6('0x39')][_0xc6c6('0x29')]}});})[_0xc6c6('0xf')](function(_0x183cdb){if(!_0x183cdb){throw new Error(_0xc6c6('0x3d'));}if(_0x183cdb[_0xc6c6('0x14')]){throw new Error(_0xc6c6('0x3e'));}if(_0x183cdb['blocked']){if(moment(_0x183cdb[_0xc6c6('0x1b')])['add'](_0x1d1af3[_0xc6c6('0xe')],_0xc6c6('0x1d'))>moment()){throw new Error(_0xc6c6('0x3f'));}else{_0x183cdb['blocked']=![];_0x183cdb[_0xc6c6('0x1b')]=null;}}_0x183cdb[_0xc6c6('0x40')]=_0x444f55;_0x183cdb[_0xc6c6('0x41')]=Date[_0xc6c6('0x42')]()+0x36ee80;return _0x183cdb['save']();})[_0xc6c6('0xf')](function(){return sendServiceMail({'to':_0x26e2fe[_0xc6c6('0x39')]['email'],'subject':_0xc6c6('0x43'),'text':_0xc6c6('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x26e2fe[_0xc6c6('0x45')][_0xc6c6('0x46')]+_0xc6c6('0x47')+_0x444f55+'\x0a\x0a'+_0xc6c6('0x48')});})[_0xc6c6('0xf')](function(){_0x39a191['status'](0xc8)[_0xc6c6('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0xc6c6('0x20')](function(_0x4402d2){return handleError(_0x39a191,0x1f4,_0x4402d2);});};exports[_0xc6c6('0x49')]=function(_0x990fb2,_0x4d03d7){return db[_0xc6c6('0x3c')][_0xc6c6('0x22')]({'where':{'resetPasswordToken':_0x990fb2[_0xc6c6('0x4a')][_0xc6c6('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xc6c6('0x42')]()}}})['then'](function(_0x3f370d){if(!_0x3f370d){throw new Error(_0xc6c6('0x4c'));}return db['Setting']['findOne']({'attributes':['id',_0xc6c6('0x4d'),_0xc6c6('0x4e'),_0xc6c6('0x4f')]})[_0xc6c6('0xf')](function(_0x3f3c39){if(_0x3f3c39[_0xc6c6('0x4d')])authService[_0xc6c6('0x50')](_0x990fb2[_0xc6c6('0x39')][_0xc6c6('0x11')]);if(!_0x3f3c39['enforcePasswordHistory']||!_0x3f370d[_0xc6c6('0x51')])return _0x3f370d;authService[_0xc6c6('0x52')](_0x990fb2['body'][_0xc6c6('0x11')],_0x3f370d[_0xc6c6('0x51')],_0x3f3c39[_0xc6c6('0x4f')]);return _0x3f370d;})[_0xc6c6('0xf')](function(){_0x3f370d['password']=_0x990fb2[_0xc6c6('0x39')]['password'];_0x3f370d[_0xc6c6('0x40')]=null;_0x3f370d[_0xc6c6('0x41')]=null;return _0x3f370d[_0xc6c6('0x53')]();});})[_0xc6c6('0xf')](function(){_0x4d03d7[_0xc6c6('0x30')](0xc8)[_0xc6c6('0x31')]({'message':_0xc6c6('0x54')});})[_0xc6c6('0x20')](function(_0x1e7659){return handleError(_0x4d03d7,0x1f4,_0x1e7659);});};passport[_0xc6c6('0x55')](_0xc6c6('0x34'),new LocalStrategy({'usernameField':_0xc6c6('0x10'),'passwordField':'password'},function(_0x1b1f98,_0x555d97,_0x34892e){return localAuthenticate(db[_0xc6c6('0x3c')],_0x1b1f98,_0x555d97,_0x34892e);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index be52a79..043cda0 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 _0xcf79=['reset','exports','express','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x1c8b71,_0x2fca5f){var _0x253dc8=function(_0x12b73f){while(--_0x12b73f){_0x1c8b71['push'](_0x1c8b71['shift']());}};_0x253dc8(++_0x2fca5f);}(_0xcf79,0x8a));var _0x9cf7=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xcf79[_0x13d07a];return _0x5ee0ee;};'use strict';var express=require(_0x9cf7('0x0'));var router=express['Router']();var controller=require(_0x9cf7('0x1'));router[_0x9cf7('0x2')]('/',controller[_0x9cf7('0x3')]);router['post'](_0x9cf7('0x4'),controller[_0x9cf7('0x5')]);router['post']('/reset/:token',controller[_0x9cf7('0x6')]);module[_0x9cf7('0x7')]=router;
\ No newline at end of file
+var _0x64dc=['login','/forgot','forgot','exports','express','post'];(function(_0x430838,_0x59b323){var _0x2434ca=function(_0x398f72){while(--_0x398f72){_0x430838['push'](_0x430838['shift']());}};_0x2434ca(++_0x59b323);}(_0x64dc,0x9a));var _0xc64d=function(_0xb7ec6c,_0x186d95){_0xb7ec6c=_0xb7ec6c-0x0;var _0x447f9b=_0x64dc[_0xb7ec6c];return _0x447f9b;};'use strict';var express=require(_0xc64d('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xc64d('0x1')]('/',controller[_0xc64d('0x2')]);router[_0xc64d('0x1')](_0xc64d('0x3'),controller[_0xc64d('0x4')]);router['post']('/reset/:token',controller['reset']);module[_0xc64d('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 8456e9c..5f5db35 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 _0xda8e=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x73301c,_0x3fd870){var _0x1f357b=function(_0x42e027){while(--_0x42e027){_0x73301c['push'](_0x73301c['shift']());}};_0x1f357b(++_0x3fd870);}(_0xda8e,0x1d8));var _0xeda8=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0xda8e[_0x5d8018];return _0x151ac4;};'use strict';var Sequelize=require(_0xeda8('0x0'));module[_0xeda8('0x1')]={'name':{'type':Sequelize[_0xeda8('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xeda8('0x2')]},'description':{'type':Sequelize[_0xeda8('0x2')]},'status':{'type':Sequelize[_0xeda8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xeda8('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xaf77=['exports','STRING','INTEGER','sequelize'];(function(_0x25d9a5,_0x261467){var _0x1fc72a=function(_0x4d6a63){while(--_0x4d6a63){_0x25d9a5['push'](_0x25d9a5['shift']());}};_0x1fc72a(++_0x261467);}(_0xaf77,0x10b));var _0x7af7=function(_0x220268,_0x4da70e){_0x220268=_0x220268-0x0;var _0x4f6e56=_0xaf77[_0x220268];return _0x4f6e56;};'use strict';var Sequelize=require(_0x7af7('0x0'));module[_0x7af7('0x1')]={'name':{'type':Sequelize[_0x7af7('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7af7('0x2')]},'description':{'type':Sequelize[_0x7af7('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7af7('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index e80b59d..13d6d4b 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 _0xa02e=['omit','ids','getConditions','findOne','keys','Condition','pick','addActions','Action','getActions','rawAttributes','rimraf','zip-dir','request-promise','moment','bluebird','util','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','save','update','error','stack','name','send','index','map','Automation','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','include','findAll','rows','show','params','find','catch','create','body','destroy','addConditions'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa02e,0xa9));var _0xea02=function(_0x593cc7,_0x3a2a1d){_0x593cc7=_0x593cc7-0x0;var _0x31e78e=_0xa02e[_0x593cc7];return _0x31e78e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea02('0x0'));var zipdir=require(_0xea02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea02('0x2'));var moment=require(_0xea02('0x3'));var BPromise=require(_0xea02('0x4'));var Mustache=require('mustache');var util=require(_0xea02('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea02('0x6'));var crypto=require(_0xea02('0x7'));var jsforce=require(_0xea02('0x8'));var deskjs=require(_0xea02('0x9'));var toCsv=require('to-csv');var querystring=require(_0xea02('0xa'));var Papa=require(_0xea02('0xb'));var Redis=require(_0xea02('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea02('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea02('0xe'))(_0xea02('0xf'));var utils=require(_0xea02('0x10'));var config=require(_0xea02('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xea02('0x12'))['db'];function respondWithStatusCode(_0xb01ad8,_0x30e352){_0x30e352=_0x30e352||0xcc;return function(_0x43fe16){if(_0x43fe16){return _0xb01ad8[_0xea02('0x13')](_0x30e352);}return _0xb01ad8[_0xea02('0x14')](_0x30e352)[_0xea02('0x15')]();};}function respondWithResult(_0x584c49,_0x3c77ba){_0x3c77ba=_0x3c77ba||0xc8;return function(_0x4d14db){if(_0x4d14db){return _0x584c49['status'](_0x3c77ba)['json'](_0x4d14db);}};}function respondWithFilteredResult(_0x2003cd,_0x5b6c16){return function(_0x5ba5ec){if(_0x5ba5ec){var _0x6e6c9d=typeof _0x5b6c16['offset']==='undefined'&&typeof _0x5b6c16[_0xea02('0x16')]===_0xea02('0x17');var _0x1c1d8b=_0x5ba5ec[_0xea02('0x18')];var _0x36b9cc=_0x6e6c9d?0x0:_0x5b6c16[_0xea02('0x19')];var _0xd45455=_0x6e6c9d?_0x5ba5ec[_0xea02('0x18')]:_0x5b6c16['offset']+_0x5b6c16[_0xea02('0x16')];var _0x52de4f;if(_0xd45455>=_0x1c1d8b){_0xd45455=_0x1c1d8b;_0x52de4f=0xc8;}else{_0x52de4f=0xce;}_0x2003cd[_0xea02('0x14')](_0x52de4f);return _0x2003cd['set'](_0xea02('0x1a'),_0x36b9cc+'-'+_0xd45455+'/'+_0x1c1d8b)[_0xea02('0x1b')](_0x5ba5ec);}return null;};}function patchUpdates(_0x555c1b){return function(_0x45a123){try{jsonpatch[_0xea02('0x1c')](_0x45a123,_0x555c1b,!![]);}catch(_0x4b44ca){return BPromise['reject'](_0x4b44ca);}return _0x45a123[_0xea02('0x1d')]();};}function saveUpdates(_0xde33e5,_0x30bb33){return function(_0x213c1f){if(_0x213c1f){return _0x213c1f[_0xea02('0x1e')](_0xde33e5)['then'](function(_0x2a4394){return _0x2a4394;});}return null;};}function removeEntity(_0x35f20b,_0x402462){return function(_0x31772c){if(_0x31772c){return _0x31772c['destroy']()['then'](function(){_0x35f20b['status'](0xcc)[_0xea02('0x15')]();});}};}function handleEntityNotFound(_0x282267,_0x2fc0f6){return function(_0xd23b65){if(!_0xd23b65){_0x282267[_0xea02('0x13')](0x194);}return _0xd23b65;};}function handleError(_0x3028d4,_0xd002e1){_0xd002e1=_0xd002e1||0x1f4;return function(_0x108413){logger[_0xea02('0x1f')](_0x108413[_0xea02('0x20')]);if(_0x108413[_0xea02('0x21')]){delete _0x108413[_0xea02('0x21')];}_0x3028d4['status'](_0xd002e1)[_0xea02('0x22')](_0x108413);};}exports[_0xea02('0x23')]=function(_0x4fd4bd,_0x44842a){var _0x4df794={},_0xe15a3f={},_0x1a2db5={'count':0x0,'rows':[]};var _0xf22d58=_[_0xea02('0x24')](db[_0xea02('0x25')]['rawAttributes'],function(_0x1ff315){return{'name':_0x1ff315[_0xea02('0x26')],'type':_0x1ff315[_0xea02('0x27')]['key']};});_0xe15a3f[_0xea02('0x28')]=_['map'](_0xf22d58,_0xea02('0x21'));_0xe15a3f[_0xea02('0x29')]=_['keys'](_0x4fd4bd['query']);_0xe15a3f[_0xea02('0x2a')]=_[_0xea02('0x2b')](_0xe15a3f[_0xea02('0x28')],_0xe15a3f[_0xea02('0x29')]);_0x4df794[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0xe15a3f[_0xea02('0x28')],qs[_0xea02('0x2d')](_0x4fd4bd[_0xea02('0x29')][_0xea02('0x2d')]));_0x4df794[_0xea02('0x2c')]=_0x4df794['attributes'][_0xea02('0x2e')]?_0x4df794[_0xea02('0x2c')]:_0xe15a3f[_0xea02('0x28')];if(!_0x4fd4bd[_0xea02('0x29')][_0xea02('0x2f')](_0xea02('0x30'))){_0x4df794[_0xea02('0x16')]=qs[_0xea02('0x16')](_0x4fd4bd[_0xea02('0x29')][_0xea02('0x16')]);_0x4df794[_0xea02('0x19')]=qs['offset'](_0x4fd4bd[_0xea02('0x29')][_0xea02('0x19')]);}_0x4df794[_0xea02('0x31')]=qs[_0xea02('0x32')](_0x4fd4bd['query'][_0xea02('0x32')]);_0x4df794[_0xea02('0x33')]=qs[_0xea02('0x2a')](_['pick'](_0x4fd4bd[_0xea02('0x29')],_0xe15a3f[_0xea02('0x2a')]),_0xf22d58);if(_0x4fd4bd['query'][_0xea02('0x34')]){_0x4df794['where']=_[_0xea02('0x35')](_0x4df794[_0xea02('0x33')],{'$or':_[_0xea02('0x24')](_0xf22d58,function(_0x50fb47){if(_0x50fb47[_0xea02('0x27')]!==_0xea02('0x36')){var _0x1f7545={};_0x1f7545[_0x50fb47[_0xea02('0x21')]]={'$like':'%'+_0x4fd4bd[_0xea02('0x29')]['filter']+'%'};return _0x1f7545;}})});}_0x4df794=_[_0xea02('0x35')]({},_0x4df794,_0x4fd4bd[_0xea02('0x37')]);var _0x5036c8={'where':_0x4df794['where']};return db[_0xea02('0x25')][_0xea02('0x18')](_0x5036c8)[_0xea02('0x38')](function(_0x37b234){_0x1a2db5['count']=_0x37b234;if(_0x4fd4bd[_0xea02('0x29')]['includeAll']){_0x4df794[_0xea02('0x39')]=[{'all':!![]}];}return db[_0xea02('0x25')][_0xea02('0x3a')](_0x4df794);})[_0xea02('0x38')](function(_0x101414){_0x1a2db5[_0xea02('0x3b')]=_0x101414;return _0x1a2db5;})[_0xea02('0x38')](respondWithFilteredResult(_0x44842a,_0x4df794))['catch'](handleError(_0x44842a,null));};exports[_0xea02('0x3c')]=function(_0x46e250,_0x2358ee){var _0x2c4eb9={'raw':![],'where':{'id':_0x46e250[_0xea02('0x3d')]['id']}},_0x3cb504={};_0x3cb504[_0xea02('0x28')]=_['keys'](db[_0xea02('0x25')]['rawAttributes']);_0x3cb504[_0xea02('0x29')]=_['keys'](_0x46e250['query']);_0x3cb504['filters']=_[_0xea02('0x2b')](_0x3cb504['model'],_0x3cb504[_0xea02('0x29')]);_0x2c4eb9['attributes']=_[_0xea02('0x2b')](_0x3cb504[_0xea02('0x28')],qs[_0xea02('0x2d')](_0x46e250[_0xea02('0x29')][_0xea02('0x2d')]));_0x2c4eb9[_0xea02('0x2c')]=_0x2c4eb9['attributes']['length']?_0x2c4eb9[_0xea02('0x2c')]:_0x3cb504[_0xea02('0x28')];if(_0x46e250[_0xea02('0x29')]['includeAll']){_0x2c4eb9['include']=[{'all':!![]}];}_0x2c4eb9=_[_0xea02('0x35')]({},_0x2c4eb9,_0x46e250[_0xea02('0x37')]);return db['Automation'][_0xea02('0x3e')](_0x2c4eb9)['then'](handleEntityNotFound(_0x2358ee,null))[_0xea02('0x38')](respondWithResult(_0x2358ee,null))[_0xea02('0x3f')](handleError(_0x2358ee,null));};exports[_0xea02('0x40')]=function(_0x587c04,_0x3c6142){return db[_0xea02('0x25')]['create'](_0x587c04[_0xea02('0x41')],{})[_0xea02('0x38')](respondWithResult(_0x3c6142,0xc9))[_0xea02('0x3f')](handleError(_0x3c6142,null));};exports[_0xea02('0x1e')]=function(_0x1e078a,_0x8d3dfa){if(_0x1e078a['body']['id']){delete _0x1e078a[_0xea02('0x41')]['id'];}return db[_0xea02('0x25')][_0xea02('0x3e')]({'where':{'id':_0x1e078a[_0xea02('0x3d')]['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x8d3dfa,null))[_0xea02('0x38')](saveUpdates(_0x1e078a['body'],null))[_0xea02('0x38')](respondWithResult(_0x8d3dfa,null))[_0xea02('0x3f')](handleError(_0x8d3dfa,null));};exports[_0xea02('0x42')]=function(_0x513383,_0x475e09){return db[_0xea02('0x25')][_0xea02('0x3e')]({'where':{'id':_0x513383['params']['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x475e09,null))[_0xea02('0x38')](removeEntity(_0x475e09,null))[_0xea02('0x3f')](handleError(_0x475e09,null));};exports['addConditions']=function(_0x2215ae,_0x32775e,_0x5a42ce){return db['Condition'][_0xea02('0x3e')]({'where':{'id':_0x2215ae[_0xea02('0x3d')]['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x32775e,null))[_0xea02('0x38')](function(_0x232551){if(_0x232551){return _0x232551[_0xea02('0x43')](_0x2215ae[_0xea02('0x41')]['ids'],_[_0xea02('0x44')](_0x2215ae[_0xea02('0x41')],[_0xea02('0x45'),'id'])||{});}})[_0xea02('0x38')](respondWithResult(_0x32775e,null))['catch'](handleError(_0x32775e,null));};exports[_0xea02('0x46')]=function(_0x5e0ef8,_0x15f13f,_0x203d13){var _0x4837d1={};var _0x4a5d3f={};var _0x19f192;var _0x5219b0;return db[_0xea02('0x25')][_0xea02('0x47')]({'where':{'id':_0x5e0ef8['params']['id']}})[_0xea02('0x38')](handleEntityNotFound(_0x15f13f,null))['then'](function(_0x5b5336){if(_0x5b5336){_0x19f192=_0x5b5336;_0x4a5d3f[_0xea02('0x28')]=_[_0xea02('0x48')](db[_0xea02('0x49')]['rawAttributes']);_0x4a5d3f[_0xea02('0x29')]=_[_0xea02('0x48')](_0x5e0ef8[_0xea02('0x29')]);_0x4a5d3f[_0xea02('0x2a')]=_[_0xea02('0x2b')](_0x4a5d3f[_0xea02('0x28')],_0x4a5d3f[_0xea02('0x29')]);_0x4837d1[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0x4a5d3f[_0xea02('0x28')],qs[_0xea02('0x2d')](_0x5e0ef8[_0xea02('0x29')][_0xea02('0x2d')]));_0x4837d1[_0xea02('0x2c')]=_0x4837d1[_0xea02('0x2c')][_0xea02('0x2e')]?_0x4837d1[_0xea02('0x2c')]:_0x4a5d3f['model'];_0x4837d1[_0xea02('0x31')]=qs['sort'](_0x5e0ef8[_0xea02('0x29')][_0xea02('0x32')]);_0x4837d1['where']=qs[_0xea02('0x2a')](_[_0xea02('0x4a')](_0x5e0ef8[_0xea02('0x29')],_0x4a5d3f['filters']));if(_0x5e0ef8[_0xea02('0x29')]['filter']){_0x4837d1[_0xea02('0x33')]=_[_0xea02('0x35')](_0x4837d1[_0xea02('0x33')],{'$or':_['map'](_0x4837d1[_0xea02('0x2c')],function(_0x2b3bc9){var _0x36bd4d={};_0x36bd4d[_0x2b3bc9]={'$like':'%'+_0x5e0ef8['query'][_0xea02('0x34')]+'%'};return _0x36bd4d;})});}_0x4837d1=_[_0xea02('0x35')]({},_0x4837d1,_0x5e0ef8[_0xea02('0x37')]);return _0x19f192[_0xea02('0x46')](_0x4837d1);}})[_0xea02('0x38')](function(_0x2f6646){if(_0x2f6646){_0x5219b0=_0x2f6646[_0xea02('0x2e')];if(!_0x5e0ef8['query']['hasOwnProperty'](_0xea02('0x30'))){_0x4837d1[_0xea02('0x16')]=qs['limit'](_0x5e0ef8[_0xea02('0x29')]['limit']);_0x4837d1[_0xea02('0x19')]=qs['offset'](_0x5e0ef8['query'][_0xea02('0x19')]);}return _0x19f192[_0xea02('0x46')](_0x4837d1);}})[_0xea02('0x38')](function(_0x25865b){if(_0x25865b){return _0x25865b?{'count':_0x5219b0,'rows':_0x25865b}:null;}})[_0xea02('0x38')](respondWithResult(_0x15f13f,null))[_0xea02('0x3f')](handleError(_0x15f13f,null));};exports[_0xea02('0x4b')]=function(_0x42865f,_0x5ac349,_0x23f6ea){return db[_0xea02('0x4c')][_0xea02('0x3e')]({'where':{'id':_0x42865f[_0xea02('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ac349,null))[_0xea02('0x38')](function(_0x46ae63){if(_0x46ae63){return _0x46ae63[_0xea02('0x4b')](_0x42865f[_0xea02('0x41')]['ids'],_[_0xea02('0x44')](_0x42865f[_0xea02('0x41')],['ids','id'])||{});}})[_0xea02('0x38')](respondWithResult(_0x5ac349,null))['catch'](handleError(_0x5ac349,null));};exports[_0xea02('0x4d')]=function(_0xccfe,_0x26ebab,_0x142687){var _0x5acceb={};var _0x14b547={};var _0x373737;var _0x231088;return db['Automation']['findOne']({'where':{'id':_0xccfe[_0xea02('0x3d')]['id']}})['then'](handleEntityNotFound(_0x26ebab,null))[_0xea02('0x38')](function(_0x3fe6b0){if(_0x3fe6b0){_0x373737=_0x3fe6b0;_0x14b547['model']=_[_0xea02('0x48')](db['Action'][_0xea02('0x4e')]);_0x14b547['query']=_[_0xea02('0x48')](_0xccfe[_0xea02('0x29')]);_0x14b547['filters']=_['intersection'](_0x14b547[_0xea02('0x28')],_0x14b547[_0xea02('0x29')]);_0x5acceb[_0xea02('0x2c')]=_[_0xea02('0x2b')](_0x14b547['model'],qs['fields'](_0xccfe['query']['fields']));_0x5acceb['attributes']=_0x5acceb[_0xea02('0x2c')]['length']?_0x5acceb['attributes']:_0x14b547[_0xea02('0x28')];_0x5acceb['order']=qs['sort'](_0xccfe[_0xea02('0x29')][_0xea02('0x32')]);_0x5acceb[_0xea02('0x33')]=qs[_0xea02('0x2a')](_[_0xea02('0x4a')](_0xccfe[_0xea02('0x29')],_0x14b547[_0xea02('0x2a')]));if(_0xccfe[_0xea02('0x29')][_0xea02('0x34')]){_0x5acceb['where']=_[_0xea02('0x35')](_0x5acceb[_0xea02('0x33')],{'$or':_['map'](_0x5acceb[_0xea02('0x2c')],function(_0x2153ae){var _0x1c6d97={};_0x1c6d97[_0x2153ae]={'$like':'%'+_0xccfe['query']['filter']+'%'};return _0x1c6d97;})});}_0x5acceb=_[_0xea02('0x35')]({},_0x5acceb,_0xccfe[_0xea02('0x37')]);return _0x373737['getActions'](_0x5acceb);}})[_0xea02('0x38')](function(_0x4f91bb){if(_0x4f91bb){_0x231088=_0x4f91bb[_0xea02('0x2e')];if(!_0xccfe['query'][_0xea02('0x2f')]('nolimit')){_0x5acceb['limit']=qs['limit'](_0xccfe[_0xea02('0x29')][_0xea02('0x16')]);_0x5acceb['offset']=qs[_0xea02('0x19')](_0xccfe[_0xea02('0x29')][_0xea02('0x19')]);}return _0x373737[_0xea02('0x4d')](_0x5acceb);}})[_0xea02('0x38')](function(_0x11eeae){if(_0x11eeae){return _0x11eeae?{'count':_0x231088,'rows':_0x11eeae}:null;}})['then'](respondWithResult(_0x26ebab,null))['catch'](handleError(_0x26ebab,null));};
\ No newline at end of file
+var _0x508d=['params','find','create','body','Condition','addConditions','omit','getConditions','findOne','sort','hasOwnProperty','Action','addActions','ids','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x56c9f2,_0x401da8){var _0x2e55f2=function(_0x50b620){while(--_0x50b620){_0x56c9f2['push'](_0x56c9f2['shift']());}};_0x2e55f2(++_0x401da8);}(_0x508d,0x1b3));var _0xd508=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x508d[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0xd508('0x0'));var rimraf=require(_0xd508('0x1'));var zipdir=require(_0xd508('0x2'));var jsonpatch=require(_0xd508('0x3'));var rp=require(_0xd508('0x4'));var moment=require('moment');var BPromise=require(_0xd508('0x5'));var Mustache=require(_0xd508('0x6'));var util=require(_0xd508('0x7'));var path=require(_0xd508('0x8'));var sox=require('sox');var csv=require(_0xd508('0x9'));var ejs=require(_0xd508('0xa'));var fs=require('fs');var fs_extra=require(_0xd508('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd508('0xc'));var jsforce=require(_0xd508('0xd'));var deskjs=require(_0xd508('0xe'));var toCsv=require(_0xd508('0x9'));var querystring=require(_0xd508('0xf'));var Papa=require(_0xd508('0x10'));var Redis=require(_0xd508('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd508('0x12'));var logger=require('../../config/logger')(_0xd508('0x13'));var utils=require(_0xd508('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd508('0x15'))['db'];function respondWithStatusCode(_0x4c84ec,_0x1db9e1){_0x1db9e1=_0x1db9e1||0xcc;return function(_0x4b3c31){if(_0x4b3c31){return _0x4c84ec[_0xd508('0x16')](_0x1db9e1);}return _0x4c84ec[_0xd508('0x17')](_0x1db9e1)[_0xd508('0x18')]();};}function respondWithResult(_0x167da3,_0x3d56b2){_0x3d56b2=_0x3d56b2||0xc8;return function(_0x1a6b93){if(_0x1a6b93){return _0x167da3[_0xd508('0x17')](_0x3d56b2)['json'](_0x1a6b93);}};}function respondWithFilteredResult(_0x3cf060,_0x1aee40){return function(_0x7be026){if(_0x7be026){var _0x48d709=typeof _0x1aee40[_0xd508('0x19')]===_0xd508('0x1a')&&typeof _0x1aee40[_0xd508('0x1b')]===_0xd508('0x1a');var _0x56c5d3=_0x7be026[_0xd508('0x1c')];var _0x1c3379=_0x48d709?0x0:_0x1aee40[_0xd508('0x19')];var _0xc5e43a=_0x48d709?_0x7be026['count']:_0x1aee40[_0xd508('0x19')]+_0x1aee40[_0xd508('0x1b')];var _0xf60509;if(_0xc5e43a>=_0x56c5d3){_0xc5e43a=_0x56c5d3;_0xf60509=0xc8;}else{_0xf60509=0xce;}_0x3cf060['status'](_0xf60509);return _0x3cf060['set'](_0xd508('0x1d'),_0x1c3379+'-'+_0xc5e43a+'/'+_0x56c5d3)['json'](_0x7be026);}return null;};}function patchUpdates(_0x1716a0){return function(_0x4a52be){try{jsonpatch[_0xd508('0x1e')](_0x4a52be,_0x1716a0,!![]);}catch(_0x1bebcf){return BPromise[_0xd508('0x1f')](_0x1bebcf);}return _0x4a52be[_0xd508('0x20')]();};}function saveUpdates(_0x11441e,_0x2510c6){return function(_0x41e722){if(_0x41e722){return _0x41e722[_0xd508('0x21')](_0x11441e)[_0xd508('0x22')](function(_0x484d5e){return _0x484d5e;});}return null;};}function removeEntity(_0x23ddeb,_0x32e68c){return function(_0x38ce84){if(_0x38ce84){return _0x38ce84[_0xd508('0x23')]()[_0xd508('0x22')](function(){_0x23ddeb[_0xd508('0x17')](0xcc)[_0xd508('0x18')]();});}};}function handleEntityNotFound(_0x5ac411,_0xa345eb){return function(_0x3982d3){if(!_0x3982d3){_0x5ac411['sendStatus'](0x194);}return _0x3982d3;};}function handleError(_0x562ccf,_0x2012a1){_0x2012a1=_0x2012a1||0x1f4;return function(_0x464f6b){logger[_0xd508('0x24')](_0x464f6b[_0xd508('0x25')]);if(_0x464f6b[_0xd508('0x26')]){delete _0x464f6b[_0xd508('0x26')];}_0x562ccf[_0xd508('0x17')](_0x2012a1)[_0xd508('0x27')](_0x464f6b);};}exports[_0xd508('0x28')]=function(_0x3eb9c5,_0x190b04){var _0x25b8ff={},_0x56322a={},_0x4f8359={'count':0x0,'rows':[]};var _0x66fda5=_['map'](db[_0xd508('0x29')][_0xd508('0x2a')],function(_0x3751e1){return{'name':_0x3751e1[_0xd508('0x2b')],'type':_0x3751e1[_0xd508('0x2c')][_0xd508('0x2d')]};});_0x56322a[_0xd508('0x2e')]=_[_0xd508('0x2f')](_0x66fda5,_0xd508('0x26'));_0x56322a[_0xd508('0x30')]=_[_0xd508('0x31')](_0x3eb9c5[_0xd508('0x30')]);_0x56322a[_0xd508('0x32')]=_['intersection'](_0x56322a[_0xd508('0x2e')],_0x56322a[_0xd508('0x30')]);_0x25b8ff[_0xd508('0x33')]=_[_0xd508('0x34')](_0x56322a[_0xd508('0x2e')],qs[_0xd508('0x35')](_0x3eb9c5[_0xd508('0x30')][_0xd508('0x35')]));_0x25b8ff[_0xd508('0x33')]=_0x25b8ff[_0xd508('0x33')][_0xd508('0x36')]?_0x25b8ff['attributes']:_0x56322a[_0xd508('0x2e')];if(!_0x3eb9c5[_0xd508('0x30')]['hasOwnProperty'](_0xd508('0x37'))){_0x25b8ff[_0xd508('0x1b')]=qs[_0xd508('0x1b')](_0x3eb9c5[_0xd508('0x30')]['limit']);_0x25b8ff[_0xd508('0x19')]=qs[_0xd508('0x19')](_0x3eb9c5[_0xd508('0x30')][_0xd508('0x19')]);}_0x25b8ff[_0xd508('0x38')]=qs['sort'](_0x3eb9c5['query']['sort']);_0x25b8ff[_0xd508('0x39')]=qs[_0xd508('0x32')](_[_0xd508('0x3a')](_0x3eb9c5[_0xd508('0x30')],_0x56322a[_0xd508('0x32')]),_0x66fda5);if(_0x3eb9c5[_0xd508('0x30')][_0xd508('0x3b')]){_0x25b8ff[_0xd508('0x39')]=_[_0xd508('0x3c')](_0x25b8ff[_0xd508('0x39')],{'$or':_[_0xd508('0x2f')](_0x66fda5,function(_0x5e0af9){if(_0x5e0af9[_0xd508('0x2c')]!==_0xd508('0x3d')){var _0x49cea7={};_0x49cea7[_0x5e0af9['name']]={'$like':'%'+_0x3eb9c5[_0xd508('0x30')]['filter']+'%'};return _0x49cea7;}})});}_0x25b8ff=_['merge']({},_0x25b8ff,_0x3eb9c5[_0xd508('0x3e')]);var _0x464abb={'where':_0x25b8ff[_0xd508('0x39')]};return db[_0xd508('0x29')][_0xd508('0x1c')](_0x464abb)['then'](function(_0x1345bd){_0x4f8359[_0xd508('0x1c')]=_0x1345bd;if(_0x3eb9c5[_0xd508('0x30')][_0xd508('0x3f')]){_0x25b8ff[_0xd508('0x40')]=[{'all':!![]}];}return db[_0xd508('0x29')][_0xd508('0x41')](_0x25b8ff);})[_0xd508('0x22')](function(_0x2e14da){_0x4f8359[_0xd508('0x42')]=_0x2e14da;return _0x4f8359;})['then'](respondWithFilteredResult(_0x190b04,_0x25b8ff))[_0xd508('0x43')](handleError(_0x190b04,null));};exports[_0xd508('0x44')]=function(_0x200e40,_0x2e2c67){var _0x20b88b={'raw':![],'where':{'id':_0x200e40[_0xd508('0x45')]['id']}},_0x3a4394={};_0x3a4394[_0xd508('0x2e')]=_[_0xd508('0x31')](db[_0xd508('0x29')]['rawAttributes']);_0x3a4394[_0xd508('0x30')]=_['keys'](_0x200e40[_0xd508('0x30')]);_0x3a4394[_0xd508('0x32')]=_['intersection'](_0x3a4394['model'],_0x3a4394[_0xd508('0x30')]);_0x20b88b[_0xd508('0x33')]=_[_0xd508('0x34')](_0x3a4394['model'],qs[_0xd508('0x35')](_0x200e40[_0xd508('0x30')][_0xd508('0x35')]));_0x20b88b[_0xd508('0x33')]=_0x20b88b[_0xd508('0x33')]['length']?_0x20b88b[_0xd508('0x33')]:_0x3a4394[_0xd508('0x2e')];if(_0x200e40[_0xd508('0x30')]['includeAll']){_0x20b88b[_0xd508('0x40')]=[{'all':!![]}];}_0x20b88b=_[_0xd508('0x3c')]({},_0x20b88b,_0x200e40['options']);return db[_0xd508('0x29')][_0xd508('0x46')](_0x20b88b)[_0xd508('0x22')](handleEntityNotFound(_0x2e2c67,null))[_0xd508('0x22')](respondWithResult(_0x2e2c67,null))['catch'](handleError(_0x2e2c67,null));};exports[_0xd508('0x47')]=function(_0x544868,_0x599c52){return db[_0xd508('0x29')]['create'](_0x544868[_0xd508('0x48')],{})['then'](respondWithResult(_0x599c52,0xc9))[_0xd508('0x43')](handleError(_0x599c52,null));};exports['update']=function(_0x45297d,_0x36d693){if(_0x45297d[_0xd508('0x48')]['id']){delete _0x45297d[_0xd508('0x48')]['id'];}return db[_0xd508('0x29')][_0xd508('0x46')]({'where':{'id':_0x45297d[_0xd508('0x45')]['id']}})[_0xd508('0x22')](handleEntityNotFound(_0x36d693,null))[_0xd508('0x22')](saveUpdates(_0x45297d[_0xd508('0x48')],null))[_0xd508('0x22')](respondWithResult(_0x36d693,null))['catch'](handleError(_0x36d693,null));};exports[_0xd508('0x23')]=function(_0x2dcd36,_0x5bea4d){return db[_0xd508('0x29')]['find']({'where':{'id':_0x2dcd36[_0xd508('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bea4d,null))[_0xd508('0x22')](removeEntity(_0x5bea4d,null))[_0xd508('0x43')](handleError(_0x5bea4d,null));};exports['addConditions']=function(_0x37951d,_0x784787,_0x31eb2d){return db[_0xd508('0x49')][_0xd508('0x46')]({'where':{'id':_0x37951d['params']['id']}})[_0xd508('0x22')](handleEntityNotFound(_0x784787,null))['then'](function(_0x79044b){if(_0x79044b){return _0x79044b[_0xd508('0x4a')](_0x37951d[_0xd508('0x48')]['ids'],_[_0xd508('0x4b')](_0x37951d[_0xd508('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x784787,null))[_0xd508('0x43')](handleError(_0x784787,null));};exports[_0xd508('0x4c')]=function(_0x55ab86,_0x5e7d14,_0x4c200a){var _0x3fc8d4={};var _0x39d836={};var _0x5a9c26;var _0x107c03;return db[_0xd508('0x29')][_0xd508('0x4d')]({'where':{'id':_0x55ab86['params']['id']}})['then'](handleEntityNotFound(_0x5e7d14,null))['then'](function(_0x1a0202){if(_0x1a0202){_0x5a9c26=_0x1a0202;_0x39d836['model']=_[_0xd508('0x31')](db['Condition'][_0xd508('0x2a')]);_0x39d836['query']=_[_0xd508('0x31')](_0x55ab86[_0xd508('0x30')]);_0x39d836['filters']=_[_0xd508('0x34')](_0x39d836[_0xd508('0x2e')],_0x39d836[_0xd508('0x30')]);_0x3fc8d4[_0xd508('0x33')]=_['intersection'](_0x39d836[_0xd508('0x2e')],qs[_0xd508('0x35')](_0x55ab86[_0xd508('0x30')][_0xd508('0x35')]));_0x3fc8d4[_0xd508('0x33')]=_0x3fc8d4[_0xd508('0x33')][_0xd508('0x36')]?_0x3fc8d4[_0xd508('0x33')]:_0x39d836[_0xd508('0x2e')];_0x3fc8d4[_0xd508('0x38')]=qs[_0xd508('0x4e')](_0x55ab86[_0xd508('0x30')][_0xd508('0x4e')]);_0x3fc8d4[_0xd508('0x39')]=qs[_0xd508('0x32')](_[_0xd508('0x3a')](_0x55ab86[_0xd508('0x30')],_0x39d836[_0xd508('0x32')]));if(_0x55ab86['query'][_0xd508('0x3b')]){_0x3fc8d4[_0xd508('0x39')]=_[_0xd508('0x3c')](_0x3fc8d4[_0xd508('0x39')],{'$or':_[_0xd508('0x2f')](_0x3fc8d4[_0xd508('0x33')],function(_0x43aa9c){var _0x2d0d0e={};_0x2d0d0e[_0x43aa9c]={'$like':'%'+_0x55ab86[_0xd508('0x30')][_0xd508('0x3b')]+'%'};return _0x2d0d0e;})});}_0x3fc8d4=_[_0xd508('0x3c')]({},_0x3fc8d4,_0x55ab86[_0xd508('0x3e')]);return _0x5a9c26[_0xd508('0x4c')](_0x3fc8d4);}})[_0xd508('0x22')](function(_0x5bc5ba){if(_0x5bc5ba){_0x107c03=_0x5bc5ba[_0xd508('0x36')];if(!_0x55ab86['query'][_0xd508('0x4f')]('nolimit')){_0x3fc8d4[_0xd508('0x1b')]=qs[_0xd508('0x1b')](_0x55ab86[_0xd508('0x30')][_0xd508('0x1b')]);_0x3fc8d4['offset']=qs['offset'](_0x55ab86[_0xd508('0x30')][_0xd508('0x19')]);}return _0x5a9c26[_0xd508('0x4c')](_0x3fc8d4);}})['then'](function(_0x5d1b06){if(_0x5d1b06){return _0x5d1b06?{'count':_0x107c03,'rows':_0x5d1b06}:null;}})[_0xd508('0x22')](respondWithResult(_0x5e7d14,null))[_0xd508('0x43')](handleError(_0x5e7d14,null));};exports['addActions']=function(_0x4b878d,_0x180bd1,_0x5377f3){return db[_0xd508('0x50')]['find']({'where':{'id':_0x4b878d[_0xd508('0x45')]['id']}})['then'](handleEntityNotFound(_0x180bd1,null))[_0xd508('0x22')](function(_0x529e59){if(_0x529e59){return _0x529e59[_0xd508('0x51')](_0x4b878d[_0xd508('0x48')][_0xd508('0x52')],_[_0xd508('0x4b')](_0x4b878d[_0xd508('0x48')],['ids','id'])||{});}})[_0xd508('0x22')](respondWithResult(_0x180bd1,null))[_0xd508('0x43')](handleError(_0x180bd1,null));};exports[_0xd508('0x53')]=function(_0x31f48e,_0x82ea2,_0x29c328){var _0x19cbcb={};var _0x29fbb6={};var _0x1e8ac4;var _0x5747c6;return db[_0xd508('0x29')][_0xd508('0x4d')]({'where':{'id':_0x31f48e[_0xd508('0x45')]['id']}})['then'](handleEntityNotFound(_0x82ea2,null))[_0xd508('0x22')](function(_0x5ab84b){if(_0x5ab84b){_0x1e8ac4=_0x5ab84b;_0x29fbb6[_0xd508('0x2e')]=_[_0xd508('0x31')](db['Action'][_0xd508('0x2a')]);_0x29fbb6[_0xd508('0x30')]=_[_0xd508('0x31')](_0x31f48e[_0xd508('0x30')]);_0x29fbb6[_0xd508('0x32')]=_[_0xd508('0x34')](_0x29fbb6['model'],_0x29fbb6[_0xd508('0x30')]);_0x19cbcb[_0xd508('0x33')]=_['intersection'](_0x29fbb6[_0xd508('0x2e')],qs['fields'](_0x31f48e['query'][_0xd508('0x35')]));_0x19cbcb[_0xd508('0x33')]=_0x19cbcb[_0xd508('0x33')][_0xd508('0x36')]?_0x19cbcb['attributes']:_0x29fbb6[_0xd508('0x2e')];_0x19cbcb['order']=qs[_0xd508('0x4e')](_0x31f48e['query'][_0xd508('0x4e')]);_0x19cbcb[_0xd508('0x39')]=qs['filters'](_['pick'](_0x31f48e[_0xd508('0x30')],_0x29fbb6['filters']));if(_0x31f48e['query'][_0xd508('0x3b')]){_0x19cbcb[_0xd508('0x39')]=_['merge'](_0x19cbcb[_0xd508('0x39')],{'$or':_['map'](_0x19cbcb[_0xd508('0x33')],function(_0xe08e6e){var _0x2b0221={};_0x2b0221[_0xe08e6e]={'$like':'%'+_0x31f48e[_0xd508('0x30')][_0xd508('0x3b')]+'%'};return _0x2b0221;})});}_0x19cbcb=_[_0xd508('0x3c')]({},_0x19cbcb,_0x31f48e[_0xd508('0x3e')]);return _0x1e8ac4[_0xd508('0x53')](_0x19cbcb);}})[_0xd508('0x22')](function(_0x979091){if(_0x979091){_0x5747c6=_0x979091[_0xd508('0x36')];if(!_0x31f48e[_0xd508('0x30')][_0xd508('0x4f')](_0xd508('0x37'))){_0x19cbcb['limit']=qs['limit'](_0x31f48e[_0xd508('0x30')][_0xd508('0x1b')]);_0x19cbcb[_0xd508('0x19')]=qs[_0xd508('0x19')](_0x31f48e['query'][_0xd508('0x19')]);}return _0x1e8ac4[_0xd508('0x53')](_0x19cbcb);}})[_0xd508('0x22')](function(_0x14f36c){if(_0x14f36c){return _0x14f36c?{'count':_0x5747c6,'rows':_0x14f36c}:null;}})[_0xd508('0x22')](respondWithResult(_0x82ea2,null))[_0xd508('0x43')](handleError(_0x82ea2,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 36c7c46..7c8a85a 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 _0xb57b=['tools_automations','lodash','util','../../config/logger','api','moment','request-promise','path','./automation.attributes','exports','define','Automation'];(function(_0x49d703,_0x347cc){var _0x5ec762=function(_0x8067a3){while(--_0x8067a3){_0x49d703['push'](_0x49d703['shift']());}};_0x5ec762(++_0x347cc);}(_0xb57b,0x1b1));var _0xbb57=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb57b[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xbb57('0x0'));var util=require(_0xbb57('0x1'));var logger=require(_0xbb57('0x2'))(_0xbb57('0x3'));var moment=require(_0xbb57('0x4'));var BPromise=require('bluebird');var rp=require(_0xbb57('0x5'));var fs=require('fs');var path=require(_0xbb57('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbb57('0x7'));module[_0xbb57('0x8')]=function(_0x560ad5,_0x2ad427){return _0x560ad5[_0xbb57('0x9')](_0xbb57('0xa'),attributes,{'tableName':_0xbb57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc1b9=['bluebird','request-promise','../../config/environment','./automation.attributes','define','Automation','tools_automations','../../config/logger','api'];(function(_0x2e855c,_0x1812f2){var _0x1e0860=function(_0x586bec){while(--_0x586bec){_0x2e855c['push'](_0x2e855c['shift']());}};_0x1e0860(++_0x1812f2);}(_0xc1b9,0x178));var _0x9c1b=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xc1b9[_0x3b3f4f];return _0x174dbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9c1b('0x0'))(_0x9c1b('0x1'));var moment=require('moment');var BPromise=require(_0x9c1b('0x2'));var rp=require(_0x9c1b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9c1b('0x4'));var attributes=require(_0x9c1b('0x5'));module['exports']=function(_0x4935b4,_0x342117){return _0x4935b4[_0x9c1b('0x6')](_0x9c1b('0x7'),attributes,{'tableName':_0x9c1b('0x8'),'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 2ebf00d..5ee4027 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 _0x02a7=['Automation,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x02a7,0x1a6));var _0x702a=function(_0x121905,_0x4b2c02){_0x121905=_0x121905-0x0;var _0x582f44=_0x02a7[_0x121905];return _0x582f44;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('Automation,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('Automation,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});}
\ No newline at end of file
+var _0x1516=['../../config/environment','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1516,0xb0));var _0x6151=function(_0x2163f5,_0x4ec207){_0x2163f5=_0x2163f5-0x0;var _0x4bf4c2=_0x1516[_0x2163f5];return _0x4bf4c2;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x319164,_0x3fa962,_0x46e22f){return new BPromise(function(_0x43513c,_0x44cc85){return client[_0x6151('0xb')](_0x319164,_0x46e22f)[_0x6151('0xc')](function(_0x5c5b55){logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));logger[_0x6151('0xf')](_0x6151('0x10'),_0x3fa962,_0x6151('0xe'),JSON[_0x6151('0x11')](_0x5c5b55));if(_0x5c5b55[_0x6151('0x12')]){if(_0x5c5b55[_0x6151('0x12')][_0x6151('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x44cc85(_0x5c5b55[_0x6151('0x12')]['message']);}logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x43513c(_0x5c5b55['error'][_0x6151('0x14')]);}else{logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));_0x43513c(_0x5c5b55[_0x6151('0x15')][_0x6151('0x14')]);}})[_0x6151('0x16')](function(_0x12524a){logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x12524a);_0x44cc85(_0x12524a);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 9280ee8..915afd1 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 _0x2e35=['put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x2e35,0x101));var _0x52e3=function(_0x4d9f21,_0x2419f7){_0x4d9f21=_0x4d9f21-0x0;var _0x570d53=_0x2e35[_0x4d9f21];return _0x570d53;};'use strict';var multer=require(_0x52e3('0x0'));var util=require('util');var path=require(_0x52e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x52e3('0x2'));var router=express[_0x52e3('0x3')]();var fs_extra=require(_0x52e3('0x4'));var auth=require(_0x52e3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x52e3('0x6'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x52e3('0x7')]);router[_0x52e3('0x8')](_0x52e3('0x9'),auth[_0x52e3('0xa')](),controller[_0x52e3('0xb')]);router[_0x52e3('0x8')](_0x52e3('0xc'),auth[_0x52e3('0xa')](),controller['getConditions']);router[_0x52e3('0x8')](_0x52e3('0xd'),auth[_0x52e3('0xa')](),controller[_0x52e3('0xe')]);router[_0x52e3('0xf')]('/',auth[_0x52e3('0xa')](),controller[_0x52e3('0x10')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0x52e3('0x11')]);router[_0x52e3('0xf')](_0x52e3('0xd'),auth['isAuthenticated'](),controller[_0x52e3('0x12')]);router[_0x52e3('0x13')]('/:id',auth[_0x52e3('0xa')](),controller[_0x52e3('0x14')]);router['delete'](_0x52e3('0x9'),auth[_0x52e3('0xa')](),controller[_0x52e3('0x15')]);module[_0x52e3('0x16')]=router;
\ No newline at end of file
+var _0xb734=['connect-timeout','express','Router','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','delete','destroy','exports','multer','util','path'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0xb734,0xe3));var _0x4b73=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0xb734[_0x297c55];return _0x120389;};'use strict';var multer=require(_0x4b73('0x0'));var util=require(_0x4b73('0x1'));var path=require(_0x4b73('0x2'));var timeout=require(_0x4b73('0x3'));var express=require(_0x4b73('0x4'));var router=express[_0x4b73('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4b73('0x6'));var controller=require(_0x4b73('0x7'));router[_0x4b73('0x8')]('/',auth[_0x4b73('0x9')](),controller[_0x4b73('0xa')]);router[_0x4b73('0x8')](_0x4b73('0xb'),auth['isAuthenticated'](),controller[_0x4b73('0xc')]);router[_0x4b73('0x8')]('/:id/conditions',auth[_0x4b73('0x9')](),controller['getConditions']);router[_0x4b73('0x8')](_0x4b73('0xd'),auth['isAuthenticated'](),controller[_0x4b73('0xe')]);router[_0x4b73('0xf')]('/',auth[_0x4b73('0x9')](),controller[_0x4b73('0x10')]);router[_0x4b73('0xf')](_0x4b73('0x11'),auth[_0x4b73('0x9')](),controller[_0x4b73('0x12')]);router[_0x4b73('0xf')](_0x4b73('0xd'),auth[_0x4b73('0x9')](),controller[_0x4b73('0x13')]);router['put'](_0x4b73('0xb'),auth[_0x4b73('0x9')](),controller['update']);router[_0x4b73('0x14')](_0x4b73('0xb'),auth['isAuthenticated'](),controller[_0x4b73('0x15')]);module[_0x4b73('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 203d2c9..df2a63c 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 _0x80a2=['ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING'];(function(_0x2d03f7,_0x453538){var _0x5e2e61=function(_0x5e78f7){while(--_0x5e78f7){_0x2d03f7['push'](_0x2d03f7['shift']());}};_0x5e2e61(++_0x453538);}(_0x80a2,0xf9));var _0x280a=function(_0x2d6684,_0x86ef71){_0x2d6684=_0x2d6684-0x0;var _0x2bb5e2=_0x80a2[_0x2d6684];return _0x2bb5e2;};'use strict';var Sequelize=require(_0x280a('0x0'));module[_0x280a('0x1')]={'name':{'type':Sequelize[_0x280a('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x280a('0x3')](_0x280a('0x4')),'allowNull':![],'defaultValue':_0x280a('0x4')},'description':{'type':Sequelize[_0x280a('0x2')]},'active':{'type':Sequelize[_0x280a('0x5')],'defaultValue':0x0,'comment':_0x280a('0x6')},'limitCalls':{'type':Sequelize[_0x280a('0x7')](0x4)[_0x280a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x280a('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x280a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x280a('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'comment':_0x280a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x280a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x280a('0x3')](_0x280a('0xf'),_0x280a('0x10'),'onlyIfOpen'),'defaultValue':_0x280a('0xf')},'dialAMDActive':{'type':Sequelize[_0x280a('0x5')],'defaultValue':0x0,'comment':_0x280a('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x280a('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x280a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x280a('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x280a('0x7')](0x9)[_0x280a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x280a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x280a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x280a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x280a('0x7')](0x9)[_0x280a('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x280a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x280a('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x280a('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x280a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x280a('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x280a('0x3')](_0x280a('0x19'),_0x280a('0x1a')),'defaultValue':_0x280a('0x19')},'dialPrefix':{'type':Sequelize[_0x280a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x280a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x280a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x280a('0x7')](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x280a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x280a('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x280a('0x7')](0x5)[_0x280a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x280a('0x23')}};
\ No newline at end of file
+var _0x787c=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x26559a,_0x3f9fe6){var _0x3c7d9e=function(_0x158106){while(--_0x158106){_0x26559a['push'](_0x26559a['shift']());}};_0x3c7d9e(++_0x3f9fe6);}(_0x787c,0x172));var _0xc787=function(_0x21045d,_0x2720a4){_0x21045d=_0x21045d-0x0;var _0x128bd9=_0x787c[_0x21045d];return _0x128bd9;};'use strict';var Sequelize=require(_0xc787('0x0'));module['exports']={'name':{'type':Sequelize[_0xc787('0x1')],'unique':_0xc787('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc787('0x3')](_0xc787('0x4')),'allowNull':![],'defaultValue':_0xc787('0x4')},'description':{'type':Sequelize[_0xc787('0x1')]},'active':{'type':Sequelize[_0xc787('0x5')],'defaultValue':0x0,'comment':_0xc787('0x6')},'limitCalls':{'type':Sequelize[_0xc787('0x7')](0x4)[_0xc787('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc787('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc787('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc787('0xe')},'dialTimezone':{'type':Sequelize[_0xc787('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc787('0x1')],'defaultValue':_0xc787('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xc787('0x10'),_0xc787('0x11'),_0xc787('0x12')),'defaultValue':_0xc787('0x10')},'dialAMDActive':{'type':Sequelize[_0xc787('0x5')],'defaultValue':0x0,'comment':_0xc787('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc787('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc787('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc787('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc787('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc787('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc787('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc787('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc787('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc787('0x7')](0x9)[_0xc787('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc787('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc787('0x3')](_0xc787('0x1b'),_0xc787('0x1c')),'defaultValue':_0xc787('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc787('0x1d')},'dialCutDigit':{'type':Sequelize[_0xc787('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc787('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xc787('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc787('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc787('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc787('0x7')](0x5)[_0xc787('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc787('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4b17269..8f9254b 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 _0x409b=['insert','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','select','phone\x20IS\x20NOT\x20NULL','into','cm_hopper_additional_phones','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','order','CampaignId','findAll','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always'];(function(_0x54b026,_0x17f28d){var _0x14fe1d=function(_0x2a340b){while(--_0x2a340b){_0x54b026['push'](_0x54b026['shift']());}};_0x14fe1d(++_0x17f28d);}(_0x409b,0x14a));var _0xb409=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x409b[_0x279d37];return _0x530173;};'use strict';var emlformat=require(_0xb409('0x0'));var rimraf=require(_0xb409('0x1'));var zipdir=require(_0xb409('0x2'));var jsonpatch=require(_0xb409('0x3'));var rp=require(_0xb409('0x4'));var moment=require(_0xb409('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb409('0x6'));var util=require(_0xb409('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb409('0x8'));var fs=require('fs');var fs_extra=require(_0xb409('0x9'));var _=require(_0xb409('0xa'));var squel=require(_0xb409('0xb'));var crypto=require(_0xb409('0xc'));var jsforce=require(_0xb409('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb409('0xe'));var querystring=require(_0xb409('0xf'));var Papa=require(_0xb409('0x10'));var Redis=require('ioredis');var authService=require(_0xb409('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb409('0x12'));var hardwareService=require(_0xb409('0x13'));var logger=require(_0xb409('0x14'))('api');var utils=require(_0xb409('0x15'));var config=require(_0xb409('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb409('0x17'))['db'];function respondWithStatusCode(_0x21fa25,_0x23bd15){_0x23bd15=_0x23bd15||0xcc;return function(_0x6b563c){if(_0x6b563c){return _0x21fa25[_0xb409('0x18')](_0x23bd15);}return _0x21fa25[_0xb409('0x19')](_0x23bd15)['end']();};}function respondWithResult(_0x1e6895,_0x75b07e){_0x75b07e=_0x75b07e||0xc8;return function(_0x128035){if(_0x128035){return _0x1e6895[_0xb409('0x19')](_0x75b07e)[_0xb409('0x1a')](_0x128035);}};}function respondWithFilteredResult(_0x4f596b,_0xd19d17){return function(_0x58bb54){if(_0x58bb54){var _0x32c205=typeof _0xd19d17[_0xb409('0x1b')]===_0xb409('0x1c')&&typeof _0xd19d17[_0xb409('0x1d')]===_0xb409('0x1c');var _0x3975d0=_0x58bb54[_0xb409('0x1e')];var _0x12b1de=_0x32c205?0x0:_0xd19d17[_0xb409('0x1b')];var _0xf4a437=_0x32c205?_0x58bb54[_0xb409('0x1e')]:_0xd19d17[_0xb409('0x1b')]+_0xd19d17[_0xb409('0x1d')];var _0x1dd011;if(_0xf4a437>=_0x3975d0){_0xf4a437=_0x3975d0;_0x1dd011=0xc8;}else{_0x1dd011=0xce;}_0x4f596b[_0xb409('0x19')](_0x1dd011);return _0x4f596b['set']('Content-Range',_0x12b1de+'-'+_0xf4a437+'/'+_0x3975d0)[_0xb409('0x1a')](_0x58bb54);}return null;};}function patchUpdates(_0x24af7d){return function(_0x22d9ed){try{jsonpatch['apply'](_0x22d9ed,_0x24af7d,!![]);}catch(_0x4df44e){return BPromise['reject'](_0x4df44e);}return _0x22d9ed['save']();};}function saveUpdates(_0x443563,_0x437d9f){return function(_0x406324){if(_0x406324){return _0x406324[_0xb409('0x1f')](_0x443563)[_0xb409('0x20')](function(_0x17a506){return _0x17a506;});}return null;};}function removeEntity(_0x3b629f,_0x12789d){return function(_0x45979e){if(_0x45979e){return _0x45979e[_0xb409('0x21')]()[_0xb409('0x20')](function(){var _0x22c2ac=_0x45979e['get']({'plain':!![]});var _0x306511=_0xb409('0x22');return db[_0xb409('0x23')]['destroy']({'where':{'type':_0x306511,'resourceId':_0x22c2ac['id']}})['then'](function(){return _0x45979e;});})[_0xb409('0x20')](function(){_0x3b629f[_0xb409('0x19')](0xcc)[_0xb409('0x24')]();});}};}function handleEntityNotFound(_0x45c1b1,_0x169929){return function(_0x365233){if(!_0x365233){_0x45c1b1[_0xb409('0x18')](0x194);}return _0x365233;};}function handleError(_0x3439ce,_0x51000f){_0x51000f=_0x51000f||0x1f4;return function(_0x5343b8){logger[_0xb409('0x25')](_0x5343b8[_0xb409('0x26')]);if(_0x5343b8[_0xb409('0x27')]){delete _0x5343b8['name'];}_0x3439ce[_0xb409('0x19')](_0x51000f)[_0xb409('0x28')](_0x5343b8);};}exports[_0xb409('0x29')]=function(_0x78e448,_0x3b403a){var _0x454ff8={},_0x104469={},_0x3a60e3={'count':0x0,'rows':[]};var _0x1c3f9a=_[_0xb409('0x2a')](db[_0xb409('0x2b')]['rawAttributes'],function(_0x350b92){return{'name':_0x350b92['fieldName'],'type':_0x350b92[_0xb409('0x2c')][_0xb409('0x2d')]};});_0x104469[_0xb409('0x2e')]=_[_0xb409('0x2a')](_0x1c3f9a,_0xb409('0x27'));_0x104469['query']=_[_0xb409('0x2f')](_0x78e448[_0xb409('0x30')]);_0x104469[_0xb409('0x31')]=_[_0xb409('0x32')](_0x104469[_0xb409('0x2e')],_0x104469[_0xb409('0x30')]);_0x454ff8[_0xb409('0x33')]=_[_0xb409('0x32')](_0x104469['model'],qs['fields'](_0x78e448[_0xb409('0x30')][_0xb409('0x34')]));_0x454ff8['attributes']=_0x454ff8[_0xb409('0x33')][_0xb409('0x35')]?_0x454ff8[_0xb409('0x33')]:_0x104469[_0xb409('0x2e')];if(!_0x78e448[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x454ff8[_0xb409('0x1d')]=qs['limit'](_0x78e448[_0xb409('0x30')]['limit']);_0x454ff8[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x78e448[_0xb409('0x30')][_0xb409('0x1b')]);}_0x454ff8['order']=qs[_0xb409('0x38')](_0x78e448[_0xb409('0x30')][_0xb409('0x38')]);_0x454ff8[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x78e448[_0xb409('0x30')],_0x104469[_0xb409('0x31')]),_0x1c3f9a);if(_0x78e448[_0xb409('0x30')]['filter']){_0x454ff8[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x454ff8[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x1c3f9a,function(_0x134ced){if(_0x134ced[_0xb409('0x2c')]!==_0xb409('0x3c')){var _0x506f4e={};_0x506f4e[_0x134ced[_0xb409('0x27')]]={'$like':'%'+_0x78e448[_0xb409('0x30')][_0xb409('0x3d')]+'%'};return _0x506f4e;}})});}_0x454ff8=_[_0xb409('0x3b')]({},_0x454ff8,_0x78e448[_0xb409('0x3e')]);var _0x558dbc={'where':_0x454ff8[_0xb409('0x39')]};return db[_0xb409('0x2b')]['count'](_0x558dbc)['then'](function(_0x33d3a6){_0x3a60e3[_0xb409('0x1e')]=_0x33d3a6;if(_0x78e448[_0xb409('0x30')][_0xb409('0x3f')]){_0x454ff8[_0xb409('0x40')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x454ff8);})[_0xb409('0x20')](function(_0x17e804){_0x3a60e3['rows']=_0x17e804;return _0x3a60e3;})[_0xb409('0x20')](respondWithFilteredResult(_0x3b403a,_0x454ff8))[_0xb409('0x41')](handleError(_0x3b403a,null));};exports[_0xb409('0x42')]=function(_0x1fb07d,_0x92a4ed){var _0x17476e={'raw':![],'where':{'id':_0x1fb07d[_0xb409('0x43')]['id']}},_0xb2cf52={};_0xb2cf52['model']=_[_0xb409('0x2f')](db[_0xb409('0x2b')][_0xb409('0x44')]);_0xb2cf52[_0xb409('0x30')]=_['keys'](_0x1fb07d[_0xb409('0x30')]);_0xb2cf52[_0xb409('0x31')]=_[_0xb409('0x32')](_0xb2cf52[_0xb409('0x2e')],_0xb2cf52[_0xb409('0x30')]);_0x17476e[_0xb409('0x33')]=_['intersection'](_0xb2cf52[_0xb409('0x2e')],qs['fields'](_0x1fb07d[_0xb409('0x30')][_0xb409('0x34')]));_0x17476e[_0xb409('0x33')]=_0x17476e['attributes'][_0xb409('0x35')]?_0x17476e[_0xb409('0x33')]:_0xb2cf52['model'];if(_0x1fb07d[_0xb409('0x30')]['includeAll']){_0x17476e[_0xb409('0x40')]=[{'all':!![]}];}_0x17476e=_[_0xb409('0x3b')]({},_0x17476e,_0x1fb07d[_0xb409('0x3e')]);return db[_0xb409('0x2b')][_0xb409('0x45')](_0x17476e)[_0xb409('0x20')](handleEntityNotFound(_0x92a4ed,null))['then'](respondWithResult(_0x92a4ed,null))['catch'](handleError(_0x92a4ed,null));};exports[_0xb409('0x46')]=function(_0x7f59a6,_0x541c95){return db[_0xb409('0x2b')]['create'](_0x7f59a6['body'],{})[_0xb409('0x20')](function(_0xbefbd9){var _0x217d34=_0x7f59a6[_0xb409('0x47')]['get']({'plain':!![]});if(!_0x217d34)throw new Error(_0xb409('0x48'));if(_0x217d34[_0xb409('0x49')]===_0xb409('0x47')){var _0x6c49=_0xbefbd9[_0xb409('0x4a')]({'plain':!![]});var _0x3dd13b=_0xb409('0x22');return db[_0xb409('0x4b')][_0xb409('0x45')]({'where':{'name':_0x3dd13b,'userProfileId':_0x217d34[_0xb409('0x4c')]},'raw':!![]})['then'](function(_0x3940d5){if(_0x3940d5&&_0x3940d5[_0xb409('0x4d')]===0x0){return db[_0xb409('0x23')][_0xb409('0x46')]({'name':_0x6c49['name'],'resourceId':_0x6c49['id'],'type':_0x3940d5['name'],'sectionId':_0x3940d5['id']},{})[_0xb409('0x20')](function(){return _0xbefbd9;});}else{return _0xbefbd9;}})[_0xb409('0x41')](function(_0x56036d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56036d);throw _0x56036d;});}return _0xbefbd9;})['then'](respondWithResult(_0x541c95,0xc9))['catch'](handleError(_0x541c95,null));};exports[_0xb409('0x4e')]=function(_0x148176,_0x5bea07){var _0x404278={'where':{'id':_0x148176[_0xb409('0x43')]['id']}},_0x22d537={};_0x22d537['model']=_[_0xb409('0x2f')](db[_0xb409('0x2b')][_0xb409('0x44')]);_0x404278[_0xb409('0x33')]=_[_0xb409('0x32')](_0x22d537['model'],qs[_0xb409('0x34')](_0x148176[_0xb409('0x30')][_0xb409('0x34')]));_0x404278[_0xb409('0x33')]=_0x404278['attributes'][_0xb409('0x35')]?_0x404278[_0xb409('0x33')]:_0x22d537[_0xb409('0x2e')];if(_0x148176[_0xb409('0x30')][_0xb409('0x3f')]){_0x404278[_0xb409('0x40')]=[{'all':!![]}];}_0x404278=_['merge']({},_0x404278,_0x148176['options']);return db['Campaign'][_0xb409('0x45')](_0x404278)[_0xb409('0x20')](handleEntityNotFound(_0x5bea07,null))[_0xb409('0x20')](function(_0x39712b){if(_0x39712b){var _0x265f7c=_0x39712b[_0xb409('0x4a')]({'plain':!![]});_0x265f7c=qs[_0xb409('0x4f')](_0x265f7c,['id',_0xb409('0x50'),_0xb409('0x51')]);_0x148176['body']=_[_0xb409('0x4f')](_0x148176[_0xb409('0x52')],['id',_0xb409('0x50'),'updatedAt']);return db[_0xb409('0x2b')][_0xb409('0x46')](_[_0xb409('0x3b')](_0x265f7c,_0x148176[_0xb409('0x52')]),{'include':_0x148176[_0xb409('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0xb409('0x20')](function(_0x5cf9ec){var _0x514542=_0x148176[_0xb409('0x47')]['get']({'plain':!![]});if(!_0x514542)throw new Error(_0xb409('0x48'));if(_0x514542[_0xb409('0x49')]===_0xb409('0x47')){var _0x2ca6b3=_0x5cf9ec[_0xb409('0x4a')]({'plain':!![]});var _0x416ff6=_0xb409('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x416ff6,'userProfileId':_0x514542[_0xb409('0x4c')]},'raw':!![]})['then'](function(_0x56fdde){if(_0x56fdde&&_0x56fdde['autoAssociation']===0x0){return db[_0xb409('0x23')][_0xb409('0x46')]({'name':_0x2ca6b3[_0xb409('0x27')],'resourceId':_0x2ca6b3['id'],'type':_0x56fdde[_0xb409('0x27')],'sectionId':_0x56fdde['id']},{})['then'](function(){return _0x5cf9ec;});}else{return _0x5cf9ec;}})[_0xb409('0x41')](function(_0x2a21a2){logger[_0xb409('0x25')](_0xb409('0x53'),_0x2a21a2);throw _0x2a21a2;});}return _0x5cf9ec;});}})['then'](respondWithResult(_0x5bea07,0xc9))['catch'](handleError(_0x5bea07,null));};exports[_0xb409('0x1f')]=function(_0x354bfb,_0x4fe681){if(_0x354bfb[_0xb409('0x52')]['id']){delete _0x354bfb[_0xb409('0x52')]['id'];}return db[_0xb409('0x2b')]['find']({'where':{'id':_0x354bfb['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x4fe681,null))[_0xb409('0x20')](saveUpdates(_0x354bfb[_0xb409('0x52')],null))['then'](respondWithResult(_0x4fe681,null))['catch'](handleError(_0x4fe681,null));};exports[_0xb409('0x21')]=function(_0x3cdebb,_0x246a15){return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x3cdebb['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x246a15,null))[_0xb409('0x20')](removeEntity(_0x246a15,null))[_0xb409('0x41')](handleError(_0x246a15,null));};exports[_0xb409('0x54')]=function(_0x5f056e,_0x39cb6c,_0x30d3e3){var _0x2a00fb={'raw':!![],'where':{}};var _0x1c3e1f={};var _0x4532ab={'count':0x0,'rows':[]};return db['Campaign'][_0xb409('0x55')]({'where':{'id':_0x5f056e['params']['id']}})['then'](handleEntityNotFound(_0x39cb6c,null))[_0xb409('0x20')](function(_0x6c0ca4){if(_0x6c0ca4){_0x1c3e1f[_0xb409('0x2e')]=_['keys'](db[_0xb409('0x56')]['rawAttributes']);_0x1c3e1f[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x5f056e[_0xb409('0x30')]);_0x1c3e1f[_0xb409('0x31')]=_[_0xb409('0x32')](_0x1c3e1f[_0xb409('0x2e')],_0x1c3e1f[_0xb409('0x30')]);_0x2a00fb[_0xb409('0x33')]=_[_0xb409('0x32')](_0x1c3e1f[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x5f056e['query'][_0xb409('0x34')]));_0x2a00fb[_0xb409('0x33')]=_0x2a00fb[_0xb409('0x33')]['length']?_0x2a00fb['attributes']:_0x1c3e1f[_0xb409('0x2e')];if(!_0x5f056e[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x2a00fb[_0xb409('0x1d')]=qs[_0xb409('0x1d')](_0x5f056e[_0xb409('0x30')][_0xb409('0x1d')]);_0x2a00fb[_0xb409('0x1b')]=qs['offset'](_0x5f056e['query']['offset']);}_0x2a00fb[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x5f056e[_0xb409('0x30')][_0xb409('0x38')]);_0x2a00fb[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x5f056e[_0xb409('0x30')],_0x1c3e1f[_0xb409('0x31')]));_0x2a00fb[_0xb409('0x39')][_0xb409('0x58')]=_0x6c0ca4['id'];if(_0x5f056e[_0xb409('0x30')][_0xb409('0x3d')]){_0x2a00fb[_0xb409('0x39')]=_['merge'](_0x2a00fb[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x2a00fb[_0xb409('0x33')],function(_0x233444){var _0x3334a6={};_0x3334a6[_0x233444]={'$like':'%'+_0x5f056e[_0xb409('0x30')]['filter']+'%'};return _0x3334a6;})});}_0x2a00fb=_['merge']({},_0x2a00fb,_0x5f056e[_0xb409('0x3e')]);return db[_0xb409('0x56')]['count']({'where':_0x2a00fb[_0xb409('0x39')]})[_0xb409('0x20')](function(_0x2884f4){_0x4532ab[_0xb409('0x1e')]=_0x2884f4;if(_0x5f056e[_0xb409('0x30')][_0xb409('0x3f')]){_0x2a00fb[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x56')][_0xb409('0x59')](_0x2a00fb);})[_0xb409('0x20')](function(_0x2ddad3){_0x4532ab[_0xb409('0x5a')]=_0x2ddad3;return _0x4532ab;});}})['then'](respondWithFilteredResult(_0x39cb6c,_0x2a00fb))[_0xb409('0x41')](handleError(_0x39cb6c,null));};exports['getHopperHistories']=function(_0x56cbad,_0x273a8b,_0x1fe092){var _0xb84e5a={'raw':!![],'where':{}};var _0x337dd2={};var _0x5e2ecd={'count':0x0,'rows':[]};return db['Campaign'][_0xb409('0x55')]({'where':{'id':_0x56cbad[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x273a8b,null))[_0xb409('0x20')](function(_0x3d5dfa){if(_0x3d5dfa){_0x337dd2[_0xb409('0x2e')]=_['keys'](db[_0xb409('0x5b')][_0xb409('0x44')]);_0x337dd2[_0xb409('0x30')]=_['keys'](_0x56cbad[_0xb409('0x30')]);_0x337dd2[_0xb409('0x31')]=_[_0xb409('0x32')](_0x337dd2[_0xb409('0x2e')],_0x337dd2[_0xb409('0x30')]);_0xb84e5a[_0xb409('0x33')]=_[_0xb409('0x32')](_0x337dd2[_0xb409('0x2e')],qs['fields'](_0x56cbad['query'][_0xb409('0x34')]));_0xb84e5a[_0xb409('0x33')]=_0xb84e5a[_0xb409('0x33')][_0xb409('0x35')]?_0xb84e5a[_0xb409('0x33')]:_0x337dd2[_0xb409('0x2e')];if(!_0x56cbad[_0xb409('0x30')][_0xb409('0x36')]('nolimit')){_0xb84e5a['limit']=qs[_0xb409('0x1d')](_0x56cbad['query'][_0xb409('0x1d')]);_0xb84e5a['offset']=qs[_0xb409('0x1b')](_0x56cbad[_0xb409('0x30')][_0xb409('0x1b')]);}_0xb84e5a[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x56cbad[_0xb409('0x30')][_0xb409('0x38')]);_0xb84e5a['where']=qs['filters'](_['pick'](_0x56cbad[_0xb409('0x30')],_0x337dd2[_0xb409('0x31')]));_0xb84e5a[_0xb409('0x39')]['CampaignId']=_0x3d5dfa['id'];if(_0x56cbad[_0xb409('0x30')][_0xb409('0x3d')]){_0xb84e5a[_0xb409('0x39')]=_[_0xb409('0x3b')](_0xb84e5a[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0xb84e5a[_0xb409('0x33')],function(_0x412d31){var _0x1ea7e4={};_0x1ea7e4[_0x412d31]={'$like':'%'+_0x56cbad[_0xb409('0x30')][_0xb409('0x3d')]+'%'};return _0x1ea7e4;})});}_0xb84e5a=_[_0xb409('0x3b')]({},_0xb84e5a,_0x56cbad[_0xb409('0x3e')]);return db['CmHopperHistory'][_0xb409('0x1e')]({'where':_0xb84e5a[_0xb409('0x39')]})[_0xb409('0x20')](function(_0x4059e2){_0x5e2ecd['count']=_0x4059e2;if(_0x56cbad['query'][_0xb409('0x3f')]){_0xb84e5a[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x5b')][_0xb409('0x59')](_0xb84e5a);})[_0xb409('0x20')](function(_0x74febb){_0x5e2ecd['rows']=_0x74febb;return _0x5e2ecd;});}})[_0xb409('0x20')](respondWithFilteredResult(_0x273a8b,_0xb84e5a))[_0xb409('0x41')](handleError(_0x273a8b,null));};exports[_0xb409('0x5c')]=function(_0x431adc,_0x1adaeb,_0x36d847){var _0x97b9a0={'raw':!![],'where':{}};var _0x498f68={};var _0x28caf4={'count':0x0,'rows':[]};return db[_0xb409('0x2b')]['findOne']({'where':{'id':_0x431adc['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x1adaeb,null))['then'](function(_0x144e28){if(_0x144e28){_0x498f68[_0xb409('0x2e')]=_['keys'](db['CmHopperFinal'][_0xb409('0x44')]);_0x498f68[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x431adc[_0xb409('0x30')]);_0x498f68[_0xb409('0x31')]=_['intersection'](_0x498f68[_0xb409('0x2e')],_0x498f68[_0xb409('0x30')]);_0x97b9a0[_0xb409('0x33')]=_[_0xb409('0x32')](_0x498f68[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x431adc[_0xb409('0x30')][_0xb409('0x34')]));_0x97b9a0[_0xb409('0x33')]=_0x97b9a0[_0xb409('0x33')][_0xb409('0x35')]?_0x97b9a0['attributes']:_0x498f68[_0xb409('0x2e')];if(!_0x431adc['query'][_0xb409('0x36')](_0xb409('0x37'))){_0x97b9a0[_0xb409('0x1d')]=qs['limit'](_0x431adc[_0xb409('0x30')][_0xb409('0x1d')]);_0x97b9a0[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x431adc[_0xb409('0x30')][_0xb409('0x1b')]);}_0x97b9a0[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x431adc[_0xb409('0x30')][_0xb409('0x38')]);_0x97b9a0['where']=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x431adc[_0xb409('0x30')],_0x498f68['filters']));_0x97b9a0[_0xb409('0x39')]['CampaignId']=_0x144e28['id'];if(_0x431adc[_0xb409('0x30')][_0xb409('0x3d')]){_0x97b9a0[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x97b9a0[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x97b9a0[_0xb409('0x33')],function(_0x17e286){var _0x311720={};_0x311720[_0x17e286]={'$like':'%'+_0x431adc[_0xb409('0x30')]['filter']+'%'};return _0x311720;})});}_0x97b9a0=_['merge']({},_0x97b9a0,_0x431adc['options']);return db[_0xb409('0x5d')][_0xb409('0x1e')]({'where':_0x97b9a0['where']})[_0xb409('0x20')](function(_0x2d48c9){_0x28caf4['count']=_0x2d48c9;if(_0x431adc[_0xb409('0x30')][_0xb409('0x3f')]){_0x97b9a0[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x5d')][_0xb409('0x59')](_0x97b9a0);})['then'](function(_0x1e604e){_0x28caf4[_0xb409('0x5a')]=_0x1e604e;return _0x28caf4;});}})[_0xb409('0x20')](respondWithFilteredResult(_0x1adaeb,_0x97b9a0))['catch'](handleError(_0x1adaeb,null));};exports[_0xb409('0x5e')]=function(_0x5a12a8,_0x15a145,_0x3a6a4a){var _0x282ca6={'raw':!![],'where':{}};var _0x5f2791={};var _0x521179={'count':0x0,'rows':[]};return db[_0xb409('0x2b')][_0xb409('0x55')]({'where':{'id':_0x5a12a8[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x15a145,null))[_0xb409('0x20')](function(_0x4d76f2){if(_0x4d76f2){_0x5f2791[_0xb409('0x2e')]=_[_0xb409('0x2f')](db[_0xb409('0x5f')][_0xb409('0x44')]);_0x5f2791[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x5a12a8['query']);_0x5f2791[_0xb409('0x31')]=_[_0xb409('0x32')](_0x5f2791['model'],_0x5f2791[_0xb409('0x30')]);_0x282ca6[_0xb409('0x33')]=_[_0xb409('0x32')](_0x5f2791[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x5a12a8[_0xb409('0x30')][_0xb409('0x34')]));_0x282ca6['attributes']=_0x282ca6[_0xb409('0x33')][_0xb409('0x35')]?_0x282ca6[_0xb409('0x33')]:_0x5f2791['model'];if(!_0x5a12a8[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x282ca6['limit']=qs[_0xb409('0x1d')](_0x5a12a8[_0xb409('0x30')]['limit']);_0x282ca6[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x5a12a8[_0xb409('0x30')][_0xb409('0x1b')]);}_0x282ca6[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x5a12a8[_0xb409('0x30')][_0xb409('0x38')]);_0x282ca6['where']=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x5a12a8['query'],_0x5f2791['filters']));_0x282ca6[_0xb409('0x39')][_0xb409('0x58')]=_0x4d76f2['id'];if(_0x5a12a8[_0xb409('0x30')][_0xb409('0x3d')]){_0x282ca6[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x282ca6[_0xb409('0x39')],{'$or':_[_0xb409('0x2a')](_0x282ca6[_0xb409('0x33')],function(_0x1c644a){var _0x3ca917={};_0x3ca917[_0x1c644a]={'$like':'%'+_0x5a12a8['query'][_0xb409('0x3d')]+'%'};return _0x3ca917;})});}_0x282ca6=_['merge']({},_0x282ca6,_0x5a12a8[_0xb409('0x3e')]);return db['CmHopperBlack'][_0xb409('0x1e')]({'where':_0x282ca6[_0xb409('0x39')]})[_0xb409('0x20')](function(_0x3a6fa9){_0x521179[_0xb409('0x1e')]=_0x3a6fa9;if(_0x5a12a8[_0xb409('0x30')][_0xb409('0x3f')]){_0x282ca6[_0xb409('0x40')]=[{'all':!![]}];}return db[_0xb409('0x5f')][_0xb409('0x59')](_0x282ca6);})[_0xb409('0x20')](function(_0x5c0903){_0x521179[_0xb409('0x5a')]=_0x5c0903;return _0x521179;});}})['then'](respondWithFilteredResult(_0x15a145,_0x282ca6))[_0xb409('0x41')](handleError(_0x15a145,null));};exports['getLists']=function(_0x43fa2b,_0x58319e,_0x25ffc2){var _0xac6978={};var _0x3e59a5={};var _0x1caa62;var _0x2ccd97;return db[_0xb409('0x2b')]['findOne']({'where':{'id':_0x43fa2b[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x58319e,null))['then'](function(_0x1af501){if(_0x1af501){_0x1caa62=_0x1af501;_0x3e59a5[_0xb409('0x2e')]=_[_0xb409('0x2f')](db[_0xb409('0x60')]['rawAttributes']);_0x3e59a5[_0xb409('0x30')]=_[_0xb409('0x2f')](_0x43fa2b[_0xb409('0x30')]);_0x3e59a5[_0xb409('0x31')]=_[_0xb409('0x32')](_0x3e59a5['model'],_0x3e59a5[_0xb409('0x30')]);_0xac6978[_0xb409('0x33')]=_[_0xb409('0x32')](_0x3e59a5['model'],qs[_0xb409('0x34')](_0x43fa2b['query'][_0xb409('0x34')]));_0xac6978[_0xb409('0x33')]=_0xac6978[_0xb409('0x33')]['length']?_0xac6978[_0xb409('0x33')]:_0x3e59a5[_0xb409('0x2e')];_0xac6978[_0xb409('0x57')]=qs[_0xb409('0x38')](_0x43fa2b[_0xb409('0x30')][_0xb409('0x38')]);_0xac6978[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x43fa2b[_0xb409('0x30')],_0x3e59a5['filters']));if(_0x43fa2b[_0xb409('0x30')]['filter']){_0xac6978['where']=_['merge'](_0xac6978['where'],{'$or':_[_0xb409('0x2a')](_0xac6978[_0xb409('0x33')],function(_0x22bdd9){var _0x15515f={};_0x15515f[_0x22bdd9]={'$like':'%'+_0x43fa2b['query'][_0xb409('0x3d')]+'%'};return _0x15515f;})});}_0xac6978=_['merge']({},_0xac6978,_0x43fa2b[_0xb409('0x3e')]);return _0x1caa62[_0xb409('0x61')](_0xac6978);}})[_0xb409('0x20')](function(_0x5d2123){if(_0x5d2123){_0x2ccd97=_0x5d2123[_0xb409('0x35')];if(!_0x43fa2b['query'][_0xb409('0x36')](_0xb409('0x37'))){_0xac6978['limit']=qs['limit'](_0x43fa2b[_0xb409('0x30')][_0xb409('0x1d')]);_0xac6978['offset']=qs['offset'](_0x43fa2b[_0xb409('0x30')]['offset']);}return _0x1caa62[_0xb409('0x61')](_0xac6978);}})[_0xb409('0x20')](function(_0x2dfeb0){if(_0x2dfeb0){return _0x2dfeb0?{'count':_0x2ccd97,'rows':_0x2dfeb0}:null;}})[_0xb409('0x20')](respondWithResult(_0x58319e,null))['catch'](handleError(_0x58319e,null));};exports[_0xb409('0x62')]=function(_0x3b4733,_0xe2750,_0x1708f7){var _0x40b4d5,_0x565de1;var _0x1e9853=[];var _0x2e7cd3=moment()[_0xb409('0x63')](_0xb409('0x64'));return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x3b4733[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0xe2750,null))[_0xb409('0x20')](function(_0x1134f9){if(_0x1134f9){_0x565de1=_0x1134f9;return _0x1134f9[_0xb409('0x62')](_0x3b4733['body'][_0xb409('0x65')],_['omit'](_0x3b4733[_0xb409('0x52')],['ids','id'])||{});}return null;})[_0xb409('0x66')](function(_0x1db146){var _0x14091b;var _0x39cdaf;_0x40b4d5=_0x1db146||[];var _0x4a260b=[];if(_0x1db146){for(var _0xd8720f=0x0;_0xd8720f<_0x1db146[_0xb409('0x35')];_0xd8720f+=0x1){var _0x1d8d1d=_0x1db146[_0xd8720f][_0xb409('0x4a')]({'plain':!![]});_0x565de1[_0xb409('0x67')]=_0x3b4733['body']['dialCheckDuplicateType']?_0x3b4733[_0xb409('0x52')][_0xb409('0x67')]:_0x565de1[_0xb409('0x67')];switch(_0x565de1['dialCheckDuplicateType']){case _0xb409('0x68'):_0x14091b=squel[_0xb409('0x69')]()['into'](_0xb409('0x6a'))[_0xb409('0x6b')]([_0xb409('0x6c'),'scheduledAt',_0xb409('0x6d'),_0xb409('0x6e'),_0xb409('0x58'),_0xb409('0x50'),'updatedAt'],squel['select']()[_0xb409('0x6f')]('phone','phone')[_0xb409('0x6f')](_0xb409('0x70'),'scheduledAt')[_0xb409('0x6f')]('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')](),'ListId')[_0xb409('0x6f')](_0x3b4733['params']['id'][_0xb409('0x72')](),_0xb409('0x58'))['field']('\x27'+_0x2e7cd3+'\x27',_0xb409('0x50'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x51'))[_0xb409('0x73')](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))[_0xb409('0x39')](_0xb409('0x76'),_0x1d8d1d[_0xb409('0x71')]['toString']())[_0xb409('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0xb409('0x39')](_0xb409('0x77'),squel['select']()[_0xb409('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0xb409('0x73')](_0xb409('0x78'))[_0xb409('0x39')](_0xb409('0x79'),_0x3b4733['params']['id'][_0xb409('0x72')]()))[_0xb409('0x39')](_0xb409('0x77'),squel['select']()[_0xb409('0x6f')](_0xb409('0x7a'))[_0xb409('0x73')](_0xb409('0x6a'))['where']('CampaignId\x20=\x20?',_0x3b4733[_0xb409('0x43')]['id']['toString']())))['toString']();break;case _0xb409('0x7b'):_0x14091b=squel[_0xb409('0x69')]()['into'](_0xb409('0x6a'))[_0xb409('0x6b')]([_0xb409('0x6c'),_0xb409('0x7c'),_0xb409('0x6d'),'ListId','CampaignId',_0xb409('0x50'),_0xb409('0x51')],squel[_0xb409('0x7d')]()[_0xb409('0x6f')](_0xb409('0x6c'),'phone')['field'](_0xb409('0x70'),_0xb409('0x7c'))['field']('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')](),_0xb409('0x6e'))[_0xb409('0x6f')](_0x3b4733[_0xb409('0x43')]['id'][_0xb409('0x72')](),'CampaignId')[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x50'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x51'))[_0xb409('0x73')](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))['where'](_0xb409('0x76'),_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0xb409('0x39')](_0xb409('0x77'),squel[_0xb409('0x7d')]()[_0xb409('0x6f')](_0xb409('0x7a'))[_0xb409('0x73')]('cm_hopper')[_0xb409('0x39')](_0xb409('0x79'),_0x3b4733[_0xb409('0x43')]['id'][_0xb409('0x72')]())))[_0xb409('0x72')]();break;default:_0x14091b=squel[_0xb409('0x69')]()['into']('cm_hopper')[_0xb409('0x6b')]([_0xb409('0x6c'),'scheduledAt',_0xb409('0x6d'),_0xb409('0x6e'),_0xb409('0x58'),_0xb409('0x50'),_0xb409('0x51')],squel[_0xb409('0x7d')]()[_0xb409('0x6f')]('phone',_0xb409('0x6c'))[_0xb409('0x6f')]('NOW()',_0xb409('0x7c'))[_0xb409('0x6f')]('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x1d8d1d['CmListId'][_0xb409('0x72')](),'ListId')[_0xb409('0x6f')](_0x3b4733['params']['id'][_0xb409('0x72')](),_0xb409('0x58'))['field']('\x27'+_0x2e7cd3+'\x27','createdAt')[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27','updatedAt')[_0xb409('0x73')](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))[_0xb409('0x39')](_0xb409('0x76'),_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')](_0xb409('0x7e')))[_0xb409('0x72')]();}_0x39cdaf=squel[_0xb409('0x69')]()[_0xb409('0x7f')](_0xb409('0x80'))['fromQuery'](['cmHopperId',_0xb409('0x7c'),_0xb409('0x6c'),_0xb409('0x81'),_0xb409('0x50'),_0xb409('0x51')],squel['select']()[_0xb409('0x6f')](_0xb409('0x82'),'id')[_0xb409('0x6f')](_0xb409('0x70'),_0xb409('0x7c'))[_0xb409('0x6f')]('ci.item',_0xb409('0x6c'))['field'](_0xb409('0x83'),_0xb409('0x81'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x50'))[_0xb409('0x6f')]('\x27'+_0x2e7cd3+'\x27',_0xb409('0x51'))[_0xb409('0x73')](_0xb409('0x84'),'ci')[_0xb409('0x85')](_0xb409('0x6a'),'h',_0xb409('0x86'))[_0xb409('0x39')](_0xb409('0x87'),_0x1d8d1d[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')]('h.CampaignId=?',_0x3b4733[_0xb409('0x43')]['id'][_0xb409('0x72')]())[_0xb409('0x39')](_0xb409('0x88'),_0x2e7cd3))[_0xb409('0x72')]();_0x4a260b[_0xb409('0x89')](db['sequelize'][_0xb409('0x30')](_0x14091b));_0x1e9853[_0xb409('0x89')](db[_0xb409('0x8a')][_0xb409('0x30')](_0x39cdaf));}return BPromise[_0xb409('0x8b')](_0x4a260b);}})[_0xb409('0x20')](function(){return BPromise['all'](_0x1e9853);})[_0xb409('0x20')](function(){return _0x40b4d5;})[_0xb409('0x20')](respondWithResult(_0xe2750,null))[_0xb409('0x41')](handleError(_0xe2750,null));};exports[_0xb409('0x8c')]=function(_0x11072f,_0x32cd33,_0x651a8){return db[_0xb409('0x2b')]['find']({'where':{'id':_0x11072f['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x32cd33,null))[_0xb409('0x20')](function(_0x5e830f){if(_0x5e830f){return _0x5e830f[_0xb409('0x8c')](_0x11072f[_0xb409('0x30')][_0xb409('0x65')]);}})[_0xb409('0x20')](function(_0x2fdd4e){if(_0x2fdd4e){return db[_0xb409('0x56')][_0xb409('0x21')]({'where':{'ListId':_0x11072f[_0xb409('0x30')][_0xb409('0x65')],'CampaignId':_0x11072f['params']['id']}})['then'](function(){return _0x2fdd4e;});}})[_0xb409('0x20')](respondWithStatusCode(_0x32cd33,null))[_0xb409('0x41')](handleError(_0x32cd33,null));};exports[_0xb409('0x8d')]=function(_0x3180bd,_0x54072e,_0x28e216){var _0x5ec19a={};var _0x21ab44={};var _0xcb8555;var _0x2c200f;return db['Campaign'][_0xb409('0x55')]({'where':{'id':_0x3180bd['params']['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x54072e,null))[_0xb409('0x20')](function(_0x2095fa){if(_0x2095fa){_0xcb8555=_0x2095fa;_0x21ab44[_0xb409('0x2e')]=_['keys'](db[_0xb409('0x60')]['rawAttributes']);_0x21ab44[_0xb409('0x30')]=_['keys'](_0x3180bd[_0xb409('0x30')]);_0x21ab44[_0xb409('0x31')]=_[_0xb409('0x32')](_0x21ab44['model'],_0x21ab44[_0xb409('0x30')]);_0x5ec19a[_0xb409('0x33')]=_[_0xb409('0x32')](_0x21ab44[_0xb409('0x2e')],qs[_0xb409('0x34')](_0x3180bd[_0xb409('0x30')][_0xb409('0x34')]));_0x5ec19a['attributes']=_0x5ec19a[_0xb409('0x33')][_0xb409('0x35')]?_0x5ec19a[_0xb409('0x33')]:_0x21ab44[_0xb409('0x2e')];_0x5ec19a['order']=qs[_0xb409('0x38')](_0x3180bd['query'][_0xb409('0x38')]);_0x5ec19a[_0xb409('0x39')]=qs[_0xb409('0x31')](_[_0xb409('0x3a')](_0x3180bd[_0xb409('0x30')],_0x21ab44[_0xb409('0x31')]));if(_0x3180bd['query'][_0xb409('0x3d')]){_0x5ec19a[_0xb409('0x39')]=_[_0xb409('0x3b')](_0x5ec19a['where'],{'$or':_[_0xb409('0x2a')](_0x5ec19a['attributes'],function(_0xa0a2a4){var _0x555469={};_0x555469[_0xa0a2a4]={'$like':'%'+_0x3180bd[_0xb409('0x30')][_0xb409('0x3d')]+'%'};return _0x555469;})});}_0x5ec19a=_['merge']({},_0x5ec19a,_0x3180bd[_0xb409('0x3e')]);return _0xcb8555[_0xb409('0x8d')](_0x5ec19a);}})[_0xb409('0x20')](function(_0xd3b971){if(_0xd3b971){_0x2c200f=_0xd3b971[_0xb409('0x35')];if(!_0x3180bd[_0xb409('0x30')][_0xb409('0x36')](_0xb409('0x37'))){_0x5ec19a[_0xb409('0x1d')]=qs[_0xb409('0x1d')](_0x3180bd[_0xb409('0x30')][_0xb409('0x1d')]);_0x5ec19a[_0xb409('0x1b')]=qs[_0xb409('0x1b')](_0x3180bd['query'][_0xb409('0x1b')]);}return _0xcb8555[_0xb409('0x8d')](_0x5ec19a);}})[_0xb409('0x20')](function(_0x5ad330){if(_0x5ad330){return _0x5ad330?{'count':_0x2c200f,'rows':_0x5ad330}:null;}})[_0xb409('0x20')](respondWithResult(_0x54072e,null))[_0xb409('0x41')](handleError(_0x54072e,null));};exports[_0xb409('0x8e')]=function(_0x1e5d61,_0x453bb5,_0x21cd01){var _0x3da1b3,_0x92e188;var _0x5e4676=[];var _0x5c157b=moment()['format'](_0xb409('0x64'));return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x1e5d61[_0xb409('0x43')]['id']}})['then'](handleEntityNotFound(_0x453bb5,null))[_0xb409('0x20')](function(_0x95c689){if(_0x95c689){_0x92e188=_0x95c689;return _0x95c689['addBlackLists'](_0x1e5d61[_0xb409('0x52')][_0xb409('0x65')],_[_0xb409('0x4f')](_0x1e5d61['body'],[_0xb409('0x65'),'id'])||{});}return null;})[_0xb409('0x66')](function(_0x201883){var _0x3e9611;var _0x13f4e4;_0x3da1b3=_0x201883||[];var _0x1b15d8=[];if(_0x201883){for(var _0x261e25=0x0;_0x261e25<_0x201883['length'];_0x261e25+=0x1){var _0x5d6a8a=_0x201883[_0x261e25][_0xb409('0x4a')]({'plain':!![]});_0x3e9611=squel[_0xb409('0x69')]()['into'](_0xb409('0x8f'))['fromQuery']([_0xb409('0x6c'),_0xb409('0x6d'),'ListId',_0xb409('0x58'),'createdAt',_0xb409('0x51')],squel[_0xb409('0x7d')]()[_0xb409('0x6f')]('phone',_0xb409('0x6c'))[_0xb409('0x6f')]('id',_0xb409('0x6d'))[_0xb409('0x6f')](_0x5d6a8a['CmListId']['toString'](),_0xb409('0x6e'))[_0xb409('0x6f')](_0x1e5d61[_0xb409('0x43')]['id']['toString'](),_0xb409('0x58'))[_0xb409('0x6f')](_0xb409('0x70'),'createdAt')[_0xb409('0x6f')](_0xb409('0x70'),_0xb409('0x51'))['from'](_0xb409('0x74'))[_0xb409('0x39')](_0xb409('0x75'))[_0xb409('0x39')]('ListId\x20=\x20?',_0x5d6a8a[_0xb409('0x71')][_0xb409('0x72')]())[_0xb409('0x39')](_0xb409('0x7e')))[_0xb409('0x72')]();_0x1b15d8['push'](db[_0xb409('0x8a')][_0xb409('0x30')](_0x3e9611));}return BPromise['all'](_0x1b15d8);}})[_0xb409('0x20')](function(){return _0x3da1b3;})[_0xb409('0x20')](respondWithResult(_0x453bb5,null))['catch'](handleError(_0x453bb5,null));};exports[_0xb409('0x90')]=function(_0x20eb70,_0x68612d,_0x11a224){return db[_0xb409('0x2b')][_0xb409('0x45')]({'where':{'id':_0x20eb70[_0xb409('0x43')]['id']}})[_0xb409('0x20')](handleEntityNotFound(_0x68612d,null))['then'](function(_0x3b7f3a){if(_0x3b7f3a){return _0x3b7f3a[_0xb409('0x90')](_0x20eb70['query'][_0xb409('0x65')]);}})[_0xb409('0x20')](function(_0x33aa73){if(_0x33aa73){return db[_0xb409('0x5f')][_0xb409('0x21')]({'where':{'ListId':_0x20eb70[_0xb409('0x30')][_0xb409('0x65')],'CampaignId':_0x20eb70[_0xb409('0x43')]['id']}})[_0xb409('0x20')](function(){return _0x33aa73;});}})[_0xb409('0x20')](respondWithStatusCode(_0x68612d,null))[_0xb409('0x41')](handleError(_0x68612d,null));};
\ No newline at end of file
+var _0x21f8=['limit','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','IvrCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','UserProfileSection','userProfileId','params','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','insert','NOW()','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count'];(function(_0x5273c9,_0x4a8fe7){var _0x3e95bc=function(_0xa79839){while(--_0xa79839){_0x5273c9['push'](_0x5273c9['shift']());}};_0x3e95bc(++_0x4a8fe7);}(_0x21f8,0x71));var _0x821f=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x21f8[_0xd511d];return _0x3f148e;};'use strict';var emlformat=require(_0x821f('0x0'));var rimraf=require(_0x821f('0x1'));var zipdir=require(_0x821f('0x2'));var jsonpatch=require(_0x821f('0x3'));var rp=require(_0x821f('0x4'));var moment=require(_0x821f('0x5'));var BPromise=require(_0x821f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x821f('0x7'));var csv=require(_0x821f('0x8'));var ejs=require(_0x821f('0x9'));var fs=require('fs');var fs_extra=require(_0x821f('0xa'));var _=require(_0x821f('0xb'));var squel=require(_0x821f('0xc'));var crypto=require(_0x821f('0xd'));var jsforce=require(_0x821f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x821f('0xf'));var Papa=require(_0x821f('0x10'));var Redis=require(_0x821f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x821f('0x12'));var as=require(_0x821f('0x13'));var hardwareService=require(_0x821f('0x14'));var logger=require(_0x821f('0x15'))(_0x821f('0x16'));var utils=require(_0x821f('0x17'));var config=require(_0x821f('0x18'));var licenseUtil=require(_0x821f('0x19'));var db=require(_0x821f('0x1a'))['db'];function respondWithStatusCode(_0x2aeb4e,_0x4ba2e2){_0x4ba2e2=_0x4ba2e2||0xcc;return function(_0x4f9752){if(_0x4f9752){return _0x2aeb4e[_0x821f('0x1b')](_0x4ba2e2);}return _0x2aeb4e[_0x821f('0x1c')](_0x4ba2e2)[_0x821f('0x1d')]();};}function respondWithResult(_0x91f4a0,_0x16145e){_0x16145e=_0x16145e||0xc8;return function(_0x42b2fa){if(_0x42b2fa){return _0x91f4a0[_0x821f('0x1c')](_0x16145e)[_0x821f('0x1e')](_0x42b2fa);}};}function respondWithFilteredResult(_0x1aeda5,_0x19d587){return function(_0x4b746c){if(_0x4b746c){var _0x3419ab=typeof _0x19d587['offset']===_0x821f('0x1f')&&typeof _0x19d587['limit']===_0x821f('0x1f');var _0x2b3f5c=_0x4b746c[_0x821f('0x20')];var _0x27c41c=_0x3419ab?0x0:_0x19d587['offset'];var _0x1c015a=_0x3419ab?_0x4b746c[_0x821f('0x20')]:_0x19d587['offset']+_0x19d587[_0x821f('0x21')];var _0x47b0ae;if(_0x1c015a>=_0x2b3f5c){_0x1c015a=_0x2b3f5c;_0x47b0ae=0xc8;}else{_0x47b0ae=0xce;}_0x1aeda5[_0x821f('0x1c')](_0x47b0ae);return _0x1aeda5['set'](_0x821f('0x22'),_0x27c41c+'-'+_0x1c015a+'/'+_0x2b3f5c)[_0x821f('0x1e')](_0x4b746c);}return null;};}function patchUpdates(_0x4fbcf2){return function(_0x4f3283){try{jsonpatch[_0x821f('0x23')](_0x4f3283,_0x4fbcf2,!![]);}catch(_0x187f02){return BPromise[_0x821f('0x24')](_0x187f02);}return _0x4f3283['save']();};}function saveUpdates(_0x3092d8,_0xb5d07){return function(_0x3dda74){if(_0x3dda74){return _0x3dda74['update'](_0x3092d8)[_0x821f('0x25')](function(_0x1ee178){return _0x1ee178;});}return null;};}function removeEntity(_0x4b2e35,_0x4ef246){return function(_0x4ede29){if(_0x4ede29){return _0x4ede29['destroy']()[_0x821f('0x25')](function(){var _0x4af347=_0x4ede29['get']({'plain':!![]});var _0x21c1d9='IvrCampaigns';return db['UserProfileResource'][_0x821f('0x26')]({'where':{'type':_0x21c1d9,'resourceId':_0x4af347['id']}})[_0x821f('0x25')](function(){return _0x4ede29;});})[_0x821f('0x25')](function(){_0x4b2e35[_0x821f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6d94a,_0x418b90){return function(_0x183535){if(!_0x183535){_0xf6d94a[_0x821f('0x1b')](0x194);}return _0x183535;};}function handleError(_0x47f0b6,_0xdd8873){_0xdd8873=_0xdd8873||0x1f4;return function(_0xac9ab1){logger[_0x821f('0x27')](_0xac9ab1[_0x821f('0x28')]);if(_0xac9ab1['name']){delete _0xac9ab1[_0x821f('0x29')];}_0x47f0b6['status'](_0xdd8873)['send'](_0xac9ab1);};}exports[_0x821f('0x2a')]=function(_0xba21fb,_0x962d81){var _0x41c12a={},_0x122e56={},_0x5b10f6={'count':0x0,'rows':[]};var _0x12b057=_[_0x821f('0x2b')](db[_0x821f('0x2c')][_0x821f('0x2d')],function(_0x5429c0){return{'name':_0x5429c0[_0x821f('0x2e')],'type':_0x5429c0[_0x821f('0x2f')][_0x821f('0x30')]};});_0x122e56[_0x821f('0x31')]=_[_0x821f('0x2b')](_0x12b057,_0x821f('0x29'));_0x122e56['query']=_[_0x821f('0x32')](_0xba21fb['query']);_0x122e56[_0x821f('0x33')]=_[_0x821f('0x34')](_0x122e56['model'],_0x122e56['query']);_0x41c12a[_0x821f('0x35')]=_[_0x821f('0x34')](_0x122e56[_0x821f('0x31')],qs[_0x821f('0x36')](_0xba21fb[_0x821f('0x37')]['fields']));_0x41c12a['attributes']=_0x41c12a[_0x821f('0x35')][_0x821f('0x38')]?_0x41c12a[_0x821f('0x35')]:_0x122e56['model'];if(!_0xba21fb[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x41c12a[_0x821f('0x21')]=qs[_0x821f('0x21')](_0xba21fb[_0x821f('0x37')][_0x821f('0x21')]);_0x41c12a['offset']=qs['offset'](_0xba21fb[_0x821f('0x37')][_0x821f('0x3b')]);}_0x41c12a[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0xba21fb[_0x821f('0x37')]['sort']);_0x41c12a['where']=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0xba21fb[_0x821f('0x37')],_0x122e56['filters']),_0x12b057);if(_0xba21fb[_0x821f('0x37')][_0x821f('0x3f')]){_0x41c12a[_0x821f('0x40')]=_['merge'](_0x41c12a[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x12b057,function(_0x147639){if(_0x147639[_0x821f('0x2f')]!==_0x821f('0x41')){var _0x315e59={};_0x315e59[_0x147639['name']]={'$like':'%'+_0xba21fb[_0x821f('0x37')]['filter']+'%'};return _0x315e59;}})});}_0x41c12a=_[_0x821f('0x42')]({},_0x41c12a,_0xba21fb[_0x821f('0x43')]);var _0x404ec7={'where':_0x41c12a[_0x821f('0x40')]};return db[_0x821f('0x2c')][_0x821f('0x20')](_0x404ec7)[_0x821f('0x25')](function(_0x25c0f2){_0x5b10f6['count']=_0x25c0f2;if(_0xba21fb[_0x821f('0x37')][_0x821f('0x44')]){_0x41c12a[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x2c')][_0x821f('0x46')](_0x41c12a);})['then'](function(_0x220e0b){_0x5b10f6[_0x821f('0x47')]=_0x220e0b;return _0x5b10f6;})[_0x821f('0x25')](respondWithFilteredResult(_0x962d81,_0x41c12a))[_0x821f('0x48')](handleError(_0x962d81,null));};exports[_0x821f('0x49')]=function(_0xff3674,_0x26acbe){var _0x1cee9f={'raw':![],'where':{'id':_0xff3674['params']['id']}},_0x122ca0={};_0x122ca0[_0x821f('0x31')]=_['keys'](db[_0x821f('0x2c')]['rawAttributes']);_0x122ca0[_0x821f('0x37')]=_['keys'](_0xff3674[_0x821f('0x37')]);_0x122ca0[_0x821f('0x33')]=_['intersection'](_0x122ca0[_0x821f('0x31')],_0x122ca0['query']);_0x1cee9f[_0x821f('0x35')]=_[_0x821f('0x34')](_0x122ca0['model'],qs[_0x821f('0x36')](_0xff3674[_0x821f('0x37')]['fields']));_0x1cee9f[_0x821f('0x35')]=_0x1cee9f['attributes'][_0x821f('0x38')]?_0x1cee9f[_0x821f('0x35')]:_0x122ca0[_0x821f('0x31')];if(_0xff3674['query'][_0x821f('0x44')]){_0x1cee9f[_0x821f('0x45')]=[{'all':!![]}];}_0x1cee9f=_['merge']({},_0x1cee9f,_0xff3674[_0x821f('0x43')]);return db['Campaign'][_0x821f('0x4a')](_0x1cee9f)[_0x821f('0x25')](handleEntityNotFound(_0x26acbe,null))[_0x821f('0x25')](respondWithResult(_0x26acbe,null))[_0x821f('0x48')](handleError(_0x26acbe,null));};exports[_0x821f('0x4b')]=function(_0x541a2e,_0x314a47){return db[_0x821f('0x2c')][_0x821f('0x4b')](_0x541a2e[_0x821f('0x4c')],{})['then'](function(_0x5c13f6){var _0x16e2b0=_0x541a2e['user']['get']({'plain':!![]});if(!_0x16e2b0)throw new Error(_0x821f('0x4d'));if(_0x16e2b0[_0x821f('0x4e')]===_0x821f('0x4f')){var _0x37715d=_0x5c13f6[_0x821f('0x50')]({'plain':!![]});var _0x4e9470=_0x821f('0x51');return db['UserProfileSection'][_0x821f('0x4a')]({'where':{'name':_0x4e9470,'userProfileId':_0x16e2b0['userProfileId']},'raw':!![]})[_0x821f('0x25')](function(_0x4054a9){if(_0x4054a9&&_0x4054a9[_0x821f('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x37715d[_0x821f('0x29')],'resourceId':_0x37715d['id'],'type':_0x4054a9[_0x821f('0x29')],'sectionId':_0x4054a9['id']},{})[_0x821f('0x25')](function(){return _0x5c13f6;});}else{return _0x5c13f6;}})['catch'](function(_0x386093){logger[_0x821f('0x27')](_0x821f('0x53'),_0x386093);throw _0x386093;});}return _0x5c13f6;})[_0x821f('0x25')](respondWithResult(_0x314a47,0xc9))[_0x821f('0x48')](handleError(_0x314a47,null));};exports['clone']=function(_0x45fcbd,_0x86b32d){var _0x362946={'where':{'id':_0x45fcbd['params']['id']}},_0x35dbb5={};_0x35dbb5[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x2c')][_0x821f('0x2d')]);_0x362946[_0x821f('0x35')]=_['intersection'](_0x35dbb5[_0x821f('0x31')],qs['fields'](_0x45fcbd['query']['fields']));_0x362946['attributes']=_0x362946['attributes'][_0x821f('0x38')]?_0x362946[_0x821f('0x35')]:_0x35dbb5[_0x821f('0x31')];if(_0x45fcbd[_0x821f('0x37')][_0x821f('0x44')]){_0x362946['include']=[{'all':!![]}];}_0x362946=_[_0x821f('0x42')]({},_0x362946,_0x45fcbd[_0x821f('0x43')]);return db['Campaign'][_0x821f('0x4a')](_0x362946)[_0x821f('0x25')](handleEntityNotFound(_0x86b32d,null))[_0x821f('0x25')](function(_0x2e6c20){if(_0x2e6c20){var _0x59e25e=_0x2e6c20[_0x821f('0x50')]({'plain':!![]});_0x59e25e=qs[_0x821f('0x54')](_0x59e25e,['id','createdAt',_0x821f('0x55')]);_0x45fcbd['body']=_[_0x821f('0x54')](_0x45fcbd[_0x821f('0x4c')],['id',_0x821f('0x56'),_0x821f('0x55')]);return db[_0x821f('0x2c')][_0x821f('0x4b')](_[_0x821f('0x42')](_0x59e25e,_0x45fcbd[_0x821f('0x4c')]),{'include':_0x45fcbd[_0x821f('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x821f('0x25')](function(_0x29e6ff){var _0x3e332c=_0x45fcbd['user'][_0x821f('0x50')]({'plain':!![]});if(!_0x3e332c)throw new Error(_0x821f('0x4d'));if(_0x3e332c[_0x821f('0x4e')]===_0x821f('0x4f')){var _0x5004d9=_0x29e6ff[_0x821f('0x50')]({'plain':!![]});var _0x5a87c5=_0x821f('0x51');return db[_0x821f('0x57')][_0x821f('0x4a')]({'where':{'name':_0x5a87c5,'userProfileId':_0x3e332c[_0x821f('0x58')]},'raw':!![]})[_0x821f('0x25')](function(_0x27df7c){if(_0x27df7c&&_0x27df7c[_0x821f('0x52')]===0x0){return db['UserProfileResource'][_0x821f('0x4b')]({'name':_0x5004d9[_0x821f('0x29')],'resourceId':_0x5004d9['id'],'type':_0x27df7c['name'],'sectionId':_0x27df7c['id']},{})[_0x821f('0x25')](function(){return _0x29e6ff;});}else{return _0x29e6ff;}})[_0x821f('0x48')](function(_0x5dafdc){logger[_0x821f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dafdc);throw _0x5dafdc;});}return _0x29e6ff;});}})['then'](respondWithResult(_0x86b32d,0xc9))[_0x821f('0x48')](handleError(_0x86b32d,null));};exports['update']=function(_0x1ccbc0,_0xb77858){if(_0x1ccbc0[_0x821f('0x4c')]['id']){delete _0x1ccbc0[_0x821f('0x4c')]['id'];}return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x1ccbc0[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0xb77858,null))[_0x821f('0x25')](saveUpdates(_0x1ccbc0[_0x821f('0x4c')],null))[_0x821f('0x25')](respondWithResult(_0xb77858,null))[_0x821f('0x48')](handleError(_0xb77858,null));};exports[_0x821f('0x26')]=function(_0x3316cf,_0x399d06){return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x3316cf[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x399d06,null))[_0x821f('0x25')](removeEntity(_0x399d06,null))[_0x821f('0x48')](handleError(_0x399d06,null));};exports[_0x821f('0x5a')]=function(_0x1c8bb9,_0x169f8f,_0x13f19c){var _0x1b1212={'raw':!![],'where':{}};var _0xddd0a4={};var _0x29dc0c={'count':0x0,'rows':[]};return db[_0x821f('0x2c')][_0x821f('0x5b')]({'where':{'id':_0x1c8bb9[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x169f8f,null))[_0x821f('0x25')](function(_0x83a2c5){if(_0x83a2c5){_0xddd0a4['model']=_[_0x821f('0x32')](db[_0x821f('0x5c')][_0x821f('0x2d')]);_0xddd0a4['query']=_[_0x821f('0x32')](_0x1c8bb9[_0x821f('0x37')]);_0xddd0a4['filters']=_[_0x821f('0x34')](_0xddd0a4[_0x821f('0x31')],_0xddd0a4[_0x821f('0x37')]);_0x1b1212[_0x821f('0x35')]=_[_0x821f('0x34')](_0xddd0a4[_0x821f('0x31')],qs[_0x821f('0x36')](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x36')]));_0x1b1212[_0x821f('0x35')]=_0x1b1212[_0x821f('0x35')][_0x821f('0x38')]?_0x1b1212['attributes']:_0xddd0a4[_0x821f('0x31')];if(!_0x1c8bb9[_0x821f('0x37')]['hasOwnProperty'](_0x821f('0x3a'))){_0x1b1212[_0x821f('0x21')]=qs['limit'](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x21')]);_0x1b1212[_0x821f('0x3b')]=qs['offset'](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x3b')]);}_0x1b1212['order']=qs[_0x821f('0x3d')](_0x1c8bb9[_0x821f('0x37')][_0x821f('0x3d')]);_0x1b1212[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x1c8bb9['query'],_0xddd0a4[_0x821f('0x33')]));_0x1b1212['where']['CampaignId']=_0x83a2c5['id'];if(_0x1c8bb9[_0x821f('0x37')][_0x821f('0x3f')]){_0x1b1212['where']=_['merge'](_0x1b1212[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x1b1212[_0x821f('0x35')],function(_0x3a04c3){var _0x4aa0be={};_0x4aa0be[_0x3a04c3]={'$like':'%'+_0x1c8bb9[_0x821f('0x37')]['filter']+'%'};return _0x4aa0be;})});}_0x1b1212=_['merge']({},_0x1b1212,_0x1c8bb9[_0x821f('0x43')]);return db[_0x821f('0x5c')][_0x821f('0x20')]({'where':_0x1b1212[_0x821f('0x40')]})[_0x821f('0x25')](function(_0x406e9d){_0x29dc0c[_0x821f('0x20')]=_0x406e9d;if(_0x1c8bb9[_0x821f('0x37')][_0x821f('0x44')]){_0x1b1212[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x5c')][_0x821f('0x46')](_0x1b1212);})['then'](function(_0x3611c4){_0x29dc0c[_0x821f('0x47')]=_0x3611c4;return _0x29dc0c;});}})[_0x821f('0x25')](respondWithFilteredResult(_0x169f8f,_0x1b1212))[_0x821f('0x48')](handleError(_0x169f8f,null));};exports[_0x821f('0x5d')]=function(_0x2f735e,_0xa5293d,_0x43585b){var _0x4e820c={'raw':!![],'where':{}};var _0x531ffd={};var _0x5f0d0d={'count':0x0,'rows':[]};return db['Campaign'][_0x821f('0x5b')]({'where':{'id':_0x2f735e['params']['id']}})[_0x821f('0x25')](handleEntityNotFound(_0xa5293d,null))[_0x821f('0x25')](function(_0x195dae){if(_0x195dae){_0x531ffd[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x5e')][_0x821f('0x2d')]);_0x531ffd[_0x821f('0x37')]=_[_0x821f('0x32')](_0x2f735e[_0x821f('0x37')]);_0x531ffd[_0x821f('0x33')]=_[_0x821f('0x34')](_0x531ffd[_0x821f('0x31')],_0x531ffd[_0x821f('0x37')]);_0x4e820c['attributes']=_['intersection'](_0x531ffd['model'],qs[_0x821f('0x36')](_0x2f735e['query'][_0x821f('0x36')]));_0x4e820c['attributes']=_0x4e820c[_0x821f('0x35')][_0x821f('0x38')]?_0x4e820c[_0x821f('0x35')]:_0x531ffd[_0x821f('0x31')];if(!_0x2f735e[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x4e820c['limit']=qs[_0x821f('0x21')](_0x2f735e['query'][_0x821f('0x21')]);_0x4e820c[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x2f735e[_0x821f('0x37')][_0x821f('0x3b')]);}_0x4e820c[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0x2f735e[_0x821f('0x37')][_0x821f('0x3d')]);_0x4e820c['where']=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x2f735e['query'],_0x531ffd[_0x821f('0x33')]));_0x4e820c[_0x821f('0x40')]['CampaignId']=_0x195dae['id'];if(_0x2f735e['query'][_0x821f('0x3f')]){_0x4e820c[_0x821f('0x40')]=_[_0x821f('0x42')](_0x4e820c[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x4e820c[_0x821f('0x35')],function(_0x4d558b){var _0x55b21c={};_0x55b21c[_0x4d558b]={'$like':'%'+_0x2f735e[_0x821f('0x37')]['filter']+'%'};return _0x55b21c;})});}_0x4e820c=_[_0x821f('0x42')]({},_0x4e820c,_0x2f735e[_0x821f('0x43')]);return db[_0x821f('0x5e')][_0x821f('0x20')]({'where':_0x4e820c[_0x821f('0x40')]})['then'](function(_0x21ff7d){_0x5f0d0d[_0x821f('0x20')]=_0x21ff7d;if(_0x2f735e[_0x821f('0x37')]['includeAll']){_0x4e820c[_0x821f('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x821f('0x46')](_0x4e820c);})['then'](function(_0x454157){_0x5f0d0d['rows']=_0x454157;return _0x5f0d0d;});}})[_0x821f('0x25')](respondWithFilteredResult(_0xa5293d,_0x4e820c))[_0x821f('0x48')](handleError(_0xa5293d,null));};exports[_0x821f('0x5f')]=function(_0x260c5c,_0x165dcb,_0x5b4539){var _0x515791={'raw':!![],'where':{}};var _0x4e2f02={};var _0x1f52aa={'count':0x0,'rows':[]};return db['Campaign'][_0x821f('0x5b')]({'where':{'id':_0x260c5c[_0x821f('0x59')]['id']}})['then'](handleEntityNotFound(_0x165dcb,null))[_0x821f('0x25')](function(_0x52b202){if(_0x52b202){_0x4e2f02['model']=_[_0x821f('0x32')](db[_0x821f('0x60')][_0x821f('0x2d')]);_0x4e2f02[_0x821f('0x37')]=_[_0x821f('0x32')](_0x260c5c['query']);_0x4e2f02['filters']=_[_0x821f('0x34')](_0x4e2f02[_0x821f('0x31')],_0x4e2f02[_0x821f('0x37')]);_0x515791[_0x821f('0x35')]=_[_0x821f('0x34')](_0x4e2f02[_0x821f('0x31')],qs[_0x821f('0x36')](_0x260c5c[_0x821f('0x37')][_0x821f('0x36')]));_0x515791['attributes']=_0x515791[_0x821f('0x35')][_0x821f('0x38')]?_0x515791[_0x821f('0x35')]:_0x4e2f02[_0x821f('0x31')];if(!_0x260c5c[_0x821f('0x37')][_0x821f('0x39')]('nolimit')){_0x515791['limit']=qs[_0x821f('0x21')](_0x260c5c['query'][_0x821f('0x21')]);_0x515791[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x260c5c['query'][_0x821f('0x3b')]);}_0x515791[_0x821f('0x3c')]=qs['sort'](_0x260c5c[_0x821f('0x37')][_0x821f('0x3d')]);_0x515791[_0x821f('0x40')]=qs[_0x821f('0x33')](_['pick'](_0x260c5c['query'],_0x4e2f02[_0x821f('0x33')]));_0x515791[_0x821f('0x40')][_0x821f('0x61')]=_0x52b202['id'];if(_0x260c5c[_0x821f('0x37')][_0x821f('0x3f')]){_0x515791[_0x821f('0x40')]=_[_0x821f('0x42')](_0x515791['where'],{'$or':_['map'](_0x515791[_0x821f('0x35')],function(_0x27b31f){var _0x45b65a={};_0x45b65a[_0x27b31f]={'$like':'%'+_0x260c5c[_0x821f('0x37')][_0x821f('0x3f')]+'%'};return _0x45b65a;})});}_0x515791=_[_0x821f('0x42')]({},_0x515791,_0x260c5c[_0x821f('0x43')]);return db[_0x821f('0x60')][_0x821f('0x20')]({'where':_0x515791[_0x821f('0x40')]})[_0x821f('0x25')](function(_0x21d120){_0x1f52aa[_0x821f('0x20')]=_0x21d120;if(_0x260c5c[_0x821f('0x37')]['includeAll']){_0x515791[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x60')][_0x821f('0x46')](_0x515791);})[_0x821f('0x25')](function(_0x51f9d7){_0x1f52aa[_0x821f('0x47')]=_0x51f9d7;return _0x1f52aa;});}})[_0x821f('0x25')](respondWithFilteredResult(_0x165dcb,_0x515791))[_0x821f('0x48')](handleError(_0x165dcb,null));};exports['getHopperBlacks']=function(_0x44bfdb,_0x2d95d9,_0x38f366){var _0x6cb426={'raw':!![],'where':{}};var _0x33a628={};var _0x5c0ce4={'count':0x0,'rows':[]};return db[_0x821f('0x2c')]['findOne']({'where':{'id':_0x44bfdb['params']['id']}})['then'](handleEntityNotFound(_0x2d95d9,null))['then'](function(_0x6bcd5b){if(_0x6bcd5b){_0x33a628[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x62')]['rawAttributes']);_0x33a628[_0x821f('0x37')]=_[_0x821f('0x32')](_0x44bfdb['query']);_0x33a628[_0x821f('0x33')]=_[_0x821f('0x34')](_0x33a628[_0x821f('0x31')],_0x33a628[_0x821f('0x37')]);_0x6cb426['attributes']=_[_0x821f('0x34')](_0x33a628['model'],qs[_0x821f('0x36')](_0x44bfdb[_0x821f('0x37')][_0x821f('0x36')]));_0x6cb426['attributes']=_0x6cb426[_0x821f('0x35')][_0x821f('0x38')]?_0x6cb426[_0x821f('0x35')]:_0x33a628[_0x821f('0x31')];if(!_0x44bfdb[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x6cb426['limit']=qs[_0x821f('0x21')](_0x44bfdb[_0x821f('0x37')][_0x821f('0x21')]);_0x6cb426['offset']=qs['offset'](_0x44bfdb[_0x821f('0x37')][_0x821f('0x3b')]);}_0x6cb426[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0x44bfdb['query'][_0x821f('0x3d')]);_0x6cb426[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x44bfdb[_0x821f('0x37')],_0x33a628[_0x821f('0x33')]));_0x6cb426[_0x821f('0x40')][_0x821f('0x61')]=_0x6bcd5b['id'];if(_0x44bfdb['query'][_0x821f('0x3f')]){_0x6cb426['where']=_[_0x821f('0x42')](_0x6cb426[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x6cb426[_0x821f('0x35')],function(_0x3df0c7){var _0x1894a3={};_0x1894a3[_0x3df0c7]={'$like':'%'+_0x44bfdb['query'][_0x821f('0x3f')]+'%'};return _0x1894a3;})});}_0x6cb426=_['merge']({},_0x6cb426,_0x44bfdb[_0x821f('0x43')]);return db['CmHopperBlack'][_0x821f('0x20')]({'where':_0x6cb426[_0x821f('0x40')]})[_0x821f('0x25')](function(_0x3c3085){_0x5c0ce4[_0x821f('0x20')]=_0x3c3085;if(_0x44bfdb['query'][_0x821f('0x44')]){_0x6cb426[_0x821f('0x45')]=[{'all':!![]}];}return db[_0x821f('0x62')][_0x821f('0x46')](_0x6cb426);})[_0x821f('0x25')](function(_0x22c52a){_0x5c0ce4[_0x821f('0x47')]=_0x22c52a;return _0x5c0ce4;});}})[_0x821f('0x25')](respondWithFilteredResult(_0x2d95d9,_0x6cb426))[_0x821f('0x48')](handleError(_0x2d95d9,null));};exports['getLists']=function(_0x3c8a3e,_0x5186dd,_0x4f0f92){var _0x5eadc1={};var _0x39f66e={};var _0x36b360;var _0x3f6d27;return db[_0x821f('0x2c')][_0x821f('0x5b')]({'where':{'id':_0x3c8a3e[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x5186dd,null))['then'](function(_0xc0a78c){if(_0xc0a78c){_0x36b360=_0xc0a78c;_0x39f66e[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x63')]['rawAttributes']);_0x39f66e[_0x821f('0x37')]=_[_0x821f('0x32')](_0x3c8a3e[_0x821f('0x37')]);_0x39f66e[_0x821f('0x33')]=_[_0x821f('0x34')](_0x39f66e['model'],_0x39f66e[_0x821f('0x37')]);_0x5eadc1[_0x821f('0x35')]=_[_0x821f('0x34')](_0x39f66e[_0x821f('0x31')],qs['fields'](_0x3c8a3e['query'][_0x821f('0x36')]));_0x5eadc1['attributes']=_0x5eadc1[_0x821f('0x35')][_0x821f('0x38')]?_0x5eadc1[_0x821f('0x35')]:_0x39f66e[_0x821f('0x31')];_0x5eadc1['order']=qs[_0x821f('0x3d')](_0x3c8a3e[_0x821f('0x37')][_0x821f('0x3d')]);_0x5eadc1[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x3c8a3e['query'],_0x39f66e[_0x821f('0x33')]));if(_0x3c8a3e[_0x821f('0x37')][_0x821f('0x3f')]){_0x5eadc1[_0x821f('0x40')]=_[_0x821f('0x42')](_0x5eadc1[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x5eadc1[_0x821f('0x35')],function(_0x57ad8f){var _0x1b4de3={};_0x1b4de3[_0x57ad8f]={'$like':'%'+_0x3c8a3e[_0x821f('0x37')][_0x821f('0x3f')]+'%'};return _0x1b4de3;})});}_0x5eadc1=_[_0x821f('0x42')]({},_0x5eadc1,_0x3c8a3e[_0x821f('0x43')]);return _0x36b360[_0x821f('0x64')](_0x5eadc1);}})[_0x821f('0x25')](function(_0x53e224){if(_0x53e224){_0x3f6d27=_0x53e224[_0x821f('0x38')];if(!_0x3c8a3e[_0x821f('0x37')][_0x821f('0x39')](_0x821f('0x3a'))){_0x5eadc1['limit']=qs[_0x821f('0x21')](_0x3c8a3e[_0x821f('0x37')][_0x821f('0x21')]);_0x5eadc1[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x3c8a3e['query'][_0x821f('0x3b')]);}return _0x36b360[_0x821f('0x64')](_0x5eadc1);}})['then'](function(_0x257428){if(_0x257428){return _0x257428?{'count':_0x3f6d27,'rows':_0x257428}:null;}})[_0x821f('0x25')](respondWithResult(_0x5186dd,null))[_0x821f('0x48')](handleError(_0x5186dd,null));};exports[_0x821f('0x65')]=function(_0x377c3d,_0x48fa4e,_0x482271){var _0x518616,_0x2e7e39;var _0x156316=[];var _0x452c2e=moment()[_0x821f('0x66')](_0x821f('0x67'));return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x377c3d[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x48fa4e,null))[_0x821f('0x25')](function(_0x52af51){if(_0x52af51){_0x2e7e39=_0x52af51;return _0x52af51[_0x821f('0x65')](_0x377c3d['body'][_0x821f('0x68')],_[_0x821f('0x54')](_0x377c3d[_0x821f('0x4c')],[_0x821f('0x68'),'id'])||{});}return null;})[_0x821f('0x69')](function(_0x2a79c7){var _0x724c60;var _0xf463c8;_0x518616=_0x2a79c7||[];var _0x5efe47=[];if(_0x2a79c7){for(var _0x5e8e2f=0x0;_0x5e8e2f<_0x2a79c7['length'];_0x5e8e2f+=0x1){var _0x2553fa=_0x2a79c7[_0x5e8e2f][_0x821f('0x50')]({'plain':!![]});_0x2e7e39['dialCheckDuplicateType']=_0x377c3d[_0x821f('0x4c')][_0x821f('0x6a')]?_0x377c3d[_0x821f('0x4c')][_0x821f('0x6a')]:_0x2e7e39[_0x821f('0x6a')];switch(_0x2e7e39['dialCheckDuplicateType']){case _0x821f('0x6b'):_0x724c60=squel['insert']()[_0x821f('0x6c')]('cm_hopper')[_0x821f('0x6d')]([_0x821f('0x6e'),_0x821f('0x6f'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x61'),_0x821f('0x56'),_0x821f('0x55')],squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x6e'),_0x821f('0x6e'))[_0x821f('0x73')]('NOW()',_0x821f('0x6f'))[_0x821f('0x73')]('id',_0x821f('0x70'))['field'](_0x2553fa[_0x821f('0x74')]['toString'](),_0x821f('0x71'))[_0x821f('0x73')](_0x377c3d[_0x821f('0x59')]['id'][_0x821f('0x75')](),'CampaignId')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x56'))[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))[_0x821f('0x76')]('cm_contacts')[_0x821f('0x40')](_0x821f('0x77'))[_0x821f('0x40')]('ListId\x20=\x20?',_0x2553fa[_0x821f('0x74')][_0x821f('0x75')]())['where'](_0x821f('0x78'))[_0x821f('0x40')](_0x821f('0x79'),squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x7a'))[_0x821f('0x76')]('cm_hopper_final')[_0x821f('0x40')](_0x821f('0x7b'),_0x377c3d['params']['id'][_0x821f('0x75')]()))[_0x821f('0x40')](_0x821f('0x79'),squel['select']()['field'](_0x821f('0x7c'))[_0x821f('0x76')](_0x821f('0x7d'))['where'](_0x821f('0x7b'),_0x377c3d['params']['id'][_0x821f('0x75')]())))[_0x821f('0x75')]();break;case'onlyIfOpen':_0x724c60=squel[_0x821f('0x7e')]()[_0x821f('0x6c')](_0x821f('0x7d'))['fromQuery']([_0x821f('0x6e'),'scheduledAt',_0x821f('0x70'),_0x821f('0x71'),'CampaignId',_0x821f('0x56'),_0x821f('0x55')],squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x6e'),_0x821f('0x6e'))['field'](_0x821f('0x7f'),'scheduledAt')[_0x821f('0x73')]('id',_0x821f('0x70'))[_0x821f('0x73')](_0x2553fa['CmListId'][_0x821f('0x75')](),_0x821f('0x71'))['field'](_0x377c3d[_0x821f('0x59')]['id'][_0x821f('0x75')](),_0x821f('0x61'))['field']('\x27'+_0x452c2e+'\x27',_0x821f('0x56'))[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))['from'](_0x821f('0x80'))[_0x821f('0x40')](_0x821f('0x77'))['where'](_0x821f('0x81'),_0x2553fa[_0x821f('0x74')][_0x821f('0x75')]())[_0x821f('0x40')](_0x821f('0x78'))['where'](_0x821f('0x79'),squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x7c'))[_0x821f('0x76')](_0x821f('0x7d'))[_0x821f('0x40')](_0x821f('0x7b'),_0x377c3d['params']['id'][_0x821f('0x75')]())))[_0x821f('0x75')]();break;default:_0x724c60=squel[_0x821f('0x7e')]()['into'](_0x821f('0x7d'))[_0x821f('0x6d')]([_0x821f('0x6e'),_0x821f('0x6f'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x61'),_0x821f('0x56'),_0x821f('0x55')],squel['select']()[_0x821f('0x73')](_0x821f('0x6e'),_0x821f('0x6e'))[_0x821f('0x73')]('NOW()',_0x821f('0x6f'))[_0x821f('0x73')]('id',_0x821f('0x70'))[_0x821f('0x73')](_0x2553fa[_0x821f('0x74')]['toString'](),_0x821f('0x71'))['field'](_0x377c3d[_0x821f('0x59')]['id'][_0x821f('0x75')](),'CampaignId')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27','createdAt')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))[_0x821f('0x76')](_0x821f('0x80'))['where'](_0x821f('0x77'))[_0x821f('0x40')](_0x821f('0x81'),_0x2553fa[_0x821f('0x74')][_0x821f('0x75')]())[_0x821f('0x40')](_0x821f('0x78')))[_0x821f('0x75')]();}_0xf463c8=squel['insert']()['into'](_0x821f('0x82'))[_0x821f('0x6d')]([_0x821f('0x83'),_0x821f('0x6f'),'phone',_0x821f('0x84'),'createdAt',_0x821f('0x55')],squel[_0x821f('0x72')]()[_0x821f('0x73')](_0x821f('0x85'),'id')[_0x821f('0x73')](_0x821f('0x7f'),_0x821f('0x6f'))[_0x821f('0x73')](_0x821f('0x86'),'phone')['field']('ci.OrderBY',_0x821f('0x84'))[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27','createdAt')[_0x821f('0x73')]('\x27'+_0x452c2e+'\x27',_0x821f('0x55'))[_0x821f('0x76')](_0x821f('0x87'),'ci')[_0x821f('0x88')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x821f('0x40')]('h.ListId\x20=\x20?',_0x2553fa['CmListId'][_0x821f('0x75')]())[_0x821f('0x40')]('h.CampaignId=?',_0x377c3d['params']['id'][_0x821f('0x75')]())[_0x821f('0x40')](_0x821f('0x89'),_0x452c2e))['toString']();_0x5efe47[_0x821f('0x8a')](db[_0x821f('0x8b')]['query'](_0x724c60));_0x156316[_0x821f('0x8a')](db[_0x821f('0x8b')]['query'](_0xf463c8));}return BPromise[_0x821f('0x8c')](_0x5efe47);}})[_0x821f('0x25')](function(){return BPromise['all'](_0x156316);})[_0x821f('0x25')](function(){return _0x518616;})['then'](respondWithResult(_0x48fa4e,null))[_0x821f('0x48')](handleError(_0x48fa4e,null));};exports[_0x821f('0x8d')]=function(_0xdf8080,_0x1e6dc1,_0x33830f){return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0xdf8080[_0x821f('0x59')]['id']}})['then'](handleEntityNotFound(_0x1e6dc1,null))[_0x821f('0x25')](function(_0x4b5f37){if(_0x4b5f37){return _0x4b5f37['removeLists'](_0xdf8080[_0x821f('0x37')]['ids']);}})[_0x821f('0x25')](function(_0x5086c0){if(_0x5086c0){return db[_0x821f('0x5c')][_0x821f('0x26')]({'where':{'ListId':_0xdf8080['query'][_0x821f('0x68')],'CampaignId':_0xdf8080['params']['id']}})[_0x821f('0x25')](function(){return _0x5086c0;});}})[_0x821f('0x25')](respondWithStatusCode(_0x1e6dc1,null))[_0x821f('0x48')](handleError(_0x1e6dc1,null));};exports['getBlackLists']=function(_0x2b736f,_0x54419c,_0x499632){var _0x515b3e={};var _0x322175={};var _0x3406d8;var _0x3c6074;return db[_0x821f('0x2c')][_0x821f('0x5b')]({'where':{'id':_0x2b736f[_0x821f('0x59')]['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x54419c,null))[_0x821f('0x25')](function(_0x22bced){if(_0x22bced){_0x3406d8=_0x22bced;_0x322175[_0x821f('0x31')]=_[_0x821f('0x32')](db[_0x821f('0x63')]['rawAttributes']);_0x322175[_0x821f('0x37')]=_[_0x821f('0x32')](_0x2b736f['query']);_0x322175[_0x821f('0x33')]=_[_0x821f('0x34')](_0x322175['model'],_0x322175[_0x821f('0x37')]);_0x515b3e[_0x821f('0x35')]=_[_0x821f('0x34')](_0x322175[_0x821f('0x31')],qs[_0x821f('0x36')](_0x2b736f[_0x821f('0x37')]['fields']));_0x515b3e[_0x821f('0x35')]=_0x515b3e[_0x821f('0x35')]['length']?_0x515b3e[_0x821f('0x35')]:_0x322175[_0x821f('0x31')];_0x515b3e[_0x821f('0x3c')]=qs[_0x821f('0x3d')](_0x2b736f[_0x821f('0x37')]['sort']);_0x515b3e[_0x821f('0x40')]=qs[_0x821f('0x33')](_[_0x821f('0x3e')](_0x2b736f[_0x821f('0x37')],_0x322175[_0x821f('0x33')]));if(_0x2b736f[_0x821f('0x37')][_0x821f('0x3f')]){_0x515b3e[_0x821f('0x40')]=_[_0x821f('0x42')](_0x515b3e[_0x821f('0x40')],{'$or':_[_0x821f('0x2b')](_0x515b3e[_0x821f('0x35')],function(_0x45666a){var _0x54b949={};_0x54b949[_0x45666a]={'$like':'%'+_0x2b736f[_0x821f('0x37')][_0x821f('0x3f')]+'%'};return _0x54b949;})});}_0x515b3e=_[_0x821f('0x42')]({},_0x515b3e,_0x2b736f[_0x821f('0x43')]);return _0x3406d8[_0x821f('0x8e')](_0x515b3e);}})['then'](function(_0x3a8910){if(_0x3a8910){_0x3c6074=_0x3a8910[_0x821f('0x38')];if(!_0x2b736f['query'][_0x821f('0x39')]('nolimit')){_0x515b3e[_0x821f('0x21')]=qs[_0x821f('0x21')](_0x2b736f[_0x821f('0x37')][_0x821f('0x21')]);_0x515b3e[_0x821f('0x3b')]=qs[_0x821f('0x3b')](_0x2b736f['query']['offset']);}return _0x3406d8[_0x821f('0x8e')](_0x515b3e);}})[_0x821f('0x25')](function(_0x29a44f){if(_0x29a44f){return _0x29a44f?{'count':_0x3c6074,'rows':_0x29a44f}:null;}})[_0x821f('0x25')](respondWithResult(_0x54419c,null))['catch'](handleError(_0x54419c,null));};exports[_0x821f('0x8f')]=function(_0x273bdb,_0x365f32,_0x3a8e6d){var _0x1796f1,_0x303bbf;var _0x55f70f=[];var _0x3c0747=moment()[_0x821f('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x821f('0x2c')]['find']({'where':{'id':_0x273bdb['params']['id']}})[_0x821f('0x25')](handleEntityNotFound(_0x365f32,null))['then'](function(_0x9a5990){if(_0x9a5990){_0x303bbf=_0x9a5990;return _0x9a5990[_0x821f('0x8f')](_0x273bdb[_0x821f('0x4c')][_0x821f('0x68')],_['omit'](_0x273bdb[_0x821f('0x4c')],[_0x821f('0x68'),'id'])||{});}return null;})['spread'](function(_0x25bd07){var _0x1ede1f;var _0x2a137c;_0x1796f1=_0x25bd07||[];var _0x3aba1f=[];if(_0x25bd07){for(var _0x3abba1=0x0;_0x3abba1<_0x25bd07[_0x821f('0x38')];_0x3abba1+=0x1){var _0x340a5b=_0x25bd07[_0x3abba1]['get']({'plain':!![]});_0x1ede1f=squel[_0x821f('0x7e')]()[_0x821f('0x6c')](_0x821f('0x90'))['fromQuery']([_0x821f('0x6e'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x61'),_0x821f('0x56'),_0x821f('0x55')],squel[_0x821f('0x72')]()['field']('phone',_0x821f('0x6e'))[_0x821f('0x73')]('id','ContactId')[_0x821f('0x73')](_0x340a5b[_0x821f('0x74')][_0x821f('0x75')](),_0x821f('0x71'))[_0x821f('0x73')](_0x273bdb[_0x821f('0x59')]['id']['toString'](),_0x821f('0x61'))[_0x821f('0x73')](_0x821f('0x7f'),_0x821f('0x56'))['field'](_0x821f('0x7f'),_0x821f('0x55'))['from'](_0x821f('0x80'))[_0x821f('0x40')](_0x821f('0x77'))[_0x821f('0x40')](_0x821f('0x81'),_0x340a5b[_0x821f('0x74')][_0x821f('0x75')]())[_0x821f('0x40')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x3aba1f['push'](db[_0x821f('0x8b')][_0x821f('0x37')](_0x1ede1f));}return BPromise[_0x821f('0x8c')](_0x3aba1f);}})[_0x821f('0x25')](function(){return _0x1796f1;})[_0x821f('0x25')](respondWithResult(_0x365f32,null))[_0x821f('0x48')](handleError(_0x365f32,null));};exports[_0x821f('0x91')]=function(_0x35338,_0x30b311,_0x2782b5){return db[_0x821f('0x2c')][_0x821f('0x4a')]({'where':{'id':_0x35338[_0x821f('0x59')]['id']}})['then'](handleEntityNotFound(_0x30b311,null))[_0x821f('0x25')](function(_0x54652f){if(_0x54652f){return _0x54652f['removeBlackLists'](_0x35338['query'][_0x821f('0x68')]);}})[_0x821f('0x25')](function(_0x499553){if(_0x499553){return db['CmHopperBlack'][_0x821f('0x26')]({'where':{'ListId':_0x35338[_0x821f('0x37')][_0x821f('0x68')],'CampaignId':_0x35338[_0x821f('0x59')]['id']}})[_0x821f('0x25')](function(){return _0x499553;});}})['then'](respondWithStatusCode(_0x30b311,null))[_0x821f('0x48')](handleError(_0x30b311,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 54129ae..6f550fa 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x46f098,_0x5f5063){var _0x1eef1d=function(_0x4d8b59){while(--_0x4d8b59){_0x46f098['push'](_0x46f098['shift']());}};_0x1eef1d(++_0x5f5063);}(_0x7a54,0x106));var _0x47a5=function(_0x46405c,_0x33d64c){_0x46405c=_0x46405c-0x0;var _0x4c4e7d=_0x7a54[_0x46405c];return _0x4c4e7d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index ce34cc5..024594e 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 _0x559a=['Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x559a,0xb3));var _0xa559=function(_0x4278eb,_0x16a32e){_0x4278eb=_0x4278eb-0x0;var _0x393dc1=_0x559a[_0x4278eb];return _0x393dc1;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var moment=require('moment');var BPromise=require(_0xa559('0x2'));var rs=require(_0xa559('0x3'));var fs=require('fs');var Redis=require(_0xa559('0x4'));var db=require(_0xa559('0x5'))['db'];var utils=require(_0xa559('0x6'));var logger=require(_0xa559('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa559('0x8'));var client=jayson[_0xa559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edab4,_0x1a5cec,_0x4eada1){return new BPromise(function(_0xb8055,_0x218e3b){return client[_0xa559('0xa')](_0x2edab4,_0x4eada1)[_0xa559('0xb')](function(_0x48aa9a){logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,_0xa559('0xe'));logger[_0xa559('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1a5cec,'request\x20sent',JSON[_0xa559('0x10')](_0x48aa9a));if(_0x48aa9a[_0xa559('0x11')]){if(_0x48aa9a['error'][_0xa559('0x12')]===0x1f4){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a['error'][_0xa559('0x13')]);return _0x218e3b(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a[_0xa559('0x11')]['message']);return _0xb8055(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}else{logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,'request\x20sent');_0xb8055(_0x48aa9a[_0xa559('0x14')]['message']);}})[_0xa559('0x15')](function(_0x1387b6){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x1387b6);_0x218e3b(_0x1387b6);});});}exports[_0xa559('0x16')]=function(_0x163405){var _0xd21ebf=this;return new Promise(function(_0x1a4c42,_0x16f090){return db[_0xa559('0x17')][_0xa559('0x18')]({'raw':_0x163405[_0xa559('0x19')]?_0x163405[_0xa559('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x163405['options']?_0x163405[_0xa559('0x19')][_0xa559('0x1a')]||null:null,'attributes':_0x163405['options']?_0x163405[_0xa559('0x19')][_0xa559('0x1b')]||null:null,'limit':_0x163405[_0xa559('0x19')]?_0x163405[_0xa559('0x19')][_0xa559('0x1c')]||null:null,'include':_0x163405[_0xa559('0x19')]?_0x163405['options'][_0xa559('0x1d')]?_['map'](_0x163405[_0xa559('0x19')][_0xa559('0x1d')],function(_0x314fef){return{'model':db[_0x314fef['model']],'as':_0x314fef['as'],'attributes':_0x314fef[_0xa559('0x1b')],'include':_0x314fef['include']?_[_0xa559('0x1e')](_0x314fef[_0xa559('0x1d')],function(_0x5834c6){return{'model':db[_0x5834c6[_0xa559('0x1f')]],'as':_0x5834c6['as'],'attributes':_0x5834c6['attributes'],'include':_0x5834c6['include']?_[_0xa559('0x1e')](_0x5834c6[_0xa559('0x1d')],function(_0x3fcf7f){return{'model':db[_0x3fcf7f[_0xa559('0x1f')]],'as':_0x3fcf7f['as'],'attributes':_0x3fcf7f[_0xa559('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa559('0xb')](function(_0x31e24b){logger[_0xa559('0xc')]('GetCampaign',_0x163405);logger[_0xa559('0xf')](_0xa559('0x16'),_0x163405,JSON[_0xa559('0x10')](_0x31e24b));_0x1a4c42(_0x31e24b);})[_0xa559('0x15')](function(_0x5f3fbb){logger[_0xa559('0x11')](_0xa559('0x16'),_0x5f3fbb[_0xa559('0x13')],_0x163405);_0x16f090(_0xd21ebf['error'](0x1f4,_0x5f3fbb[_0xa559('0x13')]));});});};
\ No newline at end of file
+var _0x847d=['request','then','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','Campaign,\x20%s,\x20%s','message','info','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','debug','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3b36ec,_0x16d86d){var _0x453b5c=function(_0x3ff48a){while(--_0x3ff48a){_0x3b36ec['push'](_0x3b36ec['shift']());}};_0x453b5c(++_0x16d86d);}(_0x847d,0x14a));var _0xd847=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x847d[_0x817d9b];return _0x2752e1;};'use strict';var _=require('lodash');var util=require(_0xd847('0x0'));var moment=require(_0xd847('0x1'));var BPromise=require(_0xd847('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd847('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd847('0x4'));var logger=require(_0xd847('0x5'))('rpc');var config=require(_0xd847('0x6'));var jayson=require(_0xd847('0x7'));var client=jayson[_0xd847('0x8')][_0xd847('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f3349,_0x20dbfd,_0x19fdb5){return new BPromise(function(_0x2bb22b,_0x235e82){return client[_0xd847('0xa')](_0x5f3349,_0x19fdb5)[_0xd847('0xb')](function(_0x17cb36){logger['info']('Campaign,\x20%s,\x20%s',_0x20dbfd,'request\x20sent');logger['debug'](_0xd847('0xc'),_0x20dbfd,_0xd847('0xd'),JSON[_0xd847('0xe')](_0x17cb36));if(_0x17cb36['error']){if(_0x17cb36['error'][_0xd847('0xf')]===0x1f4){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x235e82(_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);}logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x17cb36[_0xd847('0x10')][_0xd847('0x12')]);return _0x2bb22b(_0x17cb36['error'][_0xd847('0x12')]);}else{logger[_0xd847('0x13')](_0xd847('0x11'),_0x20dbfd,_0xd847('0xd'));_0x2bb22b(_0x17cb36[_0xd847('0x14')]['message']);}})[_0xd847('0x15')](function(_0x3e1e1c){logger[_0xd847('0x10')](_0xd847('0x11'),_0x20dbfd,_0x3e1e1c);_0x235e82(_0x3e1e1c);});});}exports['GetCampaign']=function(_0x1ef765){var _0x5eb665=this;return new Promise(function(_0x4b6264,_0x44a57b){return db[_0xd847('0x16')][_0xd847('0x17')]({'raw':_0x1ef765[_0xd847('0x18')]?_0x1ef765['options'][_0xd847('0x19')]===undefined?!![]:![]:!![],'where':_0x1ef765['options']?_0x1ef765['options'][_0xd847('0x1a')]||null:null,'attributes':_0x1ef765[_0xd847('0x18')]?_0x1ef765[_0xd847('0x18')][_0xd847('0x1b')]||null:null,'limit':_0x1ef765[_0xd847('0x18')]?_0x1ef765[_0xd847('0x18')][_0xd847('0x1c')]||null:null,'include':_0x1ef765[_0xd847('0x18')]?_0x1ef765[_0xd847('0x18')][_0xd847('0x1d')]?_[_0xd847('0x1e')](_0x1ef765[_0xd847('0x18')]['include'],function(_0x560563){return{'model':db[_0x560563[_0xd847('0x1f')]],'as':_0x560563['as'],'attributes':_0x560563[_0xd847('0x1b')],'include':_0x560563[_0xd847('0x1d')]?_['map'](_0x560563[_0xd847('0x1d')],function(_0x246920){return{'model':db[_0x246920[_0xd847('0x1f')]],'as':_0x246920['as'],'attributes':_0x246920[_0xd847('0x1b')],'include':_0x246920[_0xd847('0x1d')]?_[_0xd847('0x1e')](_0x246920[_0xd847('0x1d')],function(_0x460eba){return{'model':db[_0x460eba[_0xd847('0x1f')]],'as':_0x460eba['as'],'attributes':_0x460eba['attributes']};}):[]};}):[]};}):[]:[]})[_0xd847('0xb')](function(_0x1d03e2){logger[_0xd847('0x13')](_0xd847('0x20'),_0x1ef765);logger[_0xd847('0x21')](_0xd847('0x20'),_0x1ef765,JSON['stringify'](_0x1d03e2));_0x4b6264(_0x1d03e2);})[_0xd847('0x15')](function(_0x5375fe){logger['error']('GetCampaign',_0x5375fe[_0xd847('0x12')],_0x1ef765);_0x44a57b(_0x5eb665[_0xd847('0x10')](0x1f4,_0x5375fe[_0xd847('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 58bd5e8..9802e15 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 _0xdf71=['create','/:id/clone','clone','post','addLists','addBlackLists','put','destroy','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists'];(function(_0x150340,_0x11959e){var _0x51d792=function(_0x4a587d){while(--_0x4a587d){_0x150340['push'](_0x150340['shift']());}};_0x51d792(++_0x11959e);}(_0xdf71,0x1d2));var _0x1df7=function(_0x4a4760,_0x7ce6b4){_0x4a4760=_0x4a4760-0x0;var _0x3c2c17=_0xdf71[_0x4a4760];return _0x3c2c17;};'use strict';var multer=require(_0x1df7('0x0'));var util=require('util');var path=require(_0x1df7('0x1'));var timeout=require(_0x1df7('0x2'));var express=require(_0x1df7('0x3'));var router=express[_0x1df7('0x4')]();var fs_extra=require(_0x1df7('0x5'));var auth=require(_0x1df7('0x6'));var interaction=require(_0x1df7('0x7'));var config=require('../../config/environment');var controller=require(_0x1df7('0x8'));router[_0x1df7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1df7('0x9')](_0x1df7('0xa'),auth['isAuthenticated'](),controller[_0x1df7('0xb')]);router['get'](_0x1df7('0xc'),auth[_0x1df7('0xd')](),controller[_0x1df7('0xe')]);router[_0x1df7('0x9')]('/:id/hopper_histories',auth[_0x1df7('0xd')](),controller[_0x1df7('0xf')]);router[_0x1df7('0x9')](_0x1df7('0x10'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x11')]);router['get'](_0x1df7('0x12'),auth['isAuthenticated'](),controller[_0x1df7('0x13')]);router[_0x1df7('0x9')](_0x1df7('0x14'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x15')]);router['get'](_0x1df7('0x16'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1df7('0x18')]);router['post'](_0x1df7('0x19'),auth['isAuthenticated'](),controller[_0x1df7('0x1a')]);router[_0x1df7('0x1b')](_0x1df7('0x14'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x1c')]);router['post'](_0x1df7('0x16'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x1d')]);router[_0x1df7('0x1e')](_0x1df7('0xa'),auth[_0x1df7('0xd')](),controller['update']);router['delete'](_0x1df7('0xa'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x1f')]);router[_0x1df7('0x20')](_0x1df7('0x14'),auth[_0x1df7('0xd')](),controller['removeLists']);router[_0x1df7('0x20')](_0x1df7('0x16'),auth[_0x1df7('0xd')](),controller[_0x1df7('0x21')]);module[_0x1df7('0x22')]=router;
\ No newline at end of file
+var _0xfb3f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xfb3f,0xb2));var _0xffb3=function(_0x52b52b,_0x2d911b){_0x52b52b=_0x52b52b-0x0;var _0x32f894=_0xfb3f[_0x52b52b];return _0x32f894;};'use strict';var multer=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var path=require(_0xffb3('0x2'));var timeout=require(_0xffb3('0x3'));var express=require('express');var router=express[_0xffb3('0x4')]();var fs_extra=require(_0xffb3('0x5'));var auth=require(_0xffb3('0x6'));var interaction=require(_0xffb3('0x7'));var config=require('../../config/environment');var controller=require(_0xffb3('0x8'));router[_0xffb3('0x9')]('/',auth['isAuthenticated'](),controller[_0xffb3('0xa')]);router[_0xffb3('0x9')](_0xffb3('0xb'),auth['isAuthenticated'](),controller[_0xffb3('0xc')]);router[_0xffb3('0x9')](_0xffb3('0xd'),auth[_0xffb3('0xe')](),controller['getHoppers']);router[_0xffb3('0x9')](_0xffb3('0xf'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x10')]);router[_0xffb3('0x9')](_0xffb3('0x11'),auth[_0xffb3('0xe')](),controller['getHopperFinals']);router[_0xffb3('0x9')](_0xffb3('0x12'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x13')]);router[_0xffb3('0x9')](_0xffb3('0x14'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x15')]);router[_0xffb3('0x9')](_0xffb3('0x16'),auth['isAuthenticated'](),controller[_0xffb3('0x17')]);router[_0xffb3('0x18')]('/',auth[_0xffb3('0xe')](),controller['create']);router[_0xffb3('0x18')](_0xffb3('0x19'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1a')]);router[_0xffb3('0x18')](_0xffb3('0x14'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1b')]);router[_0xffb3('0x18')](_0xffb3('0x16'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1c')]);router[_0xffb3('0x1d')](_0xffb3('0xb'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1e')]);router['delete'](_0xffb3('0xb'),auth[_0xffb3('0xe')](),controller[_0xffb3('0x1f')]);router[_0xffb3('0x20')]('/:id/lists',auth['isAuthenticated'](),controller[_0xffb3('0x21')]);router['delete']('/:id/blacklists',auth[_0xffb3('0xe')](),controller[_0xffb3('0x22')]);module[_0xffb3('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index b7c4dd0..8e43245 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 _0x3bf8=['getDataValue','sequelize','TEXT','medium','VIRTUAL'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3bf8,0x132));var _0x83bf=function(_0x5e2ece,_0x1a1633){_0x5e2ece=_0x5e2ece-0x0;var _0x5aed84=_0x3bf8[_0x5e2ece];return _0x5aed84;};'use strict';var Sequelize=require(_0x83bf('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x83bf('0x1')],'length':_0x83bf('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x83bf('0x3')],'get':function(){return this[_0x83bf('0x4')]('key');}}};
\ No newline at end of file
+var _0x549e=['TEXT','medium','getDataValue','key','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x549e,0xe8));var _0xe549=function(_0x220a35,_0x215368){_0x220a35=_0x220a35-0x0;var _0x4808dd=_0x549e[_0x220a35];return _0x4808dd;};'use strict';var Sequelize=require('sequelize');module[_0xe549('0x0')]={'key':{'type':Sequelize[_0xe549('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xe549('0x2')],'length':_0xe549('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe549('0x4')](_0xe549('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 8606484..bbab60f 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 _0x5b44=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','options','count','includeAll','include','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x5b44,0x101));var _0x45b4=function(_0x584afc,_0x84064f){_0x584afc=_0x584afc-0x0;var _0x3d60f8=_0x5b44[_0x584afc];return _0x3d60f8;};'use strict';var emlformat=require(_0x45b4('0x0'));var rimraf=require(_0x45b4('0x1'));var zipdir=require(_0x45b4('0x2'));var jsonpatch=require(_0x45b4('0x3'));var rp=require('request-promise');var moment=require(_0x45b4('0x4'));var BPromise=require(_0x45b4('0x5'));var Mustache=require('mustache');var util=require(_0x45b4('0x6'));var path=require(_0x45b4('0x7'));var sox=require(_0x45b4('0x8'));var csv=require(_0x45b4('0x9'));var ejs=require(_0x45b4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45b4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x45b4('0xc'));var deskjs=require(_0x45b4('0xd'));var toCsv=require(_0x45b4('0x9'));var querystring=require(_0x45b4('0xe'));var Papa=require(_0x45b4('0xf'));var Redis=require('ioredis');var authService=require(_0x45b4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x45b4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45b4('0x12'))(_0x45b4('0x13'));var utils=require(_0x45b4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x45b4('0x15'))['db'];function respondWithStatusCode(_0x2841e9,_0x1b7c86){_0x1b7c86=_0x1b7c86||0xcc;return function(_0xcda46c){if(_0xcda46c){return _0x2841e9['sendStatus'](_0x1b7c86);}return _0x2841e9[_0x45b4('0x16')](_0x1b7c86)['end']();};}function respondWithResult(_0x407807,_0x2cc6f9){_0x2cc6f9=_0x2cc6f9||0xc8;return function(_0x1eec44){if(_0x1eec44){return _0x407807['status'](_0x2cc6f9)[_0x45b4('0x17')](_0x1eec44);}};}function respondWithFilteredResult(_0x558bca,_0x3c23a0){return function(_0x119320){if(_0x119320){var _0x33c88c=typeof _0x3c23a0[_0x45b4('0x18')]===_0x45b4('0x19')&&typeof _0x3c23a0['limit']===_0x45b4('0x19');var _0x228efe=_0x119320['count'];var _0x4b25e1=_0x33c88c?0x0:_0x3c23a0[_0x45b4('0x18')];var _0x5a242f=_0x33c88c?_0x119320['count']:_0x3c23a0[_0x45b4('0x18')]+_0x3c23a0['limit'];var _0x4907e6;if(_0x5a242f>=_0x228efe){_0x5a242f=_0x228efe;_0x4907e6=0xc8;}else{_0x4907e6=0xce;}_0x558bca[_0x45b4('0x16')](_0x4907e6);return _0x558bca['set'](_0x45b4('0x1a'),_0x4b25e1+'-'+_0x5a242f+'/'+_0x228efe)['json'](_0x119320);}return null;};}function patchUpdates(_0x1deb11){return function(_0x52534f){try{jsonpatch['apply'](_0x52534f,_0x1deb11,!![]);}catch(_0x3058ca){return BPromise[_0x45b4('0x1b')](_0x3058ca);}return _0x52534f[_0x45b4('0x1c')]();};}function saveUpdates(_0x1e1c37,_0x5305ff){return function(_0x4bf56f){if(_0x4bf56f){return _0x4bf56f[_0x45b4('0x1d')](_0x1e1c37)[_0x45b4('0x1e')](function(_0x4aa2b5){return _0x4aa2b5;});}return null;};}function removeEntity(_0x5d3c69,_0x2cef39){return function(_0x898d73){if(_0x898d73){return _0x898d73[_0x45b4('0x1f')]()[_0x45b4('0x1e')](function(){var _0x3af261=_0x898d73[_0x45b4('0x20')]({'plain':!![]});var _0x4469ac=_0x45b4('0x21');return db[_0x45b4('0x22')][_0x45b4('0x1f')]({'where':{'type':_0x4469ac,'resourceId':_0x3af261['id']}})['then'](function(){return _0x898d73;});})[_0x45b4('0x1e')](function(){_0x5d3c69[_0x45b4('0x16')](0xcc)[_0x45b4('0x23')]();});}};}function handleEntityNotFound(_0x2e6287,_0x44783b){return function(_0x25b8e1){if(!_0x25b8e1){_0x2e6287[_0x45b4('0x24')](0x194);}return _0x25b8e1;};}function handleError(_0xc3d163,_0x571461){_0x571461=_0x571461||0x1f4;return function(_0x6e680b){logger[_0x45b4('0x25')](_0x6e680b[_0x45b4('0x26')]);if(_0x6e680b[_0x45b4('0x27')]){delete _0x6e680b[_0x45b4('0x27')];}_0xc3d163[_0x45b4('0x16')](_0x571461)[_0x45b4('0x28')](_0x6e680b);};}exports[_0x45b4('0x29')]=function(_0x224854,_0x2740f7){var _0x5c9888={},_0x218b5f={},_0x295f4e={'count':0x0,'rows':[]};var _0x4bbee5=_[_0x45b4('0x2a')](db[_0x45b4('0x2b')][_0x45b4('0x2c')],function(_0x4a69f9){return{'name':_0x4a69f9['fieldName'],'type':_0x4a69f9[_0x45b4('0x2d')][_0x45b4('0x2e')]};});_0x218b5f[_0x45b4('0x2f')]=_[_0x45b4('0x2a')](_0x4bbee5,_0x45b4('0x27'));_0x218b5f[_0x45b4('0x30')]=_[_0x45b4('0x31')](_0x224854['query']);_0x218b5f[_0x45b4('0x32')]=_[_0x45b4('0x33')](_0x218b5f[_0x45b4('0x2f')],_0x218b5f['query']);_0x5c9888[_0x45b4('0x34')]=_[_0x45b4('0x33')](_0x218b5f[_0x45b4('0x2f')],qs[_0x45b4('0x35')](_0x224854['query'][_0x45b4('0x35')]));_0x5c9888[_0x45b4('0x34')]=_0x5c9888['attributes'][_0x45b4('0x36')]?_0x5c9888[_0x45b4('0x34')]:_0x218b5f[_0x45b4('0x2f')];if(!_0x224854[_0x45b4('0x30')][_0x45b4('0x37')](_0x45b4('0x38'))){_0x5c9888[_0x45b4('0x39')]=qs['limit'](_0x224854['query'][_0x45b4('0x39')]);_0x5c9888[_0x45b4('0x18')]=qs[_0x45b4('0x18')](_0x224854[_0x45b4('0x30')][_0x45b4('0x18')]);}_0x5c9888[_0x45b4('0x3a')]=qs[_0x45b4('0x3b')](_0x224854[_0x45b4('0x30')]['sort']);_0x5c9888['where']=qs[_0x45b4('0x32')](_[_0x45b4('0x3c')](_0x224854[_0x45b4('0x30')],_0x218b5f[_0x45b4('0x32')]),_0x4bbee5);if(_0x224854[_0x45b4('0x30')][_0x45b4('0x3d')]){_0x5c9888[_0x45b4('0x3e')]=_['merge'](_0x5c9888[_0x45b4('0x3e')],{'$or':[{'key':{'$like':'%'+_0x224854[_0x45b4('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x224854['query'][_0x45b4('0x3d')]+'%'}}]});}_0x5c9888=_['merge']({},_0x5c9888,_0x224854[_0x45b4('0x3f')]);var _0x3e0320={'where':_0x5c9888[_0x45b4('0x3e')]};return db[_0x45b4('0x2b')]['count'](_0x3e0320)[_0x45b4('0x1e')](function(_0x26c10a){_0x295f4e[_0x45b4('0x40')]=_0x26c10a;if(_0x224854[_0x45b4('0x30')][_0x45b4('0x41')]){_0x5c9888[_0x45b4('0x42')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5c9888);})[_0x45b4('0x1e')](function(_0x2394bb){_0x295f4e[_0x45b4('0x43')]=_0x2394bb;return _0x295f4e;})[_0x45b4('0x1e')](respondWithFilteredResult(_0x2740f7,_0x5c9888))[_0x45b4('0x44')](handleError(_0x2740f7,null));};exports[_0x45b4('0x45')]=function(_0x30b2ca,_0x4b01bc){var _0x53a26a={'raw':!![],'where':{'id':_0x30b2ca[_0x45b4('0x46')]['id']}},_0x206069={};_0x206069[_0x45b4('0x2f')]=_[_0x45b4('0x31')](db[_0x45b4('0x2b')][_0x45b4('0x2c')]);_0x206069[_0x45b4('0x30')]=_[_0x45b4('0x31')](_0x30b2ca['query']);_0x206069[_0x45b4('0x32')]=_['intersection'](_0x206069[_0x45b4('0x2f')],_0x206069[_0x45b4('0x30')]);_0x53a26a[_0x45b4('0x34')]=_['intersection'](_0x206069['model'],qs[_0x45b4('0x35')](_0x30b2ca['query'][_0x45b4('0x35')]));_0x53a26a[_0x45b4('0x34')]=_0x53a26a[_0x45b4('0x34')][_0x45b4('0x36')]?_0x53a26a[_0x45b4('0x34')]:_0x206069[_0x45b4('0x2f')];if(_0x30b2ca[_0x45b4('0x30')][_0x45b4('0x41')]){_0x53a26a['include']=[{'all':!![]}];}_0x53a26a=_['merge']({},_0x53a26a,_0x30b2ca[_0x45b4('0x3f')]);return db[_0x45b4('0x2b')][_0x45b4('0x47')](_0x53a26a)['then'](handleEntityNotFound(_0x4b01bc,null))['then'](respondWithResult(_0x4b01bc,null))[_0x45b4('0x44')](handleError(_0x4b01bc,null));};exports[_0x45b4('0x1d')]=function(_0x10e434,_0xf077e1){if(_0x10e434['body']['id']){delete _0x10e434['body']['id'];}return db[_0x45b4('0x2b')]['find']({'where':{'id':_0x10e434['params']['id']}})[_0x45b4('0x1e')](handleEntityNotFound(_0xf077e1,null))['then'](saveUpdates(_0x10e434[_0x45b4('0x48')],null))[_0x45b4('0x1e')](respondWithResult(_0xf077e1,null))[_0x45b4('0x44')](handleError(_0xf077e1,null));};exports['destroy']=function(_0x407241,_0xea2f33){return db[_0x45b4('0x2b')][_0x45b4('0x47')]({'where':{'id':_0x407241['params']['id']}})[_0x45b4('0x1e')](handleEntityNotFound(_0xea2f33,null))[_0x45b4('0x1e')](removeEntity(_0xea2f33,null))[_0x45b4('0x44')](handleError(_0xea2f33,null));};exports[_0x45b4('0x49')]=function(_0x1a8e4f,_0x5a7dd7){var _0x18126d={'key':_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x2e')]};if(_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4a')]){_0x18126d[_0x45b4('0x4a')]=_0x1a8e4f['body'][_0x45b4('0x4a')];}else if(_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4b')]){_0x18126d[_0x45b4('0x4b')]=_0x1a8e4f['body'][_0x45b4('0x4b')];}else if(_0x1a8e4f['body'][_0x45b4('0x4c')]){_0x18126d[_0x45b4('0x4c')]=_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4c')];}else if(_0x1a8e4f[_0x45b4('0x48')]['ChatWebsiteId']){_0x18126d[_0x45b4('0x4d')]=_0x1a8e4f[_0x45b4('0x48')][_0x45b4('0x4d')];}return db[_0x45b4('0x2b')][_0x45b4('0x47')]({'where':_0x18126d})['then'](function(_0x27c645){if(_0x27c645){throw new db['Sequelize'][(_0x45b4('0x4e'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x45b4('0x2b')][_0x45b4('0x49')](_0x1a8e4f['body']);})[_0x45b4('0x1e')](function(_0x2bf465){var _0x17e5ad=_0x1a8e4f['user'][_0x45b4('0x20')]({'plain':!![]});if(!_0x17e5ad)throw new Error(_0x45b4('0x4f'));if(_0x17e5ad[_0x45b4('0x50')]===_0x45b4('0x51')){var _0x46557e=_0x2bf465['get']({'plain':!![]});return db['UserProfileSection'][_0x45b4('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x17e5ad[_0x45b4('0x52')]},'raw':!![]})[_0x45b4('0x1e')](function(_0x29c169){if(_0x29c169&&_0x29c169[_0x45b4('0x53')]===0x0){return db[_0x45b4('0x22')]['create']({'name':_0x46557e['name'],'resourceId':_0x46557e['id'],'type':_0x29c169['name'],'sectionId':_0x29c169['id']},{})[_0x45b4('0x1e')](function(){return _0x2bf465;});}else{return _0x2bf465;}})['catch'](function(_0x4d27f9){logger['error'](_0x45b4('0x54'),_0x4d27f9);throw _0x4d27f9;});}return _0x2bf465;})[_0x45b4('0x1e')](respondWithResult(_0x5a7dd7,0xc9))[_0x45b4('0x44')](handleError(_0x5a7dd7,null));};
\ No newline at end of file
+var _0x718e=['error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','find','catch','params','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','limit','undefined','count','offset','Content-Range','json','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x718e,0x143));var _0xe718=function(_0x12b859,_0x40804e){_0x12b859=_0x12b859-0x0;var _0x867976=_0x718e[_0x12b859];return _0x867976;};'use strict';var emlformat=require(_0xe718('0x0'));var rimraf=require(_0xe718('0x1'));var zipdir=require(_0xe718('0x2'));var jsonpatch=require(_0xe718('0x3'));var rp=require('request-promise');var moment=require(_0xe718('0x4'));var BPromise=require(_0xe718('0x5'));var Mustache=require(_0xe718('0x6'));var util=require(_0xe718('0x7'));var path=require(_0xe718('0x8'));var sox=require(_0xe718('0x9'));var csv=require(_0xe718('0xa'));var ejs=require(_0xe718('0xb'));var fs=require('fs');var fs_extra=require(_0xe718('0xc'));var _=require(_0xe718('0xd'));var squel=require(_0xe718('0xe'));var crypto=require('crypto');var jsforce=require(_0xe718('0xf'));var deskjs=require(_0xe718('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe718('0x11'));var Redis=require(_0xe718('0x12'));var authService=require(_0xe718('0x13'));var qs=require(_0xe718('0x14'));var as=require(_0xe718('0x15'));var hardwareService=require(_0xe718('0x16'));var logger=require('../../config/logger')(_0xe718('0x17'));var utils=require(_0xe718('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45afe7,_0x51443d){_0x51443d=_0x51443d||0xcc;return function(_0x22a3b2){if(_0x22a3b2){return _0x45afe7[_0xe718('0x19')](_0x51443d);}return _0x45afe7[_0xe718('0x1a')](_0x51443d)['end']();};}function respondWithResult(_0x57dc19,_0x5ae7fc){_0x5ae7fc=_0x5ae7fc||0xc8;return function(_0x1bb5de){if(_0x1bb5de){return _0x57dc19[_0xe718('0x1a')](_0x5ae7fc)['json'](_0x1bb5de);}};}function respondWithFilteredResult(_0x8a3fc1,_0x6e640b){return function(_0x212230){if(_0x212230){var _0x3f45ee=typeof _0x6e640b['offset']==='undefined'&&typeof _0x6e640b[_0xe718('0x1b')]===_0xe718('0x1c');var _0x15c810=_0x212230[_0xe718('0x1d')];var _0x1b21bc=_0x3f45ee?0x0:_0x6e640b[_0xe718('0x1e')];var _0x3529ee=_0x3f45ee?_0x212230[_0xe718('0x1d')]:_0x6e640b['offset']+_0x6e640b['limit'];var _0x3ccb3d;if(_0x3529ee>=_0x15c810){_0x3529ee=_0x15c810;_0x3ccb3d=0xc8;}else{_0x3ccb3d=0xce;}_0x8a3fc1['status'](_0x3ccb3d);return _0x8a3fc1['set'](_0xe718('0x1f'),_0x1b21bc+'-'+_0x3529ee+'/'+_0x15c810)[_0xe718('0x20')](_0x212230);}return null;};}function patchUpdates(_0x38ff8a){return function(_0x3bb95c){try{jsonpatch['apply'](_0x3bb95c,_0x38ff8a,!![]);}catch(_0x3940b7){return BPromise[_0xe718('0x21')](_0x3940b7);}return _0x3bb95c['save']();};}function saveUpdates(_0x45e0f8,_0x173b2a){return function(_0x26ed0b){if(_0x26ed0b){return _0x26ed0b[_0xe718('0x22')](_0x45e0f8)[_0xe718('0x23')](function(_0x335884){return _0x335884;});}return null;};}function removeEntity(_0x492610,_0x39b9b3){return function(_0x2cfac8){if(_0x2cfac8){return _0x2cfac8[_0xe718('0x24')]()[_0xe718('0x23')](function(){var _0x3f6ade=_0x2cfac8[_0xe718('0x25')]({'plain':!![]});var _0x18702e=_0xe718('0x26');return db[_0xe718('0x27')][_0xe718('0x24')]({'where':{'type':_0x18702e,'resourceId':_0x3f6ade['id']}})[_0xe718('0x23')](function(){return _0x2cfac8;});})[_0xe718('0x23')](function(){_0x492610[_0xe718('0x1a')](0xcc)[_0xe718('0x28')]();});}};}function handleEntityNotFound(_0x17ee64,_0x3994d7){return function(_0x1d3149){if(!_0x1d3149){_0x17ee64[_0xe718('0x19')](0x194);}return _0x1d3149;};}function handleError(_0x94c480,_0x426781){_0x426781=_0x426781||0x1f4;return function(_0x21ccb7){logger[_0xe718('0x29')](_0x21ccb7[_0xe718('0x2a')]);if(_0x21ccb7['name']){delete _0x21ccb7[_0xe718('0x2b')];}_0x94c480[_0xe718('0x1a')](_0x426781)[_0xe718('0x2c')](_0x21ccb7);};}exports[_0xe718('0x2d')]=function(_0x349f48,_0x2d334f){var _0x1f790a={},_0x66bfba={},_0x570e0b={'count':0x0,'rows':[]};var _0x277f02=_[_0xe718('0x2e')](db[_0xe718('0x2f')][_0xe718('0x30')],function(_0x513fa4){return{'name':_0x513fa4[_0xe718('0x31')],'type':_0x513fa4[_0xe718('0x32')][_0xe718('0x33')]};});_0x66bfba['model']=_[_0xe718('0x2e')](_0x277f02,_0xe718('0x2b'));_0x66bfba[_0xe718('0x34')]=_[_0xe718('0x35')](_0x349f48['query']);_0x66bfba[_0xe718('0x36')]=_[_0xe718('0x37')](_0x66bfba[_0xe718('0x38')],_0x66bfba[_0xe718('0x34')]);_0x1f790a[_0xe718('0x39')]=_['intersection'](_0x66bfba['model'],qs[_0xe718('0x3a')](_0x349f48[_0xe718('0x34')][_0xe718('0x3a')]));_0x1f790a['attributes']=_0x1f790a[_0xe718('0x39')]['length']?_0x1f790a[_0xe718('0x39')]:_0x66bfba[_0xe718('0x38')];if(!_0x349f48[_0xe718('0x34')][_0xe718('0x3b')](_0xe718('0x3c'))){_0x1f790a[_0xe718('0x1b')]=qs[_0xe718('0x1b')](_0x349f48[_0xe718('0x34')][_0xe718('0x1b')]);_0x1f790a[_0xe718('0x1e')]=qs[_0xe718('0x1e')](_0x349f48['query'][_0xe718('0x1e')]);}_0x1f790a[_0xe718('0x3d')]=qs[_0xe718('0x3e')](_0x349f48[_0xe718('0x34')][_0xe718('0x3e')]);_0x1f790a[_0xe718('0x3f')]=qs[_0xe718('0x36')](_[_0xe718('0x40')](_0x349f48[_0xe718('0x34')],_0x66bfba[_0xe718('0x36')]),_0x277f02);if(_0x349f48['query'][_0xe718('0x41')]){_0x1f790a['where']=_[_0xe718('0x42')](_0x1f790a['where'],{'$or':[{'key':{'$like':'%'+_0x349f48['query'][_0xe718('0x41')]+'%'}},{'value':{'$like':'%'+_0x349f48[_0xe718('0x34')][_0xe718('0x41')]+'%'}}]});}_0x1f790a=_[_0xe718('0x42')]({},_0x1f790a,_0x349f48[_0xe718('0x43')]);var _0x45eab5={'where':_0x1f790a[_0xe718('0x3f')]};return db[_0xe718('0x2f')][_0xe718('0x1d')](_0x45eab5)[_0xe718('0x23')](function(_0x463118){_0x570e0b[_0xe718('0x1d')]=_0x463118;if(_0x349f48[_0xe718('0x34')][_0xe718('0x44')]){_0x1f790a[_0xe718('0x45')]=[{'all':!![]}];}return db[_0xe718('0x2f')][_0xe718('0x46')](_0x1f790a);})[_0xe718('0x23')](function(_0x367172){_0x570e0b[_0xe718('0x47')]=_0x367172;return _0x570e0b;})[_0xe718('0x23')](respondWithFilteredResult(_0x2d334f,_0x1f790a))['catch'](handleError(_0x2d334f,null));};exports['show']=function(_0xd58b26,_0x1adfaa){var _0x3d5ce9={'raw':!![],'where':{'id':_0xd58b26['params']['id']}},_0x1273de={};_0x1273de[_0xe718('0x38')]=_[_0xe718('0x35')](db[_0xe718('0x2f')][_0xe718('0x30')]);_0x1273de[_0xe718('0x34')]=_[_0xe718('0x35')](_0xd58b26[_0xe718('0x34')]);_0x1273de['filters']=_[_0xe718('0x37')](_0x1273de[_0xe718('0x38')],_0x1273de[_0xe718('0x34')]);_0x3d5ce9[_0xe718('0x39')]=_[_0xe718('0x37')](_0x1273de[_0xe718('0x38')],qs[_0xe718('0x3a')](_0xd58b26[_0xe718('0x34')][_0xe718('0x3a')]));_0x3d5ce9[_0xe718('0x39')]=_0x3d5ce9[_0xe718('0x39')]['length']?_0x3d5ce9[_0xe718('0x39')]:_0x1273de[_0xe718('0x38')];if(_0xd58b26['query']['includeAll']){_0x3d5ce9[_0xe718('0x45')]=[{'all':!![]}];}_0x3d5ce9=_['merge']({},_0x3d5ce9,_0xd58b26[_0xe718('0x43')]);return db[_0xe718('0x2f')][_0xe718('0x48')](_0x3d5ce9)[_0xe718('0x23')](handleEntityNotFound(_0x1adfaa,null))[_0xe718('0x23')](respondWithResult(_0x1adfaa,null))[_0xe718('0x49')](handleError(_0x1adfaa,null));};exports['update']=function(_0x3e6f8f,_0x4352f7){if(_0x3e6f8f['body']['id']){delete _0x3e6f8f['body']['id'];}return db[_0xe718('0x2f')][_0xe718('0x48')]({'where':{'id':_0x3e6f8f[_0xe718('0x4a')]['id']}})[_0xe718('0x23')](handleEntityNotFound(_0x4352f7,null))[_0xe718('0x23')](saveUpdates(_0x3e6f8f[_0xe718('0x4b')],null))['then'](respondWithResult(_0x4352f7,null))[_0xe718('0x49')](handleError(_0x4352f7,null));};exports[_0xe718('0x24')]=function(_0x2a1584,_0x1837e5){return db['CannedAnswer'][_0xe718('0x48')]({'where':{'id':_0x2a1584[_0xe718('0x4a')]['id']}})[_0xe718('0x23')](handleEntityNotFound(_0x1837e5,null))[_0xe718('0x23')](removeEntity(_0x1837e5,null))[_0xe718('0x49')](handleError(_0x1837e5,null));};exports[_0xe718('0x4c')]=function(_0x51df69,_0x50ac7a){var _0x395052={'key':_0x51df69['body'][_0xe718('0x33')]};if(_0x51df69[_0xe718('0x4b')][_0xe718('0x4d')]){_0x395052['MailAccountId']=_0x51df69[_0xe718('0x4b')][_0xe718('0x4d')];}else if(_0x51df69[_0xe718('0x4b')]['SmsAccountId']){_0x395052[_0xe718('0x4e')]=_0x51df69['body'][_0xe718('0x4e')];}else if(_0x51df69[_0xe718('0x4b')][_0xe718('0x4f')]){_0x395052[_0xe718('0x4f')]=_0x51df69[_0xe718('0x4b')]['OpenchannelAccountId'];}else if(_0x51df69[_0xe718('0x4b')][_0xe718('0x50')]){_0x395052[_0xe718('0x50')]=_0x51df69['body'][_0xe718('0x50')];}return db['CannedAnswer'][_0xe718('0x48')]({'where':_0x395052})[_0xe718('0x23')](function(_0x4e0725){if(_0x4e0725){throw new db[(_0xe718('0x51'))][(_0xe718('0x52'))](_0xe718('0x53'));}return db['CannedAnswer']['create'](_0x51df69[_0xe718('0x4b')]);})[_0xe718('0x23')](function(_0x5b0153){var _0x386c17=_0x51df69['user'][_0xe718('0x25')]({'plain':!![]});if(!_0x386c17)throw new Error(_0xe718('0x54'));if(_0x386c17[_0xe718('0x55')]===_0xe718('0x56')){var _0x3d754b=_0x5b0153[_0xe718('0x25')]({'plain':!![]});return db[_0xe718('0x57')][_0xe718('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x386c17[_0xe718('0x58')]},'raw':!![]})[_0xe718('0x23')](function(_0x32d2e3){if(_0x32d2e3&&_0x32d2e3[_0xe718('0x59')]===0x0){return db[_0xe718('0x27')][_0xe718('0x4c')]({'name':_0x3d754b[_0xe718('0x2b')],'resourceId':_0x3d754b['id'],'type':_0x32d2e3[_0xe718('0x2b')],'sectionId':_0x32d2e3['id']},{})['then'](function(){return _0x5b0153;});}else{return _0x5b0153;}})[_0xe718('0x49')](function(_0x3a51de){logger[_0xe718('0x29')](_0xe718('0x5a'),_0x3a51de);throw _0x3a51de;});}return _0x5b0153;})[_0xe718('0x23')](respondWithResult(_0x50ac7a,0xc9))[_0xe718('0x49')](handleError(_0x50ac7a,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 5270cef..974a53f 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 _0x482b=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5d1c54,_0x1f2a92){var _0x2ecd1b=function(_0x344211){while(--_0x344211){_0x5d1c54['push'](_0x5d1c54['shift']());}};_0x2ecd1b(++_0x1f2a92);}(_0x482b,0x12a));var _0xb482=function(_0x2baf26,_0x425803){_0x2baf26=_0x2baf26-0x0;var _0x4cc2ad=_0x482b[_0x2baf26];return _0x4cc2ad;};'use strict';var _=require(_0xb482('0x0'));var util=require(_0xb482('0x1'));var logger=require(_0xb482('0x2'))('api');var moment=require(_0xb482('0x3'));var BPromise=require('bluebird');var rp=require(_0xb482('0x4'));var fs=require('fs');var path=require(_0xb482('0x5'));var rimraf=require(_0xb482('0x6'));var config=require(_0xb482('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0xb482('0x8')]=function(_0x3a6412,_0x254284){return _0x3a6412[_0xb482('0x9')](_0xb482('0xa'),attributes,{'tableName':_0xb482('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb482('0xc'),'collate':_0xb482('0xd')});};
\ No newline at end of file
+var _0x4281=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci'];(function(_0x11b53b,_0x188564){var _0x529666=function(_0x54ef3a){while(--_0x54ef3a){_0x11b53b['push'](_0x11b53b['shift']());}};_0x529666(++_0x188564);}(_0x4281,0x1a4));var _0x1428=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0x4281[_0x102881];return _0x5c63d0;};'use strict';var _=require(_0x1428('0x0'));var util=require(_0x1428('0x1'));var logger=require(_0x1428('0x2'))(_0x1428('0x3'));var moment=require(_0x1428('0x4'));var BPromise=require(_0x1428('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1428('0x6'));var rimraf=require(_0x1428('0x7'));var config=require('../../config/environment');var attributes=require(_0x1428('0x8'));module[_0x1428('0x9')]=function(_0x2bac75,_0x33b855){return _0x2bac75[_0x1428('0xa')](_0x1428('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1428('0xc'),'collate':_0x1428('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 41ddde7..b5c487d 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(_0x5314c7,_0x392ead){var _0x81347c=function(_0x577f79){while(--_0x577f79){_0x5314c7['push'](_0x5314c7['shift']());}};_0x81347c(++_0x392ead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x28b37c,_0x57386c){var _0x276e9d=function(_0x56e6fc){while(--_0x56e6fc){_0x28b37c['push'](_0x28b37c['shift']());}};_0x276e9d(++_0x57386c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 96858b5..22dc302 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 _0xaddc=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x399dd8,_0x33eb97){var _0x592a3d=function(_0x48ebe6){while(--_0x48ebe6){_0x399dd8['push'](_0x399dd8['shift']());}};_0x592a3d(++_0x33eb97);}(_0xaddc,0x18e));var _0xcadd=function(_0x3436ad,_0x2cf72c){_0x3436ad=_0x3436ad-0x0;var _0x59b294=_0xaddc[_0x3436ad];return _0x59b294;};'use strict';var multer=require(_0xcadd('0x0'));var util=require(_0xcadd('0x1'));var path=require(_0xcadd('0x2'));var timeout=require(_0xcadd('0x3'));var express=require(_0xcadd('0x4'));var router=express[_0xcadd('0x5')]();var fs_extra=require(_0xcadd('0x6'));var auth=require(_0xcadd('0x7'));var interaction=require(_0xcadd('0x8'));var config=require(_0xcadd('0x9'));var controller=require(_0xcadd('0xa'));router[_0xcadd('0xb')]('/',auth['isAuthenticated'](),controller[_0xcadd('0xc')]);router[_0xcadd('0xb')](_0xcadd('0xd'),auth[_0xcadd('0xe')](),controller[_0xcadd('0xf')]);router['post']('/',auth[_0xcadd('0xe')](),controller[_0xcadd('0x10')]);router[_0xcadd('0x11')](_0xcadd('0xd'),auth[_0xcadd('0xe')](),controller[_0xcadd('0x12')]);router[_0xcadd('0x13')]('/:id',auth[_0xcadd('0xe')](),controller[_0xcadd('0x14')]);module[_0xcadd('0x15')]=router;
\ No newline at end of file
+var _0x3c2c=['index','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x58de77,_0x41e494){var _0xafe272=function(_0x352cbc){while(--_0x352cbc){_0x58de77['push'](_0x58de77['shift']());}};_0xafe272(++_0x41e494);}(_0x3c2c,0x121));var _0xc3c2=function(_0x45b77f,_0x326ff4){_0x45b77f=_0x45b77f-0x0;var _0x58a942=_0x3c2c[_0x45b77f];return _0x58a942;};'use strict';var multer=require(_0xc3c2('0x0'));var util=require(_0xc3c2('0x1'));var path=require(_0xc3c2('0x2'));var timeout=require(_0xc3c2('0x3'));var express=require(_0xc3c2('0x4'));var router=express[_0xc3c2('0x5')]();var fs_extra=require(_0xc3c2('0x6'));var auth=require(_0xc3c2('0x7'));var interaction=require(_0xc3c2('0x8'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xc3c2('0x9')]('/',auth[_0xc3c2('0xa')](),controller[_0xc3c2('0xb')]);router[_0xc3c2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc3c2('0xc')]);router[_0xc3c2('0xd')]('/',auth['isAuthenticated'](),controller[_0xc3c2('0xe')]);router[_0xc3c2('0xf')](_0xc3c2('0x10'),auth[_0xc3c2('0xa')](),controller[_0xc3c2('0x11')]);router[_0xc3c2('0x12')](_0xc3c2('0x10'),auth[_0xc3c2('0xa')](),controller['destroy']);module[_0xc3c2('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 7062d94..a9d0fc2 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 _0x984b=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0x5be3d4,_0x2f9334){var _0x2aadf5=function(_0x3042e6){while(--_0x3042e6){_0x5be3d4['push'](_0x5be3d4['shift']());}};_0x2aadf5(++_0x2f9334);}(_0x984b,0xee));var _0xb984=function(_0x223ebc,_0x2ceb2e){_0x223ebc=_0x223ebc-0x0;var _0x2aed81=_0x984b[_0x223ebc];return _0x2aed81;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb984('0x0')},'clid':{'type':Sequelize[_0xb984('0x1')]},'src':{'type':Sequelize[_0xb984('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb984('0x1')]},'dstchannel':{'type':Sequelize[_0xb984('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb984('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb984('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb984('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xb984('0x1')]},'peeraccount':{'type':Sequelize[_0xb984('0x1')]},'type':{'type':Sequelize[_0xb984('0x1')]},'tag':{'type':Sequelize[_0xb984('0x1')]}};
\ No newline at end of file
+var _0x418f=['DATE','1970-01-01\x2000:00:01','STRING','sequelize','exports'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x418f,0xdf));var _0xf418=function(_0x2f5235,_0x4b2951){_0x2f5235=_0x2f5235-0x0;var _0x3420dd=_0x418f[_0x2f5235];return _0x3420dd;};'use strict';var Sequelize=require(_0xf418('0x0'));module[_0xf418('0x1')]={'calldate':{'type':Sequelize[_0xf418('0x2')],'allowNull':![],'defaultValue':_0xf418('0x3')},'clid':{'type':Sequelize[_0xf418('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xf418('0x4')]},'dcontext':{'type':Sequelize[_0xf418('0x4')]},'channel':{'type':Sequelize[_0xf418('0x4')]},'dstchannel':{'type':Sequelize[_0xf418('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf418('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf418('0x4')]},'userfield':{'type':Sequelize[_0xf418('0x4')]},'uniqueid':{'type':Sequelize[_0xf418('0x4')]},'linkedid':{'type':Sequelize[_0xf418('0x4')]},'sequence':{'type':Sequelize[_0xf418('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf418('0x4')]},'tag':{'type':Sequelize[_0xf418('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index aa0b8a5..193a2f5 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 _0xa1f6=['error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xa1f6[_0x280f4a];return _0x1bb157;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={},_0x155c58={},_0x257cee={'count':0x0,'rows':[]};var _0x113422=_[_0x6a1f('0x2a')](db[_0x6a1f('0x2b')][_0x6a1f('0x2c')],function(_0x58d879){return{'name':_0x58d879['fieldName'],'type':_0x58d879[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x155c58[_0x6a1f('0x2f')]=_[_0x6a1f('0x2a')](_0x113422,_0x6a1f('0x27'));_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x3f0730['query']);_0x155c58[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x155c58['model'],_0x155c58[_0x6a1f('0x30')]);_0x1e951c[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x155c58['model'],qs['fields'](_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x35')]));_0x1e951c[_0x6a1f('0x34')]=_0x1e951c['attributes']['length']?_0x1e951c[_0x6a1f('0x34')]:_0x155c58[_0x6a1f('0x2f')];if(!_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x36')](_0x6a1f('0x37'))){_0x1e951c[_0x6a1f('0x1d')]=qs[_0x6a1f('0x1d')](_0x3f0730['query'][_0x6a1f('0x1d')]);_0x1e951c['offset']=qs[_0x6a1f('0x1b')](_0x3f0730[_0x6a1f('0x30')]['offset']);}_0x1e951c[_0x6a1f('0x38')]=qs[_0x6a1f('0x39')](_0x3f0730['query'][_0x6a1f('0x39')]);_0x1e951c['where']=qs[_0x6a1f('0x32')](_['pick'](_0x3f0730[_0x6a1f('0x30')],_0x155c58['filters']),_0x113422);if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]){_0x1e951c['where']=_[_0x6a1f('0x3b')](_0x1e951c[_0x6a1f('0x3c')],{'$or':_['map'](_0x113422,function(_0x5beb28){if(_0x5beb28[_0x6a1f('0x2d')]!==_0x6a1f('0x3d')){var _0x314fef={};_0x314fef[_0x5beb28[_0x6a1f('0x27')]]={'$like':'%'+_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]+'%'};return _0x314fef;}})});}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730[_0x6a1f('0x3e')]);var _0x2da23a={'where':_0x1e951c[_0x6a1f('0x3c')]};return db[_0x6a1f('0x2b')][_0x6a1f('0x1e')](_0x2da23a)[_0x6a1f('0x24')](function(_0x27be0a){_0x257cee[_0x6a1f('0x1e')]=_0x27be0a;if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3f')]){_0x1e951c[_0x6a1f('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x6a1f('0x41')](_0x1e951c);})[_0x6a1f('0x24')](function(_0x334fc4){_0x257cee[_0x6a1f('0x42')]=_0x334fc4;return _0x257cee;})[_0x6a1f('0x24')](respondWithFilteredResult(_0x574d80,_0x1e951c))[_0x6a1f('0x43')](handleError(_0x574d80,null));};exports['show']=function(_0x211009,_0x482c3a){var _0x3a6f80={'raw':!![],'where':{'id':_0x211009[_0x6a1f('0x44')]['id']}},_0x33208d={};_0x33208d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db[_0x6a1f('0x2b')]['rawAttributes']);_0x33208d[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x211009[_0x6a1f('0x30')]);_0x33208d[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],_0x33208d[_0x6a1f('0x30')]);_0x3a6f80[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],qs['fields'](_0x211009['query']['fields']));_0x3a6f80[_0x6a1f('0x34')]=_0x3a6f80[_0x6a1f('0x34')][_0x6a1f('0x45')]?_0x3a6f80[_0x6a1f('0x34')]:_0x33208d[_0x6a1f('0x2f')];if(_0x211009[_0x6a1f('0x30')]['includeAll']){_0x3a6f80[_0x6a1f('0x40')]=[{'all':!![]}];}_0x3a6f80=_['merge']({},_0x3a6f80,_0x211009[_0x6a1f('0x3e')]);return db[_0x6a1f('0x2b')]['find'](_0x3a6f80)[_0x6a1f('0x24')](handleEntityNotFound(_0x482c3a,null))['then'](respondWithResult(_0x482c3a,null))[_0x6a1f('0x43')](handleError(_0x482c3a,null));};exports[_0x6a1f('0x46')]=function(_0xa864f3,_0x4318fd){return db[_0x6a1f('0x2b')][_0x6a1f('0x46')](_0xa864f3['body'],{})[_0x6a1f('0x24')](respondWithResult(_0x4318fd,0xc9))[_0x6a1f('0x43')](handleError(_0x4318fd,null));};exports[_0x6a1f('0x23')]=function(_0x2bea1a,_0x34fa17){if(_0x2bea1a[_0x6a1f('0x47')]['id']){delete _0x2bea1a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2b')]['find']({'where':{'id':_0x2bea1a[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x34fa17,null))[_0x6a1f('0x24')](saveUpdates(_0x2bea1a['body'],null))[_0x6a1f('0x24')](respondWithResult(_0x34fa17,null))['catch'](handleError(_0x34fa17,null));};exports[_0x6a1f('0x48')]=function(_0x52c262,_0x366a60){return db['Cdr'][_0x6a1f('0x49')]({'where':{'id':_0x52c262[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x366a60,null))['then'](removeEntity(_0x366a60,null))[_0x6a1f('0x43')](handleError(_0x366a60,null));};exports['describe']=function(_0x143873,_0x55d114){return db['Cdr'][_0x6a1f('0x4a')]()[_0x6a1f('0x24')](respondWithResult(_0x55d114,null))['catch'](handleError(_0x55d114,null));};
\ No newline at end of file
+var _0x106f=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','Cdr','findAll','params','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x468481,_0x3d8b88){var _0x363252=function(_0x32e2a9){while(--_0x32e2a9){_0x468481['push'](_0x468481['shift']());}};_0x363252(++_0x3d8b88);}(_0x106f,0x162));var _0xf106=function(_0x2276fa,_0x5dc6c8){_0x2276fa=_0x2276fa-0x0;var _0x76562a=_0x106f[_0x2276fa];return _0x76562a;};'use strict';var emlformat=require(_0xf106('0x0'));var rimraf=require(_0xf106('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf106('0x2'));var rp=require(_0xf106('0x3'));var moment=require('moment');var BPromise=require(_0xf106('0x4'));var Mustache=require('mustache');var util=require(_0xf106('0x5'));var path=require(_0xf106('0x6'));var sox=require(_0xf106('0x7'));var csv=require(_0xf106('0x8'));var ejs=require(_0xf106('0x9'));var fs=require('fs');var fs_extra=require(_0xf106('0xa'));var _=require(_0xf106('0xb'));var squel=require('squel');var crypto=require(_0xf106('0xc'));var jsforce=require(_0xf106('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf106('0xe'));var qs=require(_0xf106('0xf'));var as=require(_0xf106('0x10'));var hardwareService=require(_0xf106('0x11'));var logger=require(_0xf106('0x12'))(_0xf106('0x13'));var utils=require(_0xf106('0x14'));var config=require(_0xf106('0x15'));var licenseUtil=require(_0xf106('0x16'));var db=require(_0xf106('0x17'))['db'];function respondWithStatusCode(_0x31eebf,_0x5e9da8){_0x5e9da8=_0x5e9da8||0xcc;return function(_0x2bd234){if(_0x2bd234){return _0x31eebf[_0xf106('0x18')](_0x5e9da8);}return _0x31eebf['status'](_0x5e9da8)['end']();};}function respondWithResult(_0x322351,_0x2cdbf6){_0x2cdbf6=_0x2cdbf6||0xc8;return function(_0x292a0d){if(_0x292a0d){return _0x322351['status'](_0x2cdbf6)[_0xf106('0x19')](_0x292a0d);}};}function respondWithFilteredResult(_0x26186f,_0xf05683){return function(_0x48bfdd){if(_0x48bfdd){var _0x1e17e6=typeof _0xf05683[_0xf106('0x1a')]==='undefined'&&typeof _0xf05683[_0xf106('0x1b')]===_0xf106('0x1c');var _0x62352=_0x48bfdd['count'];var _0x5d02c0=_0x1e17e6?0x0:_0xf05683[_0xf106('0x1a')];var _0x726d7c=_0x1e17e6?_0x48bfdd[_0xf106('0x1d')]:_0xf05683['offset']+_0xf05683[_0xf106('0x1b')];var _0x1a6816;if(_0x726d7c>=_0x62352){_0x726d7c=_0x62352;_0x1a6816=0xc8;}else{_0x1a6816=0xce;}_0x26186f[_0xf106('0x1e')](_0x1a6816);return _0x26186f[_0xf106('0x1f')](_0xf106('0x20'),_0x5d02c0+'-'+_0x726d7c+'/'+_0x62352)[_0xf106('0x19')](_0x48bfdd);}return null;};}function patchUpdates(_0x29ae70){return function(_0x232a54){try{jsonpatch[_0xf106('0x21')](_0x232a54,_0x29ae70,!![]);}catch(_0x4a9564){return BPromise['reject'](_0x4a9564);}return _0x232a54[_0xf106('0x22')]();};}function saveUpdates(_0x59abbc,_0x32ab30){return function(_0x3c729e){if(_0x3c729e){return _0x3c729e[_0xf106('0x23')](_0x59abbc)[_0xf106('0x24')](function(_0x450451){return _0x450451;});}return null;};}function removeEntity(_0x4f673f,_0x58febd){return function(_0x178890){if(_0x178890){return _0x178890[_0xf106('0x25')]()[_0xf106('0x24')](function(){_0x4f673f[_0xf106('0x1e')](0xcc)[_0xf106('0x26')]();});}};}function handleEntityNotFound(_0xf7de89,_0x9f99bb){return function(_0x118726){if(!_0x118726){_0xf7de89[_0xf106('0x18')](0x194);}return _0x118726;};}function handleError(_0x14b15e,_0x468fce){_0x468fce=_0x468fce||0x1f4;return function(_0x225c15){logger['error'](_0x225c15['stack']);if(_0x225c15['name']){delete _0x225c15[_0xf106('0x27')];}_0x14b15e[_0xf106('0x1e')](_0x468fce)[_0xf106('0x28')](_0x225c15);};}exports[_0xf106('0x29')]=function(_0x4265b3,_0x13b5d7){var _0x4f90d1={},_0x1394e8={},_0x269bff={'count':0x0,'rows':[]};var _0x1f8323=_[_0xf106('0x2a')](db['Cdr'][_0xf106('0x2b')],function(_0x444bde){return{'name':_0x444bde[_0xf106('0x2c')],'type':_0x444bde[_0xf106('0x2d')][_0xf106('0x2e')]};});_0x1394e8[_0xf106('0x2f')]=_['map'](_0x1f8323,_0xf106('0x27'));_0x1394e8[_0xf106('0x30')]=_[_0xf106('0x31')](_0x4265b3[_0xf106('0x30')]);_0x1394e8['filters']=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],_0x1394e8['query']);_0x4f90d1[_0xf106('0x33')]=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x4265b3[_0xf106('0x30')][_0xf106('0x34')]));_0x4f90d1[_0xf106('0x33')]=_0x4f90d1[_0xf106('0x33')][_0xf106('0x35')]?_0x4f90d1[_0xf106('0x33')]:_0x1394e8[_0xf106('0x2f')];if(!_0x4265b3['query']['hasOwnProperty'](_0xf106('0x36'))){_0x4f90d1[_0xf106('0x1b')]=qs[_0xf106('0x1b')](_0x4265b3['query'][_0xf106('0x1b')]);_0x4f90d1[_0xf106('0x1a')]=qs[_0xf106('0x1a')](_0x4265b3[_0xf106('0x30')][_0xf106('0x1a')]);}_0x4f90d1['order']=qs[_0xf106('0x37')](_0x4265b3['query'][_0xf106('0x37')]);_0x4f90d1[_0xf106('0x38')]=qs[_0xf106('0x39')](_[_0xf106('0x3a')](_0x4265b3['query'],_0x1394e8[_0xf106('0x39')]),_0x1f8323);if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3b')]){_0x4f90d1['where']=_['merge'](_0x4f90d1['where'],{'$or':_['map'](_0x1f8323,function(_0x58dba7){if(_0x58dba7[_0xf106('0x2d')]!=='VIRTUAL'){var _0x4beb79={};_0x4beb79[_0x58dba7[_0xf106('0x27')]]={'$like':'%'+_0x4265b3['query']['filter']+'%'};return _0x4beb79;}})});}_0x4f90d1=_[_0xf106('0x3c')]({},_0x4f90d1,_0x4265b3[_0xf106('0x3d')]);var _0x2d4c90={'where':_0x4f90d1[_0xf106('0x38')]};return db['Cdr'][_0xf106('0x1d')](_0x2d4c90)[_0xf106('0x24')](function(_0x583a72){_0x269bff[_0xf106('0x1d')]=_0x583a72;if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3e')]){_0x4f90d1[_0xf106('0x3f')]=[{'all':!![]}];}return db[_0xf106('0x40')][_0xf106('0x41')](_0x4f90d1);})[_0xf106('0x24')](function(_0x57d61e){_0x269bff['rows']=_0x57d61e;return _0x269bff;})[_0xf106('0x24')](respondWithFilteredResult(_0x13b5d7,_0x4f90d1))['catch'](handleError(_0x13b5d7,null));};exports['show']=function(_0x37bb28,_0x390eee){var _0x5e6cb8={'raw':!![],'where':{'id':_0x37bb28[_0xf106('0x42')]['id']}},_0x47f4d3={};_0x47f4d3['model']=_[_0xf106('0x31')](db[_0xf106('0x40')][_0xf106('0x2b')]);_0x47f4d3[_0xf106('0x30')]=_[_0xf106('0x31')](_0x37bb28[_0xf106('0x30')]);_0x47f4d3[_0xf106('0x39')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],_0x47f4d3[_0xf106('0x30')]);_0x5e6cb8[_0xf106('0x33')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x37bb28[_0xf106('0x30')][_0xf106('0x34')]));_0x5e6cb8[_0xf106('0x33')]=_0x5e6cb8[_0xf106('0x33')]['length']?_0x5e6cb8[_0xf106('0x33')]:_0x47f4d3[_0xf106('0x2f')];if(_0x37bb28[_0xf106('0x30')][_0xf106('0x3e')]){_0x5e6cb8[_0xf106('0x3f')]=[{'all':!![]}];}_0x5e6cb8=_['merge']({},_0x5e6cb8,_0x37bb28['options']);return db['Cdr']['find'](_0x5e6cb8)[_0xf106('0x24')](handleEntityNotFound(_0x390eee,null))['then'](respondWithResult(_0x390eee,null))['catch'](handleError(_0x390eee,null));};exports[_0xf106('0x43')]=function(_0x1a686d,_0xd50443){return db[_0xf106('0x40')]['create'](_0x1a686d[_0xf106('0x44')],{})[_0xf106('0x24')](respondWithResult(_0xd50443,0xc9))[_0xf106('0x45')](handleError(_0xd50443,null));};exports[_0xf106('0x23')]=function(_0x1bf065,_0x519192){if(_0x1bf065['body']['id']){delete _0x1bf065[_0xf106('0x44')]['id'];}return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x1bf065['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x519192,null))[_0xf106('0x24')](saveUpdates(_0x1bf065[_0xf106('0x44')],null))[_0xf106('0x24')](respondWithResult(_0x519192,null))['catch'](handleError(_0x519192,null));};exports[_0xf106('0x25')]=function(_0x5b80a8,_0x50798d){return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x5b80a8['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x50798d,null))[_0xf106('0x24')](removeEntity(_0x50798d,null))[_0xf106('0x45')](handleError(_0x50798d,null));};exports[_0xf106('0x47')]=function(_0x14375d,_0x391e3d){return db['Cdr']['describe']()[_0xf106('0x24')](respondWithResult(_0x391e3d,null))['catch'](handleError(_0x391e3d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 36015d0..45d26e5 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(_0x18b535,_0x3ac87f){var _0x27dcb3=function(_0x7071ce){while(--_0x7071ce){_0x18b535['push'](_0x18b535['shift']());}};_0x27dcb3(++_0x3ac87f);}(_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
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5f0f06,_0x35a7c5){var _0x26054f=function(_0x56ad15){while(--_0x56ad15){_0x5f0f06['push'](_0x5f0f06['shift']());}};_0x26054f(++_0x35a7c5);}(_0x7a54,0x106));var _0x47a5=function(_0x3ef601,_0xeffdc5){_0x3ef601=_0x3ef601-0x0;var _0x38cb26=_0x7a54[_0x3ef601];return _0x38cb26;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index b8c10a8..96eea77 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 _0x8334=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x8334,0x1b4));var _0x4833=function(_0x52883e,_0x10ef9a){_0x52883e=_0x52883e-0x0;var _0x434cf1=_0x8334[_0x52883e];return _0x434cf1;};'use strict';var _=require(_0x4833('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4833('0x1'));var rs=require(_0x4833('0x2'));var fs=require('fs');var Redis=require(_0x4833('0x3'));var db=require(_0x4833('0x4'))['db'];var utils=require(_0x4833('0x5'));var logger=require('../../config/logger')(_0x4833('0x6'));var config=require('../../config/environment');var jayson=require(_0x4833('0x7'));var client=jayson['client'][_0x4833('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b3cc5,_0x21e7d0,_0x12d176){return new BPromise(function(_0x2d8623,_0x117946){return client['request'](_0x3b3cc5,_0x12d176)[_0x4833('0x9')](function(_0x2eb04b){logger['info'](_0x4833('0xa'),_0x21e7d0,_0x4833('0xb'));logger[_0x4833('0xc')](_0x4833('0xd'),_0x21e7d0,_0x4833('0xb'),JSON[_0x4833('0xe')](_0x2eb04b));if(_0x2eb04b[_0x4833('0xf')]){if(_0x2eb04b[_0x4833('0xf')][_0x4833('0x10')]===0x1f4){logger['error'](_0x4833('0xa'),_0x21e7d0,_0x2eb04b[_0x4833('0xf')][_0x4833('0x11')]);return _0x117946(_0x2eb04b['error'][_0x4833('0x11')]);}logger[_0x4833('0xf')](_0x4833('0xa'),_0x21e7d0,_0x2eb04b['error']['message']);return _0x2d8623(_0x2eb04b[_0x4833('0xf')][_0x4833('0x11')]);}else{logger[_0x4833('0x12')]('Cdr,\x20%s,\x20%s',_0x21e7d0,_0x4833('0xb'));_0x2d8623(_0x2eb04b[_0x4833('0x13')]['message']);}})['catch'](function(_0x496b4c){logger[_0x4833('0xf')](_0x4833('0xa'),_0x21e7d0,_0x496b4c);_0x117946(_0x496b4c);});});}
\ No newline at end of file
+var _0x2569=['request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','Cdr,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2569,0x139));var _0x9256=function(_0x24c970,_0x1199ef){_0x24c970=_0x24c970-0x0;var _0x48f700=_0x2569[_0x24c970];return _0x48f700;};'use strict';var _=require('lodash');var util=require(_0x9256('0x0'));var moment=require('moment');var BPromise=require(_0x9256('0x1'));var rs=require(_0x9256('0x2'));var fs=require('fs');var Redis=require(_0x9256('0x3'));var db=require(_0x9256('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9256('0x5'))(_0x9256('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9256('0x7')][_0x9256('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30f9ee,_0x1069e5,_0x9f93fc){return new BPromise(function(_0x340977,_0x51fde6){return client['request'](_0x30f9ee,_0x9f93fc)[_0x9256('0x9')](function(_0x1ae0b4){logger['info'](_0x9256('0xa'),_0x1069e5,_0x9256('0xb'));logger['debug'](_0x9256('0xc'),_0x1069e5,_0x9256('0xb'),JSON[_0x9256('0xd')](_0x1ae0b4));if(_0x1ae0b4[_0x9256('0xe')]){if(_0x1ae0b4[_0x9256('0xe')]['code']===0x1f4){logger[_0x9256('0xe')](_0x9256('0xa'),_0x1069e5,_0x1ae0b4['error']['message']);return _0x51fde6(_0x1ae0b4[_0x9256('0xe')][_0x9256('0xf')]);}logger[_0x9256('0xe')](_0x9256('0xa'),_0x1069e5,_0x1ae0b4[_0x9256('0xe')][_0x9256('0xf')]);return _0x340977(_0x1ae0b4['error']['message']);}else{logger['info'](_0x9256('0xa'),_0x1069e5,_0x9256('0xb'));_0x340977(_0x1ae0b4[_0x9256('0x10')]['message']);}})[_0x9256('0x11')](function(_0x1aa330){logger[_0x9256('0xe')](_0x9256('0xa'),_0x1069e5,_0x1aa330);_0x51fde6(_0x1aa330);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index a044686..c336560 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('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(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index b4c8bdb..f39f7d3 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 _0x42d0=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x4b0fff,_0x2eff9e){var _0x379192=function(_0x7cb9cd){while(--_0x7cb9cd){_0x4b0fff['push'](_0x4b0fff['shift']());}};_0x379192(++_0x2eff9e);}(_0x42d0,0xc2));var _0x042d=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x42d0[_0x919445];return _0x511b3e;};'use strict';var Sequelize=require(_0x042d('0x0'));module[_0x042d('0x1')]={'priority':{'type':Sequelize[_0x042d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x042d('0x3')],'allowNull':![],'defaultValue':_0x042d('0x4')},'appdata':{'type':Sequelize[_0x042d('0x5')]()},'description':{'type':Sequelize[_0x042d('0x3')]},'interval':{'type':Sequelize[_0x042d('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xf122=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0xf122,0x17f));var _0x2f12=function(_0x3cd10f,_0x3191f6){_0x3cd10f=_0x3cd10f-0x0;var _0x19e274=_0xf122[_0x3cd10f];return _0x19e274;};'use strict';var Sequelize=require(_0x2f12('0x0'));module[_0x2f12('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2f12('0x2')],'allowNull':![],'defaultValue':_0x2f12('0x3')},'appdata':{'type':Sequelize[_0x2f12('0x4')]()},'description':{'type':Sequelize[_0x2f12('0x2')]},'interval':{'type':Sequelize[_0x2f12('0x2')],'defaultValue':_0x2f12('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 9d4e827..ebe86c1 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 _0x0f69=['../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','find','catch','body','params','destroy','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x107f52,_0x27401a){var _0x3be952=function(_0x24bf38){while(--_0x24bf38){_0x107f52['push'](_0x107f52['shift']());}};_0x3be952(++_0x27401a);}(_0x0f69,0x173));var _0x90f6=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x0f69[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x90f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90f6('0x1'));var moment=require(_0x90f6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90f6('0x3'));var util=require(_0x90f6('0x4'));var path=require('path');var sox=require(_0x90f6('0x5'));var csv=require('to-csv');var ejs=require(_0x90f6('0x6'));var fs=require('fs');var fs_extra=require(_0x90f6('0x7'));var _=require(_0x90f6('0x8'));var squel=require(_0x90f6('0x9'));var crypto=require(_0x90f6('0xa'));var jsforce=require(_0x90f6('0xb'));var deskjs=require(_0x90f6('0xc'));var toCsv=require(_0x90f6('0xd'));var querystring=require(_0x90f6('0xe'));var Papa=require(_0x90f6('0xf'));var Redis=require(_0x90f6('0x10'));var authService=require(_0x90f6('0x11'));var qs=require(_0x90f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90f6('0x13'));var logger=require(_0x90f6('0x14'))('api');var utils=require(_0x90f6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x90f6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aa86a,_0x13ca42){_0x13ca42=_0x13ca42||0xcc;return function(_0x47e1e6){if(_0x47e1e6){return _0x4aa86a[_0x90f6('0x17')](_0x13ca42);}return _0x4aa86a[_0x90f6('0x18')](_0x13ca42)[_0x90f6('0x19')]();};}function respondWithResult(_0x189351,_0x47fd3c){_0x47fd3c=_0x47fd3c||0xc8;return function(_0x3c7b60){if(_0x3c7b60){return _0x189351['status'](_0x47fd3c)['json'](_0x3c7b60);}};}function respondWithFilteredResult(_0x36803b,_0x598737){return function(_0x85ba42){if(_0x85ba42){var _0x16d692=typeof _0x598737[_0x90f6('0x1a')]===_0x90f6('0x1b')&&typeof _0x598737[_0x90f6('0x1c')]===_0x90f6('0x1b');var _0x2cb207=_0x85ba42['count'];var _0x36682a=_0x16d692?0x0:_0x598737[_0x90f6('0x1a')];var _0x5ac9be=_0x16d692?_0x85ba42[_0x90f6('0x1d')]:_0x598737[_0x90f6('0x1a')]+_0x598737[_0x90f6('0x1c')];var _0x12f0c4;if(_0x5ac9be>=_0x2cb207){_0x5ac9be=_0x2cb207;_0x12f0c4=0xc8;}else{_0x12f0c4=0xce;}_0x36803b[_0x90f6('0x18')](_0x12f0c4);return _0x36803b[_0x90f6('0x1e')](_0x90f6('0x1f'),_0x36682a+'-'+_0x5ac9be+'/'+_0x2cb207)['json'](_0x85ba42);}return null;};}function patchUpdates(_0x1beb61){return function(_0x3bec2e){try{jsonpatch['apply'](_0x3bec2e,_0x1beb61,!![]);}catch(_0x56a73e){return BPromise[_0x90f6('0x20')](_0x56a73e);}return _0x3bec2e['save']();};}function saveUpdates(_0x480cd5,_0x763a9b){return function(_0x520e2c){if(_0x520e2c){return _0x520e2c[_0x90f6('0x21')](_0x480cd5)[_0x90f6('0x22')](function(_0x300139){return _0x300139;});}return null;};}function removeEntity(_0x31f4ac,_0x31bec5){return function(_0x209244){if(_0x209244){return _0x209244['destroy']()[_0x90f6('0x22')](function(){_0x31f4ac['status'](0xcc)[_0x90f6('0x19')]();});}};}function handleEntityNotFound(_0x1b22d5,_0x2e7816){return function(_0x2c280b){if(!_0x2c280b){_0x1b22d5[_0x90f6('0x17')](0x194);}return _0x2c280b;};}function handleError(_0x304441,_0x291b62){_0x291b62=_0x291b62||0x1f4;return function(_0x21ed7){logger['error'](_0x21ed7[_0x90f6('0x23')]);if(_0x21ed7['name']){delete _0x21ed7['name'];}_0x304441['status'](_0x291b62)[_0x90f6('0x24')](_0x21ed7);};}exports[_0x90f6('0x25')]=function(_0x55b92f,_0x31f9cb){var _0x16a770={'raw':!![],'where':{'id':_0x55b92f['params']['id']}},_0x1bff1e={};_0x1bff1e[_0x90f6('0x26')]=_[_0x90f6('0x27')](db[_0x90f6('0x28')][_0x90f6('0x29')]);_0x1bff1e[_0x90f6('0x2a')]=_[_0x90f6('0x27')](_0x55b92f[_0x90f6('0x2a')]);_0x1bff1e[_0x90f6('0x2b')]=_['intersection'](_0x1bff1e['model'],_0x1bff1e['query']);_0x16a770['attributes']=_[_0x90f6('0x2c')](_0x1bff1e['model'],qs[_0x90f6('0x2d')](_0x55b92f[_0x90f6('0x2a')]['fields']));_0x16a770['attributes']=_0x16a770['attributes'][_0x90f6('0x2e')]?_0x16a770[_0x90f6('0x2f')]:_0x1bff1e[_0x90f6('0x26')];if(_0x55b92f[_0x90f6('0x2a')][_0x90f6('0x30')]){_0x16a770[_0x90f6('0x31')]=[{'all':!![]}];}_0x16a770=_[_0x90f6('0x32')]({},_0x16a770,_0x55b92f['options']);return db[_0x90f6('0x28')][_0x90f6('0x33')](_0x16a770)[_0x90f6('0x22')](handleEntityNotFound(_0x31f9cb,null))[_0x90f6('0x22')](respondWithResult(_0x31f9cb,null))[_0x90f6('0x34')](handleError(_0x31f9cb,null));};exports['update']=function(_0x2e5e22,_0x17ef33){if(_0x2e5e22[_0x90f6('0x35')]['id']){delete _0x2e5e22[_0x90f6('0x35')]['id'];}return db[_0x90f6('0x28')][_0x90f6('0x33')]({'where':{'id':_0x2e5e22[_0x90f6('0x36')]['id']}})['then'](handleEntityNotFound(_0x17ef33,null))[_0x90f6('0x22')](saveUpdates(_0x2e5e22[_0x90f6('0x35')],null))[_0x90f6('0x22')](respondWithResult(_0x17ef33,null))[_0x90f6('0x34')](handleError(_0x17ef33,null));};exports[_0x90f6('0x37')]=function(_0x410177,_0x14140d){return db[_0x90f6('0x28')][_0x90f6('0x33')]({'where':{'id':_0x410177[_0x90f6('0x36')]['id']}})[_0x90f6('0x22')](handleEntityNotFound(_0x14140d,null))[_0x90f6('0x22')](removeEntity(_0x14140d,null))[_0x90f6('0x34')](handleError(_0x14140d,null));};
\ No newline at end of file
+var _0x153f=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x490992,_0x64c65a){var _0x47d9fd=function(_0x3e70cb){while(--_0x3e70cb){_0x490992['push'](_0x490992['shift']());}};_0x47d9fd(++_0x64c65a);}(_0x153f,0x15b));var _0xf153=function(_0x331697,_0xe13353){_0x331697=_0x331697-0x0;var _0x30313b=_0x153f[_0x331697];return _0x30313b;};'use strict';var emlformat=require(_0xf153('0x0'));var rimraf=require(_0xf153('0x1'));var zipdir=require(_0xf153('0x2'));var jsonpatch=require(_0xf153('0x3'));var rp=require(_0xf153('0x4'));var moment=require(_0xf153('0x5'));var BPromise=require(_0xf153('0x6'));var Mustache=require('mustache');var util=require(_0xf153('0x7'));var path=require('path');var sox=require(_0xf153('0x8'));var csv=require(_0xf153('0x9'));var ejs=require(_0xf153('0xa'));var fs=require('fs');var fs_extra=require(_0xf153('0xb'));var _=require(_0xf153('0xc'));var squel=require('squel');var crypto=require(_0xf153('0xd'));var jsforce=require(_0xf153('0xe'));var deskjs=require(_0xf153('0xf'));var toCsv=require(_0xf153('0x9'));var querystring=require(_0xf153('0x10'));var Papa=require(_0xf153('0x11'));var Redis=require(_0xf153('0x12'));var authService=require(_0xf153('0x13'));var qs=require(_0xf153('0x14'));var as=require(_0xf153('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf153('0x16'))(_0xf153('0x17'));var utils=require(_0xf153('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf153('0x19'));var db=require(_0xf153('0x1a'))['db'];function respondWithStatusCode(_0x65756d,_0x1cc666){_0x1cc666=_0x1cc666||0xcc;return function(_0x256b7d){if(_0x256b7d){return _0x65756d[_0xf153('0x1b')](_0x1cc666);}return _0x65756d[_0xf153('0x1c')](_0x1cc666)[_0xf153('0x1d')]();};}function respondWithResult(_0x3e34fb,_0x4c5283){_0x4c5283=_0x4c5283||0xc8;return function(_0x18be7e){if(_0x18be7e){return _0x3e34fb[_0xf153('0x1c')](_0x4c5283)[_0xf153('0x1e')](_0x18be7e);}};}function respondWithFilteredResult(_0x406e6f,_0x3afea2){return function(_0x68f436){if(_0x68f436){var _0x273a90=typeof _0x3afea2[_0xf153('0x1f')]==='undefined'&&typeof _0x3afea2[_0xf153('0x20')]==='undefined';var _0x37093a=_0x68f436[_0xf153('0x21')];var _0x138dbe=_0x273a90?0x0:_0x3afea2[_0xf153('0x1f')];var _0x4e790d=_0x273a90?_0x68f436[_0xf153('0x21')]:_0x3afea2[_0xf153('0x1f')]+_0x3afea2[_0xf153('0x20')];var _0x14b83f;if(_0x4e790d>=_0x37093a){_0x4e790d=_0x37093a;_0x14b83f=0xc8;}else{_0x14b83f=0xce;}_0x406e6f[_0xf153('0x1c')](_0x14b83f);return _0x406e6f[_0xf153('0x22')](_0xf153('0x23'),_0x138dbe+'-'+_0x4e790d+'/'+_0x37093a)[_0xf153('0x1e')](_0x68f436);}return null;};}function patchUpdates(_0x3735a7){return function(_0x1dd340){try{jsonpatch[_0xf153('0x24')](_0x1dd340,_0x3735a7,!![]);}catch(_0x3665a2){return BPromise['reject'](_0x3665a2);}return _0x1dd340[_0xf153('0x25')]();};}function saveUpdates(_0x395f28,_0x3d3e41){return function(_0x32e759){if(_0x32e759){return _0x32e759[_0xf153('0x26')](_0x395f28)[_0xf153('0x27')](function(_0x465d88){return _0x465d88;});}return null;};}function removeEntity(_0x4376f7,_0xf67cde){return function(_0x38190c){if(_0x38190c){return _0x38190c[_0xf153('0x28')]()[_0xf153('0x27')](function(){_0x4376f7[_0xf153('0x1c')](0xcc)[_0xf153('0x1d')]();});}};}function handleEntityNotFound(_0xe490f8,_0x35f9da){return function(_0x141ef4){if(!_0x141ef4){_0xe490f8[_0xf153('0x1b')](0x194);}return _0x141ef4;};}function handleError(_0x23acc3,_0x17f7a4){_0x17f7a4=_0x17f7a4||0x1f4;return function(_0x48ebdc){logger[_0xf153('0x29')](_0x48ebdc[_0xf153('0x2a')]);if(_0x48ebdc['name']){delete _0x48ebdc[_0xf153('0x2b')];}_0x23acc3[_0xf153('0x1c')](_0x17f7a4)['send'](_0x48ebdc);};}exports[_0xf153('0x2c')]=function(_0x10295e,_0x261ac0){var _0x2b9a9c={'raw':!![],'where':{'id':_0x10295e[_0xf153('0x2d')]['id']}},_0x339e96={};_0x339e96[_0xf153('0x2e')]=_[_0xf153('0x2f')](db[_0xf153('0x30')][_0xf153('0x31')]);_0x339e96[_0xf153('0x32')]=_[_0xf153('0x2f')](_0x10295e['query']);_0x339e96[_0xf153('0x33')]=_[_0xf153('0x34')](_0x339e96[_0xf153('0x2e')],_0x339e96[_0xf153('0x32')]);_0x2b9a9c['attributes']=_['intersection'](_0x339e96[_0xf153('0x2e')],qs['fields'](_0x10295e['query'][_0xf153('0x35')]));_0x2b9a9c['attributes']=_0x2b9a9c[_0xf153('0x36')]['length']?_0x2b9a9c[_0xf153('0x36')]:_0x339e96[_0xf153('0x2e')];if(_0x10295e['query'][_0xf153('0x37')]){_0x2b9a9c[_0xf153('0x38')]=[{'all':!![]}];}_0x2b9a9c=_[_0xf153('0x39')]({},_0x2b9a9c,_0x10295e[_0xf153('0x3a')]);return db[_0xf153('0x30')][_0xf153('0x3b')](_0x2b9a9c)['then'](handleEntityNotFound(_0x261ac0,null))[_0xf153('0x27')](respondWithResult(_0x261ac0,null))['catch'](handleError(_0x261ac0,null));};exports[_0xf153('0x26')]=function(_0x2523c0,_0x9b3f4c){if(_0x2523c0[_0xf153('0x3c')]['id']){delete _0x2523c0[_0xf153('0x3c')]['id'];}return db[_0xf153('0x30')]['find']({'where':{'id':_0x2523c0[_0xf153('0x2d')]['id']}})[_0xf153('0x27')](handleEntityNotFound(_0x9b3f4c,null))[_0xf153('0x27')](saveUpdates(_0x2523c0['body'],null))[_0xf153('0x27')](respondWithResult(_0x9b3f4c,null))[_0xf153('0x3d')](handleError(_0x9b3f4c,null));};exports[_0xf153('0x28')]=function(_0x254692,_0x36c5cd){return db[_0xf153('0x30')]['find']({'where':{'id':_0x254692[_0xf153('0x2d')]['id']}})[_0xf153('0x27')](handleEntityNotFound(_0x36c5cd,null))['then'](removeEntity(_0x36c5cd,null))[_0xf153('0x3d')](handleError(_0x36c5cd,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 253c80d..418fd8c 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 _0x933b=['chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','exports','define'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0x933b,0x16e));var _0xb933=function(_0x1bea75,_0xf76ca0){_0x1bea75=_0x1bea75-0x0;var _0x5a41cf=_0x933b[_0x1bea75];return _0x5a41cf;};'use strict';var _=require(_0xb933('0x0'));var util=require(_0xb933('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb933('0x2'));var BPromise=require(_0xb933('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb933('0x4'));var rimraf=require(_0xb933('0x5'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xb933('0x6')]=function(_0x322df5,_0x105a1f){return _0x322df5[_0xb933('0x7')]('ChatApplication',attributes,{'tableName':_0xb933('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb933('0x9'),'collate':_0xb933('0xa')});};
\ No newline at end of file
+var _0x0f13=['./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d6ac0,_0x1c52e2){var _0x359130=function(_0x49e579){while(--_0x49e579){_0x3d6ac0['push'](_0x3d6ac0['shift']());}};_0x359130(++_0x1c52e2);}(_0x0f13,0x12b));var _0x30f1=function(_0x1cf4cb,_0x25525c){_0x1cf4cb=_0x1cf4cb-0x0;var _0x455c72=_0x0f13[_0x1cf4cb];return _0x455c72;};'use strict';var _=require(_0x30f1('0x0'));var util=require(_0x30f1('0x1'));var logger=require(_0x30f1('0x2'))(_0x30f1('0x3'));var moment=require('moment');var BPromise=require(_0x30f1('0x4'));var rp=require(_0x30f1('0x5'));var fs=require('fs');var path=require(_0x30f1('0x6'));var rimraf=require(_0x30f1('0x7'));var config=require(_0x30f1('0x8'));var attributes=require(_0x30f1('0x9'));module[_0x30f1('0xa')]=function(_0x23fa14,_0xa07d55){return _0x23fa14[_0x30f1('0xb')]('ChatApplication',attributes,{'tableName':_0x30f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x30f1('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 14fd3c5..b3341eb 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 _0xce01=['../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xef09a2,_0x1e2d64){var _0x390a34=function(_0x1be616){while(--_0x1be616){_0xef09a2['push'](_0xef09a2['shift']());}};_0x390a34(++_0x1e2d64);}(_0xce01,0x6b));var _0x1ce0=function(_0x4df531,_0x4d99f6){_0x4df531=_0x4df531-0x0;var _0x4bb657=_0xce01[_0x4df531];return _0x4bb657;};'use strict';var _=require(_0x1ce0('0x0'));var util=require(_0x1ce0('0x1'));var moment=require('moment');var BPromise=require(_0x1ce0('0x2'));var rs=require(_0x1ce0('0x3'));var fs=require('fs');var Redis=require(_0x1ce0('0x4'));var db=require(_0x1ce0('0x5'))['db'];var utils=require(_0x1ce0('0x6'));var logger=require(_0x1ce0('0x7'))('rpc');var config=require(_0x1ce0('0x8'));var jayson=require(_0x1ce0('0x9'));var client=jayson['client'][_0x1ce0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422715,_0x5d6958,_0x290aa2){return new BPromise(function(_0x3250a1,_0xbb4dec){return client[_0x1ce0('0xb')](_0x422715,_0x290aa2)[_0x1ce0('0xc')](function(_0x497dd1){logger[_0x1ce0('0xd')](_0x1ce0('0xe'),_0x5d6958,'request\x20sent');logger[_0x1ce0('0xf')](_0x1ce0('0x10'),_0x5d6958,_0x1ce0('0x11'),JSON[_0x1ce0('0x12')](_0x497dd1));if(_0x497dd1['error']){if(_0x497dd1['error'][_0x1ce0('0x13')]===0x1f4){logger[_0x1ce0('0x14')](_0x1ce0('0xe'),_0x5d6958,_0x497dd1[_0x1ce0('0x14')][_0x1ce0('0x15')]);return _0xbb4dec(_0x497dd1['error']['message']);}logger['error'](_0x1ce0('0xe'),_0x5d6958,_0x497dd1['error'][_0x1ce0('0x15')]);return _0x3250a1(_0x497dd1[_0x1ce0('0x14')]['message']);}else{logger[_0x1ce0('0xd')](_0x1ce0('0xe'),_0x5d6958,'request\x20sent');_0x3250a1(_0x497dd1[_0x1ce0('0x16')][_0x1ce0('0x15')]);}})['catch'](function(_0x376ccf){logger[_0x1ce0('0x14')](_0x1ce0('0xe'),_0x5d6958,_0x376ccf);_0xbb4dec(_0x376ccf);});});}
\ No newline at end of file
+var _0xde3b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird'];(function(_0x1035f0,_0x5e72ed){var _0x14f92e=function(_0x432acf){while(--_0x432acf){_0x1035f0['push'](_0x1035f0['shift']());}};_0x14f92e(++_0x5e72ed);}(_0xde3b,0x150));var _0xbde3=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xde3b[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xbde3('0x0'));var util=require(_0xbde3('0x1'));var moment=require(_0xbde3('0x2'));var BPromise=require(_0xbde3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbde3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde3('0x5'))(_0xbde3('0x6'));var config=require(_0xbde3('0x7'));var jayson=require(_0xbde3('0x8'));var client=jayson[_0xbde3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10f3f1,_0x4da709,_0x1a704e){return new BPromise(function(_0x1b24ad,_0x2e51c7){return client[_0xbde3('0xa')](_0x10f3f1,_0x1a704e)[_0xbde3('0xb')](function(_0x31ff81){logger[_0xbde3('0xc')](_0xbde3('0xd'),_0x4da709,_0xbde3('0xe'));logger[_0xbde3('0xf')](_0xbde3('0x10'),_0x4da709,_0xbde3('0xe'),JSON['stringify'](_0x31ff81));if(_0x31ff81[_0xbde3('0x11')]){if(_0x31ff81[_0xbde3('0x11')][_0xbde3('0x12')]===0x1f4){logger[_0xbde3('0x11')](_0xbde3('0xd'),_0x4da709,_0x31ff81[_0xbde3('0x11')][_0xbde3('0x13')]);return _0x2e51c7(_0x31ff81['error']['message']);}logger[_0xbde3('0x11')](_0xbde3('0xd'),_0x4da709,_0x31ff81['error']['message']);return _0x1b24ad(_0x31ff81[_0xbde3('0x11')][_0xbde3('0x13')]);}else{logger['info'](_0xbde3('0xd'),_0x4da709,_0xbde3('0xe'));_0x1b24ad(_0x31ff81['result'][_0xbde3('0x13')]);}})['catch'](function(_0x1e6b1a){logger[_0xbde3('0x11')](_0xbde3('0xd'),_0x4da709,_0x1e6b1a);_0x2e51c7(_0x1e6b1a);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 021734c..8ad3070 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 _0x3f95=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update','destroy','multer','util','path'];(function(_0x3eac36,_0x47a2d1){var _0x4319f6=function(_0x444df7){while(--_0x444df7){_0x3eac36['push'](_0x3eac36['shift']());}};_0x4319f6(++_0x47a2d1);}(_0x3f95,0x66));var _0x53f9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f95[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x53f9('0x0'));var util=require(_0x53f9('0x1'));var path=require(_0x53f9('0x2'));var timeout=require(_0x53f9('0x3'));var express=require('express');var router=express[_0x53f9('0x4')]();var fs_extra=require(_0x53f9('0x5'));var auth=require(_0x53f9('0x6'));var interaction=require(_0x53f9('0x7'));var config=require(_0x53f9('0x8'));var controller=require(_0x53f9('0x9'));router[_0x53f9('0xa')](_0x53f9('0xb'),auth[_0x53f9('0xc')](),controller['show']);router['put'](_0x53f9('0xb'),auth[_0x53f9('0xc')](),controller[_0x53f9('0xd')]);router['delete'](_0x53f9('0xb'),auth['isAuthenticated'](),controller[_0x53f9('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x3b97=['update','delete','isAuthenticated','destroy','util','path','Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','show','put'];(function(_0xf6709d,_0xae89ae){var _0x4c934b=function(_0x4f39a3){while(--_0x4f39a3){_0xf6709d['push'](_0xf6709d['shift']());}};_0x4c934b(++_0xae89ae);}(_0x3b97,0x1a8));var _0x73b9=function(_0x288467,_0x43c3fb){_0x288467=_0x288467-0x0;var _0x341e2a=_0x3b97[_0x288467];return _0x341e2a;};'use strict';var multer=require('multer');var util=require(_0x73b9('0x0'));var path=require(_0x73b9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x73b9('0x2')]();var fs_extra=require(_0x73b9('0x3'));var auth=require(_0x73b9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x73b9('0x5'));router[_0x73b9('0x6')](_0x73b9('0x7'),auth['isAuthenticated'](),controller[_0x73b9('0x8')]);router[_0x73b9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x73b9('0xa')]);router[_0x73b9('0xb')](_0x73b9('0x7'),auth[_0x73b9('0xc')](),controller[_0x73b9('0xd')]);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 e17570b..32cb114 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 _0xa7c8=['BOOLEAN','sequelize','STRING'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa7c8,0x82));var _0x8a7c=function(_0x1223b6,_0x180811){_0x1223b6=_0x1223b6-0x0;var _0x361c17=_0xa7c8[_0x1223b6];return _0x361c17;};'use strict';var Sequelize=require(_0x8a7c('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a7c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8a7c('0x1')]},'write':{'type':Sequelize[_0x8a7c('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xfcf7=['STRING','BOOLEAN','sequelize','exports'];(function(_0x55ff21,_0x1540f0){var _0x4baf37=function(_0x51128b){while(--_0x51128b){_0x55ff21['push'](_0x55ff21['shift']());}};_0x4baf37(++_0x1540f0);}(_0xfcf7,0x106));var _0x7fcf=function(_0x546ada,_0x274ba0){_0x546ada=_0x546ada-0x0;var _0x7d1e6c=_0xfcf7[_0x546ada];return _0x7d1e6c;};'use strict';var Sequelize=require(_0x7fcf('0x0'));module[_0x7fcf('0x1')]={'name':{'type':Sequelize[_0x7fcf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7fcf('0x2')]},'write':{'type':Sequelize[_0x7fcf('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 0ed4791..f6f0dca 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 _0x9bb9=['getMembers','User','nolimit','removeMembers','addMessage','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','ChatGroup','count','includeAll','findAll','rows','catch','params','include','create','body','find','describe','getUnread','ChatInternalMessage','user','addMembers','ids'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x9bb9,0xca));var _0x99bb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9bb9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x99bb('0x0'));var rimraf=require(_0x99bb('0x1'));var zipdir=require(_0x99bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99bb('0x3'));var moment=require('moment');var BPromise=require(_0x99bb('0x4'));var Mustache=require(_0x99bb('0x5'));var util=require(_0x99bb('0x6'));var path=require(_0x99bb('0x7'));var sox=require(_0x99bb('0x8'));var csv=require(_0x99bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99bb('0xa'));var _=require(_0x99bb('0xb'));var squel=require(_0x99bb('0xc'));var crypto=require(_0x99bb('0xd'));var jsforce=require(_0x99bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x99bb('0x9'));var querystring=require(_0x99bb('0xf'));var Papa=require(_0x99bb('0x10'));var Redis=require(_0x99bb('0x11'));var authService=require(_0x99bb('0x12'));var qs=require(_0x99bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x99bb('0x14'))(_0x99bb('0x15'));var utils=require(_0x99bb('0x16'));var config=require(_0x99bb('0x17'));var licenseUtil=require(_0x99bb('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x99bb('0x19')](config[_0x99bb('0x1a')],{'host':_0x99bb('0x1b'),'port':0x18eb});var socket=require(_0x99bb('0x1c'))(new Redis(config['redis']));require(_0x99bb('0x1d'))['register'](socket);function respondWithStatusCode(_0x9a31e4,_0x222603){_0x222603=_0x222603||0xcc;return function(_0x32d63a){if(_0x32d63a){return _0x9a31e4[_0x99bb('0x1e')](_0x222603);}return _0x9a31e4['status'](_0x222603)[_0x99bb('0x1f')]();};}function respondWithResult(_0x51bc87,_0xef46ce){_0xef46ce=_0xef46ce||0xc8;return function(_0x4dbf24){if(_0x4dbf24){return _0x51bc87[_0x99bb('0x20')](_0xef46ce)[_0x99bb('0x21')](_0x4dbf24);}};}function respondWithFilteredResult(_0x58bb56,_0x208e16){return function(_0x3afa99){if(_0x3afa99){var _0x56a576=typeof _0x208e16[_0x99bb('0x22')]===_0x99bb('0x23')&&typeof _0x208e16[_0x99bb('0x24')]===_0x99bb('0x23');var _0x2d19ec=_0x3afa99['count'];var _0x542f94=_0x56a576?0x0:_0x208e16[_0x99bb('0x22')];var _0x5ab28e=_0x56a576?_0x3afa99['count']:_0x208e16[_0x99bb('0x22')]+_0x208e16['limit'];var _0x4e17b2;if(_0x5ab28e>=_0x2d19ec){_0x5ab28e=_0x2d19ec;_0x4e17b2=0xc8;}else{_0x4e17b2=0xce;}_0x58bb56['status'](_0x4e17b2);return _0x58bb56[_0x99bb('0x25')]('Content-Range',_0x542f94+'-'+_0x5ab28e+'/'+_0x2d19ec)[_0x99bb('0x21')](_0x3afa99);}return null;};}function patchUpdates(_0x249a6c){return function(_0x60f6f2){try{jsonpatch[_0x99bb('0x26')](_0x60f6f2,_0x249a6c,!![]);}catch(_0x1a8e3b){return BPromise[_0x99bb('0x27')](_0x1a8e3b);}return _0x60f6f2[_0x99bb('0x28')]();};}function saveUpdates(_0x5048a9,_0xe5ec80){return function(_0x1afbf1){if(_0x1afbf1){return _0x1afbf1[_0x99bb('0x29')](_0x5048a9)[_0x99bb('0x2a')](function(_0x375044){return _0x375044;});}return null;};}function removeEntity(_0x1ab205,_0x1f1953){return function(_0x19a8ba){if(_0x19a8ba){return _0x19a8ba[_0x99bb('0x2b')]()[_0x99bb('0x2a')](function(){_0x1ab205[_0x99bb('0x20')](0xcc)[_0x99bb('0x1f')]();});}};}function handleEntityNotFound(_0x330457,_0x1a24ce){return function(_0x306855){if(!_0x306855){_0x330457[_0x99bb('0x1e')](0x194);}return _0x306855;};}function handleError(_0x8acb37,_0x227438){_0x227438=_0x227438||0x1f4;return function(_0x4136ab){logger[_0x99bb('0x2c')](_0x4136ab[_0x99bb('0x2d')]);if(_0x4136ab['name']){delete _0x4136ab[_0x99bb('0x2e')];}_0x8acb37[_0x99bb('0x20')](_0x227438)[_0x99bb('0x2f')](_0x4136ab);};}exports['index']=function(_0x53db50,_0x4461b0){var _0x36b7f8={},_0x3fbaf5={},_0x28b80e={'count':0x0,'rows':[]};var _0x4c4bb7=_[_0x99bb('0x30')](db['ChatGroup'][_0x99bb('0x31')],function(_0x1757b1){return{'name':_0x1757b1['fieldName'],'type':_0x1757b1[_0x99bb('0x32')][_0x99bb('0x33')]};});_0x3fbaf5[_0x99bb('0x34')]=_['map'](_0x4c4bb7,_0x99bb('0x2e'));_0x3fbaf5['query']=_[_0x99bb('0x35')](_0x53db50[_0x99bb('0x36')]);_0x3fbaf5[_0x99bb('0x37')]=_[_0x99bb('0x38')](_0x3fbaf5[_0x99bb('0x34')],_0x3fbaf5['query']);_0x36b7f8[_0x99bb('0x39')]=_[_0x99bb('0x38')](_0x3fbaf5[_0x99bb('0x34')],qs[_0x99bb('0x3a')](_0x53db50[_0x99bb('0x36')][_0x99bb('0x3a')]));_0x36b7f8['attributes']=_0x36b7f8['attributes'][_0x99bb('0x3b')]?_0x36b7f8[_0x99bb('0x39')]:_0x3fbaf5[_0x99bb('0x34')];if(!_0x53db50[_0x99bb('0x36')][_0x99bb('0x3c')]('nolimit')){_0x36b7f8[_0x99bb('0x24')]=qs[_0x99bb('0x24')](_0x53db50[_0x99bb('0x36')]['limit']);_0x36b7f8[_0x99bb('0x22')]=qs['offset'](_0x53db50[_0x99bb('0x36')][_0x99bb('0x22')]);}_0x36b7f8[_0x99bb('0x3d')]=qs[_0x99bb('0x3e')](_0x53db50[_0x99bb('0x36')][_0x99bb('0x3e')]);_0x36b7f8['where']=qs[_0x99bb('0x37')](_[_0x99bb('0x3f')](_0x53db50[_0x99bb('0x36')],_0x3fbaf5[_0x99bb('0x37')]),_0x4c4bb7);if(_0x53db50[_0x99bb('0x36')][_0x99bb('0x40')]){_0x36b7f8['where']=_[_0x99bb('0x41')](_0x36b7f8[_0x99bb('0x42')],{'$or':_['map'](_0x4c4bb7,function(_0x11db79){if(_0x11db79[_0x99bb('0x32')]!==_0x99bb('0x43')){var _0x33d2ab={};_0x33d2ab[_0x11db79['name']]={'$like':'%'+_0x53db50[_0x99bb('0x36')]['filter']+'%'};return _0x33d2ab;}})});}_0x36b7f8=_[_0x99bb('0x41')]({},_0x36b7f8,_0x53db50[_0x99bb('0x44')]);var _0x5cfa87={'where':_0x36b7f8['where']};return db[_0x99bb('0x45')]['count'](_0x5cfa87)[_0x99bb('0x2a')](function(_0x2011d7){_0x28b80e[_0x99bb('0x46')]=_0x2011d7;if(_0x53db50[_0x99bb('0x36')][_0x99bb('0x47')]){_0x36b7f8['include']=[{'all':!![]}];}return db[_0x99bb('0x45')][_0x99bb('0x48')](_0x36b7f8);})[_0x99bb('0x2a')](function(_0x3469ca){_0x28b80e[_0x99bb('0x49')]=_0x3469ca;return _0x28b80e;})[_0x99bb('0x2a')](respondWithFilteredResult(_0x4461b0,_0x36b7f8))[_0x99bb('0x4a')](handleError(_0x4461b0,null));};exports['show']=function(_0x1006ca,_0x5ce3b2){var _0x4ffb3b={'raw':!![],'where':{'id':_0x1006ca[_0x99bb('0x4b')]['id']}},_0x304063={};_0x304063[_0x99bb('0x34')]=_[_0x99bb('0x35')](db[_0x99bb('0x45')]['rawAttributes']);_0x304063[_0x99bb('0x36')]=_['keys'](_0x1006ca[_0x99bb('0x36')]);_0x304063[_0x99bb('0x37')]=_[_0x99bb('0x38')](_0x304063['model'],_0x304063[_0x99bb('0x36')]);_0x4ffb3b['attributes']=_['intersection'](_0x304063[_0x99bb('0x34')],qs[_0x99bb('0x3a')](_0x1006ca[_0x99bb('0x36')][_0x99bb('0x3a')]));_0x4ffb3b['attributes']=_0x4ffb3b['attributes'][_0x99bb('0x3b')]?_0x4ffb3b[_0x99bb('0x39')]:_0x304063['model'];if(_0x1006ca[_0x99bb('0x36')][_0x99bb('0x47')]){_0x4ffb3b[_0x99bb('0x4c')]=[{'all':!![]}];}_0x4ffb3b=_['merge']({},_0x4ffb3b,_0x1006ca[_0x99bb('0x44')]);return db[_0x99bb('0x45')]['find'](_0x4ffb3b)[_0x99bb('0x2a')](handleEntityNotFound(_0x5ce3b2,null))[_0x99bb('0x2a')](respondWithResult(_0x5ce3b2,null))[_0x99bb('0x4a')](handleError(_0x5ce3b2,null));};exports[_0x99bb('0x4d')]=function(_0x55574b,_0x29a41c){return db[_0x99bb('0x45')]['create'](_0x55574b['body'],{})[_0x99bb('0x2a')](respondWithResult(_0x29a41c,0xc9))[_0x99bb('0x4a')](handleError(_0x29a41c,null));};exports[_0x99bb('0x29')]=function(_0x4d9438,_0x28ec14){if(_0x4d9438['body']['id']){delete _0x4d9438[_0x99bb('0x4e')]['id'];}return db['ChatGroup'][_0x99bb('0x4f')]({'where':{'id':_0x4d9438[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x28ec14,null))[_0x99bb('0x2a')](saveUpdates(_0x4d9438[_0x99bb('0x4e')],null))[_0x99bb('0x2a')](respondWithResult(_0x28ec14,null))[_0x99bb('0x4a')](handleError(_0x28ec14,null));};exports[_0x99bb('0x2b')]=function(_0x142b40,_0xd14ceb){return db[_0x99bb('0x45')]['find']({'where':{'id':_0x142b40[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0xd14ceb,null))[_0x99bb('0x2a')](removeEntity(_0xd14ceb,null))[_0x99bb('0x4a')](handleError(_0xd14ceb,null));};exports[_0x99bb('0x50')]=function(_0x5c3119,_0x44914c){return db['ChatGroup'][_0x99bb('0x50')]()['then'](respondWithResult(_0x44914c,null))['catch'](handleError(_0x44914c,null));};exports[_0x99bb('0x51')]=function(_0x1d8090,_0x114aee,_0x11e9a5){return db[_0x99bb('0x52')][_0x99bb('0x46')]({'where':{'ChatGroupId':_0x1d8090[_0x99bb('0x4b')]['id'],'ToId':_0x1d8090[_0x99bb('0x53')]['id'],'read':![]}})[_0x99bb('0x2a')](function(_0x5c5a5f){return{'id':_['toInteger'](_0x1d8090[_0x99bb('0x4b')]['id']),'count':_0x5c5a5f};})[_0x99bb('0x2a')](respondWithResult(_0x114aee,null))[_0x99bb('0x4a')](handleError(_0x114aee,null));};exports[_0x99bb('0x54')]=function(_0x2e2273,_0x5485c2,_0x150d6e){return db['ChatGroup'][_0x99bb('0x4f')]({'where':{'id':_0x2e2273[_0x99bb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5485c2,null))[_0x99bb('0x2a')](function(_0x389827){if(_0x389827){return _0x389827[_0x99bb('0x54')](_0x2e2273[_0x99bb('0x4e')][_0x99bb('0x55')],_['omit'](_0x2e2273[_0x99bb('0x4e')],[_0x99bb('0x55'),'id'])||{});}})[_0x99bb('0x2a')](respondWithResult(_0x5485c2,null))['catch'](handleError(_0x5485c2,null));};exports[_0x99bb('0x56')]=function(_0x14b97c,_0x4c37ca,_0x5eb367){var _0x5a479d={};var _0x4329fc={};var _0x2ff149;var _0x10cc93;return db[_0x99bb('0x45')]['findOne']({'where':{'id':_0x14b97c[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x4c37ca,null))[_0x99bb('0x2a')](function(_0x36f072){if(_0x36f072){_0x2ff149=_0x36f072;_0x4329fc[_0x99bb('0x34')]=_[_0x99bb('0x35')](db[_0x99bb('0x57')][_0x99bb('0x31')]);_0x4329fc['query']=_[_0x99bb('0x35')](_0x14b97c[_0x99bb('0x36')]);_0x4329fc[_0x99bb('0x37')]=_['intersection'](_0x4329fc[_0x99bb('0x34')],_0x4329fc[_0x99bb('0x36')]);_0x5a479d[_0x99bb('0x39')]=_[_0x99bb('0x38')](_0x4329fc['model'],qs[_0x99bb('0x3a')](_0x14b97c[_0x99bb('0x36')]['fields']));_0x5a479d[_0x99bb('0x39')]=_0x5a479d[_0x99bb('0x39')][_0x99bb('0x3b')]?_0x5a479d[_0x99bb('0x39')]:_0x4329fc[_0x99bb('0x34')];_0x5a479d[_0x99bb('0x3d')]=qs[_0x99bb('0x3e')](_0x14b97c['query'][_0x99bb('0x3e')]);_0x5a479d[_0x99bb('0x42')]=qs[_0x99bb('0x37')](_[_0x99bb('0x3f')](_0x14b97c[_0x99bb('0x36')],_0x4329fc['filters']));if(_0x14b97c[_0x99bb('0x36')]['filter']){_0x5a479d[_0x99bb('0x42')]=_[_0x99bb('0x41')](_0x5a479d[_0x99bb('0x42')],{'$or':_['map'](_0x5a479d['attributes'],function(_0xf10612){var _0x1f15ec={};_0x1f15ec[_0xf10612]={'$like':'%'+_0x14b97c['query']['filter']+'%'};return _0x1f15ec;})});}_0x5a479d=_[_0x99bb('0x41')]({},_0x5a479d,_0x14b97c['options']);return _0x2ff149[_0x99bb('0x56')](_0x5a479d);}})['then'](function(_0x5aa9aa){if(_0x5aa9aa){_0x10cc93=_0x5aa9aa[_0x99bb('0x3b')];if(!_0x14b97c[_0x99bb('0x36')]['hasOwnProperty'](_0x99bb('0x58'))){_0x5a479d[_0x99bb('0x24')]=qs['limit'](_0x14b97c[_0x99bb('0x36')]['limit']);_0x5a479d[_0x99bb('0x22')]=qs['offset'](_0x14b97c[_0x99bb('0x36')][_0x99bb('0x22')]);}return _0x2ff149['getMembers'](_0x5a479d);}})[_0x99bb('0x2a')](function(_0x30b15c){if(_0x30b15c){return _0x30b15c?{'count':_0x10cc93,'rows':_0x30b15c}:null;}})[_0x99bb('0x2a')](respondWithResult(_0x4c37ca,null))[_0x99bb('0x4a')](handleError(_0x4c37ca,null));};exports[_0x99bb('0x59')]=function(_0x2d6202,_0x1abfb1,_0x20986f){return db[_0x99bb('0x45')][_0x99bb('0x4f')]({'where':{'id':_0x2d6202[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x1abfb1,null))[_0x99bb('0x2a')](function(_0x442b50){if(_0x442b50){return _0x442b50[_0x99bb('0x59')](_0x2d6202[_0x99bb('0x36')][_0x99bb('0x55')]);}})[_0x99bb('0x2a')](respondWithStatusCode(_0x1abfb1,null))[_0x99bb('0x4a')](handleError(_0x1abfb1,null));};exports[_0x99bb('0x5a')]=function(_0x5a860f,_0x521c2b,_0x5eccdb){if(_0x5a860f['body']['id']){delete _0x5a860f[_0x99bb('0x4e')]['id'];}return db[_0x99bb('0x45')]['find']({'where':{'id':_0x5a860f['params']['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x521c2b,null))[_0x99bb('0x2a')](function(_0x1ecf58){if(_0x1ecf58){_0x5a860f[_0x99bb('0x4e')]['ChatGroupId']=_0x1ecf58['id'];return db[_0x99bb('0x52')][_0x99bb('0x4d')](_0x5a860f[_0x99bb('0x4e')]);}})[_0x99bb('0x2a')](respondWithResult(_0x521c2b,null))['catch'](handleError(_0x521c2b,null));};exports[_0x99bb('0x5b')]=function(_0x56c89b,_0x4597fd,_0xa1373f){var _0x278a10={};var _0x210060={};var _0x1726e7;var _0x19ba6a;return db[_0x99bb('0x45')][_0x99bb('0x5c')]({'where':{'id':_0x56c89b[_0x99bb('0x4b')]['id']}})[_0x99bb('0x2a')](handleEntityNotFound(_0x4597fd,null))[_0x99bb('0x2a')](function(_0x2db512){if(_0x2db512){_0x1726e7=_0x2db512;_0x210060[_0x99bb('0x34')]=_[_0x99bb('0x35')](db['ChatInternalMessage']['rawAttributes']);_0x210060[_0x99bb('0x36')]=_[_0x99bb('0x35')](_0x56c89b[_0x99bb('0x36')]);_0x210060[_0x99bb('0x37')]=_[_0x99bb('0x38')](_0x210060['model'],_0x210060['query']);_0x278a10[_0x99bb('0x39')]=_[_0x99bb('0x38')](_0x210060[_0x99bb('0x34')],qs['fields'](_0x56c89b[_0x99bb('0x36')][_0x99bb('0x3a')]));_0x278a10['attributes']=_0x278a10[_0x99bb('0x39')][_0x99bb('0x3b')]?_0x278a10[_0x99bb('0x39')]:_0x210060[_0x99bb('0x34')];_0x278a10[_0x99bb('0x3d')]=qs[_0x99bb('0x3e')](_0x56c89b[_0x99bb('0x36')][_0x99bb('0x3e')]);_0x278a10[_0x99bb('0x42')]=qs['filters'](_[_0x99bb('0x3f')](_0x56c89b[_0x99bb('0x36')],_0x210060[_0x99bb('0x37')]));if(_0x56c89b[_0x99bb('0x36')][_0x99bb('0x40')]){_0x278a10[_0x99bb('0x42')]=_['merge'](_0x278a10[_0x99bb('0x42')],{'$or':_[_0x99bb('0x30')](_0x278a10[_0x99bb('0x39')],function(_0x263d3c){var _0x112145={};_0x112145[_0x263d3c]={'$like':'%'+_0x56c89b[_0x99bb('0x36')][_0x99bb('0x40')]+'%'};return _0x112145;})});}if(_0x56c89b['query'][_0x99bb('0x5d')]){var _0x390e6c=_0x56c89b[_0x99bb('0x36')][_0x99bb('0x5d')][_0x99bb('0x5e')](',');var _0x3be0fe={};_0x3be0fe[_0x390e6c[0x0]]={'$gte':moment(_0x390e6c[0x1])['format'](_0x99bb('0x5f'))};_0x278a10['where']=_[_0x99bb('0x41')](_0x278a10[_0x99bb('0x42')],_0x3be0fe);}_0x278a10=_[_0x99bb('0x41')]({},_0x278a10,_0x56c89b[_0x99bb('0x44')]);return _0x1726e7[_0x99bb('0x5b')](_0x278a10);}})[_0x99bb('0x2a')](function(_0x3416be){if(_0x3416be){_0x19ba6a=_0x3416be[_0x99bb('0x3b')];if(!_0x56c89b['query'][_0x99bb('0x3c')](_0x99bb('0x58'))){_0x278a10[_0x99bb('0x24')]=qs['limit'](_0x56c89b[_0x99bb('0x36')][_0x99bb('0x24')]);_0x278a10[_0x99bb('0x22')]=qs[_0x99bb('0x22')](_0x56c89b['query'][_0x99bb('0x22')]);}return _0x1726e7['getMessages'](_0x278a10);}})[_0x99bb('0x2a')](function(_0x3b890d){if(_0x3b890d){return _0x3b890d?{'count':_0x19ba6a,'rows':_0x3b890d}:null;}})['then'](respondWithResult(_0x4597fd,null))[_0x99bb('0x4a')](handleError(_0x4597fd,null));};
\ No newline at end of file
+var _0xcc46=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','map','query','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','rows','show','params','keys','intersection','length','include','find','catch','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','findOne','User','getMembers','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x38b54a,_0x33037c){var _0x921192=function(_0x312c23){while(--_0x312c23){_0x38b54a['push'](_0x38b54a['shift']());}};_0x921192(++_0x33037c);}(_0xcc46,0x1e6));var _0x6cc4=function(_0x370ab9,_0x171dd7){_0x370ab9=_0x370ab9-0x0;var _0x2d124b=_0xcc46[_0x370ab9];return _0x2d124b;};'use strict';var emlformat=require(_0x6cc4('0x0'));var rimraf=require(_0x6cc4('0x1'));var zipdir=require(_0x6cc4('0x2'));var jsonpatch=require(_0x6cc4('0x3'));var rp=require('request-promise');var moment=require(_0x6cc4('0x4'));var BPromise=require(_0x6cc4('0x5'));var Mustache=require('mustache');var util=require(_0x6cc4('0x6'));var path=require(_0x6cc4('0x7'));var sox=require('sox');var csv=require(_0x6cc4('0x8'));var ejs=require(_0x6cc4('0x9'));var fs=require('fs');var fs_extra=require(_0x6cc4('0xa'));var _=require(_0x6cc4('0xb'));var squel=require(_0x6cc4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6cc4('0xd'));var toCsv=require(_0x6cc4('0x8'));var querystring=require(_0x6cc4('0xe'));var Papa=require(_0x6cc4('0xf'));var Redis=require(_0x6cc4('0x10'));var authService=require(_0x6cc4('0x11'));var qs=require(_0x6cc4('0x12'));var as=require(_0x6cc4('0x13'));var hardwareService=require(_0x6cc4('0x14'));var logger=require(_0x6cc4('0x15'))(_0x6cc4('0x16'));var utils=require('../../config/utils');var config=require(_0x6cc4('0x17'));var licenseUtil=require(_0x6cc4('0x18'));var db=require(_0x6cc4('0x19'))['db'];config['redis']=_[_0x6cc4('0x1a')](config[_0x6cc4('0x1b')],{'host':_0x6cc4('0x1c'),'port':0x18eb});var socket=require(_0x6cc4('0x1d'))(new Redis(config[_0x6cc4('0x1b')]));require(_0x6cc4('0x1e'))[_0x6cc4('0x1f')](socket);function respondWithStatusCode(_0x714f75,_0x37a278){_0x37a278=_0x37a278||0xcc;return function(_0x3d6dbe){if(_0x3d6dbe){return _0x714f75[_0x6cc4('0x20')](_0x37a278);}return _0x714f75[_0x6cc4('0x21')](_0x37a278)[_0x6cc4('0x22')]();};}function respondWithResult(_0xc6c0e4,_0x3f49f1){_0x3f49f1=_0x3f49f1||0xc8;return function(_0x5c9d8a){if(_0x5c9d8a){return _0xc6c0e4[_0x6cc4('0x21')](_0x3f49f1)[_0x6cc4('0x23')](_0x5c9d8a);}};}function respondWithFilteredResult(_0x55d8e0,_0x4c17b0){return function(_0x453864){if(_0x453864){var _0x9ce2e3=typeof _0x4c17b0[_0x6cc4('0x24')]===_0x6cc4('0x25')&&typeof _0x4c17b0[_0x6cc4('0x26')]===_0x6cc4('0x25');var _0x22ebf6=_0x453864[_0x6cc4('0x27')];var _0x2fcfc6=_0x9ce2e3?0x0:_0x4c17b0['offset'];var _0x31edd7=_0x9ce2e3?_0x453864[_0x6cc4('0x27')]:_0x4c17b0[_0x6cc4('0x24')]+_0x4c17b0[_0x6cc4('0x26')];var _0x4d5c6b;if(_0x31edd7>=_0x22ebf6){_0x31edd7=_0x22ebf6;_0x4d5c6b=0xc8;}else{_0x4d5c6b=0xce;}_0x55d8e0['status'](_0x4d5c6b);return _0x55d8e0[_0x6cc4('0x28')]('Content-Range',_0x2fcfc6+'-'+_0x31edd7+'/'+_0x22ebf6)[_0x6cc4('0x23')](_0x453864);}return null;};}function patchUpdates(_0x1785ec){return function(_0x1b6808){try{jsonpatch[_0x6cc4('0x29')](_0x1b6808,_0x1785ec,!![]);}catch(_0xa50e94){return BPromise[_0x6cc4('0x2a')](_0xa50e94);}return _0x1b6808[_0x6cc4('0x2b')]();};}function saveUpdates(_0x14ac5a,_0xe6cded){return function(_0x4574e7){if(_0x4574e7){return _0x4574e7['update'](_0x14ac5a)['then'](function(_0x44203d){return _0x44203d;});}return null;};}function removeEntity(_0x2dbfbd,_0x33494b){return function(_0x247097){if(_0x247097){return _0x247097['destroy']()[_0x6cc4('0x2c')](function(){_0x2dbfbd[_0x6cc4('0x21')](0xcc)[_0x6cc4('0x22')]();});}};}function handleEntityNotFound(_0x3a694b,_0x547d56){return function(_0x467551){if(!_0x467551){_0x3a694b[_0x6cc4('0x20')](0x194);}return _0x467551;};}function handleError(_0x1d806f,_0x50f24f){_0x50f24f=_0x50f24f||0x1f4;return function(_0x480dce){logger[_0x6cc4('0x2d')](_0x480dce[_0x6cc4('0x2e')]);if(_0x480dce[_0x6cc4('0x2f')]){delete _0x480dce['name'];}_0x1d806f[_0x6cc4('0x21')](_0x50f24f)[_0x6cc4('0x30')](_0x480dce);};}exports[_0x6cc4('0x31')]=function(_0xedc6a,_0xc170a8){var _0xd405f2={},_0x523921={},_0x12099d={'count':0x0,'rows':[]};var _0x500774=_['map'](db[_0x6cc4('0x32')][_0x6cc4('0x33')],function(_0x507bf6){return{'name':_0x507bf6[_0x6cc4('0x34')],'type':_0x507bf6[_0x6cc4('0x35')][_0x6cc4('0x36')]};});_0x523921['model']=_[_0x6cc4('0x37')](_0x500774,'name');_0x523921[_0x6cc4('0x38')]=_['keys'](_0xedc6a['query']);_0x523921[_0x6cc4('0x39')]=_['intersection'](_0x523921[_0x6cc4('0x3a')],_0x523921[_0x6cc4('0x38')]);_0xd405f2['attributes']=_['intersection'](_0x523921[_0x6cc4('0x3a')],qs[_0x6cc4('0x3b')](_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x3b')]));_0xd405f2['attributes']=_0xd405f2[_0x6cc4('0x3c')]['length']?_0xd405f2[_0x6cc4('0x3c')]:_0x523921[_0x6cc4('0x3a')];if(!_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x3d')](_0x6cc4('0x3e'))){_0xd405f2[_0x6cc4('0x26')]=qs[_0x6cc4('0x26')](_0xedc6a['query']['limit']);_0xd405f2[_0x6cc4('0x24')]=qs['offset'](_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x24')]);}_0xd405f2[_0x6cc4('0x3f')]=qs[_0x6cc4('0x40')](_0xedc6a[_0x6cc4('0x38')]['sort']);_0xd405f2['where']=qs['filters'](_[_0x6cc4('0x41')](_0xedc6a[_0x6cc4('0x38')],_0x523921[_0x6cc4('0x39')]),_0x500774);if(_0xedc6a['query'][_0x6cc4('0x42')]){_0xd405f2[_0x6cc4('0x43')]=_[_0x6cc4('0x44')](_0xd405f2[_0x6cc4('0x43')],{'$or':_[_0x6cc4('0x37')](_0x500774,function(_0x26411a){if(_0x26411a[_0x6cc4('0x35')]!=='VIRTUAL'){var _0x58638a={};_0x58638a[_0x26411a['name']]={'$like':'%'+_0xedc6a[_0x6cc4('0x38')]['filter']+'%'};return _0x58638a;}})});}_0xd405f2=_[_0x6cc4('0x44')]({},_0xd405f2,_0xedc6a['options']);var _0x4fa48d={'where':_0xd405f2[_0x6cc4('0x43')]};return db[_0x6cc4('0x32')][_0x6cc4('0x27')](_0x4fa48d)[_0x6cc4('0x2c')](function(_0x27681){_0x12099d[_0x6cc4('0x27')]=_0x27681;if(_0xedc6a[_0x6cc4('0x38')][_0x6cc4('0x45')]){_0xd405f2['include']=[{'all':!![]}];}return db[_0x6cc4('0x32')][_0x6cc4('0x46')](_0xd405f2);})[_0x6cc4('0x2c')](function(_0x1b6438){_0x12099d[_0x6cc4('0x47')]=_0x1b6438;return _0x12099d;})[_0x6cc4('0x2c')](respondWithFilteredResult(_0xc170a8,_0xd405f2))['catch'](handleError(_0xc170a8,null));};exports[_0x6cc4('0x48')]=function(_0x3eafa1,_0x4a1665){var _0x4bb5c0={'raw':!![],'where':{'id':_0x3eafa1[_0x6cc4('0x49')]['id']}},_0x2216a3={};_0x2216a3['model']=_[_0x6cc4('0x4a')](db[_0x6cc4('0x32')][_0x6cc4('0x33')]);_0x2216a3[_0x6cc4('0x38')]=_[_0x6cc4('0x4a')](_0x3eafa1[_0x6cc4('0x38')]);_0x2216a3[_0x6cc4('0x39')]=_[_0x6cc4('0x4b')](_0x2216a3['model'],_0x2216a3['query']);_0x4bb5c0[_0x6cc4('0x3c')]=_[_0x6cc4('0x4b')](_0x2216a3['model'],qs[_0x6cc4('0x3b')](_0x3eafa1[_0x6cc4('0x38')][_0x6cc4('0x3b')]));_0x4bb5c0[_0x6cc4('0x3c')]=_0x4bb5c0[_0x6cc4('0x3c')][_0x6cc4('0x4c')]?_0x4bb5c0['attributes']:_0x2216a3[_0x6cc4('0x3a')];if(_0x3eafa1[_0x6cc4('0x38')][_0x6cc4('0x45')]){_0x4bb5c0[_0x6cc4('0x4d')]=[{'all':!![]}];}_0x4bb5c0=_[_0x6cc4('0x44')]({},_0x4bb5c0,_0x3eafa1['options']);return db[_0x6cc4('0x32')][_0x6cc4('0x4e')](_0x4bb5c0)[_0x6cc4('0x2c')](handleEntityNotFound(_0x4a1665,null))['then'](respondWithResult(_0x4a1665,null))[_0x6cc4('0x4f')](handleError(_0x4a1665,null));};exports[_0x6cc4('0x50')]=function(_0x103088,_0x549f60){return db['ChatGroup'][_0x6cc4('0x50')](_0x103088[_0x6cc4('0x51')],{})[_0x6cc4('0x2c')](respondWithResult(_0x549f60,0xc9))[_0x6cc4('0x4f')](handleError(_0x549f60,null));};exports[_0x6cc4('0x52')]=function(_0x50abd2,_0x1921f2){if(_0x50abd2[_0x6cc4('0x51')]['id']){delete _0x50abd2[_0x6cc4('0x51')]['id'];}return db[_0x6cc4('0x32')]['find']({'where':{'id':_0x50abd2[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x1921f2,null))['then'](saveUpdates(_0x50abd2[_0x6cc4('0x51')],null))['then'](respondWithResult(_0x1921f2,null))['catch'](handleError(_0x1921f2,null));};exports['destroy']=function(_0x2a0749,_0x322ef4){return db[_0x6cc4('0x32')][_0x6cc4('0x4e')]({'where':{'id':_0x2a0749[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x322ef4,null))[_0x6cc4('0x2c')](removeEntity(_0x322ef4,null))['catch'](handleError(_0x322ef4,null));};exports['describe']=function(_0x4ecf39,_0x595bab){return db[_0x6cc4('0x32')][_0x6cc4('0x53')]()[_0x6cc4('0x2c')](respondWithResult(_0x595bab,null))['catch'](handleError(_0x595bab,null));};exports[_0x6cc4('0x54')]=function(_0x5cf4f9,_0x59241d,_0x4f7a81){return db[_0x6cc4('0x55')][_0x6cc4('0x27')]({'where':{'ChatGroupId':_0x5cf4f9[_0x6cc4('0x49')]['id'],'ToId':_0x5cf4f9[_0x6cc4('0x56')]['id'],'read':![]}})['then'](function(_0x4ce8c9){return{'id':_['toInteger'](_0x5cf4f9[_0x6cc4('0x49')]['id']),'count':_0x4ce8c9};})[_0x6cc4('0x2c')](respondWithResult(_0x59241d,null))['catch'](handleError(_0x59241d,null));};exports['addMembers']=function(_0x2a97bb,_0x1069ac,_0x845b06){return db[_0x6cc4('0x32')][_0x6cc4('0x4e')]({'where':{'id':_0x2a97bb['params']['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x1069ac,null))[_0x6cc4('0x2c')](function(_0x16faac){if(_0x16faac){return _0x16faac[_0x6cc4('0x57')](_0x2a97bb[_0x6cc4('0x51')]['ids'],_['omit'](_0x2a97bb[_0x6cc4('0x51')],['ids','id'])||{});}})[_0x6cc4('0x2c')](respondWithResult(_0x1069ac,null))[_0x6cc4('0x4f')](handleError(_0x1069ac,null));};exports['getMembers']=function(_0x179d9d,_0x86de83,_0x4af6e8){var _0x15fd49={};var _0x19aa82={};var _0x38db5c;var _0x36e824;return db[_0x6cc4('0x32')][_0x6cc4('0x58')]({'where':{'id':_0x179d9d[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x86de83,null))['then'](function(_0x523327){if(_0x523327){_0x38db5c=_0x523327;_0x19aa82[_0x6cc4('0x3a')]=_[_0x6cc4('0x4a')](db[_0x6cc4('0x59')]['rawAttributes']);_0x19aa82[_0x6cc4('0x38')]=_['keys'](_0x179d9d[_0x6cc4('0x38')]);_0x19aa82[_0x6cc4('0x39')]=_[_0x6cc4('0x4b')](_0x19aa82[_0x6cc4('0x3a')],_0x19aa82[_0x6cc4('0x38')]);_0x15fd49['attributes']=_[_0x6cc4('0x4b')](_0x19aa82['model'],qs['fields'](_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x3b')]));_0x15fd49[_0x6cc4('0x3c')]=_0x15fd49[_0x6cc4('0x3c')][_0x6cc4('0x4c')]?_0x15fd49[_0x6cc4('0x3c')]:_0x19aa82[_0x6cc4('0x3a')];_0x15fd49[_0x6cc4('0x3f')]=qs[_0x6cc4('0x40')](_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x40')]);_0x15fd49[_0x6cc4('0x43')]=qs['filters'](_[_0x6cc4('0x41')](_0x179d9d['query'],_0x19aa82['filters']));if(_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x42')]){_0x15fd49[_0x6cc4('0x43')]=_[_0x6cc4('0x44')](_0x15fd49[_0x6cc4('0x43')],{'$or':_[_0x6cc4('0x37')](_0x15fd49[_0x6cc4('0x3c')],function(_0x219ff1){var _0x4742bc={};_0x4742bc[_0x219ff1]={'$like':'%'+_0x179d9d['query'][_0x6cc4('0x42')]+'%'};return _0x4742bc;})});}_0x15fd49=_[_0x6cc4('0x44')]({},_0x15fd49,_0x179d9d['options']);return _0x38db5c['getMembers'](_0x15fd49);}})[_0x6cc4('0x2c')](function(_0x216061){if(_0x216061){_0x36e824=_0x216061[_0x6cc4('0x4c')];if(!_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x3d')]('nolimit')){_0x15fd49[_0x6cc4('0x26')]=qs[_0x6cc4('0x26')](_0x179d9d['query'][_0x6cc4('0x26')]);_0x15fd49[_0x6cc4('0x24')]=qs['offset'](_0x179d9d[_0x6cc4('0x38')][_0x6cc4('0x24')]);}return _0x38db5c[_0x6cc4('0x5a')](_0x15fd49);}})[_0x6cc4('0x2c')](function(_0x183b89){if(_0x183b89){return _0x183b89?{'count':_0x36e824,'rows':_0x183b89}:null;}})[_0x6cc4('0x2c')](respondWithResult(_0x86de83,null))[_0x6cc4('0x4f')](handleError(_0x86de83,null));};exports[_0x6cc4('0x5b')]=function(_0x37e462,_0x577990,_0x58e147){return db['ChatGroup'][_0x6cc4('0x4e')]({'where':{'id':_0x37e462[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0x577990,null))[_0x6cc4('0x2c')](function(_0x174b1c){if(_0x174b1c){return _0x174b1c[_0x6cc4('0x5b')](_0x37e462[_0x6cc4('0x38')][_0x6cc4('0x5c')]);}})[_0x6cc4('0x2c')](respondWithStatusCode(_0x577990,null))[_0x6cc4('0x4f')](handleError(_0x577990,null));};exports[_0x6cc4('0x5d')]=function(_0x116484,_0x183013,_0x521806){if(_0x116484[_0x6cc4('0x51')]['id']){delete _0x116484[_0x6cc4('0x51')]['id'];}return db[_0x6cc4('0x32')][_0x6cc4('0x4e')]({'where':{'id':_0x116484[_0x6cc4('0x49')]['id']}})['then'](handleEntityNotFound(_0x183013,null))[_0x6cc4('0x2c')](function(_0x4581a8){if(_0x4581a8){_0x116484[_0x6cc4('0x51')][_0x6cc4('0x5e')]=_0x4581a8['id'];return db[_0x6cc4('0x55')][_0x6cc4('0x50')](_0x116484[_0x6cc4('0x51')]);}})[_0x6cc4('0x2c')](respondWithResult(_0x183013,null))[_0x6cc4('0x4f')](handleError(_0x183013,null));};exports[_0x6cc4('0x5f')]=function(_0x3dbd5a,_0xdc314c,_0x5f0763){var _0x4ef41b={};var _0x3fc57f={};var _0x4f8c52;var _0x5dc115;return db['ChatGroup'][_0x6cc4('0x58')]({'where':{'id':_0x3dbd5a[_0x6cc4('0x49')]['id']}})[_0x6cc4('0x2c')](handleEntityNotFound(_0xdc314c,null))[_0x6cc4('0x2c')](function(_0x1cf6d8){if(_0x1cf6d8){_0x4f8c52=_0x1cf6d8;_0x3fc57f[_0x6cc4('0x3a')]=_[_0x6cc4('0x4a')](db[_0x6cc4('0x55')]['rawAttributes']);_0x3fc57f[_0x6cc4('0x38')]=_[_0x6cc4('0x4a')](_0x3dbd5a[_0x6cc4('0x38')]);_0x3fc57f['filters']=_[_0x6cc4('0x4b')](_0x3fc57f['model'],_0x3fc57f[_0x6cc4('0x38')]);_0x4ef41b['attributes']=_[_0x6cc4('0x4b')](_0x3fc57f['model'],qs['fields'](_0x3dbd5a[_0x6cc4('0x38')]['fields']));_0x4ef41b[_0x6cc4('0x3c')]=_0x4ef41b[_0x6cc4('0x3c')][_0x6cc4('0x4c')]?_0x4ef41b[_0x6cc4('0x3c')]:_0x3fc57f[_0x6cc4('0x3a')];_0x4ef41b[_0x6cc4('0x3f')]=qs[_0x6cc4('0x40')](_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x40')]);_0x4ef41b[_0x6cc4('0x43')]=qs[_0x6cc4('0x39')](_[_0x6cc4('0x41')](_0x3dbd5a[_0x6cc4('0x38')],_0x3fc57f[_0x6cc4('0x39')]));if(_0x3dbd5a['query'][_0x6cc4('0x42')]){_0x4ef41b['where']=_[_0x6cc4('0x44')](_0x4ef41b[_0x6cc4('0x43')],{'$or':_[_0x6cc4('0x37')](_0x4ef41b[_0x6cc4('0x3c')],function(_0x11cee6){var _0x117bca={};_0x117bca[_0x11cee6]={'$like':'%'+_0x3dbd5a['query'][_0x6cc4('0x42')]+'%'};return _0x117bca;})});}if(_0x3dbd5a['query'][_0x6cc4('0x60')]){var _0x381c54=_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x60')]['split'](',');var _0x2e01b7={};_0x2e01b7[_0x381c54[0x0]]={'$gte':moment(_0x381c54[0x1])[_0x6cc4('0x61')](_0x6cc4('0x62'))};_0x4ef41b['where']=_[_0x6cc4('0x44')](_0x4ef41b[_0x6cc4('0x43')],_0x2e01b7);}_0x4ef41b=_['merge']({},_0x4ef41b,_0x3dbd5a[_0x6cc4('0x63')]);return _0x4f8c52[_0x6cc4('0x5f')](_0x4ef41b);}})[_0x6cc4('0x2c')](function(_0x3ade65){if(_0x3ade65){_0x5dc115=_0x3ade65[_0x6cc4('0x4c')];if(!_0x3dbd5a['query']['hasOwnProperty'](_0x6cc4('0x3e'))){_0x4ef41b[_0x6cc4('0x26')]=qs[_0x6cc4('0x26')](_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x26')]);_0x4ef41b[_0x6cc4('0x24')]=qs['offset'](_0x3dbd5a[_0x6cc4('0x38')][_0x6cc4('0x24')]);}return _0x4f8c52[_0x6cc4('0x5f')](_0x4ef41b);}})['then'](function(_0x265f60){if(_0x265f60){return _0x265f60?{'count':_0x5dc115,'rows':_0x265f60}:null;}})[_0x6cc4('0x2c')](respondWithResult(_0xdc314c,null))[_0x6cc4('0x4f')](handleError(_0xdc314c,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 36dfc97..a416200 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 _0x8b30=['exports','events','../../mysqldb','setMaxListeners','emit','hasOwnProperty'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x8b30,0xc1));var _0x08b3=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x8b30[_0x68ee8b];return _0x5148f7;};'use strict';var EventEmitter=require(_0x08b3('0x0'));var ChatGroup=require(_0x08b3('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x08b3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1fd558){return function(_0x124b24,_0x1ec9ca,_0x1aa4f8){ChatGroupEvents[_0x08b3('0x3')](_0x1fd558+':'+_0x124b24['id'],_0x124b24);ChatGroupEvents['emit'](_0x1fd558,_0x124b24);_0x1aa4f8(null);};}for(var e in events){if(events[_0x08b3('0x4')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x08b3('0x5')]=ChatGroupEvents;
\ No newline at end of file
+var _0xc9de=['events','../../mysqldb','ChatGroup','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xc9de,0x140));var _0xec9d=function(_0x559e7b,_0x128e69){_0x559e7b=_0x559e7b-0x0;var _0x3d4aaa=_0xc9de[_0x559e7b];return _0x3d4aaa;};'use strict';var EventEmitter=require(_0xec9d('0x0'));var ChatGroup=require(_0xec9d('0x1'))['db'][_0xec9d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xec9d('0x3'),'afterUpdate':_0xec9d('0x4'),'afterDestroy':_0xec9d('0x5')};function emitEvent(_0xc34261){return function(_0x3cc1cb,_0x14c4e5,_0x9a3338){ChatGroupEvents[_0xec9d('0x6')](_0xc34261+':'+_0x3cc1cb['id'],_0x3cc1cb);ChatGroupEvents['emit'](_0xc34261,_0x3cc1cb);_0x9a3338(null);};}for(var e in events){if(events[_0xec9d('0x7')](e)){var event=events[e];ChatGroup[_0xec9d('0x8')](e,emitEvent(event));}}module[_0xec9d('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1a943a9..eae3996 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 _0x416b=['exports','ChatGroup','chat_groups','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x416b,0xc9));var _0xb416=function(_0x41c088,_0x155e0f){_0x41c088=_0x41c088-0x0;var _0x273b77=_0x416b[_0x41c088];return _0x273b77;};'use strict';var _=require('lodash');var util=require(_0xb416('0x0'));var logger=require(_0xb416('0x1'))('api');var moment=require(_0xb416('0x2'));var BPromise=require(_0xb416('0x3'));var rp=require(_0xb416('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb416('0x5'));var attributes=require('./chatGroup.attributes');module[_0xb416('0x6')]=function(_0x2ddec2,_0x5d1a3d){return _0x2ddec2['define'](_0xb416('0x7'),attributes,{'tableName':_0xb416('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0be7=['api','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash'];(function(_0x192b1a,_0x5b1a42){var _0x219986=function(_0x197aa7){while(--_0x197aa7){_0x192b1a['push'](_0x192b1a['shift']());}};_0x219986(++_0x5b1a42);}(_0x0be7,0xbd));var _0x70be=function(_0x5df60f,_0x138a33){_0x5df60f=_0x5df60f-0x0;var _0x359ee8=_0x0be7[_0x5df60f];return _0x359ee8;};'use strict';var _=require(_0x70be('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x70be('0x1'));var moment=require('moment');var BPromise=require(_0x70be('0x2'));var rp=require(_0x70be('0x3'));var fs=require('fs');var path=require(_0x70be('0x4'));var rimraf=require(_0x70be('0x5'));var config=require('../../config/environment');var attributes=require(_0x70be('0x6'));module[_0x70be('0x7')]=function(_0xb2516e,_0x28477a){return _0xb2516e[_0x70be('0x8')](_0x70be('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 7ffcee4..2e08a55 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 _0xbb91=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatGroup.socket','register','request','then','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x43f9d8,_0x4f5a7a){var _0x4c0720=function(_0xbfef72){while(--_0xbfef72){_0x43f9d8['push'](_0x43f9d8['shift']());}};_0x4c0720(++_0x4f5a7a);}(_0xbb91,0xce));var _0x1bb9=function(_0x1e2671,_0x4cf90a){_0x1e2671=_0x1e2671-0x0;var _0x492489=_0xbb91[_0x1e2671];return _0x492489;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var moment=require(_0x1bb9('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bb9('0x3'));var fs=require('fs');var Redis=require(_0x1bb9('0x4'));var db=require(_0x1bb9('0x5'))['db'];var utils=require(_0x1bb9('0x6'));var logger=require(_0x1bb9('0x7'))(_0x1bb9('0x8'));var config=require(_0x1bb9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1bb9('0xa')][_0x1bb9('0xb')]({'port':0x232a});config[_0x1bb9('0xc')]=_[_0x1bb9('0xd')](config[_0x1bb9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1bb9('0xc')]));require(_0x1bb9('0xe'))[_0x1bb9('0xf')](socket);function respondWithRpcPromise(_0x4be0ec,_0x5d8df9,_0x303345){return new BPromise(function(_0x269cc9,_0x5a0e26){return client[_0x1bb9('0x10')](_0x4be0ec,_0x303345)[_0x1bb9('0x11')](function(_0x1f0206){logger['info']('ChatGroup,\x20%s,\x20%s',_0x5d8df9,_0x1bb9('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5d8df9,'request\x20sent',JSON[_0x1bb9('0x13')](_0x1f0206));if(_0x1f0206[_0x1bb9('0x14')]){if(_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x15')]===0x1f4){logger[_0x1bb9('0x14')](_0x1bb9('0x16'),_0x5d8df9,_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x17')]);return _0x5a0e26(_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x17')]);}logger[_0x1bb9('0x14')](_0x1bb9('0x16'),_0x5d8df9,_0x1f0206[_0x1bb9('0x14')]['message']);return _0x269cc9(_0x1f0206[_0x1bb9('0x14')][_0x1bb9('0x17')]);}else{logger[_0x1bb9('0x18')](_0x1bb9('0x16'),_0x5d8df9,'request\x20sent');_0x269cc9(_0x1f0206['result']['message']);}})[_0x1bb9('0x19')](function(_0xd9d4a6){logger[_0x1bb9('0x14')](_0x1bb9('0x16'),_0x5d8df9,_0xd9d4a6);_0x5a0e26(_0xd9d4a6);});});}
\ No newline at end of file
+var _0x7a2d=['socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x7a2d,0x142));var _0xd7a2=function(_0x20ea97,_0x3a404d){_0x20ea97=_0x20ea97-0x0;var _0x1f3e19=_0x7a2d[_0x20ea97];return _0x1f3e19;};'use strict';var _=require(_0xd7a2('0x0'));var util=require(_0xd7a2('0x1'));var moment=require(_0xd7a2('0x2'));var BPromise=require(_0xd7a2('0x3'));var rs=require(_0xd7a2('0x4'));var fs=require('fs');var Redis=require(_0xd7a2('0x5'));var db=require(_0xd7a2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd7a2('0x7'));var config=require(_0xd7a2('0x8'));var jayson=require(_0xd7a2('0x9'));var client=jayson[_0xd7a2('0xa')]['http']({'port':0x232a});config[_0xd7a2('0xb')]=_[_0xd7a2('0xc')](config[_0xd7a2('0xb')],{'host':_0xd7a2('0xd'),'port':0x18eb});var socket=require(_0xd7a2('0xe'))(new Redis(config[_0xd7a2('0xb')]));require(_0xd7a2('0xf'))[_0xd7a2('0x10')](socket);function respondWithRpcPromise(_0x104013,_0x503b42,_0x2890bf){return new BPromise(function(_0x319795,_0xe6e4b9){return client[_0xd7a2('0x11')](_0x104013,_0x2890bf)[_0xd7a2('0x12')](function(_0x358c39){logger[_0xd7a2('0x13')]('ChatGroup,\x20%s,\x20%s',_0x503b42,'request\x20sent');logger[_0xd7a2('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x503b42,_0xd7a2('0x15'),JSON[_0xd7a2('0x16')](_0x358c39));if(_0x358c39[_0xd7a2('0x17')]){if(_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x18')]===0x1f4){logger[_0xd7a2('0x17')](_0xd7a2('0x19'),_0x503b42,_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x1a')]);return _0xe6e4b9(_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x1a')]);}logger['error'](_0xd7a2('0x19'),_0x503b42,_0x358c39['error']['message']);return _0x319795(_0x358c39[_0xd7a2('0x17')][_0xd7a2('0x1a')]);}else{logger[_0xd7a2('0x13')](_0xd7a2('0x19'),_0x503b42,_0xd7a2('0x15'));_0x319795(_0x358c39[_0xd7a2('0x1b')]['message']);}})['catch'](function(_0x436fff){logger[_0xd7a2('0x17')](_0xd7a2('0x19'),_0x503b42,_0x436fff);_0xe6e4b9(_0x436fff);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 8ce5f6a..9ecec1b 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 _0x5d83=['chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1a9c97,_0xe7144a){var _0x43f8d4=function(_0x10710a){while(--_0x10710a){_0x1a9c97['push'](_0x1a9c97['shift']());}};_0x43f8d4(++_0xe7144a);}(_0x5d83,0x12a));var _0x35d8=function(_0x48bee1,_0x29f43d){_0x48bee1=_0x48bee1-0x0;var _0x582372=_0x5d83[_0x48bee1];return _0x582372;};'use strict';var ChatGroupEvents=require(_0x35d8('0x0'));var events=[_0x35d8('0x1'),_0x35d8('0x2'),_0x35d8('0x3')];function createListener(_0x2dfab1,_0xd719ba){return function(_0x2e407f){_0xd719ba[_0x35d8('0x4')](_0x2dfab1,_0x2e407f);};}function removeListener(_0x45f923,_0xcfdff3){return function(){ChatGroupEvents[_0x35d8('0x5')](_0x45f923,_0xcfdff3);};}exports[_0x35d8('0x6')]=function(_0x228d80){for(var _0x28e47f=0x0,_0x5bcd3a=events[_0x35d8('0x7')];_0x28e47f<_0x5bcd3a;_0x28e47f++){var _0x1c0034=events[_0x28e47f];var _0x5593a6=createListener(_0x35d8('0x8')+_0x1c0034,_0x228d80);ChatGroupEvents['on'](_0x1c0034,_0x5593a6);}};
\ No newline at end of file
+var _0xbcc7=['removeListener','register','length','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x6fcb25,_0xcf4055){var _0x49d670=function(_0x5f0741){while(--_0x5f0741){_0x6fcb25['push'](_0x6fcb25['shift']());}};_0x49d670(++_0xcf4055);}(_0xbcc7,0x114));var _0x7bcc=function(_0x395628,_0x56f435){_0x395628=_0x395628-0x0;var _0x248908=_0xbcc7[_0x395628];return _0x248908;};'use strict';var ChatGroupEvents=require(_0x7bcc('0x0'));var events=[_0x7bcc('0x1'),'remove',_0x7bcc('0x2')];function createListener(_0x5dd84c,_0x8a98e1){return function(_0x3f8aa5){_0x8a98e1[_0x7bcc('0x3')](_0x5dd84c,_0x3f8aa5);};}function removeListener(_0x556f9c,_0x20d537){return function(){ChatGroupEvents[_0x7bcc('0x4')](_0x556f9c,_0x20d537);};}exports[_0x7bcc('0x5')]=function(_0x31ba37){for(var _0x1a6a4f=0x0,_0xadb8c6=events[_0x7bcc('0x6')];_0x1a6a4f<_0xadb8c6;_0x1a6a4f++){var _0x2e4678=events[_0x1a6a4f];var _0x1e88f7=createListener(_0x7bcc('0x7')+_0x2e4678,_0x31ba37);ChatGroupEvents['on'](_0x2e4678,_0x1e88f7);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 48c4706..aee68cd 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 _0x14f9=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','delete','destroy','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x14f9,0x194));var _0x914f=function(_0xedbf11,_0x582f4f){_0xedbf11=_0xedbf11-0x0;var _0x55ab30=_0x14f9[_0xedbf11];return _0x55ab30;};'use strict';var multer=require(_0x914f('0x0'));var util=require(_0x914f('0x1'));var path=require(_0x914f('0x2'));var timeout=require('connect-timeout');var express=require(_0x914f('0x3'));var router=express[_0x914f('0x4')]();var fs_extra=require(_0x914f('0x5'));var auth=require(_0x914f('0x6'));var interaction=require(_0x914f('0x7'));var config=require(_0x914f('0x8'));var controller=require(_0x914f('0x9'));router[_0x914f('0xa')]('/',auth[_0x914f('0xb')](),controller[_0x914f('0xc')]);router['get'](_0x914f('0xd'),auth[_0x914f('0xb')](),controller[_0x914f('0xe')]);router[_0x914f('0xa')](_0x914f('0xf'),auth[_0x914f('0xb')](),controller[_0x914f('0x10')]);router[_0x914f('0xa')](_0x914f('0x11'),auth[_0x914f('0xb')](),controller[_0x914f('0x12')]);router[_0x914f('0xa')](_0x914f('0x13'),auth[_0x914f('0xb')](),controller['getMembers']);router[_0x914f('0xa')](_0x914f('0x14'),auth[_0x914f('0xb')](),controller[_0x914f('0x15')]);router[_0x914f('0x16')]('/',auth[_0x914f('0xb')](),controller[_0x914f('0x17')]);router[_0x914f('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0x914f('0x18')]);router[_0x914f('0x16')](_0x914f('0x14'),auth['isAuthenticated'](),controller[_0x914f('0x19')]);router['put'](_0x914f('0xf'),auth[_0x914f('0xb')](),controller['update']);router[_0x914f('0x1a')]('/:id',auth[_0x914f('0xb')](),controller[_0x914f('0x1b')]);router['delete']('/:id/members',auth[_0x914f('0xb')](),controller[_0x914f('0x1c')]);module[_0x914f('0x1d')]=router;
\ No newline at end of file
+var _0xaf59=['delete','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','addMessage','destroy'];(function(_0x320004,_0xfd3b7b){var _0x3bc6c7=function(_0x28c75a){while(--_0x28c75a){_0x320004['push'](_0x320004['shift']());}};_0x3bc6c7(++_0xfd3b7b);}(_0xaf59,0x153));var _0x9af5=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xaf59[_0x263f4c];return _0x3a78d3;};'use strict';var multer=require(_0x9af5('0x0'));var util=require(_0x9af5('0x1'));var path=require('path');var timeout=require(_0x9af5('0x2'));var express=require(_0x9af5('0x3'));var router=express[_0x9af5('0x4')]();var fs_extra=require(_0x9af5('0x5'));var auth=require(_0x9af5('0x6'));var interaction=require(_0x9af5('0x7'));var config=require(_0x9af5('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x9af5('0x9')](),controller[_0x9af5('0xa')]);router[_0x9af5('0xb')](_0x9af5('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9af5('0xb')](_0x9af5('0xd'),auth['isAuthenticated'](),controller[_0x9af5('0xe')]);router[_0x9af5('0xb')](_0x9af5('0xf'),auth[_0x9af5('0x9')](),controller[_0x9af5('0x10')]);router[_0x9af5('0xb')](_0x9af5('0x11'),auth['isAuthenticated'](),controller[_0x9af5('0x12')]);router[_0x9af5('0xb')](_0x9af5('0x13'),auth[_0x9af5('0x9')](),controller['getMessages']);router['post']('/',auth[_0x9af5('0x9')](),controller[_0x9af5('0x14')]);router[_0x9af5('0x15')]('/:id/members',auth[_0x9af5('0x9')](),controller[_0x9af5('0x16')]);router[_0x9af5('0x15')](_0x9af5('0x13'),auth[_0x9af5('0x9')](),controller[_0x9af5('0x17')]);router['put'](_0x9af5('0xd'),auth[_0x9af5('0x9')](),controller['update']);router['delete']('/:id',auth[_0x9af5('0x9')](),controller[_0x9af5('0x18')]);router[_0x9af5('0x19')]('/:id/members',auth['isAuthenticated'](),controller[_0x9af5('0x1a')]);module[_0x9af5('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 6d5de1e..ce0f9a6 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 _0x83f2=['long','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','STRING','TEXT'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x83f2,0x184));var _0x283f=function(_0x2bef52,_0x29bfb0){_0x2bef52=_0x2bef52-0x0;var _0x2715b1=_0x83f2[_0x2bef52];return _0x2715b1;};'use strict';var Sequelize=require('sequelize');module[_0x283f('0x0')]={'closed':{'type':Sequelize[_0x283f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x283f('0x2')]},'ratingType':{'type':Sequelize[_0x283f('0x3')](_0x283f('0x4'),_0x283f('0x5')),'defaultValue':_0x283f('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x283f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x283f('0x6')]},'secondDisposition':{'type':Sequelize[_0x283f('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x283f('0x6')]},'browserName':{'type':Sequelize[_0x283f('0x6')]},'browserVersion':{'type':Sequelize[_0x283f('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x283f('0x6')]},'deviceModel':{'type':Sequelize[_0x283f('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x283f('0x6')]},'referer':{'type':Sequelize[_0x283f('0x7')]},'customerIp':{'type':Sequelize[_0x283f('0x6')]},'formData':{'type':Sequelize[_0x283f('0x7')](_0x283f('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x283f('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x283f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x283f('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x283f('0x2')]}};
\ No newline at end of file
+var _0x3a42=['BOOLEAN','INTEGER','thumb','star','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3a42,0x148));var _0x23a4=function(_0x261d18,_0x13490f){_0x261d18=_0x261d18-0x0;var _0x3e7208=_0x3a42[_0x261d18];return _0x3e7208;};'use strict';var Sequelize=require(_0x23a4('0x0'));module[_0x23a4('0x1')]={'closed':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x23a4('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x23a4('0x4')),'defaultValue':_0x23a4('0x5')},'ratingMessage':{'type':Sequelize[_0x23a4('0x6')]},'pathTranscript':{'type':Sequelize[_0x23a4('0x6')]},'mailTranscript':{'type':Sequelize[_0x23a4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x23a4('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x23a4('0x7')]},'thirdDisposition':{'type':Sequelize[_0x23a4('0x7')]},'note':{'type':Sequelize[_0x23a4('0x7')]},'browserName':{'type':Sequelize[_0x23a4('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x23a4('0x7')]},'osVersion':{'type':Sequelize[_0x23a4('0x7')]},'deviceModel':{'type':Sequelize[_0x23a4('0x7')]},'deviceVendor':{'type':Sequelize[_0x23a4('0x7')]},'deviceType':{'type':Sequelize[_0x23a4('0x7')]},'referer':{'type':Sequelize[_0x23a4('0x6')]},'customerIp':{'type':Sequelize[_0x23a4('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x23a4('0x9'))},'read1stAt':{'type':Sequelize[_0x23a4('0x8')]},'lastMsgAt':{'type':Sequelize[_0x23a4('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x23a4('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x23a4('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x23a4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x23a4('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index e291466..7de5fc3 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 _0xcc81=['tail','existsSync','pipe','createWriteStream','lastName','renderFile','transcript-','createPdfFromHTML','rimraf','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','destroy','stack','name','render','merge','body','contact','agent','interaction','account','index','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','chat','user','catch','params','model','keys','query','filters','intersection','attributes','fields','include','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooNote','vidaooMetadata','vidaooApiKey','email','vidaooTopic','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','customUpdate','CmContact','Contact','abandon','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','format','now','pathTranscript','Messages','ChatWebsiteId','%s%d','System','Visitor','ContactId','agentIdentifier','agent_alias','User','alias','fullname','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','count','includeAll','findAll','getMyMessages','order','ChatInteractionId','map','includeAgent','rows','addTags','setTags','spread','color','emit','chatInteractionTags:save','download','toString','server','files','tmp','transcript-%d-%s.zip','push','firstName','createdAt','read','Account','Owner','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','browserName','osName','referer','customerIp','customerPort'];(function(_0x2f177c,_0x3717bb){var _0x7c655a=function(_0x5f32ca){while(--_0x5f32ca){_0x2f177c['push'](_0x2f177c['shift']());}};_0x7c655a(++_0x3717bb);}(_0xcc81,0x19c));var _0x1cc8=function(_0x242566,_0x4ec88d){_0x242566=_0x242566-0x0;var _0x1bc410=_0xcc81[_0x242566];return _0x1bc410;};'use strict';var rimraf=require(_0x1cc8('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require(_0x1cc8('0x1'));var BPromise=require(_0x1cc8('0x2'));var Mustache=require(_0x1cc8('0x3'));var util=require(_0x1cc8('0x4'));var path=require(_0x1cc8('0x5'));var ejs=require(_0x1cc8('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x1cc8('0x7'));var interaction=require(_0x1cc8('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x1cc8('0x9'));var logger=require(_0x1cc8('0xa'))(_0x1cc8('0xb'));var config=require(_0x1cc8('0xc'));var db=require(_0x1cc8('0xd'))['db'];config[_0x1cc8('0xe')]=_[_0x1cc8('0xf')](config[_0x1cc8('0xe')],{'host':_0x1cc8('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cc8('0xe')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1cc8('0x11')][_0x1cc8('0x12')]({'port':0x232b});var client9004=jayson['client'][_0x1cc8('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x553f1f,_0x378edc,_0x5885d9,_0x5eba59){return new BPromise(function(_0x4d9126,_0x1aeafb){var _0x4a1bef=_0x5eba59||client;return _0x4a1bef[_0x1cc8('0x13')](_0x553f1f,_0x5885d9)[_0x1cc8('0x14')](function(_0x4905c1){logger[_0x1cc8('0x15')](_0x1cc8('0x16'),_0x378edc,_0x1cc8('0x17'));logger[_0x1cc8('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x378edc,_0x1cc8('0x17'),JSON[_0x1cc8('0x19')](_0x4905c1));if(_0x4905c1[_0x1cc8('0x1a')]){if(_0x4905c1[_0x1cc8('0x1a')][_0x1cc8('0x1b')]===0x1f4){logger[_0x1cc8('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x378edc,_0x4905c1[_0x1cc8('0x1a')][_0x1cc8('0x1c')]);return _0x1aeafb(_0x4905c1['error'][_0x1cc8('0x1c')]);}logger[_0x1cc8('0x1a')](_0x1cc8('0x16'),_0x378edc,_0x4905c1['error'][_0x1cc8('0x1c')]);return _0x4d9126(_0x4905c1[_0x1cc8('0x1a')][_0x1cc8('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x378edc,_0x1cc8('0x17'));_0x4d9126(_0x4905c1[_0x1cc8('0x1d')][_0x1cc8('0x1c')]);}})['catch'](function(_0x33977e){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x378edc,_0x33977e);_0x1aeafb(_0x33977e);});});}function respondWithStatusCode(_0x4f58f3,_0x401be0){_0x401be0=_0x401be0||0xcc;return function(_0x3bf0c3){if(_0x3bf0c3){return _0x4f58f3[_0x1cc8('0x1e')](_0x401be0);}return _0x4f58f3[_0x1cc8('0x1f')](_0x401be0)[_0x1cc8('0x20')]();};}function respondWithResult(_0x1892bd,_0x1ea6ab){_0x1ea6ab=_0x1ea6ab||0xc8;return function(_0x1fff8b){if(_0x1fff8b){return _0x1892bd[_0x1cc8('0x1f')](_0x1ea6ab)[_0x1cc8('0x21')](_0x1fff8b);}};}function respondWithFilteredResult(_0x51b8f3,_0x1d89ab){return function(_0x28ba0d){if(_0x28ba0d){var _0x366de2=typeof _0x1d89ab[_0x1cc8('0x22')]===_0x1cc8('0x23')&&typeof _0x1d89ab[_0x1cc8('0x24')]===_0x1cc8('0x23');var _0x29e834=_0x28ba0d['count'];var _0x1185d2=_0x366de2?0x0:_0x1d89ab['offset'];var _0x3f7d75=_0x366de2?_0x28ba0d['count']:_0x1d89ab[_0x1cc8('0x22')]+_0x1d89ab[_0x1cc8('0x24')];var _0x3ec068;if(_0x3f7d75>=_0x29e834){_0x3f7d75=_0x29e834;_0x3ec068=0xc8;}else{_0x3ec068=0xce;}_0x51b8f3[_0x1cc8('0x1f')](_0x3ec068);return _0x51b8f3[_0x1cc8('0x25')](_0x1cc8('0x26'),_0x1185d2+'-'+_0x3f7d75+'/'+_0x29e834)['json'](_0x28ba0d);}return null;};}function saveUpdates(_0x5b7857){return function(_0x28846a){if(_0x28846a){return _0x28846a['update'](_0x5b7857)[_0x1cc8('0x14')](function(_0x2c6af0){return _0x2c6af0;});}return null;};}function removeEntity(_0x31f7c4){return function(_0x3f56c7){if(_0x3f56c7){return _0x3f56c7[_0x1cc8('0x27')]()[_0x1cc8('0x14')](function(){_0x31f7c4[_0x1cc8('0x1f')](0xcc)[_0x1cc8('0x20')]();});}};}function handleEntityNotFound(_0x33addb){return function(_0x32a80d){if(!_0x32a80d){_0x33addb['sendStatus'](0x194);}return _0x32a80d;};}function handleError(_0x16dd52,_0x2a5f11){_0x2a5f11=_0x2a5f11||0x1f4;return function(_0x2ccdf9){logger[_0x1cc8('0x1a')](_0x2ccdf9[_0x1cc8('0x28')]);if(_0x2ccdf9['name']){delete _0x2ccdf9[_0x1cc8('0x29')];}_0x16dd52[_0x1cc8('0x1f')](_0x2a5f11)['send'](_0x2ccdf9);};}function getMustacheRender(_0x54c350,_0xf2e326){return Mustache[_0x1cc8('0x2a')](_0x54c350,_[_0x1cc8('0x2b')](_0xf2e326[_0x1cc8('0x2c')],{'contact':_0xf2e326[_0x1cc8('0x2d')],'message':_0xf2e326[_0x1cc8('0x1c')],'agent':_0xf2e326[_0x1cc8('0x2e')],'interaction':_0xf2e326[_0x1cc8('0x2f')],'account':_0xf2e326[_0x1cc8('0x30')]}))||'';}exports[_0x1cc8('0x31')]=function(_0x216ca4,_0x4c613f){var _0x179e5c={};var _0x247920=_['map'](db[_0x1cc8('0x32')][_0x1cc8('0x33')],function(_0xf3c75){return{'name':_0xf3c75[_0x1cc8('0x34')],'type':_0xf3c75[_0x1cc8('0x35')][_0x1cc8('0x36')]};});_0x179e5c=qs[_0x1cc8('0x37')](_0x247920,_0x216ca4);return interaction['findAll'](_0x1cc8('0x38'),_0x216ca4['query'],_0x216ca4[_0x1cc8('0x39')],_0x179e5c,_0x247920)['then'](respondWithFilteredResult(_0x4c613f,_0x179e5c))[_0x1cc8('0x3a')](handleError(_0x4c613f,null));};exports['show']=function(_0xf98c1d,_0x300b02){var _0x244efe={'raw':![],'where':{'id':_0xf98c1d[_0x1cc8('0x3b')]['id']}},_0x15b6cc={};_0x15b6cc[_0x1cc8('0x3c')]=_[_0x1cc8('0x3d')](db['ChatInteraction'][_0x1cc8('0x33')]);_0x15b6cc[_0x1cc8('0x3e')]=_['keys'](_0xf98c1d[_0x1cc8('0x3e')]);_0x15b6cc[_0x1cc8('0x3f')]=_[_0x1cc8('0x40')](_0x15b6cc['model'],_0x15b6cc[_0x1cc8('0x3e')]);_0x244efe[_0x1cc8('0x41')]=_[_0x1cc8('0x40')](_0x15b6cc['model'],qs['fields'](_0xf98c1d['query'][_0x1cc8('0x42')]));_0x244efe['attributes']=_0x244efe[_0x1cc8('0x41')]['length']?_0x244efe[_0x1cc8('0x41')]:_0x15b6cc[_0x1cc8('0x3c')];if(_0xf98c1d[_0x1cc8('0x3e')]['includeAll']){_0x244efe[_0x1cc8('0x43')]=[{'all':!![]}];}_0x244efe=_['merge']({},_0x244efe,_0xf98c1d[_0x1cc8('0x44')]);return db[_0x1cc8('0x32')][_0x1cc8('0x45')](_0x244efe)[_0x1cc8('0x14')](handleEntityNotFound(_0x300b02,null))[_0x1cc8('0x14')](respondWithResult(_0x300b02,null))[_0x1cc8('0x3a')](handleError(_0x300b02,null));};exports[_0x1cc8('0x46')]=function(_0x20b2e1,_0x3eb52e){return db[_0x1cc8('0x32')]['create'](_0x20b2e1['body'],{})[_0x1cc8('0x14')](respondWithResult(_0x3eb52e,0xc9))[_0x1cc8('0x3a')](handleError(_0x3eb52e,null));};exports[_0x1cc8('0x47')]=function(_0x24d55c,_0x5b88de){if(_0x24d55c[_0x1cc8('0x2c')]['id']){delete _0x24d55c[_0x1cc8('0x2c')]['id'];}return db['ChatInteraction'][_0x1cc8('0x45')]({'where':{'id':_0x24d55c[_0x1cc8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5b88de,null))[_0x1cc8('0x14')](saveUpdates(_0x24d55c[_0x1cc8('0x2c')],null))[_0x1cc8('0x14')](respondWithResult(_0x5b88de,null))[_0x1cc8('0x3a')](handleError(_0x5b88de,null));};exports[_0x1cc8('0x27')]=function(_0xbedfd7,_0x15d7df){return db[_0x1cc8('0x32')]['find']({'where':{'id':_0xbedfd7[_0x1cc8('0x3b')]['id']}})[_0x1cc8('0x14')](handleEntityNotFound(_0x15d7df,null))[_0x1cc8('0x14')](removeEntity(_0x15d7df,null))[_0x1cc8('0x3a')](handleError(_0x15d7df,null));};exports[_0x1cc8('0x48')]=function(_0x2e766f,_0x572996){return db[_0x1cc8('0x32')][_0x1cc8('0x48')]()[_0x1cc8('0x14')](respondWithResult(_0x572996,null))['catch'](handleError(_0x572996,null));};exports[_0x1cc8('0x49')]=function(_0x29e2e1,_0x18624a){var _0x5a5e54=_0x29e2e1[_0x1cc8('0x3b')]['id'];var _0x263a08;var _0x232f22;var _0x268706;return db[_0x1cc8('0x32')][_0x1cc8('0x4a')]({'where':{'id':_0x5a5e54}})[_0x1cc8('0x14')](function(_0x4010f1){_0x263a08=_0x4010f1;return db[_0x1cc8('0x4b')][_0x1cc8('0x4a')]({'where':{'id':_0x4010f1['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1cc8('0x4c'),'vidaooTopic',_0x1cc8('0x4d'),_0x1cc8('0x4e')],'raw':!![]});})[_0x1cc8('0x14')](function(_0x23fc59){if(_0x23fc59&&_0x23fc59[_0x1cc8('0x4f')]&&_0x23fc59['vidaooEscalation']){_0x232f22=_0x23fc59;var _0xb981b1={'interaction':{'id':_0x5a5e54},'agent':{'id':_0x29e2e1[_0x1cc8('0x39')]['id'],'name':_0x29e2e1[_0x1cc8('0x39')][_0x1cc8('0x29')],'fullname':_0x29e2e1[_0x1cc8('0x39')]['fullname'],'email':_0x29e2e1[_0x1cc8('0x39')][_0x1cc8('0x50')]},'contact':_0x29e2e1[_0x1cc8('0x2c')]['contact'],'account':_0x29e2e1[_0x1cc8('0x2c')][_0x1cc8('0x30')]};var _0x577121={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x23fc59[_0x1cc8('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x29e2e1['user'][_0x1cc8('0x50')]],'buttons':null,'topic':_0x232f22[_0x1cc8('0x51')],'note':_[_0x1cc8('0x52')](_0x232f22[_0x1cc8('0x4d')])?null:getMustacheRender(_0x232f22['vidaooNote'],_0xb981b1),'metadata':null},'redirect':_0x1cc8('0x53'),'json':!![]};try{if(!_[_0x1cc8('0x52')](_0x232f22[_0x1cc8('0x4e')])){var _0x12f1a7=getMustacheRender(_0x232f22[_0x1cc8('0x4e')],_0xb981b1);var _0xe47bc8=JSON[_0x1cc8('0x54')](_0x12f1a7);_0x577121['body'][_0x1cc8('0x55')]=_0xe47bc8;}}catch(_0x442821){throw new db[(_0x1cc8('0x56'))]['ValidationError'](_0x1cc8('0x57'));}return rp(_0x577121);}else{throw new db[(_0x1cc8('0x56'))]['ValidationError'](_0x1cc8('0x58'));}})[_0x1cc8('0x14')](function(_0x4ee36d){_0x268706=_0x4ee36d;if(_0x268706['id']){var _0x7c3130={'body':_0x268706[_0x1cc8('0x59')],'ChatWebsiteId':_0x232f22['id'],'ChatInteractionId':_0x263a08['id'],'direction':_0x1cc8('0x5a'),'UserId':_0x29e2e1[_0x1cc8('0x39')]['id']};return db[_0x1cc8('0x5b')][_0x1cc8('0x46')](_0x7c3130,{});}else{throw new db[(_0x1cc8('0x56'))][(_0x1cc8('0x5c'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x263a08['updateAttributes']({'vidaooSessionId':_0x268706['id']});})['then'](respondWithResult(_0x18624a,null))[_0x1cc8('0x3a')](handleError(_0x18624a,null));};exports[_0x1cc8('0x5d')]=function(_0x132a39,_0x4ff23d){if(_0x132a39[_0x1cc8('0x2c')]['id']){delete _0x132a39[_0x1cc8('0x2c')]['id'];}return db['ChatInteraction'][_0x1cc8('0x45')]({'where':{'id':_0x132a39['params']['id']},'include':[{'model':db[_0x1cc8('0x5e')],'as':_0x1cc8('0x5f')}]})['then'](handleEntityNotFound(_0x4ff23d,null))[_0x1cc8('0x14')](saveUpdates(_0x132a39[_0x1cc8('0x2c')],null))['then'](respondWithResult(_0x4ff23d,null))[_0x1cc8('0x3a')](handleError(_0x4ff23d,null));};exports[_0x1cc8('0x60')]=function(_0x9310f3,_0x31b945){if(_0x9310f3[_0x1cc8('0x2c')]['id']){delete _0x9310f3[_0x1cc8('0x2c')]['id'];}return db[_0x1cc8('0x32')]['find']({'where':{'id':_0x9310f3[_0x1cc8('0x3b')]['id']}})[_0x1cc8('0x14')](function(_0x120a44){if(!_0x120a44){logger[_0x1cc8('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x1cc8('0x60'),0x194,'entity\x20not\x20found');_0x31b945[_0x1cc8('0x1e')](0x194);}else{if(_0x120a44[_0x1cc8('0x61')]){throw new db[(_0x1cc8('0x56'))][(_0x1cc8('0x5c'))](_0x1cc8('0x62'));}}return _0x120a44;})[_0x1cc8('0x14')](function(_0x5e7fcb){if(_0x5e7fcb){return _0x5e7fcb['update']({'closed':_0x9310f3[_0x1cc8('0x2c')][_0x1cc8('0x63')],'disposition':_0x9310f3[_0x1cc8('0x2c')]['disposition']})[_0x1cc8('0x14')](function(_0xc5006b){return _0xc5006b;});}})['then'](function(){return respondWithRpcPromise(_0x1cc8('0x64'),_0x1cc8('0x60'),_0x9310f3[_0x1cc8('0x2c')],client9004);})[_0x1cc8('0x14')](respondWithResult(_0x31b945,null))[_0x1cc8('0x3a')](handleError(_0x31b945,null));};exports[_0x1cc8('0x65')]=function(_0x252163,_0xd7bb6c){_0x252163['body'][_0x1cc8('0x29')]=_0x252163['file'][_0x1cc8('0x66')];_0x252163[_0x1cc8('0x2c')]['basename']=_0x252163[_0x1cc8('0x67')][_0x1cc8('0x68')];_0x252163[_0x1cc8('0x2c')][_0x1cc8('0x35')]=_0x252163[_0x1cc8('0x67')][_0x1cc8('0x69')];return db[_0x1cc8('0x6a')][_0x1cc8('0x46')](_0x252163['body'])[_0x1cc8('0x14')](respondWithResult(_0xd7bb6c,0xc9))[_0x1cc8('0x3a')](handleError(_0xd7bb6c,null));};exports['attachmentDownload']=function(_0x4f114b,_0x41127d){return db[_0x1cc8('0x32')]['findOne']({'where':{'id':_0x4f114b[_0x1cc8('0x3b')]['id']},'raw':!![]})[_0x1cc8('0x14')](handleEntityNotFound(_0x41127d,null))['then'](function(_0xc5ff4c){if(_0xc5ff4c){if(_0xc5ff4c[_0x1cc8('0x63')]){return _0x41127d[_0x1cc8('0x1f')](0x193)[_0x1cc8('0x21')]({'status':0x193,'message':_0x1cc8('0x6b')});}return db[_0x1cc8('0x6a')][_0x1cc8('0x4a')]({'where':{'id':_0x4f114b['query'][_0x1cc8('0x6c')]},'raw':!![]})[_0x1cc8('0x14')](handleEntityNotFound(_0x41127d,null));}})['then'](function(_0x2329f9){if(_0x2329f9){var _0x4d2092=_0x2329f9[_0x1cc8('0x6d')]!==null;var _0x36d828=path[_0x1cc8('0x6e')](config[_0x1cc8('0x6f')],_0x1cc8('0x70'));if(_0x4d2092){_0x36d828=path['join'](_0x36d828,'offline-chat/');}var _0x2ba43d=path['join'](_0x36d828,_0x2329f9[_0x1cc8('0x71')]);return _0x41127d['download'](_0x2ba43d);}})[_0x1cc8('0x3a')](handleError(_0x41127d,null));};exports['close']=function(_0x28bf53,_0x4db1d2){var _0x3c4bad=null;var _0x5d33e9=null;var _0x5ec547=null;if(_0x28bf53[_0x1cc8('0x2c')]['id']){delete _0x28bf53['body']['id'];}if(_0x28bf53[_0x1cc8('0x2c')]['mailTranscript']){_0x5ec547=path[_0x1cc8('0x6e')](config['root'],'server/files/chat/upload/',util[_0x1cc8('0x72')]('transcript-%s.txt',Date[_0x1cc8('0x73')]()));_0x28bf53[_0x1cc8('0x2c')][_0x1cc8('0x74')]=_0x5ec547;}return db[_0x1cc8('0x32')][_0x1cc8('0x45')]({'where':{'id':_0x28bf53[_0x1cc8('0x3b')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x1cc8('0x75'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x1cc8('0x14')](handleEntityNotFound(_0x4db1d2,null))[_0x1cc8('0x14')](saveUpdates(_0x28bf53['body'],null))[_0x1cc8('0x14')](function(_0x2a0a62){if(_0x2a0a62){_0x3c4bad=_0x2a0a62;return db[_0x1cc8('0x4b')][_0x1cc8('0x45')]({'where':{'id':_0x3c4bad[_0x1cc8('0x76')]}});}})[_0x1cc8('0x14')](function(_0x1d5dd3){if(_0x1d5dd3){_0x5d33e9=_0x1d5dd3;return db[_0x1cc8('0x5e')][_0x1cc8('0x45')]({'where':{'id':_0x3c4bad['ContactId']}});}})[_0x1cc8('0x14')](function(_0xff258d){if(_0xff258d){if(_0x5ec547){var _0x1bf0bc=null;for(var _0x32d2e1=0x1;_0x32d2e1<_0x3c4bad[_0x1cc8('0x75')]['length'];++_0x32d2e1){_0x1bf0bc=_0x3c4bad['Messages'][_0x32d2e1];var _0x5a274c=_0x1bf0bc['UserId']?util[_0x1cc8('0x72')](_0x1cc8('0x77'),_0x5d33e9['agentAlias'],_0x1bf0bc['UserId']):_0x1cc8('0x78');var _0x2aed2a=_0x28bf53[_0x1cc8('0x2c')]['customer']||util[_0x1cc8('0x72')](_0x1cc8('0x77'),_0x1cc8('0x79'),_0x1bf0bc[_0x1cc8('0x7a')]);switch(_0x5d33e9[_0x1cc8('0x7b')]){case'website_alias':_0x5a274c=_0x1bf0bc[_0x1cc8('0x61')]?util[_0x1cc8('0x72')]('%s%d',_0x5d33e9['agentAlias'],_0x1bf0bc['UserId']):_0x1cc8('0x78');break;case _0x1cc8('0x7c'):_0x5a274c=_0x1bf0bc[_0x1cc8('0x61')]?_0x1bf0bc[_0x1cc8('0x7d')][_0x1cc8('0x7e')]||_0x1bf0bc['User'][_0x1cc8('0x7f')]:_0x1cc8('0x78');break;case _0x1cc8('0x80'):_0x5a274c=_0x1bf0bc['UserId']?_0x1bf0bc[_0x1cc8('0x7d')][_0x1cc8('0x7f')]:'System';break;default:_0x5a274c=_0x1bf0bc[_0x1cc8('0x61')]?util[_0x1cc8('0x72')](_0x1cc8('0x77'),_0x5d33e9[_0x1cc8('0x81')],_0x1bf0bc[_0x1cc8('0x61')]):_0x1cc8('0x78');}var _0x380b92=util['format'](_0x1cc8('0x82'),moment(_0x1bf0bc['createdAt'])['format'](_0x1cc8('0x83')),_0x1bf0bc[_0x1cc8('0x84')]==='in'?_0x2aed2a:_0x5a274c,_0x1bf0bc[_0x1cc8('0x2c')]);if(!_0x1bf0bc[_0x1cc8('0x85')]){fs[_0x1cc8('0x86')](_0x5ec547,_0x380b92);}}return db['MailAccount'][_0x1cc8('0x4a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1cc8('0x87'),'raw':!![],'include':[{'model':db[_0x1cc8('0x88')],'as':_0x1cc8('0x88'),'raw':!![]}]}]});}}})[_0x1cc8('0x14')](function(_0x1aee1c){if(!_0x1aee1c||!_0x1aee1c[_0x1cc8('0x87')]||!_0x28bf53[_0x1cc8('0x2c')])return _0x3c4bad;var _0x55e74b=_0x1aee1c[_0x1cc8('0x89')]();return respondWithRpcPromise(_0x1cc8('0x8a'),_0x1cc8('0x8b'),{'account':_0x55e74b,'message':{'from':util['format'](_0x1cc8('0x8c'),_0x1aee1c[_0x1cc8('0x29')],_0x1aee1c[_0x1cc8('0x50')]||_0x1aee1c[_0x1cc8('0x87')][_0x1cc8('0x39')]),'to':_0x28bf53['body'][_0x1cc8('0x8d')],'subject':_0x1cc8('0x8e'),'text':util['format'](_0x1cc8('0x8f'),_0x28bf53[_0x1cc8('0x2c')][_0x1cc8('0x8d')]),'attachments':[{'path':_0x5ec547}]}})['then'](function(){return _0x3c4bad;})[_0x1cc8('0x3a')](function(_0x5a74f2){logger[_0x1cc8('0x1a')](_0x5a74f2);});})['then'](respondWithStatusCode(_0x4db1d2,0xc8))['catch'](handleError(_0x4db1d2,null));};exports[_0x1cc8('0x90')]=function(_0x3e6d40,_0x4cb3e5){return db[_0x1cc8('0x5b')][_0x1cc8('0x45')]({'where':{'id':_0x3e6d40['params']['id']}})['then'](handleEntityNotFound(_0x4cb3e5,null))[_0x1cc8('0x14')](function(_0x496b2f){if(_0x496b2f){return _0x496b2f['addMessage'](_0x3e6d40[_0x1cc8('0x2c')][_0x1cc8('0x91')],_[_0x1cc8('0x92')](_0x3e6d40[_0x1cc8('0x2c')],[_0x1cc8('0x91'),'id'])||{});}})[_0x1cc8('0x14')](respondWithResult(_0x4cb3e5,null))[_0x1cc8('0x3a')](handleError(_0x4cb3e5,null));};exports[_0x1cc8('0x93')]=function(_0x36c6eb,_0x50f043){var _0x4f61b1={'raw':![],'where':{}};var _0x133b9d={};var _0x759a2b={'count':0x0,'rows':[]};return db[_0x1cc8('0x32')][_0x1cc8('0x4a')]({'where':{'id':_0x36c6eb[_0x1cc8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x50f043,null))['then'](function(_0xa74a96){if(_0xa74a96){_0x133b9d[_0x1cc8('0x3c')]=_[_0x1cc8('0x3d')](db[_0x1cc8('0x5b')][_0x1cc8('0x33')]);_0x133b9d[_0x1cc8('0x3e')]=_[_0x1cc8('0x3d')](_0x36c6eb[_0x1cc8('0x3e')]);_0x133b9d['filters']=_['intersection'](_0x133b9d[_0x1cc8('0x3c')],_0x133b9d[_0x1cc8('0x3e')]);_0x4f61b1[_0x1cc8('0x41')]=_[_0x1cc8('0x40')](_0x133b9d['model'],qs[_0x1cc8('0x42')](_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x42')]));_0x4f61b1[_0x1cc8('0x41')]=_0x4f61b1[_0x1cc8('0x41')][_0x1cc8('0x94')]?_0x4f61b1[_0x1cc8('0x41')]:_0x133b9d[_0x1cc8('0x3c')];if(!_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x95')](_0x1cc8('0x96'))){_0x4f61b1[_0x1cc8('0x24')]=qs['limit'](_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x24')]);_0x4f61b1[_0x1cc8('0x22')]=qs[_0x1cc8('0x22')](_0x36c6eb['query'][_0x1cc8('0x22')]);}_0x4f61b1['order']=qs['sort'](_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x97')]);_0x4f61b1[_0x1cc8('0x98')]=qs[_0x1cc8('0x3f')](_[_0x1cc8('0x99')](_0x36c6eb[_0x1cc8('0x3e')],_0x133b9d[_0x1cc8('0x3f')]));_0x4f61b1[_0x1cc8('0x98')]['ChatInteractionId']=_0xa74a96['id'];if(_0x36c6eb['query'][_0x1cc8('0x9a')]){_0x4f61b1[_0x1cc8('0x98')]=_['merge'](_0x4f61b1[_0x1cc8('0x98')],{'$or':_['map'](_0x4f61b1[_0x1cc8('0x41')],function(_0x444a7b){var _0x447cb7={};_0x447cb7[_0x444a7b]={'$like':'%'+_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x9a')]+'%'};return _0x447cb7;})});}if(_0x36c6eb['query'][_0x1cc8('0x9b')]){var _0x29b3c1=_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x9b')]['split'](',');var _0x388357={};_0x388357[_0x29b3c1[0x0]]={'$gte':moment(_0x29b3c1[0x1])[_0x1cc8('0x72')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4f61b1[_0x1cc8('0x98')]=_[_0x1cc8('0x2b')](_0x4f61b1['where'],_0x388357);}_0x4f61b1=_['merge']({},_0x4f61b1,_0x36c6eb[_0x1cc8('0x44')]);return db[_0x1cc8('0x5b')]['count']({'where':_0x4f61b1[_0x1cc8('0x98')]})[_0x1cc8('0x14')](function(_0x1b8d07){_0x759a2b[_0x1cc8('0x9c')]=_0x1b8d07;if(_0x36c6eb[_0x1cc8('0x3e')][_0x1cc8('0x9d')]){_0x4f61b1[_0x1cc8('0x43')]=[{'all':!![]}];}return db[_0x1cc8('0x5b')][_0x1cc8('0x9e')](_0x4f61b1);})[_0x1cc8('0x14')](function(_0xa2b4a7){_0x759a2b['rows']=_0xa2b4a7;return _0x759a2b;});}})[_0x1cc8('0x14')](respondWithFilteredResult(_0x50f043,_0x4f61b1))[_0x1cc8('0x3a')](handleError(_0x50f043,null));};exports[_0x1cc8('0x9f')]=function(_0x40427a,_0x1c63b9){var _0x336472={'where':{}},_0x4a91df={},_0x53487e={'count':0x0,'rows':[]};return db[_0x1cc8('0x32')][_0x1cc8('0x4a')]({'where':{'id':_0x40427a[_0x1cc8('0x3b')]['id']}})[_0x1cc8('0x14')](handleEntityNotFound(_0x1c63b9,null))[_0x1cc8('0x14')](function(_0x3183b0){if(_0x3183b0){_0x4a91df[_0x1cc8('0x3c')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x4a91df[_0x1cc8('0x3e')]=_[_0x1cc8('0x3d')](_0x40427a['query']);_0x4a91df['filters']=_['intersection'](_0x4a91df[_0x1cc8('0x3c')],_0x4a91df[_0x1cc8('0x3e')]);_0x336472[_0x1cc8('0x41')]=_['intersection'](_0x4a91df[_0x1cc8('0x3c')],qs[_0x1cc8('0x42')](_0x40427a[_0x1cc8('0x3e')]['fields']));_0x336472[_0x1cc8('0x41')]=_0x336472[_0x1cc8('0x41')][_0x1cc8('0x94')]?_0x336472['attributes']:_0x4a91df['model'];if(!_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x95')](_0x1cc8('0x96'))){_0x336472['limit']=qs[_0x1cc8('0x24')](_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x24')]);_0x336472[_0x1cc8('0x22')]=qs[_0x1cc8('0x22')](_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x22')]);}_0x336472[_0x1cc8('0xa0')]=qs[_0x1cc8('0x97')](_0x40427a['query'][_0x1cc8('0x97')]);_0x336472[_0x1cc8('0x98')]=qs['filters'](_[_0x1cc8('0x99')](_0x40427a[_0x1cc8('0x3e')],_0x4a91df[_0x1cc8('0x3f')]));_0x336472[_0x1cc8('0x98')][_0x1cc8('0xa1')]=_0x3183b0['id'];if(_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x9a')]){_0x336472[_0x1cc8('0x98')]=_[_0x1cc8('0x2b')](_0x336472[_0x1cc8('0x98')],{'$or':_[_0x1cc8('0xa2')](_0x336472[_0x1cc8('0x41')],function(_0x3657ce){var _0x6d042b={};_0x6d042b[_0x3657ce]={'$like':'%'+_0x40427a['query'][_0x1cc8('0x9a')]+'%'};return _0x6d042b;})});}_0x336472[_0x1cc8('0x98')][_0x1cc8('0x85')]=![];if(_0x40427a['query']['id']){_0x336472[_0x1cc8('0x98')]['id']={'$gt':_0x40427a[_0x1cc8('0x3e')]['id']};}_0x336472=_[_0x1cc8('0x2b')]({},_0x336472,_0x40427a[_0x1cc8('0x44')]);return db[_0x1cc8('0x5b')][_0x1cc8('0x9c')]({'where':_0x336472[_0x1cc8('0x98')]})[_0x1cc8('0x14')](function(_0x2caaf2){_0x53487e[_0x1cc8('0x9c')]=_0x2caaf2;_0x336472[_0x1cc8('0x43')]=[];if(_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0xa3')]){_0x336472['include']['push']({'model':db[_0x1cc8('0x7d')],'as':_0x1cc8('0x7d'),'attributes':['id',_0x1cc8('0x7f'),_0x1cc8('0x7e')]});}if(_0x40427a[_0x1cc8('0x3e')][_0x1cc8('0x9d')]){_0x336472[_0x1cc8('0x43')]=[{'all':!![]}];}return db[_0x1cc8('0x5b')][_0x1cc8('0x9e')](_0x336472);})[_0x1cc8('0x14')](function(_0x26adeb){_0x53487e[_0x1cc8('0xa4')]=_0x26adeb;return _0x53487e;});}})['then'](respondWithFilteredResult(_0x1c63b9,_0x336472))[_0x1cc8('0x3a')](handleError(_0x1c63b9,null));};exports[_0x1cc8('0xa5')]=function(_0x2ec144,_0x46ab52){return db[_0x1cc8('0x32')]['find']({'where':{'id':_0x2ec144[_0x1cc8('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46ab52,null))['then'](function(_0x4a0d0e){if(_0x4a0d0e){return _0x4a0d0e[_0x1cc8('0xa6')](_0x2ec144[_0x1cc8('0x2c')][_0x1cc8('0x91')],_[_0x1cc8('0x92')](_0x2ec144[_0x1cc8('0x2c')],[_0x1cc8('0x91'),'id'])||{})[_0x1cc8('0xa7')](function(){return db['Tag'][_0x1cc8('0x9e')]({'attributes':['id',_0x1cc8('0x29'),_0x1cc8('0xa8')],'where':{'id':_0x2ec144[_0x1cc8('0x2c')]['ids']}});})['then'](function(_0x40c289){socket[_0x1cc8('0xa9')](_0x1cc8('0xaa'),{'id':Number(_0x2ec144['params']['id']),'tags':_0x40c289||[]});return{'id':Number(_0x2ec144['params']['id']),'tags':_0x40c289||[]};});}})[_0x1cc8('0x14')](respondWithResult(_0x46ab52,null))[_0x1cc8('0x3a')](handleError(_0x46ab52,null));};exports['removeTags']=function(_0x10ef13,_0x5272fe){return db[_0x1cc8('0x32')][_0x1cc8('0x45')]({'where':{'id':_0x10ef13['params']['id']}})[_0x1cc8('0x14')](handleEntityNotFound(_0x5272fe,null))[_0x1cc8('0x14')](function(_0x32b2e4){if(_0x32b2e4){return _0x32b2e4['removeTags'](_0x10ef13[_0x1cc8('0x3e')][_0x1cc8('0x91')]);}})[_0x1cc8('0x14')](respondWithStatusCode(_0x5272fe,null))[_0x1cc8('0x3a')](handleError(_0x5272fe,null));};exports[_0x1cc8('0xab')]=function(_0x5ca706,_0x49d46a){var _0x18de8f=moment()['unix']()[_0x1cc8('0xac')]();var _0x12684a=path[_0x1cc8('0x6e')](config[_0x1cc8('0x6f')],_0x1cc8('0xad'),_0x1cc8('0xae'),_0x1cc8('0xaf'));var _0x22f358=path[_0x1cc8('0x6e')](config[_0x1cc8('0x6f')],'server','files','attachments');var _0x522b4b=path[_0x1cc8('0x6e')](_0x12684a,_0x18de8f);var _0x343cfc=util[_0x1cc8('0x72')](_0x1cc8('0xb0'),_0x5ca706['params']['id'],_0x18de8f);var _0x271c1c=path[_0x1cc8('0x6e')](_0x12684a,_0x343cfc);var _0x22a6d1=[];_0x22a6d1[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x7d')],'as':_0x1cc8('0x7d'),'attributes':['id',_0x1cc8('0x7f')],'raw':!![]});_0x22a6d1[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x5e')],'as':_0x1cc8('0x5f'),'attributes':['id',_0x1cc8('0xb2'),'lastName'],'raw':!![]});if(_0x5ca706[_0x1cc8('0x3e')]['attachments']){_0x22a6d1[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x6a')],'as':'Attachment','raw':!![]});}var _0x542afb=[{'model':db['ChatMessage'],'as':_0x1cc8('0x75'),'attributes':['id',_0x1cc8('0x2c'),_0x1cc8('0xb3'),'direction',_0x1cc8('0x85'),_0x1cc8('0xb4')],'include':_0x22a6d1}];_0x542afb[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x4b')],'as':_0x1cc8('0xb5'),'attributes':['id','name']});_0x542afb[_0x1cc8('0xb1')]({'model':db[_0x1cc8('0x7d')],'as':_0x1cc8('0xb6'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x1cc8('0x45')]({'where':{'id':_0x5ca706[_0x1cc8('0x3b')]['id']},'include':_0x542afb})['then'](handleEntityNotFound(_0x49d46a,null))[_0x1cc8('0x14')](function(_0x126b5e){if(_0x126b5e){var _0x4d9184=_0x126b5e['get']({'plain':!![]});fs[_0x1cc8('0xb7')](_0x522b4b);var _0x3fcc21={'channel':_0x1cc8('0xb8'),'account':_0x4d9184[_0x1cc8('0xb5')]['name'],'agent':_0x4d9184[_0x1cc8('0xb6')]?_0x4d9184['Owner'][_0x1cc8('0x7f')]:_0x1cc8('0xb9'),'createdAt':moment(_0x4d9184[_0x1cc8('0xb3')])[_0x1cc8('0x72')](_0x1cc8('0xba'))[_0x1cc8('0xac')](),'closedAt':_0x4d9184['closed']?moment(_0x4d9184[_0x1cc8('0xbb')])['format'](_0x1cc8('0xba'))['toString']():'','disposition':_0x4d9184[_0x1cc8('0xbc')],'chatInfo':{'browser':_0x4d9184[_0x1cc8('0xbd')],'os':_0x4d9184[_0x1cc8('0xbe')],'referer':_0x4d9184[_0x1cc8('0xbf')],'customerIp':_0x4d9184[_0x1cc8('0xc0')],'customerPort':_0x4d9184[_0x1cc8('0xc1')]?_0x4d9184[_0x1cc8('0xc1')]:'N.A.'},'messages':_(_0x4d9184[_0x1cc8('0x75')])[_0x1cc8('0xc2')]()[_0x1cc8('0x9a')]({'secret':![]})[_0x1cc8('0xa2')](function(_0x2fa656){if(_0x2fa656[_0x1cc8('0x6a')]){var _0x3d1e64=path[_0x1cc8('0x6e')](_0x22f358,_0x2fa656['Attachment'][_0x1cc8('0x71')]);if(fs[_0x1cc8('0xc3')](_0x3d1e64)){fs['createReadStream'](_0x3d1e64)[_0x1cc8('0xc4')](fs[_0x1cc8('0xc5')](path[_0x1cc8('0x6e')](_0x522b4b,_0x2fa656[_0x1cc8('0x6a')][_0x1cc8('0x71')])));}}return{'date':moment(_0x2fa656['createdAt'])[_0x1cc8('0x72')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1cc8('0xac')](),'sender':_0x2fa656[_0x1cc8('0x84')]==='out'?_0x2fa656[_0x1cc8('0x7d')]?_0x2fa656[_0x1cc8('0x7d')][_0x1cc8('0x7f')]:'System':_0x2fa656[_0x1cc8('0x5f')][_0x1cc8('0xb2')]+(_0x2fa656[_0x1cc8('0x5f')][_0x1cc8('0xc6')]?'\x20'+_0x2fa656[_0x1cc8('0x5f')]['lastName']:''),'body':_0x2fa656[_0x1cc8('0x6a')]?_0x2fa656[_0x1cc8('0x6a')][_0x1cc8('0x71')]:_0x2fa656['body'],'direction':_0x2fa656[_0x1cc8('0x84')]===_0x1cc8('0x5a')?'A':'C','secret':_0x2fa656[_0x1cc8('0x85')],'read':_0x2fa656[_0x1cc8('0xb4')],'attachment':_0x2fa656[_0x1cc8('0x6a')]};})['value']()};return ejs[_0x1cc8('0xc7')](path['join'](config[_0x1cc8('0x6f')],'server','views','downloadInteraction.ejs'),{'interaction':_0x3fcc21})[_0x1cc8('0x14')](function(_0x1777e3){var _0x4f63d8=path[_0x1cc8('0x6e')](_0x522b4b,_0x1cc8('0xc8')+_0x4d9184['id']+'-'+_0x18de8f+'.pdf');var _0x1f2de1={'path':_0x4f63d8,'channel':_0x1cc8('0xb8'),'interactionId':_0x4d9184['id']};return pdf[_0x1cc8('0xc9')](_0x1777e3,_0x1f2de1);})[_0x1cc8('0x14')](function(){return new Promise(function(_0x4b4a51,_0x2f2f27){zipdir(_0x522b4b,{'saveTo':_0x271c1c},function(_0x4bb60e,_0x1c59dc){if(_0x4bb60e)return _0x2f2f27(_0x4bb60e);return _0x4b4a51(_0x1c59dc);});})[_0x1cc8('0x14')](function(){return new BPromise(function(_0x3206f5,_0x2ca04b){rimraf(_0x522b4b,function(_0x7d3e9a){if(_0x7d3e9a)_0x2ca04b(_0x7d3e9a);return _0x3206f5();});});})[_0x1cc8('0x14')](function(){return _0x49d46a[_0x1cc8('0xab')](_0x271c1c,_0x343cfc,function(_0xb4977){if(_0xb4977){logger['error']('err',_0xb4977);}else{fs['unlinkSync'](_0x271c1c);}});});});}else{return _0x49d46a['sendStatus'](0xc8);}})[_0x1cc8('0x3a')](handleError(_0x49d46a,null));};
\ No newline at end of file
+var _0xb7d7=['N.A.','existsSync','pipe','createWriteStream','out','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','stack','name','render','body','agent','map','ChatInteraction','type','key','findAll','user','show','params','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','update','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','contact','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Sequelize','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','server/files/attachments/','join','download','close','server/files/chat/upload/','format','transcript-%s.txt','User','ContactId','agentAlias','System','customer','%s%d','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','setTags','spread','color','emit','chatInteractionTags:save','unix','toString','root','server','files','attachments','push','fullname','lastName','Messages','secret','read','Account','Owner','get','Chat','closedAt','disposition','browserName','osName','referer','customerIp'];(function(_0x23677a,_0x5e98a1){var _0x3a8969=function(_0x2dc233){while(--_0x2dc233){_0x23677a['push'](_0x23677a['shift']());}};_0x3a8969(++_0x5e98a1);}(_0xb7d7,0xd4));var _0x7b7d=function(_0x45231c,_0x1610a8){_0x45231c=_0x45231c-0x0;var _0x5481b1=_0xb7d7[_0x45231c];return _0x5481b1;};'use strict';var rimraf=require(_0x7b7d('0x0'));var zipdir=require(_0x7b7d('0x1'));var rp=require('request-promise');var moment=require(_0x7b7d('0x2'));var BPromise=require(_0x7b7d('0x3'));var Mustache=require(_0x7b7d('0x4'));var util=require(_0x7b7d('0x5'));var path=require('path');var ejs=require(_0x7b7d('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x7b7d('0x7'));var qs=require(_0x7b7d('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x7b7d('0x9'))(_0x7b7d('0xa'));var config=require(_0x7b7d('0xb'));var db=require(_0x7b7d('0xc'))['db'];config[_0x7b7d('0xd')]=_[_0x7b7d('0xe')](config['redis'],{'host':_0x7b7d('0xf'),'port':0x18eb});var socket=require(_0x7b7d('0x10'))(new Redis(config[_0x7b7d('0xd')]));require(_0x7b7d('0x11'))['register'](socket);var jayson=require(_0x7b7d('0x12'));var client=jayson[_0x7b7d('0x13')][_0x7b7d('0x14')]({'port':0x232b});var client9004=jayson[_0x7b7d('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x189a53,_0x522be9,_0x11b27f,_0x453d03){return new BPromise(function(_0x3306d7,_0x30f541){var _0x3bdb33=_0x453d03||client;return _0x3bdb33[_0x7b7d('0x15')](_0x189a53,_0x11b27f)['then'](function(_0x253a6f){logger[_0x7b7d('0x16')](_0x7b7d('0x17'),_0x522be9,_0x7b7d('0x18'));logger[_0x7b7d('0x19')](_0x7b7d('0x1a'),_0x522be9,_0x7b7d('0x18'),JSON['stringify'](_0x253a6f));if(_0x253a6f[_0x7b7d('0x1b')]){if(_0x253a6f[_0x7b7d('0x1b')]['code']===0x1f4){logger['error'](_0x7b7d('0x17'),_0x522be9,_0x253a6f[_0x7b7d('0x1b')][_0x7b7d('0x1c')]);return _0x30f541(_0x253a6f[_0x7b7d('0x1b')][_0x7b7d('0x1c')]);}logger[_0x7b7d('0x1b')](_0x7b7d('0x17'),_0x522be9,_0x253a6f[_0x7b7d('0x1b')]['message']);return _0x3306d7(_0x253a6f[_0x7b7d('0x1b')][_0x7b7d('0x1c')]);}else{logger[_0x7b7d('0x16')](_0x7b7d('0x17'),_0x522be9,_0x7b7d('0x18'));_0x3306d7(_0x253a6f[_0x7b7d('0x1d')][_0x7b7d('0x1c')]);}})[_0x7b7d('0x1e')](function(_0x375f2c){logger[_0x7b7d('0x1b')](_0x7b7d('0x17'),_0x522be9,_0x375f2c);_0x30f541(_0x375f2c);});});}function respondWithStatusCode(_0x7e3df7,_0x3455fa){_0x3455fa=_0x3455fa||0xcc;return function(_0x108bf1){if(_0x108bf1){return _0x7e3df7['sendStatus'](_0x3455fa);}return _0x7e3df7[_0x7b7d('0x1f')](_0x3455fa)[_0x7b7d('0x20')]();};}function respondWithResult(_0x234f3c,_0x453dc9){_0x453dc9=_0x453dc9||0xc8;return function(_0x15494c){if(_0x15494c){return _0x234f3c[_0x7b7d('0x1f')](_0x453dc9)[_0x7b7d('0x21')](_0x15494c);}};}function respondWithFilteredResult(_0x59282a,_0x2d85d9){return function(_0xe91dd3){if(_0xe91dd3){var _0x435f73=typeof _0x2d85d9[_0x7b7d('0x22')]===_0x7b7d('0x23')&&typeof _0x2d85d9['limit']===_0x7b7d('0x23');var _0x17bc53=_0xe91dd3[_0x7b7d('0x24')];var _0x2c5457=_0x435f73?0x0:_0x2d85d9[_0x7b7d('0x22')];var _0x508c47=_0x435f73?_0xe91dd3[_0x7b7d('0x24')]:_0x2d85d9[_0x7b7d('0x22')]+_0x2d85d9[_0x7b7d('0x25')];var _0x368582;if(_0x508c47>=_0x17bc53){_0x508c47=_0x17bc53;_0x368582=0xc8;}else{_0x368582=0xce;}_0x59282a[_0x7b7d('0x1f')](_0x368582);return _0x59282a[_0x7b7d('0x26')](_0x7b7d('0x27'),_0x2c5457+'-'+_0x508c47+'/'+_0x17bc53)[_0x7b7d('0x21')](_0xe91dd3);}return null;};}function saveUpdates(_0x5f5482){return function(_0x3ca59c){if(_0x3ca59c){return _0x3ca59c['update'](_0x5f5482)[_0x7b7d('0x28')](function(_0x51d781){return _0x51d781;});}return null;};}function removeEntity(_0x163357){return function(_0x450c8b){if(_0x450c8b){return _0x450c8b[_0x7b7d('0x29')]()[_0x7b7d('0x28')](function(){_0x163357[_0x7b7d('0x1f')](0xcc)[_0x7b7d('0x20')]();});}};}function handleEntityNotFound(_0x17e6a7){return function(_0x80bd08){if(!_0x80bd08){_0x17e6a7[_0x7b7d('0x2a')](0x194);}return _0x80bd08;};}function handleError(_0x5a22c7,_0x106eaf){_0x106eaf=_0x106eaf||0x1f4;return function(_0x5209a6){logger[_0x7b7d('0x1b')](_0x5209a6[_0x7b7d('0x2b')]);if(_0x5209a6[_0x7b7d('0x2c')]){delete _0x5209a6['name'];}_0x5a22c7[_0x7b7d('0x1f')](_0x106eaf)['send'](_0x5209a6);};}function getMustacheRender(_0x407c95,_0x40f5dc){return Mustache[_0x7b7d('0x2d')](_0x407c95,_['merge'](_0x40f5dc[_0x7b7d('0x2e')],{'contact':_0x40f5dc['contact'],'message':_0x40f5dc[_0x7b7d('0x1c')],'agent':_0x40f5dc[_0x7b7d('0x2f')],'interaction':_0x40f5dc['interaction'],'account':_0x40f5dc['account']}))||'';}exports['index']=function(_0x45bddd,_0xa2d6ec){var _0x331fc5={};var _0x339e77=_[_0x7b7d('0x30')](db[_0x7b7d('0x31')]['rawAttributes'],function(_0x83dadd){return{'name':_0x83dadd['fieldName'],'type':_0x83dadd[_0x7b7d('0x32')][_0x7b7d('0x33')]};});_0x331fc5=qs['getOptions'](_0x339e77,_0x45bddd);return interaction[_0x7b7d('0x34')]('chat',_0x45bddd['query'],_0x45bddd[_0x7b7d('0x35')],_0x331fc5,_0x339e77)[_0x7b7d('0x28')](respondWithFilteredResult(_0xa2d6ec,_0x331fc5))[_0x7b7d('0x1e')](handleError(_0xa2d6ec,null));};exports[_0x7b7d('0x36')]=function(_0x4e4f9f,_0x24011e){var _0x4686b6={'raw':![],'where':{'id':_0x4e4f9f[_0x7b7d('0x37')]['id']}},_0x18bf5f={};_0x18bf5f[_0x7b7d('0x38')]=_[_0x7b7d('0x39')](db[_0x7b7d('0x31')][_0x7b7d('0x3a')]);_0x18bf5f[_0x7b7d('0x3b')]=_['keys'](_0x4e4f9f[_0x7b7d('0x3b')]);_0x18bf5f[_0x7b7d('0x3c')]=_['intersection'](_0x18bf5f['model'],_0x18bf5f['query']);_0x4686b6[_0x7b7d('0x3d')]=_[_0x7b7d('0x3e')](_0x18bf5f[_0x7b7d('0x38')],qs[_0x7b7d('0x3f')](_0x4e4f9f[_0x7b7d('0x3b')][_0x7b7d('0x3f')]));_0x4686b6[_0x7b7d('0x3d')]=_0x4686b6['attributes'][_0x7b7d('0x40')]?_0x4686b6[_0x7b7d('0x3d')]:_0x18bf5f[_0x7b7d('0x38')];if(_0x4e4f9f[_0x7b7d('0x3b')][_0x7b7d('0x41')]){_0x4686b6[_0x7b7d('0x42')]=[{'all':!![]}];}_0x4686b6=_[_0x7b7d('0x43')]({},_0x4686b6,_0x4e4f9f[_0x7b7d('0x44')]);return db[_0x7b7d('0x31')][_0x7b7d('0x45')](_0x4686b6)[_0x7b7d('0x28')](handleEntityNotFound(_0x24011e,null))[_0x7b7d('0x28')](respondWithResult(_0x24011e,null))[_0x7b7d('0x1e')](handleError(_0x24011e,null));};exports[_0x7b7d('0x46')]=function(_0x183143,_0x510d43){return db['ChatInteraction']['create'](_0x183143[_0x7b7d('0x2e')],{})[_0x7b7d('0x28')](respondWithResult(_0x510d43,0xc9))[_0x7b7d('0x1e')](handleError(_0x510d43,null));};exports[_0x7b7d('0x47')]=function(_0xd43aa1,_0x39ab2a){if(_0xd43aa1[_0x7b7d('0x2e')]['id']){delete _0xd43aa1['body']['id'];}return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0xd43aa1[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x39ab2a,null))['then'](saveUpdates(_0xd43aa1['body'],null))['then'](respondWithResult(_0x39ab2a,null))[_0x7b7d('0x1e')](handleError(_0x39ab2a,null));};exports[_0x7b7d('0x29')]=function(_0x3037f2,_0x5cab49){return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x3037f2[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x5cab49,null))['then'](removeEntity(_0x5cab49,null))['catch'](handleError(_0x5cab49,null));};exports[_0x7b7d('0x48')]=function(_0x53974e,_0x526187){return db['ChatInteraction'][_0x7b7d('0x48')]()['then'](respondWithResult(_0x526187,null))[_0x7b7d('0x1e')](handleError(_0x526187,null));};exports['createVidaooSession']=function(_0x5e443e,_0x2569a1){var _0x5301af=_0x5e443e['params']['id'];var _0x23d2a3;var _0x5d0435;var _0x481e84;return db['ChatInteraction'][_0x7b7d('0x49')]({'where':{'id':_0x5301af}})[_0x7b7d('0x28')](function(_0x54b6df){_0x23d2a3=_0x54b6df;return db[_0x7b7d('0x4a')][_0x7b7d('0x49')]({'where':{'id':_0x54b6df[_0x7b7d('0x4b')]},'attributes':['id',_0x7b7d('0x4c'),_0x7b7d('0x4d'),_0x7b7d('0x4e'),_0x7b7d('0x4f'),'vidaooMetadata'],'raw':!![]});})[_0x7b7d('0x28')](function(_0x4ae9ac){if(_0x4ae9ac&&_0x4ae9ac[_0x7b7d('0x4c')]&&_0x4ae9ac[_0x7b7d('0x4d')]){_0x5d0435=_0x4ae9ac;var _0x205616={'interaction':{'id':_0x5301af},'agent':{'id':_0x5e443e[_0x7b7d('0x35')]['id'],'name':_0x5e443e[_0x7b7d('0x35')][_0x7b7d('0x2c')],'fullname':_0x5e443e[_0x7b7d('0x35')]['fullname'],'email':_0x5e443e[_0x7b7d('0x35')][_0x7b7d('0x50')]},'contact':_0x5e443e[_0x7b7d('0x2e')][_0x7b7d('0x51')],'account':_0x5e443e[_0x7b7d('0x2e')][_0x7b7d('0x52')]};var _0x31dd9c={'rejectUnauthorized':![],'method':_0x7b7d('0x53'),'url':_0x7b7d('0x54'),'headers':{'X-APIKEY':_0x4ae9ac['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e443e[_0x7b7d('0x35')][_0x7b7d('0x50')]],'buttons':null,'topic':_0x5d0435[_0x7b7d('0x4e')],'note':_['isNull'](_0x5d0435['vidaooNote'])?null:getMustacheRender(_0x5d0435['vidaooNote'],_0x205616),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7b7d('0x55')](_0x5d0435[_0x7b7d('0x56')])){var _0x4f7fec=getMustacheRender(_0x5d0435[_0x7b7d('0x56')],_0x205616);var _0xd48e06=JSON[_0x7b7d('0x57')](_0x4f7fec);_0x31dd9c[_0x7b7d('0x2e')][_0x7b7d('0x58')]=_0xd48e06;}}catch(_0x48b6c3){throw new db['Sequelize']['ValidationError'](_0x7b7d('0x59'));}return rp(_0x31dd9c);}else{throw new db['Sequelize'][(_0x7b7d('0x5a'))](_0x7b7d('0x5b'));}})[_0x7b7d('0x28')](function(_0x86b851){_0x481e84=_0x86b851;if(_0x481e84['id']){var _0x46c782={'body':_0x481e84['join_url'],'ChatWebsiteId':_0x5d0435['id'],'ChatInteractionId':_0x23d2a3['id'],'direction':'out','UserId':_0x5e443e[_0x7b7d('0x35')]['id']};return db[_0x7b7d('0x5c')][_0x7b7d('0x46')](_0x46c782,{});}else{throw new db['Sequelize'][(_0x7b7d('0x5a'))](_0x7b7d('0x5d'));}})[_0x7b7d('0x28')](function(){return _0x23d2a3[_0x7b7d('0x5e')]({'vidaooSessionId':_0x481e84['id']});})[_0x7b7d('0x28')](respondWithResult(_0x2569a1,null))['catch'](handleError(_0x2569a1,null));};exports[_0x7b7d('0x5f')]=function(_0x45a077,_0x5dd48f){if(_0x45a077[_0x7b7d('0x2e')]['id']){delete _0x45a077[_0x7b7d('0x2e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x45a077[_0x7b7d('0x37')]['id']},'include':[{'model':db[_0x7b7d('0x60')],'as':_0x7b7d('0x61')}]})[_0x7b7d('0x28')](handleEntityNotFound(_0x5dd48f,null))['then'](saveUpdates(_0x45a077['body'],null))[_0x7b7d('0x28')](respondWithResult(_0x5dd48f,null))[_0x7b7d('0x1e')](handleError(_0x5dd48f,null));};exports[_0x7b7d('0x62')]=function(_0x34c969,_0x1da821){if(_0x34c969[_0x7b7d('0x2e')]['id']){delete _0x34c969[_0x7b7d('0x2e')]['id'];}return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x34c969[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](function(_0x32d9f2){if(!_0x32d9f2){logger[_0x7b7d('0x1b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x7b7d('0x62'),0x194,_0x7b7d('0x63'));_0x1da821[_0x7b7d('0x2a')](0x194);}else{if(_0x32d9f2[_0x7b7d('0x64')]){throw new db[(_0x7b7d('0x65'))][(_0x7b7d('0x5a'))](_0x7b7d('0x66'));}}return _0x32d9f2;})[_0x7b7d('0x28')](function(_0x5efb4f){if(_0x5efb4f){return _0x5efb4f[_0x7b7d('0x47')]({'closed':_0x34c969[_0x7b7d('0x2e')][_0x7b7d('0x67')],'disposition':_0x34c969[_0x7b7d('0x2e')]['disposition']})[_0x7b7d('0x28')](function(_0xd4a500){return _0xd4a500;});}})['then'](function(){return respondWithRpcPromise(_0x7b7d('0x68'),_0x7b7d('0x62'),_0x34c969[_0x7b7d('0x2e')],client9004);})[_0x7b7d('0x28')](respondWithResult(_0x1da821,null))[_0x7b7d('0x1e')](handleError(_0x1da821,null));};exports[_0x7b7d('0x69')]=function(_0x20b9d4,_0x3f739e){_0x20b9d4[_0x7b7d('0x2e')][_0x7b7d('0x2c')]=_0x20b9d4['file'][_0x7b7d('0x6a')];_0x20b9d4[_0x7b7d('0x2e')][_0x7b7d('0x6b')]=_0x20b9d4[_0x7b7d('0x6c')][_0x7b7d('0x6d')];_0x20b9d4[_0x7b7d('0x2e')]['type']=_0x20b9d4[_0x7b7d('0x6c')]['mimetype'];return db[_0x7b7d('0x6e')][_0x7b7d('0x46')](_0x20b9d4['body'])[_0x7b7d('0x28')](respondWithResult(_0x3f739e,0xc9))['catch'](handleError(_0x3f739e,null));};exports[_0x7b7d('0x6f')]=function(_0xddea6,_0x5d92bb){return db['ChatInteraction'][_0x7b7d('0x49')]({'where':{'id':_0xddea6['params']['id']},'raw':!![]})[_0x7b7d('0x28')](handleEntityNotFound(_0x5d92bb,null))['then'](function(_0x4a9af9){if(_0x4a9af9){if(_0x4a9af9[_0x7b7d('0x67')]){return _0x5d92bb['status'](0x193)[_0x7b7d('0x21')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0xddea6['query'][_0x7b7d('0x70')]},'raw':!![]})['then'](handleEntityNotFound(_0x5d92bb,null));}})[_0x7b7d('0x28')](function(_0x2c06bb){if(_0x2c06bb){var _0x3f793c=_0x2c06bb[_0x7b7d('0x71')]!==null;var _0x327503=path['join'](config['root'],_0x7b7d('0x72'));if(_0x3f793c){_0x327503=path[_0x7b7d('0x73')](_0x327503,'offline-chat/');}var _0x383ea0=path[_0x7b7d('0x73')](_0x327503,_0x2c06bb[_0x7b7d('0x6b')]);return _0x5d92bb[_0x7b7d('0x74')](_0x383ea0);}})[_0x7b7d('0x1e')](handleError(_0x5d92bb,null));};exports[_0x7b7d('0x75')]=function(_0x434b73,_0x35887f){var _0x51fa77=null;var _0x4321ca=null;var _0x250ed4=null;if(_0x434b73[_0x7b7d('0x2e')]['id']){delete _0x434b73['body']['id'];}if(_0x434b73['body']['mailTranscript']){_0x250ed4=path[_0x7b7d('0x73')](config['root'],_0x7b7d('0x76'),util[_0x7b7d('0x77')](_0x7b7d('0x78'),Date['now']()));_0x434b73[_0x7b7d('0x2e')]['pathTranscript']=_0x250ed4;}return db[_0x7b7d('0x31')]['find']({'where':{'id':_0x434b73['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x7b7d('0x79')],'as':_0x7b7d('0x79')}]}]})['then'](handleEntityNotFound(_0x35887f,null))['then'](saveUpdates(_0x434b73[_0x7b7d('0x2e')],null))[_0x7b7d('0x28')](function(_0x2aaea9){if(_0x2aaea9){_0x51fa77=_0x2aaea9;return db[_0x7b7d('0x4a')][_0x7b7d('0x45')]({'where':{'id':_0x51fa77[_0x7b7d('0x4b')]}});}})[_0x7b7d('0x28')](function(_0x5c0a45){if(_0x5c0a45){_0x4321ca=_0x5c0a45;return db[_0x7b7d('0x60')]['find']({'where':{'id':_0x51fa77[_0x7b7d('0x7a')]}});}})[_0x7b7d('0x28')](function(_0x5c2e3e){if(_0x5c2e3e){if(_0x250ed4){var _0x1ca989=null;for(var _0x20f9c9=0x1;_0x20f9c9<_0x51fa77['Messages'][_0x7b7d('0x40')];++_0x20f9c9){_0x1ca989=_0x51fa77['Messages'][_0x20f9c9];var _0x5d5dec=_0x1ca989[_0x7b7d('0x64')]?util[_0x7b7d('0x77')]('%s%d',_0x4321ca[_0x7b7d('0x7b')],_0x1ca989['UserId']):_0x7b7d('0x7c');var _0x3e3110=_0x434b73['body'][_0x7b7d('0x7d')]||util[_0x7b7d('0x77')](_0x7b7d('0x7e'),_0x7b7d('0x7f'),_0x1ca989[_0x7b7d('0x7a')]);switch(_0x4321ca['agentIdentifier']){case _0x7b7d('0x80'):_0x5d5dec=_0x1ca989[_0x7b7d('0x64')]?util['format'](_0x7b7d('0x7e'),_0x4321ca[_0x7b7d('0x7b')],_0x1ca989[_0x7b7d('0x64')]):_0x7b7d('0x7c');break;case _0x7b7d('0x81'):_0x5d5dec=_0x1ca989[_0x7b7d('0x64')]?_0x1ca989['User'][_0x7b7d('0x82')]||_0x1ca989[_0x7b7d('0x79')]['fullname']:'System';break;case _0x7b7d('0x83'):_0x5d5dec=_0x1ca989['UserId']?_0x1ca989['User']['fullname']:'System';break;default:_0x5d5dec=_0x1ca989['UserId']?util[_0x7b7d('0x77')]('%s%d',_0x4321ca[_0x7b7d('0x7b')],_0x1ca989['UserId']):_0x7b7d('0x7c');}var _0x58826c=util[_0x7b7d('0x77')](_0x7b7d('0x84'),moment(_0x1ca989[_0x7b7d('0x85')])[_0x7b7d('0x77')](_0x7b7d('0x86')),_0x1ca989[_0x7b7d('0x87')]==='in'?_0x3e3110:_0x5d5dec,_0x1ca989[_0x7b7d('0x2e')]);if(!_0x1ca989['secret']){fs[_0x7b7d('0x88')](_0x250ed4,_0x58826c);}}return db[_0x7b7d('0x89')][_0x7b7d('0x49')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x7b7d('0x8a'),'raw':!![],'include':[{'model':db[_0x7b7d('0x8b')],'as':_0x7b7d('0x8b'),'raw':!![]}]}]});}}})[_0x7b7d('0x28')](function(_0x3a34ab){if(!_0x3a34ab||!_0x3a34ab['Smtp']||!_0x434b73[_0x7b7d('0x2e')])return _0x51fa77;var _0x45e386=_0x3a34ab[_0x7b7d('0x8c')]();return respondWithRpcPromise(_0x7b7d('0x8d'),'sendMail',{'account':_0x45e386,'message':{'from':util[_0x7b7d('0x77')](_0x7b7d('0x8e'),_0x3a34ab[_0x7b7d('0x2c')],_0x3a34ab[_0x7b7d('0x50')]||_0x3a34ab[_0x7b7d('0x8a')][_0x7b7d('0x35')]),'to':_0x434b73[_0x7b7d('0x2e')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x7b7d('0x77')](_0x7b7d('0x8f'),_0x434b73[_0x7b7d('0x2e')]['mailTranscript']),'attachments':[{'path':_0x250ed4}]}})[_0x7b7d('0x28')](function(){return _0x51fa77;})['catch'](function(_0x2f1c94){logger[_0x7b7d('0x1b')](_0x2f1c94);});})[_0x7b7d('0x28')](respondWithStatusCode(_0x35887f,0xc8))['catch'](handleError(_0x35887f,null));};exports[_0x7b7d('0x90')]=function(_0x287455,_0x300712){return db[_0x7b7d('0x5c')][_0x7b7d('0x45')]({'where':{'id':_0x287455[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x300712,null))[_0x7b7d('0x28')](function(_0x41c186){if(_0x41c186){return _0x41c186[_0x7b7d('0x90')](_0x287455[_0x7b7d('0x2e')][_0x7b7d('0x91')],_[_0x7b7d('0x92')](_0x287455['body'],['ids','id'])||{});}})[_0x7b7d('0x28')](respondWithResult(_0x300712,null))[_0x7b7d('0x1e')](handleError(_0x300712,null));};exports[_0x7b7d('0x93')]=function(_0x477e9e,_0x122891){var _0x11cf09={'raw':![],'where':{}};var _0x26642f={};var _0x148e26={'count':0x0,'rows':[]};return db[_0x7b7d('0x31')][_0x7b7d('0x49')]({'where':{'id':_0x477e9e[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x122891,null))[_0x7b7d('0x28')](function(_0xaa43c0){if(_0xaa43c0){_0x26642f['model']=_[_0x7b7d('0x39')](db[_0x7b7d('0x5c')]['rawAttributes']);_0x26642f[_0x7b7d('0x3b')]=_[_0x7b7d('0x39')](_0x477e9e['query']);_0x26642f[_0x7b7d('0x3c')]=_[_0x7b7d('0x3e')](_0x26642f[_0x7b7d('0x38')],_0x26642f[_0x7b7d('0x3b')]);_0x11cf09[_0x7b7d('0x3d')]=_['intersection'](_0x26642f[_0x7b7d('0x38')],qs[_0x7b7d('0x3f')](_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x3f')]));_0x11cf09[_0x7b7d('0x3d')]=_0x11cf09[_0x7b7d('0x3d')][_0x7b7d('0x40')]?_0x11cf09[_0x7b7d('0x3d')]:_0x26642f[_0x7b7d('0x38')];if(!_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x94')](_0x7b7d('0x95'))){_0x11cf09[_0x7b7d('0x25')]=qs[_0x7b7d('0x25')](_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x25')]);_0x11cf09[_0x7b7d('0x22')]=qs[_0x7b7d('0x22')](_0x477e9e['query']['offset']);}_0x11cf09[_0x7b7d('0x96')]=qs[_0x7b7d('0x97')](_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x97')]);_0x11cf09['where']=qs['filters'](_[_0x7b7d('0x98')](_0x477e9e['query'],_0x26642f[_0x7b7d('0x3c')]));_0x11cf09[_0x7b7d('0x99')][_0x7b7d('0x9a')]=_0xaa43c0['id'];if(_0x477e9e['query']['filter']){_0x11cf09[_0x7b7d('0x99')]=_[_0x7b7d('0x43')](_0x11cf09[_0x7b7d('0x99')],{'$or':_['map'](_0x11cf09[_0x7b7d('0x3d')],function(_0x810420){var _0x183554={};_0x183554[_0x810420]={'$like':'%'+_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x9b')]+'%'};return _0x183554;})});}if(_0x477e9e[_0x7b7d('0x3b')]['$gte']){var _0x934eef=_0x477e9e[_0x7b7d('0x3b')][_0x7b7d('0x9c')][_0x7b7d('0x9d')](',');var _0x253d03={};_0x253d03[_0x934eef[0x0]]={'$gte':moment(_0x934eef[0x1])['format'](_0x7b7d('0x9e'))};_0x11cf09[_0x7b7d('0x99')]=_[_0x7b7d('0x43')](_0x11cf09[_0x7b7d('0x99')],_0x253d03);}_0x11cf09=_[_0x7b7d('0x43')]({},_0x11cf09,_0x477e9e[_0x7b7d('0x44')]);return db['ChatMessage'][_0x7b7d('0x24')]({'where':_0x11cf09['where']})[_0x7b7d('0x28')](function(_0x42adb7){_0x148e26[_0x7b7d('0x24')]=_0x42adb7;if(_0x477e9e['query'][_0x7b7d('0x41')]){_0x11cf09[_0x7b7d('0x42')]=[{'all':!![]}];}return db[_0x7b7d('0x5c')][_0x7b7d('0x34')](_0x11cf09);})['then'](function(_0x5b051){_0x148e26[_0x7b7d('0x9f')]=_0x5b051;return _0x148e26;});}})[_0x7b7d('0x28')](respondWithFilteredResult(_0x122891,_0x11cf09))[_0x7b7d('0x1e')](handleError(_0x122891,null));};exports[_0x7b7d('0xa0')]=function(_0x2f0660,_0x8bfc47){var _0x3812ec={'where':{}},_0x210745={},_0x52edd1={'count':0x0,'rows':[]};return db[_0x7b7d('0x31')][_0x7b7d('0x49')]({'where':{'id':_0x2f0660[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x8bfc47,null))[_0x7b7d('0x28')](function(_0x362332){if(_0x362332){_0x210745['model']=_['keys'](db['ChatMessage'][_0x7b7d('0x3a')]);_0x210745[_0x7b7d('0x3b')]=_[_0x7b7d('0x39')](_0x2f0660['query']);_0x210745['filters']=_['intersection'](_0x210745[_0x7b7d('0x38')],_0x210745[_0x7b7d('0x3b')]);_0x3812ec[_0x7b7d('0x3d')]=_[_0x7b7d('0x3e')](_0x210745[_0x7b7d('0x38')],qs[_0x7b7d('0x3f')](_0x2f0660[_0x7b7d('0x3b')][_0x7b7d('0x3f')]));_0x3812ec['attributes']=_0x3812ec[_0x7b7d('0x3d')][_0x7b7d('0x40')]?_0x3812ec[_0x7b7d('0x3d')]:_0x210745[_0x7b7d('0x38')];if(!_0x2f0660[_0x7b7d('0x3b')]['hasOwnProperty']('nolimit')){_0x3812ec[_0x7b7d('0x25')]=qs['limit'](_0x2f0660[_0x7b7d('0x3b')][_0x7b7d('0x25')]);_0x3812ec[_0x7b7d('0x22')]=qs['offset'](_0x2f0660['query']['offset']);}_0x3812ec[_0x7b7d('0x96')]=qs['sort'](_0x2f0660['query']['sort']);_0x3812ec[_0x7b7d('0x99')]=qs[_0x7b7d('0x3c')](_[_0x7b7d('0x98')](_0x2f0660[_0x7b7d('0x3b')],_0x210745[_0x7b7d('0x3c')]));_0x3812ec['where']['ChatInteractionId']=_0x362332['id'];if(_0x2f0660[_0x7b7d('0x3b')]['filter']){_0x3812ec[_0x7b7d('0x99')]=_[_0x7b7d('0x43')](_0x3812ec[_0x7b7d('0x99')],{'$or':_[_0x7b7d('0x30')](_0x3812ec[_0x7b7d('0x3d')],function(_0x499e8b){var _0xa4d7eb={};_0xa4d7eb[_0x499e8b]={'$like':'%'+_0x2f0660[_0x7b7d('0x3b')][_0x7b7d('0x9b')]+'%'};return _0xa4d7eb;})});}_0x3812ec['where']['secret']=![];if(_0x2f0660[_0x7b7d('0x3b')]['id']){_0x3812ec[_0x7b7d('0x99')]['id']={'$gt':_0x2f0660[_0x7b7d('0x3b')]['id']};}_0x3812ec=_['merge']({},_0x3812ec,_0x2f0660[_0x7b7d('0x44')]);return db[_0x7b7d('0x5c')][_0x7b7d('0x24')]({'where':_0x3812ec[_0x7b7d('0x99')]})['then'](function(_0x11092b){_0x52edd1[_0x7b7d('0x24')]=_0x11092b;_0x3812ec[_0x7b7d('0x42')]=[];if(_0x2f0660[_0x7b7d('0x3b')]['includeAgent']){_0x3812ec[_0x7b7d('0x42')]['push']({'model':db['User'],'as':_0x7b7d('0x79'),'attributes':['id','fullname',_0x7b7d('0x82')]});}if(_0x2f0660['query']['includeAll']){_0x3812ec[_0x7b7d('0x42')]=[{'all':!![]}];}return db[_0x7b7d('0x5c')]['findAll'](_0x3812ec);})['then'](function(_0x37c357){_0x52edd1[_0x7b7d('0x9f')]=_0x37c357;return _0x52edd1;});}})[_0x7b7d('0x28')](respondWithFilteredResult(_0x8bfc47,_0x3812ec))[_0x7b7d('0x1e')](handleError(_0x8bfc47,null));};exports['addTags']=function(_0x142f05,_0x4ee027){return db['ChatInteraction']['find']({'where':{'id':_0x142f05[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x4ee027,null))[_0x7b7d('0x28')](function(_0x6f82be){if(_0x6f82be){return _0x6f82be[_0x7b7d('0xa1')](_0x142f05[_0x7b7d('0x2e')][_0x7b7d('0x91')],_[_0x7b7d('0x92')](_0x142f05[_0x7b7d('0x2e')],[_0x7b7d('0x91'),'id'])||{})[_0x7b7d('0xa2')](function(){return db['Tag'][_0x7b7d('0x34')]({'attributes':['id',_0x7b7d('0x2c'),_0x7b7d('0xa3')],'where':{'id':_0x142f05[_0x7b7d('0x2e')][_0x7b7d('0x91')]}});})[_0x7b7d('0x28')](function(_0x23acbd){socket[_0x7b7d('0xa4')](_0x7b7d('0xa5'),{'id':Number(_0x142f05[_0x7b7d('0x37')]['id']),'tags':_0x23acbd||[]});return{'id':Number(_0x142f05[_0x7b7d('0x37')]['id']),'tags':_0x23acbd||[]};});}})[_0x7b7d('0x28')](respondWithResult(_0x4ee027,null))[_0x7b7d('0x1e')](handleError(_0x4ee027,null));};exports['removeTags']=function(_0x1af421,_0x3dd452){return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x1af421[_0x7b7d('0x37')]['id']}})[_0x7b7d('0x28')](handleEntityNotFound(_0x3dd452,null))['then'](function(_0x427c3e){if(_0x427c3e){return _0x427c3e['removeTags'](_0x1af421['query']['ids']);}})['then'](respondWithStatusCode(_0x3dd452,null))[_0x7b7d('0x1e')](handleError(_0x3dd452,null));};exports[_0x7b7d('0x74')]=function(_0x4e36c9,_0x489e5a){var _0x4587f1=moment()[_0x7b7d('0xa6')]()[_0x7b7d('0xa7')]();var _0x4dbccf=path[_0x7b7d('0x73')](config[_0x7b7d('0xa8')],_0x7b7d('0xa9'),_0x7b7d('0xaa'),'tmp');var _0x53f279=path[_0x7b7d('0x73')](config[_0x7b7d('0xa8')],_0x7b7d('0xa9'),_0x7b7d('0xaa'),_0x7b7d('0xab'));var _0x488386=path[_0x7b7d('0x73')](_0x4dbccf,_0x4587f1);var _0x32bc47=util[_0x7b7d('0x77')]('transcript-%d-%s.zip',_0x4e36c9[_0x7b7d('0x37')]['id'],_0x4587f1);var _0x5791bc=path[_0x7b7d('0x73')](_0x4dbccf,_0x32bc47);var _0x2336a1=[];_0x2336a1[_0x7b7d('0xac')]({'model':db[_0x7b7d('0x79')],'as':'User','attributes':['id',_0x7b7d('0xad')],'raw':!![]});_0x2336a1[_0x7b7d('0xac')]({'model':db['CmContact'],'as':_0x7b7d('0x61'),'attributes':['id','firstName',_0x7b7d('0xae')],'raw':!![]});if(_0x4e36c9['query'][_0x7b7d('0xab')]){_0x2336a1[_0x7b7d('0xac')]({'model':db[_0x7b7d('0x6e')],'as':_0x7b7d('0x6e'),'raw':!![]});}var _0x1d61d2=[{'model':db[_0x7b7d('0x5c')],'as':_0x7b7d('0xaf'),'attributes':['id','body',_0x7b7d('0x85'),_0x7b7d('0x87'),_0x7b7d('0xb0'),_0x7b7d('0xb1')],'include':_0x2336a1}];_0x1d61d2[_0x7b7d('0xac')]({'model':db['ChatWebsite'],'as':_0x7b7d('0xb2'),'attributes':['id',_0x7b7d('0x2c')]});_0x1d61d2[_0x7b7d('0xac')]({'model':db[_0x7b7d('0x79')],'as':_0x7b7d('0xb3'),'attributes':['id',_0x7b7d('0xad')]});return db[_0x7b7d('0x31')][_0x7b7d('0x45')]({'where':{'id':_0x4e36c9[_0x7b7d('0x37')]['id']},'include':_0x1d61d2})['then'](handleEntityNotFound(_0x489e5a,null))['then'](function(_0x55c73c){if(_0x55c73c){var _0x3cac80=_0x55c73c[_0x7b7d('0xb4')]({'plain':!![]});fs['mkdirSync'](_0x488386);var _0x3e4211={'channel':_0x7b7d('0xb5'),'account':_0x3cac80[_0x7b7d('0xb2')]['name'],'agent':_0x3cac80[_0x7b7d('0xb3')]?_0x3cac80[_0x7b7d('0xb3')][_0x7b7d('0xad')]:'N.A.','createdAt':moment(_0x3cac80[_0x7b7d('0x85')])['format'](_0x7b7d('0x9e'))[_0x7b7d('0xa7')](),'closedAt':_0x3cac80['closed']?moment(_0x3cac80[_0x7b7d('0xb6')])[_0x7b7d('0x77')](_0x7b7d('0x9e'))[_0x7b7d('0xa7')]():'','disposition':_0x3cac80[_0x7b7d('0xb7')],'chatInfo':{'browser':_0x3cac80[_0x7b7d('0xb8')],'os':_0x3cac80[_0x7b7d('0xb9')],'referer':_0x3cac80[_0x7b7d('0xba')],'customerIp':_0x3cac80[_0x7b7d('0xbb')],'customerPort':_0x3cac80['customerPort']?_0x3cac80['customerPort']:_0x7b7d('0xbc')},'messages':_(_0x3cac80['Messages'])['tail']()[_0x7b7d('0x9b')]({'secret':![]})['map'](function(_0x564088){if(_0x564088[_0x7b7d('0x6e')]){var _0x56a72d=path['join'](_0x53f279,_0x564088[_0x7b7d('0x6e')][_0x7b7d('0x6b')]);if(fs[_0x7b7d('0xbd')](_0x56a72d)){fs['createReadStream'](_0x56a72d)[_0x7b7d('0xbe')](fs[_0x7b7d('0xbf')](path['join'](_0x488386,_0x564088[_0x7b7d('0x6e')]['basename'])));}}return{'date':moment(_0x564088['createdAt'])[_0x7b7d('0x77')](_0x7b7d('0x9e'))[_0x7b7d('0xa7')](),'sender':_0x564088['direction']===_0x7b7d('0xc0')?_0x564088[_0x7b7d('0x79')]?_0x564088[_0x7b7d('0x79')][_0x7b7d('0xad')]:'System':_0x564088[_0x7b7d('0x61')]['firstName']+(_0x564088[_0x7b7d('0x61')][_0x7b7d('0xae')]?'\x20'+_0x564088[_0x7b7d('0x61')]['lastName']:''),'body':_0x564088[_0x7b7d('0x6e')]?_0x564088[_0x7b7d('0x6e')][_0x7b7d('0x6b')]:_0x564088[_0x7b7d('0x2e')],'direction':_0x564088['direction']===_0x7b7d('0xc0')?'A':'C','secret':_0x564088[_0x7b7d('0xb0')],'read':_0x564088['read'],'attachment':_0x564088['Attachment']};})[_0x7b7d('0xc1')]()};return ejs['renderFile'](path[_0x7b7d('0x73')](config[_0x7b7d('0xa8')],'server',_0x7b7d('0xc2'),_0x7b7d('0xc3')),{'interaction':_0x3e4211})['then'](function(_0x6cb19e){var _0x2c58f2=path[_0x7b7d('0x73')](_0x488386,'transcript-'+_0x3cac80['id']+'-'+_0x4587f1+_0x7b7d('0xc4'));var _0x1de930={'path':_0x2c58f2,'channel':_0x7b7d('0xb5'),'interactionId':_0x3cac80['id']};return pdf[_0x7b7d('0xc5')](_0x6cb19e,_0x1de930);})['then'](function(){return new Promise(function(_0x56580c,_0x3052f7){zipdir(_0x488386,{'saveTo':_0x5791bc},function(_0x4b5721,_0x21190b){if(_0x4b5721)return _0x3052f7(_0x4b5721);return _0x56580c(_0x21190b);});})[_0x7b7d('0x28')](function(){return new BPromise(function(_0x3128d7,_0x56ebd9){rimraf(_0x488386,function(_0x1a9943){if(_0x1a9943)_0x56ebd9(_0x1a9943);return _0x3128d7();});});})[_0x7b7d('0x28')](function(){return _0x489e5a[_0x7b7d('0x74')](_0x5791bc,_0x32bc47,function(_0x3ce239){if(_0x3ce239){logger['error'](_0x7b7d('0xc6'),_0x3ce239);}else{fs[_0x7b7d('0xc7')](_0x5791bc);}});});});}else{return _0x489e5a[_0x7b7d('0x2a')](0xc8);}})['catch'](handleError(_0x489e5a,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d58edf6..35a5c8f 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 _0x2c67=['then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x2c67,0x81));var _0x72c6=function(_0x26b090,_0x129196){_0x26b090=_0x26b090-0x0;var _0x1e488a=_0x2c67[_0x26b090];return _0x1e488a;};'use strict';var EventEmitter=require(_0x72c6('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x72c6('0x1'))['db'][_0x72c6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x72c6('0x3')](0x0);var events={'afterCreate':_0x72c6('0x4'),'afterUpdate':_0x72c6('0x5'),'afterDestroy':_0x72c6('0x6')};function emitEvent(_0x5be971){return function(_0x1f2acb,_0x2136c2,_0x1d65a3){_0x1f2acb['getUsers']({'attributes':['id'],'raw':!![]})[_0x72c6('0x7')](function(_0x206693){_0x1f2acb[_0x72c6('0x8')](_0x72c6('0x9'),_0x206693[_0x72c6('0xa')](function(_0x534611){return{'id':_0x534611['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1f2acb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x9802aa){_0x1f2acb[_0x72c6('0x8')](_0x72c6('0xb'),_0x9802aa[_0x72c6('0xc')]);ChatInteractionEvents[_0x72c6('0xd')](_0x5be971+':'+_0x1f2acb['id'],_0x1f2acb);ChatInteractionEvents[_0x72c6('0xd')](_0x5be971,_0x1f2acb);_0x1d65a3(null);})[_0x72c6('0xe')](_0x1d65a3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x72c6('0xf')](e,emitEvent(event));}}module[_0x72c6('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x3df6=['exports','../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hook'];(function(_0x46e76c,_0x40dad9){var _0x47f72a=function(_0x3d1802){while(--_0x3d1802){_0x46e76c['push'](_0x46e76c['shift']());}};_0x47f72a(++_0x40dad9);}(_0x3df6,0x13c));var _0x63df=function(_0x3f911c,_0x1441cf){_0x3f911c=_0x3f911c-0x0;var _0x25c459=_0x3df6[_0x3f911c];return _0x25c459;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x63df('0x0'))['db'][_0x63df('0x1')];var ChatMessage=require(_0x63df('0x0'))['db'][_0x63df('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63df('0x3'),'afterUpdate':'update','afterDestroy':_0x63df('0x4')};function emitEvent(_0x1970fd){return function(_0x3a5cab,_0x1bd3f8,_0x3defa0){_0x3a5cab[_0x63df('0x5')]({'attributes':['id'],'raw':!![]})[_0x63df('0x6')](function(_0x13c4e1){_0x3a5cab[_0x63df('0x7')](_0x63df('0x8'),_0x13c4e1[_0x63df('0x9')](function(_0x28fdb7){return{'id':_0x28fdb7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3a5cab['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x110e84){_0x3a5cab[_0x63df('0x7')](_0x63df('0xa'),_0x110e84['length']);ChatInteractionEvents[_0x63df('0xb')](_0x1970fd+':'+_0x3a5cab['id'],_0x3a5cab);ChatInteractionEvents[_0x63df('0xb')](_0x1970fd,_0x3a5cab);_0x3defa0(null);})[_0x63df('0xc')](_0x3defa0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x63df('0xd')](e,emitEvent(event));}}module[_0x63df('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index f844eb7..3bd2063 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 _0x8066=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatInteraction','changed','closed'];(function(_0x42dcbb,_0x3bab87){var _0x597f5d=function(_0x3c93c6){while(--_0x3c93c6){_0x42dcbb['push'](_0x42dcbb['shift']());}};_0x597f5d(++_0x3bab87);}(_0x8066,0xe5));var _0x6806=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8066[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x6806('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6806('0x1'));var moment=require(_0x6806('0x2'));var BPromise=require(_0x6806('0x3'));var rp=require(_0x6806('0x4'));var fs=require('fs');var path=require(_0x6806('0x5'));var rimraf=require('rimraf');var config=require(_0x6806('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x6806('0x7')]=function(_0x43b08b,_0x3ed9c3){return _0x43b08b['define'](_0x6806('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2eba39,_0x4831de,_0x58edc8){if(_0x2eba39[_0x6806('0x9')](_0x6806('0xa'))){_0x2eba39[_0x6806('0xb')]=moment()[_0x6806('0xc')](_0x6806('0xd'));}_0x58edc8(null,_0x2eba39);}},'charset':_0x6806('0xe'),'collate':_0x6806('0xf')});};
\ No newline at end of file
+var _0xab8c=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0xab8c,0x174));var _0xcab8=function(_0x4c1239,_0x57921a){_0x4c1239=_0x4c1239-0x0;var _0x5c843a=_0xab8c[_0x4c1239];return _0x5c843a;};'use strict';var _=require(_0xcab8('0x0'));var util=require(_0xcab8('0x1'));var logger=require(_0xcab8('0x2'))(_0xcab8('0x3'));var moment=require(_0xcab8('0x4'));var BPromise=require(_0xcab8('0x5'));var rp=require(_0xcab8('0x6'));var fs=require('fs');var path=require(_0xcab8('0x7'));var rimraf=require(_0xcab8('0x8'));var config=require(_0xcab8('0x9'));var attributes=require(_0xcab8('0xa'));module[_0xcab8('0xb')]=function(_0x196eab,_0x1366eb){return _0x196eab[_0xcab8('0xc')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fbf1f,_0x1d3744,_0x27276d){if(_0x3fbf1f[_0xcab8('0xd')]('closed')){_0x3fbf1f[_0xcab8('0xe')]=moment()['format'](_0xcab8('0xf'));}_0x27276d(null,_0x3fbf1f);}},'charset':_0xcab8('0x10'),'collate':_0xcab8('0x11')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 7ca5c80..a1579aa 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 _0x2665=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','update','body','options','where','attributes','AddTagsToChatInteraction','ChatInteraction','find','addTags','omit','ids','AddTags','lodash','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2665,0x1d1));var _0x5266=function(_0x5cb488,_0x92f6c7){_0x5cb488=_0x5cb488-0x0;var _0x2270d1=_0x2665[_0x5cb488];return _0x2270d1;};'use strict';var _=require(_0x5266('0x0'));var util=require('util');var moment=require(_0x5266('0x1'));var BPromise=require(_0x5266('0x2'));var rs=require(_0x5266('0x3'));var fs=require('fs');var Redis=require(_0x5266('0x4'));var db=require(_0x5266('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5266('0x6'))(_0x5266('0x7'));var config=require(_0x5266('0x8'));var jayson=require(_0x5266('0x9'));var client=jayson[_0x5266('0xa')]['http']({'port':0x232a});config[_0x5266('0xb')]=_['defaults'](config[_0x5266('0xb')],{'host':_0x5266('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5266('0xb')]));require(_0x5266('0xd'))[_0x5266('0xe')](socket);function respondWithRpcPromise(_0x313874,_0x149ab6,_0x5b1fc1){return new BPromise(function(_0x2b69e8,_0x267a00){return client[_0x5266('0xf')](_0x313874,_0x5b1fc1)[_0x5266('0x10')](function(_0xb3b1ca){logger[_0x5266('0x11')](_0x5266('0x12'),_0x149ab6,_0x5266('0x13'));logger[_0x5266('0x14')](_0x5266('0x15'),_0x149ab6,_0x5266('0x13'),JSON[_0x5266('0x16')](_0xb3b1ca));if(_0xb3b1ca['error']){if(_0xb3b1ca['error']['code']===0x1f4){logger[_0x5266('0x17')](_0x5266('0x12'),_0x149ab6,_0xb3b1ca['error'][_0x5266('0x18')]);return _0x267a00(_0xb3b1ca[_0x5266('0x17')]['message']);}logger[_0x5266('0x17')](_0x5266('0x12'),_0x149ab6,_0xb3b1ca['error']['message']);return _0x2b69e8(_0xb3b1ca[_0x5266('0x17')][_0x5266('0x18')]);}else{logger[_0x5266('0x11')](_0x5266('0x12'),_0x149ab6,_0x5266('0x13'));_0x2b69e8(_0xb3b1ca['result'][_0x5266('0x18')]);}})[_0x5266('0x19')](function(_0x3fff7f){logger['error'](_0x5266('0x12'),_0x149ab6,_0x3fff7f);_0x267a00(_0x3fff7f);});});}exports[_0x5266('0x1a')]=function(_0x3a8b09){var _0x4c4c1f=this;return new Promise(function(_0x5d2c8f,_0x1ed79a){return db['ChatInteraction'][_0x5266('0x1b')](_0x3a8b09[_0x5266('0x1c')],{'raw':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09[_0x5266('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09['options'][_0x5266('0x1e')]||null:null,'attributes':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09[_0x5266('0x1d')][_0x5266('0x1f')]||null:null,'limit':_0x3a8b09[_0x5266('0x1d')]?_0x3a8b09['options']['limit']||null:null})[_0x5266('0x10')](function(_0x3fed6c){logger[_0x5266('0x11')]('UpdateChatInteraction',_0x3a8b09);logger['debug'](_0x5266('0x1a'),_0x3a8b09,JSON[_0x5266('0x16')](_0x3fed6c));_0x5d2c8f(_0x3fed6c);})[_0x5266('0x19')](function(_0x15ddbf){logger[_0x5266('0x17')](_0x5266('0x1a'),_0x15ddbf[_0x5266('0x18')],_0x3a8b09);_0x1ed79a(_0x4c4c1f['error'](0x1f4,_0x15ddbf[_0x5266('0x18')]));});});};exports[_0x5266('0x20')]=function(_0x42aa34){return new Promise(function(_0x575662,_0x28aea5){return db[_0x5266('0x21')][_0x5266('0x22')]({'where':_0x42aa34[_0x5266('0x1d')]?_0x42aa34[_0x5266('0x1d')]['where']||null:null})[_0x5266('0x10')](function(_0x474831){if(_0x474831){return _0x474831[_0x5266('0x23')](_0x42aa34['body']['ids'],_[_0x5266('0x24')](_0x42aa34[_0x5266('0x1c')],[_0x5266('0x25'),'id'])||{});}})['spread'](function(_0x13244e){logger[_0x5266('0x11')](_0x5266('0x26'),_0x42aa34);logger['debug'](_0x5266('0x26'),_0x42aa34,JSON[_0x5266('0x16')](_0x13244e));_0x575662(_0x13244e);})[_0x5266('0x19')](function(_0x331af2){logger['error'](_0x5266('0x26'),_0x331af2[_0x5266('0x18')],_0x42aa34);_0x28aea5(_this[_0x5266('0x17')](0x1f4,_0x331af2[_0x5266('0x18')]));});});};
\ No newline at end of file
+var _0x17b4=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','request','then','info','request\x20sent'];(function(_0x1649ea,_0x422343){var _0x42787d=function(_0x22f3fb){while(--_0x22f3fb){_0x1649ea['push'](_0x1649ea['shift']());}};_0x42787d(++_0x422343);}(_0x17b4,0x89));var _0x417b=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x17b4[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x417b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x417b('0x1'));var rs=require(_0x417b('0x2'));var fs=require('fs');var Redis=require(_0x417b('0x3'));var db=require(_0x417b('0x4'))['db'];var utils=require(_0x417b('0x5'));var logger=require('../../config/logger')(_0x417b('0x6'));var config=require(_0x417b('0x7'));var jayson=require(_0x417b('0x8'));var client=jayson[_0x417b('0x9')]['http']({'port':0x232a});config[_0x417b('0xa')]=_['defaults'](config[_0x417b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2b3cc9,_0x51e32b,_0x2dd1b3){return new BPromise(function(_0x298769,_0x2d5ab9){return client[_0x417b('0xb')](_0x2b3cc9,_0x2dd1b3)[_0x417b('0xc')](function(_0xfd990f){logger[_0x417b('0xd')]('ChatInteraction,\x20%s,\x20%s',_0x51e32b,_0x417b('0xe'));logger['debug'](_0x417b('0xf'),_0x51e32b,_0x417b('0xe'),JSON[_0x417b('0x10')](_0xfd990f));if(_0xfd990f[_0x417b('0x11')]){if(_0xfd990f['error']['code']===0x1f4){logger[_0x417b('0x11')](_0x417b('0x12'),_0x51e32b,_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);return _0x2d5ab9(_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);}logger[_0x417b('0x11')](_0x417b('0x12'),_0x51e32b,_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);return _0x298769(_0xfd990f[_0x417b('0x11')][_0x417b('0x13')]);}else{logger['info'](_0x417b('0x12'),_0x51e32b,_0x417b('0xe'));_0x298769(_0xfd990f[_0x417b('0x14')][_0x417b('0x13')]);}})[_0x417b('0x15')](function(_0x4e60c4){logger[_0x417b('0x11')](_0x417b('0x12'),_0x51e32b,_0x4e60c4);_0x2d5ab9(_0x4e60c4);});});}exports[_0x417b('0x16')]=function(_0x4b4a0f){var _0x1ee16d=this;return new Promise(function(_0x2c73b7,_0x25979b){return db[_0x417b('0x17')][_0x417b('0x18')](_0x4b4a0f[_0x417b('0x19')],{'raw':_0x4b4a0f[_0x417b('0x1a')]?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b4a0f[_0x417b('0x1a')]?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1c')]||null:null,'attributes':_0x4b4a0f[_0x417b('0x1a')]?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1d')]||null:null,'limit':_0x4b4a0f['options']?_0x4b4a0f[_0x417b('0x1a')][_0x417b('0x1e')]||null:null})['then'](function(_0x20c1ab){logger[_0x417b('0xd')](_0x417b('0x16'),_0x4b4a0f);logger['debug'](_0x417b('0x16'),_0x4b4a0f,JSON['stringify'](_0x20c1ab));_0x2c73b7(_0x20c1ab);})[_0x417b('0x15')](function(_0x18c455){logger[_0x417b('0x11')](_0x417b('0x16'),_0x18c455[_0x417b('0x13')],_0x4b4a0f);_0x25979b(_0x1ee16d[_0x417b('0x11')](0x1f4,_0x18c455['message']));});});};exports[_0x417b('0x1f')]=function(_0x52cc58){return new Promise(function(_0x4bf260,_0x15d5c5){return db[_0x417b('0x17')][_0x417b('0x20')]({'where':_0x52cc58[_0x417b('0x1a')]?_0x52cc58[_0x417b('0x1a')][_0x417b('0x1c')]||null:null})['then'](function(_0x32f791){if(_0x32f791){return _0x32f791[_0x417b('0x21')](_0x52cc58['body'][_0x417b('0x22')],_[_0x417b('0x23')](_0x52cc58[_0x417b('0x19')],[_0x417b('0x22'),'id'])||{});}})[_0x417b('0x24')](function(_0x505074){logger[_0x417b('0xd')](_0x417b('0x25'),_0x52cc58);logger['debug'](_0x417b('0x25'),_0x52cc58,JSON[_0x417b('0x10')](_0x505074));_0x4bf260(_0x505074);})[_0x417b('0x15')](function(_0x411483){logger[_0x417b('0x11')]('AddTags',_0x411483['message'],_0x52cc58);_0x15d5c5(_this[_0x417b('0x11')](0x1f4,_0x411483[_0x417b('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 178a9aa..b8cf917 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 _0xd689=['save','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x56faeb,_0xc940de){var _0x1b96a9=function(_0x3cdf68){while(--_0x3cdf68){_0x56faeb['push'](_0x56faeb['shift']());}};_0x1b96a9(++_0xc940de);}(_0xd689,0x1cd));var _0x9d68=function(_0x305c8f,_0xc5f7fb){_0x305c8f=_0x305c8f-0x0;var _0x5ddc30=_0xd689[_0x305c8f];return _0x5ddc30;};'use strict';var ChatInteractionEvents=require(_0x9d68('0x0'));var events=[_0x9d68('0x1'),'remove',_0x9d68('0x2')];function createListener(_0x5e8ddc,_0x443d35){return function(_0x4243c8){_0x443d35[_0x9d68('0x3')](_0x5e8ddc,_0x4243c8);};}function removeListener(_0x493d93,_0x4fc29d){return function(){ChatInteractionEvents[_0x9d68('0x4')](_0x493d93,_0x4fc29d);};}exports[_0x9d68('0x5')]=function(_0x58ebd6){for(var _0x492239=0x0,_0x160f4c=events['length'];_0x492239<_0x160f4c;_0x492239++){var _0x438093=events[_0x492239];var _0x27af52=createListener(_0x9d68('0x6')+_0x438093,_0x58ebd6);ChatInteractionEvents['on'](_0x438093,_0x27af52);}};
\ No newline at end of file
+var _0xe801=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x3aaac1,_0x4222b9){var _0x3e2469=function(_0x2734e3){while(--_0x2734e3){_0x3aaac1['push'](_0x3aaac1['shift']());}};_0x3e2469(++_0x4222b9);}(_0xe801,0x69));var _0x1e80=function(_0xce31d3,_0x271f26){_0xce31d3=_0xce31d3-0x0;var _0x3fb648=_0xe801[_0xce31d3];return _0x3fb648;};'use strict';var ChatInteractionEvents=require(_0x1e80('0x0'));var events=[_0x1e80('0x1'),_0x1e80('0x2'),_0x1e80('0x3')];function createListener(_0x4a0db2,_0x50359e){return function(_0x28049f){_0x50359e[_0x1e80('0x4')](_0x4a0db2,_0x28049f);};}function removeListener(_0x68e655,_0x41ee15){return function(){ChatInteractionEvents[_0x1e80('0x5')](_0x68e655,_0x41ee15);};}exports[_0x1e80('0x6')]=function(_0x5d93a7){for(var _0x27b027=0x0,_0x26d5f0=events['length'];_0x27b027<_0x26d5f0;_0x27b027++){var _0x566744=events[_0x27b027];var _0x4893d6=createListener(_0x1e80('0x7')+_0x566744,_0x5d93a7);ChatInteractionEvents['on'](_0x566744,_0x4893d6);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index e534762..61d71ab 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 _0x916c=['chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','removeTags','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','get','/:id/my_messages','getMyMessages','/:id/download','create','post','createVidaooSession','diskStorage','root','format','%s-%s','originalname','single','file','/:id/messages','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x916c,0x152));var _0xc916=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0x916c[_0x2df1f2];return _0x38652b;};'use strict';var multer=require(_0xc916('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc916('0x1'));var express=require('express');var router=express[_0xc916('0x2')]();var fs_extra=require(_0xc916('0x3'));var auth=require(_0xc916('0x4'));var interaction=require(_0xc916('0x5'));var config=require('../../config/environment');var controller=require(_0xc916('0x6'));router['get']('/',auth[_0xc916('0x7')](),controller[_0xc916('0x8')]);router['get'](_0xc916('0x9'),auth[_0xc916('0x7')](),controller[_0xc916('0xa')]);router['get'](_0xc916('0xb'),auth[_0xc916('0xc')](),controller[_0xc916('0xd')]);router['get']('/:id/attachment_download',auth[_0xc916('0xc')](),controller[_0xc916('0xe')]);router['get']('/:id/messages',auth[_0xc916('0x7')](),controller[_0xc916('0xf')]);router[_0xc916('0x10')](_0xc916('0x11'),auth[_0xc916('0xc')](),controller[_0xc916('0x12')]);router[_0xc916('0x10')](_0xc916('0x13'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xc916('0x14')]);router[_0xc916('0x15')]('/:id/vidaoo',auth[_0xc916('0x7')](),controller[_0xc916('0x16')]);var upload=multer({'storage':multer[_0xc916('0x17')]({'destination':function(_0x312a19,_0x3730f1,_0x49a95d){_0x49a95d(null,path['join'](config[_0xc916('0x18')],'server/files/attachments/'));},'filename':function(_0x5a142b,_0x3ff957,_0x3868cf){_0x3868cf(null,util[_0xc916('0x19')](_0xc916('0x1a'),Date['now'](),_0x3ff957[_0xc916('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc916('0x15')]('/:id/attachment_upload',upload[_0xc916('0x1c')](_0xc916('0x1d')),controller['attachmentUpload']);router[_0xc916('0x15')](_0xc916('0x1e'),auth[_0xc916('0xc')](),controller[_0xc916('0x1f')]);router['post'](_0xc916('0x20'),auth[_0xc916('0x7')](),interaction['tracked']('chat',_0xc916('0x21')),controller[_0xc916('0x22')]);router[_0xc916('0x23')](_0xc916('0xb'),auth['isAuthenticated'](),interaction[_0xc916('0x24')](_0xc916('0x25'),_0xc916('0x26')),controller[_0xc916('0x27')]);router[_0xc916('0x23')]('/:id/custom_update',controller[_0xc916('0x28')]);router[_0xc916('0x23')](_0xc916('0x29'),auth[_0xc916('0xc')](),controller[_0xc916('0x2a')]);router['put'](_0xc916('0x2b'),controller['close']);router['delete'](_0xc916('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xc916('0x25'),_0xc916('0x2c')),controller['destroy']);router['delete'](_0xc916('0x20'),auth[_0xc916('0x7')](),controller[_0xc916('0x2d')]);module[_0xc916('0x2e')]=router;
\ No newline at end of file
+var _0x894f=['file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','createVidaooSession','root','%s-%s','now','originalname','/:id/attachment_upload','single'];(function(_0x107abb,_0x4d0688){var _0x4c746c=function(_0x1750b4){while(--_0x1750b4){_0x107abb['push'](_0x107abb['shift']());}};_0x4c746c(++_0x4d0688);}(_0x894f,0xd5));var _0xf894=function(_0x3ffaf7,_0x503a5a){_0x3ffaf7=_0x3ffaf7-0x0;var _0x172e99=_0x894f[_0x3ffaf7];return _0x172e99;};'use strict';var multer=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var path=require(_0xf894('0x2'));var timeout=require(_0xf894('0x3'));var express=require(_0xf894('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf894('0x5'));var interaction=require(_0xf894('0x6'));var config=require(_0xf894('0x7'));var controller=require(_0xf894('0x8'));router[_0xf894('0x9')]('/',auth[_0xf894('0xa')](),controller[_0xf894('0xb')]);router[_0xf894('0x9')](_0xf894('0xc'),auth[_0xf894('0xa')](),controller[_0xf894('0xd')]);router[_0xf894('0x9')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0xf894('0xe')]);router[_0xf894('0x9')](_0xf894('0xf'),auth[_0xf894('0x10')](),controller[_0xf894('0x11')]);router[_0xf894('0x9')](_0xf894('0x12'),auth[_0xf894('0xa')](),controller[_0xf894('0x13')]);router[_0xf894('0x9')](_0xf894('0x14'),auth[_0xf894('0x10')](),controller[_0xf894('0x15')]);router[_0xf894('0x9')](_0xf894('0x16'),auth[_0xf894('0xa')](),controller['download']);router[_0xf894('0x17')]('/',auth[_0xf894('0xa')](),controller['create']);router[_0xf894('0x17')](_0xf894('0x18'),auth[_0xf894('0xa')](),controller[_0xf894('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xcc4a0c,_0x2a6475,_0x55187f){_0x55187f(null,path['join'](config[_0xf894('0x1a')],'server/files/attachments/'));},'filename':function(_0xa442db,_0x583951,_0x482aab){_0x482aab(null,util['format'](_0xf894('0x1b'),Date[_0xf894('0x1c')](),_0x583951[_0xf894('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf894('0x1e'),upload[_0xf894('0x1f')](_0xf894('0x20')),controller[_0xf894('0x21')]);router[_0xf894('0x17')](_0xf894('0x12'),auth[_0xf894('0x10')](),controller[_0xf894('0x22')]);router[_0xf894('0x17')]('/:id/tags',auth[_0xf894('0xa')](),interaction[_0xf894('0x23')](_0xf894('0x24'),_0xf894('0x25')),controller['addTags']);router[_0xf894('0x26')](_0xf894('0x27'),auth[_0xf894('0xa')](),interaction['tracked']('chat',_0xf894('0x28')),controller[_0xf894('0x29')]);router[_0xf894('0x26')](_0xf894('0x2a'),controller[_0xf894('0x2b')]);router[_0xf894('0x26')]('/:id/abandon',auth[_0xf894('0x10')](),controller['abandon']);router[_0xf894('0x26')]('/:id/close',controller['close']);router[_0xf894('0x2c')](_0xf894('0x27'),auth[_0xf894('0xa')](),interaction[_0xf894('0x23')](_0xf894('0x24'),'chatinteraction:destroy'),controller[_0xf894('0x2d')]);router['delete'](_0xf894('0x2e'),auth[_0xf894('0xa')](),controller[_0xf894('0x2f')]);module[_0xf894('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 6d1fe01..ac4a00e 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 _0x2354=['exports','TEXT','medium','INTEGER'];(function(_0x5d124d,_0x2b5378){var _0x99203=function(_0x1c339e){while(--_0x1c339e){_0x5d124d['push'](_0x5d124d['shift']());}};_0x99203(++_0x2b5378);}(_0x2354,0x84));var _0x4235=function(_0x63ba8,_0x5b4583){_0x63ba8=_0x63ba8-0x0;var _0x93620c=_0x2354[_0x63ba8];return _0x93620c;};'use strict';var Sequelize=require('sequelize');module[_0x4235('0x0')]={'body':{'type':Sequelize[_0x4235('0x1')](_0x4235('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4235('0x3')]}};
\ No newline at end of file
+var _0xd95d=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd95d,0x16e));var _0xdd95=function(_0x3adb1e,_0x2145b0){_0x3adb1e=_0x3adb1e-0x0;var _0xe5dba9=_0xd95d[_0x3adb1e];return _0xe5dba9;};'use strict';var Sequelize=require(_0xdd95('0x0'));module[_0xdd95('0x1')]={'body':{'type':Sequelize[_0xdd95('0x2')](_0xdd95('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdd95('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdd95('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 61dd431..fefc494 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 _0xad5a=['lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','messages','createdAt','lastMessageAt','format'];(function(_0x8d7430,_0x503f1c){var _0x51797b=function(_0x319a74){while(--_0x319a74){_0x8d7430['push'](_0x8d7430['shift']());}};_0x51797b(++_0x503f1c);}(_0xad5a,0x91));var _0xaad5=function(_0x176a00,_0x421b0e){_0x176a00=_0x176a00-0x0;var _0x1f2c82=_0xad5a[_0x176a00];return _0x1f2c82;};'use strict';var emlformat=require(_0xaad5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaad5('0x1'));var jsonpatch=require(_0xaad5('0x2'));var rp=require(_0xaad5('0x3'));var moment=require(_0xaad5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaad5('0x5'));var util=require(_0xaad5('0x6'));var path=require(_0xaad5('0x7'));var sox=require(_0xaad5('0x8'));var csv=require(_0xaad5('0x9'));var ejs=require(_0xaad5('0xa'));var fs=require('fs');var fs_extra=require(_0xaad5('0xb'));var _=require('lodash');var squel=require(_0xaad5('0xc'));var crypto=require(_0xaad5('0xd'));var jsforce=require(_0xaad5('0xe'));var deskjs=require(_0xaad5('0xf'));var toCsv=require(_0xaad5('0x9'));var querystring=require(_0xaad5('0x10'));var Papa=require(_0xaad5('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaad5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaad5('0x13'));var logger=require('../../config/logger')(_0xaad5('0x14'));var utils=require(_0xaad5('0x15'));var config=require(_0xaad5('0x16'));var licenseUtil=require(_0xaad5('0x17'));var db=require(_0xaad5('0x18'))['db'];config[_0xaad5('0x19')]=_[_0xaad5('0x1a')](config[_0xaad5('0x19')],{'host':_0xaad5('0x1b'),'port':0x18eb});var socket=require(_0xaad5('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xaad5('0x1d')](socket);function respondWithStatusCode(_0x1c7501,_0x175fe9){_0x175fe9=_0x175fe9||0xcc;return function(_0x58a375){if(_0x58a375){return _0x1c7501['sendStatus'](_0x175fe9);}return _0x1c7501[_0xaad5('0x1e')](_0x175fe9)[_0xaad5('0x1f')]();};}function respondWithResult(_0x5bab1d,_0x3ac99a){_0x3ac99a=_0x3ac99a||0xc8;return function(_0x1934dd){if(_0x1934dd){return _0x5bab1d[_0xaad5('0x1e')](_0x3ac99a)[_0xaad5('0x20')](_0x1934dd);}};}function respondWithFilteredResult(_0x2187c5,_0x45a110){return function(_0x3c64d8){if(_0x3c64d8){var _0x728823=typeof _0x45a110[_0xaad5('0x21')]===_0xaad5('0x22')&&typeof _0x45a110['limit']===_0xaad5('0x22');var _0x31a0aa=_0x3c64d8['count'];var _0x25b6cd=_0x728823?0x0:_0x45a110[_0xaad5('0x21')];var _0x38dd98=_0x728823?_0x3c64d8[_0xaad5('0x23')]:_0x45a110['offset']+_0x45a110[_0xaad5('0x24')];var _0x299ec0;if(_0x38dd98>=_0x31a0aa){_0x38dd98=_0x31a0aa;_0x299ec0=0xc8;}else{_0x299ec0=0xce;}_0x2187c5[_0xaad5('0x1e')](_0x299ec0);return _0x2187c5[_0xaad5('0x25')](_0xaad5('0x26'),_0x25b6cd+'-'+_0x38dd98+'/'+_0x31a0aa)['json'](_0x3c64d8);}return null;};}function patchUpdates(_0x11e3e6){return function(_0x1af9ab){try{jsonpatch['apply'](_0x1af9ab,_0x11e3e6,!![]);}catch(_0x49458c){return BPromise[_0xaad5('0x27')](_0x49458c);}return _0x1af9ab[_0xaad5('0x28')]();};}function saveUpdates(_0x2ce312,_0x30cc5c){return function(_0x117484){if(_0x117484){return _0x117484[_0xaad5('0x29')](_0x2ce312)['then'](function(_0x161d77){return _0x161d77;});}return null;};}function removeEntity(_0x4546cc,_0x4fda48){return function(_0x2126eb){if(_0x2126eb){return _0x2126eb[_0xaad5('0x2a')]()[_0xaad5('0x2b')](function(){_0x4546cc[_0xaad5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b4a6f,_0x160376){return function(_0x1d7c93){if(!_0x1d7c93){_0x1b4a6f[_0xaad5('0x2c')](0x194);}return _0x1d7c93;};}function handleError(_0x1d0e30,_0x3e3237){_0x3e3237=_0x3e3237||0x1f4;return function(_0x1712df){logger[_0xaad5('0x2d')](_0x1712df[_0xaad5('0x2e')]);if(_0x1712df['name']){delete _0x1712df[_0xaad5('0x2f')];}_0x1d0e30[_0xaad5('0x1e')](_0x3e3237)[_0xaad5('0x30')](_0x1712df);};}exports[_0xaad5('0x31')]=function(_0x386f7f,_0x400d34){var _0x1c0dad={},_0x15efa2={},_0x495f56={'count':0x0,'rows':[]};var _0x2bc080=_['map'](db[_0xaad5('0x32')][_0xaad5('0x33')],function(_0x56f390){return{'name':_0x56f390[_0xaad5('0x34')],'type':_0x56f390[_0xaad5('0x35')]['key']};});_0x15efa2[_0xaad5('0x36')]=_[_0xaad5('0x37')](_0x2bc080,_0xaad5('0x2f'));_0x15efa2[_0xaad5('0x38')]=_[_0xaad5('0x39')](_0x386f7f[_0xaad5('0x38')]);_0x15efa2[_0xaad5('0x3a')]=_[_0xaad5('0x3b')](_0x15efa2[_0xaad5('0x36')],_0x15efa2[_0xaad5('0x38')]);_0x1c0dad[_0xaad5('0x3c')]=_[_0xaad5('0x3b')](_0x15efa2['model'],qs[_0xaad5('0x3d')](_0x386f7f[_0xaad5('0x38')]['fields']));_0x1c0dad[_0xaad5('0x3c')]=_0x1c0dad['attributes'][_0xaad5('0x3e')]?_0x1c0dad[_0xaad5('0x3c')]:_0x15efa2[_0xaad5('0x36')];if(!_0x386f7f['query'][_0xaad5('0x3f')](_0xaad5('0x40'))){_0x1c0dad[_0xaad5('0x24')]=qs[_0xaad5('0x24')](_0x386f7f[_0xaad5('0x38')][_0xaad5('0x24')]);_0x1c0dad['offset']=qs[_0xaad5('0x21')](_0x386f7f[_0xaad5('0x38')][_0xaad5('0x21')]);}_0x1c0dad['order']=qs[_0xaad5('0x41')](_0x386f7f[_0xaad5('0x38')][_0xaad5('0x41')]);_0x1c0dad['where']=qs[_0xaad5('0x3a')](_['pick'](_0x386f7f[_0xaad5('0x38')],_0x15efa2['filters']),_0x2bc080);if(_0x386f7f[_0xaad5('0x38')][_0xaad5('0x42')]){_0x1c0dad[_0xaad5('0x43')]=_[_0xaad5('0x44')](_0x1c0dad[_0xaad5('0x43')],{'$or':_[_0xaad5('0x37')](_0x2bc080,function(_0x5b083a){if(_0x5b083a[_0xaad5('0x35')]!==_0xaad5('0x45')){var _0x4eb191={};_0x4eb191[_0x5b083a[_0xaad5('0x2f')]]={'$like':'%'+_0x386f7f[_0xaad5('0x38')][_0xaad5('0x42')]+'%'};return _0x4eb191;}})});}_0x1c0dad=_[_0xaad5('0x44')]({},_0x1c0dad,_0x386f7f[_0xaad5('0x46')]);var _0x2293f8={'where':_0x1c0dad['where']};return db[_0xaad5('0x32')][_0xaad5('0x23')](_0x2293f8)[_0xaad5('0x2b')](function(_0x2fd72c){_0x495f56['count']=_0x2fd72c;if(_0x386f7f[_0xaad5('0x38')]['includeAll']){_0x1c0dad[_0xaad5('0x47')]=[{'all':!![]}];}return db[_0xaad5('0x32')][_0xaad5('0x48')](_0x1c0dad);})['then'](function(_0x55f82a){_0x495f56['rows']=_0x55f82a;return _0x495f56;})['then'](respondWithFilteredResult(_0x400d34,_0x1c0dad))[_0xaad5('0x49')](handleError(_0x400d34,null));};exports[_0xaad5('0x4a')]=function(_0xfeb2ca,_0x153745){var _0x2cd9bb={'raw':!![],'where':{'id':_0xfeb2ca[_0xaad5('0x4b')]['id']}},_0xfc29c7={};_0xfc29c7[_0xaad5('0x36')]=_[_0xaad5('0x39')](db[_0xaad5('0x32')][_0xaad5('0x33')]);_0xfc29c7[_0xaad5('0x38')]=_[_0xaad5('0x39')](_0xfeb2ca['query']);_0xfc29c7[_0xaad5('0x3a')]=_[_0xaad5('0x3b')](_0xfc29c7['model'],_0xfc29c7['query']);_0x2cd9bb['attributes']=_['intersection'](_0xfc29c7[_0xaad5('0x36')],qs['fields'](_0xfeb2ca[_0xaad5('0x38')][_0xaad5('0x3d')]));_0x2cd9bb[_0xaad5('0x3c')]=_0x2cd9bb[_0xaad5('0x3c')]['length']?_0x2cd9bb[_0xaad5('0x3c')]:_0xfc29c7['model'];if(_0xfeb2ca[_0xaad5('0x38')][_0xaad5('0x4c')]){_0x2cd9bb[_0xaad5('0x47')]=[{'all':!![]}];}_0x2cd9bb=_[_0xaad5('0x44')]({},_0x2cd9bb,_0xfeb2ca[_0xaad5('0x46')]);return db['ChatInternalMessage'][_0xaad5('0x4d')](_0x2cd9bb)[_0xaad5('0x2b')](handleEntityNotFound(_0x153745,null))['then'](respondWithResult(_0x153745,null))[_0xaad5('0x49')](handleError(_0x153745,null));};exports['create']=function(_0x45011b,_0x40262d){return db[_0xaad5('0x32')][_0xaad5('0x4e')](_0x45011b[_0xaad5('0x4f')],{})[_0xaad5('0x2b')](respondWithResult(_0x40262d,0xc9))[_0xaad5('0x49')](handleError(_0x40262d,null));};exports['update']=function(_0x193da6,_0x2cd0bc){if(_0x193da6[_0xaad5('0x4f')]['id']){delete _0x193da6[_0xaad5('0x4f')]['id'];}return db['ChatInternalMessage'][_0xaad5('0x4d')]({'where':{'id':_0x193da6[_0xaad5('0x4b')]['id']}})[_0xaad5('0x2b')](handleEntityNotFound(_0x2cd0bc,null))['then'](saveUpdates(_0x193da6[_0xaad5('0x4f')],null))[_0xaad5('0x2b')](respondWithResult(_0x2cd0bc,null))[_0xaad5('0x49')](handleError(_0x2cd0bc,null));};exports[_0xaad5('0x2a')]=function(_0x44fb29,_0x470910){return db[_0xaad5('0x32')][_0xaad5('0x4d')]({'where':{'id':_0x44fb29['params']['id']}})['then'](handleEntityNotFound(_0x470910,null))[_0xaad5('0x2b')](removeEntity(_0x470910,null))[_0xaad5('0x49')](handleError(_0x470910,null));};exports[_0xaad5('0x50')]=function(_0x579a01,_0x3bcedc){return db[_0xaad5('0x32')][_0xaad5('0x50')]()[_0xaad5('0x2b')](respondWithResult(_0x3bcedc,null))[_0xaad5('0x49')](handleError(_0x3bcedc,null));};function wrapUser(_0x298674){return function(_0x4067da){var _0x19117b=_0x298674['get']({'plain':!![]});_0x19117b[_0xaad5('0x51')]=[];if(_0x4067da){_0x19117b['lastMessageAt']=_0x4067da[_0xaad5('0x52')];_0x19117b['lastMessage']=_0x4067da;}else{_0x19117b[_0xaad5('0x53')]=moment(0x0)[_0xaad5('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x19117b[_0xaad5('0x55')]={};}return _0x19117b;};}exports[_0xaad5('0x56')]=function(_0x2d18e7,_0x18a175,_0x4452a0){var _0x12a4b7=[];return db[_0xaad5('0x57')][_0xaad5('0x48')]({'where':{'role':[_0xaad5('0x58'),_0xaad5('0x59'),_0xaad5('0x5a')]},'attributes':['id',_0xaad5('0x5b'),_0xaad5('0x2f'),_0xaad5('0x5c'),_0xaad5('0x5d'),_0xaad5('0x5e'),_0xaad5('0x5f'),_0xaad5('0x60'),'allowmessenger',_0xaad5('0x61')],'order':qs[_0xaad5('0x41')](_0xaad5('0x62')),'include':[{'model':db[_0xaad5('0x63')],'as':_0xaad5('0x64'),'attributes':['id',_0xaad5('0x2f'),_0xaad5('0x35')],'through':{'attributes':[]}}]})[_0xaad5('0x2b')](function(_0x43f6ee){if(_0x43f6ee){var _0x2737c3=_0x2d18e7[_0xaad5('0x5a')][_0xaad5('0x65')]({'plain':!![]});if(!_0x2737c3)throw new Error(_0xaad5('0x66'));if(_0x2737c3['role']===_0xaad5('0x5a')){return db[_0xaad5('0x67')][_0xaad5('0x4d')]({'where':{'name':_0xaad5('0x68'),'userProfileId':_0x2737c3[_0xaad5('0x69')]},'raw':!![]})[_0xaad5('0x2b')](function(_0x581234){if(_0x581234){if(_0x581234[_0xaad5('0x6a')]===0x0){return db[_0xaad5('0x6b')][_0xaad5('0x48')]({'where':{'sectionId':_0x581234['id']},'raw':!![]})[_0xaad5('0x2b')](function(_0x9bdff5){var _0x4cd693=[];if(_[_0xaad5('0x6c')](_0x9bdff5)){_0x4cd693=_[_0xaad5('0x42')](_0x43f6ee,function(_0x10c980){if(_0x10c980[_0xaad5('0x5c')]!==_0xaad5('0x58')){return _0x10c980;}});return _0x4cd693;}else{for(var _0x488dea=0x0;_0x488dea<_0x43f6ee[_0xaad5('0x3e')];_0x488dea++){var _0x1d4349=_0x43f6ee[_0x488dea];if(_0x1d4349[_0xaad5('0x5c')]===_0xaad5('0x58')){var _0x17a84c=_['find'](_0x9bdff5,function(_0x383de9){return _0x383de9[_0xaad5('0x6d')]===_0x1d4349['id'];});if(_0x17a84c)_0x4cd693[_0xaad5('0x6e')](_0x1d4349);}else{_0x4cd693[_0xaad5('0x6e')](_0x1d4349);}}return _0x4cd693;}});}else{return _0x43f6ee;}}else{var _0x5bf25c=_[_0xaad5('0x42')](_0x43f6ee,function(_0x5adc99){if(_0x5adc99[_0xaad5('0x5c')]!=='agent'){return _0x5adc99;}});return _0x5bf25c;}});}else{return _0x43f6ee;}}})[_0xaad5('0x2b')](function(_0x1d0c39){var _0xb998e8=[];if(_0x1d0c39){_0x12a4b7=_0x1d0c39;for(var _0x12a21a=0x0;_0x12a21a<_0x1d0c39['length'];_0x12a21a+=0x1){_0x12a4b7[_0x12a21a][_0xaad5('0x51')]=[];_0xb998e8[_0xaad5('0x6e')](db[_0xaad5('0x32')]['find']({'where':{'FromId':[_0x2d18e7[_0xaad5('0x5a')]['id'],_0x1d0c39[_0x12a21a]['id']],'ToId':[_0x2d18e7['user']['id'],_0x1d0c39[_0x12a21a]['id']],'ChatGroupId':null},'attributes':['id',_0xaad5('0x52'),_0xaad5('0x6f'),_0xaad5('0x70'),'read',_0xaad5('0x4f')],'order':qs['sort'](_0xaad5('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xaad5('0x2b')](wrapUser(_0x1d0c39[_0x12a21a])));}return BPromise[_0xaad5('0x72')](_0xb998e8);}return[];})['then'](function(_0x212e5e){return{'rows':_0x212e5e,'count':_0x212e5e[_0xaad5('0x3e')]};})[_0xaad5('0x2b')](respondWithResult(_0x18a175,null))[_0xaad5('0x49')](handleError(_0x18a175,null));};
\ No newline at end of file
+var _0x5e4a=['params','rawAttributes','catch','create','body','find','describe','messages','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','fullname','role','userpic','online','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','createdAt','FromId','ToId','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','ChatInternalMessage','findAll','rows'];(function(_0xe503ff,_0xc9e5e4){var _0x345c46=function(_0x3f6bc7){while(--_0x3f6bc7){_0xe503ff['push'](_0xe503ff['shift']());}};_0x345c46(++_0xc9e5e4);}(_0x5e4a,0xf3));var _0xa5e4=function(_0x5a42b2,_0x49e23f){_0x5a42b2=_0x5a42b2-0x0;var _0x6fa38d=_0x5e4a[_0x5a42b2];return _0x6fa38d;};'use strict';var emlformat=require(_0xa5e4('0x0'));var rimraf=require(_0xa5e4('0x1'));var zipdir=require(_0xa5e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5e4('0x3'));var moment=require(_0xa5e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5e4('0x5'));var util=require(_0xa5e4('0x6'));var path=require('path');var sox=require(_0xa5e4('0x7'));var csv=require(_0xa5e4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5e4('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa5e4('0xa'));var jsforce=require(_0xa5e4('0xb'));var deskjs=require(_0xa5e4('0xc'));var toCsv=require(_0xa5e4('0x8'));var querystring=require(_0xa5e4('0xd'));var Papa=require('papaparse');var Redis=require(_0xa5e4('0xe'));var authService=require(_0xa5e4('0xf'));var qs=require(_0xa5e4('0x10'));var as=require(_0xa5e4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa5e4('0x12'));var utils=require(_0xa5e4('0x13'));var config=require(_0xa5e4('0x14'));var licenseUtil=require(_0xa5e4('0x15'));var db=require(_0xa5e4('0x16'))['db'];config['redis']=_[_0xa5e4('0x17')](config[_0xa5e4('0x18')],{'host':_0xa5e4('0x19'),'port':0x18eb});var socket=require(_0xa5e4('0x1a'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xa5e4('0x1b')](socket);function respondWithStatusCode(_0xe84edd,_0x2a6440){_0x2a6440=_0x2a6440||0xcc;return function(_0x4a79bc){if(_0x4a79bc){return _0xe84edd['sendStatus'](_0x2a6440);}return _0xe84edd[_0xa5e4('0x1c')](_0x2a6440)['end']();};}function respondWithResult(_0x533a52,_0x4a5416){_0x4a5416=_0x4a5416||0xc8;return function(_0x3bd692){if(_0x3bd692){return _0x533a52[_0xa5e4('0x1c')](_0x4a5416)[_0xa5e4('0x1d')](_0x3bd692);}};}function respondWithFilteredResult(_0x1901f6,_0x165fa3){return function(_0x164a21){if(_0x164a21){var _0x51ebee=typeof _0x165fa3['offset']===_0xa5e4('0x1e')&&typeof _0x165fa3[_0xa5e4('0x1f')]===_0xa5e4('0x1e');var _0x176b21=_0x164a21[_0xa5e4('0x20')];var _0x1d3622=_0x51ebee?0x0:_0x165fa3[_0xa5e4('0x21')];var _0x2c957a=_0x51ebee?_0x164a21[_0xa5e4('0x20')]:_0x165fa3[_0xa5e4('0x21')]+_0x165fa3['limit'];var _0x26185b;if(_0x2c957a>=_0x176b21){_0x2c957a=_0x176b21;_0x26185b=0xc8;}else{_0x26185b=0xce;}_0x1901f6[_0xa5e4('0x1c')](_0x26185b);return _0x1901f6['set'](_0xa5e4('0x22'),_0x1d3622+'-'+_0x2c957a+'/'+_0x176b21)[_0xa5e4('0x1d')](_0x164a21);}return null;};}function patchUpdates(_0x3fe2d8){return function(_0x297820){try{jsonpatch[_0xa5e4('0x23')](_0x297820,_0x3fe2d8,!![]);}catch(_0x21e677){return BPromise[_0xa5e4('0x24')](_0x21e677);}return _0x297820[_0xa5e4('0x25')]();};}function saveUpdates(_0x200ce1,_0x584631){return function(_0x3eb5ad){if(_0x3eb5ad){return _0x3eb5ad[_0xa5e4('0x26')](_0x200ce1)['then'](function(_0x51b027){return _0x51b027;});}return null;};}function removeEntity(_0x2ed137,_0x43311a){return function(_0x426967){if(_0x426967){return _0x426967[_0xa5e4('0x27')]()[_0xa5e4('0x28')](function(){_0x2ed137[_0xa5e4('0x1c')](0xcc)[_0xa5e4('0x29')]();});}};}function handleEntityNotFound(_0x3a5d08,_0xe4e21f){return function(_0xbc8455){if(!_0xbc8455){_0x3a5d08[_0xa5e4('0x2a')](0x194);}return _0xbc8455;};}function handleError(_0x59204b,_0x2290cc){_0x2290cc=_0x2290cc||0x1f4;return function(_0x4d0859){logger[_0xa5e4('0x2b')](_0x4d0859[_0xa5e4('0x2c')]);if(_0x4d0859[_0xa5e4('0x2d')]){delete _0x4d0859[_0xa5e4('0x2d')];}_0x59204b['status'](_0x2290cc)[_0xa5e4('0x2e')](_0x4d0859);};}exports[_0xa5e4('0x2f')]=function(_0x5a6ba8,_0xf2498a){var _0x2ca8d6={},_0x34d2d4={},_0x4e4df6={'count':0x0,'rows':[]};var _0x4fcb5c=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x52ee6b){return{'name':_0x52ee6b[_0xa5e4('0x30')],'type':_0x52ee6b[_0xa5e4('0x31')][_0xa5e4('0x32')]};});_0x34d2d4[_0xa5e4('0x33')]=_['map'](_0x4fcb5c,_0xa5e4('0x2d'));_0x34d2d4[_0xa5e4('0x34')]=_[_0xa5e4('0x35')](_0x5a6ba8['query']);_0x34d2d4[_0xa5e4('0x36')]=_[_0xa5e4('0x37')](_0x34d2d4['model'],_0x34d2d4[_0xa5e4('0x34')]);_0x2ca8d6['attributes']=_[_0xa5e4('0x37')](_0x34d2d4[_0xa5e4('0x33')],qs[_0xa5e4('0x38')](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x38')]));_0x2ca8d6[_0xa5e4('0x39')]=_0x2ca8d6['attributes'][_0xa5e4('0x3a')]?_0x2ca8d6[_0xa5e4('0x39')]:_0x34d2d4['model'];if(!_0x5a6ba8['query'][_0xa5e4('0x3b')](_0xa5e4('0x3c'))){_0x2ca8d6[_0xa5e4('0x1f')]=qs[_0xa5e4('0x1f')](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x1f')]);_0x2ca8d6['offset']=qs[_0xa5e4('0x21')](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x21')]);}_0x2ca8d6['order']=qs['sort'](_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x3d')]);_0x2ca8d6[_0xa5e4('0x3e')]=qs['filters'](_[_0xa5e4('0x3f')](_0x5a6ba8['query'],_0x34d2d4[_0xa5e4('0x36')]),_0x4fcb5c);if(_0x5a6ba8['query'][_0xa5e4('0x40')]){_0x2ca8d6['where']=_[_0xa5e4('0x41')](_0x2ca8d6[_0xa5e4('0x3e')],{'$or':_['map'](_0x4fcb5c,function(_0x4a2881){if(_0x4a2881[_0xa5e4('0x31')]!=='VIRTUAL'){var _0x2cfc51={};_0x2cfc51[_0x4a2881[_0xa5e4('0x2d')]]={'$like':'%'+_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x40')]+'%'};return _0x2cfc51;}})});}_0x2ca8d6=_['merge']({},_0x2ca8d6,_0x5a6ba8[_0xa5e4('0x42')]);var _0x388b41={'where':_0x2ca8d6['where']};return db['ChatInternalMessage']['count'](_0x388b41)['then'](function(_0x40126b){_0x4e4df6[_0xa5e4('0x20')]=_0x40126b;if(_0x5a6ba8[_0xa5e4('0x34')][_0xa5e4('0x43')]){_0x2ca8d6[_0xa5e4('0x44')]=[{'all':!![]}];}return db[_0xa5e4('0x45')][_0xa5e4('0x46')](_0x2ca8d6);})[_0xa5e4('0x28')](function(_0x294939){_0x4e4df6[_0xa5e4('0x47')]=_0x294939;return _0x4e4df6;})['then'](respondWithFilteredResult(_0xf2498a,_0x2ca8d6))['catch'](handleError(_0xf2498a,null));};exports['show']=function(_0x4ffd64,_0x3689b5){var _0x52740c={'raw':!![],'where':{'id':_0x4ffd64[_0xa5e4('0x48')]['id']}},_0x5f16cd={};_0x5f16cd[_0xa5e4('0x33')]=_['keys'](db[_0xa5e4('0x45')][_0xa5e4('0x49')]);_0x5f16cd[_0xa5e4('0x34')]=_[_0xa5e4('0x35')](_0x4ffd64[_0xa5e4('0x34')]);_0x5f16cd['filters']=_['intersection'](_0x5f16cd[_0xa5e4('0x33')],_0x5f16cd[_0xa5e4('0x34')]);_0x52740c[_0xa5e4('0x39')]=_[_0xa5e4('0x37')](_0x5f16cd['model'],qs[_0xa5e4('0x38')](_0x4ffd64[_0xa5e4('0x34')][_0xa5e4('0x38')]));_0x52740c[_0xa5e4('0x39')]=_0x52740c[_0xa5e4('0x39')][_0xa5e4('0x3a')]?_0x52740c[_0xa5e4('0x39')]:_0x5f16cd['model'];if(_0x4ffd64[_0xa5e4('0x34')][_0xa5e4('0x43')]){_0x52740c[_0xa5e4('0x44')]=[{'all':!![]}];}_0x52740c=_['merge']({},_0x52740c,_0x4ffd64['options']);return db['ChatInternalMessage']['find'](_0x52740c)[_0xa5e4('0x28')](handleEntityNotFound(_0x3689b5,null))[_0xa5e4('0x28')](respondWithResult(_0x3689b5,null))[_0xa5e4('0x4a')](handleError(_0x3689b5,null));};exports[_0xa5e4('0x4b')]=function(_0x312695,_0x85e375){return db[_0xa5e4('0x45')][_0xa5e4('0x4b')](_0x312695[_0xa5e4('0x4c')],{})[_0xa5e4('0x28')](respondWithResult(_0x85e375,0xc9))[_0xa5e4('0x4a')](handleError(_0x85e375,null));};exports[_0xa5e4('0x26')]=function(_0x3ded6c,_0x217afd){if(_0x3ded6c[_0xa5e4('0x4c')]['id']){delete _0x3ded6c[_0xa5e4('0x4c')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3ded6c['params']['id']}})['then'](handleEntityNotFound(_0x217afd,null))[_0xa5e4('0x28')](saveUpdates(_0x3ded6c[_0xa5e4('0x4c')],null))[_0xa5e4('0x28')](respondWithResult(_0x217afd,null))[_0xa5e4('0x4a')](handleError(_0x217afd,null));};exports[_0xa5e4('0x27')]=function(_0x2a1a58,_0x30bafe){return db['ChatInternalMessage'][_0xa5e4('0x4d')]({'where':{'id':_0x2a1a58[_0xa5e4('0x48')]['id']}})[_0xa5e4('0x28')](handleEntityNotFound(_0x30bafe,null))[_0xa5e4('0x28')](removeEntity(_0x30bafe,null))[_0xa5e4('0x4a')](handleError(_0x30bafe,null));};exports[_0xa5e4('0x4e')]=function(_0x35bd0c,_0x35e1f8){return db[_0xa5e4('0x45')][_0xa5e4('0x4e')]()[_0xa5e4('0x28')](respondWithResult(_0x35e1f8,null))[_0xa5e4('0x4a')](handleError(_0x35e1f8,null));};function wrapUser(_0x34794c){return function(_0x237413){var _0x4f8480=_0x34794c['get']({'plain':!![]});_0x4f8480[_0xa5e4('0x4f')]=[];if(_0x237413){_0x4f8480['lastMessageAt']=_0x237413['createdAt'];_0x4f8480[_0xa5e4('0x50')]=_0x237413;}else{_0x4f8480[_0xa5e4('0x51')]=moment(0x0)['format'](_0xa5e4('0x52'));_0x4f8480['lastMessage']={};}return _0x4f8480;};}exports[_0xa5e4('0x53')]=function(_0x3ec843,_0x4dbc21,_0x12d70a){var _0x1dc79a=[];return db['User'][_0xa5e4('0x46')]({'where':{'role':[_0xa5e4('0x54'),'admin',_0xa5e4('0x55')]},'attributes':['id',_0xa5e4('0x56'),_0xa5e4('0x2d'),_0xa5e4('0x57'),_0xa5e4('0x58'),'internal',_0xa5e4('0x59'),'lastLoginAt',_0xa5e4('0x5a'),_0xa5e4('0x5b')],'order':qs[_0xa5e4('0x3d')]('-online'),'include':[{'model':db[_0xa5e4('0x5c')],'as':'VoiceQueues','attributes':['id',_0xa5e4('0x2d'),'type'],'through':{'attributes':[]}}]})[_0xa5e4('0x28')](function(_0x48fe88){if(_0x48fe88){var _0x1014df=_0x3ec843[_0xa5e4('0x55')]['get']({'plain':!![]});if(!_0x1014df)throw new Error(_0xa5e4('0x5d'));if(_0x1014df[_0xa5e4('0x57')]===_0xa5e4('0x55')){return db[_0xa5e4('0x5e')][_0xa5e4('0x4d')]({'where':{'name':_0xa5e4('0x5f'),'userProfileId':_0x1014df[_0xa5e4('0x60')]},'raw':!![]})[_0xa5e4('0x28')](function(_0x2282bf){if(_0x2282bf){if(_0x2282bf[_0xa5e4('0x61')]===0x0){return db[_0xa5e4('0x62')][_0xa5e4('0x46')]({'where':{'sectionId':_0x2282bf['id']},'raw':!![]})['then'](function(_0x2fe9be){var _0x1b9abc=[];if(_[_0xa5e4('0x63')](_0x2fe9be)){_0x1b9abc=_[_0xa5e4('0x40')](_0x48fe88,function(_0x18359b){if(_0x18359b[_0xa5e4('0x57')]!=='agent'){return _0x18359b;}});return _0x1b9abc;}else{for(var _0x400218=0x0;_0x400218<_0x48fe88['length'];_0x400218++){var _0x5418df=_0x48fe88[_0x400218];if(_0x5418df['role']===_0xa5e4('0x54')){var _0x46e582=_[_0xa5e4('0x4d')](_0x2fe9be,function(_0xfb472f){return _0xfb472f['resourceId']===_0x5418df['id'];});if(_0x46e582)_0x1b9abc['push'](_0x5418df);}else{_0x1b9abc['push'](_0x5418df);}}return _0x1b9abc;}});}else{return _0x48fe88;}}else{var _0x525212=_[_0xa5e4('0x40')](_0x48fe88,function(_0x21e68d){if(_0x21e68d[_0xa5e4('0x57')]!=='agent'){return _0x21e68d;}});return _0x525212;}});}else{return _0x48fe88;}}})[_0xa5e4('0x28')](function(_0x3b3bb8){var _0x56ee2a=[];if(_0x3b3bb8){_0x1dc79a=_0x3b3bb8;for(var _0x25ca2b=0x0;_0x25ca2b<_0x3b3bb8[_0xa5e4('0x3a')];_0x25ca2b+=0x1){_0x1dc79a[_0x25ca2b][_0xa5e4('0x4f')]=[];_0x56ee2a[_0xa5e4('0x64')](db[_0xa5e4('0x45')][_0xa5e4('0x4d')]({'where':{'FromId':[_0x3ec843[_0xa5e4('0x55')]['id'],_0x3b3bb8[_0x25ca2b]['id']],'ToId':[_0x3ec843[_0xa5e4('0x55')]['id'],_0x3b3bb8[_0x25ca2b]['id']],'ChatGroupId':null},'attributes':['id',_0xa5e4('0x65'),_0xa5e4('0x66'),_0xa5e4('0x67'),'read',_0xa5e4('0x4c')],'order':qs[_0xa5e4('0x3d')](_0xa5e4('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa5e4('0x28')](wrapUser(_0x3b3bb8[_0x25ca2b])));}return BPromise['all'](_0x56ee2a);}return[];})[_0xa5e4('0x28')](function(_0x9a5f3f){return{'rows':_0x9a5f3f,'count':_0x9a5f3f[_0xa5e4('0x3a')]};})[_0xa5e4('0x28')](respondWithResult(_0x4dbc21,null))['catch'](handleError(_0x4dbc21,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 1daeff9..ad168bb 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 _0xf133=['update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage','setMaxListeners'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0xf133,0x166));var _0x3f13=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xf133[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x3f13('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3f13('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3f13('0x2'),'afterDestroy':_0x3f13('0x3')};function emitEvent(_0x3fb529){return function(_0x525734,_0x32b39b,_0x38e420){ChatInternalMessageEvents[_0x3f13('0x4')](_0x3fb529+':'+_0x525734['id'],_0x525734);ChatInternalMessageEvents['emit'](_0x3fb529,_0x525734);_0x38e420(null);};}for(var e in events){if(events[_0x3f13('0x5')](e)){var event=events[e];ChatInternalMessage[_0x3f13('0x6')](e,emitEvent(event));}}module[_0x3f13('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x197c=['remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x197c,0xc1));var _0xc197=function(_0x58f65e,_0x467d61){_0x58f65e=_0x58f65e-0x0;var _0x35684b=_0x197c[_0x58f65e];return _0x35684b;};'use strict';var EventEmitter=require(_0xc197('0x0'));var ChatInternalMessage=require(_0xc197('0x1'))['db'][_0xc197('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc197('0x3'),'afterUpdate':_0xc197('0x4'),'afterDestroy':_0xc197('0x5')};function emitEvent(_0x288aa1){return function(_0x39a525,_0x5b8019,_0x1eaf99){ChatInternalMessageEvents[_0xc197('0x6')](_0x288aa1+':'+_0x39a525['id'],_0x39a525);ChatInternalMessageEvents[_0xc197('0x6')](_0x288aa1,_0x39a525);_0x1eaf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc197('0x7')](e,emitEvent(event));}}module[_0xc197('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 208a247..0abb8ff 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 _0x5db0=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x31c3db,_0x10b243){var _0x57c39c=function(_0x456dda){while(--_0x456dda){_0x31c3db['push'](_0x31c3db['shift']());}};_0x57c39c(++_0x10b243);}(_0x5db0,0x158));var _0x05db=function(_0x198ac3,_0x51a6ba){_0x198ac3=_0x198ac3-0x0;var _0x3b0276=_0x5db0[_0x198ac3];return _0x3b0276;};'use strict';var _=require(_0x05db('0x0'));var util=require(_0x05db('0x1'));var logger=require(_0x05db('0x2'))(_0x05db('0x3'));var moment=require(_0x05db('0x4'));var BPromise=require('bluebird');var rp=require(_0x05db('0x5'));var fs=require('fs');var path=require(_0x05db('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x05db('0x7')]=function(_0x4e69c0,_0x4e01f0){return _0x4e69c0[_0x05db('0x8')](_0x05db('0x9'),attributes,{'tableName':_0x05db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x05db('0xb'),'collate':_0x05db('0xc')});};
\ No newline at end of file
+var _0xf311=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4_unicode_ci'];(function(_0x1c6817,_0x1c32ac){var _0x3bbb97=function(_0x156a6f){while(--_0x156a6f){_0x1c6817['push'](_0x1c6817['shift']());}};_0x3bbb97(++_0x1c32ac);}(_0xf311,0x1c3));var _0x1f31=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf311[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x1f31('0x0'));var logger=require(_0x1f31('0x1'))(_0x1f31('0x2'));var moment=require(_0x1f31('0x3'));var BPromise=require('bluebird');var rp=require(_0x1f31('0x4'));var fs=require('fs');var path=require(_0x1f31('0x5'));var rimraf=require('rimraf');var config=require(_0x1f31('0x6'));var attributes=require(_0x1f31('0x7'));module[_0x1f31('0x8')]=function(_0x4b97f9,_0x2e0b5b){return _0x4b97f9['define'](_0x1f31('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1f31('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9bea06a..5758b13 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 _0xc6e5=['../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b97fa,_0x4399a6){var _0x44267a=function(_0x60f28){while(--_0x60f28){_0x3b97fa['push'](_0x3b97fa['shift']());}};_0x44267a(++_0x4399a6);}(_0xc6e5,0x192));var _0x5c6e=function(_0x44ff66,_0x247610){_0x44ff66=_0x44ff66-0x0;var _0x3f64a4=_0xc6e5[_0x44ff66];return _0x3f64a4;};'use strict';var _=require(_0x5c6e('0x0'));var util=require(_0x5c6e('0x1'));var moment=require('moment');var BPromise=require(_0x5c6e('0x2'));var rs=require(_0x5c6e('0x3'));var fs=require('fs');var Redis=require(_0x5c6e('0x4'));var db=require(_0x5c6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c6e('0x6'))('rpc');var config=require(_0x5c6e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5c6e('0x8')][_0x5c6e('0x9')]({'port':0x232a});config[_0x5c6e('0xa')]=_[_0x5c6e('0xb')](config[_0x5c6e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c6e('0xc'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5c6e('0xd')](socket);function respondWithRpcPromise(_0x274a2b,_0x3490b3,_0x4d7f2d){return new BPromise(function(_0x2415a7,_0x55f61d){return client[_0x5c6e('0xe')](_0x274a2b,_0x4d7f2d)[_0x5c6e('0xf')](function(_0x38b967){logger[_0x5c6e('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x3490b3,'request\x20sent');logger[_0x5c6e('0x11')](_0x5c6e('0x12'),_0x3490b3,'request\x20sent',JSON['stringify'](_0x38b967));if(_0x38b967[_0x5c6e('0x13')]){if(_0x38b967[_0x5c6e('0x13')]['code']===0x1f4){logger['error'](_0x5c6e('0x14'),_0x3490b3,_0x38b967[_0x5c6e('0x13')][_0x5c6e('0x15')]);return _0x55f61d(_0x38b967[_0x5c6e('0x13')][_0x5c6e('0x15')]);}logger[_0x5c6e('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x3490b3,_0x38b967[_0x5c6e('0x13')]['message']);return _0x2415a7(_0x38b967[_0x5c6e('0x13')][_0x5c6e('0x15')]);}else{logger[_0x5c6e('0x10')](_0x5c6e('0x14'),_0x3490b3,'request\x20sent');_0x2415a7(_0x38b967[_0x5c6e('0x16')][_0x5c6e('0x15')]);}})[_0x5c6e('0x17')](function(_0x238a98){logger[_0x5c6e('0x13')](_0x5c6e('0x14'),_0x3490b3,_0x238a98);_0x55f61d(_0x238a98);});});}
\ No newline at end of file
+var _0xd95b=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','request','info','request\x20sent','debug'];(function(_0x20b04f,_0xc07087){var _0x591839=function(_0x2570b4){while(--_0x2570b4){_0x20b04f['push'](_0x20b04f['shift']());}};_0x591839(++_0xc07087);}(_0xd95b,0x126));var _0xbd95=function(_0x2b8983,_0x54abb2){_0x2b8983=_0x2b8983-0x0;var _0x3ce526=_0xd95b[_0x2b8983];return _0x3ce526;};'use strict';var _=require('lodash');var util=require(_0xbd95('0x0'));var moment=require(_0xbd95('0x1'));var BPromise=require(_0xbd95('0x2'));var rs=require(_0xbd95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd95('0x4'))['db'];var utils=require(_0xbd95('0x5'));var logger=require(_0xbd95('0x6'))('rpc');var config=require(_0xbd95('0x7'));var jayson=require(_0xbd95('0x8'));var client=jayson['client'][_0xbd95('0x9')]({'port':0x232a});config[_0xbd95('0xa')]=_[_0xbd95('0xb')](config['redis'],{'host':_0xbd95('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd95('0xa')]));require(_0xbd95('0xd'))['register'](socket);function respondWithRpcPromise(_0x27ee03,_0x490825,_0x1c8ca0){return new BPromise(function(_0x893dcb,_0x4ed6e8){return client[_0xbd95('0xe')](_0x27ee03,_0x1c8ca0)['then'](function(_0xd8a13d){logger[_0xbd95('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x490825,_0xbd95('0x10'));logger[_0xbd95('0x11')](_0xbd95('0x12'),_0x490825,_0xbd95('0x10'),JSON[_0xbd95('0x13')](_0xd8a13d));if(_0xd8a13d[_0xbd95('0x14')]){if(_0xd8a13d[_0xbd95('0x14')]['code']===0x1f4){logger[_0xbd95('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x490825,_0xd8a13d[_0xbd95('0x14')][_0xbd95('0x15')]);return _0x4ed6e8(_0xd8a13d[_0xbd95('0x14')][_0xbd95('0x15')]);}logger[_0xbd95('0x14')](_0xbd95('0x16'),_0x490825,_0xd8a13d['error'][_0xbd95('0x15')]);return _0x893dcb(_0xd8a13d['error'][_0xbd95('0x15')]);}else{logger[_0xbd95('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x490825,_0xbd95('0x10'));_0x893dcb(_0xd8a13d[_0xbd95('0x17')][_0xbd95('0x15')]);}})['catch'](function(_0x172092){logger[_0xbd95('0x14')](_0xbd95('0x16'),_0x490825,_0x172092);_0x4ed6e8(_0x172092);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 7552ed8..d2eae21 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 _0x7af2=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','removeListener'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x7af2,0x1bb));var _0x27af=function(_0x592edb,_0x2e4d3f){_0x592edb=_0x592edb-0x0;var _0x108fc8=_0x7af2[_0x592edb];return _0x108fc8;};'use strict';var ChatInternalMessageEvents=require(_0x27af('0x0'));var events=[_0x27af('0x1'),_0x27af('0x2'),'update'];function createListener(_0xab5b1a,_0x2535d8){return function(_0xa8ea9b){_0x2535d8[_0x27af('0x3')](_0xab5b1a,_0xa8ea9b);};}function removeListener(_0x49461e,_0x7b3edc){return function(){ChatInternalMessageEvents[_0x27af('0x4')](_0x49461e,_0x7b3edc);};}exports[_0x27af('0x5')]=function(_0x3e40ef){for(var _0x2edbaa=0x0,_0x3ed398=events[_0x27af('0x6')];_0x2edbaa<_0x3ed398;_0x2edbaa++){var _0x368035=events[_0x2edbaa];var _0x314047=createListener(_0x27af('0x7')+_0x368035,_0x3e40ef);ChatInternalMessageEvents['on'](_0x368035,_0x314047);}};
\ No newline at end of file
+var _0xb0d4=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','register','length'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xb0d4,0xd1));var _0x4b0d=function(_0x66808a,_0x60f3bd){_0x66808a=_0x66808a-0x0;var _0x760006=_0xb0d4[_0x66808a];return _0x760006;};'use strict';var ChatInternalMessageEvents=require(_0x4b0d('0x0'));var events=[_0x4b0d('0x1'),_0x4b0d('0x2'),_0x4b0d('0x3')];function createListener(_0x1c2911,_0xeaad4a){return function(_0x43c6e8){_0xeaad4a[_0x4b0d('0x4')](_0x1c2911,_0x43c6e8);};}function removeListener(_0x2bf4a6,_0x287fa7){return function(){ChatInternalMessageEvents['removeListener'](_0x2bf4a6,_0x287fa7);};}exports[_0x4b0d('0x5')]=function(_0x5aa827){for(var _0x157f19=0x0,_0x307bab=events[_0x4b0d('0x6')];_0x157f19<_0x307bab;_0x157f19++){var _0x310df8=events[_0x157f19];var _0xe767fb=createListener(_0x4b0d('0x7')+_0x310df8,_0x5aa827);ChatInternalMessageEvents['on'](_0x310df8,_0xe767fb);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2c7ed9a..3d5f169 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 _0x66d2=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','getUsers','/:id','show','create','put','update','delete'];(function(_0x41ea43,_0x449611){var _0x273c57=function(_0x218037){while(--_0x218037){_0x41ea43['push'](_0x41ea43['shift']());}};_0x273c57(++_0x449611);}(_0x66d2,0x17b));var _0x266d=function(_0x5276ff,_0x4e416f){_0x5276ff=_0x5276ff-0x0;var _0x197192=_0x66d2[_0x5276ff];return _0x197192;};'use strict';var multer=require(_0x266d('0x0'));var util=require(_0x266d('0x1'));var path=require(_0x266d('0x2'));var timeout=require(_0x266d('0x3'));var express=require(_0x266d('0x4'));var router=express['Router']();var fs_extra=require(_0x266d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x266d('0x6'));var config=require(_0x266d('0x7'));var controller=require(_0x266d('0x8'));router[_0x266d('0x9')]('/',auth[_0x266d('0xa')](),controller[_0x266d('0xb')]);router[_0x266d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x266d('0xc')]);router[_0x266d('0x9')]('/users',auth[_0x266d('0xa')](),controller[_0x266d('0xd')]);router[_0x266d('0x9')](_0x266d('0xe'),auth[_0x266d('0xa')](),controller[_0x266d('0xf')]);router['post']('/',auth[_0x266d('0xa')](),controller[_0x266d('0x10')]);router[_0x266d('0x11')](_0x266d('0xe'),controller[_0x266d('0x12')]);router[_0x266d('0x13')](_0x266d('0xe'),auth[_0x266d('0xa')](),controller['destroy']);module[_0x266d('0x14')]=router;
\ No newline at end of file
+var _0xdef5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','getUsers','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express'];(function(_0x1321d6,_0x4424c6){var _0x3aae91=function(_0x5b7fe1){while(--_0x5b7fe1){_0x1321d6['push'](_0x1321d6['shift']());}};_0x3aae91(++_0x4424c6);}(_0xdef5,0x1b1));var _0x5def=function(_0x360f9c,_0x208039){_0x360f9c=_0x360f9c-0x0;var _0x4f916c=_0xdef5[_0x360f9c];return _0x4f916c;};'use strict';var multer=require(_0x5def('0x0'));var util=require('util');var path=require(_0x5def('0x1'));var timeout=require(_0x5def('0x2'));var express=require(_0x5def('0x3'));var router=express[_0x5def('0x4')]();var fs_extra=require(_0x5def('0x5'));var auth=require(_0x5def('0x6'));var interaction=require(_0x5def('0x7'));var config=require(_0x5def('0x8'));var controller=require(_0x5def('0x9'));router['get']('/',auth[_0x5def('0xa')](),controller[_0x5def('0xb')]);router[_0x5def('0xc')](_0x5def('0xd'),auth[_0x5def('0xa')](),controller[_0x5def('0xe')]);router['get']('/users',auth[_0x5def('0xa')](),controller[_0x5def('0xf')]);router[_0x5def('0xc')](_0x5def('0x10'),auth['isAuthenticated'](),controller[_0x5def('0x11')]);router[_0x5def('0x12')]('/',auth[_0x5def('0xa')](),controller[_0x5def('0x13')]);router[_0x5def('0x14')](_0x5def('0x10'),controller['update']);router[_0x5def('0x15')]('/:id',auth[_0x5def('0xa')](),controller[_0x5def('0x16')]);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 e34d5c4..7316709 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 _0xceb0=['ENUM','out','TEXT','BOOLEAN'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xceb0,0x173));var _0x0ceb=function(_0x3cb8b6,_0x5cad07){_0x3cb8b6=_0x3cb8b6-0x0;var _0xbc94f4=_0xceb0[_0x3cb8b6];return _0xbc94f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0ceb('0x0')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0ceb('0x1')]('in',_0x0ceb('0x2')),'defaultValue':_0x0ceb('0x2'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0ceb('0x3')]}};
\ No newline at end of file
+var _0xabad=['sequelize','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x33ff91,_0x795acd){var _0x14d1bd=function(_0x32fc59){while(--_0x32fc59){_0x33ff91['push'](_0x33ff91['shift']());}};_0x14d1bd(++_0x795acd);}(_0xabad,0x150));var _0xdaba=function(_0x2724ab,_0x4890a8){_0x2724ab=_0x2724ab-0x0;var _0x3e05d8=_0xabad[_0x2724ab];return _0x3e05d8;};'use strict';var Sequelize=require(_0xdaba('0x0'));module['exports']={'body':{'type':Sequelize[_0xdaba('0x1')](_0xdaba('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdaba('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdaba('0x4')]('in',_0xdaba('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdaba('0x6')]},'providerName':{'type':Sequelize[_0xdaba('0x7')]},'providerResponse':{'type':Sequelize[_0xdaba('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index e970d91..bc94e5b 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 _0x29de=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','reject','RejectMessage','ContactId','QueryTypes','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','send','ChatMessage','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','length','find','create','body','params','describe','chat','read','readAt','format'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x29de,0x134));var _0xe29d=function(_0x49c0b3,_0x4a1b06){_0x49c0b3=_0x49c0b3-0x0;var _0x245c6f=_0x29de[_0x49c0b3];return _0x245c6f;};'use strict';var emlformat=require(_0xe29d('0x0'));var rimraf=require(_0xe29d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe29d('0x2'));var rp=require(_0xe29d('0x3'));var moment=require(_0xe29d('0x4'));var BPromise=require(_0xe29d('0x5'));var Mustache=require(_0xe29d('0x6'));var util=require(_0xe29d('0x7'));var path=require(_0xe29d('0x8'));var sox=require('sox');var csv=require(_0xe29d('0x9'));var ejs=require(_0xe29d('0xa'));var fs=require('fs');var fs_extra=require(_0xe29d('0xb'));var _=require(_0xe29d('0xc'));var squel=require('squel');var crypto=require(_0xe29d('0xd'));var jsforce=require(_0xe29d('0xe'));var deskjs=require(_0xe29d('0xf'));var toCsv=require(_0xe29d('0x9'));var querystring=require('querystring');var Papa=require(_0xe29d('0x10'));var Redis=require(_0xe29d('0x11'));var authService=require(_0xe29d('0x12'));var qs=require(_0xe29d('0x13'));var as=require(_0xe29d('0x14'));var hardwareService=require(_0xe29d('0x15'));var logger=require(_0xe29d('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe29d('0x17'));var db=require(_0xe29d('0x18'))['db'];config[_0xe29d('0x19')]=_[_0xe29d('0x1a')](config[_0xe29d('0x19')],{'host':_0xe29d('0x1b'),'port':0x18eb});var socket=require(_0xe29d('0x1c'))(new Redis(config[_0xe29d('0x19')]));require(_0xe29d('0x1d'))[_0xe29d('0x1e')](socket);var jayson=require(_0xe29d('0x1f'));var client=jayson[_0xe29d('0x20')][_0xe29d('0x21')]({'port':0x232c});var client9002=jayson[_0xe29d('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a42aa,_0x1554e5,_0x234b1d,_0x42b7cc){return new BPromise(function(_0x343050,_0x1b1a89){var _0xce6a86=_0x42b7cc||client;return _0xce6a86['request'](_0x3a42aa,_0x234b1d)[_0xe29d('0x22')](function(_0x39c9fe){logger[_0xe29d('0x23')](_0xe29d('0x24'),_0x1554e5,'request\x20sent');logger[_0xe29d('0x25')](_0xe29d('0x26'),_0x1554e5,_0xe29d('0x27'),JSON[_0xe29d('0x28')](_0x39c9fe));if(_0x39c9fe['error']){if(_0x39c9fe[_0xe29d('0x29')]['code']===0x1f4){logger[_0xe29d('0x29')](_0xe29d('0x24'),_0x1554e5,_0x39c9fe[_0xe29d('0x29')][_0xe29d('0x2a')]);return _0x1b1a89(_0x39c9fe[_0xe29d('0x29')][_0xe29d('0x2a')]);}logger[_0xe29d('0x29')]('ChatMessage,\x20%s,\x20%s',_0x1554e5,_0x39c9fe[_0xe29d('0x29')][_0xe29d('0x2a')]);return _0x343050(_0x39c9fe[_0xe29d('0x29')]['message']);}else{logger[_0xe29d('0x23')](_0xe29d('0x24'),_0x1554e5,_0xe29d('0x27'));_0x343050(_0x39c9fe[_0xe29d('0x2b')]['message']);}})[_0xe29d('0x2c')](function(_0x163856){logger['error'](_0xe29d('0x24'),_0x1554e5,_0x163856);_0x1b1a89(_0x163856);});});}function respondWithStatusCode(_0x345eb0,_0xd41e75){_0xd41e75=_0xd41e75||0xcc;return function(_0x487bd9){if(_0x487bd9){return _0x345eb0[_0xe29d('0x2d')](_0xd41e75);}return _0x345eb0['status'](_0xd41e75)['end']();};}function respondWithResult(_0x5438de,_0x24155c){_0x24155c=_0x24155c||0xc8;return function(_0x5044a1){if(_0x5044a1){return _0x5438de[_0xe29d('0x2e')](_0x24155c)[_0xe29d('0x2f')](_0x5044a1);}};}function respondWithFilteredResult(_0x2af1e9,_0x1e0b17){return function(_0x35a33a){if(_0x35a33a){var _0x410f3e=typeof _0x1e0b17[_0xe29d('0x30')]===_0xe29d('0x31')&&typeof _0x1e0b17['limit']==='undefined';var _0x217503=_0x35a33a[_0xe29d('0x32')];var _0x2485a6=_0x410f3e?0x0:_0x1e0b17[_0xe29d('0x30')];var _0xc75459=_0x410f3e?_0x35a33a[_0xe29d('0x32')]:_0x1e0b17['offset']+_0x1e0b17[_0xe29d('0x33')];var _0x3159d8;if(_0xc75459>=_0x217503){_0xc75459=_0x217503;_0x3159d8=0xc8;}else{_0x3159d8=0xce;}_0x2af1e9['status'](_0x3159d8);return _0x2af1e9[_0xe29d('0x34')](_0xe29d('0x35'),_0x2485a6+'-'+_0xc75459+'/'+_0x217503)[_0xe29d('0x2f')](_0x35a33a);}return null;};}function patchUpdates(_0x2a2fe7){return function(_0x2ef01c){try{jsonpatch[_0xe29d('0x36')](_0x2ef01c,_0x2a2fe7,!![]);}catch(_0xe5646e){return BPromise['reject'](_0xe5646e);}return _0x2ef01c[_0xe29d('0x37')]();};}function saveUpdates(_0x4f211c,_0x51d4ef){return function(_0x79ab21){if(_0x79ab21){return _0x79ab21['update'](_0x4f211c)['then'](function(_0x31bd5e){return _0x31bd5e;});}return null;};}function removeEntity(_0x3da158,_0x1e1b53){return function(_0x32b8ef){if(_0x32b8ef){return _0x32b8ef[_0xe29d('0x38')]()['then'](function(){_0x3da158[_0xe29d('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517bb9,_0x5c9e1c){return function(_0xacb365){if(!_0xacb365){_0x517bb9[_0xe29d('0x2d')](0x194);}return _0xacb365;};}function handleError(_0x311de2,_0x157fe4){_0x157fe4=_0x157fe4||0x1f4;return function(_0x30d658){logger['error'](_0x30d658['stack']);if(_0x30d658['name']){delete _0x30d658['name'];}_0x311de2['status'](_0x157fe4)[_0xe29d('0x39')](_0x30d658);};}exports['index']=function(_0x3c93ce,_0x4ed94a){var _0x63f9f5={},_0x35ca12={},_0x53fedf={'count':0x0,'rows':[]};var _0x1ada11=_['map'](db[_0xe29d('0x3a')][_0xe29d('0x3b')],function(_0x200018){return{'name':_0x200018[_0xe29d('0x3c')],'type':_0x200018[_0xe29d('0x3d')][_0xe29d('0x3e')]};});_0x35ca12['model']=_['map'](_0x1ada11,_0xe29d('0x3f'));_0x35ca12[_0xe29d('0x40')]=_[_0xe29d('0x41')](_0x3c93ce['query']);_0x35ca12[_0xe29d('0x42')]=_['intersection'](_0x35ca12['model'],_0x35ca12[_0xe29d('0x40')]);_0x63f9f5['attributes']=_[_0xe29d('0x43')](_0x35ca12[_0xe29d('0x44')],qs['fields'](_0x3c93ce['query'][_0xe29d('0x45')]));_0x63f9f5[_0xe29d('0x46')]=_0x63f9f5[_0xe29d('0x46')]['length']?_0x63f9f5[_0xe29d('0x46')]:_0x35ca12[_0xe29d('0x44')];if(!_0x3c93ce['query'][_0xe29d('0x47')](_0xe29d('0x48'))){_0x63f9f5[_0xe29d('0x33')]=qs[_0xe29d('0x33')](_0x3c93ce[_0xe29d('0x40')][_0xe29d('0x33')]);_0x63f9f5[_0xe29d('0x30')]=qs[_0xe29d('0x30')](_0x3c93ce[_0xe29d('0x40')]['offset']);}_0x63f9f5[_0xe29d('0x49')]=qs[_0xe29d('0x4a')](_0x3c93ce['query'][_0xe29d('0x4a')]);_0x63f9f5[_0xe29d('0x4b')]=qs[_0xe29d('0x42')](_[_0xe29d('0x4c')](_0x3c93ce[_0xe29d('0x40')],_0x35ca12[_0xe29d('0x42')]),_0x1ada11);if(_0x3c93ce[_0xe29d('0x40')][_0xe29d('0x4d')]){_0x63f9f5['where']=_[_0xe29d('0x4e')](_0x63f9f5[_0xe29d('0x4b')],{'$or':_['map'](_0x1ada11,function(_0x35c65c){if(_0x35c65c[_0xe29d('0x3d')]!==_0xe29d('0x4f')){var _0x3fdc2a={};_0x3fdc2a[_0x35c65c[_0xe29d('0x3f')]]={'$like':'%'+_0x3c93ce[_0xe29d('0x40')][_0xe29d('0x4d')]+'%'};return _0x3fdc2a;}})});}_0x63f9f5=_[_0xe29d('0x4e')]({},_0x63f9f5,_0x3c93ce[_0xe29d('0x50')]);var _0x5ae35a={'where':_0x63f9f5[_0xe29d('0x4b')]};return db[_0xe29d('0x3a')][_0xe29d('0x32')](_0x5ae35a)[_0xe29d('0x22')](function(_0x1a965d){_0x53fedf[_0xe29d('0x32')]=_0x1a965d;if(_0x3c93ce['query'][_0xe29d('0x51')]){_0x63f9f5[_0xe29d('0x52')]=[{'all':!![]}];}return db[_0xe29d('0x3a')][_0xe29d('0x53')](_0x63f9f5);})[_0xe29d('0x22')](function(_0x22fad8){_0x53fedf['rows']=_0x22fad8;return _0x53fedf;})[_0xe29d('0x22')](respondWithFilteredResult(_0x4ed94a,_0x63f9f5))[_0xe29d('0x2c')](handleError(_0x4ed94a,null));};exports['show']=function(_0x3168c1,_0x54a6d0){var _0x31af5e={'raw':!![],'where':{'id':_0x3168c1['params']['id']}},_0x21cf2b={};_0x21cf2b[_0xe29d('0x44')]=_[_0xe29d('0x41')](db[_0xe29d('0x3a')][_0xe29d('0x3b')]);_0x21cf2b[_0xe29d('0x40')]=_['keys'](_0x3168c1[_0xe29d('0x40')]);_0x21cf2b[_0xe29d('0x42')]=_[_0xe29d('0x43')](_0x21cf2b[_0xe29d('0x44')],_0x21cf2b[_0xe29d('0x40')]);_0x31af5e[_0xe29d('0x46')]=_[_0xe29d('0x43')](_0x21cf2b[_0xe29d('0x44')],qs[_0xe29d('0x45')](_0x3168c1[_0xe29d('0x40')][_0xe29d('0x45')]));_0x31af5e[_0xe29d('0x46')]=_0x31af5e[_0xe29d('0x46')][_0xe29d('0x54')]?_0x31af5e['attributes']:_0x21cf2b[_0xe29d('0x44')];if(_0x3168c1['query']['includeAll']){_0x31af5e[_0xe29d('0x52')]=[{'all':!![]}];}_0x31af5e=_[_0xe29d('0x4e')]({},_0x31af5e,_0x3168c1[_0xe29d('0x50')]);return db['ChatMessage'][_0xe29d('0x55')](_0x31af5e)[_0xe29d('0x22')](handleEntityNotFound(_0x54a6d0,null))[_0xe29d('0x22')](respondWithResult(_0x54a6d0,null))[_0xe29d('0x2c')](handleError(_0x54a6d0,null));};exports[_0xe29d('0x56')]=function(_0x4e96de,_0x489df5){return db['ChatMessage'][_0xe29d('0x56')](_0x4e96de['body'],{})[_0xe29d('0x22')](respondWithResult(_0x489df5,0xc9))[_0xe29d('0x2c')](handleError(_0x489df5,null));};exports['update']=function(_0x38d01e,_0x512b6a){if(_0x38d01e[_0xe29d('0x57')]['id']){delete _0x38d01e[_0xe29d('0x57')]['id'];}return db[_0xe29d('0x3a')][_0xe29d('0x55')]({'where':{'id':_0x38d01e['params']['id']}})['then'](handleEntityNotFound(_0x512b6a,null))['then'](saveUpdates(_0x38d01e[_0xe29d('0x57')],null))[_0xe29d('0x22')](respondWithResult(_0x512b6a,null))['catch'](handleError(_0x512b6a,null));};exports[_0xe29d('0x38')]=function(_0x578f80,_0x2e3861){return db[_0xe29d('0x3a')][_0xe29d('0x55')]({'where':{'id':_0x578f80[_0xe29d('0x58')]['id']}})[_0xe29d('0x22')](handleEntityNotFound(_0x2e3861,null))[_0xe29d('0x22')](removeEntity(_0x2e3861,null))[_0xe29d('0x2c')](handleError(_0x2e3861,null));};exports[_0xe29d('0x59')]=function(_0x5d8ab8,_0x4eac35){return db[_0xe29d('0x3a')][_0xe29d('0x59')]()[_0xe29d('0x22')](respondWithResult(_0x4eac35,null))[_0xe29d('0x2c')](handleError(_0x4eac35,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x41063f,_0x4594de,_0x52fde1){var _0x38660e={'agent':{},'channel':_0xe29d('0x5a')};if(_0x41063f[_0xe29d('0x57')]['id']){delete _0x41063f['body']['id'];}_0x41063f[_0xe29d('0x57')][_0xe29d('0x5b')]=!![];_0x41063f[_0xe29d('0x57')][_0xe29d('0x5c')]=moment()[_0xe29d('0x5d')](_0xe29d('0x5e'));_0x41063f['body'][_0xe29d('0x5f')]=_0x41063f['body'][_0xe29d('0x5f')]||_0x41063f[_0xe29d('0x60')]['id'];_0x38660e[_0xe29d('0x61')]['id']=_0x41063f[_0xe29d('0x57')][_0xe29d('0x5f')];return db['ChatMessage'][_0xe29d('0x55')]({'where':{'id':_0x41063f['params']['id'],'UserId':null}})[_0xe29d('0x22')](handleEntityNotFound(_0x4594de,null))[_0xe29d('0x22')](saveUpdates(_0x41063f[_0xe29d('0x57')],null))['then'](function(_0x2febbd){if(_0x2febbd){_0x38660e[_0xe29d('0x2a')]=_0x2febbd[_0xe29d('0x62')]({'plain':!![]});return db[_0xe29d('0x63')][_0xe29d('0x55')]({'where':{'id':_0x2febbd[_0xe29d('0x64')]}});}return null;})[_0xe29d('0x22')](handleEntityNotFound(_0x4594de,null))[_0xe29d('0x22')](function(_0x5e584d){if(_0x5e584d){return _0x5e584d[_0xe29d('0x65')]({'UserId':_0x41063f[_0xe29d('0x57')][_0xe29d('0x5f')],'read1stAt':_[_0xe29d('0x66')](_0x5e584d[_0xe29d('0x67')])?moment()['format'](_0xe29d('0x5e')):undefined});}return null;})[_0xe29d('0x22')](function(_0x2dea58){if(_0x2dea58){_0x38660e[_0xe29d('0x68')]=_0x2dea58['get']({'plain':!![]});interaction_log[_0xe29d('0x23')](_0xe29d('0x69'),_0x41063f[_0xe29d('0x60')]['id'],_0x41063f[_0xe29d('0x60')][_0xe29d('0x3f')],_0x41063f[_0xe29d('0x60')][_0xe29d('0x6a')],_0x38660e[_0xe29d('0x68')]['id'],_0x41063f[_0xe29d('0x57')]?JSON[_0xe29d('0x28')](_0x41063f[_0xe29d('0x57')]):_0xe29d('0x6b'));return respondWithRpcPromise('AcceptMessage',_0xe29d('0x6c'),_0x38660e);}return null;})[_0xe29d('0x22')](function(_0x26a81a){var _0x5b92ea=_0xe29d('0x6d')+_0x26a81a[_0xe29d('0x2a')]['ContactId'];return db[_0xe29d('0x6e')]['query'](_0x5b92ea,{'type':db[_0xe29d('0x6f')]['QueryTypes'][_0xe29d('0x70')],'raw':!![]})['then'](function(_0x241d57){return _0x241d57;});})['then'](function(_0x1f3572){if(_0x1f3572){_0x38660e[_0xe29d('0x2a')][_0xe29d('0x71')]=_0x1f3572[0x0];if(!_0x41063f[_0xe29d('0x57')]['UserId'])return;return db[_0xe29d('0x72')][_0xe29d('0x55')]({'where':{'id':_0x41063f[_0xe29d('0x57')]['UserId'],'role':_0xe29d('0x61')},'attributes':['id',_0xe29d('0x3f'),_0xe29d('0x73'),_0xe29d('0x74'),_0xe29d('0x75')],'raw':!![]});}return null;})[_0xe29d('0x22')](function(_0x33de75){if(!_0x33de75)return null;_0x38660e[_0xe29d('0x2a')][_0xe29d('0x61')]=_0x33de75;return _0x38660e;})[_0xe29d('0x22')](function(_0x16ed4b){if(_0x16ed4b){if(_0x41063f[_0xe29d('0x57')]['manual']){_0x38660e[_0xe29d('0x2a')][_0xe29d('0x76')]=util[_0xe29d('0x5d')](_0xe29d('0x77'),_0x41063f[_0xe29d('0x60')][_0xe29d('0x3f')]);_0x38660e[_0xe29d('0x2a')][_0xe29d('0x78')]=_0x38660e[_0xe29d('0x78')];_0x38660e[_0xe29d('0x2a')][_0xe29d('0x79')]=_0x38660e[_0xe29d('0x78')];_0x38660e[_0xe29d('0x2a')][_0xe29d('0x7a')]=_0xe29d('0x7b');return respondWithRpcPromise(_0xe29d('0x7c'),_0xe29d('0x7c'),{'event':_0xe29d('0x7d'),'message':_[_0xe29d('0x4e')](_0x38660e[_0xe29d('0x2a')],JSON[_0xe29d('0x7e')](_0x38660e[_0xe29d('0x68')][_0xe29d('0x7f')]))},client9002)[_0xe29d('0x22')](function(){return _0x38660e;});}return _0x38660e;}return null;})[_0xe29d('0x22')](respondWithResult(_0x4594de,null))[_0xe29d('0x2c')](handleError(_0x4594de,null));};var interaction_log=require(_0xe29d('0x16'))(_0xe29d('0x80'));exports[_0xe29d('0x81')]=function(_0x47c843,_0x1ac75f,_0x48ef0b){var _0x4f3137={'agent':{},'channel':'chat'};if(_0x47c843[_0xe29d('0x57')]['id']){delete _0x47c843[_0xe29d('0x57')]['id'];}_0x47c843[_0xe29d('0x57')]['UserId']=_0x47c843[_0xe29d('0x57')][_0xe29d('0x5f')]||_0x47c843[_0xe29d('0x60')]['id'];_0x4f3137['agent']['id']=_0x47c843[_0xe29d('0x57')][_0xe29d('0x5f')];return db[_0xe29d('0x3a')][_0xe29d('0x55')]({'where':{'id':_0x47c843[_0xe29d('0x58')]['id'],'UserId':null}})[_0xe29d('0x22')](handleEntityNotFound(_0x1ac75f,null))[_0xe29d('0x22')](function(_0x395cb7){if(_0x395cb7){_0x4f3137[_0xe29d('0x2a')]=_0x395cb7[_0xe29d('0x62')]({'plain':!![]});return db[_0xe29d('0x63')]['find']({'where':{'id':_0x395cb7[_0xe29d('0x64')]}});}return null;})[_0xe29d('0x22')](handleEntityNotFound(_0x1ac75f,null))['then'](function(_0x8ad0ab){if(_0x8ad0ab){_0x4f3137['interaction']=_0x8ad0ab['get']({'plain':!![]});interaction_log[_0xe29d('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47c843[_0xe29d('0x60')]['id'],_0x47c843[_0xe29d('0x60')]['name'],_0x47c843['user'][_0xe29d('0x6a')],_0x4f3137[_0xe29d('0x68')]['id'],_0x47c843[_0xe29d('0x57')]?JSON[_0xe29d('0x28')](_0x47c843[_0xe29d('0x57')]):_0xe29d('0x6b'));return respondWithRpcPromise(_0xe29d('0x82'),'rejectMessage',_0x4f3137);}return null;})[_0xe29d('0x22')](function(_0x350aa1){var _0x2f8c07=_0xe29d('0x6d')+_0x350aa1[_0xe29d('0x2a')][_0xe29d('0x83')];return db[_0xe29d('0x6e')][_0xe29d('0x40')](_0x2f8c07,{'type':db[_0xe29d('0x6f')][_0xe29d('0x84')][_0xe29d('0x70')],'raw':!![]})[_0xe29d('0x22')](function(_0x25970f){return _0x25970f;});})[_0xe29d('0x22')](function(_0x29d5fe){if(_0x29d5fe){_0x4f3137[_0xe29d('0x2a')][_0xe29d('0x71')]=_0x29d5fe[0x0];if(!_0x47c843[_0xe29d('0x57')][_0xe29d('0x5f')])return;return db[_0xe29d('0x72')][_0xe29d('0x55')]({'where':{'id':_0x47c843[_0xe29d('0x57')]['UserId'],'role':_0xe29d('0x61')},'attributes':['id',_0xe29d('0x3f'),_0xe29d('0x73'),_0xe29d('0x74'),_0xe29d('0x75')],'raw':!![]});}return null;})['then'](function(_0x4f0cbf){if(!_0x4f0cbf)return null;_0x4f3137[_0xe29d('0x2a')][_0xe29d('0x61')]=_0x4f0cbf;return _0x4f3137;})[_0xe29d('0x22')](function(_0x41722a){if(_0x41722a){_0x41722a[_0xe29d('0x2a')][_0xe29d('0x76')]=util[_0xe29d('0x5d')](_0xe29d('0x77'),_0x47c843['user']['name']);_0x41722a[_0xe29d('0x2a')]['channel']=_0x4f3137[_0xe29d('0x78')];_0x41722a[_0xe29d('0x2a')][_0xe29d('0x79')]=_0x4f3137[_0xe29d('0x78')];_0x41722a['message'][_0xe29d('0x7a')]='reject';respondWithRpcPromise(_0xe29d('0x7c'),_0xe29d('0x7c'),{'event':_0xe29d('0x85'),'message':_['merge'](_0x4f3137[_0xe29d('0x2a')],JSON[_0xe29d('0x7e')](_0x4f3137[_0xe29d('0x68')][_0xe29d('0x7f')]))},client9002);return _0x4f3137;}return null;})[_0xe29d('0x22')](respondWithResult(_0x1ac75f,null))[_0xe29d('0x2c')](handleError(_0x1ac75f,null));};
\ No newline at end of file
+var _0xc695=['chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteraction','get','RejectMessage','rejectMessage','contact','email','internal','interface','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','destroy','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','includeAll','find','body','params','catch','describe','../../config/logger'];(function(_0x56b477,_0x324907){var _0x4d4a52=function(_0xf5f913){while(--_0xf5f913){_0x56b477['push'](_0x56b477['shift']());}};_0x4d4a52(++_0x324907);}(_0xc695,0x1ae));var _0x5c69=function(_0x3fd50c,_0x1b41ed){_0x3fd50c=_0x3fd50c-0x0;var _0x4cebb2=_0xc695[_0x3fd50c];return _0x4cebb2;};'use strict';var emlformat=require(_0x5c69('0x0'));var rimraf=require(_0x5c69('0x1'));var zipdir=require(_0x5c69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c69('0x3'));var moment=require('moment');var BPromise=require(_0x5c69('0x4'));var Mustache=require(_0x5c69('0x5'));var util=require(_0x5c69('0x6'));var path=require(_0x5c69('0x7'));var sox=require('sox');var csv=require(_0x5c69('0x8'));var ejs=require(_0x5c69('0x9'));var fs=require('fs');var fs_extra=require(_0x5c69('0xa'));var _=require(_0x5c69('0xb'));var squel=require(_0x5c69('0xc'));var crypto=require('crypto');var jsforce=require(_0x5c69('0xd'));var deskjs=require(_0x5c69('0xe'));var toCsv=require(_0x5c69('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5c69('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5c69('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c69('0x11'));var utils=require(_0x5c69('0x12'));var config=require(_0x5c69('0x13'));var licenseUtil=require(_0x5c69('0x14'));var db=require(_0x5c69('0x15'))['db'];config[_0x5c69('0x16')]=_[_0x5c69('0x17')](config[_0x5c69('0x16')],{'host':_0x5c69('0x18'),'port':0x18eb});var socket=require(_0x5c69('0x19'))(new Redis(config[_0x5c69('0x16')]));require('./chatMessage.socket')[_0x5c69('0x1a')](socket);var jayson=require(_0x5c69('0x1b'));var client=jayson['client'][_0x5c69('0x1c')]({'port':0x232c});var client9002=jayson[_0x5c69('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aa5db,_0xf5615f,_0x331d94,_0x1f70aa){return new BPromise(function(_0x17ec1f,_0x408dd1){var _0x4b90af=_0x1f70aa||client;return _0x4b90af[_0x5c69('0x1e')](_0x1aa5db,_0x331d94)[_0x5c69('0x1f')](function(_0x52e70b){logger[_0x5c69('0x20')](_0x5c69('0x21'),_0xf5615f,_0x5c69('0x22'));logger[_0x5c69('0x23')](_0x5c69('0x24'),_0xf5615f,_0x5c69('0x22'),JSON[_0x5c69('0x25')](_0x52e70b));if(_0x52e70b[_0x5c69('0x26')]){if(_0x52e70b[_0x5c69('0x26')]['code']===0x1f4){logger[_0x5c69('0x26')](_0x5c69('0x21'),_0xf5615f,_0x52e70b['error'][_0x5c69('0x27')]);return _0x408dd1(_0x52e70b[_0x5c69('0x26')][_0x5c69('0x27')]);}logger[_0x5c69('0x26')](_0x5c69('0x21'),_0xf5615f,_0x52e70b[_0x5c69('0x26')]['message']);return _0x17ec1f(_0x52e70b[_0x5c69('0x26')][_0x5c69('0x27')]);}else{logger['info'](_0x5c69('0x21'),_0xf5615f,_0x5c69('0x22'));_0x17ec1f(_0x52e70b[_0x5c69('0x28')]['message']);}})['catch'](function(_0x548d76){logger['error'](_0x5c69('0x21'),_0xf5615f,_0x548d76);_0x408dd1(_0x548d76);});});}function respondWithStatusCode(_0xeff031,_0x1bf201){_0x1bf201=_0x1bf201||0xcc;return function(_0x45fbf2){if(_0x45fbf2){return _0xeff031[_0x5c69('0x29')](_0x1bf201);}return _0xeff031[_0x5c69('0x2a')](_0x1bf201)[_0x5c69('0x2b')]();};}function respondWithResult(_0x33578e,_0x42b0e3){_0x42b0e3=_0x42b0e3||0xc8;return function(_0x4e55a0){if(_0x4e55a0){return _0x33578e['status'](_0x42b0e3)['json'](_0x4e55a0);}};}function respondWithFilteredResult(_0x2b1607,_0x3d1af5){return function(_0xc74a5e){if(_0xc74a5e){var _0x5b6146=typeof _0x3d1af5[_0x5c69('0x2c')]===_0x5c69('0x2d')&&typeof _0x3d1af5[_0x5c69('0x2e')]===_0x5c69('0x2d');var _0x32b458=_0xc74a5e[_0x5c69('0x2f')];var _0x398ec2=_0x5b6146?0x0:_0x3d1af5[_0x5c69('0x2c')];var _0x4e9dd3=_0x5b6146?_0xc74a5e[_0x5c69('0x2f')]:_0x3d1af5['offset']+_0x3d1af5[_0x5c69('0x2e')];var _0xa9be78;if(_0x4e9dd3>=_0x32b458){_0x4e9dd3=_0x32b458;_0xa9be78=0xc8;}else{_0xa9be78=0xce;}_0x2b1607[_0x5c69('0x2a')](_0xa9be78);return _0x2b1607['set']('Content-Range',_0x398ec2+'-'+_0x4e9dd3+'/'+_0x32b458)[_0x5c69('0x30')](_0xc74a5e);}return null;};}function patchUpdates(_0xc0dd2a){return function(_0x33d022){try{jsonpatch[_0x5c69('0x31')](_0x33d022,_0xc0dd2a,!![]);}catch(_0x5e4055){return BPromise[_0x5c69('0x32')](_0x5e4055);}return _0x33d022['save']();};}function saveUpdates(_0xcbf544,_0x28b70e){return function(_0x4d7e4b){if(_0x4d7e4b){return _0x4d7e4b[_0x5c69('0x33')](_0xcbf544)[_0x5c69('0x1f')](function(_0x385857){return _0x385857;});}return null;};}function removeEntity(_0xa3cf33,_0x41195f){return function(_0x57dd34){if(_0x57dd34){return _0x57dd34[_0x5c69('0x34')]()[_0x5c69('0x1f')](function(){_0xa3cf33[_0x5c69('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5f75,_0x25718a){return function(_0x22db34){if(!_0x22db34){_0x2d5f75[_0x5c69('0x29')](0x194);}return _0x22db34;};}function handleError(_0x3bf6c6,_0x35c255){_0x35c255=_0x35c255||0x1f4;return function(_0x1699af){logger[_0x5c69('0x26')](_0x1699af[_0x5c69('0x35')]);if(_0x1699af[_0x5c69('0x36')]){delete _0x1699af[_0x5c69('0x36')];}_0x3bf6c6[_0x5c69('0x2a')](_0x35c255)[_0x5c69('0x37')](_0x1699af);};}exports['index']=function(_0x185cbb,_0x495b27){var _0x5f4461={},_0x1966e7={},_0xf50860={'count':0x0,'rows':[]};var _0x143238=_['map'](db[_0x5c69('0x38')][_0x5c69('0x39')],function(_0x2415a4){return{'name':_0x2415a4[_0x5c69('0x3a')],'type':_0x2415a4[_0x5c69('0x3b')][_0x5c69('0x3c')]};});_0x1966e7[_0x5c69('0x3d')]=_[_0x5c69('0x3e')](_0x143238,_0x5c69('0x36'));_0x1966e7[_0x5c69('0x3f')]=_[_0x5c69('0x40')](_0x185cbb[_0x5c69('0x3f')]);_0x1966e7[_0x5c69('0x41')]=_['intersection'](_0x1966e7[_0x5c69('0x3d')],_0x1966e7[_0x5c69('0x3f')]);_0x5f4461[_0x5c69('0x42')]=_[_0x5c69('0x43')](_0x1966e7[_0x5c69('0x3d')],qs['fields'](_0x185cbb['query'][_0x5c69('0x44')]));_0x5f4461[_0x5c69('0x42')]=_0x5f4461[_0x5c69('0x42')][_0x5c69('0x45')]?_0x5f4461[_0x5c69('0x42')]:_0x1966e7['model'];if(!_0x185cbb['query'][_0x5c69('0x46')](_0x5c69('0x47'))){_0x5f4461['limit']=qs[_0x5c69('0x2e')](_0x185cbb[_0x5c69('0x3f')][_0x5c69('0x2e')]);_0x5f4461['offset']=qs[_0x5c69('0x2c')](_0x185cbb['query'][_0x5c69('0x2c')]);}_0x5f4461[_0x5c69('0x48')]=qs[_0x5c69('0x49')](_0x185cbb[_0x5c69('0x3f')]['sort']);_0x5f4461[_0x5c69('0x4a')]=qs[_0x5c69('0x41')](_['pick'](_0x185cbb[_0x5c69('0x3f')],_0x1966e7[_0x5c69('0x41')]),_0x143238);if(_0x185cbb[_0x5c69('0x3f')]['filter']){_0x5f4461[_0x5c69('0x4a')]=_[_0x5c69('0x4b')](_0x5f4461[_0x5c69('0x4a')],{'$or':_[_0x5c69('0x3e')](_0x143238,function(_0xfd3729){if(_0xfd3729[_0x5c69('0x3b')]!==_0x5c69('0x4c')){var _0x507f23={};_0x507f23[_0xfd3729[_0x5c69('0x36')]]={'$like':'%'+_0x185cbb['query'][_0x5c69('0x4d')]+'%'};return _0x507f23;}})});}_0x5f4461=_['merge']({},_0x5f4461,_0x185cbb[_0x5c69('0x4e')]);var _0x17ce96={'where':_0x5f4461[_0x5c69('0x4a')]};return db[_0x5c69('0x38')][_0x5c69('0x2f')](_0x17ce96)[_0x5c69('0x1f')](function(_0x4a4717){_0xf50860['count']=_0x4a4717;if(_0x185cbb[_0x5c69('0x3f')]['includeAll']){_0x5f4461[_0x5c69('0x4f')]=[{'all':!![]}];}return db[_0x5c69('0x38')][_0x5c69('0x50')](_0x5f4461);})[_0x5c69('0x1f')](function(_0x37c852){_0xf50860[_0x5c69('0x51')]=_0x37c852;return _0xf50860;})[_0x5c69('0x1f')](respondWithFilteredResult(_0x495b27,_0x5f4461))['catch'](handleError(_0x495b27,null));};exports[_0x5c69('0x52')]=function(_0x467692,_0x454aba){var _0x31efaf={'raw':!![],'where':{'id':_0x467692['params']['id']}},_0x135389={};_0x135389['model']=_[_0x5c69('0x40')](db[_0x5c69('0x38')][_0x5c69('0x39')]);_0x135389['query']=_[_0x5c69('0x40')](_0x467692[_0x5c69('0x3f')]);_0x135389[_0x5c69('0x41')]=_[_0x5c69('0x43')](_0x135389['model'],_0x135389[_0x5c69('0x3f')]);_0x31efaf[_0x5c69('0x42')]=_[_0x5c69('0x43')](_0x135389[_0x5c69('0x3d')],qs['fields'](_0x467692[_0x5c69('0x3f')][_0x5c69('0x44')]));_0x31efaf[_0x5c69('0x42')]=_0x31efaf[_0x5c69('0x42')]['length']?_0x31efaf[_0x5c69('0x42')]:_0x135389['model'];if(_0x467692[_0x5c69('0x3f')][_0x5c69('0x53')]){_0x31efaf[_0x5c69('0x4f')]=[{'all':!![]}];}_0x31efaf=_[_0x5c69('0x4b')]({},_0x31efaf,_0x467692['options']);return db[_0x5c69('0x38')][_0x5c69('0x54')](_0x31efaf)[_0x5c69('0x1f')](handleEntityNotFound(_0x454aba,null))[_0x5c69('0x1f')](respondWithResult(_0x454aba,null))['catch'](handleError(_0x454aba,null));};exports['create']=function(_0x4cc7cd,_0x1a9e2a){return db['ChatMessage']['create'](_0x4cc7cd['body'],{})[_0x5c69('0x1f')](respondWithResult(_0x1a9e2a,0xc9))['catch'](handleError(_0x1a9e2a,null));};exports[_0x5c69('0x33')]=function(_0x119c35,_0x41c889){if(_0x119c35[_0x5c69('0x55')]['id']){delete _0x119c35[_0x5c69('0x55')]['id'];}return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x119c35[_0x5c69('0x56')]['id']}})['then'](handleEntityNotFound(_0x41c889,null))[_0x5c69('0x1f')](saveUpdates(_0x119c35[_0x5c69('0x55')],null))[_0x5c69('0x1f')](respondWithResult(_0x41c889,null))[_0x5c69('0x57')](handleError(_0x41c889,null));};exports['destroy']=function(_0x391edf,_0x484730){return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x391edf[_0x5c69('0x56')]['id']}})[_0x5c69('0x1f')](handleEntityNotFound(_0x484730,null))['then'](removeEntity(_0x484730,null))[_0x5c69('0x57')](handleError(_0x484730,null));};exports[_0x5c69('0x58')]=function(_0x4337e4,_0x555007){return db[_0x5c69('0x38')][_0x5c69('0x58')]()['then'](respondWithResult(_0x555007,null))[_0x5c69('0x57')](handleError(_0x555007,null));};var interaction_log=require(_0x5c69('0x59'))(_0x5c69('0x5a'));exports[_0x5c69('0x5b')]=function(_0x50f335,_0xe27e7b,_0x2170de){var _0x48c1b1={'agent':{},'channel':'chat'};if(_0x50f335[_0x5c69('0x55')]['id']){delete _0x50f335['body']['id'];}_0x50f335[_0x5c69('0x55')][_0x5c69('0x5c')]=!![];_0x50f335[_0x5c69('0x55')][_0x5c69('0x5d')]=moment()[_0x5c69('0x5e')](_0x5c69('0x5f'));_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')]=_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')]||_0x50f335[_0x5c69('0x61')]['id'];_0x48c1b1[_0x5c69('0x62')]['id']=_0x50f335['body']['UserId'];return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x50f335[_0x5c69('0x56')]['id'],'UserId':null}})[_0x5c69('0x1f')](handleEntityNotFound(_0xe27e7b,null))['then'](saveUpdates(_0x50f335[_0x5c69('0x55')],null))[_0x5c69('0x1f')](function(_0x4094ee){if(_0x4094ee){_0x48c1b1[_0x5c69('0x27')]=_0x4094ee['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4094ee[_0x5c69('0x63')]}});}return null;})[_0x5c69('0x1f')](handleEntityNotFound(_0xe27e7b,null))[_0x5c69('0x1f')](function(_0x2e5a18){if(_0x2e5a18){return _0x2e5a18[_0x5c69('0x33')]({'UserId':_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')],'read1stAt':_[_0x5c69('0x64')](_0x2e5a18[_0x5c69('0x65')])?moment()[_0x5c69('0x5e')](_0x5c69('0x5f')):undefined});}return null;})[_0x5c69('0x1f')](function(_0x28737a){if(_0x28737a){_0x48c1b1[_0x5c69('0x66')]=_0x28737a['get']({'plain':!![]});interaction_log[_0x5c69('0x20')](_0x5c69('0x67'),_0x50f335[_0x5c69('0x61')]['id'],_0x50f335[_0x5c69('0x61')]['name'],_0x50f335['user'][_0x5c69('0x68')],_0x48c1b1[_0x5c69('0x66')]['id'],_0x50f335[_0x5c69('0x55')]?JSON[_0x5c69('0x25')](_0x50f335['body']):_0x5c69('0x69'));return respondWithRpcPromise('AcceptMessage',_0x5c69('0x6a'),_0x48c1b1);}return null;})[_0x5c69('0x1f')](function(_0x5f25b7){var _0x59092d=_0x5c69('0x6b')+_0x5f25b7['message']['ContactId'];return db[_0x5c69('0x6c')][_0x5c69('0x3f')](_0x59092d,{'type':db[_0x5c69('0x6d')][_0x5c69('0x6e')][_0x5c69('0x6f')],'raw':!![]})[_0x5c69('0x1f')](function(_0x37ed5a){return _0x37ed5a;});})[_0x5c69('0x1f')](function(_0x4e612e){if(_0x4e612e){_0x48c1b1[_0x5c69('0x27')]['contact']=_0x4e612e[0x0];if(!_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')])return;return db[_0x5c69('0x70')][_0x5c69('0x54')]({'where':{'id':_0x50f335[_0x5c69('0x55')][_0x5c69('0x60')],'role':_0x5c69('0x62')},'attributes':['id',_0x5c69('0x36'),_0x5c69('0x71'),'email','internal'],'raw':!![]});}return null;})[_0x5c69('0x1f')](function(_0x197bb6){if(!_0x197bb6)return null;_0x48c1b1[_0x5c69('0x27')]['agent']=_0x197bb6;return _0x48c1b1;})['then'](function(_0xbed95b){if(_0xbed95b){if(_0x50f335['body']['manual']){_0x48c1b1[_0x5c69('0x27')]['interface']=util[_0x5c69('0x5e')](_0x5c69('0x72'),_0x50f335[_0x5c69('0x61')][_0x5c69('0x36')]);_0x48c1b1[_0x5c69('0x27')][_0x5c69('0x73')]=_0x48c1b1[_0x5c69('0x73')];_0x48c1b1[_0x5c69('0x27')][_0x5c69('0x74')]=_0x48c1b1[_0x5c69('0x73')];_0x48c1b1[_0x5c69('0x27')][_0x5c69('0x75')]=_0x5c69('0x5b');return respondWithRpcPromise(_0x5c69('0x76'),_0x5c69('0x76'),{'event':_0x5c69('0x77'),'message':_[_0x5c69('0x4b')](_0x48c1b1[_0x5c69('0x27')],JSON[_0x5c69('0x78')](_0x48c1b1['interaction'][_0x5c69('0x79')]))},client9002)[_0x5c69('0x1f')](function(){return _0x48c1b1;});}return _0x48c1b1;}return null;})[_0x5c69('0x1f')](respondWithResult(_0xe27e7b,null))[_0x5c69('0x57')](handleError(_0xe27e7b,null));};var interaction_log=require(_0x5c69('0x59'))(_0x5c69('0x5a'));exports[_0x5c69('0x32')]=function(_0x2cfd92,_0x37d1f9,_0x18bacb){var _0x149770={'agent':{},'channel':'chat'};if(_0x2cfd92[_0x5c69('0x55')]['id']){delete _0x2cfd92[_0x5c69('0x55')]['id'];}_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')]=_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')]||_0x2cfd92[_0x5c69('0x61')]['id'];_0x149770[_0x5c69('0x62')]['id']=_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')];return db[_0x5c69('0x38')][_0x5c69('0x54')]({'where':{'id':_0x2cfd92[_0x5c69('0x56')]['id'],'UserId':null}})[_0x5c69('0x1f')](handleEntityNotFound(_0x37d1f9,null))['then'](function(_0x3b9137){if(_0x3b9137){_0x149770['message']=_0x3b9137['get']({'plain':!![]});return db[_0x5c69('0x7a')][_0x5c69('0x54')]({'where':{'id':_0x3b9137[_0x5c69('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x37d1f9,null))[_0x5c69('0x1f')](function(_0x20a2fd){if(_0x20a2fd){_0x149770[_0x5c69('0x66')]=_0x20a2fd[_0x5c69('0x7b')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cfd92['user']['id'],_0x2cfd92[_0x5c69('0x61')][_0x5c69('0x36')],_0x2cfd92[_0x5c69('0x61')][_0x5c69('0x68')],_0x149770[_0x5c69('0x66')]['id'],_0x2cfd92[_0x5c69('0x55')]?JSON['stringify'](_0x2cfd92[_0x5c69('0x55')]):_0x5c69('0x69'));return respondWithRpcPromise(_0x5c69('0x7c'),_0x5c69('0x7d'),_0x149770);}return null;})[_0x5c69('0x1f')](function(_0x59f304){var _0x612c46='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x59f304['message']['ContactId'];return db[_0x5c69('0x6c')][_0x5c69('0x3f')](_0x612c46,{'type':db[_0x5c69('0x6d')]['QueryTypes'][_0x5c69('0x6f')],'raw':!![]})[_0x5c69('0x1f')](function(_0x32b8b2){return _0x32b8b2;});})['then'](function(_0xb23d0){if(_0xb23d0){_0x149770[_0x5c69('0x27')][_0x5c69('0x7e')]=_0xb23d0[0x0];if(!_0x2cfd92[_0x5c69('0x55')][_0x5c69('0x60')])return;return db[_0x5c69('0x70')][_0x5c69('0x54')]({'where':{'id':_0x2cfd92['body'][_0x5c69('0x60')],'role':_0x5c69('0x62')},'attributes':['id',_0x5c69('0x36'),_0x5c69('0x71'),_0x5c69('0x7f'),_0x5c69('0x80')],'raw':!![]});}return null;})[_0x5c69('0x1f')](function(_0x132faa){if(!_0x132faa)return null;_0x149770['message'][_0x5c69('0x62')]=_0x132faa;return _0x149770;})[_0x5c69('0x1f')](function(_0x54e1bb){if(_0x54e1bb){_0x54e1bb['message'][_0x5c69('0x81')]=util[_0x5c69('0x5e')]('SIP/%s',_0x2cfd92[_0x5c69('0x61')][_0x5c69('0x36')]);_0x54e1bb[_0x5c69('0x27')][_0x5c69('0x73')]=_0x149770[_0x5c69('0x73')];_0x54e1bb[_0x5c69('0x27')][_0x5c69('0x74')]=_0x149770[_0x5c69('0x73')];_0x54e1bb[_0x5c69('0x27')][_0x5c69('0x75')]='reject';respondWithRpcPromise(_0x5c69('0x76'),_0x5c69('0x76'),{'event':'rejectmessage','message':_['merge'](_0x149770[_0x5c69('0x27')],JSON[_0x5c69('0x78')](_0x149770['interaction'][_0x5c69('0x79')]))},client9002);return _0x149770;}return null;})['then'](respondWithResult(_0x37d1f9,null))[_0x5c69('0x57')](handleError(_0x37d1f9,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b5463ea..dcda08b 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 _0xd192=['remove','emit','hasOwnProperty','exports','events','ChatMessage','setMaxListeners','save','update'];(function(_0xc83b33,_0x5d6cee){var _0x4dd7b8=function(_0x3687bf){while(--_0x3687bf){_0xc83b33['push'](_0xc83b33['shift']());}};_0x4dd7b8(++_0x5d6cee);}(_0xd192,0x67));var _0x2d19=function(_0x1fdbef,_0x41d245){_0x1fdbef=_0x1fdbef-0x0;var _0x21680a=_0xd192[_0x1fdbef];return _0x21680a;};'use strict';var EventEmitter=require(_0x2d19('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x2d19('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2d19('0x2')](0x0);var events={'afterCreate':_0x2d19('0x3'),'afterUpdate':_0x2d19('0x4'),'afterDestroy':_0x2d19('0x5')};function emitEvent(_0x5ebd1b){return function(_0x6330ae,_0x9d3b95,_0x426924){ChatMessageEvents[_0x2d19('0x6')](_0x5ebd1b+':'+_0x6330ae['id'],_0x6330ae);ChatMessageEvents[_0x2d19('0x6')](_0x5ebd1b,_0x6330ae);_0x426924(null);};}for(var e in events){if(events[_0x2d19('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x2d19('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xc55a=['update','remove','emit','hook','exports','events','ChatMessage','setMaxListeners','save'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xc55a,0x9e));var _0xac55=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc55a[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0xac55('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xac55('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xac55('0x2')](0x0);var events={'afterCreate':_0xac55('0x3'),'afterUpdate':_0xac55('0x4'),'afterDestroy':_0xac55('0x5')};function emitEvent(_0x4e8b6d){return function(_0x438d8,_0x144589,_0x27530d){ChatMessageEvents['emit'](_0x4e8b6d+':'+_0x438d8['id'],_0x438d8);ChatMessageEvents[_0xac55('0x6')](_0x4e8b6d,_0x438d8);_0x27530d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xac55('0x7')](e,emitEvent(event));}}module[_0xac55('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 0cb5027..1c52016 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 _0x8d20=['path','rimraf','../../config/environment','exports','define','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f2438,_0x1aa150){var _0x25d498=function(_0x2a3fe4){while(--_0x2a3fe4){_0x1f2438['push'](_0x1f2438['shift']());}};_0x25d498(++_0x1aa150);}(_0x8d20,0x1c5));var _0x08d2=function(_0x4136b8,_0x9ce0ab){_0x4136b8=_0x4136b8-0x0;var _0x161647=_0x8d20[_0x4136b8];return _0x161647;};'use strict';var _=require('lodash');var util=require(_0x08d2('0x0'));var logger=require(_0x08d2('0x1'))(_0x08d2('0x2'));var moment=require(_0x08d2('0x3'));var BPromise=require(_0x08d2('0x4'));var rp=require(_0x08d2('0x5'));var fs=require('fs');var path=require(_0x08d2('0x6'));var rimraf=require(_0x08d2('0x7'));var config=require(_0x08d2('0x8'));var attributes=require('./chatMessage.attributes');module[_0x08d2('0x9')]=function(_0x459e2c,_0x1acbf4){return _0x459e2c[_0x08d2('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x08d2('0xb'),'fields':[_0x08d2('0xc')],'type':_0x08d2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xaf964,_0x3ff53f,_0x3f9e21){var _0x3112d0=_0x459e2c['models'];var _0x463135=_0xaf964['get']({'plain':!![]});if(_0x463135[_0x08d2('0xe')][_0x08d2('0xf')]()==='in'||_0x463135[_0x08d2('0xe')]['toLowerCase']()==='out'&&!_0x463135[_0x08d2('0x10')]&&!_[_0x08d2('0x11')](_0x463135[_0x08d2('0x12')])){_0x3112d0[_0x08d2('0x13')][_0x08d2('0x14')]({'where':{'id':_0x463135['ChatInteractionId']}})[_0x08d2('0x15')](function(_0x3c4718){if(_0x3c4718){_0x3c4718[_0x08d2('0x16')]({'lastMsgAt':_0x463135[_0x08d2('0x17')],'lastMsgDirection':_0x463135[_0x08d2('0xe')][_0x08d2('0xf')]()});}})[_0x08d2('0x18')](function(_0x3f355a){console['error'](_0x3f355a);});}_0x3f9e21();}},'charset':_0x08d2('0x19'),'collate':_0x08d2('0x1a')});};
\ No newline at end of file
+var _0x8b0d=['then','createdAt','catch','error','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x8b0d,0x1f2));var _0xd8b0=function(_0x3d0c6c,_0x56c36c){_0x3d0c6c=_0x3d0c6c-0x0;var _0x13f5b6=_0x8b0d[_0x3d0c6c];return _0x13f5b6;};'use strict';var _=require(_0xd8b0('0x0'));var util=require(_0xd8b0('0x1'));var logger=require(_0xd8b0('0x2'))('api');var moment=require(_0xd8b0('0x3'));var BPromise=require(_0xd8b0('0x4'));var rp=require(_0xd8b0('0x5'));var fs=require('fs');var path=require(_0xd8b0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd8b0('0x7'));module[_0xd8b0('0x8')]=function(_0x34bae6,_0x1bd8cd){return _0x34bae6[_0xd8b0('0x9')]('ChatMessage',attributes,{'tableName':_0xd8b0('0xa'),'paranoid':![],'indexes':[{'name':_0xd8b0('0xb'),'fields':[_0xd8b0('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51c1f2,_0x532c0c,_0x5bafb4){var _0x4e38bd=_0x34bae6[_0xd8b0('0xd')];var _0x6b2f28=_0x51c1f2['get']({'plain':!![]});if(_0x6b2f28[_0xd8b0('0xe')][_0xd8b0('0xf')]()==='in'||_0x6b2f28[_0xd8b0('0xe')][_0xd8b0('0xf')]()===_0xd8b0('0x10')&&!_0x6b2f28[_0xd8b0('0x11')]&&!_[_0xd8b0('0x12')](_0x6b2f28[_0xd8b0('0x13')])){_0x4e38bd['ChatInteraction'][_0xd8b0('0x14')]({'where':{'id':_0x6b2f28[_0xd8b0('0x15')]}})[_0xd8b0('0x16')](function(_0x564b7f){if(_0x564b7f){_0x564b7f['update']({'lastMsgAt':_0x6b2f28[_0xd8b0('0x17')],'lastMsgDirection':_0x6b2f28[_0xd8b0('0xe')][_0xd8b0('0xf')]()});}})[_0xd8b0('0x18')](function(_0x5f308c){console[_0xd8b0('0x19')](_0x5f308c);});}_0x5bafb4();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 539e282..bdfd031 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 _0xa808=['stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatMessage','ChatMessage','body','options','raw'];(function(_0x37679c,_0x1873fe){var _0x26b3b4=function(_0xb6ce4d){while(--_0xb6ce4d){_0x37679c['push'](_0x37679c['shift']());}};_0x26b3b4(++_0x1873fe);}(_0xa808,0x12b));var _0x8a80=function(_0x466fc5,_0x44df27){_0x466fc5=_0x466fc5-0x0;var _0x351e8a=_0xa808[_0x466fc5];return _0x351e8a;};'use strict';var _=require(_0x8a80('0x0'));var util=require(_0x8a80('0x1'));var moment=require('moment');var BPromise=require(_0x8a80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a80('0x3'));var db=require(_0x8a80('0x4'))['db'];var utils=require(_0x8a80('0x5'));var logger=require('../../config/logger')(_0x8a80('0x6'));var config=require(_0x8a80('0x7'));var jayson=require(_0x8a80('0x8'));var client=jayson[_0x8a80('0x9')][_0x8a80('0xa')]({'port':0x232a});config[_0x8a80('0xb')]=_[_0x8a80('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8a80('0xd'))(new Redis(config[_0x8a80('0xb')]));require(_0x8a80('0xe'))[_0x8a80('0xf')](socket);function respondWithRpcPromise(_0x27361c,_0x606674,_0x8f8cdd){return new BPromise(function(_0x30868c,_0x3702d6){return client['request'](_0x27361c,_0x8f8cdd)[_0x8a80('0x10')](function(_0x527d7a){logger[_0x8a80('0x11')](_0x8a80('0x12'),_0x606674,_0x8a80('0x13'));logger[_0x8a80('0x14')](_0x8a80('0x15'),_0x606674,_0x8a80('0x13'),JSON['stringify'](_0x527d7a));if(_0x527d7a[_0x8a80('0x16')]){if(_0x527d7a[_0x8a80('0x16')][_0x8a80('0x17')]===0x1f4){logger[_0x8a80('0x16')](_0x8a80('0x12'),_0x606674,_0x527d7a['error'][_0x8a80('0x18')]);return _0x3702d6(_0x527d7a[_0x8a80('0x16')]['message']);}logger[_0x8a80('0x16')](_0x8a80('0x12'),_0x606674,_0x527d7a['error'][_0x8a80('0x18')]);return _0x30868c(_0x527d7a['error'][_0x8a80('0x18')]);}else{logger['info'](_0x8a80('0x12'),_0x606674,_0x8a80('0x13'));_0x30868c(_0x527d7a[_0x8a80('0x19')][_0x8a80('0x18')]);}})['catch'](function(_0x10e306){logger[_0x8a80('0x16')]('ChatMessage,\x20%s,\x20%s',_0x606674,_0x10e306);_0x3702d6(_0x10e306);});});}exports[_0x8a80('0x1a')]=function(_0x2e68e5){var _0x24f342=this;return new Promise(function(_0x328b04,_0x55250a){return db[_0x8a80('0x1b')]['create'](_0x2e68e5[_0x8a80('0x1c')],{'raw':_0x2e68e5[_0x8a80('0x1d')]?_0x2e68e5[_0x8a80('0x1d')][_0x8a80('0x1e')]===undefined?!![]:![]:!![]})[_0x8a80('0x10')](function(_0x395532){logger[_0x8a80('0x11')](_0x8a80('0x1a'),_0x2e68e5);logger[_0x8a80('0x14')](_0x8a80('0x1a'),_0x2e68e5,JSON[_0x8a80('0x1f')](_0x395532));_0x328b04(_0x395532);})[_0x8a80('0x20')](function(_0x1e1e9f){logger['error'](_0x8a80('0x1a'),_0x1e1e9f['message'],_0x2e68e5);_0x55250a(_0x24f342['error'](0x1f4,_0x1e1e9f[_0x8a80('0x18')]));});});};
\ No newline at end of file
+var _0x3a94=['redis','defaults','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x11c93e,_0xd3235e){var _0x3d1726=function(_0x3dc228){while(--_0x3dc228){_0x11c93e['push'](_0x11c93e['shift']());}};_0x3d1726(++_0xd3235e);}(_0x3a94,0x105));var _0x43a9=function(_0x5866c7,_0x5f4a5c){_0x5866c7=_0x5866c7-0x0;var _0x14a350=_0x3a94[_0x5866c7];return _0x14a350;};'use strict';var _=require(_0x43a9('0x0'));var util=require(_0x43a9('0x1'));var moment=require('moment');var BPromise=require(_0x43a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43a9('0x3'));var db=require(_0x43a9('0x4'))['db'];var utils=require(_0x43a9('0x5'));var logger=require('../../config/logger')(_0x43a9('0x6'));var config=require(_0x43a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43a9('0x8')]['http']({'port':0x232a});config[_0x43a9('0x9')]=_[_0x43a9('0xa')](config[_0x43a9('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43a9('0x9')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4562f6,_0x95b0c2,_0x1b17f8){return new BPromise(function(_0x530d23,_0x31362d){return client[_0x43a9('0xb')](_0x4562f6,_0x1b17f8)[_0x43a9('0xc')](function(_0x1ba77b){logger['info'](_0x43a9('0xd'),_0x95b0c2,_0x43a9('0xe'));logger[_0x43a9('0xf')](_0x43a9('0x10'),_0x95b0c2,'request\x20sent',JSON[_0x43a9('0x11')](_0x1ba77b));if(_0x1ba77b['error']){if(_0x1ba77b['error'][_0x43a9('0x12')]===0x1f4){logger[_0x43a9('0x13')](_0x43a9('0xd'),_0x95b0c2,_0x1ba77b[_0x43a9('0x13')][_0x43a9('0x14')]);return _0x31362d(_0x1ba77b[_0x43a9('0x13')][_0x43a9('0x14')]);}logger[_0x43a9('0x13')](_0x43a9('0xd'),_0x95b0c2,_0x1ba77b[_0x43a9('0x13')]['message']);return _0x530d23(_0x1ba77b[_0x43a9('0x13')]['message']);}else{logger[_0x43a9('0x15')](_0x43a9('0xd'),_0x95b0c2,'request\x20sent');_0x530d23(_0x1ba77b[_0x43a9('0x16')]['message']);}})[_0x43a9('0x17')](function(_0x106898){logger[_0x43a9('0x13')](_0x43a9('0xd'),_0x95b0c2,_0x106898);_0x31362d(_0x106898);});});}exports[_0x43a9('0x18')]=function(_0x14b265){var _0x2bf949=this;return new Promise(function(_0x143e58,_0x4f69e8){return db[_0x43a9('0x19')][_0x43a9('0x1a')](_0x14b265[_0x43a9('0x1b')],{'raw':_0x14b265[_0x43a9('0x1c')]?_0x14b265['options'][_0x43a9('0x1d')]===undefined?!![]:![]:!![]})[_0x43a9('0xc')](function(_0x3de3ed){logger[_0x43a9('0x15')](_0x43a9('0x18'),_0x14b265);logger[_0x43a9('0xf')](_0x43a9('0x18'),_0x14b265,JSON['stringify'](_0x3de3ed));_0x143e58(_0x3de3ed);})[_0x43a9('0x17')](function(_0xbeb8ce){logger[_0x43a9('0x13')](_0x43a9('0x18'),_0xbeb8ce['message'],_0x14b265);_0x4f69e8(_0x2bf949[_0x43a9('0x13')](0x1f4,_0xbeb8ce['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index aadcb60..05d8854 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 _0x49c4=['chatMessage:','./chatMessage.events','remove','update','emit','register','length'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x49c4,0x9b));var _0x449c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x49c4[_0x2641f9];return _0x585741;};'use strict';var ChatMessageEvents=require(_0x449c('0x0'));var events=['save',_0x449c('0x1'),_0x449c('0x2')];function createListener(_0x17bf65,_0x1d60ee){return function(_0x2646ac){_0x1d60ee[_0x449c('0x3')](_0x17bf65,_0x2646ac);};}function removeListener(_0x23314e,_0x5b564c){return function(){ChatMessageEvents['removeListener'](_0x23314e,_0x5b564c);};}exports[_0x449c('0x4')]=function(_0x442e56){for(var _0x12586c=0x0,_0x2db09a=events[_0x449c('0x5')];_0x12586c<_0x2db09a;_0x12586c++){var _0x43cb0e=events[_0x12586c];var _0x3e6354=createListener(_0x449c('0x6')+_0x43cb0e,_0x442e56);ChatMessageEvents['on'](_0x43cb0e,_0x3e6354);}};
\ No newline at end of file
+var _0x1db9=['remove','update','emit','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x2f742b,_0x3ca4ad){var _0x4ffc39=function(_0x236f2f){while(--_0x236f2f){_0x2f742b['push'](_0x2f742b['shift']());}};_0x4ffc39(++_0x3ca4ad);}(_0x1db9,0x176));var _0x91db=function(_0x359e56,_0x4522f6){_0x359e56=_0x359e56-0x0;var _0x2b2662=_0x1db9[_0x359e56];return _0x2b2662;};'use strict';var ChatMessageEvents=require(_0x91db('0x0'));var events=[_0x91db('0x1'),_0x91db('0x2'),_0x91db('0x3')];function createListener(_0xcdfaed,_0xb6de0b){return function(_0x49b8c5){_0xb6de0b[_0x91db('0x4')](_0xcdfaed,_0x49b8c5);};}function removeListener(_0x42ae75,_0x59c944){return function(){ChatMessageEvents['removeListener'](_0x42ae75,_0x59c944);};}exports[_0x91db('0x5')]=function(_0x4b3f5c){for(var _0x5e69d9=0x0,_0x433c75=events[_0x91db('0x6')];_0x5e69d9<_0x433c75;_0x5e69d9++){var _0x45fea0=events[_0x5e69d9];var _0x2330c2=createListener(_0x91db('0x7')+_0x45fea0,_0x4b3f5c);ChatMessageEvents['on'](_0x45fea0,_0x2330c2);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 08e839d..008819d 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 _0x95b9=['reject','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept'];(function(_0x21852b,_0x252996){var _0x369e2f=function(_0x58974a){while(--_0x58974a){_0x21852b['push'](_0x21852b['shift']());}};_0x369e2f(++_0x252996);}(_0x95b9,0xc1));var _0x995b=function(_0x5a5f4a,_0x38b29c){_0x5a5f4a=_0x5a5f4a-0x0;var _0x5cec38=_0x95b9[_0x5a5f4a];return _0x5cec38;};'use strict';var multer=require('multer');var util=require(_0x995b('0x0'));var path=require(_0x995b('0x1'));var timeout=require('connect-timeout');var express=require(_0x995b('0x2'));var router=express[_0x995b('0x3')]();var fs_extra=require(_0x995b('0x4'));var auth=require(_0x995b('0x5'));var interaction=require(_0x995b('0x6'));var config=require('../../config/environment');var controller=require(_0x995b('0x7'));router[_0x995b('0x8')]('/',auth[_0x995b('0x9')](),controller['index']);router[_0x995b('0x8')](_0x995b('0xa'),auth[_0x995b('0x9')](),controller[_0x995b('0xb')]);router[_0x995b('0x8')](_0x995b('0xc'),auth[_0x995b('0x9')](),controller[_0x995b('0xd')]);router[_0x995b('0xe')]('/',auth['isAuthenticated'](),interaction[_0x995b('0xf')](_0x995b('0x10'),_0x995b('0x11')),controller[_0x995b('0x12')]);router[_0x995b('0x13')](_0x995b('0xc'),controller[_0x995b('0x14')]);router[_0x995b('0x13')](_0x995b('0x15'),auth[_0x995b('0x9')](),controller[_0x995b('0x16')]);router['put']('/:id/reject',auth[_0x995b('0x9')](),controller[_0x995b('0x17')]);router[_0x995b('0x18')](_0x995b('0xc'),auth['isAuthenticated'](),controller[_0x995b('0x19')]);module[_0x995b('0x1a')]=router;
\ No newline at end of file
+var _0x15bb=['chatmessage:create','create','put','update','accept','/:id/reject','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','post','tracked','chat'];(function(_0x2b435e,_0x427598){var _0x4cab98=function(_0x5d4981){while(--_0x5d4981){_0x2b435e['push'](_0x2b435e['shift']());}};_0x4cab98(++_0x427598);}(_0x15bb,0x140));var _0xb15b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x15bb[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xb15b('0x0'));var util=require(_0xb15b('0x1'));var path=require(_0xb15b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb15b('0x3'));var router=express[_0xb15b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb15b('0x5'));var interaction=require(_0xb15b('0x6'));var config=require(_0xb15b('0x7'));var controller=require(_0xb15b('0x8'));router[_0xb15b('0x9')]('/',auth[_0xb15b('0xa')](),controller[_0xb15b('0xb')]);router[_0xb15b('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb15b('0x9')](_0xb15b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb15b('0xd')]('/',auth[_0xb15b('0xa')](),interaction[_0xb15b('0xe')](_0xb15b('0xf'),_0xb15b('0x10')),controller[_0xb15b('0x11')]);router[_0xb15b('0x12')]('/:id',controller[_0xb15b('0x13')]);router[_0xb15b('0x12')]('/:id/accept',auth[_0xb15b('0xa')](),controller[_0xb15b('0x14')]);router['put'](_0xb15b('0x15'),auth[_0xb15b('0xa')](),controller['reject']);router[_0xb15b('0x16')]('/:id',auth[_0xb15b('0xa')](),controller['destroy']);module[_0xb15b('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index de44d8d..70132e0 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(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0b0e[_0x53ccf2];return _0x5a2964;};'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 _0x757a=['exports','TEXT'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x757a,0xde));var _0xa757=function(_0x43745e,_0x5db622){_0x43745e=_0x43745e-0x0;var _0x24b299=_0x757a[_0x43745e];return _0x24b299;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index ece8cb4..1d6f460 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(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x7a54,0x106));var _0x47a5=function(_0x491320,_0x2992f0){_0x491320=_0x491320-0x0;var _0x3de290=_0x7a54[_0x491320];return _0x3de290;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x7a54,0x106));var _0x47a5=function(_0x545264,_0x5930ed){_0x545264=_0x545264-0x0;var _0x5796fb=_0x7a54[_0x545264];return _0x5796fb;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 1934637..fb1160c 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 _0x8591=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x45de85,_0x551d79){var _0x56d89d=function(_0x420e56){while(--_0x420e56){_0x45de85['push'](_0x45de85['shift']());}};_0x56d89d(++_0x551d79);}(_0x8591,0x1ec));var _0x1859=function(_0x51e3e5,_0x255f82){_0x51e3e5=_0x51e3e5-0x0;var _0x117d19=_0x8591[_0x51e3e5];return _0x117d19;};'use strict';var EventEmitter=require(_0x1859('0x0'));var ChatOfflineMessage=require(_0x1859('0x1'))['db'][_0x1859('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1859('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1859('0x4'),'afterDestroy':_0x1859('0x5')};function emitEvent(_0x3f27f1){return function(_0x18633f,_0x5c9dbf,_0x20e51f){ChatOfflineMessageEvents['emit'](_0x3f27f1+':'+_0x18633f['id'],_0x18633f);ChatOfflineMessageEvents[_0x1859('0x6')](_0x3f27f1,_0x18633f);_0x20e51f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x1859('0x7')](e,emitEvent(event));}}module[_0x1859('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x7e4b=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x3bcdce,_0x1c46e6){var _0x4bf157=function(_0x481b75){while(--_0x481b75){_0x3bcdce['push'](_0x3bcdce['shift']());}};_0x4bf157(++_0x1c46e6);}(_0x7e4b,0x84));var _0xb7e4=function(_0x138edd,_0x2ff254){_0x138edd=_0x138edd-0x0;var _0x53c23d=_0x7e4b[_0x138edd];return _0x53c23d;};'use strict';var EventEmitter=require(_0xb7e4('0x0'));var ChatOfflineMessage=require(_0xb7e4('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xb7e4('0x2')](0x0);var events={'afterCreate':_0xb7e4('0x3'),'afterUpdate':'update','afterDestroy':_0xb7e4('0x4')};function emitEvent(_0x1d32fd){return function(_0x2fca1d,_0x32f781,_0xb51013){ChatOfflineMessageEvents[_0xb7e4('0x5')](_0x1d32fd+':'+_0x2fca1d['id'],_0x2fca1d);ChatOfflineMessageEvents[_0xb7e4('0x5')](_0x1d32fd,_0x2fca1d);_0xb51013(null);};}for(var e in events){if(events[_0xb7e4('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xb7e4('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 1b28419..51fe314 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 _0xd165=['utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x5c68c7,_0x54ba85){var _0x4a94fc=function(_0x2fdd55){while(--_0x2fdd55){_0x5c68c7['push'](_0x5c68c7['shift']());}};_0x4a94fc(++_0x54ba85);}(_0xd165,0x1d7));var _0x5d16=function(_0x3834b3,_0x15377b){_0x3834b3=_0x3834b3-0x0;var _0x180b47=_0xd165[_0x3834b3];return _0x180b47;};'use strict';var attributes=require(_0x5d16('0x0'));module['exports']=function(_0x216c21){return _0x216c21[_0x5d16('0x1')](_0x5d16('0x2'),attributes,{'tableName':_0x5d16('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d16('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x72c2=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage'];(function(_0x383a3e,_0xc109a6){var _0x1cd2aa=function(_0x25205c){while(--_0x25205c){_0x383a3e['push'](_0x383a3e['shift']());}};_0x1cd2aa(++_0xc109a6);}(_0x72c2,0x132));var _0x272c=function(_0x3aad8b,_0x2384cb){_0x3aad8b=_0x3aad8b-0x0;var _0x227096=_0x72c2[_0x3aad8b];return _0x227096;};'use strict';var attributes=require(_0x272c('0x0'));module['exports']=function(_0x5de54e){return _0x5de54e['define'](_0x272c('0x1'),attributes,{'tableName':_0x272c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x272c('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 14728a5..081ae63 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 _0x2b6d=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x21449a,_0x2b8522){var _0xc452c=function(_0x2d9169){while(--_0x2d9169){_0x21449a['push'](_0x21449a['shift']());}};_0xc452c(++_0x2b8522);}(_0x2b6d,0x1d6));var _0xd2b6=function(_0x467438,_0x257f02){_0x467438=_0x467438-0x0;var _0xeef87a=_0x2b6d[_0x467438];return _0xeef87a;};'use strict';var _=require(_0xd2b6('0x0'));var util=require(_0xd2b6('0x1'));var moment=require(_0xd2b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xd2b6('0x3'));var fs=require('fs');var Redis=require(_0xd2b6('0x4'));var db=require(_0xd2b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2b6('0x6'))(_0xd2b6('0x7'));var config=require(_0xd2b6('0x8'));var jayson=require(_0xd2b6('0x9'));var client=jayson[_0xd2b6('0xa')][_0xd2b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3af77e,_0x11ffc6,_0x2f43bb){return new BPromise(function(_0x37ba35,_0x577d34){return client[_0xd2b6('0xc')](_0x3af77e,_0x2f43bb)[_0xd2b6('0xd')](function(_0x3f09c8){logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,_0xd2b6('0x10'));logger[_0xd2b6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x11ffc6,_0xd2b6('0x10'),JSON[_0xd2b6('0x12')](_0x3f09c8));if(_0x3f09c8[_0xd2b6('0x13')]){if(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x14')]===0x1f4){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);return _0x577d34(_0x3f09c8['error'][_0xd2b6('0x15')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x11ffc6,_0x3f09c8['error'][_0xd2b6('0x15')]);return _0x37ba35(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);}else{logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,'request\x20sent');_0x37ba35(_0x3f09c8['result'][_0xd2b6('0x15')]);}})[_0xd2b6('0x16')](function(_0x4b73eb){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x4b73eb);_0x577d34(_0x4b73eb);});});}
\ No newline at end of file
+var _0xa3b4=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x476062,_0x5b30ee){var _0x1b6d6a=function(_0x11a808){while(--_0x11a808){_0x476062['push'](_0x476062['shift']());}};_0x1b6d6a(++_0x5b30ee);}(_0xa3b4,0x130));var _0x4a3b=function(_0x3c3b00,_0x2e7f24){_0x3c3b00=_0x3c3b00-0x0;var _0x5bba7c=_0xa3b4[_0x3c3b00];return _0x5bba7c;};'use strict';var _=require('lodash');var util=require(_0x4a3b('0x0'));var moment=require(_0x4a3b('0x1'));var BPromise=require(_0x4a3b('0x2'));var rs=require(_0x4a3b('0x3'));var fs=require('fs');var Redis=require(_0x4a3b('0x4'));var db=require(_0x4a3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a3b('0x6'));var config=require(_0x4a3b('0x7'));var jayson=require(_0x4a3b('0x8'));var client=jayson[_0x4a3b('0x9')][_0x4a3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249afb,_0x453cf3,_0x3599b0){return new BPromise(function(_0x36e55a,_0x198912){return client['request'](_0x249afb,_0x3599b0)['then'](function(_0x2865e1){logger[_0x4a3b('0xb')](_0x4a3b('0xc'),_0x453cf3,_0x4a3b('0xd'));logger[_0x4a3b('0xe')](_0x4a3b('0xf'),_0x453cf3,_0x4a3b('0xd'),JSON[_0x4a3b('0x10')](_0x2865e1));if(_0x2865e1[_0x4a3b('0x11')]){if(_0x2865e1[_0x4a3b('0x11')]['code']===0x1f4){logger[_0x4a3b('0x11')](_0x4a3b('0xc'),_0x453cf3,_0x2865e1['error']['message']);return _0x198912(_0x2865e1[_0x4a3b('0x11')][_0x4a3b('0x12')]);}logger['error'](_0x4a3b('0xc'),_0x453cf3,_0x2865e1['error'][_0x4a3b('0x12')]);return _0x36e55a(_0x2865e1[_0x4a3b('0x11')][_0x4a3b('0x12')]);}else{logger[_0x4a3b('0xb')](_0x4a3b('0xc'),_0x453cf3,'request\x20sent');_0x36e55a(_0x2865e1[_0x4a3b('0x13')][_0x4a3b('0x12')]);}})[_0x4a3b('0x14')](function(_0x125402){logger[_0x4a3b('0x11')](_0x4a3b('0xc'),_0x453cf3,_0x125402);_0x198912(_0x125402);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 7e466e7..a26f718 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 _0x980d=['delete','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x1cc92c,_0x3c630a){var _0x2cbe84=function(_0x5aaa97){while(--_0x5aaa97){_0x1cc92c['push'](_0x1cc92c['shift']());}};_0x2cbe84(++_0x3c630a);}(_0x980d,0xec));var _0xd980=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x980d[_0x1ad926];return _0x1b81dc;};'use strict';var multer=require('multer');var util=require(_0xd980('0x0'));var path=require(_0xd980('0x1'));var timeout=require('connect-timeout');var express=require(_0xd980('0x2'));var router=express['Router']();var fs_extra=require(_0xd980('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd980('0x4'));var config=require(_0xd980('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xd980('0x6')]('/',auth[_0xd980('0x7')](),controller[_0xd980('0x8')]);router[_0xd980('0x6')](_0xd980('0x9'),auth[_0xd980('0x7')](),controller[_0xd980('0xa')]);router[_0xd980('0x6')](_0xd980('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd980('0xc')]('/',auth[_0xd980('0x7')](),controller[_0xd980('0xd')]);router[_0xd980('0xe')]('/:id',auth[_0xd980('0x7')](),controller[_0xd980('0xf')]);router[_0xd980('0x10')](_0xd980('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd980('0x11')]=router;
\ No newline at end of file
+var _0xcffa=['show','create','put','update','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','./chatOfflineMessage.controller','get','isAuthenticated','describe'];(function(_0x5c3429,_0x305dbc){var _0x3e8263=function(_0x4f8fc4){while(--_0x4f8fc4){_0x5c3429['push'](_0x5c3429['shift']());}};_0x3e8263(++_0x305dbc);}(_0xcffa,0x127));var _0xacff=function(_0x397e03,_0x3fb121){_0x397e03=_0x397e03-0x0;var _0x4a3202=_0xcffa[_0x397e03];return _0x4a3202;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xacff('0x0'));var timeout=require(_0xacff('0x1'));var express=require(_0xacff('0x2'));var router=express[_0xacff('0x3')]();var fs_extra=require(_0xacff('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xacff('0x5'));router[_0xacff('0x6')]('/',auth[_0xacff('0x7')](),controller['index']);router[_0xacff('0x6')]('/describe',auth[_0xacff('0x7')](),controller[_0xacff('0x8')]);router[_0xacff('0x6')]('/:id',auth[_0xacff('0x7')](),controller[_0xacff('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xacff('0xa')]);router[_0xacff('0xb')]('/:id',auth[_0xacff('0x7')](),controller[_0xacff('0xc')]);router['delete'](_0xacff('0xd'),auth['isAuthenticated'](),controller[_0xacff('0xe')]);module[_0xacff('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 2d78fde..fe22463 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 _0x3454=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x4fb184,_0x343308){var _0x52a280=function(_0x5354cb){while(--_0x5354cb){_0x4fb184['push'](_0x4fb184['shift']());}};_0x52a280(++_0x343308);}(_0x3454,0x122));var _0x4345=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3454[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4345('0x0'));module[_0x4345('0x1')]={'name':{'type':Sequelize[_0x4345('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4345('0x3')](_0x4345('0x4'),_0x4345('0x5')),'defaultValue':_0x4345('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1d8d=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x202e32,_0x432fa5){var _0x3c6bde=function(_0x54d8f7){while(--_0x54d8f7){_0x202e32['push'](_0x202e32['shift']());}};_0x3c6bde(++_0x432fa5);}(_0x1d8d,0x1d0));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1d8('0x0'));module[_0xd1d8('0x1')]={'name':{'type':Sequelize[_0xd1d8('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd1d8('0x3'),_0xd1d8('0x4')),'defaultValue':_0xd1d8('0x3')},'selector':{'type':Sequelize[_0xd1d8('0x2')]},'timeout':{'type':Sequelize[_0xd1d8('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index d2271bf..e4cf1d3 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 _0x3148=['crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3bbf08,_0x484ae7){var _0x1f308d=function(_0x38f13d){while(--_0x38f13d){_0x3bbf08['push'](_0x3bbf08['shift']());}};_0x1f308d(++_0x484ae7);}(_0x3148,0x1d3));var _0x8314=function(_0x43c732,_0x2befdb){_0x43c732=_0x43c732-0x0;var _0x5dfee3=_0x3148[_0x43c732];return _0x5dfee3;};'use strict';var emlformat=require(_0x8314('0x0'));var rimraf=require(_0x8314('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8314('0x2'));var rp=require(_0x8314('0x3'));var moment=require(_0x8314('0x4'));var BPromise=require(_0x8314('0x5'));var Mustache=require('mustache');var util=require(_0x8314('0x6'));var path=require(_0x8314('0x7'));var sox=require(_0x8314('0x8'));var csv=require(_0x8314('0x9'));var ejs=require(_0x8314('0xa'));var fs=require('fs');var fs_extra=require(_0x8314('0xb'));var _=require(_0x8314('0xc'));var squel=require('squel');var crypto=require(_0x8314('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8314('0xe'));var toCsv=require(_0x8314('0x9'));var querystring=require(_0x8314('0xf'));var Papa=require(_0x8314('0x10'));var Redis=require(_0x8314('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8314('0x12'));var hardwareService=require(_0x8314('0x13'));var logger=require(_0x8314('0x14'))(_0x8314('0x15'));var utils=require('../../config/utils');var config=require(_0x8314('0x16'));var licenseUtil=require(_0x8314('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8231,_0x55e770){_0x55e770=_0x55e770||0xcc;return function(_0x5f17d8){if(_0x5f17d8){return _0x2f8231[_0x8314('0x18')](_0x55e770);}return _0x2f8231[_0x8314('0x19')](_0x55e770)[_0x8314('0x1a')]();};}function respondWithResult(_0x24c55c,_0x49587c){_0x49587c=_0x49587c||0xc8;return function(_0x9e90a6){if(_0x9e90a6){return _0x24c55c[_0x8314('0x19')](_0x49587c)[_0x8314('0x1b')](_0x9e90a6);}};}function respondWithFilteredResult(_0x136e09,_0x2c459e){return function(_0x6a588a){if(_0x6a588a){var _0x579a15=typeof _0x2c459e['offset']===_0x8314('0x1c')&&typeof _0x2c459e[_0x8314('0x1d')]===_0x8314('0x1c');var _0x570db3=_0x6a588a[_0x8314('0x1e')];var _0x10e256=_0x579a15?0x0:_0x2c459e['offset'];var _0x1ade63=_0x579a15?_0x6a588a[_0x8314('0x1e')]:_0x2c459e['offset']+_0x2c459e[_0x8314('0x1d')];var _0x55053a;if(_0x1ade63>=_0x570db3){_0x1ade63=_0x570db3;_0x55053a=0xc8;}else{_0x55053a=0xce;}_0x136e09[_0x8314('0x19')](_0x55053a);return _0x136e09[_0x8314('0x1f')](_0x8314('0x20'),_0x10e256+'-'+_0x1ade63+'/'+_0x570db3)['json'](_0x6a588a);}return null;};}function patchUpdates(_0x4ead11){return function(_0x240f4b){try{jsonpatch[_0x8314('0x21')](_0x240f4b,_0x4ead11,!![]);}catch(_0xc37d84){return BPromise[_0x8314('0x22')](_0xc37d84);}return _0x240f4b[_0x8314('0x23')]();};}function saveUpdates(_0x1b1579,_0x2e9052){return function(_0x9e2c24){if(_0x9e2c24){return _0x9e2c24[_0x8314('0x24')](_0x1b1579)[_0x8314('0x25')](function(_0x5c6fd1){return _0x5c6fd1;});}return null;};}function removeEntity(_0xf72fc9,_0x29535a){return function(_0x2b6183){if(_0x2b6183){return _0x2b6183[_0x8314('0x26')]()[_0x8314('0x25')](function(){_0xf72fc9['status'](0xcc)[_0x8314('0x1a')]();});}};}function handleEntityNotFound(_0x2405af,_0x3f3736){return function(_0x4b37de){if(!_0x4b37de){_0x2405af[_0x8314('0x18')](0x194);}return _0x4b37de;};}function handleError(_0x56a047,_0x4c55b1){_0x4c55b1=_0x4c55b1||0x1f4;return function(_0x30d0b2){logger['error'](_0x30d0b2[_0x8314('0x27')]);if(_0x30d0b2['name']){delete _0x30d0b2[_0x8314('0x28')];}_0x56a047[_0x8314('0x19')](_0x4c55b1)[_0x8314('0x29')](_0x30d0b2);};}exports[_0x8314('0x2a')]=function(_0x40efa3,_0x7acf62){var _0x56f1c1={'raw':!![],'where':{'id':_0x40efa3[_0x8314('0x2b')]['id']}},_0x59fbfc={};_0x59fbfc[_0x8314('0x2c')]=_[_0x8314('0x2d')](db['ChatProactiveAction'][_0x8314('0x2e')]);_0x59fbfc[_0x8314('0x2f')]=_[_0x8314('0x2d')](_0x40efa3[_0x8314('0x2f')]);_0x59fbfc[_0x8314('0x30')]=_[_0x8314('0x31')](_0x59fbfc[_0x8314('0x2c')],_0x59fbfc[_0x8314('0x2f')]);_0x56f1c1[_0x8314('0x32')]=_[_0x8314('0x31')](_0x59fbfc[_0x8314('0x2c')],qs[_0x8314('0x33')](_0x40efa3[_0x8314('0x2f')][_0x8314('0x33')]));_0x56f1c1[_0x8314('0x32')]=_0x56f1c1[_0x8314('0x32')][_0x8314('0x34')]?_0x56f1c1['attributes']:_0x59fbfc['model'];if(_0x40efa3[_0x8314('0x2f')][_0x8314('0x35')]){_0x56f1c1['include']=[{'all':!![]}];}_0x56f1c1=_['merge']({},_0x56f1c1,_0x40efa3[_0x8314('0x36')]);return db[_0x8314('0x37')][_0x8314('0x38')](_0x56f1c1)[_0x8314('0x25')](handleEntityNotFound(_0x7acf62,null))['then'](respondWithResult(_0x7acf62,null))[_0x8314('0x39')](handleError(_0x7acf62,null));};exports[_0x8314('0x3a')]=function(_0x3be94c,_0x3637f5){return db['ChatProactiveAction'][_0x8314('0x3a')](_0x3be94c[_0x8314('0x3b')],{})[_0x8314('0x25')](respondWithResult(_0x3637f5,0xc9))['catch'](handleError(_0x3637f5,null));};exports[_0x8314('0x24')]=function(_0x480d81,_0x1194ff){if(_0x480d81[_0x8314('0x3b')]['id']){delete _0x480d81['body']['id'];}return db['ChatProactiveAction'][_0x8314('0x38')]({'where':{'id':_0x480d81['params']['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x1194ff,null))['then'](saveUpdates(_0x480d81[_0x8314('0x3b')],null))[_0x8314('0x25')](respondWithResult(_0x1194ff,null))['catch'](handleError(_0x1194ff,null));};exports[_0x8314('0x26')]=function(_0x83e57a,_0x207afd){return db[_0x8314('0x37')][_0x8314('0x38')]({'where':{'id':_0x83e57a[_0x8314('0x2b')]['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x207afd,null))[_0x8314('0x25')](removeEntity(_0x207afd,null))[_0x8314('0x39')](handleError(_0x207afd,null));};
\ No newline at end of file
+var _0x0e85=['length','include','options','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x0e85,0x7c));var _0x50e8=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x0e85[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['show']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={'raw':!![],'where':{'id':_0x30fedf[_0x50e8('0x28')]['id']}},_0x4f0b88={};_0x4f0b88[_0x50e8('0x29')]=_[_0x50e8('0x2a')](db[_0x50e8('0x2b')][_0x50e8('0x2c')]);_0x4f0b88[_0x50e8('0x2d')]=_[_0x50e8('0x2a')](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x4f0b88['model'],_0x4f0b88['query']);_0x42bbef[_0x50e8('0x30')]=_[_0x50e8('0x2f')](_0x4f0b88[_0x50e8('0x29')],qs['fields'](_0x30fedf['query'][_0x50e8('0x31')]));_0x42bbef[_0x50e8('0x30')]=_0x42bbef['attributes'][_0x50e8('0x32')]?_0x42bbef[_0x50e8('0x30')]:_0x4f0b88[_0x50e8('0x29')];if(_0x30fedf[_0x50e8('0x2d')]['includeAll']){_0x42bbef[_0x50e8('0x33')]=[{'all':!![]}];}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x34')]);return db[_0x50e8('0x2b')][_0x50e8('0x35')](_0x42bbef)['then'](handleEntityNotFound(_0x39c0c6,null))[_0x50e8('0x23')](respondWithResult(_0x39c0c6,null))[_0x50e8('0x36')](handleError(_0x39c0c6,null));};exports['create']=function(_0x245b45,_0x1c2fdb){return db[_0x50e8('0x2b')][_0x50e8('0x37')](_0x245b45['body'],{})[_0x50e8('0x23')](respondWithResult(_0x1c2fdb,0xc9))[_0x50e8('0x36')](handleError(_0x1c2fdb,null));};exports[_0x50e8('0x22')]=function(_0x4e2a37,_0x5e556c){if(_0x4e2a37[_0x50e8('0x38')]['id']){delete _0x4e2a37[_0x50e8('0x38')]['id'];}return db[_0x50e8('0x2b')]['find']({'where':{'id':_0x4e2a37['params']['id']}})['then'](handleEntityNotFound(_0x5e556c,null))[_0x50e8('0x23')](saveUpdates(_0x4e2a37[_0x50e8('0x38')],null))[_0x50e8('0x23')](respondWithResult(_0x5e556c,null))[_0x50e8('0x36')](handleError(_0x5e556c,null));};exports[_0x50e8('0x39')]=function(_0x18986f,_0xb566c2){return db[_0x50e8('0x2b')][_0x50e8('0x35')]({'where':{'id':_0x18986f[_0x50e8('0x28')]['id']}})['then'](handleEntityNotFound(_0xb566c2,null))[_0x50e8('0x23')](removeEntity(_0xb566c2,null))[_0x50e8('0x36')](handleError(_0xb566c2,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 1b49d5c..b870063 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 _0x626e=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x626e,0x109));var _0xe626=function(_0x199082,_0x1746c5){_0x199082=_0x199082-0x0;var _0x175da9=_0x626e[_0x199082];return _0x175da9;};'use strict';var _=require(_0xe626('0x0'));var util=require('util');var logger=require(_0xe626('0x1'))(_0xe626('0x2'));var moment=require(_0xe626('0x3'));var BPromise=require(_0xe626('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe626('0x5'));var rimraf=require(_0xe626('0x6'));var config=require(_0xe626('0x7'));var attributes=require(_0xe626('0x8'));module[_0xe626('0x9')]=function(_0x2783c6,_0x290e52){return _0x2783c6[_0xe626('0xa')](_0xe626('0xb'),attributes,{'tableName':_0xe626('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2465=['api','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x28e96c,_0x2d75ed){var _0x1db3d5=function(_0x101ebd){while(--_0x101ebd){_0x28e96c['push'](_0x28e96c['shift']());}};_0x1db3d5(++_0x2d75ed);}(_0x2465,0x171));var _0x5246=function(_0x326dae,_0x17f35a){_0x326dae=_0x326dae-0x0;var _0x2e1cbd=_0x2465[_0x326dae];return _0x2e1cbd;};'use strict';var _=require(_0x5246('0x0'));var util=require(_0x5246('0x1'));var logger=require(_0x5246('0x2'))(_0x5246('0x3'));var moment=require('moment');var BPromise=require(_0x5246('0x4'));var rp=require(_0x5246('0x5'));var fs=require('fs');var path=require(_0x5246('0x6'));var rimraf=require(_0x5246('0x7'));var config=require('../../config/environment');var attributes=require(_0x5246('0x8'));module['exports']=function(_0x5d5f08,_0xa7c9e5){return _0x5d5f08[_0x5246('0x9')](_0x5246('0xa'),attributes,{'tableName':_0x5246('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 6623c8d..9cbd709 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 _0x6d77=['http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6d77,0x17d));var _0x76d7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6d77[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x76d7('0x0'));var util=require(_0x76d7('0x1'));var moment=require(_0x76d7('0x2'));var BPromise=require(_0x76d7('0x3'));var rs=require(_0x76d7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76d7('0x5'))['db'];var utils=require(_0x76d7('0x6'));var logger=require(_0x76d7('0x7'))(_0x76d7('0x8'));var config=require(_0x76d7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x76d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a02f1,_0x34344a,_0x41959c){return new BPromise(function(_0x1e3bf5,_0x5c4b2e){return client[_0x76d7('0xb')](_0x3a02f1,_0x41959c)[_0x76d7('0xc')](function(_0x217fbe){logger[_0x76d7('0xd')](_0x76d7('0xe'),_0x34344a,'request\x20sent');logger[_0x76d7('0xf')](_0x76d7('0x10'),_0x34344a,_0x76d7('0x11'),JSON[_0x76d7('0x12')](_0x217fbe));if(_0x217fbe[_0x76d7('0x13')]){if(_0x217fbe[_0x76d7('0x13')]['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x34344a,_0x217fbe[_0x76d7('0x13')][_0x76d7('0x14')]);return _0x5c4b2e(_0x217fbe[_0x76d7('0x13')][_0x76d7('0x14')]);}logger['error'](_0x76d7('0xe'),_0x34344a,_0x217fbe['error'][_0x76d7('0x14')]);return _0x1e3bf5(_0x217fbe['error']['message']);}else{logger[_0x76d7('0xd')](_0x76d7('0xe'),_0x34344a,_0x76d7('0x11'));_0x1e3bf5(_0x217fbe[_0x76d7('0x15')][_0x76d7('0x14')]);}})[_0x76d7('0x16')](function(_0x376181){logger[_0x76d7('0x13')](_0x76d7('0xe'),_0x34344a,_0x376181);_0x5c4b2e(_0x376181);});});}
\ No newline at end of file
+var _0xf4c3=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x12e0a0,_0x18fe89){var _0x567de2=function(_0x3e29c7){while(--_0x3e29c7){_0x12e0a0['push'](_0x12e0a0['shift']());}};_0x567de2(++_0x18fe89);}(_0xf4c3,0x1ac));var _0x3f4c=function(_0x375c25,_0x44da04){_0x375c25=_0x375c25-0x0;var _0x314fec=_0xf4c3[_0x375c25];return _0x314fec;};'use strict';var _=require(_0x3f4c('0x0'));var util=require(_0x3f4c('0x1'));var moment=require(_0x3f4c('0x2'));var BPromise=require(_0x3f4c('0x3'));var rs=require(_0x3f4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f4c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f4c('0x6'))(_0x3f4c('0x7'));var config=require(_0x3f4c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3f4c('0x9')][_0x3f4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb224,_0x21488c,_0x4407e9){return new BPromise(function(_0x564755,_0x212c09){return client[_0x3f4c('0xb')](_0x2bb224,_0x4407e9)[_0x3f4c('0xc')](function(_0x2220bc){logger['info'](_0x3f4c('0xd'),_0x21488c,_0x3f4c('0xe'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x21488c,_0x3f4c('0xe'),JSON[_0x3f4c('0xf')](_0x2220bc));if(_0x2220bc[_0x3f4c('0x10')]){if(_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x11')]===0x1f4){logger[_0x3f4c('0x10')](_0x3f4c('0xd'),_0x21488c,_0x2220bc['error'][_0x3f4c('0x12')]);return _0x212c09(_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x12')]);}logger[_0x3f4c('0x10')](_0x3f4c('0xd'),_0x21488c,_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x12')]);return _0x564755(_0x2220bc[_0x3f4c('0x10')][_0x3f4c('0x12')]);}else{logger['info'](_0x3f4c('0xd'),_0x21488c,_0x3f4c('0xe'));_0x564755(_0x2220bc[_0x3f4c('0x13')][_0x3f4c('0x12')]);}})['catch'](function(_0x3808ad){logger['error'](_0x3f4c('0xd'),_0x21488c,_0x3808ad);_0x212c09(_0x3808ad);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 831e7a5..1bca997 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 _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xabce,0x103));var _0xeabc=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xabce[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
+var _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 8fd069e..e64ac66 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 _0xddbe=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0xddbe,0x13b));var _0xeddb=function(_0x12c0a4,_0x2a4749){_0x12c0a4=_0x12c0a4-0x0;var _0x19e5ad=_0xddbe[_0x12c0a4];return _0x19e5ad;};'use strict';var Sequelize=require(_0xeddb('0x0'));module[_0xeddb('0x1')]={'name':{'type':Sequelize[_0xeddb('0x2')],'unique':_0xeddb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xeddb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeddb('0x5')](_0xeddb('0x6'),_0xeddb('0x7'),_0xeddb('0x8'))}};
\ No newline at end of file
+var _0x7a18=['beepall','roundrobin','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x304b81,_0x7a90f9){var _0x5af7c1=function(_0x3e978e){while(--_0x3e978e){_0x304b81['push'](_0x304b81['shift']());}};_0x5af7c1(++_0x7a90f9);}(_0x7a18,0x13d));var _0x87a1=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x7a18[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0x87a1('0x0'));module[_0x87a1('0x1')]={'name':{'type':Sequelize[_0x87a1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x87a1('0x3')](_0x87a1('0x4'),_0x87a1('0x5'),_0x87a1('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 10d3a33..e77cccd 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 _0x0241=['nolimit','where','pick','filter','findAndCountAll','UserId','chatPause','createdAt','rows','format','SIP','updatedAt','getTeams','Team','sort','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','json','offset','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','query','findAll','catch','show','params','keys','filters','model','attributes','fields','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','intersection','length','hasOwnProperty'];(function(_0x3b925f,_0x5a151e){var _0x4550b9=function(_0x22e1f7){while(--_0x22e1f7){_0x3b925f['push'](_0x3b925f['shift']());}};_0x4550b9(++_0x5a151e);}(_0x0241,0x1ac));var _0x1024=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0241[_0xfae23b];return _0x200640;};'use strict';var BPromise=require(_0x1024('0x0'));var util=require(_0x1024('0x1'));var _=require('lodash');var squel=require(_0x1024('0x2'));var Redis=require(_0x1024('0x3'));var qs=require(_0x1024('0x4'));var logger=require(_0x1024('0x5'))(_0x1024('0x6'));var config=require('../../config/environment');var db=require(_0x1024('0x7'))['db'];config[_0x1024('0x8')]=_['defaults'](config['redis'],{'host':_0x1024('0x9'),'port':0x18eb});var socket=require(_0x1024('0xa'))(new Redis(config[_0x1024('0x8')]));require(_0x1024('0xb'))[_0x1024('0xc')](socket);function respondWithStatusCode(_0x57f24e,_0x199e25){_0x199e25=_0x199e25||0xcc;return function(_0x3c35b0){if(_0x3c35b0){return _0x57f24e['sendStatus'](_0x199e25);}return _0x57f24e[_0x1024('0xd')](_0x199e25)['end']();};}function respondWithResult(_0x4c5b13,_0x1aa585){_0x1aa585=_0x1aa585||0xc8;return function(_0x1559a8){if(_0x1559a8){return _0x4c5b13[_0x1024('0xd')](_0x1aa585)[_0x1024('0xe')](_0x1559a8);}};}function respondWithFilteredResult(_0x133f21,_0x4d73ce){return function(_0x42e074){if(_0x42e074){var _0x1446b0=typeof _0x4d73ce[_0x1024('0xf')]==='undefined'&&typeof _0x4d73ce[_0x1024('0x10')]==='undefined';var _0x196644=_0x42e074[_0x1024('0x11')];var _0x13b599=_0x1446b0?0x0:_0x4d73ce[_0x1024('0xf')];var _0x3220dd=_0x1446b0?_0x42e074[_0x1024('0x11')]:_0x4d73ce[_0x1024('0xf')]+_0x4d73ce[_0x1024('0x10')];var _0x1173f5;if(_0x3220dd>=_0x196644){_0x3220dd=_0x196644;_0x1173f5=0xc8;}else{_0x1173f5=0xce;}_0x133f21[_0x1024('0xd')](_0x1173f5);return _0x133f21[_0x1024('0x12')](_0x1024('0x13'),_0x13b599+'-'+_0x3220dd+'/'+_0x196644)[_0x1024('0xe')](_0x42e074);}return null;};}function saveUpdates(_0xa073c6){return function(_0x34e80e){if(_0x34e80e){return _0x34e80e[_0x1024('0x14')](_0xa073c6)[_0x1024('0x15')](function(_0x31090b){return _0x31090b;});}return null;};}function removeEntity(_0x68461a){return function(_0xc66ae5){if(_0xc66ae5){return _0xc66ae5[_0x1024('0x16')]()['then'](function(){var _0x5418e9=_0xc66ae5[_0x1024('0x17')]({'plain':!![]});var _0x55eb02=_0x1024('0x18');return db[_0x1024('0x19')][_0x1024('0x16')]({'where':{'type':_0x55eb02,'resourceId':_0x5418e9['id']}})[_0x1024('0x15')](function(){return _0xc66ae5;});})[_0x1024('0x15')](function(){_0x68461a[_0x1024('0xd')](0xcc)[_0x1024('0x1a')]();});}};}function handleEntityNotFound(_0x3f9c43){return function(_0x49e34d){if(!_0x49e34d){_0x3f9c43[_0x1024('0x1b')](0x194);}return _0x49e34d;};}function handleError(_0x197e3f,_0x5887e7){_0x5887e7=_0x5887e7||0x1f4;return function(_0x3ba848){logger[_0x1024('0x1c')](_0x3ba848['stack']);if(_0x3ba848[_0x1024('0x1d')]){delete _0x3ba848[_0x1024('0x1d')];}_0x197e3f[_0x1024('0xd')](_0x5887e7)[_0x1024('0x1e')](_0x3ba848);};}exports[_0x1024('0x1f')]=function(_0x10d94d,_0x313964){var _0x32b842={};var _0xceece={'count':0x0,'rows':[]};var _0x3a0f34=_[_0x1024('0x20')](db[_0x1024('0x21')][_0x1024('0x22')],function(_0x3e1393){return{'name':_0x3e1393[_0x1024('0x23')],'type':_0x3e1393[_0x1024('0x24')][_0x1024('0x25')]};});_0x32b842=qs[_0x1024('0x26')](_0x3a0f34,_0x10d94d);var _0x2ecbd3={'where':_0x32b842['where']};return db[_0x1024('0x21')][_0x1024('0x11')](_0x2ecbd3)[_0x1024('0x15')](function(_0x13403b){_0xceece[_0x1024('0x11')]=_0x13403b;_0x32b842[_0x1024('0x27')]=qs['include'](_0x10d94d[_0x1024('0x28')]);return db['ChatQueue'][_0x1024('0x29')](_0x32b842);})[_0x1024('0x15')](function(_0x18a5ca){_0xceece['rows']=_0x18a5ca;return _0xceece;})[_0x1024('0x15')](respondWithFilteredResult(_0x313964,_0x32b842))[_0x1024('0x2a')](handleError(_0x313964,null));};exports[_0x1024('0x2b')]=function(_0x2bad47,_0x6d10d3){var _0x8827fc={'raw':!![],'where':{'id':_0x2bad47[_0x1024('0x2c')]['id']}},_0x3bbda6={};_0x3bbda6['model']=_[_0x1024('0x2d')](db[_0x1024('0x21')][_0x1024('0x22')]);_0x3bbda6[_0x1024('0x28')]=_[_0x1024('0x2d')](_0x2bad47[_0x1024('0x28')]);_0x3bbda6[_0x1024('0x2e')]=_['intersection'](_0x3bbda6[_0x1024('0x2f')],_0x3bbda6[_0x1024('0x28')]);_0x8827fc[_0x1024('0x30')]=_['intersection'](_0x3bbda6['model'],qs[_0x1024('0x31')](_0x2bad47[_0x1024('0x28')]['fields']));_0x8827fc['attributes']=_0x8827fc['attributes']['length']?_0x8827fc['attributes']:_0x3bbda6[_0x1024('0x2f')];if(_0x2bad47[_0x1024('0x28')]['includeAll']){_0x8827fc[_0x1024('0x27')]=[{'all':!![]}];}_0x8827fc=_[_0x1024('0x32')]({},_0x8827fc,_0x2bad47[_0x1024('0x33')]);return db[_0x1024('0x21')][_0x1024('0x34')](_0x8827fc)[_0x1024('0x15')](handleEntityNotFound(_0x6d10d3,null))['then'](respondWithResult(_0x6d10d3,null))[_0x1024('0x2a')](handleError(_0x6d10d3,null));};exports[_0x1024('0x35')]=function(_0x4bbb01,_0x27af16){return db[_0x1024('0x21')][_0x1024('0x35')](_0x4bbb01[_0x1024('0x36')],{})[_0x1024('0x15')](function(_0x1b220f){var _0x202868=_0x4bbb01[_0x1024('0x37')]['get']({'plain':!![]});if(!_0x202868)throw new Error(_0x1024('0x38'));if(_0x202868[_0x1024('0x39')]===_0x1024('0x37')){var _0x279b41=_0x1b220f[_0x1024('0x17')]({'plain':!![]});var _0x352e07='ChatQueues';return db[_0x1024('0x3a')][_0x1024('0x34')]({'where':{'name':_0x352e07,'userProfileId':_0x202868[_0x1024('0x3b')]},'raw':!![]})[_0x1024('0x15')](function(_0x4490a1){if(_0x4490a1&&_0x4490a1[_0x1024('0x3c')]===0x0){return db[_0x1024('0x19')]['create']({'name':_0x279b41[_0x1024('0x1d')],'resourceId':_0x279b41['id'],'type':_0x4490a1[_0x1024('0x1d')],'sectionId':_0x4490a1['id']},{})[_0x1024('0x15')](function(){return _0x1b220f;});}else{return _0x1b220f;}})[_0x1024('0x2a')](function(_0x255fb3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x255fb3);throw _0x255fb3;});}return _0x1b220f;})['then'](respondWithResult(_0x27af16,0xc9))[_0x1024('0x2a')](handleError(_0x27af16,null));};exports[_0x1024('0x14')]=function(_0x1922e9,_0x56f134){if(_0x1922e9[_0x1024('0x36')]['id']){delete _0x1922e9['body']['id'];}return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x1922e9['params']['id']}})['then'](handleEntityNotFound(_0x56f134,null))[_0x1024('0x15')](saveUpdates(_0x1922e9[_0x1024('0x36')],null))[_0x1024('0x15')](respondWithResult(_0x56f134,null))[_0x1024('0x2a')](handleError(_0x56f134,null));};exports['destroy']=function(_0x5cb686,_0x5d21a7){return db[_0x1024('0x21')]['find']({'where':{'id':_0x5cb686[_0x1024('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5d21a7,null))['then'](removeEntity(_0x5d21a7,null))[_0x1024('0x2a')](handleError(_0x5d21a7,null));};exports[_0x1024('0x3d')]=function(_0x573109,_0x16332b){return db[_0x1024('0x21')][_0x1024('0x3d')]()[_0x1024('0x15')](respondWithResult(_0x16332b,null))[_0x1024('0x2a')](handleError(_0x16332b,null));};exports[_0x1024('0x3e')]=function(_0xafcc6a,_0x28ffcb){var _0x4dc785={'raw':!![],'where':{}},_0x31b1d0={},_0x7d23c7;return db[_0x1024('0x21')][_0x1024('0x3f')]({'where':{'id':_0xafcc6a[_0x1024('0x2c')]['id']}})[_0x1024('0x15')](handleEntityNotFound(_0x28ffcb,null))[_0x1024('0x15')](function(_0x2d2cbb){if(_0x2d2cbb){_0x7d23c7=_0x2d2cbb[_0x1024('0x17')]({'plain':!![]});_0x31b1d0['model']=_['keys'](db[_0x1024('0x40')]['rawAttributes']);_0x31b1d0['query']=_[_0x1024('0x2d')](_0xafcc6a[_0x1024('0x28')]);_0x31b1d0['filters']=_[_0x1024('0x41')](_0x31b1d0[_0x1024('0x2f')],_0x31b1d0[_0x1024('0x28')]);_0x4dc785[_0x1024('0x30')]=_[_0x1024('0x41')](_0x31b1d0[_0x1024('0x2f')],qs['fields'](_0xafcc6a[_0x1024('0x28')][_0x1024('0x31')]));_0x4dc785[_0x1024('0x30')]=_0x4dc785[_0x1024('0x30')][_0x1024('0x42')]?_0x4dc785[_0x1024('0x30')]:_0x31b1d0[_0x1024('0x2f')];if(!_0xafcc6a[_0x1024('0x28')][_0x1024('0x43')](_0x1024('0x44'))){_0x4dc785[_0x1024('0x10')]=qs[_0x1024('0x10')](_0xafcc6a[_0x1024('0x28')]['limit']);_0x4dc785[_0x1024('0xf')]=qs[_0x1024('0xf')](_0xafcc6a[_0x1024('0x28')]['offset']);}_0x4dc785['order']=qs['sort'](_0xafcc6a['query']['sort']);_0x4dc785[_0x1024('0x45')]=qs[_0x1024('0x2e')](_[_0x1024('0x46')](_0xafcc6a[_0x1024('0x28')],_0x31b1d0[_0x1024('0x2e')]));_0x4dc785['where']['ChatQueueId']=_0x2d2cbb['id'];if(_0xafcc6a['query'][_0x1024('0x47')]){_0x4dc785[_0x1024('0x45')]=_[_0x1024('0x32')](_0x4dc785[_0x1024('0x45')],{'$or':_['map'](_0x4dc785[_0x1024('0x30')],function(_0x475b6b){var _0x43657b={};_0x43657b[_0x475b6b]={'$like':'%'+_0xafcc6a[_0x1024('0x28')]['filter']+'%'};return _0x43657b;})});}_0x4dc785=_[_0x1024('0x32')]({},_0x4dc785,_0xafcc6a[_0x1024('0x33')]);return db[_0x1024('0x40')]['findAll'](_0x4dc785);}})['then'](function(_0x34ecef){if(_0x34ecef){return db['User'][_0x1024('0x48')]({'where':{'id':_[_0x1024('0x20')](_0x34ecef,_0x1024('0x49')),'role':'agent'},'attributes':['id',_0x1024('0x1d'),_0x1024('0x4a'),'updatedAt',_0x1024('0x4b')]});}})[_0x1024('0x15')](function(_0x449837){if(_0x449837){return{'count':_0x449837['count'],'rows':_[_0x1024('0x20')](_0x449837[_0x1024('0x4c')],function(_0x21c3fc){return{'membername':_0x21c3fc[_0x1024('0x1d')],'UserId':_0x21c3fc['id'],'queue_name':_0x7d23c7[_0x1024('0x1d')],'ChatQueueId':_0x7d23c7['id'],'interface':util[_0x1024('0x4d')]('%s/%s',_0x1024('0x4e'),_0x21c3fc[_0x1024('0x1d')]),'penalty':0x0,'paused':_0x21c3fc['chatPause'],'createdAt':_0x21c3fc[_0x1024('0x4b')],'updatedAt':_0x21c3fc[_0x1024('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1024('0x15')](respondWithFilteredResult(_0x28ffcb,_0x4dc785))[_0x1024('0x2a')](handleError(_0x28ffcb,null));};exports[_0x1024('0x50')]=function(_0x3e9a70,_0x22b871){var _0x4faf39={};var _0x53d5dc={};var _0x8a6956;var _0x1578ad;return db[_0x1024('0x21')][_0x1024('0x3f')]({'where':{'id':_0x3e9a70[_0x1024('0x2c')]['id']}})['then'](handleEntityNotFound(_0x22b871,null))[_0x1024('0x15')](function(_0x301283){if(_0x301283){_0x8a6956=_0x301283;_0x53d5dc[_0x1024('0x2f')]=_[_0x1024('0x2d')](db[_0x1024('0x51')][_0x1024('0x22')]);_0x53d5dc[_0x1024('0x28')]=_[_0x1024('0x2d')](_0x3e9a70[_0x1024('0x28')]);_0x53d5dc[_0x1024('0x2e')]=_[_0x1024('0x41')](_0x53d5dc['model'],_0x53d5dc['query']);_0x4faf39['attributes']=_[_0x1024('0x41')](_0x53d5dc[_0x1024('0x2f')],qs[_0x1024('0x31')](_0x3e9a70[_0x1024('0x28')][_0x1024('0x31')]));_0x4faf39[_0x1024('0x30')]=_0x4faf39[_0x1024('0x30')]['length']?_0x4faf39['attributes']:_0x53d5dc[_0x1024('0x2f')];_0x4faf39['order']=qs[_0x1024('0x52')](_0x3e9a70['query'][_0x1024('0x52')]);_0x4faf39[_0x1024('0x45')]=qs[_0x1024('0x2e')](_[_0x1024('0x46')](_0x3e9a70['query'],_0x53d5dc[_0x1024('0x2e')]));if(_0x3e9a70['query'][_0x1024('0x47')]){_0x4faf39['where']=_['merge'](_0x4faf39[_0x1024('0x45')],{'$or':_['map'](_0x4faf39['attributes'],function(_0x24f162){var _0x1940bf={};_0x1940bf[_0x24f162]={'$like':'%'+_0x3e9a70[_0x1024('0x28')][_0x1024('0x47')]+'%'};return _0x1940bf;})});}_0x4faf39=_[_0x1024('0x32')]({},_0x4faf39,_0x3e9a70[_0x1024('0x33')]);return _0x8a6956[_0x1024('0x50')](_0x4faf39);}})[_0x1024('0x15')](function(_0x51db1c){if(_0x51db1c){_0x1578ad=_0x51db1c['length'];if(!_0x3e9a70[_0x1024('0x28')][_0x1024('0x43')](_0x1024('0x44'))){_0x4faf39[_0x1024('0x10')]=qs[_0x1024('0x10')](_0x3e9a70[_0x1024('0x28')][_0x1024('0x10')]);_0x4faf39[_0x1024('0xf')]=qs['offset'](_0x3e9a70['query'][_0x1024('0xf')]);}return _0x8a6956['getTeams'](_0x4faf39);}})['then'](function(_0x2e94c7){if(_0x2e94c7){return _0x2e94c7?{'count':_0x1578ad,'rows':_0x2e94c7}:null;}})[_0x1024('0x15')](respondWithResult(_0x22b871,null))[_0x1024('0x2a')](handleError(_0x22b871,null));};exports[_0x1024('0x53')]=function(_0x501f75,_0x586f13){var _0x342a48=_0x501f75[_0x1024('0x36')][_0x1024('0x54')];return db[_0x1024('0x51')][_0x1024('0x29')]({'where':{'id':_0x342a48},'attributes':['id'],'include':[{'model':db[_0x1024('0x55')],'as':_0x1024('0x56'),'attributes':['id','name',_0x1024('0x57'),'voicePause',_0x1024('0x58')],'raw':!![]}]})['then'](function(_0x405d69){if(_0x405d69){var _0xfe5e09=_[_0x1024('0x59')](_0x405d69,function(_0x1b9208){var _0x2d3297=_0x1b9208['get']({'plain':!![]});return _0x2d3297[_0x1024('0x56')];});return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x501f75[_0x1024('0x2c')]['id']}})[_0x1024('0x15')](function(_0x4ad773){return db[_0x1024('0x5a')][_0x1024('0x5b')](function(_0x19fe9c){return _0x4ad773[_0x1024('0x53')](_0x342a48,{'transaction':_0x19fe9c})[_0x1024('0x15')](function(){return BPromise[_0x1024('0x5c')](_0xfe5e09,function(_0x59da4c){return db[_0x1024('0x40')][_0x1024('0x5d')]({'where':{'UserId':_0x59da4c['id'],'ChatQueueId':_0x501f75[_0x1024('0x2c')]['id']},'transaction':_0x19fe9c});});})[_0x1024('0x15')](function(){_0xfe5e09['forEach'](function(_0xd013ef){socket['emit'](_0x1024('0x5e'),{'UserId':_0xd013ef['id'],'ChatQueueId':_0x4ad773['id']});});});});});}})[_0x1024('0x15')](respondWithStatusCode(_0x586f13,null))['catch'](handleError(_0x586f13,null));};exports['removeTeams']=function(_0x4990f7,_0x3e663d){return db[_0x1024('0x51')][_0x1024('0x29')]({'where':{'id':_0x4990f7['query'][_0x1024('0x54')]},'attributes':['id'],'include':[{'model':db[_0x1024('0x55')],'as':_0x1024('0x56'),'attributes':['id'],'raw':!![]}]})[_0x1024('0x15')](handleEntityNotFound(_0x3e663d,null))['then'](function(_0x685597){var _0x40da63=_[_0x1024('0x20')](_0x685597,'id');var _0x2d7bb3=[];var _0x3e4d8b=[];var _0x48aa1d=squel[_0x1024('0x5f')]();_0x48aa1d[_0x1024('0x60')](_0x1024('0x61'))[_0x1024('0x62')](_0x1024('0x63'),'tq')[_0x1024('0x64')](_0x1024('0x65'),'ut',_0x1024('0x66'))[_0x1024('0x45')](_0x1024('0x67'),_0x4990f7[_0x1024('0x2c')]['id']);for(var _0x9b833a=0x0;_0x9b833a<_0x685597[_0x1024('0x42')];_0x9b833a+=0x1){let _0x24b8f7=_0x685597[_0x9b833a];for(var _0x21cdbc=0x0;_0x21cdbc<_0x24b8f7['Agents']['length'];_0x21cdbc+=0x1){let _0x445f3c=_0x24b8f7['Agents'][_0x21cdbc];var _0x6e3769=_0x48aa1d['clone']();_0x6e3769[_0x1024('0x45')](_0x1024('0x68'),_0x445f3c['id']);_0x3e4d8b[_0x1024('0x69')](db['sequelize'][_0x1024('0x28')](_0x6e3769[_0x1024('0x6a')](),{'type':db[_0x1024('0x5a')][_0x1024('0x6b')][_0x1024('0x6c')]})[_0x1024('0x15')](function(_0xc7cbf1){if(_0xc7cbf1[_0x1024('0x42')]===0x1){return _0x445f3c['id'];}else{var _0x186667=_[_0x1024('0x6d')](_[_0x1024('0x20')](_0xc7cbf1,'TeamId'),function(_0x49b3b2){return _[_0x1024('0x6e')](_0x40da63,_0x49b3b2);});if(_0x186667){return _0x445f3c['id'];}}}));}}return BPromise[_0x1024('0x6f')](_0x3e4d8b)['then'](function(_0x2bfe0b){_0x2d7bb3=_(_0x2d7bb3)['union'](_0x2bfe0b)[_0x1024('0x70')]()[_0x1024('0x71')]();return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x4990f7['params']['id']}})[_0x1024('0x15')](function(_0x1e0855){return db[_0x1024('0x5a')][_0x1024('0x5b')](function(_0x5626ec){return _0x1e0855[_0x1024('0x72')](_0x4990f7[_0x1024('0x28')][_0x1024('0x54')],{'transaction':_0x5626ec})['then'](function(){if(!_[_0x1024('0x73')](_0x2d7bb3)){return _0x1e0855[_0x1024('0x74')](_0x2d7bb3,{'transaction':_0x5626ec});}})[_0x1024('0x15')](function(){_0x2d7bb3[_0x1024('0x75')](function(_0x21b973){socket[_0x1024('0x76')](_0x1024('0x77'),{'UserId':_0x21b973,'ChatQueueId':_0x1e0855['id']});});});});});});})[_0x1024('0x15')](respondWithStatusCode(_0x3e663d,null))[_0x1024('0x2a')](handleError(_0x3e663d,null));};exports[_0x1024('0x78')]=function(_0x346fc3,_0x8dc37d){return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x346fc3['params']['id']}})[_0x1024('0x15')](handleEntityNotFound(_0x8dc37d,null))['then'](function(_0x3f2a54){if(_0x3f2a54){return _0x3f2a54[_0x1024('0x78')](_0x346fc3[_0x1024('0x36')][_0x1024('0x54')],_['omit'](_0x346fc3['body'],['ids','id'])||{})[_0x1024('0x79')](function(_0x54d600){for(var _0xf919e8=0x0;_0xf919e8<_0x346fc3[_0x1024('0x36')][_0x1024('0x54')][_0x1024('0x42')];_0xf919e8+=0x1){socket[_0x1024('0x76')](_0x1024('0x5e'),{'UserId':Number(_0x346fc3[_0x1024('0x36')][_0x1024('0x54')][_0xf919e8]),'ChatQueueId':Number(_0x346fc3[_0x1024('0x2c')]['id'])});}return _0x54d600;});}})['then'](respondWithResult(_0x8dc37d,null))[_0x1024('0x2a')](handleError(_0x8dc37d,null));};exports['removeAgents']=function(_0x48565d,_0x51ff8d){return db[_0x1024('0x21')][_0x1024('0x34')]({'where':{'id':_0x48565d['params']['id']}})['then'](handleEntityNotFound(_0x51ff8d,null))[_0x1024('0x15')](function(_0x2ea0ab){if(_0x2ea0ab){return _0x2ea0ab[_0x1024('0x74')](_0x48565d[_0x1024('0x28')][_0x1024('0x54')])['then'](function(){if(_[_0x1024('0x7a')](_0x48565d[_0x1024('0x28')]['ids'])){for(var _0x24e4fe=0x0;_0x24e4fe<_0x48565d[_0x1024('0x28')][_0x1024('0x54')]['length'];_0x24e4fe+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x48565d['query'][_0x1024('0x54')][_0x24e4fe]),'ChatQueueId':Number(_0x48565d[_0x1024('0x2c')]['id'])});}}else{socket['emit'](_0x1024('0x77'),{'UserId':Number(_0x48565d[_0x1024('0x28')][_0x1024('0x54')]),'ChatQueueId':Number(_0x48565d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x51ff8d,null))['catch'](handleError(_0x51ff8d,null));};exports[_0x1024('0x7b')]=function(_0x11f941,_0x281081){var _0x1489bf={};var _0x54cd65={};var _0x3a198a;var _0x1cb020;return db[_0x1024('0x21')][_0x1024('0x3f')]({'where':{'id':_0x11f941[_0x1024('0x2c')]['id']}})[_0x1024('0x15')](handleEntityNotFound(_0x281081,null))[_0x1024('0x15')](function(_0x35b9c6){if(_0x35b9c6){_0x3a198a=_0x35b9c6;_0x54cd65['model']=_[_0x1024('0x2d')](db[_0x1024('0x55')][_0x1024('0x22')]);_0x54cd65['query']=_[_0x1024('0x2d')](_0x11f941[_0x1024('0x28')]);_0x54cd65[_0x1024('0x2e')]=_[_0x1024('0x41')](_0x54cd65['model'],_0x54cd65[_0x1024('0x28')]);_0x1489bf['attributes']=_[_0x1024('0x41')](_0x54cd65[_0x1024('0x2f')],qs[_0x1024('0x31')](_0x11f941[_0x1024('0x28')][_0x1024('0x31')]));_0x1489bf[_0x1024('0x30')]=_0x1489bf[_0x1024('0x30')][_0x1024('0x42')]?_0x1489bf[_0x1024('0x30')]:_0x54cd65['model'];_0x1489bf['order']=qs['sort'](_0x11f941['query']['sort']);_0x1489bf[_0x1024('0x45')]=qs[_0x1024('0x2e')](_[_0x1024('0x46')](_0x11f941['query'],_0x54cd65[_0x1024('0x2e')]));if(_0x11f941[_0x1024('0x28')][_0x1024('0x47')]){_0x1489bf[_0x1024('0x45')]=_['merge'](_0x1489bf[_0x1024('0x45')],{'$or':_[_0x1024('0x20')](_0x1489bf[_0x1024('0x30')],function(_0x49c12f){var _0x5a5ef3={};_0x5a5ef3[_0x49c12f]={'$like':'%'+_0x11f941[_0x1024('0x28')][_0x1024('0x47')]+'%'};return _0x5a5ef3;})});}_0x1489bf=_[_0x1024('0x32')]({},_0x1489bf,_0x11f941[_0x1024('0x33')]);return _0x3a198a[_0x1024('0x7b')](_0x1489bf);}})[_0x1024('0x15')](function(_0x21e3d8){if(_0x21e3d8){_0x1cb020=_0x21e3d8[_0x1024('0x42')];if(!_0x11f941['query']['hasOwnProperty'](_0x1024('0x44'))){_0x1489bf[_0x1024('0x10')]=qs[_0x1024('0x10')](_0x11f941['query'][_0x1024('0x10')]);_0x1489bf[_0x1024('0xf')]=qs[_0x1024('0xf')](_0x11f941[_0x1024('0x28')][_0x1024('0xf')]);}return _0x3a198a[_0x1024('0x7b')](_0x1489bf);}})['then'](function(_0x2f8cda){if(_0x2f8cda){return _0x2f8cda?{'count':_0x1cb020,'rows':_0x2f8cda}:null;}})[_0x1024('0x15')](respondWithResult(_0x281081,null))[_0x1024('0x2a')](handleError(_0x281081,null));};
\ No newline at end of file
+var _0x6129=['squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','undefined','count','offset','set','json','update','destroy','then','get','ChatQueues','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','role','user','userProfileId','autoAssociation','name','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','model','hasOwnProperty','nolimit','limit','order','sort','ChatQueueId','filter','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','chatPause','getTeams','Team','pick','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','isEmpty','removeAgents','addAgents','omit','spread','isArray','getAgents','util'];(function(_0x59fc4d,_0x55f16d){var _0x42f86f=function(_0xfcc5d2){while(--_0xfcc5d2){_0x59fc4d['push'](_0x59fc4d['shift']());}};_0x42f86f(++_0x55f16d);}(_0x6129,0x16a));var _0x9612=function(_0x4ab157,_0x298ced){_0x4ab157=_0x4ab157-0x0;var _0x33f852=_0x6129[_0x4ab157];return _0x33f852;};'use strict';var BPromise=require('bluebird');var util=require(_0x9612('0x0'));var _=require('lodash');var squel=require(_0x9612('0x1'));var Redis=require(_0x9612('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x9612('0x3'))(_0x9612('0x4'));var config=require(_0x9612('0x5'));var db=require(_0x9612('0x6'))['db'];config[_0x9612('0x7')]=_['defaults'](config[_0x9612('0x7')],{'host':_0x9612('0x8'),'port':0x18eb});var socket=require(_0x9612('0x9'))(new Redis(config[_0x9612('0x7')]));require(_0x9612('0xa'))[_0x9612('0xb')](socket);function respondWithStatusCode(_0x32338d,_0x4cfb36){_0x4cfb36=_0x4cfb36||0xcc;return function(_0x225045){if(_0x225045){return _0x32338d[_0x9612('0xc')](_0x4cfb36);}return _0x32338d[_0x9612('0xd')](_0x4cfb36)[_0x9612('0xe')]();};}function respondWithResult(_0x374dbc,_0x2b105e){_0x2b105e=_0x2b105e||0xc8;return function(_0x54da03){if(_0x54da03){return _0x374dbc[_0x9612('0xd')](_0x2b105e)['json'](_0x54da03);}};}function respondWithFilteredResult(_0xf51e8f,_0x279fc6){return function(_0x3d5432){if(_0x3d5432){var _0x446210=typeof _0x279fc6['offset']===_0x9612('0xf')&&typeof _0x279fc6['limit']===_0x9612('0xf');var _0x55d1e7=_0x3d5432[_0x9612('0x10')];var _0x54b67a=_0x446210?0x0:_0x279fc6[_0x9612('0x11')];var _0x55b477=_0x446210?_0x3d5432[_0x9612('0x10')]:_0x279fc6[_0x9612('0x11')]+_0x279fc6['limit'];var _0x14747c;if(_0x55b477>=_0x55d1e7){_0x55b477=_0x55d1e7;_0x14747c=0xc8;}else{_0x14747c=0xce;}_0xf51e8f[_0x9612('0xd')](_0x14747c);return _0xf51e8f[_0x9612('0x12')]('Content-Range',_0x54b67a+'-'+_0x55b477+'/'+_0x55d1e7)[_0x9612('0x13')](_0x3d5432);}return null;};}function saveUpdates(_0xee3a97){return function(_0x1481ca){if(_0x1481ca){return _0x1481ca[_0x9612('0x14')](_0xee3a97)['then'](function(_0x239b64){return _0x239b64;});}return null;};}function removeEntity(_0x6481cc){return function(_0x483d67){if(_0x483d67){return _0x483d67[_0x9612('0x15')]()[_0x9612('0x16')](function(){var _0x4ece60=_0x483d67[_0x9612('0x17')]({'plain':!![]});var _0x18c63d=_0x9612('0x18');return db[_0x9612('0x19')][_0x9612('0x15')]({'where':{'type':_0x18c63d,'resourceId':_0x4ece60['id']}})[_0x9612('0x16')](function(){return _0x483d67;});})[_0x9612('0x16')](function(){_0x6481cc['status'](0xcc)[_0x9612('0xe')]();});}};}function handleEntityNotFound(_0xd87e62){return function(_0x3a5bf2){if(!_0x3a5bf2){_0xd87e62[_0x9612('0xc')](0x194);}return _0x3a5bf2;};}function handleError(_0x3358bf,_0x246241){_0x246241=_0x246241||0x1f4;return function(_0x520439){logger[_0x9612('0x1a')](_0x520439[_0x9612('0x1b')]);if(_0x520439['name']){delete _0x520439['name'];}_0x3358bf[_0x9612('0xd')](_0x246241)[_0x9612('0x1c')](_0x520439);};}exports[_0x9612('0x1d')]=function(_0x19a97e,_0x126f35){var _0x4ea451={};var _0x2c3426={'count':0x0,'rows':[]};var _0x4d5d15=_[_0x9612('0x1e')](db['ChatQueue'][_0x9612('0x1f')],function(_0x30552f){return{'name':_0x30552f[_0x9612('0x20')],'type':_0x30552f[_0x9612('0x21')][_0x9612('0x22')]};});_0x4ea451=qs[_0x9612('0x23')](_0x4d5d15,_0x19a97e);var _0x45478b={'where':_0x4ea451[_0x9612('0x24')]};return db[_0x9612('0x25')]['count'](_0x45478b)['then'](function(_0x55400d){_0x2c3426[_0x9612('0x10')]=_0x55400d;_0x4ea451[_0x9612('0x26')]=qs['include'](_0x19a97e[_0x9612('0x27')]);return db[_0x9612('0x25')][_0x9612('0x28')](_0x4ea451);})[_0x9612('0x16')](function(_0x5071ec){_0x2c3426[_0x9612('0x29')]=_0x5071ec;return _0x2c3426;})[_0x9612('0x16')](respondWithFilteredResult(_0x126f35,_0x4ea451))['catch'](handleError(_0x126f35,null));};exports['show']=function(_0x1bf7fd,_0x8880ee){var _0x431fac={'raw':!![],'where':{'id':_0x1bf7fd['params']['id']}},_0x4ca9d8={};_0x4ca9d8['model']=_[_0x9612('0x2a')](db[_0x9612('0x25')]['rawAttributes']);_0x4ca9d8[_0x9612('0x27')]=_[_0x9612('0x2a')](_0x1bf7fd[_0x9612('0x27')]);_0x4ca9d8[_0x9612('0x2b')]=_[_0x9612('0x2c')](_0x4ca9d8['model'],_0x4ca9d8[_0x9612('0x27')]);_0x431fac[_0x9612('0x2d')]=_[_0x9612('0x2c')](_0x4ca9d8['model'],qs[_0x9612('0x2e')](_0x1bf7fd[_0x9612('0x27')][_0x9612('0x2e')]));_0x431fac[_0x9612('0x2d')]=_0x431fac[_0x9612('0x2d')][_0x9612('0x2f')]?_0x431fac['attributes']:_0x4ca9d8['model'];if(_0x1bf7fd[_0x9612('0x27')][_0x9612('0x30')]){_0x431fac[_0x9612('0x26')]=[{'all':!![]}];}_0x431fac=_[_0x9612('0x31')]({},_0x431fac,_0x1bf7fd[_0x9612('0x32')]);return db['ChatQueue'][_0x9612('0x33')](_0x431fac)[_0x9612('0x16')](handleEntityNotFound(_0x8880ee,null))[_0x9612('0x16')](respondWithResult(_0x8880ee,null))['catch'](handleError(_0x8880ee,null));};exports[_0x9612('0x34')]=function(_0x1c6c6a,_0xf60de){return db['ChatQueue'][_0x9612('0x34')](_0x1c6c6a[_0x9612('0x35')],{})[_0x9612('0x16')](function(_0x78cf1c){var _0x3d2965=_0x1c6c6a['user'][_0x9612('0x17')]({'plain':!![]});if(!_0x3d2965)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d2965[_0x9612('0x36')]===_0x9612('0x37')){var _0x4f713b=_0x78cf1c[_0x9612('0x17')]({'plain':!![]});var _0x4edbe2=_0x9612('0x18');return db['UserProfileSection'][_0x9612('0x33')]({'where':{'name':_0x4edbe2,'userProfileId':_0x3d2965[_0x9612('0x38')]},'raw':!![]})[_0x9612('0x16')](function(_0x2f0bf9){if(_0x2f0bf9&&_0x2f0bf9[_0x9612('0x39')]===0x0){return db[_0x9612('0x19')][_0x9612('0x34')]({'name':_0x4f713b[_0x9612('0x3a')],'resourceId':_0x4f713b['id'],'type':_0x2f0bf9[_0x9612('0x3a')],'sectionId':_0x2f0bf9['id']},{})[_0x9612('0x16')](function(){return _0x78cf1c;});}else{return _0x78cf1c;}})[_0x9612('0x3b')](function(_0xd52e45){logger[_0x9612('0x1a')](_0x9612('0x3c'),_0xd52e45);throw _0xd52e45;});}return _0x78cf1c;})[_0x9612('0x16')](respondWithResult(_0xf60de,0xc9))[_0x9612('0x3b')](handleError(_0xf60de,null));};exports[_0x9612('0x14')]=function(_0x300a5b,_0x366986){if(_0x300a5b[_0x9612('0x35')]['id']){delete _0x300a5b[_0x9612('0x35')]['id'];}return db[_0x9612('0x25')]['find']({'where':{'id':_0x300a5b['params']['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x366986,null))[_0x9612('0x16')](saveUpdates(_0x300a5b[_0x9612('0x35')],null))[_0x9612('0x16')](respondWithResult(_0x366986,null))[_0x9612('0x3b')](handleError(_0x366986,null));};exports[_0x9612('0x15')]=function(_0x1cc53b,_0x5cb6d9){return db['ChatQueue'][_0x9612('0x33')]({'where':{'id':_0x1cc53b[_0x9612('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5cb6d9,null))['then'](removeEntity(_0x5cb6d9,null))[_0x9612('0x3b')](handleError(_0x5cb6d9,null));};exports[_0x9612('0x3e')]=function(_0x4371b7,_0x22286d){return db[_0x9612('0x25')][_0x9612('0x3e')]()[_0x9612('0x16')](respondWithResult(_0x22286d,null))['catch'](handleError(_0x22286d,null));};exports[_0x9612('0x3f')]=function(_0x3f8198,_0x2258cb){var _0x3d35a7={'raw':!![],'where':{}},_0x521648={},_0x4e8647;return db[_0x9612('0x25')][_0x9612('0x40')]({'where':{'id':_0x3f8198['params']['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x2258cb,null))[_0x9612('0x16')](function(_0x410c1b){if(_0x410c1b){_0x4e8647=_0x410c1b[_0x9612('0x17')]({'plain':!![]});_0x521648[_0x9612('0x41')]=_['keys'](db['UserChatQueue'][_0x9612('0x1f')]);_0x521648[_0x9612('0x27')]=_[_0x9612('0x2a')](_0x3f8198['query']);_0x521648['filters']=_['intersection'](_0x521648[_0x9612('0x41')],_0x521648[_0x9612('0x27')]);_0x3d35a7[_0x9612('0x2d')]=_[_0x9612('0x2c')](_0x521648[_0x9612('0x41')],qs['fields'](_0x3f8198[_0x9612('0x27')][_0x9612('0x2e')]));_0x3d35a7['attributes']=_0x3d35a7[_0x9612('0x2d')][_0x9612('0x2f')]?_0x3d35a7['attributes']:_0x521648['model'];if(!_0x3f8198[_0x9612('0x27')][_0x9612('0x42')](_0x9612('0x43'))){_0x3d35a7[_0x9612('0x44')]=qs[_0x9612('0x44')](_0x3f8198['query'][_0x9612('0x44')]);_0x3d35a7[_0x9612('0x11')]=qs[_0x9612('0x11')](_0x3f8198[_0x9612('0x27')]['offset']);}_0x3d35a7[_0x9612('0x45')]=qs[_0x9612('0x46')](_0x3f8198['query'][_0x9612('0x46')]);_0x3d35a7['where']=qs[_0x9612('0x2b')](_['pick'](_0x3f8198[_0x9612('0x27')],_0x521648[_0x9612('0x2b')]));_0x3d35a7['where'][_0x9612('0x47')]=_0x410c1b['id'];if(_0x3f8198[_0x9612('0x27')][_0x9612('0x48')]){_0x3d35a7['where']=_[_0x9612('0x31')](_0x3d35a7['where'],{'$or':_[_0x9612('0x1e')](_0x3d35a7['attributes'],function(_0x459dd9){var _0x4e6489={};_0x4e6489[_0x459dd9]={'$like':'%'+_0x3f8198[_0x9612('0x27')][_0x9612('0x48')]+'%'};return _0x4e6489;})});}_0x3d35a7=_[_0x9612('0x31')]({},_0x3d35a7,_0x3f8198[_0x9612('0x32')]);return db[_0x9612('0x49')]['findAll'](_0x3d35a7);}})[_0x9612('0x16')](function(_0x4b252e){if(_0x4b252e){return db[_0x9612('0x4a')][_0x9612('0x4b')]({'where':{'id':_[_0x9612('0x1e')](_0x4b252e,_0x9612('0x4c')),'role':_0x9612('0x4d')},'attributes':['id',_0x9612('0x3a'),'chatPause',_0x9612('0x4e'),'createdAt']});}})['then'](function(_0x5cd2d3){if(_0x5cd2d3){return{'count':_0x5cd2d3[_0x9612('0x10')],'rows':_[_0x9612('0x1e')](_0x5cd2d3[_0x9612('0x29')],function(_0x451a57){return{'membername':_0x451a57[_0x9612('0x3a')],'UserId':_0x451a57['id'],'queue_name':_0x4e8647[_0x9612('0x3a')],'ChatQueueId':_0x4e8647['id'],'interface':util[_0x9612('0x4f')]('%s/%s',_0x9612('0x50'),_0x451a57['name']),'penalty':0x0,'paused':_0x451a57[_0x9612('0x51')],'createdAt':_0x451a57['createdAt'],'updatedAt':_0x451a57[_0x9612('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2258cb,_0x3d35a7))['catch'](handleError(_0x2258cb,null));};exports[_0x9612('0x52')]=function(_0x1aaf85,_0x25a7da){var _0x530370={};var _0x11a069={};var _0x158193;var _0xd67ecf;return db[_0x9612('0x25')][_0x9612('0x40')]({'where':{'id':_0x1aaf85[_0x9612('0x3d')]['id']}})['then'](handleEntityNotFound(_0x25a7da,null))[_0x9612('0x16')](function(_0x2f56b7){if(_0x2f56b7){_0x158193=_0x2f56b7;_0x11a069['model']=_[_0x9612('0x2a')](db[_0x9612('0x53')][_0x9612('0x1f')]);_0x11a069['query']=_[_0x9612('0x2a')](_0x1aaf85[_0x9612('0x27')]);_0x11a069['filters']=_[_0x9612('0x2c')](_0x11a069[_0x9612('0x41')],_0x11a069[_0x9612('0x27')]);_0x530370[_0x9612('0x2d')]=_[_0x9612('0x2c')](_0x11a069['model'],qs[_0x9612('0x2e')](_0x1aaf85['query'][_0x9612('0x2e')]));_0x530370[_0x9612('0x2d')]=_0x530370['attributes'][_0x9612('0x2f')]?_0x530370[_0x9612('0x2d')]:_0x11a069[_0x9612('0x41')];_0x530370[_0x9612('0x45')]=qs['sort'](_0x1aaf85[_0x9612('0x27')][_0x9612('0x46')]);_0x530370[_0x9612('0x24')]=qs[_0x9612('0x2b')](_[_0x9612('0x54')](_0x1aaf85[_0x9612('0x27')],_0x11a069[_0x9612('0x2b')]));if(_0x1aaf85[_0x9612('0x27')][_0x9612('0x48')]){_0x530370[_0x9612('0x24')]=_['merge'](_0x530370[_0x9612('0x24')],{'$or':_['map'](_0x530370['attributes'],function(_0x4a7c83){var _0x9707e0={};_0x9707e0[_0x4a7c83]={'$like':'%'+_0x1aaf85[_0x9612('0x27')]['filter']+'%'};return _0x9707e0;})});}_0x530370=_[_0x9612('0x31')]({},_0x530370,_0x1aaf85[_0x9612('0x32')]);return _0x158193[_0x9612('0x52')](_0x530370);}})[_0x9612('0x16')](function(_0x432223){if(_0x432223){_0xd67ecf=_0x432223[_0x9612('0x2f')];if(!_0x1aaf85[_0x9612('0x27')]['hasOwnProperty'](_0x9612('0x43'))){_0x530370['limit']=qs[_0x9612('0x44')](_0x1aaf85['query']['limit']);_0x530370[_0x9612('0x11')]=qs['offset'](_0x1aaf85['query'][_0x9612('0x11')]);}return _0x158193[_0x9612('0x52')](_0x530370);}})['then'](function(_0x248e8a){if(_0x248e8a){return _0x248e8a?{'count':_0xd67ecf,'rows':_0x248e8a}:null;}})[_0x9612('0x16')](respondWithResult(_0x25a7da,null))['catch'](handleError(_0x25a7da,null));};exports[_0x9612('0x55')]=function(_0x33d515,_0x82852f){var _0x122d30=_0x33d515[_0x9612('0x35')][_0x9612('0x56')];return db[_0x9612('0x53')]['findAll']({'where':{'id':_0x122d30},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9612('0x57'),'attributes':['id',_0x9612('0x3a'),_0x9612('0x58'),_0x9612('0x59'),_0x9612('0x5a')],'raw':!![]}]})['then'](function(_0x13996c){if(_0x13996c){var _0x197f9=_[_0x9612('0x5b')](_0x13996c,function(_0x3ccf6e){var _0x4a3a26=_0x3ccf6e[_0x9612('0x17')]({'plain':!![]});return _0x4a3a26[_0x9612('0x57')];});return db[_0x9612('0x25')][_0x9612('0x33')]({'where':{'id':_0x33d515[_0x9612('0x3d')]['id']}})['then'](function(_0x5478c9){return db[_0x9612('0x5c')][_0x9612('0x5d')](function(_0x5f1029){return _0x5478c9[_0x9612('0x55')](_0x122d30,{'transaction':_0x5f1029})['then'](function(){return BPromise['each'](_0x197f9,function(_0x3e5071){return db[_0x9612('0x49')]['findOrCreate']({'where':{'UserId':_0x3e5071['id'],'ChatQueueId':_0x33d515[_0x9612('0x3d')]['id']},'transaction':_0x5f1029});});})[_0x9612('0x16')](function(){_0x197f9[_0x9612('0x5e')](function(_0x47cfaf){socket[_0x9612('0x5f')](_0x9612('0x60'),{'UserId':_0x47cfaf['id'],'ChatQueueId':_0x5478c9['id']});});});});});}})['then'](respondWithStatusCode(_0x82852f,null))[_0x9612('0x3b')](handleError(_0x82852f,null));};exports[_0x9612('0x61')]=function(_0x4083b3,_0x57a6ef){return db[_0x9612('0x53')][_0x9612('0x28')]({'where':{'id':_0x4083b3[_0x9612('0x27')][_0x9612('0x56')]},'attributes':['id'],'include':[{'model':db[_0x9612('0x4a')],'as':_0x9612('0x57'),'attributes':['id'],'raw':!![]}]})[_0x9612('0x16')](handleEntityNotFound(_0x57a6ef,null))[_0x9612('0x16')](function(_0x1f86a2){var _0x74a850=_[_0x9612('0x1e')](_0x1f86a2,'id');var _0x54d66b=[];var _0x5b4ac0=[];var _0x130c96=squel['select']();_0x130c96[_0x9612('0x62')](_0x9612('0x63'))[_0x9612('0x64')]('team_has_chat_queues','tq')[_0x9612('0x65')](_0x9612('0x66'),'ut',_0x9612('0x67'))[_0x9612('0x24')](_0x9612('0x68'),_0x4083b3['params']['id']);for(var _0x4ba642=0x0;_0x4ba642<_0x1f86a2[_0x9612('0x2f')];_0x4ba642+=0x1){let _0x7a851f=_0x1f86a2[_0x4ba642];for(var _0x5edcc2=0x0;_0x5edcc2<_0x7a851f[_0x9612('0x57')]['length'];_0x5edcc2+=0x1){let _0x44de64=_0x7a851f[_0x9612('0x57')][_0x5edcc2];var _0x540c96=_0x130c96['clone']();_0x540c96[_0x9612('0x24')](_0x9612('0x69'),_0x44de64['id']);_0x5b4ac0[_0x9612('0x6a')](db[_0x9612('0x5c')][_0x9612('0x27')](_0x540c96[_0x9612('0x6b')](),{'type':db[_0x9612('0x5c')][_0x9612('0x6c')]['SELECT']})[_0x9612('0x16')](function(_0x4da11f){if(_0x4da11f[_0x9612('0x2f')]===0x1){return _0x44de64['id'];}else{var _0x1f7856=_[_0x9612('0x6d')](_[_0x9612('0x1e')](_0x4da11f,_0x9612('0x6e')),function(_0x496adf){return _[_0x9612('0x6f')](_0x74a850,_0x496adf);});if(_0x1f7856){return _0x44de64['id'];}}}));}}return BPromise['all'](_0x5b4ac0)[_0x9612('0x16')](function(_0x2128a1){_0x54d66b=_(_0x54d66b)[_0x9612('0x70')](_0x2128a1)[_0x9612('0x71')]()['value']();return db[_0x9612('0x25')][_0x9612('0x33')]({'where':{'id':_0x4083b3['params']['id']}})[_0x9612('0x16')](function(_0x19fb96){return db[_0x9612('0x5c')][_0x9612('0x5d')](function(_0x2260ba){return _0x19fb96[_0x9612('0x61')](_0x4083b3[_0x9612('0x27')]['ids'],{'transaction':_0x2260ba})[_0x9612('0x16')](function(){if(!_[_0x9612('0x72')](_0x54d66b)){return _0x19fb96[_0x9612('0x73')](_0x54d66b,{'transaction':_0x2260ba});}})[_0x9612('0x16')](function(){_0x54d66b['forEach'](function(_0x13b802){socket[_0x9612('0x5f')]('userChatQueue:remove',{'UserId':_0x13b802,'ChatQueueId':_0x19fb96['id']});});});});});});})['then'](respondWithStatusCode(_0x57a6ef,null))[_0x9612('0x3b')](handleError(_0x57a6ef,null));};exports[_0x9612('0x74')]=function(_0x397fdc,_0x111635){return db[_0x9612('0x25')]['find']({'where':{'id':_0x397fdc[_0x9612('0x3d')]['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x111635,null))[_0x9612('0x16')](function(_0x371afc){if(_0x371afc){return _0x371afc[_0x9612('0x74')](_0x397fdc['body'][_0x9612('0x56')],_[_0x9612('0x75')](_0x397fdc['body'],[_0x9612('0x56'),'id'])||{})[_0x9612('0x76')](function(_0x365fd5){for(var _0x357044=0x0;_0x357044<_0x397fdc[_0x9612('0x35')][_0x9612('0x56')][_0x9612('0x2f')];_0x357044+=0x1){socket[_0x9612('0x5f')]('userChatQueue:save',{'UserId':Number(_0x397fdc['body'][_0x9612('0x56')][_0x357044]),'ChatQueueId':Number(_0x397fdc[_0x9612('0x3d')]['id'])});}return _0x365fd5;});}})[_0x9612('0x16')](respondWithResult(_0x111635,null))[_0x9612('0x3b')](handleError(_0x111635,null));};exports[_0x9612('0x73')]=function(_0x211551,_0x52741e){return db[_0x9612('0x25')][_0x9612('0x33')]({'where':{'id':_0x211551[_0x9612('0x3d')]['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x52741e,null))['then'](function(_0x50291f){if(_0x50291f){return _0x50291f[_0x9612('0x73')](_0x211551[_0x9612('0x27')][_0x9612('0x56')])['then'](function(){if(_[_0x9612('0x77')](_0x211551[_0x9612('0x27')][_0x9612('0x56')])){for(var _0x122946=0x0;_0x122946<_0x211551[_0x9612('0x27')][_0x9612('0x56')][_0x9612('0x2f')];_0x122946+=0x1){socket[_0x9612('0x5f')]('userChatQueue:remove',{'UserId':Number(_0x211551[_0x9612('0x27')][_0x9612('0x56')][_0x122946]),'ChatQueueId':Number(_0x211551[_0x9612('0x3d')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x211551[_0x9612('0x27')][_0x9612('0x56')]),'ChatQueueId':Number(_0x211551[_0x9612('0x3d')]['id'])});}});}})[_0x9612('0x16')](respondWithStatusCode(_0x52741e,null))[_0x9612('0x3b')](handleError(_0x52741e,null));};exports[_0x9612('0x78')]=function(_0x18f990,_0x5856e5){var _0x321b72={};var _0x5abc65={};var _0x18477a;var _0x2011f8;return db[_0x9612('0x25')][_0x9612('0x40')]({'where':{'id':_0x18f990[_0x9612('0x3d')]['id']}})[_0x9612('0x16')](handleEntityNotFound(_0x5856e5,null))[_0x9612('0x16')](function(_0x3aa24f){if(_0x3aa24f){_0x18477a=_0x3aa24f;_0x5abc65[_0x9612('0x41')]=_['keys'](db[_0x9612('0x4a')][_0x9612('0x1f')]);_0x5abc65[_0x9612('0x27')]=_[_0x9612('0x2a')](_0x18f990['query']);_0x5abc65['filters']=_[_0x9612('0x2c')](_0x5abc65[_0x9612('0x41')],_0x5abc65[_0x9612('0x27')]);_0x321b72['attributes']=_[_0x9612('0x2c')](_0x5abc65[_0x9612('0x41')],qs['fields'](_0x18f990[_0x9612('0x27')][_0x9612('0x2e')]));_0x321b72[_0x9612('0x2d')]=_0x321b72['attributes'][_0x9612('0x2f')]?_0x321b72[_0x9612('0x2d')]:_0x5abc65[_0x9612('0x41')];_0x321b72[_0x9612('0x45')]=qs['sort'](_0x18f990[_0x9612('0x27')][_0x9612('0x46')]);_0x321b72[_0x9612('0x24')]=qs[_0x9612('0x2b')](_[_0x9612('0x54')](_0x18f990[_0x9612('0x27')],_0x5abc65['filters']));if(_0x18f990[_0x9612('0x27')]['filter']){_0x321b72[_0x9612('0x24')]=_[_0x9612('0x31')](_0x321b72[_0x9612('0x24')],{'$or':_['map'](_0x321b72[_0x9612('0x2d')],function(_0x1d095e){var _0x1799e8={};_0x1799e8[_0x1d095e]={'$like':'%'+_0x18f990[_0x9612('0x27')][_0x9612('0x48')]+'%'};return _0x1799e8;})});}_0x321b72=_['merge']({},_0x321b72,_0x18f990[_0x9612('0x32')]);return _0x18477a[_0x9612('0x78')](_0x321b72);}})['then'](function(_0x14acf6){if(_0x14acf6){_0x2011f8=_0x14acf6['length'];if(!_0x18f990['query'][_0x9612('0x42')](_0x9612('0x43'))){_0x321b72[_0x9612('0x44')]=qs[_0x9612('0x44')](_0x18f990[_0x9612('0x27')][_0x9612('0x44')]);_0x321b72[_0x9612('0x11')]=qs['offset'](_0x18f990['query'][_0x9612('0x11')]);}return _0x18477a[_0x9612('0x78')](_0x321b72);}})[_0x9612('0x16')](function(_0x37fb1d){if(_0x37fb1d){return _0x37fb1d?{'count':_0x2011f8,'rows':_0x37fb1d}:null;}})[_0x9612('0x16')](respondWithResult(_0x5856e5,null))[_0x9612('0x3b')](handleError(_0x5856e5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index a86ab0a..ae7da73 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 _0x62fb=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1d7ed7,_0x3a5e6a){var _0x3fcf8d=function(_0x4c3cfe){while(--_0x4c3cfe){_0x1d7ed7['push'](_0x1d7ed7['shift']());}};_0x3fcf8d(++_0x3a5e6a);}(_0x62fb,0x172));var _0xb62f=function(_0x4f491e,_0xbd7715){_0x4f491e=_0x4f491e-0x0;var _0x24c954=_0x62fb[_0x4f491e];return _0x24c954;};'use strict';var EventEmitter=require(_0xb62f('0x0'));var ChatQueue=require(_0xb62f('0x1'))['db'][_0xb62f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb62f('0x3')](0x0);var events={'afterCreate':_0xb62f('0x4'),'afterUpdate':_0xb62f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22e459){return function(_0x4ba244,_0x21de3f,_0x12fce1){ChatQueueEvents[_0xb62f('0x6')](_0x22e459+':'+_0x4ba244['id'],_0x4ba244);ChatQueueEvents[_0xb62f('0x6')](_0x22e459,_0x4ba244);_0x12fce1(null);};}for(var e in events){if(events[_0xb62f('0x7')](e)){var event=events[e];ChatQueue[_0xb62f('0x8')](e,emitEvent(event));}}module[_0xb62f('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x09a4=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x20b844,_0x1fcefc){var _0x146bcc=function(_0x1abbe9){while(--_0x1abbe9){_0x20b844['push'](_0x20b844['shift']());}};_0x146bcc(++_0x1fcefc);}(_0x09a4,0x147));var _0x409a=function(_0xc28ad2,_0x5de7dd){_0xc28ad2=_0xc28ad2-0x0;var _0x3df1e2=_0x09a4[_0xc28ad2];return _0x3df1e2;};'use strict';var EventEmitter=require(_0x409a('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x409a('0x1')](0x0);var events={'afterCreate':_0x409a('0x2'),'afterUpdate':_0x409a('0x3'),'afterDestroy':_0x409a('0x4')};function emitEvent(_0x56b8c5){return function(_0x2db9e0,_0x630525,_0x32e3cf){ChatQueueEvents[_0x409a('0x5')](_0x56b8c5+':'+_0x2db9e0['id'],_0x2db9e0);ChatQueueEvents[_0x409a('0x5')](_0x56b8c5,_0x2db9e0);_0x32e3cf(null);};}for(var e in events){if(events[_0x409a('0x6')](e)){var event=events[e];ChatQueue[_0x409a('0x7')](e,emitEvent(event));}}module[_0x409a('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 6ffae9f..4c23bb4 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 _0x311f=['ChatQueue','chat_queues','util','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3b6d96,_0x5d3241){var _0x1e6b1c=function(_0x200631){while(--_0x200631){_0x3b6d96['push'](_0x3b6d96['shift']());}};_0x1e6b1c(++_0x5d3241);}(_0x311f,0xc0));var _0xf311=function(_0x487fb9,_0x43c08e){_0x487fb9=_0x487fb9-0x0;var _0x44d36a=_0x311f[_0x487fb9];return _0x44d36a;};'use strict';var _=require('lodash');var util=require(_0xf311('0x0'));var logger=require('../../config/logger')(_0xf311('0x1'));var moment=require(_0xf311('0x2'));var BPromise=require('bluebird');var rp=require(_0xf311('0x3'));var fs=require('fs');var path=require(_0xf311('0x4'));var rimraf=require(_0xf311('0x5'));var config=require(_0xf311('0x6'));var attributes=require('./chatQueue.attributes');module[_0xf311('0x7')]=function(_0x1362b1,_0x54c7d7){return _0x1362b1['define'](_0xf311('0x8'),attributes,{'tableName':_0xf311('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcae2=['bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','moment'];(function(_0x23f58d,_0x22b11c){var _0x515d10=function(_0x18fe4a){while(--_0x18fe4a){_0x23f58d['push'](_0x23f58d['shift']());}};_0x515d10(++_0x22b11c);}(_0xcae2,0x1a1));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2cae('0x0'));var logger=require(_0x2cae('0x1'))('api');var moment=require(_0x2cae('0x2'));var BPromise=require(_0x2cae('0x3'));var rp=require(_0x2cae('0x4'));var fs=require('fs');var path=require(_0x2cae('0x5'));var rimraf=require(_0x2cae('0x6'));var config=require('../../config/environment');var attributes=require(_0x2cae('0x7'));module[_0x2cae('0x8')]=function(_0x3371f0,_0x312a86){return _0x3371f0[_0x2cae('0x9')](_0x2cae('0xa'),attributes,{'tableName':_0x2cae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index cae5450..699b026 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 _0x8b26=['./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','model','map','then','ChatQueue','find','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x8b26,0x1f3));var _0x68b2=function(_0x3875b1,_0x47cf1a){_0x3875b1=_0x3875b1-0x0;var _0x1e9c55=_0x8b26[_0x3875b1];return _0x1e9c55;};'use strict';var _=require(_0x68b2('0x0'));var util=require(_0x68b2('0x1'));var moment=require(_0x68b2('0x2'));var BPromise=require('bluebird');var rs=require(_0x68b2('0x3'));var fs=require('fs');var Redis=require(_0x68b2('0x4'));var db=require(_0x68b2('0x5'))['db'];var utils=require(_0x68b2('0x6'));var logger=require(_0x68b2('0x7'))(_0x68b2('0x8'));var config=require(_0x68b2('0x9'));var jayson=require(_0x68b2('0xa'));var client=jayson[_0x68b2('0xb')][_0x68b2('0xc')]({'port':0x232a});config['redis']=_[_0x68b2('0xd')](config[_0x68b2('0xe')],{'host':_0x68b2('0xf'),'port':0x18eb});var socket=require(_0x68b2('0x10'))(new Redis(config['redis']));require(_0x68b2('0x11'))['register'](socket);function respondWithRpcPromise(_0x5d960c,_0x45e46b,_0x17fd91){return new BPromise(function(_0x179350,_0x4b31c6){return client[_0x68b2('0x12')](_0x5d960c,_0x17fd91)['then'](function(_0x5ef591){logger[_0x68b2('0x13')](_0x68b2('0x14'),_0x45e46b,_0x68b2('0x15'));logger[_0x68b2('0x16')](_0x68b2('0x17'),_0x45e46b,_0x68b2('0x15'),JSON[_0x68b2('0x18')](_0x5ef591));if(_0x5ef591[_0x68b2('0x19')]){if(_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1a')]===0x1f4){logger[_0x68b2('0x19')]('ChatQueue,\x20%s,\x20%s',_0x45e46b,_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1b')]);return _0x4b31c6(_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1b')]);}logger[_0x68b2('0x19')]('ChatQueue,\x20%s,\x20%s',_0x45e46b,_0x5ef591[_0x68b2('0x19')]['message']);return _0x179350(_0x5ef591[_0x68b2('0x19')][_0x68b2('0x1b')]);}else{logger[_0x68b2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x45e46b,'request\x20sent');_0x179350(_0x5ef591[_0x68b2('0x1c')][_0x68b2('0x1b')]);}})[_0x68b2('0x1d')](function(_0x5836a5){logger[_0x68b2('0x19')](_0x68b2('0x14'),_0x45e46b,_0x5836a5);_0x4b31c6(_0x5836a5);});});}exports[_0x68b2('0x1e')]=function(_0x28af4d){var _0x313704=this;return new Promise(function(_0x240c89,_0x8ddd65){return db['ChatQueue'][_0x68b2('0x1f')]({'raw':_0x28af4d[_0x68b2('0x20')]?_0x28af4d[_0x68b2('0x20')][_0x68b2('0x21')]===undefined?!![]:![]:!![],'where':_0x28af4d[_0x68b2('0x20')]?_0x28af4d['options'][_0x68b2('0x22')]||null:null,'attributes':_0x28af4d[_0x68b2('0x20')]?_0x28af4d[_0x68b2('0x20')][_0x68b2('0x23')]||null:null,'limit':_0x28af4d['options']?_0x28af4d[_0x68b2('0x20')]['limit']||null:null,'include':_0x28af4d[_0x68b2('0x20')]?_0x28af4d[_0x68b2('0x20')][_0x68b2('0x24')]?_['map'](_0x28af4d['options'][_0x68b2('0x24')],function(_0x4ecbb3){return{'model':db[_0x4ecbb3[_0x68b2('0x25')]],'as':_0x4ecbb3['as'],'attributes':_0x4ecbb3[_0x68b2('0x23')],'include':_0x4ecbb3[_0x68b2('0x24')]?_[_0x68b2('0x26')](_0x4ecbb3['include'],function(_0x219142){return{'model':db[_0x219142[_0x68b2('0x25')]],'as':_0x219142['as'],'attributes':_0x219142['attributes'],'include':_0x219142[_0x68b2('0x24')]?_['map'](_0x219142[_0x68b2('0x24')],function(_0x5a073b){return{'model':db[_0x5a073b[_0x68b2('0x25')]],'as':_0x5a073b['as'],'attributes':_0x5a073b[_0x68b2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x68b2('0x27')](function(_0x356899){logger[_0x68b2('0x13')]('GetChatQueue',_0x28af4d);logger[_0x68b2('0x16')](_0x68b2('0x1e'),_0x28af4d,JSON['stringify'](_0x356899));_0x240c89(_0x356899);})[_0x68b2('0x1d')](function(_0x4bdb95){logger[_0x68b2('0x19')](_0x68b2('0x1e'),_0x4bdb95[_0x68b2('0x1b')],_0x28af4d);_0x8ddd65(_0x313704[_0x68b2('0x19')](0x1f4,_0x4bdb95[_0x68b2('0x1b')]));});});};exports['ShowChatQueue']=function(_0x533586){var _0x36c81b=this;return new Promise(function(_0x6da681,_0x26dac1){return db[_0x68b2('0x28')][_0x68b2('0x29')]({'raw':_0x533586['options']?_0x533586[_0x68b2('0x20')][_0x68b2('0x21')]===undefined?!![]:![]:!![],'where':_0x533586[_0x68b2('0x20')]?_0x533586[_0x68b2('0x20')][_0x68b2('0x22')]||null:null,'attributes':_0x533586[_0x68b2('0x20')]?_0x533586['options'][_0x68b2('0x23')]||null:null,'include':_0x533586['options']?_0x533586[_0x68b2('0x20')][_0x68b2('0x24')]?_[_0x68b2('0x26')](_0x533586[_0x68b2('0x20')]['include'],function(_0x58552d){return{'model':db[_0x58552d[_0x68b2('0x25')]],'as':_0x58552d['as'],'attributes':_0x58552d[_0x68b2('0x23')],'include':_0x58552d[_0x68b2('0x24')]?_['map'](_0x58552d[_0x68b2('0x24')],function(_0x524fac){return{'model':db[_0x524fac[_0x68b2('0x25')]],'as':_0x524fac['as'],'attributes':_0x524fac[_0x68b2('0x23')],'include':_0x524fac[_0x68b2('0x24')]?_[_0x68b2('0x26')](_0x524fac[_0x68b2('0x24')],function(_0x23ca1b){return{'model':db[_0x23ca1b[_0x68b2('0x25')]],'as':_0x23ca1b['as'],'attributes':_0x23ca1b[_0x68b2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x68b2('0x27')](function(_0x5c05ee){logger[_0x68b2('0x13')](_0x68b2('0x2a'),_0x533586);logger[_0x68b2('0x16')](_0x68b2('0x2a'),_0x533586,JSON[_0x68b2('0x18')](_0x5c05ee));_0x6da681(_0x5c05ee);})[_0x68b2('0x1d')](function(_0x3fdb97){logger[_0x68b2('0x19')](_0x68b2('0x2a'),_0x3fdb97[_0x68b2('0x1b')],_0x533586);_0x26dac1(_0x36c81b[_0x68b2('0x19')](0x1f4,_0x3fdb97[_0x68b2('0x1b')]));});});};
\ No newline at end of file
+var _0xde6f=['stringify','error','code','ChatQueue,\x20%s,\x20%s','message','GetChatQueue','ChatQueue','options','limit','include','model','attributes','map','ShowChatQueue','find','raw','where','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0xed9fea,_0x5ed774){var _0x198f12=function(_0xfb85f6){while(--_0xfb85f6){_0xed9fea['push'](_0xed9fea['shift']());}};_0x198f12(++_0x5ed774);}(_0xde6f,0x84));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfde6('0x0'));var BPromise=require(_0xfde6('0x1'));var rs=require(_0xfde6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfde6('0x3'))['db'];var utils=require(_0xfde6('0x4'));var logger=require(_0xfde6('0x5'))(_0xfde6('0x6'));var config=require(_0xfde6('0x7'));var jayson=require(_0xfde6('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xfde6('0x9')]=_[_0xfde6('0xa')](config[_0xfde6('0x9')],{'host':_0xfde6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfde6('0x9')]));require(_0xfde6('0xc'))[_0xfde6('0xd')](socket);function respondWithRpcPromise(_0x5d890c,_0x27e896,_0x470b8a){return new BPromise(function(_0x48dd4c,_0x5167e2){return client[_0xfde6('0xe')](_0x5d890c,_0x470b8a)[_0xfde6('0xf')](function(_0x37df80){logger[_0xfde6('0x10')]('ChatQueue,\x20%s,\x20%s',_0x27e896,_0xfde6('0x11'));logger[_0xfde6('0x12')](_0xfde6('0x13'),_0x27e896,_0xfde6('0x11'),JSON[_0xfde6('0x14')](_0x37df80));if(_0x37df80['error']){if(_0x37df80[_0xfde6('0x15')][_0xfde6('0x16')]===0x1f4){logger['error'](_0xfde6('0x17'),_0x27e896,_0x37df80[_0xfde6('0x15')][_0xfde6('0x18')]);return _0x5167e2(_0x37df80['error'][_0xfde6('0x18')]);}logger[_0xfde6('0x15')](_0xfde6('0x17'),_0x27e896,_0x37df80[_0xfde6('0x15')]['message']);return _0x48dd4c(_0x37df80['error'][_0xfde6('0x18')]);}else{logger['info'](_0xfde6('0x17'),_0x27e896,_0xfde6('0x11'));_0x48dd4c(_0x37df80['result'][_0xfde6('0x18')]);}})['catch'](function(_0x122e45){logger[_0xfde6('0x15')](_0xfde6('0x17'),_0x27e896,_0x122e45);_0x5167e2(_0x122e45);});});}exports[_0xfde6('0x19')]=function(_0x1ec215){var _0x386622=this;return new Promise(function(_0x37b4dc,_0x1841d8){return db[_0xfde6('0x1a')]['findAll']({'raw':_0x1ec215[_0xfde6('0x1b')]?_0x1ec215[_0xfde6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1ec215[_0xfde6('0x1b')]?_0x1ec215[_0xfde6('0x1b')]['where']||null:null,'attributes':_0x1ec215[_0xfde6('0x1b')]?_0x1ec215[_0xfde6('0x1b')]['attributes']||null:null,'limit':_0x1ec215['options']?_0x1ec215[_0xfde6('0x1b')][_0xfde6('0x1c')]||null:null,'include':_0x1ec215['options']?_0x1ec215[_0xfde6('0x1b')]['include']?_['map'](_0x1ec215[_0xfde6('0x1b')][_0xfde6('0x1d')],function(_0x62e9b8){return{'model':db[_0x62e9b8[_0xfde6('0x1e')]],'as':_0x62e9b8['as'],'attributes':_0x62e9b8[_0xfde6('0x1f')],'include':_0x62e9b8[_0xfde6('0x1d')]?_['map'](_0x62e9b8[_0xfde6('0x1d')],function(_0x262373){return{'model':db[_0x262373['model']],'as':_0x262373['as'],'attributes':_0x262373[_0xfde6('0x1f')],'include':_0x262373['include']?_[_0xfde6('0x20')](_0x262373[_0xfde6('0x1d')],function(_0x59661f){return{'model':db[_0x59661f[_0xfde6('0x1e')]],'as':_0x59661f['as'],'attributes':_0x59661f[_0xfde6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c043){logger[_0xfde6('0x10')]('GetChatQueue',_0x1ec215);logger[_0xfde6('0x12')]('GetChatQueue',_0x1ec215,JSON[_0xfde6('0x14')](_0x43c043));_0x37b4dc(_0x43c043);})['catch'](function(_0x52c0db){logger['error'](_0xfde6('0x19'),_0x52c0db[_0xfde6('0x18')],_0x1ec215);_0x1841d8(_0x386622[_0xfde6('0x15')](0x1f4,_0x52c0db[_0xfde6('0x18')]));});});};exports[_0xfde6('0x21')]=function(_0x5a9f1a){var _0x488f7b=this;return new Promise(function(_0x5ae689,_0x183e89){return db[_0xfde6('0x1a')][_0xfde6('0x22')]({'raw':_0x5a9f1a[_0xfde6('0x1b')]?_0x5a9f1a[_0xfde6('0x1b')][_0xfde6('0x23')]===undefined?!![]:![]:!![],'where':_0x5a9f1a[_0xfde6('0x1b')]?_0x5a9f1a[_0xfde6('0x1b')][_0xfde6('0x24')]||null:null,'attributes':_0x5a9f1a['options']?_0x5a9f1a[_0xfde6('0x1b')][_0xfde6('0x1f')]||null:null,'include':_0x5a9f1a[_0xfde6('0x1b')]?_0x5a9f1a[_0xfde6('0x1b')]['include']?_[_0xfde6('0x20')](_0x5a9f1a['options'][_0xfde6('0x1d')],function(_0x359181){return{'model':db[_0x359181[_0xfde6('0x1e')]],'as':_0x359181['as'],'attributes':_0x359181[_0xfde6('0x1f')],'include':_0x359181['include']?_[_0xfde6('0x20')](_0x359181['include'],function(_0x337da2){return{'model':db[_0x337da2[_0xfde6('0x1e')]],'as':_0x337da2['as'],'attributes':_0x337da2['attributes'],'include':_0x337da2[_0xfde6('0x1d')]?_[_0xfde6('0x20')](_0x337da2[_0xfde6('0x1d')],function(_0xa1fc20){return{'model':db[_0xa1fc20['model']],'as':_0xa1fc20['as'],'attributes':_0xa1fc20[_0xfde6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfde6('0xf')](function(_0x3d8957){logger[_0xfde6('0x10')](_0xfde6('0x21'),_0x5a9f1a);logger[_0xfde6('0x12')](_0xfde6('0x21'),_0x5a9f1a,JSON[_0xfde6('0x14')](_0x3d8957));_0x5ae689(_0x3d8957);})[_0xfde6('0x25')](function(_0x312c9b){logger[_0xfde6('0x15')](_0xfde6('0x21'),_0x312c9b[_0xfde6('0x18')],_0x5a9f1a);_0x183e89(_0x488f7b[_0xfde6('0x15')](0x1f4,_0x312c9b[_0xfde6('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index e226723..553b4df 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 _0x425d=['./chatQueue.events','remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x425d,0x1e0));var _0xd425=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0x425d[_0x2726ad];return _0xd87993;};'use strict';var ChatQueueEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){ChatQueueEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);ChatQueueEvents['on'](_0x50b061,_0xb6ba8e);}};
\ No newline at end of file
+var _0x2123=['./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1a215b,_0x5749df){var _0x245257=function(_0x15ef3d){while(--_0x15ef3d){_0x1a215b['push'](_0x1a215b['shift']());}};_0x245257(++_0x5749df);}(_0x2123,0x190));var _0x3212=function(_0x10ee18,_0x16a291){_0x10ee18=_0x10ee18-0x0;var _0xd8c465=_0x2123[_0x10ee18];return _0xd8c465;};'use strict';var ChatQueueEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatQueueEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatQueue:'+_0x4b35e9,_0x5d9d36);ChatQueueEvents['on'](_0x4b35e9,_0x3e17a3);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 21852c8..a5f94b0 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x455944,_0x487e92){var _0x52f79e=function(_0x208418){while(--_0x208418){_0x455944['push'](_0x455944['shift']());}};_0x52f79e(++_0x487e92);}(_0xe14b,0x93));var _0xbe14=function(_0xa82c60,_0x3f05bf){_0xa82c60=_0xa82c60-0x0;var _0x291fef=_0xe14b[_0xa82c60];return _0x291fef;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4f1550,_0x34864a){var _0x2ea3ca=function(_0x272eb5){while(--_0x272eb5){_0x4f1550['push'](_0x4f1550['shift']());}};_0x2ea3ca(++_0x34864a);}(_0x55ca,0x126));var _0xa55c=function(_0x2ecd91,_0x1f21e8){_0x2ecd91=_0x2ecd91-0x0;var _0x3bf737=_0x55ca[_0x2ecd91];return _0x3bf737;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 8ed0a16..278b12f 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 _0xb85f=['STRING','DATE','sequelize','exports'];(function(_0x57d9a7,_0x2b6a19){var _0x5e02f1=function(_0x5aacc5){while(--_0x5aacc5){_0x57d9a7['push'](_0x57d9a7['shift']());}};_0x5e02f1(++_0x2b6a19);}(_0xb85f,0x132));var _0xfb85=function(_0xcc6ae,_0x11bc90){_0xcc6ae=_0xcc6ae-0x0;var _0x57e3a8=_0xb85f[_0xcc6ae];return _0x57e3a8;};'use strict';var moment=require('moment');var Sequelize=require(_0xfb85('0x0'));module[_0xfb85('0x1')]={'uniqueid':{'type':Sequelize[_0xfb85('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfb85('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfb85('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe747=['DATE','moment','sequelize','STRING'];(function(_0x47a844,_0x45be97){var _0x570f07=function(_0x1acea7){while(--_0x1acea7){_0x47a844['push'](_0x47a844['shift']());}};_0x570f07(++_0x45be97);}(_0xe747,0x13d));var _0x7e74=function(_0x3bc5a1,_0x530b19){_0x3bc5a1=_0x3bc5a1-0x0;var _0x5d23a3=_0xe747[_0x3bc5a1];return _0x5d23a3;};'use strict';var moment=require(_0x7e74('0x0'));var Sequelize=require(_0x7e74('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x7e74('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7e74('0x3')]},'acceptAt':{'type':Sequelize[_0x7e74('0x3')]},'exitAt':{'type':Sequelize[_0x7e74('0x3')]},'reason':{'type':Sequelize[_0x7e74('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index bb929af..f47e527 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 _0x8458=['reject','update','then','destroy','error','stack','name','send','map','ChatQueueReport','fieldName','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x8458,0x1a5));var _0x8845=function(_0x8c52ba,_0x20a269){_0x8c52ba=_0x8c52ba-0x0;var _0x248eeb=_0x8458[_0x8c52ba];return _0x248eeb;};'use strict';var emlformat=require(_0x8845('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8845('0x1'));var jsonpatch=require(_0x8845('0x2'));var rp=require(_0x8845('0x3'));var moment=require(_0x8845('0x4'));var BPromise=require(_0x8845('0x5'));var Mustache=require('mustache');var util=require(_0x8845('0x6'));var path=require(_0x8845('0x7'));var sox=require(_0x8845('0x8'));var csv=require(_0x8845('0x9'));var ejs=require(_0x8845('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8845('0xb'));var squel=require('squel');var crypto=require(_0x8845('0xc'));var jsforce=require(_0x8845('0xd'));var deskjs=require(_0x8845('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8845('0xf'));var Papa=require(_0x8845('0x10'));var Redis=require('ioredis');var authService=require(_0x8845('0x11'));var qs=require(_0x8845('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8845('0x13'));var logger=require(_0x8845('0x14'))(_0x8845('0x15'));var utils=require(_0x8845('0x16'));var config=require(_0x8845('0x17'));var licenseUtil=require(_0x8845('0x18'));var db=require(_0x8845('0x19'))['db'];function respondWithStatusCode(_0x160380,_0x189cfc){_0x189cfc=_0x189cfc||0xcc;return function(_0x2b11dd){if(_0x2b11dd){return _0x160380[_0x8845('0x1a')](_0x189cfc);}return _0x160380[_0x8845('0x1b')](_0x189cfc)[_0x8845('0x1c')]();};}function respondWithResult(_0x2b9b36,_0x4a3a96){_0x4a3a96=_0x4a3a96||0xc8;return function(_0x110541){if(_0x110541){return _0x2b9b36[_0x8845('0x1b')](_0x4a3a96)['json'](_0x110541);}};}function respondWithFilteredResult(_0x2df404,_0x4138c4){return function(_0x15e80e){if(_0x15e80e){var _0x4e56d2=typeof _0x4138c4['offset']==='undefined'&&typeof _0x4138c4[_0x8845('0x1d')]===_0x8845('0x1e');var _0x41c8dc=_0x15e80e[_0x8845('0x1f')];var _0x10f1d5=_0x4e56d2?0x0:_0x4138c4[_0x8845('0x20')];var _0x433170=_0x4e56d2?_0x15e80e['count']:_0x4138c4['offset']+_0x4138c4['limit'];var _0x2afdda;if(_0x433170>=_0x41c8dc){_0x433170=_0x41c8dc;_0x2afdda=0xc8;}else{_0x2afdda=0xce;}_0x2df404[_0x8845('0x1b')](_0x2afdda);return _0x2df404[_0x8845('0x21')](_0x8845('0x22'),_0x10f1d5+'-'+_0x433170+'/'+_0x41c8dc)['json'](_0x15e80e);}return null;};}function patchUpdates(_0x2e94f5){return function(_0x5a5197){try{jsonpatch['apply'](_0x5a5197,_0x2e94f5,!![]);}catch(_0x1ccdca){return BPromise[_0x8845('0x23')](_0x1ccdca);}return _0x5a5197['save']();};}function saveUpdates(_0x450bfc,_0x23a0d3){return function(_0x597fc5){if(_0x597fc5){return _0x597fc5[_0x8845('0x24')](_0x450bfc)[_0x8845('0x25')](function(_0x2b7ad7){return _0x2b7ad7;});}return null;};}function removeEntity(_0x391972,_0x4e48b1){return function(_0x5cd766){if(_0x5cd766){return _0x5cd766[_0x8845('0x26')]()[_0x8845('0x25')](function(){_0x391972[_0x8845('0x1b')](0xcc)[_0x8845('0x1c')]();});}};}function handleEntityNotFound(_0x3d2fca,_0x18819c){return function(_0x37eea4){if(!_0x37eea4){_0x3d2fca[_0x8845('0x1a')](0x194);}return _0x37eea4;};}function handleError(_0x9f40e8,_0x21be51){_0x21be51=_0x21be51||0x1f4;return function(_0x3e1e6e){logger[_0x8845('0x27')](_0x3e1e6e[_0x8845('0x28')]);if(_0x3e1e6e[_0x8845('0x29')]){delete _0x3e1e6e[_0x8845('0x29')];}_0x9f40e8[_0x8845('0x1b')](_0x21be51)[_0x8845('0x2a')](_0x3e1e6e);};}exports['index']=function(_0x47dfff,_0x3a831f){var _0xd1f69e={},_0x26cae2={},_0x3cc594={'count':0x0,'rows':[]};var _0x26dd9e=_[_0x8845('0x2b')](db[_0x8845('0x2c')]['rawAttributes'],function(_0x2991cd){return{'name':_0x2991cd[_0x8845('0x2d')],'type':_0x2991cd['type'][_0x8845('0x2e')]};});_0x26cae2[_0x8845('0x2f')]=_[_0x8845('0x2b')](_0x26dd9e,_0x8845('0x29'));_0x26cae2[_0x8845('0x30')]=_[_0x8845('0x31')](_0x47dfff[_0x8845('0x30')]);_0x26cae2[_0x8845('0x32')]=_['intersection'](_0x26cae2['model'],_0x26cae2[_0x8845('0x30')]);_0xd1f69e[_0x8845('0x33')]=_['intersection'](_0x26cae2[_0x8845('0x2f')],qs[_0x8845('0x34')](_0x47dfff[_0x8845('0x30')]['fields']));_0xd1f69e['attributes']=_0xd1f69e[_0x8845('0x33')]['length']?_0xd1f69e[_0x8845('0x33')]:_0x26cae2[_0x8845('0x2f')];if(!_0x47dfff[_0x8845('0x30')]['hasOwnProperty'](_0x8845('0x35'))){_0xd1f69e[_0x8845('0x1d')]=qs[_0x8845('0x1d')](_0x47dfff['query'][_0x8845('0x1d')]);_0xd1f69e['offset']=qs[_0x8845('0x20')](_0x47dfff[_0x8845('0x30')][_0x8845('0x20')]);}_0xd1f69e[_0x8845('0x36')]=qs[_0x8845('0x37')](_0x47dfff[_0x8845('0x30')][_0x8845('0x37')]);_0xd1f69e[_0x8845('0x38')]=qs['filters'](_[_0x8845('0x39')](_0x47dfff['query'],_0x26cae2[_0x8845('0x32')]),_0x26dd9e);if(_0x47dfff['query'][_0x8845('0x3a')]){_0xd1f69e[_0x8845('0x38')]=_['merge'](_0xd1f69e[_0x8845('0x38')],{'$or':_['map'](_0x26dd9e,function(_0x1c08a3){if(_0x1c08a3[_0x8845('0x3b')]!==_0x8845('0x3c')){var _0x13d360={};_0x13d360[_0x1c08a3[_0x8845('0x29')]]={'$like':'%'+_0x47dfff[_0x8845('0x30')][_0x8845('0x3a')]+'%'};return _0x13d360;}})});}_0xd1f69e=_[_0x8845('0x3d')]({},_0xd1f69e,_0x47dfff[_0x8845('0x3e')]);var _0x1b967b={'where':_0xd1f69e['where']};return db[_0x8845('0x2c')]['count'](_0x1b967b)[_0x8845('0x25')](function(_0x39cfb6){_0x3cc594['count']=_0x39cfb6;if(_0x47dfff[_0x8845('0x30')][_0x8845('0x3f')]){_0xd1f69e[_0x8845('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x8845('0x41')](_0xd1f69e);})['then'](function(_0x4d3a05){_0x3cc594[_0x8845('0x42')]=_0x4d3a05;return _0x3cc594;})[_0x8845('0x25')](respondWithFilteredResult(_0x3a831f,_0xd1f69e))[_0x8845('0x43')](handleError(_0x3a831f,null));};exports[_0x8845('0x44')]=function(_0x17bff3,_0x3c19c0){var _0x5002c4={'raw':!![],'where':{'id':_0x17bff3[_0x8845('0x45')]['id']}},_0x4f576a={};_0x4f576a[_0x8845('0x2f')]=_[_0x8845('0x31')](db[_0x8845('0x2c')][_0x8845('0x46')]);_0x4f576a[_0x8845('0x30')]=_[_0x8845('0x31')](_0x17bff3[_0x8845('0x30')]);_0x4f576a['filters']=_[_0x8845('0x47')](_0x4f576a[_0x8845('0x2f')],_0x4f576a[_0x8845('0x30')]);_0x5002c4['attributes']=_[_0x8845('0x47')](_0x4f576a[_0x8845('0x2f')],qs[_0x8845('0x34')](_0x17bff3[_0x8845('0x30')][_0x8845('0x34')]));_0x5002c4[_0x8845('0x33')]=_0x5002c4['attributes']['length']?_0x5002c4[_0x8845('0x33')]:_0x4f576a[_0x8845('0x2f')];if(_0x17bff3['query'][_0x8845('0x3f')]){_0x5002c4[_0x8845('0x40')]=[{'all':!![]}];}_0x5002c4=_[_0x8845('0x3d')]({},_0x5002c4,_0x17bff3['options']);return db[_0x8845('0x2c')]['find'](_0x5002c4)['then'](handleEntityNotFound(_0x3c19c0,null))[_0x8845('0x25')](respondWithResult(_0x3c19c0,null))[_0x8845('0x43')](handleError(_0x3c19c0,null));};exports[_0x8845('0x48')]=function(_0x45c22e,_0x2d4ca6){return db[_0x8845('0x2c')]['create'](_0x45c22e[_0x8845('0x49')],{})['then'](respondWithResult(_0x2d4ca6,0xc9))[_0x8845('0x43')](handleError(_0x2d4ca6,null));};exports[_0x8845('0x24')]=function(_0x3bd655,_0x3dbe0a){if(_0x3bd655['body']['id']){delete _0x3bd655[_0x8845('0x49')]['id'];}return db[_0x8845('0x2c')][_0x8845('0x4a')]({'where':{'id':_0x3bd655[_0x8845('0x45')]['id']}})[_0x8845('0x25')](handleEntityNotFound(_0x3dbe0a,null))[_0x8845('0x25')](saveUpdates(_0x3bd655[_0x8845('0x49')],null))['then'](respondWithResult(_0x3dbe0a,null))[_0x8845('0x43')](handleError(_0x3dbe0a,null));};exports[_0x8845('0x26')]=function(_0x2e9ce6,_0x176356){return db[_0x8845('0x2c')]['find']({'where':{'id':_0x2e9ce6[_0x8845('0x45')]['id']}})[_0x8845('0x25')](handleEntityNotFound(_0x176356,null))[_0x8845('0x25')](removeEntity(_0x176356,null))['catch'](handleError(_0x176356,null));};exports[_0x8845('0x4b')]=function(_0x2f8f9e,_0x81f01a){return db[_0x8845('0x2c')][_0x8845('0x4b')]()[_0x8845('0x25')](respondWithResult(_0x81f01a,null))['catch'](handleError(_0x81f01a,null));};
\ No newline at end of file
+var _0xaf11=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf11,0x12f));var _0x1af1=function(_0x5825bf,_0x106229){_0x5825bf=_0x5825bf-0x0;var _0x5e842f=_0xaf11[_0x5825bf];return _0x5e842f;};'use strict';var emlformat=require(_0x1af1('0x0'));var rimraf=require(_0x1af1('0x1'));var zipdir=require(_0x1af1('0x2'));var jsonpatch=require(_0x1af1('0x3'));var rp=require('request-promise');var moment=require(_0x1af1('0x4'));var BPromise=require(_0x1af1('0x5'));var Mustache=require(_0x1af1('0x6'));var util=require('util');var path=require(_0x1af1('0x7'));var sox=require(_0x1af1('0x8'));var csv=require(_0x1af1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1af1('0xa'));var _=require('lodash');var squel=require(_0x1af1('0xb'));var crypto=require(_0x1af1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1af1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1af1('0xe'));var Redis=require(_0x1af1('0xf'));var authService=require(_0x1af1('0x10'));var qs=require(_0x1af1('0x11'));var as=require(_0x1af1('0x12'));var hardwareService=require(_0x1af1('0x13'));var logger=require('../../config/logger')(_0x1af1('0x14'));var utils=require(_0x1af1('0x15'));var config=require(_0x1af1('0x16'));var licenseUtil=require(_0x1af1('0x17'));var db=require(_0x1af1('0x18'))['db'];function respondWithStatusCode(_0x20141a,_0x339763){_0x339763=_0x339763||0xcc;return function(_0x5e4634){if(_0x5e4634){return _0x20141a[_0x1af1('0x19')](_0x339763);}return _0x20141a[_0x1af1('0x1a')](_0x339763)[_0x1af1('0x1b')]();};}function respondWithResult(_0x2fe8d4,_0x4e92d5){_0x4e92d5=_0x4e92d5||0xc8;return function(_0x19f4e3){if(_0x19f4e3){return _0x2fe8d4[_0x1af1('0x1a')](_0x4e92d5)[_0x1af1('0x1c')](_0x19f4e3);}};}function respondWithFilteredResult(_0x5d842d,_0x1e756b){return function(_0x41b905){if(_0x41b905){var _0x38df6f=typeof _0x1e756b[_0x1af1('0x1d')]===_0x1af1('0x1e')&&typeof _0x1e756b[_0x1af1('0x1f')]===_0x1af1('0x1e');var _0x45dd76=_0x41b905[_0x1af1('0x20')];var _0x20c17b=_0x38df6f?0x0:_0x1e756b['offset'];var _0x4da591=_0x38df6f?_0x41b905['count']:_0x1e756b[_0x1af1('0x1d')]+_0x1e756b['limit'];var _0xf1c8ae;if(_0x4da591>=_0x45dd76){_0x4da591=_0x45dd76;_0xf1c8ae=0xc8;}else{_0xf1c8ae=0xce;}_0x5d842d[_0x1af1('0x1a')](_0xf1c8ae);return _0x5d842d[_0x1af1('0x21')](_0x1af1('0x22'),_0x20c17b+'-'+_0x4da591+'/'+_0x45dd76)[_0x1af1('0x1c')](_0x41b905);}return null;};}function patchUpdates(_0x5d336){return function(_0x4af71a){try{jsonpatch[_0x1af1('0x23')](_0x4af71a,_0x5d336,!![]);}catch(_0x2ef81a){return BPromise[_0x1af1('0x24')](_0x2ef81a);}return _0x4af71a['save']();};}function saveUpdates(_0x3d1ed1,_0xca2e20){return function(_0x535a8e){if(_0x535a8e){return _0x535a8e[_0x1af1('0x25')](_0x3d1ed1)[_0x1af1('0x26')](function(_0x187dd4){return _0x187dd4;});}return null;};}function removeEntity(_0x51c213,_0x8952cf){return function(_0x4003db){if(_0x4003db){return _0x4003db['destroy']()['then'](function(){_0x51c213['status'](0xcc)[_0x1af1('0x1b')]();});}};}function handleEntityNotFound(_0x5df091,_0x50c0e0){return function(_0x21c60c){if(!_0x21c60c){_0x5df091[_0x1af1('0x19')](0x194);}return _0x21c60c;};}function handleError(_0x3d19e7,_0xbd139d){_0xbd139d=_0xbd139d||0x1f4;return function(_0x6222f1){logger['error'](_0x6222f1[_0x1af1('0x27')]);if(_0x6222f1[_0x1af1('0x28')]){delete _0x6222f1[_0x1af1('0x28')];}_0x3d19e7[_0x1af1('0x1a')](_0xbd139d)[_0x1af1('0x29')](_0x6222f1);};}exports[_0x1af1('0x2a')]=function(_0x4b655b,_0x40e32f){var _0x50438e={},_0x40630d={},_0x440da4={'count':0x0,'rows':[]};var _0x526aba=_['map'](db[_0x1af1('0x2b')][_0x1af1('0x2c')],function(_0x2c1494){return{'name':_0x2c1494[_0x1af1('0x2d')],'type':_0x2c1494['type'][_0x1af1('0x2e')]};});_0x40630d[_0x1af1('0x2f')]=_['map'](_0x526aba,_0x1af1('0x28'));_0x40630d['query']=_[_0x1af1('0x30')](_0x4b655b[_0x1af1('0x31')]);_0x40630d[_0x1af1('0x32')]=_[_0x1af1('0x33')](_0x40630d['model'],_0x40630d[_0x1af1('0x31')]);_0x50438e[_0x1af1('0x34')]=_[_0x1af1('0x33')](_0x40630d['model'],qs['fields'](_0x4b655b[_0x1af1('0x31')]['fields']));_0x50438e[_0x1af1('0x34')]=_0x50438e[_0x1af1('0x34')]['length']?_0x50438e['attributes']:_0x40630d[_0x1af1('0x2f')];if(!_0x4b655b['query'][_0x1af1('0x35')](_0x1af1('0x36'))){_0x50438e[_0x1af1('0x1f')]=qs[_0x1af1('0x1f')](_0x4b655b['query'][_0x1af1('0x1f')]);_0x50438e['offset']=qs[_0x1af1('0x1d')](_0x4b655b['query'][_0x1af1('0x1d')]);}_0x50438e[_0x1af1('0x37')]=qs[_0x1af1('0x38')](_0x4b655b[_0x1af1('0x31')]['sort']);_0x50438e[_0x1af1('0x39')]=qs[_0x1af1('0x32')](_[_0x1af1('0x3a')](_0x4b655b[_0x1af1('0x31')],_0x40630d[_0x1af1('0x32')]),_0x526aba);if(_0x4b655b[_0x1af1('0x31')]['filter']){_0x50438e[_0x1af1('0x39')]=_[_0x1af1('0x3b')](_0x50438e['where'],{'$or':_[_0x1af1('0x3c')](_0x526aba,function(_0x53ef03){if(_0x53ef03[_0x1af1('0x3d')]!==_0x1af1('0x3e')){var _0x4569f5={};_0x4569f5[_0x53ef03[_0x1af1('0x28')]]={'$like':'%'+_0x4b655b[_0x1af1('0x31')]['filter']+'%'};return _0x4569f5;}})});}_0x50438e=_['merge']({},_0x50438e,_0x4b655b[_0x1af1('0x3f')]);var _0x36ab51={'where':_0x50438e[_0x1af1('0x39')]};return db[_0x1af1('0x2b')][_0x1af1('0x20')](_0x36ab51)['then'](function(_0x4683d5){_0x440da4['count']=_0x4683d5;if(_0x4b655b[_0x1af1('0x31')][_0x1af1('0x40')]){_0x50438e[_0x1af1('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x1af1('0x42')](_0x50438e);})[_0x1af1('0x26')](function(_0x13331d){_0x440da4[_0x1af1('0x43')]=_0x13331d;return _0x440da4;})[_0x1af1('0x26')](respondWithFilteredResult(_0x40e32f,_0x50438e))['catch'](handleError(_0x40e32f,null));};exports[_0x1af1('0x44')]=function(_0x115e96,_0x501056){var _0x4ca014={'raw':!![],'where':{'id':_0x115e96['params']['id']}},_0x4c6d0b={};_0x4c6d0b[_0x1af1('0x2f')]=_[_0x1af1('0x30')](db[_0x1af1('0x2b')]['rawAttributes']);_0x4c6d0b[_0x1af1('0x31')]=_[_0x1af1('0x30')](_0x115e96[_0x1af1('0x31')]);_0x4c6d0b[_0x1af1('0x32')]=_[_0x1af1('0x33')](_0x4c6d0b[_0x1af1('0x2f')],_0x4c6d0b['query']);_0x4ca014[_0x1af1('0x34')]=_[_0x1af1('0x33')](_0x4c6d0b[_0x1af1('0x2f')],qs[_0x1af1('0x45')](_0x115e96['query'][_0x1af1('0x45')]));_0x4ca014[_0x1af1('0x34')]=_0x4ca014['attributes']['length']?_0x4ca014[_0x1af1('0x34')]:_0x4c6d0b[_0x1af1('0x2f')];if(_0x115e96['query'][_0x1af1('0x40')]){_0x4ca014[_0x1af1('0x41')]=[{'all':!![]}];}_0x4ca014=_['merge']({},_0x4ca014,_0x115e96[_0x1af1('0x3f')]);return db['ChatQueueReport'][_0x1af1('0x46')](_0x4ca014)['then'](handleEntityNotFound(_0x501056,null))[_0x1af1('0x26')](respondWithResult(_0x501056,null))[_0x1af1('0x47')](handleError(_0x501056,null));};exports['create']=function(_0xabb1c6,_0x1587da){return db[_0x1af1('0x2b')][_0x1af1('0x48')](_0xabb1c6[_0x1af1('0x49')],{})['then'](respondWithResult(_0x1587da,0xc9))[_0x1af1('0x47')](handleError(_0x1587da,null));};exports['update']=function(_0x46e41d,_0x3856be){if(_0x46e41d['body']['id']){delete _0x46e41d[_0x1af1('0x49')]['id'];}return db[_0x1af1('0x2b')][_0x1af1('0x46')]({'where':{'id':_0x46e41d['params']['id']}})[_0x1af1('0x26')](handleEntityNotFound(_0x3856be,null))[_0x1af1('0x26')](saveUpdates(_0x46e41d[_0x1af1('0x49')],null))['then'](respondWithResult(_0x3856be,null))[_0x1af1('0x47')](handleError(_0x3856be,null));};exports[_0x1af1('0x4a')]=function(_0x59b710,_0x27a5d8){return db[_0x1af1('0x2b')][_0x1af1('0x46')]({'where':{'id':_0x59b710['params']['id']}})[_0x1af1('0x26')](handleEntityNotFound(_0x27a5d8,null))[_0x1af1('0x26')](removeEntity(_0x27a5d8,null))[_0x1af1('0x47')](handleError(_0x27a5d8,null));};exports['describe']=function(_0x5b06a5,_0x452d44){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x452d44,null))[_0x1af1('0x47')](handleError(_0x452d44,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 77cf8de..5d4d423 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x237cec,_0x15476b){var _0x553476=function(_0x532733){while(--_0x532733){_0x237cec['push'](_0x237cec['shift']());}};_0x553476(++_0x15476b);}(_0x757a,0xde));var _0xa757=function(_0x4eaaaa,_0x28e660){_0x4eaaaa=_0x4eaaaa-0x0;var _0x46d9d9=_0x757a[_0x4eaaaa];return _0x46d9d9;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c483d91..bf0a32d 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 _0x1a58=['UpdateChatQueueReport','update','where','attributes','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport'];(function(_0xa37959,_0x1759fe){var _0x17c997=function(_0x3a5019){while(--_0x3a5019){_0xa37959['push'](_0xa37959['shift']());}};_0x17c997(++_0x1759fe);}(_0x1a58,0x1b6));var _0x81a5=function(_0x22c15a,_0x2d6084){_0x22c15a=_0x22c15a-0x0;var _0x1071ca=_0x1a58[_0x22c15a];return _0x1071ca;};'use strict';var _=require(_0x81a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81a5('0x1'));var fs=require('fs');var Redis=require(_0x81a5('0x2'));var db=require(_0x81a5('0x3'))['db'];var utils=require(_0x81a5('0x4'));var logger=require(_0x81a5('0x5'))(_0x81a5('0x6'));var config=require(_0x81a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x81a5('0x8')][_0x81a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x882e6d,_0x230901,_0x2eefaf){return new BPromise(function(_0x5b6070,_0x2dafee){return client[_0x81a5('0xa')](_0x882e6d,_0x2eefaf)[_0x81a5('0xb')](function(_0x222675){logger[_0x81a5('0xc')](_0x81a5('0xd'),_0x230901,_0x81a5('0xe'));logger[_0x81a5('0xf')](_0x81a5('0x10'),_0x230901,_0x81a5('0xe'),JSON[_0x81a5('0x11')](_0x222675));if(_0x222675[_0x81a5('0x12')]){if(_0x222675[_0x81a5('0x12')][_0x81a5('0x13')]===0x1f4){logger[_0x81a5('0x12')](_0x81a5('0xd'),_0x230901,_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);return _0x2dafee(_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);}logger['error'](_0x81a5('0xd'),_0x230901,_0x222675[_0x81a5('0x12')]['message']);return _0x5b6070(_0x222675[_0x81a5('0x12')][_0x81a5('0x14')]);}else{logger[_0x81a5('0xc')](_0x81a5('0xd'),_0x230901,_0x81a5('0xe'));_0x5b6070(_0x222675['result']['message']);}})[_0x81a5('0x15')](function(_0x150d74){logger[_0x81a5('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x230901,_0x150d74);_0x2dafee(_0x150d74);});});}exports['CreateChatQueueReport']=function(_0x2c4cff){var _0x5ae466=this;return new Promise(function(_0x3fefc5,_0x21f32b){return db[_0x81a5('0x16')][_0x81a5('0x17')](_0x2c4cff['body'],{'raw':_0x2c4cff[_0x81a5('0x18')]?_0x2c4cff['options'][_0x81a5('0x19')]===undefined?!![]:![]:!![]})[_0x81a5('0xb')](function(_0x15093a){logger[_0x81a5('0xc')](_0x81a5('0x1a'),_0x2c4cff);logger[_0x81a5('0xf')](_0x81a5('0x1a'),_0x2c4cff,JSON['stringify'](_0x15093a));_0x3fefc5(_0x15093a);})[_0x81a5('0x15')](function(_0x33ff5c){logger[_0x81a5('0x12')]('CreateChatQueueReport',_0x33ff5c['message'],_0x2c4cff);_0x21f32b(_0x5ae466['error'](0x1f4,_0x33ff5c[_0x81a5('0x14')]));});});};exports[_0x81a5('0x1b')]=function(_0x46a3bc){var _0x25c55c=this;return new Promise(function(_0x3107fa,_0x2b3267){return db[_0x81a5('0x16')][_0x81a5('0x1c')](_0x46a3bc['body'],{'raw':_0x46a3bc['options']?_0x46a3bc[_0x81a5('0x18')][_0x81a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46a3bc[_0x81a5('0x18')]?_0x46a3bc['options'][_0x81a5('0x1d')]||null:null,'attributes':_0x46a3bc[_0x81a5('0x18')]?_0x46a3bc[_0x81a5('0x18')][_0x81a5('0x1e')]||null:null,'limit':_0x46a3bc['options']?_0x46a3bc[_0x81a5('0x18')]['limit']||null:null})['then'](function(_0x24aeec){logger[_0x81a5('0xc')](_0x81a5('0x1b'),_0x46a3bc);logger[_0x81a5('0xf')](_0x81a5('0x1b'),_0x46a3bc,JSON['stringify'](_0x24aeec));_0x3107fa(_0x24aeec);})[_0x81a5('0x15')](function(_0x17dda2){logger['error'](_0x81a5('0x1b'),_0x17dda2[_0x81a5('0x14')],_0x46a3bc);_0x2b3267(_0x25c55c[_0x81a5('0x12')](0x1f4,_0x17dda2['message']));});});};
\ No newline at end of file
+var _0x315e=['info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x315e,0x1dd));var _0xe315=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x315e[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xe315('0x0'));var util=require(_0xe315('0x1'));var moment=require(_0xe315('0x2'));var BPromise=require('bluebird');var rs=require(_0xe315('0x3'));var fs=require('fs');var Redis=require(_0xe315('0x4'));var db=require(_0xe315('0x5'))['db'];var utils=require(_0xe315('0x6'));var logger=require(_0xe315('0x7'))(_0xe315('0x8'));var config=require(_0xe315('0x9'));var jayson=require(_0xe315('0xa'));var client=jayson['client'][_0xe315('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x137531,_0x3b920a,_0x19332e){return new BPromise(function(_0x3fd83b,_0x59b2bf){return client['request'](_0x137531,_0x19332e)[_0xe315('0xc')](function(_0xdcfc4f){logger[_0xe315('0xd')](_0xe315('0xe'),_0x3b920a,_0xe315('0xf'));logger['debug'](_0xe315('0x10'),_0x3b920a,_0xe315('0xf'),JSON[_0xe315('0x11')](_0xdcfc4f));if(_0xdcfc4f[_0xe315('0x12')]){if(_0xdcfc4f['error'][_0xe315('0x13')]===0x1f4){logger[_0xe315('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3b920a,_0xdcfc4f['error'][_0xe315('0x14')]);return _0x59b2bf(_0xdcfc4f[_0xe315('0x12')]['message']);}logger[_0xe315('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3b920a,_0xdcfc4f[_0xe315('0x12')][_0xe315('0x14')]);return _0x3fd83b(_0xdcfc4f[_0xe315('0x12')]['message']);}else{logger[_0xe315('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3b920a,_0xe315('0xf'));_0x3fd83b(_0xdcfc4f[_0xe315('0x15')]['message']);}})[_0xe315('0x16')](function(_0x22e06e){logger[_0xe315('0x12')](_0xe315('0xe'),_0x3b920a,_0x22e06e);_0x59b2bf(_0x22e06e);});});}exports[_0xe315('0x17')]=function(_0x112821){var _0x2e5e24=this;return new Promise(function(_0x10e106,_0x49f764){return db[_0xe315('0x18')][_0xe315('0x19')](_0x112821[_0xe315('0x1a')],{'raw':_0x112821[_0xe315('0x1b')]?_0x112821[_0xe315('0x1b')][_0xe315('0x1c')]===undefined?!![]:![]:!![]})[_0xe315('0xc')](function(_0x566672){logger[_0xe315('0xd')](_0xe315('0x17'),_0x112821);logger[_0xe315('0x1d')]('CreateChatQueueReport',_0x112821,JSON['stringify'](_0x566672));_0x10e106(_0x566672);})[_0xe315('0x16')](function(_0x249386){logger['error'](_0xe315('0x17'),_0x249386[_0xe315('0x14')],_0x112821);_0x49f764(_0x2e5e24[_0xe315('0x12')](0x1f4,_0x249386[_0xe315('0x14')]));});});};exports[_0xe315('0x1e')]=function(_0x151940){var _0x426296=this;return new Promise(function(_0x10ac47,_0x959f7d){return db[_0xe315('0x18')][_0xe315('0x1f')](_0x151940[_0xe315('0x1a')],{'raw':_0x151940['options']?_0x151940['options'][_0xe315('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x151940[_0xe315('0x1b')]?_0x151940[_0xe315('0x1b')][_0xe315('0x20')]||null:null,'attributes':_0x151940[_0xe315('0x1b')]?_0x151940['options'][_0xe315('0x21')]||null:null,'limit':_0x151940[_0xe315('0x1b')]?_0x151940[_0xe315('0x1b')][_0xe315('0x22')]||null:null})[_0xe315('0xc')](function(_0x29571d){logger[_0xe315('0xd')](_0xe315('0x1e'),_0x151940);logger[_0xe315('0x1d')](_0xe315('0x1e'),_0x151940,JSON[_0xe315('0x11')](_0x29571d));_0x10ac47(_0x29571d);})['catch'](function(_0x5e4a9f){logger[_0xe315('0x12')]('UpdateChatQueueReport',_0x5e4a9f[_0xe315('0x14')],_0x151940);_0x959f7d(_0x426296[_0xe315('0x12')](0x1f4,_0x5e4a9f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 3327675..5db3d93 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 _0x8551=['put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0xa5fdf4,_0x553bc8){var _0x45a73d=function(_0x3d6276){while(--_0x3d6276){_0xa5fdf4['push'](_0xa5fdf4['shift']());}};_0x45a73d(++_0x553bc8);}(_0x8551,0x159));var _0x1855=function(_0xd24b43,_0x11caa4){_0xd24b43=_0xd24b43-0x0;var _0x2b1b44=_0x8551[_0xd24b43];return _0x2b1b44;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1855('0x0'));var express=require(_0x1855('0x1'));var router=express[_0x1855('0x2')]();var fs_extra=require(_0x1855('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1855('0x4'));var config=require('../../config/environment');var controller=require(_0x1855('0x5'));router[_0x1855('0x6')]('/',auth['isAuthenticated'](),controller[_0x1855('0x7')]);router[_0x1855('0x6')](_0x1855('0x8'),auth[_0x1855('0x9')](),controller[_0x1855('0xa')]);router['get'](_0x1855('0xb'),auth[_0x1855('0x9')](),controller[_0x1855('0xc')]);router[_0x1855('0xd')]('/',auth[_0x1855('0x9')](),controller[_0x1855('0xe')]);router[_0x1855('0xf')](_0x1855('0xb'),auth[_0x1855('0x9')](),controller[_0x1855('0x10')]);router[_0x1855('0x11')](_0x1855('0xb'),auth[_0x1855('0x9')](),controller[_0x1855('0x12')]);module[_0x1855('0x13')]=router;
\ No newline at end of file
+var _0xb95e=['update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x306698,_0x20c637){var _0x4bcae4=function(_0x367a31){while(--_0x367a31){_0x306698['push'](_0x306698['shift']());}};_0x4bcae4(++_0x20c637);}(_0xb95e,0xf5));var _0xeb95=function(_0x39a70a,_0xb0a23c){_0x39a70a=_0x39a70a-0x0;var _0x356be6=_0xb95e[_0x39a70a];return _0x356be6;};'use strict';var multer=require(_0xeb95('0x0'));var util=require(_0xeb95('0x1'));var path=require(_0xeb95('0x2'));var timeout=require(_0xeb95('0x3'));var express=require('express');var router=express[_0xeb95('0x4')]();var fs_extra=require(_0xeb95('0x5'));var auth=require(_0xeb95('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb95('0x7'));var controller=require(_0xeb95('0x8'));router['get']('/',auth[_0xeb95('0x9')](),controller[_0xeb95('0xa')]);router[_0xeb95('0xb')](_0xeb95('0xc'),auth[_0xeb95('0x9')](),controller[_0xeb95('0xd')]);router[_0xeb95('0xb')](_0xeb95('0xe'),auth[_0xeb95('0x9')](),controller[_0xeb95('0xf')]);router[_0xeb95('0x10')]('/',auth[_0xeb95('0x9')](),controller[_0xeb95('0x11')]);router[_0xeb95('0x12')]('/:id',auth[_0xeb95('0x9')](),controller[_0xeb95('0x13')]);router[_0xeb95('0x14')](_0xeb95('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb95('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index f2eb892..8cd8b4b 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3e1768,_0x2e9066){var _0x489604=function(_0x388f87){while(--_0x388f87){_0x3e1768['push'](_0x3e1768['shift']());}};_0x489604(++_0x2e9066);}(_0x70e0,0x17b));var _0x070e=function(_0x8635cc,_0x1bee82){_0x8635cc=_0x8635cc-0x0;var _0x27600a=_0x70e0[_0x8635cc];return _0x27600a;};'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
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x34e8,0x12c));var _0x834e=function(_0x55567c,_0x393abe){_0x55567c=_0x55567c-0x0;var _0x259f31=_0x34e8[_0x55567c];return _0x259f31;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index d831648..d5612e0 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 _0x1d63=['rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','ChatTransferReport','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d63,0x13c));var _0x31d6=function(_0x4744f4,_0x515ab0){_0x4744f4=_0x4744f4-0x0;var _0x2c4640=_0x1d63[_0x4744f4];return _0x2c4640;};'use strict';var emlformat=require(_0x31d6('0x0'));var rimraf=require(_0x31d6('0x1'));var zipdir=require(_0x31d6('0x2'));var jsonpatch=require(_0x31d6('0x3'));var rp=require(_0x31d6('0x4'));var moment=require(_0x31d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31d6('0x6'));var util=require(_0x31d6('0x7'));var path=require(_0x31d6('0x8'));var sox=require('sox');var csv=require(_0x31d6('0x9'));var ejs=require(_0x31d6('0xa'));var fs=require('fs');var fs_extra=require(_0x31d6('0xb'));var _=require(_0x31d6('0xc'));var squel=require(_0x31d6('0xd'));var crypto=require(_0x31d6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x31d6('0xf'));var toCsv=require(_0x31d6('0x9'));var querystring=require(_0x31d6('0x10'));var Papa=require(_0x31d6('0x11'));var Redis=require(_0x31d6('0x12'));var authService=require(_0x31d6('0x13'));var qs=require(_0x31d6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d6('0x15'));var logger=require('../../config/logger')(_0x31d6('0x16'));var utils=require(_0x31d6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x31d6('0x18'));var db=require(_0x31d6('0x19'))['db'];function respondWithStatusCode(_0x4526c1,_0x4bd034){_0x4bd034=_0x4bd034||0xcc;return function(_0x2b6181){if(_0x2b6181){return _0x4526c1['sendStatus'](_0x4bd034);}return _0x4526c1[_0x31d6('0x1a')](_0x4bd034)[_0x31d6('0x1b')]();};}function respondWithResult(_0x5336a5,_0x5e11fd){_0x5e11fd=_0x5e11fd||0xc8;return function(_0x53fc0d){if(_0x53fc0d){return _0x5336a5[_0x31d6('0x1a')](_0x5e11fd)[_0x31d6('0x1c')](_0x53fc0d);}};}function respondWithFilteredResult(_0x3b5160,_0x565f0f){return function(_0x2c97c9){if(_0x2c97c9){var _0x291685=typeof _0x565f0f[_0x31d6('0x1d')]===_0x31d6('0x1e')&&typeof _0x565f0f['limit']===_0x31d6('0x1e');var _0x394692=_0x2c97c9[_0x31d6('0x1f')];var _0x1b1b77=_0x291685?0x0:_0x565f0f[_0x31d6('0x1d')];var _0x3a4857=_0x291685?_0x2c97c9[_0x31d6('0x1f')]:_0x565f0f[_0x31d6('0x1d')]+_0x565f0f[_0x31d6('0x20')];var _0x6122fd;if(_0x3a4857>=_0x394692){_0x3a4857=_0x394692;_0x6122fd=0xc8;}else{_0x6122fd=0xce;}_0x3b5160[_0x31d6('0x1a')](_0x6122fd);return _0x3b5160[_0x31d6('0x21')](_0x31d6('0x22'),_0x1b1b77+'-'+_0x3a4857+'/'+_0x394692)['json'](_0x2c97c9);}return null;};}function patchUpdates(_0x46ab30){return function(_0x5e5705){try{jsonpatch[_0x31d6('0x23')](_0x5e5705,_0x46ab30,!![]);}catch(_0x25a64c){return BPromise[_0x31d6('0x24')](_0x25a64c);}return _0x5e5705[_0x31d6('0x25')]();};}function saveUpdates(_0x33cf6c,_0x3e8415){return function(_0x473746){if(_0x473746){return _0x473746[_0x31d6('0x26')](_0x33cf6c)['then'](function(_0x56e3bc){return _0x56e3bc;});}return null;};}function removeEntity(_0x5e3120,_0x5a78e8){return function(_0x1091d2){if(_0x1091d2){return _0x1091d2[_0x31d6('0x27')]()[_0x31d6('0x28')](function(){_0x5e3120[_0x31d6('0x1a')](0xcc)[_0x31d6('0x1b')]();});}};}function handleEntityNotFound(_0xb62601,_0x3052ef){return function(_0x210162){if(!_0x210162){_0xb62601[_0x31d6('0x29')](0x194);}return _0x210162;};}function handleError(_0x18a8bb,_0x2a04b0){_0x2a04b0=_0x2a04b0||0x1f4;return function(_0x2d7c12){logger[_0x31d6('0x2a')](_0x2d7c12[_0x31d6('0x2b')]);if(_0x2d7c12[_0x31d6('0x2c')]){delete _0x2d7c12[_0x31d6('0x2c')];}_0x18a8bb[_0x31d6('0x1a')](_0x2a04b0)['send'](_0x2d7c12);};}exports['index']=function(_0x481b34,_0x17bc47){var _0x162ad8={},_0x4ed85a={},_0x2c8316={'count':0x0,'rows':[]};var _0xe70926=_[_0x31d6('0x2d')](db['ChatTransferReport'][_0x31d6('0x2e')],function(_0x37581c){return{'name':_0x37581c[_0x31d6('0x2f')],'type':_0x37581c[_0x31d6('0x30')]['key']};});_0x4ed85a['model']=_['map'](_0xe70926,_0x31d6('0x2c'));_0x4ed85a[_0x31d6('0x31')]=_[_0x31d6('0x32')](_0x481b34['query']);_0x4ed85a[_0x31d6('0x33')]=_[_0x31d6('0x34')](_0x4ed85a[_0x31d6('0x35')],_0x4ed85a[_0x31d6('0x31')]);_0x162ad8['attributes']=_[_0x31d6('0x34')](_0x4ed85a[_0x31d6('0x35')],qs[_0x31d6('0x36')](_0x481b34[_0x31d6('0x31')][_0x31d6('0x36')]));_0x162ad8[_0x31d6('0x37')]=_0x162ad8['attributes'][_0x31d6('0x38')]?_0x162ad8[_0x31d6('0x37')]:_0x4ed85a[_0x31d6('0x35')];if(!_0x481b34[_0x31d6('0x31')][_0x31d6('0x39')](_0x31d6('0x3a'))){_0x162ad8[_0x31d6('0x20')]=qs['limit'](_0x481b34[_0x31d6('0x31')]['limit']);_0x162ad8[_0x31d6('0x1d')]=qs[_0x31d6('0x1d')](_0x481b34[_0x31d6('0x31')]['offset']);}_0x162ad8[_0x31d6('0x3b')]=qs[_0x31d6('0x3c')](_0x481b34['query'][_0x31d6('0x3c')]);_0x162ad8[_0x31d6('0x3d')]=qs[_0x31d6('0x33')](_['pick'](_0x481b34['query'],_0x4ed85a[_0x31d6('0x33')]),_0xe70926);if(_0x481b34[_0x31d6('0x31')]['filter']){_0x162ad8[_0x31d6('0x3d')]=_[_0x31d6('0x3e')](_0x162ad8[_0x31d6('0x3d')],{'$or':_[_0x31d6('0x2d')](_0xe70926,function(_0x3ab4e6){if(_0x3ab4e6[_0x31d6('0x30')]!==_0x31d6('0x3f')){var _0x20d3e8={};_0x20d3e8[_0x3ab4e6[_0x31d6('0x2c')]]={'$like':'%'+_0x481b34['query'][_0x31d6('0x40')]+'%'};return _0x20d3e8;}})});}_0x162ad8=_[_0x31d6('0x3e')]({},_0x162ad8,_0x481b34[_0x31d6('0x41')]);var _0x3399f3={'where':_0x162ad8[_0x31d6('0x3d')]};return db[_0x31d6('0x42')]['count'](_0x3399f3)[_0x31d6('0x28')](function(_0x172be9){_0x2c8316['count']=_0x172be9;if(_0x481b34['query'][_0x31d6('0x43')]){_0x162ad8[_0x31d6('0x44')]=[{'all':!![]}];}return db[_0x31d6('0x42')]['findAll'](_0x162ad8);})[_0x31d6('0x28')](function(_0x4329dd){_0x2c8316[_0x31d6('0x45')]=_0x4329dd;return _0x2c8316;})[_0x31d6('0x28')](respondWithFilteredResult(_0x17bc47,_0x162ad8))[_0x31d6('0x46')](handleError(_0x17bc47,null));};exports[_0x31d6('0x47')]=function(_0x3b8379,_0x173c82){var _0x5653b7={'raw':!![],'where':{'id':_0x3b8379[_0x31d6('0x48')]['id']}},_0x2b4055={};_0x2b4055[_0x31d6('0x35')]=_[_0x31d6('0x32')](db[_0x31d6('0x42')][_0x31d6('0x2e')]);_0x2b4055[_0x31d6('0x31')]=_[_0x31d6('0x32')](_0x3b8379[_0x31d6('0x31')]);_0x2b4055['filters']=_[_0x31d6('0x34')](_0x2b4055['model'],_0x2b4055[_0x31d6('0x31')]);_0x5653b7[_0x31d6('0x37')]=_[_0x31d6('0x34')](_0x2b4055[_0x31d6('0x35')],qs[_0x31d6('0x36')](_0x3b8379['query'][_0x31d6('0x36')]));_0x5653b7['attributes']=_0x5653b7[_0x31d6('0x37')][_0x31d6('0x38')]?_0x5653b7[_0x31d6('0x37')]:_0x2b4055[_0x31d6('0x35')];if(_0x3b8379['query'][_0x31d6('0x43')]){_0x5653b7['include']=[{'all':!![]}];}_0x5653b7=_[_0x31d6('0x3e')]({},_0x5653b7,_0x3b8379[_0x31d6('0x41')]);return db[_0x31d6('0x42')][_0x31d6('0x49')](_0x5653b7)[_0x31d6('0x28')](handleEntityNotFound(_0x173c82,null))[_0x31d6('0x28')](respondWithResult(_0x173c82,null))['catch'](handleError(_0x173c82,null));};exports['create']=function(_0x491ff1,_0x4844fc){return db['ChatTransferReport'][_0x31d6('0x4a')](_0x491ff1[_0x31d6('0x4b')],{})[_0x31d6('0x28')](respondWithResult(_0x4844fc,0xc9))[_0x31d6('0x46')](handleError(_0x4844fc,null));};exports[_0x31d6('0x26')]=function(_0xbe0dd5,_0x3c2fb0){if(_0xbe0dd5[_0x31d6('0x4b')]['id']){delete _0xbe0dd5[_0x31d6('0x4b')]['id'];}return db['ChatTransferReport'][_0x31d6('0x49')]({'where':{'id':_0xbe0dd5[_0x31d6('0x48')]['id']}})[_0x31d6('0x28')](handleEntityNotFound(_0x3c2fb0,null))[_0x31d6('0x28')](saveUpdates(_0xbe0dd5['body'],null))['then'](respondWithResult(_0x3c2fb0,null))['catch'](handleError(_0x3c2fb0,null));};exports[_0x31d6('0x27')]=function(_0x3fbaa4,_0x14a71f){return db['ChatTransferReport'][_0x31d6('0x49')]({'where':{'id':_0x3fbaa4[_0x31d6('0x48')]['id']}})[_0x31d6('0x28')](handleEntityNotFound(_0x14a71f,null))[_0x31d6('0x28')](removeEntity(_0x14a71f,null))[_0x31d6('0x46')](handleError(_0x14a71f,null));};exports[_0x31d6('0x4c')]=function(_0x4b7b85,_0x41466a){return db['ChatTransferReport'][_0x31d6('0x4c')]()[_0x31d6('0x28')](respondWithResult(_0x41466a,null))[_0x31d6('0x46')](handleError(_0x41466a,null));};
\ No newline at end of file
+var _0xe77e=['set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatTransferReport','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xe77e,0xc4));var _0xee77=function(_0x3bfb60,_0x176e88){_0x3bfb60=_0x3bfb60-0x0;var _0x2a4ef3=_0xe77e[_0x3bfb60];return _0x2a4ef3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee77('0x0'));var zipdir=require(_0xee77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee77('0x2'));var moment=require(_0xee77('0x3'));var BPromise=require(_0xee77('0x4'));var Mustache=require(_0xee77('0x5'));var util=require(_0xee77('0x6'));var path=require(_0xee77('0x7'));var sox=require(_0xee77('0x8'));var csv=require(_0xee77('0x9'));var ejs=require(_0xee77('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xee77('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xee77('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee77('0xd'));var Redis=require(_0xee77('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xee77('0xf'));var as=require(_0xee77('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee77('0x11'))(_0xee77('0x12'));var utils=require(_0xee77('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xee77('0x14'));var db=require(_0xee77('0x15'))['db'];function respondWithStatusCode(_0x4cf31d,_0x375c30){_0x375c30=_0x375c30||0xcc;return function(_0x3bf2b9){if(_0x3bf2b9){return _0x4cf31d[_0xee77('0x16')](_0x375c30);}return _0x4cf31d[_0xee77('0x17')](_0x375c30)['end']();};}function respondWithResult(_0x2cc0cf,_0x240b9a){_0x240b9a=_0x240b9a||0xc8;return function(_0x2373b2){if(_0x2373b2){return _0x2cc0cf[_0xee77('0x17')](_0x240b9a)[_0xee77('0x18')](_0x2373b2);}};}function respondWithFilteredResult(_0x368741,_0x5c6a02){return function(_0x117e06){if(_0x117e06){var _0x384c00=typeof _0x5c6a02[_0xee77('0x19')]===_0xee77('0x1a')&&typeof _0x5c6a02[_0xee77('0x1b')]==='undefined';var _0x253ac3=_0x117e06[_0xee77('0x1c')];var _0x39bbd2=_0x384c00?0x0:_0x5c6a02[_0xee77('0x19')];var _0x10f837=_0x384c00?_0x117e06['count']:_0x5c6a02[_0xee77('0x19')]+_0x5c6a02[_0xee77('0x1b')];var _0x30edfe;if(_0x10f837>=_0x253ac3){_0x10f837=_0x253ac3;_0x30edfe=0xc8;}else{_0x30edfe=0xce;}_0x368741['status'](_0x30edfe);return _0x368741[_0xee77('0x1d')](_0xee77('0x1e'),_0x39bbd2+'-'+_0x10f837+'/'+_0x253ac3)[_0xee77('0x18')](_0x117e06);}return null;};}function patchUpdates(_0x1d4227){return function(_0x1e518f){try{jsonpatch[_0xee77('0x1f')](_0x1e518f,_0x1d4227,!![]);}catch(_0x1ab640){return BPromise[_0xee77('0x20')](_0x1ab640);}return _0x1e518f[_0xee77('0x21')]();};}function saveUpdates(_0x4c45fe,_0x315421){return function(_0xc0ea04){if(_0xc0ea04){return _0xc0ea04[_0xee77('0x22')](_0x4c45fe)[_0xee77('0x23')](function(_0x49f11b){return _0x49f11b;});}return null;};}function removeEntity(_0x5d1faf,_0xa40dad){return function(_0x1ba5f0){if(_0x1ba5f0){return _0x1ba5f0[_0xee77('0x24')]()[_0xee77('0x23')](function(){_0x5d1faf[_0xee77('0x17')](0xcc)[_0xee77('0x25')]();});}};}function handleEntityNotFound(_0x39248b,_0x589a1d){return function(_0x4bf852){if(!_0x4bf852){_0x39248b[_0xee77('0x16')](0x194);}return _0x4bf852;};}function handleError(_0x3a19bf,_0x3321fa){_0x3321fa=_0x3321fa||0x1f4;return function(_0x3e1138){logger[_0xee77('0x26')](_0x3e1138['stack']);if(_0x3e1138[_0xee77('0x27')]){delete _0x3e1138[_0xee77('0x27')];}_0x3a19bf[_0xee77('0x17')](_0x3321fa)['send'](_0x3e1138);};}exports[_0xee77('0x28')]=function(_0x1a8256,_0x737f40){var _0x2ec5d3={},_0x1d04fd={},_0xaa5b68={'count':0x0,'rows':[]};var _0x3974e7=_['map'](db['ChatTransferReport'][_0xee77('0x29')],function(_0x3c1207){return{'name':_0x3c1207[_0xee77('0x2a')],'type':_0x3c1207[_0xee77('0x2b')][_0xee77('0x2c')]};});_0x1d04fd[_0xee77('0x2d')]=_[_0xee77('0x2e')](_0x3974e7,_0xee77('0x27'));_0x1d04fd['query']=_[_0xee77('0x2f')](_0x1a8256['query']);_0x1d04fd[_0xee77('0x30')]=_['intersection'](_0x1d04fd[_0xee77('0x2d')],_0x1d04fd[_0xee77('0x31')]);_0x2ec5d3[_0xee77('0x32')]=_[_0xee77('0x33')](_0x1d04fd[_0xee77('0x2d')],qs[_0xee77('0x34')](_0x1a8256[_0xee77('0x31')]['fields']));_0x2ec5d3['attributes']=_0x2ec5d3['attributes'][_0xee77('0x35')]?_0x2ec5d3[_0xee77('0x32')]:_0x1d04fd[_0xee77('0x2d')];if(!_0x1a8256['query'][_0xee77('0x36')](_0xee77('0x37'))){_0x2ec5d3[_0xee77('0x1b')]=qs[_0xee77('0x1b')](_0x1a8256[_0xee77('0x31')]['limit']);_0x2ec5d3[_0xee77('0x19')]=qs[_0xee77('0x19')](_0x1a8256[_0xee77('0x31')][_0xee77('0x19')]);}_0x2ec5d3[_0xee77('0x38')]=qs[_0xee77('0x39')](_0x1a8256[_0xee77('0x31')][_0xee77('0x39')]);_0x2ec5d3[_0xee77('0x3a')]=qs[_0xee77('0x30')](_[_0xee77('0x3b')](_0x1a8256['query'],_0x1d04fd['filters']),_0x3974e7);if(_0x1a8256[_0xee77('0x31')][_0xee77('0x3c')]){_0x2ec5d3[_0xee77('0x3a')]=_[_0xee77('0x3d')](_0x2ec5d3[_0xee77('0x3a')],{'$or':_[_0xee77('0x2e')](_0x3974e7,function(_0x16bca7){if(_0x16bca7['type']!==_0xee77('0x3e')){var _0x4c280f={};_0x4c280f[_0x16bca7[_0xee77('0x27')]]={'$like':'%'+_0x1a8256['query'][_0xee77('0x3c')]+'%'};return _0x4c280f;}})});}_0x2ec5d3=_[_0xee77('0x3d')]({},_0x2ec5d3,_0x1a8256['options']);var _0x5a7524={'where':_0x2ec5d3[_0xee77('0x3a')]};return db[_0xee77('0x3f')][_0xee77('0x1c')](_0x5a7524)['then'](function(_0x5a80df){_0xaa5b68[_0xee77('0x1c')]=_0x5a80df;if(_0x1a8256[_0xee77('0x31')][_0xee77('0x40')]){_0x2ec5d3[_0xee77('0x41')]=[{'all':!![]}];}return db[_0xee77('0x3f')][_0xee77('0x42')](_0x2ec5d3);})[_0xee77('0x23')](function(_0x3663fd){_0xaa5b68[_0xee77('0x43')]=_0x3663fd;return _0xaa5b68;})[_0xee77('0x23')](respondWithFilteredResult(_0x737f40,_0x2ec5d3))[_0xee77('0x44')](handleError(_0x737f40,null));};exports['show']=function(_0xe989ab,_0x4d9569){var _0x42946d={'raw':!![],'where':{'id':_0xe989ab[_0xee77('0x45')]['id']}},_0x41b86f={};_0x41b86f[_0xee77('0x2d')]=_[_0xee77('0x2f')](db['ChatTransferReport'][_0xee77('0x29')]);_0x41b86f[_0xee77('0x31')]=_['keys'](_0xe989ab[_0xee77('0x31')]);_0x41b86f[_0xee77('0x30')]=_[_0xee77('0x33')](_0x41b86f[_0xee77('0x2d')],_0x41b86f[_0xee77('0x31')]);_0x42946d[_0xee77('0x32')]=_[_0xee77('0x33')](_0x41b86f[_0xee77('0x2d')],qs['fields'](_0xe989ab[_0xee77('0x31')][_0xee77('0x34')]));_0x42946d[_0xee77('0x32')]=_0x42946d[_0xee77('0x32')][_0xee77('0x35')]?_0x42946d[_0xee77('0x32')]:_0x41b86f[_0xee77('0x2d')];if(_0xe989ab[_0xee77('0x31')]['includeAll']){_0x42946d[_0xee77('0x41')]=[{'all':!![]}];}_0x42946d=_[_0xee77('0x3d')]({},_0x42946d,_0xe989ab[_0xee77('0x46')]);return db[_0xee77('0x3f')][_0xee77('0x47')](_0x42946d)[_0xee77('0x23')](handleEntityNotFound(_0x4d9569,null))[_0xee77('0x23')](respondWithResult(_0x4d9569,null))[_0xee77('0x44')](handleError(_0x4d9569,null));};exports[_0xee77('0x48')]=function(_0x39c4f5,_0x15a4cc){return db[_0xee77('0x3f')][_0xee77('0x48')](_0x39c4f5[_0xee77('0x49')],{})[_0xee77('0x23')](respondWithResult(_0x15a4cc,0xc9))[_0xee77('0x44')](handleError(_0x15a4cc,null));};exports[_0xee77('0x22')]=function(_0x505f3c,_0x22d15b){if(_0x505f3c[_0xee77('0x49')]['id']){delete _0x505f3c[_0xee77('0x49')]['id'];}return db[_0xee77('0x3f')][_0xee77('0x47')]({'where':{'id':_0x505f3c[_0xee77('0x45')]['id']}})['then'](handleEntityNotFound(_0x22d15b,null))[_0xee77('0x23')](saveUpdates(_0x505f3c[_0xee77('0x49')],null))[_0xee77('0x23')](respondWithResult(_0x22d15b,null))[_0xee77('0x44')](handleError(_0x22d15b,null));};exports[_0xee77('0x24')]=function(_0x5d32c3,_0x58fa51){return db['ChatTransferReport']['find']({'where':{'id':_0x5d32c3['params']['id']}})[_0xee77('0x23')](handleEntityNotFound(_0x58fa51,null))[_0xee77('0x23')](removeEntity(_0x58fa51,null))[_0xee77('0x44')](handleError(_0x58fa51,null));};exports[_0xee77('0x4a')]=function(_0x538418,_0x528050){return db[_0xee77('0x3f')][_0xee77('0x4a')]()['then'](respondWithResult(_0x528050,null))[_0xee77('0x44')](handleError(_0x528050,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 12a86cc..6ddcae3 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 _0x6845=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x2c3c52,_0x57e3d6){var _0xe670a3=function(_0x467e34){while(--_0x467e34){_0x2c3c52['push'](_0x2c3c52['shift']());}};_0xe670a3(++_0x57e3d6);}(_0x6845,0x17c));var _0x5684=function(_0x49347f,_0x187a45){_0x49347f=_0x49347f-0x0;var _0x467e4f=_0x6845[_0x49347f];return _0x467e4f;};'use strict';var _=require(_0x5684('0x0'));var util=require(_0x5684('0x1'));var logger=require(_0x5684('0x2'))(_0x5684('0x3'));var moment=require('moment');var BPromise=require(_0x5684('0x4'));var rp=require(_0x5684('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5684('0x6'));var config=require(_0x5684('0x7'));var attributes=require(_0x5684('0x8'));module[_0x5684('0x9')]=function(_0x4c6f85,_0x56020f){return _0x4c6f85[_0x5684('0xa')](_0x5684('0xb'),attributes,{'tableName':_0x5684('0xc'),'paranoid':![],'indexes':[{'name':_0x5684('0xd'),'fields':[_0x5684('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd055=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x4c59c2,_0x4c5d26){var _0x4c3a33=function(_0x27bfc7){while(--_0x27bfc7){_0x4c59c2['push'](_0x4c59c2['shift']());}};_0x4c3a33(++_0x4c5d26);}(_0xd055,0x1af));var _0x5d05=function(_0x1c470d,_0x81d66b){_0x1c470d=_0x1c470d-0x0;var _0x12141b=_0xd055[_0x1c470d];return _0x12141b;};'use strict';var _=require(_0x5d05('0x0'));var util=require(_0x5d05('0x1'));var logger=require(_0x5d05('0x2'))(_0x5d05('0x3'));var moment=require(_0x5d05('0x4'));var BPromise=require(_0x5d05('0x5'));var rp=require(_0x5d05('0x6'));var fs=require('fs');var path=require(_0x5d05('0x7'));var rimraf=require(_0x5d05('0x8'));var config=require(_0x5d05('0x9'));var attributes=require(_0x5d05('0xa'));module[_0x5d05('0xb')]=function(_0x34366d,_0x2d4152){return _0x34366d[_0x5d05('0xc')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5d05('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 0167ec8..2b39303 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 _0x8b72=['util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8b72,0xe7));var _0x28b7=function(_0x57c2aa,_0x1ce944){_0x57c2aa=_0x57c2aa-0x0;var _0xc614b9=_0x8b72[_0x57c2aa];return _0xc614b9;};'use strict';var _=require('lodash');var util=require(_0x28b7('0x0'));var moment=require('moment');var BPromise=require(_0x28b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28b7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x28b7('0x3'));var logger=require(_0x28b7('0x4'))(_0x28b7('0x5'));var config=require(_0x28b7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x28b7('0x7')][_0x28b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2935ca,_0x95f287,_0x428cb4){return new BPromise(function(_0x56a174,_0x222231){return client[_0x28b7('0x9')](_0x2935ca,_0x428cb4)[_0x28b7('0xa')](function(_0x2cd3d1){logger[_0x28b7('0xb')](_0x28b7('0xc'),_0x95f287,_0x28b7('0xd'));logger[_0x28b7('0xe')](_0x28b7('0xf'),_0x95f287,_0x28b7('0xd'),JSON[_0x28b7('0x10')](_0x2cd3d1));if(_0x2cd3d1['error']){if(_0x2cd3d1['error']['code']===0x1f4){logger[_0x28b7('0x11')](_0x28b7('0xc'),_0x95f287,_0x2cd3d1['error']['message']);return _0x222231(_0x2cd3d1[_0x28b7('0x11')][_0x28b7('0x12')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x95f287,_0x2cd3d1[_0x28b7('0x11')][_0x28b7('0x12')]);return _0x56a174(_0x2cd3d1[_0x28b7('0x11')][_0x28b7('0x12')]);}else{logger['info'](_0x28b7('0xc'),_0x95f287,_0x28b7('0xd'));_0x56a174(_0x2cd3d1[_0x28b7('0x13')][_0x28b7('0x12')]);}})[_0x28b7('0x14')](function(_0x44a9fc){logger[_0x28b7('0x11')](_0x28b7('0xc'),_0x95f287,_0x44a9fc);_0x222231(_0x44a9fc);});});}
\ No newline at end of file
+var _0x7b2d=['jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1397f1,_0x1498e2){var _0x1a47fb=function(_0x1c2265){while(--_0x1c2265){_0x1397f1['push'](_0x1397f1['shift']());}};_0x1a47fb(++_0x1498e2);}(_0x7b2d,0x81));var _0xd7b2=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7b2d[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xd7b2('0x0'));var moment=require(_0xd7b2('0x1'));var BPromise=require(_0xd7b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7b2('0x3'));var db=require(_0xd7b2('0x4'))['db'];var utils=require(_0xd7b2('0x5'));var logger=require(_0xd7b2('0x6'))(_0xd7b2('0x7'));var config=require(_0xd7b2('0x8'));var jayson=require(_0xd7b2('0x9'));var client=jayson[_0xd7b2('0xa')][_0xd7b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d2beb,_0x4a2c1d,_0x583642){return new BPromise(function(_0x3ddc11,_0x5a9158){return client[_0xd7b2('0xc')](_0x2d2beb,_0x583642)[_0xd7b2('0xd')](function(_0x1acd73){logger[_0xd7b2('0xe')](_0xd7b2('0xf'),_0x4a2c1d,'request\x20sent');logger['debug'](_0xd7b2('0x10'),_0x4a2c1d,'request\x20sent',JSON[_0xd7b2('0x11')](_0x1acd73));if(_0x1acd73['error']){if(_0x1acd73[_0xd7b2('0x12')][_0xd7b2('0x13')]===0x1f4){logger['error'](_0xd7b2('0xf'),_0x4a2c1d,_0x1acd73[_0xd7b2('0x12')][_0xd7b2('0x14')]);return _0x5a9158(_0x1acd73['error']['message']);}logger[_0xd7b2('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4a2c1d,_0x1acd73[_0xd7b2('0x12')][_0xd7b2('0x14')]);return _0x3ddc11(_0x1acd73['error']['message']);}else{logger[_0xd7b2('0xe')](_0xd7b2('0xf'),_0x4a2c1d,_0xd7b2('0x15'));_0x3ddc11(_0x1acd73['result'][_0xd7b2('0x14')]);}})[_0xd7b2('0x16')](function(_0x1443fb){logger[_0xd7b2('0x12')](_0xd7b2('0xf'),_0x4a2c1d,_0x1443fb);_0x5a9158(_0x1443fb);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 156769c..186462f 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 _0x2eea=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x2eea,0xcb));var _0xa2ee=function(_0x1ca7d6,_0x3f531a){_0x1ca7d6=_0x1ca7d6-0x0;var _0x2a64ee=_0x2eea[_0x1ca7d6];return _0x2a64ee;};'use strict';var multer=require(_0xa2ee('0x0'));var util=require(_0xa2ee('0x1'));var path=require(_0xa2ee('0x2'));var timeout=require(_0xa2ee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2ee('0x4'));var config=require(_0xa2ee('0x5'));var controller=require(_0xa2ee('0x6'));router[_0xa2ee('0x7')]('/',auth[_0xa2ee('0x8')](),controller[_0xa2ee('0x9')]);router['get'](_0xa2ee('0xa'),auth[_0xa2ee('0x8')](),controller[_0xa2ee('0xb')]);router[_0xa2ee('0x7')](_0xa2ee('0xc'),auth[_0xa2ee('0x8')](),controller[_0xa2ee('0xd')]);router[_0xa2ee('0xe')]('/',auth['isAuthenticated'](),controller[_0xa2ee('0xf')]);router[_0xa2ee('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa2ee('0x11')](_0xa2ee('0xc'),auth[_0xa2ee('0x8')](),controller[_0xa2ee('0x12')]);module[_0xa2ee('0x13')]=router;
\ No newline at end of file
+var _0x346d=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','update','delete','/:id','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x346d,0x85));var _0xd346=function(_0x56fc4f,_0xd1f6a){_0x56fc4f=_0x56fc4f-0x0;var _0x5d0c0b=_0x346d[_0x56fc4f];return _0x5d0c0b;};'use strict';var multer=require(_0xd346('0x0'));var util=require(_0xd346('0x1'));var path=require(_0xd346('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd346('0x3')]();var fs_extra=require(_0xd346('0x4'));var auth=require(_0xd346('0x5'));var interaction=require(_0xd346('0x6'));var config=require(_0xd346('0x7'));var controller=require(_0xd346('0x8'));router[_0xd346('0x9')]('/',auth['isAuthenticated'](),controller[_0xd346('0xa')]);router[_0xd346('0x9')](_0xd346('0xb'),auth[_0xd346('0xc')](),controller[_0xd346('0xd')]);router[_0xd346('0x9')]('/:id',auth[_0xd346('0xc')](),controller[_0xd346('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd346('0xf')]);router[_0xd346('0x10')]('/:id',auth[_0xd346('0xc')](),controller[_0xd346('0x11')]);router[_0xd346('0x12')](_0xd346('0x13'),auth[_0xd346('0xc')](),controller[_0xd346('0x14')]);module[_0xd346('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index affd9eb..1a5604a 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 _0x58fd=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','setDataValue','Comments','offlineForm','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x58fd,0x1c3));var _0xd58f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x58fd[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd58f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd58f('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x2')},'mapKeyOffline':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x2')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'defaultValue':_0xd58f('0x3'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd58f('0x3'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd58f('0x4'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd58f('0x1')]},'animation':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd58f('0x7')](_0xd58f('0x8'),_0xd58f('0x9')),'defaultValue':_0xd58f('0x8')},'header_online':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xa')},'start_chat_button':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xb')},'offline_chat_button':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xc')},'header_offline':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xd')},'download_transcript':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x11')},'closingMessageButton':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xc')},'skipMessageButton':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x12')},'conditionAgreement':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xd58f('0x7')](_0xd58f('0x13'),_0xd58f('0x14')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd58f('0x15')],'defaultValue':function(){return JSON[_0xd58f('0x16')]({'items':[{'type':_0xd58f('0x17'),'variable':null,'config':{'placeholder':_0xd58f('0x18'),'type':_0xd58f('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xd58f('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd58f('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd58f('0x1a')](_0xd58f('0x1b'))?JSON['parse'](this[_0xd58f('0x1a')](_0xd58f('0x1b'))):{};},'set':function(_0x58549a){return this[_0xd58f('0x1c')]('onlineForm',JSON['stringify'](_0x58549a));}},'offlineForm':{'type':Sequelize[_0xd58f('0x15')],'defaultValue':function(){return JSON[_0xd58f('0x16')]({'items':[{'type':_0xd58f('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd58f('0x2'),'type':_0xd58f('0x2')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd58f('0x1d')},'props':{'title':_0xd58f('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd58f('0x1e'))?JSON[_0xd58f('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x204487){return this[_0xd58f('0x1c')](_0xd58f('0x1e'),JSON[_0xd58f('0x16')](_0x204487));}},'token':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd58f('0x1')]},'forwardOffline':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd58f('0x1')]},'waitingTitle':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x20')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x21')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd58f('0x12')},'sendUnmanaged':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd58f('0x15')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd58f('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd58f('0x22');}},'notificationSound':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x23')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x24')},'verticalAlignment':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x25')},'messagesAlignment':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x26')},'defaultTitle':{'type':Sequelize[_0xd58f('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd58f('0x5')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd58f('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd58f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd58f('0x1')],'defaultValue':_0xd58f('0x27')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd58f('0x5')],'comment':_0xd58f('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x16a164){if(!_0x16a164)this[_0xd58f('0x1c')](_0xd58f('0x29'),null);this[_0xd58f('0x1c')](_0xd58f('0x2a'),_0x16a164);}},'vidaooEscalation':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd58f('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd58f('0x2b')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xd58f('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xd58f('0x15')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd58f('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd58f('0x15')]}};
\ No newline at end of file
+var _0xcd00=['input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify'];(function(_0x1aaf85,_0x2eebaa){var _0x59ad1c=function(_0x338363){while(--_0x338363){_0x1aaf85['push'](_0x1aaf85['shift']());}};_0x59ad1c(++_0x2eebaa);}(_0xcd00,0x12f));var _0x0cd0=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xcd00[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0x0cd0('0x0'));var rs=require(_0x0cd0('0x1'));module[_0x0cd0('0x2')]={'name':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x5')},'customerAlias':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0cd0('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0cd0('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0cd0('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0cd0('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0cd0('0xa')](_0x0cd0('0xb'),_0x0cd0('0xc')),'defaultValue':_0x0cd0('0xb')},'header_online':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xd')},'start_chat_button':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xe')},'offline_chat_button':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x10')},'download_transcript':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0cd0('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0cd0('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x15')},'placeholderMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x16')},'closingMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x17')},'closingMessageButton':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0xf')},'skipMessageButton':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x0cd0('0xa')](_0x0cd0('0x18'),_0x0cd0('0x19')),'defaultValue':_0x0cd0('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0cd0('0x12')],'defaultValue':function(){return JSON[_0x0cd0('0x1a')]({'items':[{'type':_0x0cd0('0x1b'),'variable':null,'config':{'placeholder':_0x0cd0('0x1c'),'type':_0x0cd0('0x1d'),'required':!![]},'props':{'title':_0x0cd0('0x1c'),'helpText':''}},{'type':_0x0cd0('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0cd0('0x4'),'type':_0x0cd0('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0cd0('0x1e')]('onlineForm')?JSON['parse'](this[_0x0cd0('0x1e')](_0x0cd0('0x1f'))):{};},'set':function(_0x5664cd){return this[_0x0cd0('0x20')](_0x0cd0('0x1f'),JSON['stringify'](_0x5664cd));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x0cd0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0cd0('0x4'),'type':'email'},'variable':null},{'type':_0x0cd0('0x21'),'config':{'placeholder':_0x0cd0('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x0cd0('0x1e')](_0x0cd0('0x23'))?JSON[_0x0cd0('0x24')](this[_0x0cd0('0x1e')](_0x0cd0('0x23'))):{};},'set':function(_0x57f648){return this[_0x0cd0('0x20')](_0x0cd0('0x23'),JSON['stringify'](_0x57f648));}},'token':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':function(){return rs[_0x0cd0('0x25')]();}},'autoclose':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0cd0('0x3')]},'waitingTitle':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x26')},'waitingMessage':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x29')},'skipUnmanaged':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x2a')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0cd0('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0cd0('0x2b');}},'notificationSound':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x0cd0('0x2e')},'messagesAlignment':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x0cd0('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0cd0('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'defaultValue':_0x0cd0('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0cd0('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':_0x0cd0('0x30')},'systemAvatar':{'type':Sequelize[_0x0cd0('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0cd0('0x8')],'comment':_0x0cd0('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![],'comment':_0x0cd0('0x32'),'set':function(_0x46cdd3){if(!_0x46cdd3)this[_0x0cd0('0x20')](_0x0cd0('0x33'),null);this['setDataValue'](_0x0cd0('0x34'),_0x46cdd3);}},'vidaooEscalation':{'type':Sequelize[_0x0cd0('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0cd0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x0cd0('0x3')],'allowNull':![],'defaultValue':_0x0cd0('0x35')},'vidaooNote':{'type':Sequelize[_0x0cd0('0x3')],'defaultValue':function(){return _0x0cd0('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x0cd0('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0cd0('0x12')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 1ec55b4..cdf0e74 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 _0x43fd=['filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','Interval','resolve','timezone','ifTime','notify','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','CmContact','Contacts','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','Applications','priority','account','list','List','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','firstName','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','utf8','origin','http://localhost:9000','testWebsiteWithWildcard','x-real-ip','connection','remoteAddress','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','util','fs-extra','lodash','html-to-text','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','user-agent','getResult','customerIp','x-forwarded-for','split','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','address','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','describe','addDisposition','ChatWebsiteId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file'];(function(_0xabbe3d,_0x4c9120){var _0x32d93d=function(_0x2b3722){while(--_0x2b3722){_0xabbe3d['push'](_0xabbe3d['shift']());}};_0x32d93d(++_0x4c9120);}(_0x43fd,0x1ec));var _0xd43f=function(_0x3d2a7b,_0x20b709){_0x3d2a7b=_0x3d2a7b-0x0;var _0xf8adb=_0x43fd[_0x3d2a7b];return _0xf8adb;};'use strict';var Mustache=require('mustache');var util=require(_0xd43f('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd43f('0x1'));var _=require(_0xd43f('0x2'));var querystring=require('querystring');var htmlToText=require(_0xd43f('0x3'));var Redis=require('ioredis');var jayson=require(_0xd43f('0x4'));var qs=require(_0xd43f('0x5'));var logger=require(_0xd43f('0x6'))(_0xd43f('0x7'));var config=require('../../config/environment');var APIBadRequestError=require(_0xd43f('0x8'))[_0xd43f('0x9')];var APINotFoundError=require(_0xd43f('0x8'))[_0xd43f('0xa')];var APIOutOfIntervalError=require('../../errors/api')[_0xd43f('0xb')];var APIHandleError=require(_0xd43f('0x8'))['handleError'];var APIConflictError=require(_0xd43f('0x8'))[_0xd43f('0xc')];var wildcardUtils=require(_0xd43f('0xd'));var URL=require(_0xd43f('0xe'))[_0xd43f('0xf')];var db=require('../../mysqldb')['db'];config[_0xd43f('0x10')]=_[_0xd43f('0x11')](config[_0xd43f('0x10')],{'host':_0xd43f('0x12'),'port':0x18eb});var socket=require(_0xd43f('0x13'))(new Redis(config[_0xd43f('0x10')]));require(_0xd43f('0x14'))[_0xd43f('0x15')](socket);var client=jayson[_0xd43f('0x16')][_0xd43f('0x17')]({'port':0x232c});var client9002=jayson[_0xd43f('0x16')]['http']({'port':0x232a});var client9003=jayson[_0xd43f('0x16')][_0xd43f('0x17')]({'port':0x232b});var client9001=jayson[_0xd43f('0x16')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4c576e,_0x4a2b49,_0x1c729a,_0x3ca2d4){return new Promise(function(_0x4f8862,_0x3c0953){var _0x3647df=_0x3ca2d4||client;return _0x3647df['request'](_0x4c576e,_0x1c729a)['then'](function(_0x4fd639){logger['info'](_0xd43f('0x18'),_0x4a2b49,_0xd43f('0x19'));logger['debug'](_0xd43f('0x1a'),_0x4a2b49,_0xd43f('0x19'),JSON[_0xd43f('0x1b')](_0x4fd639));if(_0x4fd639[_0xd43f('0x1c')]){if(_0x4fd639['error'][_0xd43f('0x1d')]===0x1f4){logger[_0xd43f('0x1c')](_0xd43f('0x18'),_0x4a2b49,_0x4fd639['error']['message']);return _0x3c0953(_0x4fd639['error'][_0xd43f('0x1e')]);}logger[_0xd43f('0x1c')](_0xd43f('0x18'),_0x4a2b49,_0x4fd639[_0xd43f('0x1c')][_0xd43f('0x1e')]);return _0x4f8862(_0x4fd639[_0xd43f('0x1c')][_0xd43f('0x1e')]);}else{logger['info'](_0xd43f('0x18'),_0x4a2b49,'request\x20sent');_0x4f8862(_0x4fd639[_0xd43f('0x1f')]['message']);}})['catch'](function(_0x310195){logger[_0xd43f('0x1c')](_0xd43f('0x18'),_0x4a2b49,_0x310195);_0x3c0953(_0x310195);});});}function respondWithStatusCode(_0x2a38f6,_0x35acd0){_0x35acd0=_0x35acd0||0xcc;return function(_0xcaf5ae){if(_0xcaf5ae){return _0x2a38f6[_0xd43f('0x20')](_0x35acd0);}return _0x2a38f6[_0xd43f('0x21')](_0x35acd0)[_0xd43f('0x22')]();};}function respondWithResult(_0x49d043,_0x26a6c9){_0x26a6c9=_0x26a6c9||0xc8;return function(_0x2d5915){if(_0x2d5915){return _0x49d043[_0xd43f('0x21')](_0x26a6c9)[_0xd43f('0x23')](_0x2d5915);}};}function respondWithFilteredResult(_0x209ccd,_0x4a8b4d){return function(_0x161540){if(_0x161540){var _0x7b6761=typeof _0x4a8b4d[_0xd43f('0x24')]===_0xd43f('0x25')&&typeof _0x4a8b4d[_0xd43f('0x26')]===_0xd43f('0x25');var _0x481b4d=_0x161540[_0xd43f('0x27')];var _0x1f476d=_0x7b6761?0x0:_0x4a8b4d['offset'];var _0x308439=_0x7b6761?_0x161540['count']:_0x4a8b4d['offset']+_0x4a8b4d[_0xd43f('0x26')];var _0x18472c;if(_0x308439>=_0x481b4d){_0x308439=_0x481b4d;_0x18472c=0xc8;}else{_0x18472c=0xce;}_0x209ccd[_0xd43f('0x21')](_0x18472c);return _0x209ccd['set'](_0xd43f('0x28'),_0x1f476d+'-'+_0x308439+'/'+_0x481b4d)[_0xd43f('0x23')](_0x161540);}return null;};}function saveUpdates(_0x5bba3d){return function(_0x557a96){if(_0x557a96){return _0x557a96[_0xd43f('0x29')](_0x5bba3d)[_0xd43f('0x2a')](function(_0xb9e156){return _0xb9e156;});}return null;};}function removeEntity(_0x202a05){return function(_0x49ff92){if(_0x49ff92){return _0x49ff92[_0xd43f('0x2b')]()[_0xd43f('0x2a')](function(){var _0x134b27=_0x49ff92[_0xd43f('0x2c')]({'plain':!![]});var _0x5a5717=_0xd43f('0x2d');return db[_0xd43f('0x2e')]['destroy']({'where':{'type':_0x5a5717,'resourceId':_0x134b27['id']}})[_0xd43f('0x2a')](function(){return _0x49ff92;});})['then'](function(){_0x202a05[_0xd43f('0x21')](0xcc)[_0xd43f('0x22')]();});}};}function handleEntityNotFound(_0x2d91fc){return function(_0x51b765){if(!_0x51b765){_0x2d91fc[_0xd43f('0x20')](0x194);}return _0x51b765;};}function handleError(_0x2ccd50,_0x523718){_0x523718=_0x523718||0x1f4;return function(_0x3b785f){logger[_0xd43f('0x1c')](_0x3b785f[_0xd43f('0x2f')]);if(_0x3b785f['name']){delete _0x3b785f[_0xd43f('0x30')];}_0x2ccd50[_0xd43f('0x21')](_0x523718)[_0xd43f('0x31')](_0x3b785f);};}function createInteractionObject(_0x20682d,_0x176aac,_0x5bce4d,_0x3386d9){var _0x4b1c73=require(_0xd43f('0x32'));var _0x2d8bfe=new _0x4b1c73();var _0x416030=_0x2d8bfe['setUA'](_0x5bce4d[_0xd43f('0x33')])[_0xd43f('0x34')]();var _0x4b1dfa=_0x176aac[_0xd43f('0x35')];if(_0x5bce4d['cf-connecting-ip']){_0x4b1dfa=_0x5bce4d['cf-connecting-ip'];}else if(_0x5bce4d[_0xd43f('0x36')]){_0x4b1dfa=_['first'](_0x5bce4d['x-forwarded-for'][_0xd43f('0x37')](','));}return{'ContactId':_0x3386d9['id'],'ChatWebsiteId':_0x20682d,'from':(_0x3386d9['firstName']||'')+'\x20'+(_0x3386d9['lastName']||''),'customerIp':_0x4b1dfa,'customerPort':_0x5bce4d[_0xd43f('0x38')]?_0x5bce4d[_0xd43f('0x38')]:null,'referer':_0x176aac[_0xd43f('0x39')],'browserName':_0x416030[_0xd43f('0x3a')][_0xd43f('0x30')]&&_0x416030['browser'][_0xd43f('0x3b')]?util[_0xd43f('0x3c')](_0xd43f('0x3d'),_0x416030[_0xd43f('0x3a')][_0xd43f('0x30')],_0x416030[_0xd43f('0x3a')][_0xd43f('0x3b')]):_0xd43f('0x3e'),'browserVersion':_0x416030[_0xd43f('0x3a')][_0xd43f('0x3b')]||_0xd43f('0x3e'),'osName':util['format'](_0xd43f('0x3d'),_0x416030['os'][_0xd43f('0x30')],_0x416030['os']['version']),'osVersion':_0x416030['os']['version'],'deviceModel':_0x416030[_0xd43f('0x3f')][_0xd43f('0x40')]&&_0x416030[_0xd43f('0x3f')]['vendor']?util[_0xd43f('0x3c')](_0xd43f('0x41'),_0x416030[_0xd43f('0x3f')][_0xd43f('0x40')],_0x416030['device']['vendor'],_0x416030[_0xd43f('0x3f')][_0xd43f('0x42')]):null,'deviceVendor':_0x416030[_0xd43f('0x3f')]['vendor'],'deviceType':_0x416030[_0xd43f('0x3f')][_0xd43f('0x42')],'formData':JSON[_0xd43f('0x1b')](_0x176aac)};}exports[_0xd43f('0x43')]=function(_0x33a644,_0xc2a5a6){var _0x15071b={'include':[{'model':db[_0xd43f('0x44')],'as':_0xd43f('0x45')}]},_0xadbc59={},_0x4f5587={'count':0x0,'rows':[]};var _0x386dfa=_[_0xd43f('0x46')](db[_0xd43f('0x47')][_0xd43f('0x48')],function(_0x30fc76){return{'name':_0x30fc76[_0xd43f('0x49')],'type':_0x30fc76[_0xd43f('0x42')][_0xd43f('0x4a')]};});_0xadbc59[_0xd43f('0x40')]=_['map'](_0x386dfa,_0xd43f('0x30'));_0xadbc59[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x33a644[_0xd43f('0x4b')]);_0xadbc59[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0xadbc59['model'],_0xadbc59[_0xd43f('0x4b')]);_0x15071b['attributes']=_[_0xd43f('0x4e')](_0xadbc59['model'],qs[_0xd43f('0x4f')](_0x33a644[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x15071b[_0xd43f('0x50')]=_0x15071b[_0xd43f('0x50')][_0xd43f('0x51')]?_0x15071b[_0xd43f('0x50')]:_0xadbc59[_0xd43f('0x40')];if(!_0x33a644[_0xd43f('0x4b')]['hasOwnProperty'](_0xd43f('0x52'))){_0x15071b[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x33a644[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x15071b[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x33a644[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x15071b[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x33a644['query']['sort']);_0x15071b[_0xd43f('0x55')]=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x33a644['query'],_0xadbc59['filters']),_0x386dfa);if(_0x33a644[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x15071b[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x15071b[_0xd43f('0x55')],{'$or':_['map'](_0x386dfa,function(_0x344797){if(_0x344797[_0xd43f('0x42')]!==_0xd43f('0x59')){var _0xafb5d4={};_0xafb5d4[_0x344797[_0xd43f('0x30')]]={'$like':'%'+_0x33a644[_0xd43f('0x4b')]['filter']+'%'};return _0xafb5d4;}})});}_0x15071b=_[_0xd43f('0x58')]({},_0x15071b,_0x33a644[_0xd43f('0x5a')]);var _0x39e85a={'where':_0x15071b[_0xd43f('0x55')]};return db[_0xd43f('0x47')][_0xd43f('0x27')](_0x39e85a)[_0xd43f('0x2a')](function(_0xece809){_0x4f5587['count']=_0xece809;if(_0x33a644[_0xd43f('0x4b')][_0xd43f('0x5b')]){_0x15071b[_0xd43f('0x5c')]=[{'all':!![]}];}return db['ChatWebsite'][_0xd43f('0x5d')](_0x15071b);})[_0xd43f('0x2a')](function(_0xb719d){_0x4f5587[_0xd43f('0x5e')]=_0xb719d;return _0x4f5587;})[_0xd43f('0x2a')](respondWithFilteredResult(_0xc2a5a6,_0x15071b))[_0xd43f('0x5f')](handleError(_0xc2a5a6,null));};exports[_0xd43f('0x60')]=function(_0x32590d,_0x1c1fd5){var _0x418af0={'raw':![],'where':{'id':_0x32590d[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0x44')],'as':'mandatoryDispositionPause'}]},_0x4ca871={};_0x4ca871[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0x47')]['rawAttributes']);_0x4ca871[_0xd43f('0x4b')]=_['keys'](_0x32590d[_0xd43f('0x4b')]);_0x4ca871['filters']=_[_0xd43f('0x4e')](_0x4ca871['model'],_0x4ca871[_0xd43f('0x4b')]);_0x418af0[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x4ca871['model'],qs['fields'](_0x32590d[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x418af0['attributes']=_0x418af0[_0xd43f('0x50')][_0xd43f('0x51')]?_0x418af0['attributes']:_0x4ca871[_0xd43f('0x40')];if(_0x32590d[_0xd43f('0x4b')][_0xd43f('0x5b')]){_0x418af0[_0xd43f('0x5c')]=[{'all':!![]}];}_0x418af0=_[_0xd43f('0x58')]({},_0x418af0,_0x32590d[_0xd43f('0x5a')]);return db[_0xd43f('0x47')]['find'](_0x418af0)[_0xd43f('0x2a')](handleEntityNotFound(_0x1c1fd5,null))[_0xd43f('0x2a')](respondWithResult(_0x1c1fd5,null))[_0xd43f('0x5f')](handleError(_0x1c1fd5,null));};exports[_0xd43f('0x62')]=function(_0x6ee0ef,_0x18cdd9){var _0x2ff8ad=null;_0x6ee0ef['body'][_0xd43f('0x63')][_0xd43f('0x37')](',')['forEach'](_0x1898b6=>{if(_0x1898b6[_0xd43f('0x64')]()!==''&&!wildcardUtils[_0xd43f('0x65')](_0x1898b6[_0xd43f('0x64')]())){_0x2ff8ad=new APIBadRequestError('\x22'+_0x1898b6[_0xd43f('0x64')]()+_0xd43f('0x66'));}});if(_0x2ff8ad){return handleError(_0x18cdd9,null)(_0x2ff8ad);}return db[_0xd43f('0x47')]['create'](_0x6ee0ef[_0xd43f('0x67')],{})[_0xd43f('0x2a')](function(_0x5b70c8){var _0x451d18=_0x6ee0ef['user'][_0xd43f('0x2c')]({'plain':!![]});if(!_0x451d18)throw new Error(_0xd43f('0x68'));if(_0x451d18[_0xd43f('0x69')]===_0xd43f('0x6a')){var _0x32090e=_0x5b70c8[_0xd43f('0x2c')]({'plain':!![]});var _0x1c59c4=_0xd43f('0x2d');return db[_0xd43f('0x6b')][_0xd43f('0x6c')]({'where':{'name':_0x1c59c4,'userProfileId':_0x451d18[_0xd43f('0x6d')]},'raw':!![]})[_0xd43f('0x2a')](function(_0x332271){if(_0x332271&&_0x332271[_0xd43f('0x6e')]===0x0){return db['UserProfileResource'][_0xd43f('0x62')]({'name':_0x32090e[_0xd43f('0x30')],'resourceId':_0x32090e['id'],'type':_0x332271[_0xd43f('0x30')],'sectionId':_0x332271['id']},{})['then'](function(){return _0x5b70c8;});}else{return _0x5b70c8;}})[_0xd43f('0x5f')](function(_0x5211ee){logger[_0xd43f('0x1c')](_0xd43f('0x6f'),_0x5211ee);throw _0x5211ee;});}return _0x5b70c8;})[_0xd43f('0x2a')](respondWithResult(_0x18cdd9,0xc9))[_0xd43f('0x5f')](handleError(_0x18cdd9,null));};exports['update']=function(_0x1e2258,_0x1a53ce){var _0x15cfb3=null;_0x1e2258['body'][_0xd43f('0x63')]['split'](',')[_0xd43f('0x70')](_0x41d560=>{if(_0x41d560[_0xd43f('0x64')]()!==''&&!wildcardUtils[_0xd43f('0x65')](_0x41d560['trim']())){_0x15cfb3=new APIBadRequestError('\x22'+_0x41d560[_0xd43f('0x64')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x15cfb3){return handleError(_0x1a53ce,null)(_0x15cfb3);}if(_0x1e2258[_0xd43f('0x67')]['id']){delete _0x1e2258['body']['id'];}return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x1e2258['params']['id']},'include':[{'model':db[_0xd43f('0x44')],'as':_0xd43f('0x45')}]})[_0xd43f('0x2a')](handleEntityNotFound(_0x1a53ce,null))[_0xd43f('0x2a')](saveUpdates(_0x1e2258['body'],null))[_0xd43f('0x2a')](respondWithResult(_0x1a53ce,null))[_0xd43f('0x5f')](handleError(_0x1a53ce,null));};exports[_0xd43f('0x2b')]=function(_0x147c6b,_0x5f30f7){return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x147c6b['params']['id']}})['then'](handleEntityNotFound(_0x5f30f7,null))[_0xd43f('0x2a')](removeEntity(_0x5f30f7,null))[_0xd43f('0x5f')](handleError(_0x5f30f7,null));};exports[_0xd43f('0x71')]=function(_0x5346af,_0x209cdc){return db['ChatWebsite'][_0xd43f('0x71')]()[_0xd43f('0x2a')](respondWithResult(_0x209cdc,null))['catch'](handleError(_0x209cdc,null));};exports[_0xd43f('0x72')]=function(_0x45c946,_0x2d6b29){if(_0x45c946[_0xd43f('0x67')]['id']){delete _0x45c946[_0xd43f('0x67')]['id'];}return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x45c946[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x2d6b29,null))[_0xd43f('0x2a')](function(_0x3703b5){if(_0x3703b5){_0x45c946['body'][_0xd43f('0x73')]=_0x3703b5['id'];return db['Disposition'][_0xd43f('0x62')](_0x45c946[_0xd43f('0x67')]);}})[_0xd43f('0x2a')](respondWithResult(_0x2d6b29,null))[_0xd43f('0x5f')](handleError(_0x2d6b29,null));};exports['getDispositions']=function(_0x533892,_0x1ddba2){var _0x104006={'raw':![],'where':{}};var _0x5f0190={};var _0x43d8e7={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x533892[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x1ddba2,null))[_0xd43f('0x2a')](function(_0x49a6b4){if(_0x49a6b4){_0x5f0190[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0x75')][_0xd43f('0x48')]);_0x5f0190[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x533892[_0xd43f('0x4b')]);_0x5f0190[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x5f0190['model'],_0x5f0190['query']);_0x104006[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x5f0190['model'],qs[_0xd43f('0x4f')](_0x533892[_0xd43f('0x4b')]['fields']));_0x104006[_0xd43f('0x50')]=_0x104006[_0xd43f('0x50')][_0xd43f('0x51')]?_0x104006['attributes']:_0x5f0190['model'];if(!_0x533892[_0xd43f('0x4b')][_0xd43f('0x76')](_0xd43f('0x52'))){_0x104006[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x533892[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x104006[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x533892[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x104006[_0xd43f('0x53')]=qs['sort'](_0x533892[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x104006[_0xd43f('0x55')]=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x533892[_0xd43f('0x4b')],_0x5f0190[_0xd43f('0x4d')]));_0x104006['where'][_0xd43f('0x73')]=_0x49a6b4['id'];if(_0x533892[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x104006[_0xd43f('0x55')]=_['merge'](_0x104006[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x104006[_0xd43f('0x50')],function(_0x13dd7f){var _0x1f5d58={};_0x1f5d58[_0x13dd7f]={'$like':'%'+_0x533892[_0xd43f('0x4b')][_0xd43f('0x57')]+'%'};return _0x1f5d58;})});}_0x104006=_[_0xd43f('0x58')]({},_0x104006,_0x533892[_0xd43f('0x5a')]);return db['Disposition'][_0xd43f('0x27')]({'where':_0x104006['where']})[_0xd43f('0x2a')](function(_0x4762fb){_0x43d8e7[_0xd43f('0x27')]=_0x4762fb;if(_0x533892[_0xd43f('0x4b')]['includeAll']){_0x104006[_0xd43f('0x5c')]=[{'all':!![]}];}return db[_0xd43f('0x75')]['findAll'](_0x104006);})[_0xd43f('0x2a')](function(_0x11fbbb){_0x43d8e7[_0xd43f('0x5e')]=_0x11fbbb;return _0x43d8e7;});}})[_0xd43f('0x2a')](respondWithFilteredResult(_0x1ddba2,_0x104006))[_0xd43f('0x5f')](handleError(_0x1ddba2,null));};exports[_0xd43f('0x77')]=function(_0x4f3d39,_0x5c6897){return db['ChatWebsite'][_0xd43f('0x6c')]({'where':{'id':_0x4f3d39['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x5c6897,null))['then'](function(_0x24fc08){if(_0x24fc08){return _0x24fc08[_0xd43f('0x77')](_0x4f3d39[_0xd43f('0x4b')][_0xd43f('0x78')]);}})[_0xd43f('0x2a')](respondWithStatusCode(_0x5c6897,null))[_0xd43f('0x5f')](handleError(_0x5c6897,null));};exports[_0xd43f('0x79')]=function(_0x464c42,_0x17115b){if(_0x464c42[_0xd43f('0x67')]['id']){delete _0x464c42[_0xd43f('0x67')]['id'];}return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x464c42['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x17115b,null))[_0xd43f('0x2a')](function(_0x80efa4){if(_0x80efa4){_0x464c42[_0xd43f('0x67')][_0xd43f('0x73')]=_0x80efa4['id'];return db['CannedAnswer'][_0xd43f('0x62')](_0x464c42[_0xd43f('0x67')]);}})[_0xd43f('0x2a')](respondWithResult(_0x17115b,null))[_0xd43f('0x5f')](handleError(_0x17115b,null));};exports[_0xd43f('0x7a')]=function(_0x41836b,_0x19c24c){var _0x4efd7d={'raw':![],'where':{}};var _0x4cddee={};var _0xb18bde={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x41836b[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x19c24c,null))['then'](function(_0x53a610){if(_0x53a610){_0x4cddee['model']=_[_0xd43f('0x4c')](db[_0xd43f('0x7b')][_0xd43f('0x48')]);_0x4cddee[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x41836b[_0xd43f('0x4b')]);_0x4cddee['filters']=_[_0xd43f('0x4e')](_0x4cddee[_0xd43f('0x40')],_0x4cddee['query']);_0x4efd7d['attributes']=_['intersection'](_0x4cddee[_0xd43f('0x40')],qs[_0xd43f('0x4f')](_0x41836b['query'][_0xd43f('0x4f')]));_0x4efd7d['attributes']=_0x4efd7d[_0xd43f('0x50')]['length']?_0x4efd7d[_0xd43f('0x50')]:_0x4cddee[_0xd43f('0x40')];if(!_0x41836b['query'][_0xd43f('0x76')](_0xd43f('0x52'))){_0x4efd7d[_0xd43f('0x26')]=qs['limit'](_0x41836b['query'][_0xd43f('0x26')]);_0x4efd7d['offset']=qs[_0xd43f('0x24')](_0x41836b[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x4efd7d[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x41836b['query'][_0xd43f('0x54')]);_0x4efd7d['where']=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x41836b['query'],_0x4cddee[_0xd43f('0x4d')]));_0x4efd7d[_0xd43f('0x55')]['ChatWebsiteId']=_0x53a610['id'];if(_0x41836b[_0xd43f('0x4b')]['filter']){_0x4efd7d[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x4efd7d['where'],{'$or':_[_0xd43f('0x46')](_0x4efd7d[_0xd43f('0x50')],function(_0x578e4f){var _0x40538e={};_0x40538e[_0x578e4f]={'$like':'%'+_0x41836b[_0xd43f('0x4b')][_0xd43f('0x57')]+'%'};return _0x40538e;})});}_0x4efd7d=_[_0xd43f('0x58')]({},_0x4efd7d,_0x41836b[_0xd43f('0x5a')]);return db[_0xd43f('0x7b')]['count']({'where':_0x4efd7d[_0xd43f('0x55')]})[_0xd43f('0x2a')](function(_0x3598c2){_0xb18bde[_0xd43f('0x27')]=_0x3598c2;if(_0x41836b['query'][_0xd43f('0x5b')]){_0x4efd7d[_0xd43f('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd43f('0x5d')](_0x4efd7d);})[_0xd43f('0x2a')](function(_0x870d3f){_0xb18bde[_0xd43f('0x5e')]=_0x870d3f;return _0xb18bde;});}})[_0xd43f('0x2a')](respondWithFilteredResult(_0x19c24c,_0x4efd7d))[_0xd43f('0x5f')](handleError(_0x19c24c,null));};exports['removeAnswers']=function(_0x3757e1,_0x570b79){return db['ChatWebsite'][_0xd43f('0x6c')]({'where':{'id':_0x3757e1[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x570b79,null))[_0xd43f('0x2a')](function(_0x5b017d){if(_0x5b017d){return _0x5b017d[_0xd43f('0x7c')](_0x3757e1[_0xd43f('0x4b')][_0xd43f('0x78')]);}})[_0xd43f('0x2a')](respondWithStatusCode(_0x570b79,null))['catch'](handleError(_0x570b79,null));};exports[_0xd43f('0x7d')]=function(_0x21635f,_0x5b2330){_0x21635f['body'][_0xd43f('0x7e')]=_0x21635f[_0xd43f('0x7f')][_0xd43f('0x80')];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x21635f[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x5b2330,null))[_0xd43f('0x2a')](saveUpdates(_0x21635f[_0xd43f('0x67')],null))[_0xd43f('0x2a')](respondWithResult(_0x5b2330,null))[_0xd43f('0x5f')](handleError(_0x5b2330,null));};exports['addAvatar']=function(_0xf41755,_0x458d12){_0xf41755[_0xd43f('0x67')][_0xd43f('0x81')]=_0xf41755['file']['filename'];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0xf41755['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x458d12,null))[_0xd43f('0x2a')](saveUpdates(_0xf41755[_0xd43f('0x67')],null))[_0xd43f('0x2a')](respondWithResult(_0x458d12,null))['catch'](handleError(_0x458d12,null));};exports[_0xd43f('0x82')]=function(_0x37fded,_0x39b6ce){_0x37fded['body'][_0xd43f('0x83')]=_0x37fded[_0xd43f('0x7f')][_0xd43f('0x80')];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x37fded[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x39b6ce,null))['then'](saveUpdates(_0x37fded['body'],null))[_0xd43f('0x2a')](respondWithResult(_0x39b6ce,null))[_0xd43f('0x5f')](handleError(_0x39b6ce,null));};exports[_0xd43f('0x84')]=function(_0x482c1f,_0x203821){_0x482c1f[_0xd43f('0x67')][_0xd43f('0x85')]=_0x482c1f[_0xd43f('0x7f')][_0xd43f('0x80')];return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x482c1f['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x203821,null))[_0xd43f('0x2a')](saveUpdates(_0x482c1f[_0xd43f('0x67')],null))[_0xd43f('0x2a')](respondWithResult(_0x203821,null))[_0xd43f('0x5f')](handleError(_0x203821,null));};exports['getLogo']=function(_0x211b48,_0x4fe18a){var _0x5d39a9=path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x88'));var _0x284afe={'where':{'id':_0x211b48[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x7e')],'raw':!![]};var _0x35bf20=![];return require(_0xd43f('0x89'))[_0xd43f('0x8a')]()[_0xd43f('0x2a')](function(_0x5c69b6){if(_0x5c69b6){_0x35bf20=_0x5c69b6[_0xd43f('0x8b')];}})[_0xd43f('0x2a')](function(){return db[_0xd43f('0x47')][_0xd43f('0x6c')](_0x284afe);})[_0xd43f('0x2a')](handleEntityNotFound(_0x4fe18a,null))['then'](function(_0x4158e5){if(_0x4158e5){if(!_[_0xd43f('0x8c')](_0x4158e5[_0xd43f('0x7e')])){if(fs[_0xd43f('0x8d')](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x8e'),_0x4158e5[_0xd43f('0x7e')]))&&_0x35bf20){_0x5d39a9=path[_0xd43f('0x86')](config['root'],'server/files/images/logos/',_0x4158e5[_0xd43f('0x7e')]);}}return _0x4fe18a['download'](_0x5d39a9);}})[_0xd43f('0x5f')](handleError(_0x4fe18a,null));};exports[_0xd43f('0x8f')]=function(_0x475df1,_0x46632f){var _0x48499c=path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x90'));var _0x50f233={'where':{'id':_0x475df1[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x81')],'raw':!![]};return db[_0xd43f('0x47')][_0xd43f('0x6c')](_0x50f233)['then'](handleEntityNotFound(_0x46632f,null))[_0xd43f('0x2a')](function(_0x2d2035){if(_0x2d2035){if(!_[_0xd43f('0x8c')](_0x2d2035['agentAvatar'])){if(fs[_0xd43f('0x8d')](path['join'](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x2d2035[_0xd43f('0x81')]))){_0x48499c=path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x2d2035[_0xd43f('0x81')]);}}return _0x46632f[_0xd43f('0x92')](_0x48499c);}})[_0xd43f('0x5f')](handleError(_0x46632f,null));};exports[_0xd43f('0x93')]=function(_0x57e736,_0x103e10){var _0x4833c6=path[_0xd43f('0x86')](config[_0xd43f('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x58dd26={'where':{'id':_0x57e736[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x83'),_0xd43f('0x94')],'raw':!![]};return db[_0xd43f('0x47')]['find'](_0x58dd26)[_0xd43f('0x2a')](handleEntityNotFound(_0x103e10,null))[_0xd43f('0x2a')](function(_0x55bc9e){if(_0x55bc9e){if(!_[_0xd43f('0x8c')](_0x55bc9e[_0xd43f('0x83')])){if(fs[_0xd43f('0x8d')](path[_0xd43f('0x86')](config['root'],_0xd43f('0x91'),_0x55bc9e[_0xd43f('0x83')]))&&_0x55bc9e[_0xd43f('0x94')]){_0x4833c6=path[_0xd43f('0x86')](config['root'],_0xd43f('0x91'),_0x55bc9e['customerAvatar']);}}return _0x103e10[_0xd43f('0x92')](_0x4833c6);}})[_0xd43f('0x5f')](handleError(_0x103e10,null));};exports[_0xd43f('0x95')]=function(_0x42c198,_0x3df7d4){var _0x2af269=path[_0xd43f('0x86')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x4315d6={'where':{'id':_0x42c198[_0xd43f('0x61')]['id']},'attributes':['id',_0xd43f('0x85')],'raw':!![]};return db[_0xd43f('0x47')][_0xd43f('0x6c')](_0x4315d6)[_0xd43f('0x2a')](handleEntityNotFound(_0x3df7d4,null))[_0xd43f('0x2a')](function(_0x1f4052){if(_0x1f4052){if(!_[_0xd43f('0x8c')](_0x1f4052[_0xd43f('0x85')])){if(fs[_0xd43f('0x8d')](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x1f4052[_0xd43f('0x85')]))){_0x2af269=path['join'](config[_0xd43f('0x87')],_0xd43f('0x91'),_0x1f4052[_0xd43f('0x85')]);}}return _0x3df7d4[_0xd43f('0x92')](_0x2af269);}})['catch'](handleError(_0x3df7d4,null));};function checkWebsiteInterval(_0x19c481){var _0x294d4f=_0x19c481[_0xd43f('0x96')];if(!_0x294d4f){return Promise[_0xd43f('0x97')](_0x19c481);}var _0x438520=_0x19c481[_0xd43f('0x98')]||undefined;return _0x294d4f[_0xd43f('0x99')](_0x438520)[_0xd43f('0x2a')](function(_0x24dc61){if(!_0x24dc61){throw new APIOutOfIntervalError();}return _0x19c481;});}exports[_0xd43f('0x9a')]=function(_0x46223a,_0x139970){var _0x41c0ea={'body':_0x46223a[_0xd43f('0x67')],'channel':'chat'};var _0x517f8f=[];var _0x510e67=[];var _0xaf3a26={};var _0x4895a7=![];if(_0x46223a['body']['id']){delete _0x46223a[_0xd43f('0x67')]['id'];}if(_[_0xd43f('0x8c')](_0x46223a[_0xd43f('0x67')][_0xd43f('0x9b')])){throw new APIBadRequestError(_0xd43f('0x9c'));}if(_['isNil'](_0x46223a[_0xd43f('0x67')][_0xd43f('0x9d')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xd43f('0x9e')](_0x46223a['body'][_0xd43f('0x67')])){throw new APIBadRequestError(_0xd43f('0x9f'));}var _0x1d173b=_0x46223a[_0xd43f('0x67')]['customerIp']&&_0x46223a[_0xd43f('0x67')][_0xd43f('0x39')];return db['CmContact'][_0xd43f('0x71')]()[_0xd43f('0x2a')](function(_0x651f61){if(!_0x651f61){throw new Error('No\x20available\x20attributes');}_0x517f8f=Object[_0xd43f('0x4c')](_0x651f61)['filter'](function(_0x50ea34){return![_0xd43f('0xa0'),_0xd43f('0xa1')][_0xd43f('0xa2')](_0x50ea34);});_0x510e67=Object[_0xd43f('0x4c')](_0x651f61)[_0xd43f('0x57')](function(_0x36e2e4){return![_0xd43f('0xa0'),_0xd43f('0xa1'),_0xd43f('0xa3'),_0xd43f('0xa4')]['includes'](_0x36e2e4);});if(!_[_0xd43f('0xa2')](_0x510e67,_0x46223a['body'][_0xd43f('0x9d')])){throw new APIBadRequestError(_0xd43f('0xa5')+_0x510e67['join'](',\x20'));}_0xaf3a26[_0x46223a['body'][_0xd43f('0x9d')]]=_0x46223a[_0xd43f('0x67')][_0xd43f('0x9b')];})['then'](function(){return db['ChatWebsite'][_0xd43f('0x6c')]({'where':{'id':_0x46223a[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0xa6')],'as':'List','include':[{'model':db[_0xd43f('0xa7')],'as':_0xd43f('0xa8'),'where':_0xaf3a26,'limit':0x1,'order':[[_0xd43f('0xa1'),'DESC']]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db[_0xd43f('0x96')],'as':_0xd43f('0x96'),'include':[{'model':db[_0xd43f('0x96')],'as':_0xd43f('0xa9'),'attributes':['id',_0xd43f('0xaa')],'raw':!![]}]}]});})[_0xd43f('0x2a')](function(_0x8824d5){if(!_0x8824d5){throw new APINotFoundError(util[_0xd43f('0x3c')](_0xd43f('0xab'),_0x46223a[_0xd43f('0x61')]['id']));}if(_0x1d173b){return checkWebsiteInterval(_0x8824d5);}return _0x8824d5;})[_0xd43f('0x2a')](function(_0x23cc45){_0x41c0ea['account']=_0x23cc45;_0x41c0ea[_0xd43f('0xac')]=_[_0xd43f('0xad')](_0x23cc45[_0xd43f('0xae')],[_0xd43f('0xaf')],['asc']);if(_0x41c0ea[_0xd43f('0xb0')]['Applications']){delete _0x41c0ea['account'][_0xd43f('0xae')];}_0x41c0ea[_0xd43f('0xb1')]=_0x23cc45[_0xd43f('0xb2')]||{'id':_0x23cc45[_0xd43f('0xa4')]};if(_0x41c0ea['list']&&_0x41c0ea[_0xd43f('0xb1')][_0xd43f('0xa8')][_0xd43f('0x51')]){return _0x41c0ea[_0xd43f('0xb1')][_0xd43f('0xa8')][0x0];}var _0x32a2d6=_['defaults'](_0x46223a[_0xd43f('0x67')],{'firstName':_0x46223a['body']['from'],'ListId':_0x23cc45['ListId']});_0x32a2d6[_0x46223a[_0xd43f('0x67')][_0xd43f('0x9d')]]=_0x46223a[_0xd43f('0x67')]['from'];return db[_0xd43f('0xa7')][_0xd43f('0x62')](_0x32a2d6,{'fields':_0x517f8f,'raw':!![]});})[_0xd43f('0x2a')](function(_0x21669b){_0x41c0ea[_0xd43f('0xb3')]=_0x21669b;var _0x2770cf=createInteractionObject(_0x46223a[_0xd43f('0x61')]['id'],_0x46223a[_0xd43f('0x67')],_0x46223a[_0xd43f('0xb4')],_0x21669b);var _0xab1320={'ChatWebsiteId':_0x46223a[_0xd43f('0x61')]['id']};if(_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')]){_0xab1320['threadId']=_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')];_0xab1320[_0xd43f('0xb6')]=![];return db[_0xd43f('0xb7')][_0xd43f('0x6c')]({'where':_0xab1320})[_0xd43f('0x2a')](function(_0x37b08b){var _0x479d80=_0x46223a[_0xd43f('0x67')]['customerIp']&&_0x46223a[_0xd43f('0x67')][_0xd43f('0x39')];if(_0x37b08b){_0x4895a7=!![];return _0x37b08b;}else if(!_0x479d80&&_0x37b08b&&_0x37b08b[_0xd43f('0xb6')]){throw new APIConflictError(_0xd43f('0xb8'));}_0x2770cf['threadId']=_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')];_0x2770cf[_0xd43f('0xb9')]=_0x46223a[_0xd43f('0x67')][_0xd43f('0xb9')];return db[_0xd43f('0xb7')][_0xd43f('0x62')](_0x2770cf);});}_0xab1320[_0xd43f('0xba')]=_0x21669b['id'];if(_0x46223a[_0xd43f('0x67')]['interaction']&&_0x46223a['body']['interaction']['id']){_0xab1320['id']=_0x46223a[_0xd43f('0x67')][_0xd43f('0xbb')]['id'];return db[_0xd43f('0xb7')][_0xd43f('0x6c')]({'where':_0xab1320})[_0xd43f('0x2a')](function(_0x3095bd){var _0x5654f6=_0x46223a[_0xd43f('0x67')][_0xd43f('0x35')]&&_0x46223a[_0xd43f('0x67')]['referer'];if(!_0x5654f6&&_0x3095bd&&_0x3095bd[_0xd43f('0xb6')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x3095bd){_0x4895a7=!![];return _0x3095bd;}else{return db[_0xd43f('0xb7')][_0xd43f('0x62')](_0x2770cf);}});}return db[_0xd43f('0xb7')][_0xd43f('0x62')](_0x2770cf);})['then'](function(_0x486e3e){if(!_0x4895a7){return _0x486e3e;}var _0x5a9af4={'from':(_0x41c0ea[_0xd43f('0xb3')][_0xd43f('0xbc')]||'')+'\x20'+(_0x41c0ea[_0xd43f('0xb3')][_0xd43f('0xbd')]||'')};if(_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')]&&_0x46223a[_0xd43f('0x67')][_0xd43f('0xbe')]&&_0x46223a[_0xd43f('0x67')][_0xd43f('0xb5')]!=_0x46223a[_0xd43f('0x67')][_0xd43f('0xbe')]){_0x5a9af4[_0xd43f('0xb5')]=_0x46223a[_0xd43f('0x67')]['messageId'];}return _0x486e3e[_0xd43f('0x29')](_0x5a9af4);})[_0xd43f('0x2a')](function(_0x1aa11f){_0x41c0ea[_0xd43f('0xbb')]=_0x1aa11f[_0xd43f('0x2c')]({'plain':!![]});_0x41c0ea['interaction'][_0xd43f('0xbf')]=!_0x4895a7;if(_0x41c0ea['interaction']['created']){if(_0x41c0ea[_0xd43f('0xb0')][_0xd43f('0xc0')]){_0x41c0ea[_0xd43f('0xac')]['push']({'id':0x0,'priority':_0x41c0ea[_0xd43f('0xac')][_0xd43f('0x51')]+0x1,'app':_0xd43f('0xc1'),'appdata':_0xd43f('0xc2'),'interval':_0xd43f('0xc3')});}}return db[_0xd43f('0xc4')]['create']({'body':_0x46223a[_0xd43f('0x67')][_0xd43f('0x67')],'ChatWebsiteId':_0x46223a[_0xd43f('0x61')]['id'],'ChatInteractionId':_0x1aa11f['id'],'direction':'in','ContactId':_0x41c0ea[_0xd43f('0xb3')]['id'],'AttachmentId':_0x46223a[_0xd43f('0x67')]['AttachmentId']});})[_0xd43f('0x2a')](function(_0x43442d){_0x41c0ea[_0xd43f('0x1e')]=_0x43442d;if(!_0x41c0ea[_0xd43f('0xbb')][_0xd43f('0xc5')]){return;}return db[_0xd43f('0xc6')]['find']({'attributes':['id',_0xd43f('0x30')],'where':{'id':_0x41c0ea['interaction'][_0xd43f('0xc5')]}});})[_0xd43f('0x2a')](function(_0x19a129){if(_0x19a129){_0x41c0ea[_0xd43f('0xac')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd43f('0xc7'),'appdata':_0x19a129[_0xd43f('0x30')]+','+(_0x41c0ea[_0xd43f('0xb0')][_0xd43f('0xc8')]||0xa),'interval':_0xd43f('0xc3')});_0x41c0ea['forcedOwnership']=!![];}if(!_0x41c0ea[_0xd43f('0xbb')][_0xd43f('0xc9')]){return;}return db[_0xd43f('0xca')]['find']({'attributes':['id','name'],'where':{'id':_0x41c0ea['interaction'][_0xd43f('0xc9')]}});})[_0xd43f('0x2a')](function(_0x5e5e44){if(_0x5e5e44){_0x41c0ea['applications'][_0xd43f('0xcb')]({'id':0x0,'priority':0x1,'app':_0xd43f('0xcc'),'appdata':_0x5e5e44[_0xd43f('0x30')]+','+(_0x41c0ea[_0xd43f('0xb0')][_0xd43f('0xcd')]||0x12c),'interval':_0xd43f('0xc3')});}return respondWithRpcPromise(_0xd43f('0xce'),_0xd43f('0xcf'),_0x41c0ea);})['then'](function(_0xf451bf){respondWithRpcPromise(_0xd43f('0xd0'),_0xd43f('0xd0'),{'event':_0xd43f('0x9a'),'message':_0xf451bf},client9002);return _0xf451bf;})['then'](respondWithResult(_0x139970,null))[_0xd43f('0x5f')](APIHandleError(_0x139970));};exports[_0xd43f('0xd1')]=function(_0x3d9159,_0x3eaa9e){var _0x593918,_0x587c0a,_0x4179cf;var _0x10b29c=[];var _0x132f85={};var _0x5f3cc1=_0x3d9159['files']||[];var _0x31ad17=[];var _0x36398a;return db['CmContact'][_0xd43f('0x71')]()[_0xd43f('0x2a')](function(_0x50c513){if(!_0x50c513){throw new db[(_0xd43f('0xd2'))][(_0xd43f('0xd3'))](_0xd43f('0xd4'));}_0x10b29c=_[_0xd43f('0xd5')](_[_0xd43f('0x4c')](_0x50c513),['createdAt',_0xd43f('0xa1'),_0xd43f('0xa3'),_0xd43f('0xa4')]);if(_0x3d9159[_0xd43f('0x67')]['id']){delete _0x3d9159['body']['id'];}if(_[_0xd43f('0x8c')](_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')])){throw _0x3eaa9e['status'](0x1f4)[_0xd43f('0x31')](new db[(_0xd43f('0xd2'))][(_0xd43f('0xd3'))](_0xd43f('0xd6')));}if(_[_0xd43f('0x8c')](_0x3d9159['body'][_0xd43f('0x67')])||_0x3d9159['body']['body']===''){throw _0x3eaa9e[_0xd43f('0x21')](0x1f4)['send'](new db[(_0xd43f('0xd2'))]['ValidationError'](_0xd43f('0xd7')));}if(_[_0xd43f('0x8c')](_0x3d9159[_0xd43f('0x67')][_0xd43f('0xd8')])){throw _0x3eaa9e[_0xd43f('0x21')](0x1f4)[_0xd43f('0x31')](new db[(_0xd43f('0xd2'))][(_0xd43f('0xd3'))](_0xd43f('0xd9')+_0x10b29c));}if(!_[_0xd43f('0xa2')](_0x10b29c,_0x3d9159[_0xd43f('0x67')][_0xd43f('0xd8')])){throw _0x3eaa9e['status'](0x1f4)['send'](new db[(_0xd43f('0xd2'))]['ValidationError'](_0xd43f('0xda')+_0x10b29c));}_0x132f85[_0x3d9159[_0xd43f('0x67')][_0xd43f('0xd8')]]=_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')];})[_0xd43f('0x2a')](function(){return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x3d9159[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0xa6')],'as':_0xd43f('0xb2')},{'model':db['MailAccount'],'as':_0xd43f('0xdb')}]});})[_0xd43f('0x2a')](handleEntityNotFound(_0x3eaa9e,null))[_0xd43f('0x2a')](function(_0xd9b10a){if(_0xd9b10a&&_0xd9b10a[_0xd43f('0xb2')]){_0x587c0a=_0xd9b10a;var _0x162d9b=_[_0xd43f('0x11')](_0x3d9159[_0xd43f('0x67')],{'firstName':_0x3d9159['body'][_0xd43f('0x9b')],'phone':_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')],'ListId':_0xd9b10a[_0xd43f('0xa4')]});_0x162d9b[_0x3d9159['body'][_0xd43f('0xd8')]]=_0x3d9159[_0xd43f('0x67')][_0xd43f('0x9b')];return db[_0xd43f('0xa7')][_0xd43f('0xdc')]({'where':_0x132f85,'defaults':_0x162d9b});}})[_0xd43f('0xdd')](function(_0x4e9337){if(_0x4e9337){_0x4179cf=_0x4e9337;var _0x57321f=fs['readFileSync'](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0xde')),'utf8');var _0x372b2d=ejs[_0xd43f('0xdf')](_0x57321f,{'body':_[_0xd43f('0xe0')](_0x3d9159[_0xd43f('0x67')][_0xd43f('0x67')]),'bodyTitle':_0x587c0a[_0xd43f('0xe1')]});return db[_0xd43f('0xe2')]['create']({'body':_0x372b2d,'plainBody':htmlToText[_0xd43f('0xe3')](_0x372b2d),'ContactId':_0x4e9337['id'],'ChatWebsiteId':_0x587c0a['id']});}})[_0xd43f('0x2a')](function(_0x50c93a){_0x36398a=_0x50c93a;if(_0x5f3cc1['length']){var _0x30c306=_0x5f3cc1[_0xd43f('0x46')](function(_0xfe034e){return{'name':_0xfe034e[_0xd43f('0xe4')],'basename':_0xfe034e['filename'],'type':_0xfe034e[_0xd43f('0xe5')],'ChatOfflineMessageId':_0x50c93a['id']};});_0x31ad17=_0x30c306[_0xd43f('0x46')](_0xcad05c=>{var _0x1e4efe={'filename':_0xcad05c[_0xd43f('0x30')],'path':path[_0xd43f('0x86')](config[_0xd43f('0x87')],'server','files',_0xd43f('0xe6'),_0xd43f('0xe7'),_0xcad05c[_0xd43f('0xe8')])};return _0x1e4efe;});if(!_0x587c0a[_0xd43f('0xe9')]){return db[_0xd43f('0xea')][_0xd43f('0xeb')](function(_0x3df481){return db[_0xd43f('0xec')][_0xd43f('0xed')](_0x30c306,{'transaction':_0x3df481});});}}})['then'](function(){if(_0x36398a){_0x593918=_0x36398a;return db[_0xd43f('0xdb')][_0xd43f('0x74')]({'where':{'service':!![]},'include':[{'model':db[_0xd43f('0xee')],'as':_0xd43f('0xef'),'raw':!![],'include':[{'model':db[_0xd43f('0xf0')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xd43f('0x2a')](function(_0x44be88){if(_0x44be88&&_0x44be88[_0xd43f('0xef')]&&_0x587c0a['forwardOffline']&&_0x587c0a[_0xd43f('0xf1')]){var _0x36839a=_0x44be88[_0xd43f('0xf2')]();return respondWithRpcPromise(_0xd43f('0xf3'),_0xd43f('0xf4'),{'account':_0x36839a,'message':{'from':util[_0xd43f('0x3c')](_0xd43f('0xf5'),_0x44be88[_0xd43f('0x30')],_0x44be88[_0xd43f('0xf6')]||_0x44be88[_0xd43f('0xef')][_0xd43f('0x6a')]),'to':_0x587c0a['forwardOfflineAddress'],'subject':_0x587c0a['offlineMessageSubject'],'html':_0x593918[_0xd43f('0x67')],'attachments':_0x31ad17}},client9003)['then'](function(){return _0x593918;})[_0xd43f('0x5f')](function(_0x4b13d0){logger[_0xd43f('0x1c')](_0x4b13d0);});}})[_0xd43f('0x2a')](function(){if(_0x587c0a&&_0x587c0a[_0xd43f('0xe9')]&&_0x587c0a['MailAccountId']){var _0x28bb01=[];if(_0x5f3cc1['length']){_0x28bb01=_0x5f3cc1[_0xd43f('0x46')](function(_0x2bd853){return{'name':_0x2bd853[_0xd43f('0xe4')],'basename':_0x2bd853[_0xd43f('0x80')],'type':_0x2bd853[_0xd43f('0xe5')],'ChatOfflineMessageId':_0x36398a['id']};});}var _0x18fea1;if(!_['isNil'](_0x587c0a[_0xd43f('0xf7')])){var _0x25890a=_['map'](_0x3d9159[_0xd43f('0x67')],function(_0x48f676){return _0x48f676;});var _0xce79fa=_[_0xd43f('0xf8')](_0x25890a)[0x0];var _0x193ee8=_[_0xd43f('0xf9')](_0xce79fa,function(_0x701631){return _0x701631;});_0x18fea1=_0x193ee8[0x1][_0x587c0a['subjectOffline']];}var _0x2f10ee={'from':_0x4179cf[_0xd43f('0xf6')],'firstName':_0x4179cf[_0xd43f('0xbc')],'lastName':_0x4179cf[_0xd43f('0xbd')],'mapKey':_0xd43f('0xf6'),'message':{'from':_0x4179cf[_0xd43f('0xf6')],'to':_0x587c0a['MailAccount'][_0xd43f('0xf6')],'cc':'','subject':_['isNil'](_0x18fea1)?_0x587c0a[_0xd43f('0xfa')]:_0x18fea1,'messageId':'','sentAt':new Date(),'attach':_0x28bb01[_0xd43f('0x51')],'attachments':_0x28bb01,'originChannel':_0xd43f('0xfb'),'ChatWebsiteId':_0x587c0a['id'],'ChatOfflineMessageId':_0x593918['id'],'originTo':_0x587c0a[_0xd43f('0xdb')]['email']},'body':_0x593918[_0xd43f('0x67')]};var _0x17b5c8={'account':{'id':_0x587c0a[_0xd43f('0xfc')]},'body':_0x2f10ee,'log':_0xd43f('0xfd')};return respondWithRpcPromise(_0xd43f('0xfd'),_0xd43f('0xfe'),_0x17b5c8,client9001)[_0xd43f('0x2a')](function(){return _0x593918;})['catch'](function(_0x46c524){logger[_0xd43f('0x1c')](_0x46c524);});}return;})['then'](function(){if(_0x593918){return _0x593918;}})[_0xd43f('0x2a')](respondWithResult(_0x3eaa9e,null))[_0xd43f('0x5f')](function(){for(var _0x1facca of _0x5f3cc1){var _0x1a01b7=path[_0xd43f('0x86')](config['root'],_0xd43f('0xff'),'files',_0xd43f('0xe6'),_0xd43f('0xe7'),_0x1facca[_0xd43f('0x80')]);fs_extra[_0xd43f('0x100')](_0x1a01b7)[_0xd43f('0x5f')](function(_0x45433f){logger[_0xd43f('0x1c')](_0xd43f('0x101'),_0x1a01b7,_0x45433f);});}});};exports[_0xd43f('0x102')]=function(_0x21753f,_0x5aa425){return db[_0xd43f('0xb7')][_0xd43f('0x6c')]({'where':{'id':_0x21753f[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x5aa425,null))[_0xd43f('0x2a')](function(_0x2c1cf4){if(_0x2c1cf4){return _0x2c1cf4[_0xd43f('0x102')](_0x21753f['body'][_0xd43f('0x78')],_[_0xd43f('0x103')](_0x21753f[_0xd43f('0x67')],[_0xd43f('0x78'),'id'])||{});}})['then'](respondWithResult(_0x5aa425,null))[_0xd43f('0x5f')](handleError(_0x5aa425,null));};exports[_0xd43f('0x104')]=function(_0x1845fe,_0x52267d){var _0x55e661={'raw':![],'where':{}};var _0x5264b4={};var _0x58badb={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x1845fe[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x52267d,null))[_0xd43f('0x2a')](function(_0x56c0b6){if(_0x56c0b6){_0x5264b4[_0xd43f('0x40')]=_['keys'](db[_0xd43f('0xb7')][_0xd43f('0x48')]);_0x5264b4[_0xd43f('0x4b')]=_['keys'](_0x1845fe[_0xd43f('0x4b')]);_0x5264b4[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x5264b4[_0xd43f('0x40')],_0x5264b4['query']);_0x55e661[_0xd43f('0x50')]=_['intersection'](_0x5264b4[_0xd43f('0x40')],qs['fields'](_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x55e661[_0xd43f('0x50')]=_0x55e661[_0xd43f('0x50')][_0xd43f('0x51')]?_0x55e661[_0xd43f('0x50')]:_0x5264b4[_0xd43f('0x40')];if(!_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x76')]('nolimit')){_0x55e661[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x1845fe['query'][_0xd43f('0x26')]);_0x55e661[_0xd43f('0x24')]=qs['offset'](_0x1845fe[_0xd43f('0x4b')]['offset']);}_0x55e661[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x55e661[_0xd43f('0x55')]=qs['filters'](_[_0xd43f('0x56')](_0x1845fe['query'],_0x5264b4[_0xd43f('0x4d')]));_0x55e661['where']['ChatWebsiteId']=_0x56c0b6['id'];if(_0x1845fe[_0xd43f('0x4b')]['filter']){_0x55e661[_0xd43f('0x55')]=_['merge'](_0x55e661[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x55e661[_0xd43f('0x50')],function(_0x3bf49f){var _0x1bffe2={};_0x1bffe2[_0x3bf49f]={'$like':'%'+_0x1845fe[_0xd43f('0x4b')]['filter']+'%'};return _0x1bffe2;})});}_0x55e661=_['merge']({},_0x55e661,_0x1845fe[_0xd43f('0x5a')]);return db[_0xd43f('0xb7')][_0xd43f('0x27')]({'where':_0x55e661[_0xd43f('0x55')]})[_0xd43f('0x2a')](function(_0x4ba9cf){_0x58badb[_0xd43f('0x27')]=_0x4ba9cf;if(_0x1845fe[_0xd43f('0x4b')]['includeAll']){_0x55e661[_0xd43f('0x5c')]=[{'model':db[_0xd43f('0xa7')],'as':_0xd43f('0x105'),'required':![]},{'model':db['User'],'as':_0xd43f('0x106'),'attributes':[_0xd43f('0x30'),_0xd43f('0x107'),'internal'],'required':![]},{'model':db[_0xd43f('0x108')],'as':_0xd43f('0x109'),'attributes':['id',_0xd43f('0x30'),_0xd43f('0x10a')],'where':_0x1845fe[_0xd43f('0x4b')]['tag']?{'id':_0x1845fe['query'][_0xd43f('0x10b')]}:undefined,'required':_0x1845fe[_0xd43f('0x4b')][_0xd43f('0x10b')]?!![]:![]}];}return db[_0xd43f('0xb7')][_0xd43f('0x5d')](_0x55e661);})['then'](function(_0x452dc0){_0x58badb[_0xd43f('0x5e')]=_0x452dc0;return _0x58badb;});}})['then'](respondWithFilteredResult(_0x52267d,_0x55e661))[_0xd43f('0x5f')](handleError(_0x52267d,null));};exports[_0xd43f('0x10c')]=function(_0x4050c7,_0x314e00){var _0x5ef2c2=0x0;var _0x3a3a25=0x0;var _0x4f989d=![];var _0x478a6a;var _0x2f6cf1;return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x4050c7[_0xd43f('0x61')]['id']},'include':[{'model':db[_0xd43f('0x96')],'as':_0xd43f('0x96'),'include':[{'model':db[_0xd43f('0x96')],'as':_0xd43f('0xa9'),'attributes':['id','interval']}]}]})[_0xd43f('0x2a')](handleEntityNotFound(_0x314e00,null))[_0xd43f('0x2a')](function(_0x4acc9f){if(_0x4acc9f){_0x478a6a=_0x4acc9f;return _0x4acc9f[_0xd43f('0x10d')]({'raw':!![]});}})[_0xd43f('0x2a')](function(_0x3156ad){if(_0x478a6a){if(_0x3156ad){_0x2f6cf1=_0x3156ad;}}return require(_0xd43f('0x89'))[_0xd43f('0x8a')]();})['then'](function(_0x559ad7){if(_0x559ad7){_0x3a3a25=_0x559ad7[_0xd43f('0x10e')];_0x4f989d=_0x559ad7[_0xd43f('0x8b')];}})[_0xd43f('0x2a')](function(){return db[_0xd43f('0xb7')]['count']({'where':{'closed':![]}});})['then'](function(_0x1c06fd){_0x5ef2c2=_0x1c06fd;if(_0x3a3a25&&_0x1c06fd>_0x3a3a25){return db['License'][_0xd43f('0x74')]({'where':{'id':0x1}})[_0xd43f('0x2a')](function(_0xbd8d56){if(_0xbd8d56){_0xbd8d56['increment'](_0xd43f('0x10f'));}});}})['then'](function(){var _0x4874fd=_0x478a6a[_0xd43f('0x96')];var _0x2fbf1e=_0x478a6a[_0xd43f('0x98')]||undefined;return _0x4874fd?_0x4874fd['ifTime'](_0x2fbf1e):!![];})['then'](function(_0x3be95e){var _0x4087d9=fs[_0xd43f('0x110')](path[_0xd43f('0x86')](config[_0xd43f('0x87')],_0xd43f('0x111')),_0xd43f('0x112'));var _0x3b9b2c='3.10.1';var _0x38fe0c=![];var _0x2005e1,_0x1c63d5;if(_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x39')]){_0x2005e1=new URL(_0x4050c7['headers'][_0xd43f('0x39')])[_0xd43f('0x113')];}else if(_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x113')]){_0x2005e1=new URL(_0x4050c7['headers'][_0xd43f('0x113')])[_0xd43f('0x113')];}else{_0x2005e1=_0xd43f('0x114');}_0x1c63d5=typeof _0x478a6a[_0xd43f('0x63')][_0xd43f('0x37')](',')['find'](function(_0x53c9d3){return wildcardUtils[_0xd43f('0x115')](_0x53c9d3,_0x2005e1);})!=='undefined';var _0x5a0613={'chatVersion':_0x3b9b2c,'chatWebsiteAddressOrigin':_0x1c63d5?_0x2005e1:_0x478a6a[_0xd43f('0x63')],'remote':_0x478a6a['remote'],'query':querystring[_0xd43f('0x1b')](_[_0xd43f('0x58')](_0x478a6a[_0xd43f('0x2c')]({'plain':!![]}),{'customerIp':_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x36')]||_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x116')]||_0x4050c7[_0xd43f('0x117')][_0xd43f('0x118')]||_0x4050c7['ip'],'referer':_0x4050c7[_0xd43f('0xb4')][_0xd43f('0x39')],'openedInteractions':_0x5ef2c2,'maxInteractions':_0x3a3a25,'virtual':_0x4f989d['virtual'],'online':_0x3be95e,'custom':_0x4f989d,'address':_0x1c63d5?_0x2005e1:null}))[_0xd43f('0x119')](/'/g,'\x5c\x27')};_0x314e00[_0xd43f('0x31')](ejs[_0xd43f('0xdf')](Mustache[_0xd43f('0xdf')](_0x4087d9,_0x5a0613),{'proactiveActions':_0x2f6cf1,'alignment':_0x478a6a['alignment'],'verticalAlignment':_0x478a6a['verticalAlignment'],'div_color':_0x478a6a[_0xd43f('0x10a')],'labelText':_0x478a6a[_0xd43f('0x11a')],'text_color':_0x478a6a[_0xd43f('0x11b')],'text_button_color':_0x478a6a[_0xd43f('0x11c')],'button_color':_0x478a6a[_0xd43f('0x11d')],'background_color':_0x478a6a[_0xd43f('0x11e')],'hideWhenOffline':_0x478a6a['hideWhenOffline'],'intervalId':_0x478a6a[_0xd43f('0x11f')],'isDevelopment':_0x38fe0c,'chatVersion':_0x3b9b2c}));})[_0xd43f('0x5f')](handleError(_0x314e00,null));};exports['addApplications']=function(_0x4b3e23,_0x415d1e){var _0x2f7253=_0x4b3e23[_0xd43f('0x61')]['id'];var _0x515e60=_0x4b3e23[_0xd43f('0x67')];var _0x3132a2=0xc8;var _0x4b054=null;return db[_0xd43f('0xea')][_0xd43f('0xeb')]({'isolationLevel':db['sequelize'][_0xd43f('0x120')][_0xd43f('0x121')][_0xd43f('0x122')]},function(_0x5c69d9){return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x2f7253},'transaction':_0x5c69d9})[_0xd43f('0x2a')](function(_0x10f796){if(_0x10f796){return db[_0xd43f('0x123')][_0xd43f('0x2b')]({'where':{'ChatWebsiteId':_0x2f7253},'transaction':_0x5c69d9})[_0xd43f('0x2a')](function(){var _0x35aaab=_['map'](_0x515e60,function(_0x160d74){_0x160d74[_0xd43f('0x73')]=_0x2f7253;return _0x160d74;});return db[_0xd43f('0x123')][_0xd43f('0xed')](_0x35aaab,{'transaction':_0x5c69d9});});}else{_0x3132a2=0x194;_0x4b054=[];}});})['then'](function(){if(_0x3132a2!==0x194){return db['ChatApplication'][_0xd43f('0x124')]({'where':{'ChatWebsiteId':_0x2f7253},'order':_0xd43f('0xaf')})[_0xd43f('0x2a')](function(_0xf87efb){_0x4b054=_0xf87efb;});}})[_0xd43f('0x5f')](function(_0x4fbe4c){_0x3132a2=0x1f4;logger[_0xd43f('0x1c')](_0x4fbe4c[_0xd43f('0x2f')]);if(_0x4fbe4c[_0xd43f('0x30')]){delete _0x4fbe4c[_0xd43f('0x30')];}_0x4b054=_0x4fbe4c;})[_0xd43f('0x125')](function(){if(_0x4b054===null){_0x415d1e[_0xd43f('0x20')](_0x3132a2);}else{if(_0x3132a2===0x1f4){_0x415d1e[_0xd43f('0x21')](_0x3132a2)[_0xd43f('0x31')](_0x4b054);}else{_0x415d1e[_0xd43f('0x21')](_0x3132a2)[_0xd43f('0x23')](_0x4b054);}}});};exports[_0xd43f('0x126')]=function(_0x10c59e,_0x221f68){var _0x22ab14={};var _0x169909={};var _0x47a5eb;var _0x2eae07;return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x10c59e['params']['id']}})['then'](handleEntityNotFound(_0x221f68,null))['then'](function(_0x47d583){if(_0x47d583){_0x47a5eb=_0x47d583;_0x169909[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0x123')]['rawAttributes']);_0x169909[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x10c59e[_0xd43f('0x4b')]);_0x169909['filters']=_[_0xd43f('0x4e')](_0x169909[_0xd43f('0x40')],_0x169909[_0xd43f('0x4b')]);_0x22ab14[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x169909[_0xd43f('0x40')],qs[_0xd43f('0x4f')](_0x10c59e[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x22ab14[_0xd43f('0x50')]=_0x22ab14[_0xd43f('0x50')][_0xd43f('0x51')]?_0x22ab14[_0xd43f('0x50')]:_0x169909['model'];_0x22ab14[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x10c59e[_0xd43f('0x4b')]['sort']);_0x22ab14[_0xd43f('0x55')]=qs['filters'](_[_0xd43f('0x56')](_0x10c59e[_0xd43f('0x4b')],_0x169909[_0xd43f('0x4d')]));if(_0x10c59e[_0xd43f('0x4b')]['filter']){_0x22ab14['where']=_[_0xd43f('0x58')](_0x22ab14[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x22ab14[_0xd43f('0x50')],function(_0x303647){var _0xd186b9={};_0xd186b9[_0x303647]={'$like':'%'+_0x10c59e[_0xd43f('0x4b')]['filter']+'%'};return _0xd186b9;})});}_0x22ab14=_[_0xd43f('0x58')]({},_0x22ab14,_0x10c59e[_0xd43f('0x5a')]);return _0x47a5eb['getApplications'](_0x22ab14);}})[_0xd43f('0x2a')](function(_0x1fe152){if(_0x1fe152){_0x2eae07=_0x1fe152[_0xd43f('0x51')];if(!_0x10c59e[_0xd43f('0x4b')]['hasOwnProperty'](_0xd43f('0x52'))){_0x22ab14[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x10c59e[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x22ab14[_0xd43f('0x24')]=qs['offset'](_0x10c59e[_0xd43f('0x4b')][_0xd43f('0x24')]);}return _0x47a5eb[_0xd43f('0x126')](_0x22ab14);}})[_0xd43f('0x2a')](function(_0x4e417f){if(_0x4e417f){return _0x4e417f?{'count':_0x2eae07,'rows':_0x4e417f}:null;}})['then'](respondWithResult(_0x221f68,null))[_0xd43f('0x5f')](handleError(_0x221f68,null));};exports[_0xd43f('0x127')]=function(_0x495ae9,_0x1308e6){return db[_0xd43f('0x128')][_0xd43f('0x6c')]({'where':{'id':_0x495ae9[_0xd43f('0x61')]['id']}})['then'](handleEntityNotFound(_0x1308e6,null))[_0xd43f('0x2a')](function(_0x80dc00){if(_0x80dc00){return _0x80dc00[_0xd43f('0x127')](_0x495ae9['body']['ids'],_[_0xd43f('0x103')](_0x495ae9[_0xd43f('0x67')],[_0xd43f('0x78'),'id'])||{});}})[_0xd43f('0x2a')](respondWithResult(_0x1308e6,null))['catch'](handleError(_0x1308e6,null));};exports[_0xd43f('0x10d')]=function(_0x40d89c,_0x49daff){var _0x2ddf5b={};var _0x33821b={};var _0x1e66f2;var _0x43a1fa;return db[_0xd43f('0x47')]['findOne']({'where':{'id':_0x40d89c[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x49daff,null))[_0xd43f('0x2a')](function(_0xb93358){if(_0xb93358){_0x1e66f2=_0xb93358;_0x33821b[_0xd43f('0x40')]=_['keys'](db[_0xd43f('0x129')][_0xd43f('0x48')]);_0x33821b[_0xd43f('0x4b')]=_['keys'](_0x40d89c[_0xd43f('0x4b')]);_0x33821b[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x33821b[_0xd43f('0x40')],_0x33821b[_0xd43f('0x4b')]);_0x2ddf5b['attributes']=_[_0xd43f('0x4e')](_0x33821b['model'],qs[_0xd43f('0x4f')](_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x2ddf5b['attributes']=_0x2ddf5b[_0xd43f('0x50')][_0xd43f('0x51')]?_0x2ddf5b[_0xd43f('0x50')]:_0x33821b['model'];_0x2ddf5b[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x40d89c[_0xd43f('0x4b')]['sort']);_0x2ddf5b['where']=qs[_0xd43f('0x4d')](_[_0xd43f('0x56')](_0x40d89c['query'],_0x33821b[_0xd43f('0x4d')]));if(_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x2ddf5b[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x2ddf5b[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x2ddf5b['attributes'],function(_0x39fc95){var _0x4bb226={};_0x4bb226[_0x39fc95]={'$like':'%'+_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x57')]+'%'};return _0x4bb226;})});}_0x2ddf5b=_[_0xd43f('0x58')]({},_0x2ddf5b,_0x40d89c[_0xd43f('0x5a')]);return _0x1e66f2['getProactiveActions'](_0x2ddf5b);}})[_0xd43f('0x2a')](function(_0x1eb282){if(_0x1eb282){_0x43a1fa=_0x1eb282[_0xd43f('0x51')];if(!_0x40d89c['query']['hasOwnProperty']('nolimit')){_0x2ddf5b[_0xd43f('0x26')]=qs['limit'](_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x2ddf5b[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x40d89c[_0xd43f('0x4b')][_0xd43f('0x24')]);}return _0x1e66f2['getProactiveActions'](_0x2ddf5b);}})[_0xd43f('0x2a')](function(_0x54437b){if(_0x54437b){return _0x54437b?{'count':_0x43a1fa,'rows':_0x54437b}:null;}})[_0xd43f('0x2a')](respondWithResult(_0x49daff,null))[_0xd43f('0x5f')](handleError(_0x49daff,null));};exports[_0xd43f('0x12a')]=function(_0x501a44,_0x49dd44){var _0x564386=_0x501a44[_0xd43f('0x4b')]['online']===_0xd43f('0x12b')?_0xd43f('0x12c'):'onlineForm';return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'attributes':['id',_0x564386],'where':{'id':_0x501a44['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x49dd44,null))[_0xd43f('0x2a')](function(_0x3e5ad9){if(_0x3e5ad9){var _0x179a4c=_0x3e5ad9[_0x564386];var _0x5e56fa=_0x179a4c&&_0x179a4c[_0xd43f('0x12d')]?_0x179a4c[_0xd43f('0x12d')]:[];_0x49dd44[_0xd43f('0x31')]({'fromKey':_[_0xd43f('0x8c')](_0x179a4c['fromKey'])?undefined:_0x179a4c[_0xd43f('0x12e')],'count':_0x5e56fa[_0xd43f('0x51')],'rows':_0x5e56fa});}})[_0xd43f('0x5f')](handleError(_0x49dd44,null));};exports[_0xd43f('0x12f')]=function(_0x1ec235,_0x2d8bc9){var _0x414a60={'raw':![],'where':{}};var _0x4ebdcd={};var _0x41bbe9={'count':0x0,'rows':[]};return db[_0xd43f('0x47')][_0xd43f('0x74')]({'where':{'id':_0x1ec235[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x2d8bc9,null))['then'](function(_0x2d3afd){if(_0x2d3afd){_0x4ebdcd[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0xe2')][_0xd43f('0x48')]);_0x4ebdcd[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x1ec235[_0xd43f('0x4b')]);_0x4ebdcd[_0xd43f('0x4d')]=_[_0xd43f('0x4e')](_0x4ebdcd['model'],_0x4ebdcd[_0xd43f('0x4b')]);_0x414a60[_0xd43f('0x50')]=_[_0xd43f('0x4e')](_0x4ebdcd[_0xd43f('0x40')],qs['fields'](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x414a60[_0xd43f('0x50')]=_0x414a60[_0xd43f('0x50')][_0xd43f('0x51')]?_0x414a60[_0xd43f('0x50')]:_0x4ebdcd[_0xd43f('0x40')];if(!_0x1ec235['query'][_0xd43f('0x76')](_0xd43f('0x52'))){_0x414a60[_0xd43f('0x26')]=qs[_0xd43f('0x26')](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x414a60['offset']=qs[_0xd43f('0x24')](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x24')]);}_0x414a60[_0xd43f('0x53')]=qs[_0xd43f('0x54')](_0x1ec235[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x414a60[_0xd43f('0x55')]=qs['filters'](_[_0xd43f('0x56')](_0x1ec235['query'],_0x4ebdcd[_0xd43f('0x4d')]));_0x414a60[_0xd43f('0x55')][_0xd43f('0x73')]=_0x2d3afd['id'];if(_0x1ec235['query'][_0xd43f('0x57')]){_0x414a60['where']=_[_0xd43f('0x58')](_0x414a60[_0xd43f('0x55')],{'$or':_[_0xd43f('0x46')](_0x414a60[_0xd43f('0x50')],function(_0x22efb1){var _0x34e038={};_0x34e038[_0x22efb1]={'$like':'%'+_0x1ec235[_0xd43f('0x4b')]['filter']+'%'};return _0x34e038;})});}_0x414a60=_['merge']({},_0x414a60,_0x1ec235[_0xd43f('0x5a')]);return db['ChatOfflineMessage']['count']({'where':_0x414a60['where']})[_0xd43f('0x2a')](function(_0x189375){_0x41bbe9[_0xd43f('0x27')]=_0x189375;if(_0x1ec235['query'][_0xd43f('0x5b')]){_0x414a60[_0xd43f('0x5c')]=[{'all':!![]}];}else{_0x414a60[_0xd43f('0x5c')]=[{'model':db[_0xd43f('0xa7')],'as':_0xd43f('0x105'),'required':![]},{'model':db[_0xd43f('0xec')],'as':'Attachments','required':![]}];}return db[_0xd43f('0xe2')]['findAll'](_0x414a60);})[_0xd43f('0x2a')](function(_0x4a1c14){_0x41bbe9[_0xd43f('0x5e')]=_0x4a1c14;return _0x41bbe9;});}})[_0xd43f('0x2a')](respondWithFilteredResult(_0x2d8bc9,_0x414a60))[_0xd43f('0x5f')](handleError(_0x2d8bc9,null));};exports[_0xd43f('0x130')]=function(_0xcb9333,_0x5a08c4){return db[_0xd43f('0x47')]['find']({'where':{'id':_0xcb9333[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x5a08c4,null))[_0xd43f('0x2a')](function(_0x276899){if(_0x276899){return _0x276899[_0xd43f('0x130')](_0xcb9333[_0xd43f('0x67')]['ids'],_[_0xd43f('0x103')](_0xcb9333['body'],[_0xd43f('0x78'),'id'])||{})[_0xd43f('0xdd')](function(_0x29a4ea){for(var _0x5ae805=0x0;_0x5ae805<_0xcb9333[_0xd43f('0x67')][_0xd43f('0x78')][_0xd43f('0x51')];_0x5ae805+=0x1){socket[_0xd43f('0x131')](_0xd43f('0x132'),{'UserId':Number(_0xcb9333[_0xd43f('0x67')]['ids'][_0x5ae805]),'ChatWebsiteId':Number(_0xcb9333[_0xd43f('0x61')]['id'])});}return _0x29a4ea;});}})[_0xd43f('0x2a')](respondWithResult(_0x5a08c4,null))[_0xd43f('0x5f')](handleError(_0x5a08c4,null));};exports[_0xd43f('0x133')]=function(_0x2d4e34,_0x52fb8a){return db[_0xd43f('0x47')][_0xd43f('0x6c')]({'where':{'id':_0x2d4e34['params']['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x52fb8a,null))[_0xd43f('0x2a')](function(_0x5dac85){if(_0x5dac85){return _0x5dac85[_0xd43f('0x133')](_0x2d4e34[_0xd43f('0x4b')]['ids'])['then'](function(){if(_[_0xd43f('0x134')](_0x2d4e34['query'][_0xd43f('0x78')])){for(var _0x2a5a61=0x0;_0x2a5a61<_0x2d4e34['query'][_0xd43f('0x78')][_0xd43f('0x51')];_0x2a5a61+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2d4e34['query'][_0xd43f('0x78')][_0x2a5a61]),'ChatWebsiteId':Number(_0x2d4e34[_0xd43f('0x61')]['id'])});}}else{socket[_0xd43f('0x131')]('userChatWebsite:remove',{'UserId':Number(_0x2d4e34[_0xd43f('0x4b')][_0xd43f('0x78')]),'ChatWebsiteId':Number(_0x2d4e34[_0xd43f('0x61')]['id'])});}});}})[_0xd43f('0x2a')](respondWithStatusCode(_0x52fb8a,null))['catch'](handleError(_0x52fb8a,null));};exports[_0xd43f('0x135')]=function(_0x595980,_0x1af0a4){var _0x22bd32={};var _0x5174ed={};var _0x1bcde4;var _0x2040d8;return db[_0xd43f('0x47')]['findOne']({'where':{'id':_0x595980[_0xd43f('0x61')]['id']}})[_0xd43f('0x2a')](handleEntityNotFound(_0x1af0a4,null))['then'](function(_0xf5f331){if(_0xf5f331){_0x1bcde4=_0xf5f331;_0x5174ed[_0xd43f('0x40')]=_[_0xd43f('0x4c')](db[_0xd43f('0xc6')][_0xd43f('0x48')]);_0x5174ed[_0xd43f('0x4b')]=_[_0xd43f('0x4c')](_0x595980['query']);_0x5174ed['filters']=_['intersection'](_0x5174ed['model'],_0x5174ed[_0xd43f('0x4b')]);_0x22bd32['attributes']=_[_0xd43f('0x4e')](_0x5174ed['model'],qs[_0xd43f('0x4f')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x4f')]));_0x22bd32[_0xd43f('0x50')]=_0x22bd32['attributes'][_0xd43f('0x51')]?_0x22bd32[_0xd43f('0x50')]:_0x5174ed[_0xd43f('0x40')];_0x22bd32['order']=qs[_0xd43f('0x54')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x54')]);_0x22bd32['where']=qs['filters'](_[_0xd43f('0x56')](_0x595980[_0xd43f('0x4b')],_0x5174ed[_0xd43f('0x4d')]));if(_0x595980[_0xd43f('0x4b')][_0xd43f('0x57')]){_0x22bd32[_0xd43f('0x55')]=_[_0xd43f('0x58')](_0x22bd32['where'],{'$or':_[_0xd43f('0x46')](_0x22bd32[_0xd43f('0x50')],function(_0x148b77){var _0x50cc7e={};_0x50cc7e[_0x148b77]={'$like':'%'+_0x595980[_0xd43f('0x4b')]['filter']+'%'};return _0x50cc7e;})});}_0x22bd32=_[_0xd43f('0x58')]({},_0x22bd32,_0x595980['options']);return _0x1bcde4[_0xd43f('0x135')](_0x22bd32);}})['then'](function(_0x36c15e){if(_0x36c15e){_0x2040d8=_0x36c15e[_0xd43f('0x51')];if(!_0x595980[_0xd43f('0x4b')]['hasOwnProperty'](_0xd43f('0x52'))){_0x22bd32['limit']=qs[_0xd43f('0x26')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x26')]);_0x22bd32[_0xd43f('0x24')]=qs[_0xd43f('0x24')](_0x595980[_0xd43f('0x4b')][_0xd43f('0x24')]);}return _0x1bcde4[_0xd43f('0x135')](_0x22bd32);}})[_0xd43f('0x2a')](function(_0x190cc9){if(_0x190cc9){return _0x190cc9?{'count':_0x2040d8,'rows':_0x190cc9}:null;}})[_0xd43f('0x2a')](respondWithResult(_0x1af0a4,null))[_0xd43f('0x5f')](handleError(_0x1af0a4,null));};
\ No newline at end of file
+var _0xfa2b=['ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','CompanyId','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','toPairsIn','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tags','color','tag','getSnippet','Intervals','custom','License','increment','timezone','ifTime','server/files/chat/iframe.ejs','3.10.1','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','json','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','end','status','offset','undefined','limit','count','then','ChatWebsites','UserProfileResource','destroy','stack','name','setUA','user-agent','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','model','vendor','device','type','stringify','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','find','create','body','address','split','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','forEach','testWildcardValidity','Pause','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','nolimit','pick','Disposition','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','notify','chat','from','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','Contacts','DESC','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','Applications','priority','asc','List','ListId','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership'];(function(_0x1cb3bd,_0x26d60f){var _0xe19894=function(_0x5ee5a9){while(--_0x5ee5a9){_0x1cb3bd['push'](_0x1cb3bd['shift']());}};_0xe19894(++_0x26d60f);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0xd9bdf5,_0x40909f){_0xd9bdf5=_0xd9bdf5-0x0;var _0x3e0dc6=_0xfa2b[_0xd9bdf5];return _0x3e0dc6;};'use strict';var Mustache=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var path=require(_0xbfa2('0x2'));var ejs=require(_0xbfa2('0x3'));var fs=require('fs');var fs_extra=require(_0xbfa2('0x4'));var _=require(_0xbfa2('0x5'));var querystring=require(_0xbfa2('0x6'));var htmlToText=require(_0xbfa2('0x7'));var Redis=require(_0xbfa2('0x8'));var jayson=require(_0xbfa2('0x9'));var qs=require(_0xbfa2('0xa'));var logger=require(_0xbfa2('0xb'))(_0xbfa2('0xc'));var config=require(_0xbfa2('0xd'));var APIBadRequestError=require(_0xbfa2('0xe'))[_0xbfa2('0xf')];var APINotFoundError=require('../../errors/api')[_0xbfa2('0x10')];var APIOutOfIntervalError=require('../../errors/api')[_0xbfa2('0x11')];var APIHandleError=require(_0xbfa2('0xe'))[_0xbfa2('0x12')];var APIConflictError=require(_0xbfa2('0xe'))[_0xbfa2('0x13')];var wildcardUtils=require(_0xbfa2('0x14'));var URL=require(_0xbfa2('0x15'))[_0xbfa2('0x16')];var db=require(_0xbfa2('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xbfa2('0x18'),'port':0x18eb});var socket=require(_0xbfa2('0x19'))(new Redis(config[_0xbfa2('0x1a')]));require(_0xbfa2('0x1b'))[_0xbfa2('0x1c')](socket);var client=jayson[_0xbfa2('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xbfa2('0x1d')][_0xbfa2('0x1e')]({'port':0x232a});var client9003=jayson[_0xbfa2('0x1d')][_0xbfa2('0x1e')]({'port':0x232b});var client9001=jayson[_0xbfa2('0x1d')]['http']({'port':0x2329});function respondWithRpcPromise(_0xa988cc,_0x47db68,_0x5d3aa2,_0xee34b8){return new Promise(function(_0x55c9fe,_0x560190){var _0xab2c91=_0xee34b8||client;return _0xab2c91[_0xbfa2('0x1f')](_0xa988cc,_0x5d3aa2)['then'](function(_0xb9b6a3){logger[_0xbfa2('0x20')](_0xbfa2('0x21'),_0x47db68,_0xbfa2('0x22'));logger[_0xbfa2('0x23')](_0xbfa2('0x24'),_0x47db68,_0xbfa2('0x22'),JSON['stringify'](_0xb9b6a3));if(_0xb9b6a3[_0xbfa2('0x25')]){if(_0xb9b6a3[_0xbfa2('0x25')][_0xbfa2('0x26')]===0x1f4){logger['error'](_0xbfa2('0x21'),_0x47db68,_0xb9b6a3[_0xbfa2('0x25')]['message']);return _0x560190(_0xb9b6a3[_0xbfa2('0x25')]['message']);}logger['error'](_0xbfa2('0x21'),_0x47db68,_0xb9b6a3[_0xbfa2('0x25')][_0xbfa2('0x27')]);return _0x55c9fe(_0xb9b6a3[_0xbfa2('0x25')]['message']);}else{logger['info'](_0xbfa2('0x21'),_0x47db68,_0xbfa2('0x22'));_0x55c9fe(_0xb9b6a3['result'][_0xbfa2('0x27')]);}})['catch'](function(_0xeb88ab){logger['error'](_0xbfa2('0x21'),_0x47db68,_0xeb88ab);_0x560190(_0xeb88ab);});});}function respondWithStatusCode(_0xbe4d26,_0x8488e1){_0x8488e1=_0x8488e1||0xcc;return function(_0x38c5dc){if(_0x38c5dc){return _0xbe4d26[_0xbfa2('0x28')](_0x8488e1);}return _0xbe4d26['status'](_0x8488e1)[_0xbfa2('0x29')]();};}function respondWithResult(_0x2f9217,_0x4f782b){_0x4f782b=_0x4f782b||0xc8;return function(_0x37ec27){if(_0x37ec27){return _0x2f9217[_0xbfa2('0x2a')](_0x4f782b)['json'](_0x37ec27);}};}function respondWithFilteredResult(_0x2cbc51,_0x5ecd55){return function(_0x16bc84){if(_0x16bc84){var _0x56dd44=typeof _0x5ecd55[_0xbfa2('0x2b')]===_0xbfa2('0x2c')&&typeof _0x5ecd55[_0xbfa2('0x2d')]===_0xbfa2('0x2c');var _0x49d563=_0x16bc84[_0xbfa2('0x2e')];var _0x4aac4e=_0x56dd44?0x0:_0x5ecd55[_0xbfa2('0x2b')];var _0x36a30d=_0x56dd44?_0x16bc84[_0xbfa2('0x2e')]:_0x5ecd55['offset']+_0x5ecd55[_0xbfa2('0x2d')];var _0x17e471;if(_0x36a30d>=_0x49d563){_0x36a30d=_0x49d563;_0x17e471=0xc8;}else{_0x17e471=0xce;}_0x2cbc51[_0xbfa2('0x2a')](_0x17e471);return _0x2cbc51['set']('Content-Range',_0x4aac4e+'-'+_0x36a30d+'/'+_0x49d563)['json'](_0x16bc84);}return null;};}function saveUpdates(_0x2d5050){return function(_0x12069c){if(_0x12069c){return _0x12069c['update'](_0x2d5050)[_0xbfa2('0x2f')](function(_0x2ae697){return _0x2ae697;});}return null;};}function removeEntity(_0x39d1ce){return function(_0x206119){if(_0x206119){return _0x206119['destroy']()[_0xbfa2('0x2f')](function(){var _0x9523b7=_0x206119['get']({'plain':!![]});var _0x63ed08=_0xbfa2('0x30');return db[_0xbfa2('0x31')][_0xbfa2('0x32')]({'where':{'type':_0x63ed08,'resourceId':_0x9523b7['id']}})[_0xbfa2('0x2f')](function(){return _0x206119;});})[_0xbfa2('0x2f')](function(){_0x39d1ce[_0xbfa2('0x2a')](0xcc)[_0xbfa2('0x29')]();});}};}function handleEntityNotFound(_0x787887){return function(_0x5d6c57){if(!_0x5d6c57){_0x787887[_0xbfa2('0x28')](0x194);}return _0x5d6c57;};}function handleError(_0x5c910b,_0x2518dd){_0x2518dd=_0x2518dd||0x1f4;return function(_0x57c93c){logger[_0xbfa2('0x25')](_0x57c93c[_0xbfa2('0x33')]);if(_0x57c93c[_0xbfa2('0x34')]){delete _0x57c93c[_0xbfa2('0x34')];}_0x5c910b[_0xbfa2('0x2a')](_0x2518dd)['send'](_0x57c93c);};}function createInteractionObject(_0x3ed2f0,_0x31bb3f,_0xb264a6,_0xf53cdb){var _0xa6f846=require('user-agent-parser');var _0x4b9647=new _0xa6f846();var _0x2e2674=_0x4b9647[_0xbfa2('0x35')](_0xb264a6[_0xbfa2('0x36')])['getResult']();var _0x4f1362=_0x31bb3f[_0xbfa2('0x37')];if(_0xb264a6[_0xbfa2('0x38')]){_0x4f1362=_0xb264a6['cf-connecting-ip'];}else if(_0xb264a6['x-forwarded-for']){_0x4f1362=_[_0xbfa2('0x39')](_0xb264a6[_0xbfa2('0x3a')]['split'](','));}return{'ContactId':_0xf53cdb['id'],'ChatWebsiteId':_0x3ed2f0,'from':(_0xf53cdb[_0xbfa2('0x3b')]||'')+'\x20'+(_0xf53cdb[_0xbfa2('0x3c')]||''),'customerIp':_0x4f1362,'customerPort':_0xb264a6[_0xbfa2('0x3d')]?_0xb264a6[_0xbfa2('0x3d')]:null,'referer':_0x31bb3f[_0xbfa2('0x3e')],'browserName':_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x34')]&&_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x40')]?util[_0xbfa2('0x41')](_0xbfa2('0x42'),_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x34')],_0x2e2674[_0xbfa2('0x3f')][_0xbfa2('0x40')]):_0xbfa2('0x43'),'browserVersion':_0x2e2674[_0xbfa2('0x3f')]['version']||_0xbfa2('0x43'),'osName':util[_0xbfa2('0x41')](_0xbfa2('0x42'),_0x2e2674['os'][_0xbfa2('0x34')],_0x2e2674['os'][_0xbfa2('0x40')]),'osVersion':_0x2e2674['os'][_0xbfa2('0x40')],'deviceModel':_0x2e2674['device'][_0xbfa2('0x44')]&&_0x2e2674['device'][_0xbfa2('0x45')]?util[_0xbfa2('0x41')]('%s\x20%s\x20%s',_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x44')],_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x45')],_0x2e2674[_0xbfa2('0x46')]['type']):null,'deviceVendor':_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x45')],'deviceType':_0x2e2674[_0xbfa2('0x46')][_0xbfa2('0x47')],'formData':JSON[_0xbfa2('0x48')](_0x31bb3f)};}exports[_0xbfa2('0x49')]=function(_0x1a353b,_0x25a54f){var _0x4a43f8={'include':[{'model':db['Pause'],'as':_0xbfa2('0x4a')}]},_0x20eb6e={},_0xba5a16={'count':0x0,'rows':[]};var _0x38c005=_[_0xbfa2('0x4b')](db[_0xbfa2('0x4c')][_0xbfa2('0x4d')],function(_0x31ef59){return{'name':_0x31ef59[_0xbfa2('0x4e')],'type':_0x31ef59[_0xbfa2('0x47')][_0xbfa2('0x4f')]};});_0x20eb6e['model']=_[_0xbfa2('0x4b')](_0x38c005,_0xbfa2('0x34'));_0x20eb6e[_0xbfa2('0x50')]=_['keys'](_0x1a353b['query']);_0x20eb6e[_0xbfa2('0x51')]=_['intersection'](_0x20eb6e[_0xbfa2('0x44')],_0x20eb6e[_0xbfa2('0x50')]);_0x4a43f8['attributes']=_[_0xbfa2('0x52')](_0x20eb6e[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x1a353b['query'][_0xbfa2('0x53')]));_0x4a43f8['attributes']=_0x4a43f8[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x4a43f8['attributes']:_0x20eb6e[_0xbfa2('0x44')];if(!_0x1a353b['query'][_0xbfa2('0x56')]('nolimit')){_0x4a43f8[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x1a353b[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x4a43f8[_0xbfa2('0x2b')]=qs['offset'](_0x1a353b['query']['offset']);}_0x4a43f8[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x1a353b[_0xbfa2('0x50')]['sort']);_0x4a43f8[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_['pick'](_0x1a353b[_0xbfa2('0x50')],_0x20eb6e[_0xbfa2('0x51')]),_0x38c005);if(_0x1a353b['query'][_0xbfa2('0x5a')]){_0x4a43f8[_0xbfa2('0x59')]=_['merge'](_0x4a43f8['where'],{'$or':_[_0xbfa2('0x4b')](_0x38c005,function(_0x4a705f){if(_0x4a705f[_0xbfa2('0x47')]!==_0xbfa2('0x5b')){var _0x55da83={};_0x55da83[_0x4a705f[_0xbfa2('0x34')]]={'$like':'%'+_0x1a353b[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x55da83;}})});}_0x4a43f8=_[_0xbfa2('0x5c')]({},_0x4a43f8,_0x1a353b[_0xbfa2('0x5d')]);var _0x28d7c5={'where':_0x4a43f8[_0xbfa2('0x59')]};return db[_0xbfa2('0x4c')][_0xbfa2('0x2e')](_0x28d7c5)[_0xbfa2('0x2f')](function(_0x33531){_0xba5a16[_0xbfa2('0x2e')]=_0x33531;if(_0x1a353b[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x4a43f8['include']=[{'all':!![]}];}return db[_0xbfa2('0x4c')]['findAll'](_0x4a43f8);})[_0xbfa2('0x2f')](function(_0x401f2c){_0xba5a16[_0xbfa2('0x5f')]=_0x401f2c;return _0xba5a16;})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x25a54f,_0x4a43f8))[_0xbfa2('0x60')](handleError(_0x25a54f,null));};exports[_0xbfa2('0x61')]=function(_0x36b0df,_0x1b8c24){var _0x41749d={'raw':![],'where':{'id':_0x36b0df[_0xbfa2('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0xbfa2('0x4a')}]},_0x2ea55c={};_0x2ea55c[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0x4c')]['rawAttributes']);_0x2ea55c[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x36b0df[_0xbfa2('0x50')]);_0x2ea55c[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x2ea55c['model'],_0x2ea55c[_0xbfa2('0x50')]);_0x41749d[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x2ea55c[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x36b0df[_0xbfa2('0x50')]['fields']));_0x41749d[_0xbfa2('0x54')]=_0x41749d[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x41749d[_0xbfa2('0x54')]:_0x2ea55c[_0xbfa2('0x44')];if(_0x36b0df['query'][_0xbfa2('0x5e')]){_0x41749d['include']=[{'all':!![]}];}_0x41749d=_[_0xbfa2('0x5c')]({},_0x41749d,_0x36b0df[_0xbfa2('0x5d')]);return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x41749d)['then'](handleEntityNotFound(_0x1b8c24,null))['then'](respondWithResult(_0x1b8c24,null))[_0xbfa2('0x60')](handleError(_0x1b8c24,null));};exports[_0xbfa2('0x65')]=function(_0x15c172,_0x4ec9b0){var _0x1ab345=null;_0x15c172[_0xbfa2('0x66')][_0xbfa2('0x67')][_0xbfa2('0x68')](',')['forEach'](_0x433448=>{if(_0x433448[_0xbfa2('0x69')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x433448[_0xbfa2('0x69')]())){_0x1ab345=new APIBadRequestError('\x22'+_0x433448[_0xbfa2('0x69')]()+_0xbfa2('0x6a'));}});if(_0x1ab345){return handleError(_0x4ec9b0,null)(_0x1ab345);}return db[_0xbfa2('0x4c')]['create'](_0x15c172['body'],{})[_0xbfa2('0x2f')](function(_0x140627){var _0x8de0a6=_0x15c172[_0xbfa2('0x6b')][_0xbfa2('0x6c')]({'plain':!![]});if(!_0x8de0a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8de0a6[_0xbfa2('0x6d')]===_0xbfa2('0x6b')){var _0x3c5ff6=_0x140627['get']({'plain':!![]});var _0x288e11=_0xbfa2('0x30');return db[_0xbfa2('0x6e')][_0xbfa2('0x64')]({'where':{'name':_0x288e11,'userProfileId':_0x8de0a6['userProfileId']},'raw':!![]})['then'](function(_0x149ee3){if(_0x149ee3&&_0x149ee3['autoAssociation']===0x0){return db[_0xbfa2('0x31')][_0xbfa2('0x65')]({'name':_0x3c5ff6[_0xbfa2('0x34')],'resourceId':_0x3c5ff6['id'],'type':_0x149ee3[_0xbfa2('0x34')],'sectionId':_0x149ee3['id']},{})[_0xbfa2('0x2f')](function(){return _0x140627;});}else{return _0x140627;}})['catch'](function(_0x4611e2){logger[_0xbfa2('0x25')](_0xbfa2('0x6f'),_0x4611e2);throw _0x4611e2;});}return _0x140627;})['then'](respondWithResult(_0x4ec9b0,0xc9))['catch'](handleError(_0x4ec9b0,null));};exports[_0xbfa2('0x70')]=function(_0x48029a,_0x5b8407){var _0x5ea6fd=null;_0x48029a[_0xbfa2('0x66')]['address'][_0xbfa2('0x68')](',')[_0xbfa2('0x71')](_0xdde19=>{if(_0xdde19[_0xbfa2('0x69')]()!==''&&!wildcardUtils[_0xbfa2('0x72')](_0xdde19[_0xbfa2('0x69')]())){_0x5ea6fd=new APIBadRequestError('\x22'+_0xdde19[_0xbfa2('0x69')]()+_0xbfa2('0x6a'));}});if(_0x5ea6fd){return handleError(_0x5b8407,null)(_0x5ea6fd);}if(_0x48029a[_0xbfa2('0x66')]['id']){delete _0x48029a[_0xbfa2('0x66')]['id'];}return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x48029a[_0xbfa2('0x62')]['id']},'include':[{'model':db[_0xbfa2('0x73')],'as':_0xbfa2('0x4a')}]})[_0xbfa2('0x2f')](handleEntityNotFound(_0x5b8407,null))[_0xbfa2('0x2f')](saveUpdates(_0x48029a[_0xbfa2('0x66')],null))[_0xbfa2('0x2f')](respondWithResult(_0x5b8407,null))[_0xbfa2('0x60')](handleError(_0x5b8407,null));};exports[_0xbfa2('0x32')]=function(_0x31bab8,_0x4d94a4){return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x31bab8[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x4d94a4,null))[_0xbfa2('0x2f')](removeEntity(_0x4d94a4,null))[_0xbfa2('0x60')](handleError(_0x4d94a4,null));};exports['describe']=function(_0x2dd954,_0x1f4482){return db['ChatWebsite'][_0xbfa2('0x74')]()['then'](respondWithResult(_0x1f4482,null))[_0xbfa2('0x60')](handleError(_0x1f4482,null));};exports[_0xbfa2('0x75')]=function(_0x128617,_0x196367){if(_0x128617[_0xbfa2('0x66')]['id']){delete _0x128617[_0xbfa2('0x66')]['id'];}return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x128617[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x196367,null))[_0xbfa2('0x2f')](function(_0x405375){if(_0x405375){_0x128617['body'][_0xbfa2('0x76')]=_0x405375['id'];return db['Disposition']['create'](_0x128617[_0xbfa2('0x66')]);}})[_0xbfa2('0x2f')](respondWithResult(_0x196367,null))[_0xbfa2('0x60')](handleError(_0x196367,null));};exports[_0xbfa2('0x77')]=function(_0x584bf3,_0x417abc){var _0x4bd996={'raw':![],'where':{}};var _0x3a4027={};var _0x3f077a={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x584bf3[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x417abc,null))[_0xbfa2('0x2f')](function(_0x186b09){if(_0x186b09){_0x3a4027[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db['Disposition'][_0xbfa2('0x4d')]);_0x3a4027[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x584bf3[_0xbfa2('0x50')]);_0x3a4027[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x3a4027['model'],_0x3a4027[_0xbfa2('0x50')]);_0x4bd996[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x3a4027[_0xbfa2('0x44')],qs['fields'](_0x584bf3['query'][_0xbfa2('0x53')]));_0x4bd996[_0xbfa2('0x54')]=_0x4bd996[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x4bd996[_0xbfa2('0x54')]:_0x3a4027[_0xbfa2('0x44')];if(!_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x56')](_0xbfa2('0x79'))){_0x4bd996['limit']=qs['limit'](_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x4bd996['offset']=qs[_0xbfa2('0x2b')](_0x584bf3['query'][_0xbfa2('0x2b')]);}_0x4bd996[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x4bd996['where']=qs['filters'](_[_0xbfa2('0x7a')](_0x584bf3['query'],_0x3a4027[_0xbfa2('0x51')]));_0x4bd996[_0xbfa2('0x59')]['ChatWebsiteId']=_0x186b09['id'];if(_0x584bf3[_0xbfa2('0x50')]['filter']){_0x4bd996['where']=_[_0xbfa2('0x5c')](_0x4bd996[_0xbfa2('0x59')],{'$or':_['map'](_0x4bd996[_0xbfa2('0x54')],function(_0x20ee10){var _0x3bd6d8={};_0x3bd6d8[_0x20ee10]={'$like':'%'+_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x3bd6d8;})});}_0x4bd996=_[_0xbfa2('0x5c')]({},_0x4bd996,_0x584bf3[_0xbfa2('0x5d')]);return db[_0xbfa2('0x7b')][_0xbfa2('0x2e')]({'where':_0x4bd996[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x1e8bd8){_0x3f077a[_0xbfa2('0x2e')]=_0x1e8bd8;if(_0x584bf3[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x4bd996[_0xbfa2('0x7c')]=[{'all':!![]}];}return db[_0xbfa2('0x7b')][_0xbfa2('0x7d')](_0x4bd996);})['then'](function(_0x595f1f){_0x3f077a[_0xbfa2('0x5f')]=_0x595f1f;return _0x3f077a;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x417abc,_0x4bd996))[_0xbfa2('0x60')](handleError(_0x417abc,null));};exports[_0xbfa2('0x7e')]=function(_0x46f369,_0x52c47c){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x46f369[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x52c47c,null))[_0xbfa2('0x2f')](function(_0x71ac8e){if(_0x71ac8e){return _0x71ac8e[_0xbfa2('0x7e')](_0x46f369[_0xbfa2('0x50')][_0xbfa2('0x7f')]);}})[_0xbfa2('0x2f')](respondWithStatusCode(_0x52c47c,null))[_0xbfa2('0x60')](handleError(_0x52c47c,null));};exports[_0xbfa2('0x80')]=function(_0x352788,_0x3c398e){if(_0x352788['body']['id']){delete _0x352788[_0xbfa2('0x66')]['id'];}return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x352788['params']['id']}})['then'](handleEntityNotFound(_0x3c398e,null))[_0xbfa2('0x2f')](function(_0x24bb46){if(_0x24bb46){_0x352788[_0xbfa2('0x66')][_0xbfa2('0x76')]=_0x24bb46['id'];return db[_0xbfa2('0x81')][_0xbfa2('0x65')](_0x352788[_0xbfa2('0x66')]);}})['then'](respondWithResult(_0x3c398e,null))['catch'](handleError(_0x3c398e,null));};exports[_0xbfa2('0x82')]=function(_0x2e4715,_0x40dbef){var _0x1cab3f={'raw':![],'where':{}};var _0x5e5a3a={};var _0x1f93eb={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x2e4715[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x40dbef,null))['then'](function(_0x515bad){if(_0x515bad){_0x5e5a3a[_0xbfa2('0x44')]=_['keys'](db[_0xbfa2('0x81')][_0xbfa2('0x4d')]);_0x5e5a3a[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x2e4715[_0xbfa2('0x50')]);_0x5e5a3a[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x5e5a3a['model'],_0x5e5a3a[_0xbfa2('0x50')]);_0x1cab3f[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x5e5a3a[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x2e4715['query']['fields']));_0x1cab3f[_0xbfa2('0x54')]=_0x1cab3f[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x1cab3f['attributes']:_0x5e5a3a[_0xbfa2('0x44')];if(!_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x56')](_0xbfa2('0x79'))){_0x1cab3f['limit']=qs['limit'](_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x1cab3f['offset']=qs[_0xbfa2('0x2b')](_0x2e4715['query'][_0xbfa2('0x2b')]);}_0x1cab3f[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x2e4715['query'][_0xbfa2('0x58')]);_0x1cab3f['where']=qs[_0xbfa2('0x51')](_[_0xbfa2('0x7a')](_0x2e4715[_0xbfa2('0x50')],_0x5e5a3a[_0xbfa2('0x51')]));_0x1cab3f['where'][_0xbfa2('0x76')]=_0x515bad['id'];if(_0x2e4715['query'][_0xbfa2('0x5a')]){_0x1cab3f[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x1cab3f[_0xbfa2('0x59')],{'$or':_[_0xbfa2('0x4b')](_0x1cab3f['attributes'],function(_0x1cc3a6){var _0x4e94d7={};_0x4e94d7[_0x1cc3a6]={'$like':'%'+_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x4e94d7;})});}_0x1cab3f=_[_0xbfa2('0x5c')]({},_0x1cab3f,_0x2e4715[_0xbfa2('0x5d')]);return db[_0xbfa2('0x81')][_0xbfa2('0x2e')]({'where':_0x1cab3f[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x244b4f){_0x1f93eb[_0xbfa2('0x2e')]=_0x244b4f;if(_0x2e4715[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x1cab3f['include']=[{'all':!![]}];}return db[_0xbfa2('0x81')][_0xbfa2('0x7d')](_0x1cab3f);})['then'](function(_0x5785aa){_0x1f93eb[_0xbfa2('0x5f')]=_0x5785aa;return _0x1f93eb;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x40dbef,_0x1cab3f))[_0xbfa2('0x60')](handleError(_0x40dbef,null));};exports[_0xbfa2('0x83')]=function(_0x9a0a20,_0xb2ba9f){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x9a0a20['params']['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0xb2ba9f,null))[_0xbfa2('0x2f')](function(_0x267df7){if(_0x267df7){return _0x267df7[_0xbfa2('0x83')](_0x9a0a20[_0xbfa2('0x50')][_0xbfa2('0x7f')]);}})[_0xbfa2('0x2f')](respondWithStatusCode(_0xb2ba9f,null))[_0xbfa2('0x60')](handleError(_0xb2ba9f,null));};exports[_0xbfa2('0x84')]=function(_0x15de6a,_0x3de98d){_0x15de6a[_0xbfa2('0x66')]['sitepic']=_0x15de6a[_0xbfa2('0x85')]['filename'];return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x15de6a[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x3de98d,null))[_0xbfa2('0x2f')](saveUpdates(_0x15de6a[_0xbfa2('0x66')],null))[_0xbfa2('0x2f')](respondWithResult(_0x3de98d,null))[_0xbfa2('0x60')](handleError(_0x3de98d,null));};exports[_0xbfa2('0x86')]=function(_0x178f44,_0x304e23){_0x178f44['body'][_0xbfa2('0x87')]=_0x178f44['file'][_0xbfa2('0x88')];return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x178f44[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x304e23,null))['then'](saveUpdates(_0x178f44[_0xbfa2('0x66')],null))['then'](respondWithResult(_0x304e23,null))[_0xbfa2('0x60')](handleError(_0x304e23,null));};exports[_0xbfa2('0x89')]=function(_0x21555a,_0x599631){_0x21555a[_0xbfa2('0x66')]['customerAvatar']=_0x21555a[_0xbfa2('0x85')][_0xbfa2('0x88')];return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x21555a['params']['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x599631,null))[_0xbfa2('0x2f')](saveUpdates(_0x21555a['body'],null))['then'](respondWithResult(_0x599631,null))['catch'](handleError(_0x599631,null));};exports[_0xbfa2('0x8a')]=function(_0x2d05f6,_0x6713ce){_0x2d05f6[_0xbfa2('0x66')][_0xbfa2('0x8b')]=_0x2d05f6[_0xbfa2('0x85')][_0xbfa2('0x88')];return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x2d05f6['params']['id']}})['then'](handleEntityNotFound(_0x6713ce,null))[_0xbfa2('0x2f')](saveUpdates(_0x2d05f6[_0xbfa2('0x66')],null))[_0xbfa2('0x2f')](respondWithResult(_0x6713ce,null))[_0xbfa2('0x60')](handleError(_0x6713ce,null));};exports[_0xbfa2('0x8c')]=function(_0x24a52a,_0x36577e){var _0x4f7177=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x8f'));var _0x2286ae={'where':{'id':_0x24a52a[_0xbfa2('0x62')]['id']},'attributes':['id',_0xbfa2('0x90')],'raw':!![]};var _0x2f43d5=![];return require(_0xbfa2('0x91'))[_0xbfa2('0x92')]()[_0xbfa2('0x2f')](function(_0x4523a4){if(_0x4523a4){_0x2f43d5=_0x4523a4['custom'];}})[_0xbfa2('0x2f')](function(){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x2286ae);})[_0xbfa2('0x2f')](handleEntityNotFound(_0x36577e,null))[_0xbfa2('0x2f')](function(_0x2a172e){if(_0x2a172e){if(!_[_0xbfa2('0x93')](_0x2a172e['sitepic'])){if(fs[_0xbfa2('0x94')](path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x95'),_0x2a172e[_0xbfa2('0x90')]))&&_0x2f43d5){_0x4f7177=path['join'](config[_0xbfa2('0x8e')],_0xbfa2('0x95'),_0x2a172e[_0xbfa2('0x90')]);}}return _0x36577e[_0xbfa2('0x96')](_0x4f7177);}})['catch'](handleError(_0x36577e,null));};exports[_0xbfa2('0x97')]=function(_0x21f246,_0x3a2070){var _0x1461d4=path[_0xbfa2('0x8d')](config['root'],_0xbfa2('0x98'));var _0x529291={'where':{'id':_0x21f246[_0xbfa2('0x62')]['id']},'attributes':['id',_0xbfa2('0x87')],'raw':!![]};return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x529291)[_0xbfa2('0x2f')](handleEntityNotFound(_0x3a2070,null))[_0xbfa2('0x2f')](function(_0x418594){if(_0x418594){if(!_[_0xbfa2('0x93')](_0x418594['agentAvatar'])){if(fs[_0xbfa2('0x94')](path['join'](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x418594[_0xbfa2('0x87')]))){_0x1461d4=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x418594[_0xbfa2('0x87')]);}}return _0x3a2070[_0xbfa2('0x96')](_0x1461d4);}})[_0xbfa2('0x60')](handleError(_0x3a2070,null));};exports[_0xbfa2('0x9a')]=function(_0x373e78,_0x33828e){var _0x3495b2=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],'server/files/images/avatars/customer_avatar.png');var _0xfcea05={'where':{'id':_0x373e78['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0xfcea05)[_0xbfa2('0x2f')](handleEntityNotFound(_0x33828e,null))[_0xbfa2('0x2f')](function(_0x321b23){if(_0x321b23){if(!_[_0xbfa2('0x93')](_0x321b23['customerAvatar'])){if(fs[_0xbfa2('0x94')](path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x321b23[_0xbfa2('0x9b')]))&&_0x321b23[_0xbfa2('0x9c')]){_0x3495b2=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x321b23['customerAvatar']);}}return _0x33828e[_0xbfa2('0x96')](_0x3495b2);}})['catch'](handleError(_0x33828e,null));};exports[_0xbfa2('0x9d')]=function(_0x44ea29,_0xe51ea7){var _0x2170b8=path[_0xbfa2('0x8d')](config['root'],_0xbfa2('0x9e'));var _0x5e56ad={'where':{'id':_0x44ea29[_0xbfa2('0x62')]['id']},'attributes':['id',_0xbfa2('0x8b')],'raw':!![]};return db[_0xbfa2('0x4c')][_0xbfa2('0x64')](_0x5e56ad)[_0xbfa2('0x2f')](handleEntityNotFound(_0xe51ea7,null))[_0xbfa2('0x2f')](function(_0x2ec64e){if(_0x2ec64e){if(!_[_0xbfa2('0x93')](_0x2ec64e[_0xbfa2('0x8b')])){if(fs[_0xbfa2('0x94')](path['join'](config[_0xbfa2('0x8e')],'server/files/images/avatars/',_0x2ec64e[_0xbfa2('0x8b')]))){_0x2170b8=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0x99'),_0x2ec64e[_0xbfa2('0x8b')]);}}return _0xe51ea7[_0xbfa2('0x96')](_0x2170b8);}})[_0xbfa2('0x60')](handleError(_0xe51ea7,null));};function checkWebsiteInterval(_0x68a1b6){var _0x1749ff=_0x68a1b6[_0xbfa2('0x9f')];if(!_0x1749ff){return Promise[_0xbfa2('0xa0')](_0x68a1b6);}var _0x17205f=_0x68a1b6['timezone']||undefined;return _0x1749ff['ifTime'](_0x17205f)['then'](function(_0x403c85){if(!_0x403c85){throw new APIOutOfIntervalError();}return _0x68a1b6;});}exports[_0xbfa2('0xa1')]=function(_0x112b9f,_0x5d4b42){var _0x3ddd75={'body':_0x112b9f[_0xbfa2('0x66')],'channel':_0xbfa2('0xa2')};var _0x5dd72f=[];var _0x1551c5=[];var _0xc559f4={};var _0x2d4041=![];if(_0x112b9f[_0xbfa2('0x66')]['id']){delete _0x112b9f[_0xbfa2('0x66')]['id'];}if(_[_0xbfa2('0x93')](_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xbfa2('0x93')](_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa4')])){throw new APIBadRequestError(_0xbfa2('0xa5'));}if(_[_0xbfa2('0xa6')](_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0x66')])){throw new APIBadRequestError(_0xbfa2('0xa7'));}var _0x22d06f=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0x37')]&&_0x112b9f[_0xbfa2('0x66')]['referer'];return db[_0xbfa2('0xa8')][_0xbfa2('0x74')]()[_0xbfa2('0x2f')](function(_0x1fe7cb){if(!_0x1fe7cb){throw new Error(_0xbfa2('0xa9'));}_0x5dd72f=Object['keys'](_0x1fe7cb)[_0xbfa2('0x5a')](function(_0x89f72a){return![_0xbfa2('0xaa'),'updatedAt']['includes'](_0x89f72a);});_0x1551c5=Object[_0xbfa2('0x63')](_0x1fe7cb)[_0xbfa2('0x5a')](function(_0x24aeeb){return![_0xbfa2('0xaa'),_0xbfa2('0xab'),'CompanyId','ListId'][_0xbfa2('0xac')](_0x24aeeb);});if(!_[_0xbfa2('0xac')](_0x1551c5,_0x112b9f['body'][_0xbfa2('0xa4')])){throw new APIBadRequestError(_0xbfa2('0xad')+_0x1551c5[_0xbfa2('0x8d')](',\x20'));}_0xc559f4[_0x112b9f['body'][_0xbfa2('0xa4')]]=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')];})[_0xbfa2('0x2f')](function(){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x112b9f['params']['id']},'include':[{'model':db[_0xbfa2('0xae')],'as':'List','include':[{'model':db[_0xbfa2('0xa8')],'as':_0xbfa2('0xaf'),'where':_0xc559f4,'limit':0x1,'order':[[_0xbfa2('0xab'),_0xbfa2('0xb0')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db['Interval'],'as':_0xbfa2('0x9f'),'include':[{'model':db[_0xbfa2('0x9f')],'as':'Intervals','attributes':['id',_0xbfa2('0xb1')],'raw':!![]}]}]});})[_0xbfa2('0x2f')](function(_0x29a04e){if(!_0x29a04e){throw new APINotFoundError(util[_0xbfa2('0x41')](_0xbfa2('0xb2'),_0x112b9f[_0xbfa2('0x62')]['id']));}if(_0x22d06f){return checkWebsiteInterval(_0x29a04e);}return _0x29a04e;})[_0xbfa2('0x2f')](function(_0x3937a4){_0x3ddd75[_0xbfa2('0xb3')]=_0x3937a4;_0x3ddd75[_0xbfa2('0xb4')]=_['orderBy'](_0x3937a4[_0xbfa2('0xb5')],[_0xbfa2('0xb6')],[_0xbfa2('0xb7')]);if(_0x3ddd75['account'][_0xbfa2('0xb5')]){delete _0x3ddd75['account']['Applications'];}_0x3ddd75['list']=_0x3937a4[_0xbfa2('0xb8')]||{'id':_0x3937a4[_0xbfa2('0xb9')]};if(_0x3ddd75[_0xbfa2('0xba')]&&_0x3ddd75[_0xbfa2('0xba')][_0xbfa2('0xaf')]['length']){return _0x3ddd75[_0xbfa2('0xba')]['Contacts'][0x0];}var _0x4a99e7=_['defaults'](_0x112b9f[_0xbfa2('0x66')],{'firstName':_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')],'ListId':_0x3937a4['ListId']});_0x4a99e7[_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa4')]]=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xa3')];return db[_0xbfa2('0xa8')][_0xbfa2('0x65')](_0x4a99e7,{'fields':_0x5dd72f,'raw':!![]});})[_0xbfa2('0x2f')](function(_0x20086d){_0x3ddd75[_0xbfa2('0xbb')]=_0x20086d;var _0x40051f=createInteractionObject(_0x112b9f['params']['id'],_0x112b9f[_0xbfa2('0x66')],_0x112b9f[_0xbfa2('0xbc')],_0x20086d);var _0x2c83eb={'ChatWebsiteId':_0x112b9f[_0xbfa2('0x62')]['id']};if(_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xbd')]){_0x2c83eb[_0xbfa2('0xbd')]=_0x112b9f['body']['threadId'];_0x2c83eb[_0xbfa2('0xbe')]=![];return db[_0xbfa2('0xbf')][_0xbfa2('0x64')]({'where':_0x2c83eb})[_0xbfa2('0x2f')](function(_0x59abdc){var _0x17162a=_0x112b9f[_0xbfa2('0x66')]['customerIp']&&_0x112b9f[_0xbfa2('0x66')]['referer'];if(_0x59abdc){_0x2d4041=!![];return _0x59abdc;}else if(!_0x17162a&&_0x59abdc&&_0x59abdc[_0xbfa2('0xbe')]){throw new APIConflictError(_0xbfa2('0xc0'));}_0x40051f[_0xbfa2('0xbd')]=_0x112b9f[_0xbfa2('0x66')]['threadId'];_0x40051f['externalUrl']=_0x112b9f['body']['externalUrl'];return db['ChatInteraction'][_0xbfa2('0x65')](_0x40051f);});}_0x2c83eb[_0xbfa2('0xc1')]=_0x20086d['id'];if(_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc2')]&&_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc2')]['id']){_0x2c83eb['id']=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc2')]['id'];return db['ChatInteraction'][_0xbfa2('0x64')]({'where':_0x2c83eb})[_0xbfa2('0x2f')](function(_0x288f7e){var _0x2ae6eb=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0x37')]&&_0x112b9f['body']['referer'];if(!_0x2ae6eb&&_0x288f7e&&_0x288f7e['closed']){throw new APIConflictError(_0xbfa2('0xc0'));}else if(_0x288f7e){_0x2d4041=!![];return _0x288f7e;}else{return db['ChatInteraction'][_0xbfa2('0x65')](_0x40051f);}});}return db[_0xbfa2('0xbf')][_0xbfa2('0x65')](_0x40051f);})[_0xbfa2('0x2f')](function(_0x5ac9d4){if(!_0x2d4041){return _0x5ac9d4;}var _0x44f395={'from':(_0x3ddd75[_0xbfa2('0xbb')]['firstName']||'')+'\x20'+(_0x3ddd75[_0xbfa2('0xbb')][_0xbfa2('0x3c')]||'')};if(_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xbd')]&&_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc3')]&&_0x112b9f['body'][_0xbfa2('0xbd')]!=_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xc3')]){_0x44f395[_0xbfa2('0xbd')]=_0x112b9f['body']['messageId'];}return _0x5ac9d4[_0xbfa2('0x70')](_0x44f395);})[_0xbfa2('0x2f')](function(_0x10e794){_0x3ddd75[_0xbfa2('0xc2')]=_0x10e794[_0xbfa2('0x6c')]({'plain':!![]});_0x3ddd75['interaction'][_0xbfa2('0xc4')]=!_0x2d4041;if(_0x3ddd75['interaction'][_0xbfa2('0xc4')]){if(_0x3ddd75[_0xbfa2('0xb3')][_0xbfa2('0xc5')]){_0x3ddd75[_0xbfa2('0xb4')][_0xbfa2('0xc6')]({'id':0x0,'priority':_0x3ddd75[_0xbfa2('0xb4')][_0xbfa2('0x55')]+0x1,'app':_0xbfa2('0xc7'),'appdata':_0xbfa2('0xc8'),'interval':'*,*,*,*'});}}return db[_0xbfa2('0xc9')][_0xbfa2('0x65')]({'body':_0x112b9f[_0xbfa2('0x66')]['body'],'ChatWebsiteId':_0x112b9f[_0xbfa2('0x62')]['id'],'ChatInteractionId':_0x10e794['id'],'direction':'in','ContactId':_0x3ddd75[_0xbfa2('0xbb')]['id'],'AttachmentId':_0x112b9f[_0xbfa2('0x66')][_0xbfa2('0xca')]});})[_0xbfa2('0x2f')](function(_0x46b515){_0x3ddd75[_0xbfa2('0x27')]=_0x46b515;if(!_0x3ddd75[_0xbfa2('0xc2')][_0xbfa2('0xcb')]){return;}return db[_0xbfa2('0xcc')][_0xbfa2('0x64')]({'attributes':['id',_0xbfa2('0x34')],'where':{'id':_0x3ddd75[_0xbfa2('0xc2')][_0xbfa2('0xcb')]}});})[_0xbfa2('0x2f')](function(_0xf2681f){if(_0xf2681f){_0x3ddd75[_0xbfa2('0xb4')]['unshift']({'id':0x0,'priority':0x0,'app':_0xbfa2('0xcd'),'appdata':_0xf2681f[_0xbfa2('0x34')]+','+(_0x3ddd75[_0xbfa2('0xb3')][_0xbfa2('0xce')]||0xa),'interval':_0xbfa2('0xcf')});_0x3ddd75[_0xbfa2('0xd0')]=!![];}if(!_0x3ddd75[_0xbfa2('0xc2')]['queueId']){return;}return db[_0xbfa2('0xd1')][_0xbfa2('0x64')]({'attributes':['id',_0xbfa2('0x34')],'where':{'id':_0x3ddd75[_0xbfa2('0xc2')]['queueId']}});})['then'](function(_0x3b1ac8){if(_0x3b1ac8){_0x3ddd75[_0xbfa2('0xb4')]['unshift']({'id':0x0,'priority':0x1,'app':_0xbfa2('0xd2'),'appdata':_0x3b1ac8[_0xbfa2('0x34')]+','+(_0x3ddd75[_0xbfa2('0xb3')][_0xbfa2('0xd3')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xbfa2('0xd4'),_0x3ddd75);})[_0xbfa2('0x2f')](function(_0xcabfa5){respondWithRpcPromise(_0xbfa2('0xd5'),_0xbfa2('0xd5'),{'event':'notify','message':_0xcabfa5},client9002);return _0xcabfa5;})[_0xbfa2('0x2f')](respondWithResult(_0x5d4b42,null))[_0xbfa2('0x60')](APIHandleError(_0x5d4b42));};exports[_0xbfa2('0xd6')]=function(_0x3f4805,_0x776092){var _0x230cbc,_0x2a2f9a,_0xbe9477;var _0x4f6bd3=[];var _0x26b11c={};var _0x43b517=_0x3f4805[_0xbfa2('0xd7')]||[];var _0x38bb2b=[];var _0x24968b;return db['CmContact'][_0xbfa2('0x74')]()[_0xbfa2('0x2f')](function(_0x59ea3c){if(!_0x59ea3c){throw new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))](_0xbfa2('0xda'));}_0x4f6bd3=_[_0xbfa2('0xdb')](_['keys'](_0x59ea3c),[_0xbfa2('0xaa'),'updatedAt',_0xbfa2('0xdc'),_0xbfa2('0xb9')]);if(_0x3f4805['body']['id']){delete _0x3f4805['body']['id'];}if(_[_0xbfa2('0x93')](_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xa3')])){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))](_0xbfa2('0xde')));}if(_['isNil'](_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0x66')])||_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0x66')]===''){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xbfa2('0x93')](_0x3f4805['body'][_0xbfa2('0xdf')])){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db['Sequelize'][(_0xbfa2('0xd9'))](_0xbfa2('0xe0')+_0x4f6bd3));}if(!_[_0xbfa2('0xac')](_0x4f6bd3,_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xdf')])){throw _0x776092[_0xbfa2('0x2a')](0x1f4)[_0xbfa2('0xdd')](new db[(_0xbfa2('0xd8'))][(_0xbfa2('0xd9'))](_0xbfa2('0xe1')+_0x4f6bd3));}_0x26b11c[_0x3f4805['body'][_0xbfa2('0xdf')]]=_0x3f4805['body']['from'];})[_0xbfa2('0x2f')](function(){return db['ChatWebsite'][_0xbfa2('0x64')]({'where':{'id':_0x3f4805[_0xbfa2('0x62')]['id']},'include':[{'model':db[_0xbfa2('0xae')],'as':'List'},{'model':db[_0xbfa2('0xe2')],'as':_0xbfa2('0xe2')}]});})[_0xbfa2('0x2f')](handleEntityNotFound(_0x776092,null))['then'](function(_0x34eda4){if(_0x34eda4&&_0x34eda4[_0xbfa2('0xb8')]){_0x2a2f9a=_0x34eda4;var _0x2ef589=_[_0xbfa2('0xe3')](_0x3f4805[_0xbfa2('0x66')],{'firstName':_0x3f4805['body'][_0xbfa2('0xa3')],'phone':_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xa3')],'ListId':_0x34eda4[_0xbfa2('0xb9')]});_0x2ef589[_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0xdf')]]=_0x3f4805['body']['from'];return db[_0xbfa2('0xa8')][_0xbfa2('0xe4')]({'where':_0x26b11c,'defaults':_0x2ef589});}})['spread'](function(_0x1f9ba3){if(_0x1f9ba3){_0xbe9477=_0x1f9ba3;var _0x36e465=fs[_0xbfa2('0xe5')](path[_0xbfa2('0x8d')](config['root'],_0xbfa2('0xe6')),_0xbfa2('0xe7'));var _0x2691cd=ejs[_0xbfa2('0xe8')](_0x36e465,{'body':_[_0xbfa2('0xe9')](_0x3f4805[_0xbfa2('0x66')][_0xbfa2('0x66')]),'bodyTitle':_0x2a2f9a[_0xbfa2('0xea')]});return db[_0xbfa2('0xeb')]['create']({'body':_0x2691cd,'plainBody':htmlToText[_0xbfa2('0xec')](_0x2691cd),'ContactId':_0x1f9ba3['id'],'ChatWebsiteId':_0x2a2f9a['id']});}})[_0xbfa2('0x2f')](function(_0x1eab9d){_0x24968b=_0x1eab9d;if(_0x43b517[_0xbfa2('0x55')]){var _0x1c1d16=_0x43b517['map'](function(_0x2b4733){return{'name':_0x2b4733[_0xbfa2('0xed')],'basename':_0x2b4733['filename'],'type':_0x2b4733[_0xbfa2('0xee')],'ChatOfflineMessageId':_0x1eab9d['id']};});_0x38bb2b=_0x1c1d16[_0xbfa2('0x4b')](_0x1c1df4=>{var _0x19d474={'filename':_0x1c1df4['name'],'path':path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0xef'),_0xbfa2('0xd7'),'attachments',_0xbfa2('0xf0'),_0x1c1df4[_0xbfa2('0xf1')])};return _0x19d474;});if(!_0x2a2f9a['openNewInteraction']){return db['sequelize'][_0xbfa2('0xf2')](function(_0x29340b){return db[_0xbfa2('0xf3')][_0xbfa2('0xf4')](_0x1c1d16,{'transaction':_0x29340b});});}}})[_0xbfa2('0x2f')](function(){if(_0x24968b){_0x230cbc=_0x24968b;return db[_0xbfa2('0xe2')][_0xbfa2('0x78')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xbfa2('0xf5'),'raw':!![],'include':[{'model':db[_0xbfa2('0xf6')],'as':_0xbfa2('0xf6'),'raw':!![]}]}]});}})[_0xbfa2('0x2f')](function(_0x596ceb){if(_0x596ceb&&_0x596ceb['Smtp']&&_0x2a2f9a[_0xbfa2('0xf7')]&&_0x2a2f9a[_0xbfa2('0xf8')]){var _0x32aa8b=_0x596ceb[_0xbfa2('0xf9')]();return respondWithRpcPromise(_0xbfa2('0xfa'),_0xbfa2('0xfb'),{'account':_0x32aa8b,'message':{'from':util[_0xbfa2('0x41')](_0xbfa2('0xfc'),_0x596ceb[_0xbfa2('0x34')],_0x596ceb['email']||_0x596ceb[_0xbfa2('0xf5')][_0xbfa2('0x6b')]),'to':_0x2a2f9a['forwardOfflineAddress'],'subject':_0x2a2f9a[_0xbfa2('0xfd')],'html':_0x230cbc[_0xbfa2('0x66')],'attachments':_0x38bb2b}},client9003)['then'](function(){return _0x230cbc;})[_0xbfa2('0x60')](function(_0x419133){logger[_0xbfa2('0x25')](_0x419133);});}})[_0xbfa2('0x2f')](function(){if(_0x2a2f9a&&_0x2a2f9a['openNewInteraction']&&_0x2a2f9a[_0xbfa2('0xfe')]){var _0x5aa1fd=[];if(_0x43b517[_0xbfa2('0x55')]){_0x5aa1fd=_0x43b517[_0xbfa2('0x4b')](function(_0x319f1b){return{'name':_0x319f1b['originalname'],'basename':_0x319f1b['filename'],'type':_0x319f1b[_0xbfa2('0xee')],'ChatOfflineMessageId':_0x24968b['id']};});}var _0x48de8d;if(!_[_0xbfa2('0x93')](_0x2a2f9a['subjectOffline'])){var _0x12f6a3=_[_0xbfa2('0x4b')](_0x3f4805[_0xbfa2('0x66')],function(_0x3c7311){return _0x3c7311;});var _0x106a6a=_[_0xbfa2('0xff')](_0x12f6a3)[0x0];var _0x54bc10=_['mapValues'](_0x106a6a,function(_0x46c45b){return _0x46c45b;});_0x48de8d=_0x54bc10[0x1][_0x2a2f9a['subjectOffline']];}var _0xd721e8={'from':_0xbe9477['email'],'firstName':_0xbe9477[_0xbfa2('0x3b')],'lastName':_0xbe9477[_0xbfa2('0x3c')],'mapKey':_0xbfa2('0x100'),'message':{'from':_0xbe9477[_0xbfa2('0x100')],'to':_0x2a2f9a['MailAccount'][_0xbfa2('0x100')],'cc':'','subject':_[_0xbfa2('0x93')](_0x48de8d)?_0x2a2f9a[_0xbfa2('0xfd')]:_0x48de8d,'messageId':'','sentAt':new Date(),'attach':_0x5aa1fd['length'],'attachments':_0x5aa1fd,'originChannel':_0xbfa2('0x101'),'ChatWebsiteId':_0x2a2f9a['id'],'ChatOfflineMessageId':_0x230cbc['id'],'originTo':_0x2a2f9a[_0xbfa2('0xe2')][_0xbfa2('0x100')]},'body':_0x230cbc[_0xbfa2('0x66')]};var _0x5b8ebf={'account':{'id':_0x2a2f9a[_0xbfa2('0xfe')]},'body':_0xd721e8,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbfa2('0x102'),_0xbfa2('0x103'),_0x5b8ebf,client9001)['then'](function(){return _0x230cbc;})[_0xbfa2('0x60')](function(_0x4e7605){logger[_0xbfa2('0x25')](_0x4e7605);});}return;})[_0xbfa2('0x2f')](function(){if(_0x230cbc){return _0x230cbc;}})[_0xbfa2('0x2f')](respondWithResult(_0x776092,null))['catch'](function(){for(var _0x2cbdb1 of _0x43b517){var _0x28b56f=path[_0xbfa2('0x8d')](config[_0xbfa2('0x8e')],_0xbfa2('0xef'),'files','attachments',_0xbfa2('0xf0'),_0x2cbdb1[_0xbfa2('0x88')]);fs_extra[_0xbfa2('0x104')](_0x28b56f)['catch'](function(_0x560496){logger['error'](_0xbfa2('0x105'),_0x28b56f,_0x560496);});}});};exports[_0xbfa2('0x106')]=function(_0x9201cf,_0x55a754){return db[_0xbfa2('0xbf')][_0xbfa2('0x64')]({'where':{'id':_0x9201cf[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x55a754,null))[_0xbfa2('0x2f')](function(_0x1c1fb9){if(_0x1c1fb9){return _0x1c1fb9[_0xbfa2('0x106')](_0x9201cf['body'][_0xbfa2('0x7f')],_[_0xbfa2('0x107')](_0x9201cf['body'],[_0xbfa2('0x7f'),'id'])||{});}})['then'](respondWithResult(_0x55a754,null))['catch'](handleError(_0x55a754,null));};exports[_0xbfa2('0x108')]=function(_0x5704ec,_0x351b76){var _0x23d4ea={'raw':![],'where':{}};var _0x5a62e6={};var _0x428800={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x5704ec['params']['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x351b76,null))['then'](function(_0x522e82){if(_0x522e82){_0x5a62e6[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0xbf')]['rawAttributes']);_0x5a62e6[_0xbfa2('0x50')]=_['keys'](_0x5704ec[_0xbfa2('0x50')]);_0x5a62e6[_0xbfa2('0x51')]=_['intersection'](_0x5a62e6['model'],_0x5a62e6['query']);_0x23d4ea[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x5a62e6[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x53')]));_0x23d4ea[_0xbfa2('0x54')]=_0x23d4ea[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0x23d4ea[_0xbfa2('0x54')]:_0x5a62e6[_0xbfa2('0x44')];if(!_0x5704ec[_0xbfa2('0x50')]['hasOwnProperty'](_0xbfa2('0x79'))){_0x23d4ea[_0xbfa2('0x2d')]=qs['limit'](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x23d4ea['offset']=qs[_0xbfa2('0x2b')](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x2b')]);}_0x23d4ea[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x23d4ea[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_[_0xbfa2('0x7a')](_0x5704ec[_0xbfa2('0x50')],_0x5a62e6[_0xbfa2('0x51')]));_0x23d4ea[_0xbfa2('0x59')][_0xbfa2('0x76')]=_0x522e82['id'];if(_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x5a')]){_0x23d4ea[_0xbfa2('0x59')]=_['merge'](_0x23d4ea[_0xbfa2('0x59')],{'$or':_[_0xbfa2('0x4b')](_0x23d4ea[_0xbfa2('0x54')],function(_0x54a76b){var _0x1f0e96={};_0x1f0e96[_0x54a76b]={'$like':'%'+_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x1f0e96;})});}_0x23d4ea=_[_0xbfa2('0x5c')]({},_0x23d4ea,_0x5704ec[_0xbfa2('0x5d')]);return db[_0xbfa2('0xbf')][_0xbfa2('0x2e')]({'where':_0x23d4ea[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x2a080b){_0x428800[_0xbfa2('0x2e')]=_0x2a080b;if(_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x23d4ea['include']=[{'model':db[_0xbfa2('0xa8')],'as':_0xbfa2('0x109'),'required':![]},{'model':db[_0xbfa2('0xcc')],'as':_0xbfa2('0x10a'),'attributes':[_0xbfa2('0x34'),'fullname',_0xbfa2('0x10b')],'required':![]},{'model':db['Tag'],'as':_0xbfa2('0x10c'),'attributes':['id',_0xbfa2('0x34'),_0xbfa2('0x10d')],'where':_0x5704ec[_0xbfa2('0x50')][_0xbfa2('0x10e')]?{'id':_0x5704ec[_0xbfa2('0x50')]['tag']}:undefined,'required':_0x5704ec['query']['tag']?!![]:![]}];}return db[_0xbfa2('0xbf')][_0xbfa2('0x7d')](_0x23d4ea);})['then'](function(_0x5e4edc){_0x428800[_0xbfa2('0x5f')]=_0x5e4edc;return _0x428800;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x351b76,_0x23d4ea))[_0xbfa2('0x60')](handleError(_0x351b76,null));};exports[_0xbfa2('0x10f')]=function(_0x10c637,_0x3043ad){var _0x56532e=0x0;var _0x2e6220=0x0;var _0x2d97f5=![];var _0x391ee0;var _0x1a4931;return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0x10c637[_0xbfa2('0x62')]['id']},'include':[{'model':db[_0xbfa2('0x9f')],'as':_0xbfa2('0x9f'),'include':[{'model':db[_0xbfa2('0x9f')],'as':_0xbfa2('0x110'),'attributes':['id',_0xbfa2('0xb1')]}]}]})[_0xbfa2('0x2f')](handleEntityNotFound(_0x3043ad,null))[_0xbfa2('0x2f')](function(_0x1802ae){if(_0x1802ae){_0x391ee0=_0x1802ae;return _0x1802ae['getProactiveActions']({'raw':!![]});}})[_0xbfa2('0x2f')](function(_0x16bf90){if(_0x391ee0){if(_0x16bf90){_0x1a4931=_0x16bf90;}}return require('../../config/license/util')[_0xbfa2('0x92')]();})[_0xbfa2('0x2f')](function(_0x303d04){if(_0x303d04){_0x2e6220=_0x303d04['virtual'];_0x2d97f5=_0x303d04[_0xbfa2('0x111')];}})[_0xbfa2('0x2f')](function(){return db['ChatInteraction'][_0xbfa2('0x2e')]({'where':{'closed':![]}});})['then'](function(_0x39584d){_0x56532e=_0x39584d;if(_0x2e6220&&_0x39584d>_0x2e6220){return db[_0xbfa2('0x112')]['findOne']({'where':{'id':0x1}})[_0xbfa2('0x2f')](function(_0x3eadd8){if(_0x3eadd8){_0x3eadd8[_0xbfa2('0x113')]('chatLicenseExceeded');}});}})[_0xbfa2('0x2f')](function(){var _0x157ccf=_0x391ee0['Interval'];var _0x1da624=_0x391ee0[_0xbfa2('0x114')]||undefined;return _0x157ccf?_0x157ccf[_0xbfa2('0x115')](_0x1da624):!![];})[_0xbfa2('0x2f')](function(_0x2edfbf){var _0x2fbe1b=fs[_0xbfa2('0xe5')](path['join'](config[_0xbfa2('0x8e')],_0xbfa2('0x116')),_0xbfa2('0xe7'));var _0x4ecc5d=_0xbfa2('0x117');var _0x1db897=![];var _0x4caeb1,_0x34a958;if(_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x3e')]){_0x4caeb1=new URL(_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x3e')])[_0xbfa2('0x118')];}else if(_0x10c637['headers'][_0xbfa2('0x118')]){_0x4caeb1=new URL(_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x118')])['origin'];}else{_0x4caeb1=_0xbfa2('0x119');}_0x34a958=typeof _0x391ee0[_0xbfa2('0x67')]['split'](',')[_0xbfa2('0x64')](function(_0x535079){return wildcardUtils[_0xbfa2('0x11a')](_0x535079,_0x4caeb1);})!==_0xbfa2('0x2c');var _0x27cfe4={'chatVersion':_0x4ecc5d,'chatWebsiteAddressOrigin':_0x34a958?_0x4caeb1:_0x391ee0[_0xbfa2('0x67')],'remote':_0x391ee0[_0xbfa2('0x11b')],'query':querystring[_0xbfa2('0x48')](_['merge'](_0x391ee0[_0xbfa2('0x6c')]({'plain':!![]}),{'customerIp':_0x10c637[_0xbfa2('0xbc')]['x-forwarded-for']||_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x11c')]||_0x10c637['connection']['remoteAddress']||_0x10c637['ip'],'referer':_0x10c637[_0xbfa2('0xbc')][_0xbfa2('0x3e')],'openedInteractions':_0x56532e,'maxInteractions':_0x2e6220,'virtual':_0x2d97f5[_0xbfa2('0x11d')],'online':_0x2edfbf,'custom':_0x2d97f5,'address':_0x34a958?_0x4caeb1:null}))['replace'](/'/g,'\x5c\x27')};_0x3043ad['send'](ejs[_0xbfa2('0xe8')](Mustache[_0xbfa2('0xe8')](_0x2fbe1b,_0x27cfe4),{'proactiveActions':_0x1a4931,'alignment':_0x391ee0[_0xbfa2('0x11e')],'verticalAlignment':_0x391ee0[_0xbfa2('0x11f')],'div_color':_0x391ee0[_0xbfa2('0x10d')],'labelText':_0x391ee0[_0xbfa2('0x120')],'text_color':_0x391ee0[_0xbfa2('0x121')],'text_button_color':_0x391ee0[_0xbfa2('0x122')],'button_color':_0x391ee0['color_button'],'background_color':_0x391ee0[_0xbfa2('0x123')],'hideWhenOffline':_0x391ee0[_0xbfa2('0x124')],'intervalId':_0x391ee0[_0xbfa2('0x125')],'isDevelopment':_0x1db897,'chatVersion':_0x4ecc5d}));})['catch'](handleError(_0x3043ad,null));};exports[_0xbfa2('0x126')]=function(_0x20eef7,_0x23a94f){var _0x4e0d05=_0x20eef7['params']['id'];var _0x29aace=_0x20eef7[_0xbfa2('0x66')];var _0x3a7171=0xc8;var _0x24efd7=null;return db[_0xbfa2('0x127')][_0xbfa2('0xf2')]({'isolationLevel':db[_0xbfa2('0x127')][_0xbfa2('0x128')][_0xbfa2('0x129')][_0xbfa2('0x12a')]},function(_0x59a06b){return db['ChatWebsite'][_0xbfa2('0x78')]({'where':{'id':_0x4e0d05},'transaction':_0x59a06b})[_0xbfa2('0x2f')](function(_0x232e1a){if(_0x232e1a){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x4e0d05},'transaction':_0x59a06b})[_0xbfa2('0x2f')](function(){var _0x426936=_[_0xbfa2('0x4b')](_0x29aace,function(_0x16f24a){_0x16f24a[_0xbfa2('0x76')]=_0x4e0d05;return _0x16f24a;});return db[_0xbfa2('0x12b')]['bulkCreate'](_0x426936,{'transaction':_0x59a06b});});}else{_0x3a7171=0x194;_0x24efd7=[];}});})['then'](function(){if(_0x3a7171!==0x194){return db[_0xbfa2('0x12b')][_0xbfa2('0x12c')]({'where':{'ChatWebsiteId':_0x4e0d05},'order':_0xbfa2('0xb6')})[_0xbfa2('0x2f')](function(_0x251c7f){_0x24efd7=_0x251c7f;});}})[_0xbfa2('0x60')](function(_0x417090){_0x3a7171=0x1f4;logger[_0xbfa2('0x25')](_0x417090[_0xbfa2('0x33')]);if(_0x417090['name']){delete _0x417090[_0xbfa2('0x34')];}_0x24efd7=_0x417090;})[_0xbfa2('0x12d')](function(){if(_0x24efd7===null){_0x23a94f[_0xbfa2('0x28')](_0x3a7171);}else{if(_0x3a7171===0x1f4){_0x23a94f[_0xbfa2('0x2a')](_0x3a7171)[_0xbfa2('0xdd')](_0x24efd7);}else{_0x23a94f['status'](_0x3a7171)[_0xbfa2('0x12e')](_0x24efd7);}}});};exports[_0xbfa2('0x12f')]=function(_0x5418ad,_0x3c756f){var _0xa838b5={};var _0x4bd2dd={};var _0xfb3358;var _0x13d404;return db[_0xbfa2('0x4c')]['findOne']({'where':{'id':_0x5418ad[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x3c756f,null))['then'](function(_0x42ce7d){if(_0x42ce7d){_0xfb3358=_0x42ce7d;_0x4bd2dd[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0x12b')][_0xbfa2('0x4d')]);_0x4bd2dd[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x5418ad[_0xbfa2('0x50')]);_0x4bd2dd['filters']=_[_0xbfa2('0x52')](_0x4bd2dd[_0xbfa2('0x44')],_0x4bd2dd[_0xbfa2('0x50')]);_0xa838b5[_0xbfa2('0x54')]=_['intersection'](_0x4bd2dd[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x53')]));_0xa838b5[_0xbfa2('0x54')]=_0xa838b5[_0xbfa2('0x54')][_0xbfa2('0x55')]?_0xa838b5[_0xbfa2('0x54')]:_0x4bd2dd['model'];_0xa838b5[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0xa838b5[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_[_0xbfa2('0x7a')](_0x5418ad[_0xbfa2('0x50')],_0x4bd2dd[_0xbfa2('0x51')]));if(_0x5418ad[_0xbfa2('0x50')]['filter']){_0xa838b5[_0xbfa2('0x59')]=_['merge'](_0xa838b5['where'],{'$or':_[_0xbfa2('0x4b')](_0xa838b5['attributes'],function(_0x4f0d33){var _0x1da0b9={};_0x1da0b9[_0x4f0d33]={'$like':'%'+_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x1da0b9;})});}_0xa838b5=_[_0xbfa2('0x5c')]({},_0xa838b5,_0x5418ad[_0xbfa2('0x5d')]);return _0xfb3358['getApplications'](_0xa838b5);}})[_0xbfa2('0x2f')](function(_0x2326da){if(_0x2326da){_0x13d404=_0x2326da[_0xbfa2('0x55')];if(!_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x56')]('nolimit')){_0xa838b5[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0xa838b5[_0xbfa2('0x2b')]=qs[_0xbfa2('0x2b')](_0x5418ad[_0xbfa2('0x50')][_0xbfa2('0x2b')]);}return _0xfb3358[_0xbfa2('0x12f')](_0xa838b5);}})[_0xbfa2('0x2f')](function(_0x8a5e17){if(_0x8a5e17){return _0x8a5e17?{'count':_0x13d404,'rows':_0x8a5e17}:null;}})[_0xbfa2('0x2f')](respondWithResult(_0x3c756f,null))[_0xbfa2('0x60')](handleError(_0x3c756f,null));};exports[_0xbfa2('0x130')]=function(_0x14015b,_0x23ce1b){return db[_0xbfa2('0x131')][_0xbfa2('0x64')]({'where':{'id':_0x14015b['params']['id']}})['then'](handleEntityNotFound(_0x23ce1b,null))[_0xbfa2('0x2f')](function(_0x26ae79){if(_0x26ae79){return _0x26ae79[_0xbfa2('0x130')](_0x14015b[_0xbfa2('0x66')]['ids'],_['omit'](_0x14015b[_0xbfa2('0x66')],[_0xbfa2('0x7f'),'id'])||{});}})[_0xbfa2('0x2f')](respondWithResult(_0x23ce1b,null))[_0xbfa2('0x60')](handleError(_0x23ce1b,null));};exports[_0xbfa2('0x132')]=function(_0x587b0c,_0x3c1962){var _0x136fe9={};var _0x4b338b={};var _0x1bb2ea;var _0x21f97d;return db['ChatWebsite'][_0xbfa2('0x78')]({'where':{'id':_0x587b0c['params']['id']}})['then'](handleEntityNotFound(_0x3c1962,null))['then'](function(_0x4e240f){if(_0x4e240f){_0x1bb2ea=_0x4e240f;_0x4b338b['model']=_[_0xbfa2('0x63')](db[_0xbfa2('0x133')][_0xbfa2('0x4d')]);_0x4b338b['query']=_[_0xbfa2('0x63')](_0x587b0c[_0xbfa2('0x50')]);_0x4b338b[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x4b338b[_0xbfa2('0x44')],_0x4b338b['query']);_0x136fe9[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x4b338b[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x53')]));_0x136fe9[_0xbfa2('0x54')]=_0x136fe9['attributes'][_0xbfa2('0x55')]?_0x136fe9[_0xbfa2('0x54')]:_0x4b338b[_0xbfa2('0x44')];_0x136fe9['order']=qs[_0xbfa2('0x58')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x136fe9[_0xbfa2('0x59')]=qs[_0xbfa2('0x51')](_['pick'](_0x587b0c[_0xbfa2('0x50')],_0x4b338b[_0xbfa2('0x51')]));if(_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x5a')]){_0x136fe9[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x136fe9['where'],{'$or':_[_0xbfa2('0x4b')](_0x136fe9[_0xbfa2('0x54')],function(_0x357eea){var _0x4bebc9={};_0x4bebc9[_0x357eea]={'$like':'%'+_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x5a')]+'%'};return _0x4bebc9;})});}_0x136fe9=_[_0xbfa2('0x5c')]({},_0x136fe9,_0x587b0c['options']);return _0x1bb2ea[_0xbfa2('0x132')](_0x136fe9);}})['then'](function(_0x5297d4){if(_0x5297d4){_0x21f97d=_0x5297d4[_0xbfa2('0x55')];if(!_0x587b0c['query'][_0xbfa2('0x56')]('nolimit')){_0x136fe9[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x136fe9[_0xbfa2('0x2b')]=qs[_0xbfa2('0x2b')](_0x587b0c[_0xbfa2('0x50')][_0xbfa2('0x2b')]);}return _0x1bb2ea[_0xbfa2('0x132')](_0x136fe9);}})[_0xbfa2('0x2f')](function(_0x25762e){if(_0x25762e){return _0x25762e?{'count':_0x21f97d,'rows':_0x25762e}:null;}})[_0xbfa2('0x2f')](respondWithResult(_0x3c1962,null))[_0xbfa2('0x60')](handleError(_0x3c1962,null));};exports[_0xbfa2('0x134')]=function(_0x20f848,_0x5b78d4){var _0x1e745e=_0x20f848['query'][_0xbfa2('0x135')]===_0xbfa2('0x136')?_0xbfa2('0x137'):_0xbfa2('0x138');return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'attributes':['id',_0x1e745e],'where':{'id':_0x20f848[_0xbfa2('0x62')]['id']}})['then'](handleEntityNotFound(_0x5b78d4,null))[_0xbfa2('0x2f')](function(_0x46e94c){if(_0x46e94c){var _0x579c98=_0x46e94c[_0x1e745e];var _0x182f25=_0x579c98&&_0x579c98[_0xbfa2('0x139')]?_0x579c98[_0xbfa2('0x139')]:[];_0x5b78d4[_0xbfa2('0xdd')]({'fromKey':_[_0xbfa2('0x93')](_0x579c98[_0xbfa2('0x13a')])?undefined:_0x579c98[_0xbfa2('0x13a')],'count':_0x182f25[_0xbfa2('0x55')],'rows':_0x182f25});}})[_0xbfa2('0x60')](handleError(_0x5b78d4,null));};exports[_0xbfa2('0x13b')]=function(_0x5afa7d,_0x55e149){var _0x329122={'raw':![],'where':{}};var _0x40918b={};var _0x5ad658={'count':0x0,'rows':[]};return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x5afa7d[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x55e149,null))['then'](function(_0x2d9044){if(_0x2d9044){_0x40918b[_0xbfa2('0x44')]=_[_0xbfa2('0x63')](db[_0xbfa2('0xeb')][_0xbfa2('0x4d')]);_0x40918b[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x5afa7d[_0xbfa2('0x50')]);_0x40918b[_0xbfa2('0x51')]=_['intersection'](_0x40918b[_0xbfa2('0x44')],_0x40918b[_0xbfa2('0x50')]);_0x329122['attributes']=_[_0xbfa2('0x52')](_0x40918b[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5afa7d[_0xbfa2('0x50')]['fields']));_0x329122[_0xbfa2('0x54')]=_0x329122[_0xbfa2('0x54')]['length']?_0x329122[_0xbfa2('0x54')]:_0x40918b[_0xbfa2('0x44')];if(!_0x5afa7d['query'][_0xbfa2('0x56')](_0xbfa2('0x79'))){_0x329122[_0xbfa2('0x2d')]=qs[_0xbfa2('0x2d')](_0x5afa7d[_0xbfa2('0x50')][_0xbfa2('0x2d')]);_0x329122[_0xbfa2('0x2b')]=qs[_0xbfa2('0x2b')](_0x5afa7d['query'][_0xbfa2('0x2b')]);}_0x329122[_0xbfa2('0x57')]=qs[_0xbfa2('0x58')](_0x5afa7d[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x329122[_0xbfa2('0x59')]=qs['filters'](_[_0xbfa2('0x7a')](_0x5afa7d[_0xbfa2('0x50')],_0x40918b[_0xbfa2('0x51')]));_0x329122['where'][_0xbfa2('0x76')]=_0x2d9044['id'];if(_0x5afa7d[_0xbfa2('0x50')]['filter']){_0x329122[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x329122[_0xbfa2('0x59')],{'$or':_[_0xbfa2('0x4b')](_0x329122[_0xbfa2('0x54')],function(_0xaabda0){var _0x3bd993={};_0x3bd993[_0xaabda0]={'$like':'%'+_0x5afa7d['query'][_0xbfa2('0x5a')]+'%'};return _0x3bd993;})});}_0x329122=_['merge']({},_0x329122,_0x5afa7d['options']);return db[_0xbfa2('0xeb')][_0xbfa2('0x2e')]({'where':_0x329122[_0xbfa2('0x59')]})[_0xbfa2('0x2f')](function(_0x193c3e){_0x5ad658['count']=_0x193c3e;if(_0x5afa7d[_0xbfa2('0x50')][_0xbfa2('0x5e')]){_0x329122[_0xbfa2('0x7c')]=[{'all':!![]}];}else{_0x329122['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0xbfa2('0x7d')](_0x329122);})[_0xbfa2('0x2f')](function(_0x11cba6){_0x5ad658[_0xbfa2('0x5f')]=_0x11cba6;return _0x5ad658;});}})[_0xbfa2('0x2f')](respondWithFilteredResult(_0x55e149,_0x329122))[_0xbfa2('0x60')](handleError(_0x55e149,null));};exports[_0xbfa2('0x13c')]=function(_0x505dc0,_0x19e869){return db[_0xbfa2('0x4c')]['find']({'where':{'id':_0x505dc0[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x19e869,null))[_0xbfa2('0x2f')](function(_0x16cfc4){if(_0x16cfc4){return _0x16cfc4[_0xbfa2('0x13c')](_0x505dc0[_0xbfa2('0x66')]['ids'],_[_0xbfa2('0x107')](_0x505dc0[_0xbfa2('0x66')],[_0xbfa2('0x7f'),'id'])||{})[_0xbfa2('0x13d')](function(_0x281f44){for(var _0x28458d=0x0;_0x28458d<_0x505dc0[_0xbfa2('0x66')][_0xbfa2('0x7f')][_0xbfa2('0x55')];_0x28458d+=0x1){socket['emit'](_0xbfa2('0x13e'),{'UserId':Number(_0x505dc0[_0xbfa2('0x66')][_0xbfa2('0x7f')][_0x28458d]),'ChatWebsiteId':Number(_0x505dc0['params']['id'])});}return _0x281f44;});}})[_0xbfa2('0x2f')](respondWithResult(_0x19e869,null))[_0xbfa2('0x60')](handleError(_0x19e869,null));};exports[_0xbfa2('0x13f')]=function(_0xb9e403,_0x4b62d1){return db[_0xbfa2('0x4c')][_0xbfa2('0x64')]({'where':{'id':_0xb9e403[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x4b62d1,null))[_0xbfa2('0x2f')](function(_0x41fbc2){if(_0x41fbc2){return _0x41fbc2['removeAgents'](_0xb9e403[_0xbfa2('0x50')][_0xbfa2('0x7f')])[_0xbfa2('0x2f')](function(){if(_[_0xbfa2('0x140')](_0xb9e403['query']['ids'])){for(var _0x2e146c=0x0;_0x2e146c<_0xb9e403[_0xbfa2('0x50')][_0xbfa2('0x7f')]['length'];_0x2e146c+=0x1){socket['emit'](_0xbfa2('0x141'),{'UserId':Number(_0xb9e403[_0xbfa2('0x50')][_0xbfa2('0x7f')][_0x2e146c]),'ChatWebsiteId':Number(_0xb9e403['params']['id'])});}}else{socket[_0xbfa2('0x142')](_0xbfa2('0x141'),{'UserId':Number(_0xb9e403['query']['ids']),'ChatWebsiteId':Number(_0xb9e403[_0xbfa2('0x62')]['id'])});}});}})[_0xbfa2('0x2f')](respondWithStatusCode(_0x4b62d1,null))[_0xbfa2('0x60')](handleError(_0x4b62d1,null));};exports[_0xbfa2('0x143')]=function(_0x5111ec,_0x25ed66){var _0x234360={};var _0x7abbda={};var _0x54a6de;var _0x46d92e;return db[_0xbfa2('0x4c')][_0xbfa2('0x78')]({'where':{'id':_0x5111ec[_0xbfa2('0x62')]['id']}})[_0xbfa2('0x2f')](handleEntityNotFound(_0x25ed66,null))[_0xbfa2('0x2f')](function(_0x29f310){if(_0x29f310){_0x54a6de=_0x29f310;_0x7abbda[_0xbfa2('0x44')]=_['keys'](db[_0xbfa2('0xcc')][_0xbfa2('0x4d')]);_0x7abbda[_0xbfa2('0x50')]=_[_0xbfa2('0x63')](_0x5111ec[_0xbfa2('0x50')]);_0x7abbda[_0xbfa2('0x51')]=_[_0xbfa2('0x52')](_0x7abbda[_0xbfa2('0x44')],_0x7abbda[_0xbfa2('0x50')]);_0x234360[_0xbfa2('0x54')]=_[_0xbfa2('0x52')](_0x7abbda[_0xbfa2('0x44')],qs[_0xbfa2('0x53')](_0x5111ec['query'][_0xbfa2('0x53')]));_0x234360[_0xbfa2('0x54')]=_0x234360[_0xbfa2('0x54')]['length']?_0x234360[_0xbfa2('0x54')]:_0x7abbda[_0xbfa2('0x44')];_0x234360['order']=qs[_0xbfa2('0x58')](_0x5111ec[_0xbfa2('0x50')][_0xbfa2('0x58')]);_0x234360[_0xbfa2('0x59')]=qs['filters'](_['pick'](_0x5111ec[_0xbfa2('0x50')],_0x7abbda['filters']));if(_0x5111ec[_0xbfa2('0x50')][_0xbfa2('0x5a')]){_0x234360[_0xbfa2('0x59')]=_[_0xbfa2('0x5c')](_0x234360['where'],{'$or':_['map'](_0x234360[_0xbfa2('0x54')],function(_0xc75a24){var _0x202631={};_0x202631[_0xc75a24]={'$like':'%'+_0x5111ec['query'][_0xbfa2('0x5a')]+'%'};return _0x202631;})});}_0x234360=_['merge']({},_0x234360,_0x5111ec[_0xbfa2('0x5d')]);return _0x54a6de[_0xbfa2('0x143')](_0x234360);}})[_0xbfa2('0x2f')](function(_0x21b3d2){if(_0x21b3d2){_0x46d92e=_0x21b3d2['length'];if(!_0x5111ec[_0xbfa2('0x50')][_0xbfa2('0x56')]('nolimit')){_0x234360[_0xbfa2('0x2d')]=qs['limit'](_0x5111ec['query'][_0xbfa2('0x2d')]);_0x234360['offset']=qs['offset'](_0x5111ec[_0xbfa2('0x50')]['offset']);}return _0x54a6de[_0xbfa2('0x143')](_0x234360);}})[_0xbfa2('0x2f')](function(_0x4ca95c){if(_0x4ca95c){return _0x4ca95c?{'count':_0x46d92e,'rows':_0x4ca95c}:null;}})['then'](respondWithResult(_0x25ed66,null))[_0xbfa2('0x60')](handleError(_0x25ed66,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 219bf84..767276d 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 _0x86dd=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x4a12c2,_0x19f176){var _0x297f9f=function(_0x5df143){while(--_0x5df143){_0x4a12c2['push'](_0x4a12c2['shift']());}};_0x297f9f(++_0x19f176);}(_0x86dd,0x1ee));var _0xd86d=function(_0x5b48dc,_0x39c416){_0x5b48dc=_0x5b48dc-0x0;var _0x48031c=_0x86dd[_0x5b48dc];return _0x48031c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xd86d('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd86d('0x1')](0x0);var events={'afterCreate':_0xd86d('0x2'),'afterUpdate':_0xd86d('0x3'),'afterDestroy':_0xd86d('0x4')};function emitEvent(_0x17237d){return function(_0x30a31c,_0x2e82a9,_0x240531){ChatWebsiteEvents[_0xd86d('0x5')](_0x17237d+':'+_0x30a31c['id'],_0x30a31c);ChatWebsiteEvents[_0xd86d('0x5')](_0x17237d,_0x30a31c);_0x240531(null);};}for(var e in events){if(events[_0xd86d('0x6')](e)){var event=events[e];ChatWebsite[_0xd86d('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xca9e=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x275a19,_0x310d3a){var _0x37b693=function(_0x3048df){while(--_0x3048df){_0x275a19['push'](_0x275a19['shift']());}};_0x37b693(++_0x310d3a);}(_0xca9e,0x136));var _0xeca9=function(_0x5f6980,_0x144ad4){_0x5f6980=_0x5f6980-0x0;var _0xcb091a=_0xca9e[_0x5f6980];return _0xcb091a;};'use strict';var EventEmitter=require(_0xeca9('0x0'));var ChatWebsite=require(_0xeca9('0x1'))['db'][_0xeca9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xeca9('0x3')](0x0);var events={'afterCreate':_0xeca9('0x4'),'afterUpdate':_0xeca9('0x5'),'afterDestroy':_0xeca9('0x6')};function emitEvent(_0x2c6185){return function(_0x1b2864,_0x1e0a18,_0x3aba81){ChatWebsiteEvents[_0xeca9('0x7')](_0x2c6185+':'+_0x1b2864['id'],_0x1b2864);ChatWebsiteEvents[_0xeca9('0x7')](_0x2c6185,_0x1b2864);_0x3aba81(null);};}for(var e in events){if(events[_0xeca9('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xeca9('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 566bd0e..0878079 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 _0xbf2b=['chat_websites','lodash','api','moment','request-promise','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x5dfb25,_0x31f4bd){var _0x3c16f7=function(_0x2cbc6b){while(--_0x2cbc6b){_0x5dfb25['push'](_0x5dfb25['shift']());}};_0x3c16f7(++_0x31f4bd);}(_0xbf2b,0xc7));var _0xbbf2=function(_0x59bd24,_0xdde327){_0x59bd24=_0x59bd24-0x0;var _0x41384a=_0xbf2b[_0x59bd24];return _0x41384a;};'use strict';var _=require(_0xbbf2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbbf2('0x1'));var moment=require(_0xbbf2('0x2'));var BPromise=require('bluebird');var rp=require(_0xbbf2('0x3'));var fs=require('fs');var path=require(_0xbbf2('0x4'));var rimraf=require('rimraf');var config=require(_0xbbf2('0x5'));var attributes=require(_0xbbf2('0x6'));module[_0xbbf2('0x7')]=function(_0x453847,_0x1de326){return _0x453847['define']('ChatWebsite',attributes,{'tableName':_0xbbf2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7bf2=['lodash','util','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x3d30d5,_0x4f767c){var _0x2ff33f=function(_0x10c7da){while(--_0x10c7da){_0x3d30d5['push'](_0x3d30d5['shift']());}};_0x2ff33f(++_0x4f767c);}(_0x7bf2,0x197));var _0x27bf=function(_0x1d997d,_0x35df68){_0x1d997d=_0x1d997d-0x0;var _0x4d0d9a=_0x7bf2[_0x1d997d];return _0x4d0d9a;};'use strict';var _=require(_0x27bf('0x0'));var util=require(_0x27bf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x27bf('0x2'));var BPromise=require(_0x27bf('0x3'));var rp=require(_0x27bf('0x4'));var fs=require('fs');var path=require(_0x27bf('0x5'));var rimraf=require(_0x27bf('0x6'));var config=require('../../config/environment');var attributes=require(_0x27bf('0x7'));module['exports']=function(_0x499b06,_0x3311fb){return _0x499b06[_0x27bf('0x8')](_0x27bf('0x9'),attributes,{'tableName':_0x27bf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 2e6f1d7..f5b387b 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 _0x2916=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c166f,_0xa0dbc4){var _0x5cbaeb=function(_0x5a1af0){while(--_0x5a1af0){_0x3c166f['push'](_0x3c166f['shift']());}};_0x5cbaeb(++_0xa0dbc4);}(_0x2916,0xac));var _0x6291=function(_0x308ddd,_0x3a8401){_0x308ddd=_0x308ddd-0x0;var _0x3224c3=_0x2916[_0x308ddd];return _0x3224c3;};'use strict';var _=require(_0x6291('0x0'));var util=require(_0x6291('0x1'));var moment=require(_0x6291('0x2'));var BPromise=require('bluebird');var rs=require(_0x6291('0x3'));var fs=require('fs');var Redis=require(_0x6291('0x4'));var db=require(_0x6291('0x5'))['db'];var utils=require(_0x6291('0x6'));var logger=require(_0x6291('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6291('0x8'));var client=jayson[_0x6291('0x9')][_0x6291('0xa')]({'port':0x232a});config['redis']=_[_0x6291('0xb')](config[_0x6291('0xc')],{'host':_0x6291('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6291('0xc')]));require(_0x6291('0xe'))[_0x6291('0xf')](socket);function respondWithRpcPromise(_0x47dc8b,_0x550ef2,_0x6fef8d){return new BPromise(function(_0x3c9bb2,_0x786721){return client['request'](_0x47dc8b,_0x6fef8d)[_0x6291('0x10')](function(_0x5eeec6){logger[_0x6291('0x11')](_0x6291('0x12'),_0x550ef2,_0x6291('0x13'));logger[_0x6291('0x14')](_0x6291('0x15'),_0x550ef2,_0x6291('0x13'),JSON[_0x6291('0x16')](_0x5eeec6));if(_0x5eeec6[_0x6291('0x17')]){if(_0x5eeec6['error'][_0x6291('0x18')]===0x1f4){logger[_0x6291('0x17')](_0x6291('0x12'),_0x550ef2,_0x5eeec6[_0x6291('0x17')]['message']);return _0x786721(_0x5eeec6[_0x6291('0x17')][_0x6291('0x19')]);}logger[_0x6291('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x550ef2,_0x5eeec6[_0x6291('0x17')][_0x6291('0x19')]);return _0x3c9bb2(_0x5eeec6[_0x6291('0x17')][_0x6291('0x19')]);}else{logger[_0x6291('0x11')](_0x6291('0x12'),_0x550ef2,_0x6291('0x13'));_0x3c9bb2(_0x5eeec6[_0x6291('0x1a')][_0x6291('0x19')]);}})[_0x6291('0x1b')](function(_0xf431d7){logger[_0x6291('0x17')](_0x6291('0x12'),_0x550ef2,_0xf431d7);_0x786721(_0xf431d7);});});}
\ No newline at end of file
+var _0x8823=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x10cf03,_0x5e1bdd){var _0x2b8be8=function(_0x1bb1a7){while(--_0x1bb1a7){_0x10cf03['push'](_0x10cf03['shift']());}};_0x2b8be8(++_0x5e1bdd);}(_0x8823,0x194));var _0x3882=function(_0x308a1b,_0x457867){_0x308a1b=_0x308a1b-0x0;var _0x50fd46=_0x8823[_0x308a1b];return _0x50fd46;};'use strict';var _=require(_0x3882('0x0'));var util=require(_0x3882('0x1'));var moment=require(_0x3882('0x2'));var BPromise=require(_0x3882('0x3'));var rs=require(_0x3882('0x4'));var fs=require('fs');var Redis=require(_0x3882('0x5'));var db=require(_0x3882('0x6'))['db'];var utils=require(_0x3882('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3882('0x8'));var jayson=require(_0x3882('0x9'));var client=jayson[_0x3882('0xa')][_0x3882('0xb')]({'port':0x232a});config[_0x3882('0xc')]=_[_0x3882('0xd')](config['redis'],{'host':_0x3882('0xe'),'port':0x18eb});var socket=require(_0x3882('0xf'))(new Redis(config['redis']));require(_0x3882('0x10'))['register'](socket);function respondWithRpcPromise(_0x4caac8,_0x330abf,_0xc607eb){return new BPromise(function(_0xfc04e3,_0x39a3cb){return client[_0x3882('0x11')](_0x4caac8,_0xc607eb)[_0x3882('0x12')](function(_0x2b363a){logger[_0x3882('0x13')](_0x3882('0x14'),_0x330abf,'request\x20sent');logger[_0x3882('0x15')](_0x3882('0x16'),_0x330abf,_0x3882('0x17'),JSON[_0x3882('0x18')](_0x2b363a));if(_0x2b363a[_0x3882('0x19')]){if(_0x2b363a[_0x3882('0x19')][_0x3882('0x1a')]===0x1f4){logger['error'](_0x3882('0x14'),_0x330abf,_0x2b363a[_0x3882('0x19')][_0x3882('0x1b')]);return _0x39a3cb(_0x2b363a[_0x3882('0x19')]['message']);}logger[_0x3882('0x19')](_0x3882('0x14'),_0x330abf,_0x2b363a[_0x3882('0x19')]['message']);return _0xfc04e3(_0x2b363a[_0x3882('0x19')][_0x3882('0x1b')]);}else{logger[_0x3882('0x13')](_0x3882('0x14'),_0x330abf,'request\x20sent');_0xfc04e3(_0x2b363a['result'][_0x3882('0x1b')]);}})[_0x3882('0x1c')](function(_0x4ea910){logger[_0x3882('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x330abf,_0x4ea910);_0x39a3cb(_0x4ea910);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index feaa03b..40a7d09 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 _0xc47e=['register','length','chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener'];(function(_0x16a9ea,_0x5ace14){var _0x550439=function(_0x33506b){while(--_0x33506b){_0x16a9ea['push'](_0x16a9ea['shift']());}};_0x550439(++_0x5ace14);}(_0xc47e,0x12b));var _0xec47=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xc47e[_0x3a7a9c];return _0x59156e;};'use strict';var ChatWebsiteEvents=require(_0xec47('0x0'));var events=['save',_0xec47('0x1'),_0xec47('0x2')];function createListener(_0x14372f,_0x396843){return function(_0x1849fb){_0x396843[_0xec47('0x3')](_0x14372f,_0x1849fb);};}function removeListener(_0x439bae,_0x387d60){return function(){ChatWebsiteEvents[_0xec47('0x4')](_0x439bae,_0x387d60);};}exports[_0xec47('0x5')]=function(_0xc2527){for(var _0x460ba6=0x0,_0x4ed49c=events[_0xec47('0x6')];_0x460ba6<_0x4ed49c;_0x460ba6++){var _0x52e164=events[_0x460ba6];var _0x5a89c7=createListener(_0xec47('0x7')+_0x52e164,_0xc2527);ChatWebsiteEvents['on'](_0x52e164,_0x5a89c7);}};
\ No newline at end of file
+var _0xd4b4=['register','length','save','remove','update'];(function(_0x3f9455,_0x44a884){var _0xbef00=function(_0x158c09){while(--_0x158c09){_0x3f9455['push'](_0x3f9455['shift']());}};_0xbef00(++_0x44a884);}(_0xd4b4,0x1b5));var _0x4d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x4d4b('0x0'),_0x4d4b('0x1'),_0x4d4b('0x2')];function createListener(_0x51e872,_0x2cebe5){return function(_0x58e288){_0x2cebe5['emit'](_0x51e872,_0x58e288);};}function removeListener(_0x302546,_0x33ca05){return function(){ChatWebsiteEvents['removeListener'](_0x302546,_0x33ca05);};}exports[_0x4d4b('0x3')]=function(_0x3c62d6){for(var _0x10c694=0x0,_0x316a0d=events[_0x4d4b('0x4')];_0x10c694<_0x316a0d;_0x10c694++){var _0x1b984f=events[_0x10c694];var _0x363bbb=createListener('chatWebsite:'+_0x1b984f,_0x3c62d6);ChatWebsiteEvents['on'](_0x1b984f,_0x363bbb);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index b809393..63df001 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x09df=['test','trim','([\x5cw]+)','localhost','exports','../../../utils/misc','escapeRegExp','URL','replace'];(function(_0x3e4a3f,_0x3c2f2a){var _0x130e52=function(_0x5bd122){while(--_0x5bd122){_0x3e4a3f['push'](_0x3e4a3f['shift']());}};_0x130e52(++_0x3c2f2a);}(_0x09df,0x164));var _0xf09d=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x09df[_0x3511d3];return _0x5d6321;};var escapeRegExp=require(_0xf09d('0x0'))[_0xf09d('0x1')];var URL=require('url')[_0xf09d('0x2')];function testWildcardValidity(_0x55478e){var _0x5bbc52=!![];try{new URL(_0x55478e[_0xf09d('0x3')]('*','localhost'));}catch(_0x4b4911){_0x5bbc52=![];}return _0x5bbc52&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xf09d('0x4')](_0x55478e);}function testWebsiteWithWildcard(_0x436673,_0x4df47c){var _0x4db4e7;var _0x4b452b=escapeRegExp(_0x436673[_0xf09d('0x5')]()['replace'](/\/$/,''))[_0xf09d('0x3')]('\x5c*',_0xf09d('0x6'));try{new URL(_0x436673[_0xf09d('0x3')]('\x5c*',_0xf09d('0x7')));_0x4db4e7=new RegExp(_0x4b452b)[_0xf09d('0x4')](_0x4df47c);}catch(_0x2a59a8){_0x4db4e7=![];}return _0x4db4e7;}module[_0xf09d('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0xb91a=['test','escapeRegExp','url','URL','replace','localhost'];(function(_0x54efc0,_0x5aeea2){var _0x2df0eb=function(_0x2ec005){while(--_0x2ec005){_0x54efc0['push'](_0x54efc0['shift']());}};_0x2df0eb(++_0x5aeea2);}(_0xb91a,0xe5));var _0xab91=function(_0x13ab0a,_0x1c71ae){_0x13ab0a=_0x13ab0a-0x0;var _0xd3cd5f=_0xb91a[_0x13ab0a];return _0xd3cd5f;};var escapeRegExp=require('../../../utils/misc')[_0xab91('0x0')];var URL=require(_0xab91('0x1'))[_0xab91('0x2')];function testWildcardValidity(_0x182972){var _0x485c32=!![];try{new URL(_0x182972[_0xab91('0x3')]('*',_0xab91('0x4')));}catch(_0x53c757){_0x485c32=![];}return _0x485c32&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xab91('0x5')](_0x182972);}function testWebsiteWithWildcard(_0x4ec84d,_0x54c9f4){var _0x1f99d4;var _0x1cce1e=escapeRegExp(_0x4ec84d['trim']()[_0xab91('0x3')](/\/$/,''))[_0xab91('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x4ec84d[_0xab91('0x3')]('\x5c*',_0xab91('0x4')));_0x1f99d4=new RegExp(_0x1cce1e)['test'](_0x54c9f4);}catch(_0x5765fc){_0x1f99d4=![];}return _0x1f99d4;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index fb61c27..a830be3 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 _0x85c2=['attachments','offline-chat','ensureDir','replace','extname','offline','addInteraction','addApplications','addAgents','put','/:id','update','delete','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getDispositions','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','server/files/images/logos/','now','originalname','server/files/images/avatars/','format','%s-%s','/:id/avatar','file','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x85c2,0x1b4));var _0x285c=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x85c2[_0x455c6c];return _0x488242;};'use strict';var multer=require(_0x285c('0x0'));var util=require(_0x285c('0x1'));var path=require(_0x285c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x285c('0x3')]();var fs_extra=require(_0x285c('0x4'));var auth=require(_0x285c('0x5'));var interaction=require(_0x285c('0x6'));var config=require(_0x285c('0x7'));var controller=require('./chatWebsite.controller');router[_0x285c('0x8')]('/',auth[_0x285c('0x9')](),controller[_0x285c('0xa')]);router[_0x285c('0x8')](_0x285c('0xb'),auth[_0x285c('0x9')](),controller[_0x285c('0xc')]);router[_0x285c('0x8')]('/:id',auth[_0x285c('0x9')](),controller['show']);router['get']('/:id/dispositions',auth[_0x285c('0x9')](),controller[_0x285c('0xd')]);router[_0x285c('0x8')]('/:id/canned_answers',auth[_0x285c('0x9')](),controller['getAnswers']);router[_0x285c('0x8')](_0x285c('0xe'),controller[_0x285c('0xf')]);router[_0x285c('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x285c('0x8')](_0x285c('0x10'),controller[_0x285c('0x11')]);router[_0x285c('0x8')](_0x285c('0x12'),controller[_0x285c('0x13')]);router[_0x285c('0x8')](_0x285c('0x14'),auth[_0x285c('0x9')](),controller[_0x285c('0x15')]);router[_0x285c('0x8')](_0x285c('0x16'),controller['getSnippet']);router[_0x285c('0x8')](_0x285c('0x17'),auth[_0x285c('0x9')](),controller[_0x285c('0x18')]);router['get'](_0x285c('0x19'),auth[_0x285c('0x9')](),controller[_0x285c('0x1a')]);router['get'](_0x285c('0x1b'),controller[_0x285c('0x1c')]);router['get'](_0x285c('0x1d'),auth['isAuthenticated'](),controller[_0x285c('0x1e')]);router['get'](_0x285c('0x1f'),auth[_0x285c('0x9')](),controller[_0x285c('0x20')]);router[_0x285c('0x21')]('/',auth[_0x285c('0x9')](),controller[_0x285c('0x22')]);router[_0x285c('0x21')](_0x285c('0x23'),auth[_0x285c('0x9')](),controller['addDisposition']);router[_0x285c('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x285c('0x24')]);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x1099b7,_0x1a3e5f,_0x96d052){_0x96d052(null,path[_0x285c('0x26')](config[_0x285c('0x27')],_0x285c('0x28')));},'filename':function(_0x15b2a3,_0xa927a8,_0x29b038){_0x29b038(null,util['format']('%s-%s',Date[_0x285c('0x29')](),_0xa927a8[_0x285c('0x2a')]));}})});router['post'](_0x285c('0xe'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x14c802,_0x413ccb,_0x22ba23){_0x22ba23(null,path['join'](config['root'],_0x285c('0x2b')));},'filename':function(_0x149d95,_0x17a06d,_0x56f7fd){_0x56f7fd(null,util[_0x285c('0x2c')](_0x285c('0x2d'),Date[_0x285c('0x29')](),_0x17a06d[_0x285c('0x2a')]));}})});router[_0x285c('0x21')](_0x285c('0x2e'),upload['single'](_0x285c('0x2f')),controller[_0x285c('0x30')]);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x594534,_0x3311d5,_0x3de0c4){_0x3de0c4(null,path[_0x285c('0x26')](config[_0x285c('0x27')],'server/files/images/avatars/'));},'filename':function(_0x5d5769,_0x2275c5,_0x18641f){_0x18641f(null,util['format'](_0x285c('0x2d'),Date[_0x285c('0x29')](),_0x2275c5['originalname']));}})});router['post'](_0x285c('0x10'),upload[_0x285c('0x31')](_0x285c('0x2f')),controller[_0x285c('0x32')]);var upload=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x238429,_0x5a30e3,_0x21518f){_0x21518f(null,path[_0x285c('0x26')](config[_0x285c('0x27')],_0x285c('0x2b')));},'filename':function(_0x34a752,_0x57683c,_0x66048e){_0x66048e(null,util[_0x285c('0x2c')](_0x285c('0x2d'),Date[_0x285c('0x29')](),_0x57683c[_0x285c('0x2a')]));}})});router[_0x285c('0x21')]('/:id/system_avatar',upload[_0x285c('0x31')](_0x285c('0x2f')),controller[_0x285c('0x33')]);router[_0x285c('0x21')](_0x285c('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x285c('0x25')]({'destination':function(_0x54e831,_0x217fd4,_0x43c755){const _0x1c3590=path['join'](config[_0x285c('0x27')],_0x285c('0x35'),_0x285c('0x36'),_0x285c('0x37'));fs_extra[_0x285c('0x38')](_0x1c3590,function(){_0x43c755(null,_0x1c3590);});},'filename':function(_0xa68a0f,_0x2cfbbe,_0x28b885){const _0x4dc70a=_0x2cfbbe['originalname'][_0x285c('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2b3db9=path[_0x285c('0x3a')](_0x4dc70a);const _0x4f9ae8=Date[_0x285c('0x29')]()+'-'+_0x4dc70a['replace'](_0x2b3db9,'')+_0x2b3db9;_0x28b885(null,_0x4f9ae8);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0x285c('0x3b')]);router[_0x285c('0x21')](_0x285c('0x14'),auth['isAuthenticated'](),controller[_0x285c('0x3c')]);router[_0x285c('0x21')]('/:id/applications',auth[_0x285c('0x9')](),controller[_0x285c('0x3d')]);router[_0x285c('0x21')]('/:id/proactive_actions',auth[_0x285c('0x9')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x285c('0x9')](),controller[_0x285c('0x3e')]);router[_0x285c('0x3f')](_0x285c('0x40'),auth[_0x285c('0x9')](),controller[_0x285c('0x41')]);router[_0x285c('0x42')](_0x285c('0x40'),auth[_0x285c('0x9')](),controller['destroy']);router[_0x285c('0x42')]('/:id/dispositions',auth[_0x285c('0x9')](),controller['removeDispositions']);router[_0x285c('0x42')]('/:id/canned_answers',auth[_0x285c('0x9')](),controller[_0x285c('0x43')]);router['delete'](_0x285c('0x1f'),auth[_0x285c('0x9')](),controller[_0x285c('0x44')]);module[_0x285c('0x45')]=router;
\ No newline at end of file
+var _0x00fb=['get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','server/files/images/avatars/','single','file','addCustomerAvatar','/:id/notify','notify','server/files','attachments','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','./chatWebsite.controller'];(function(_0x371d15,_0xd98587){var _0x32afdf=function(_0x587ba3){while(--_0x587ba3){_0x371d15['push'](_0x371d15['shift']());}};_0x32afdf(++_0xd98587);}(_0x00fb,0xc3));var _0xb00f=function(_0x69b0bf,_0x248a70){_0x69b0bf=_0x69b0bf-0x0;var _0x53a201=_0x00fb[_0x69b0bf];return _0x53a201;};'use strict';var multer=require(_0xb00f('0x0'));var util=require(_0xb00f('0x1'));var path=require('path');var timeout=require(_0xb00f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb00f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb00f('0x4'));var config=require('../../config/environment');var controller=require(_0xb00f('0x5'));router[_0xb00f('0x6')]('/',auth[_0xb00f('0x7')](),controller['index']);router[_0xb00f('0x6')]('/describe',auth[_0xb00f('0x7')](),controller[_0xb00f('0x8')]);router[_0xb00f('0x6')](_0xb00f('0x9'),auth[_0xb00f('0x7')](),controller[_0xb00f('0xa')]);router[_0xb00f('0x6')](_0xb00f('0xb'),auth[_0xb00f('0x7')](),controller[_0xb00f('0xc')]);router[_0xb00f('0x6')](_0xb00f('0xd'),auth['isAuthenticated'](),controller[_0xb00f('0xe')]);router['get'](_0xb00f('0xf'),controller['getLogo']);router[_0xb00f('0x6')](_0xb00f('0x10'),controller[_0xb00f('0x11')]);router[_0xb00f('0x6')](_0xb00f('0x12'),controller[_0xb00f('0x13')]);router['get'](_0xb00f('0x14'),controller[_0xb00f('0x15')]);router['get'](_0xb00f('0x16'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x17')]);router[_0xb00f('0x6')](_0xb00f('0x18'),controller['getSnippet']);router[_0xb00f('0x6')](_0xb00f('0x19'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x1a')]);router['get'](_0xb00f('0x1b'),auth[_0xb00f('0x7')](),controller['getProactiveActions']);router[_0xb00f('0x6')]('/:id/fields',controller[_0xb00f('0x1c')]);router['get'](_0xb00f('0x1d'),auth['isAuthenticated'](),controller[_0xb00f('0x1e')]);router[_0xb00f('0x6')](_0xb00f('0x1f'),auth['isAuthenticated'](),controller[_0xb00f('0x20')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb00f('0x21')]('/:id/dispositions',auth[_0xb00f('0x7')](),controller['addDisposition']);router[_0xb00f('0x21')](_0xb00f('0xd'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x22')]);var upload=multer({'storage':multer[_0xb00f('0x23')]({'destination':function(_0x1ddb74,_0x4869e4,_0x1079ef){_0x1079ef(null,path[_0xb00f('0x24')](config[_0xb00f('0x25')],_0xb00f('0x26')));},'filename':function(_0x2f4d20,_0x4cc239,_0x5a7a7f){_0x5a7a7f(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x4cc239[_0xb00f('0x2a')]));}})});router[_0xb00f('0x21')](_0xb00f('0xf'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42ea66,_0x37cb83,_0x17f08b){_0x17f08b(null,path[_0xb00f('0x24')](config[_0xb00f('0x25')],_0xb00f('0x2b')));},'filename':function(_0xcfcd83,_0x13b73a,_0x410e5b){_0x410e5b(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x13b73a[_0xb00f('0x2a')]));}})});router[_0xb00f('0x21')](_0xb00f('0x10'),upload[_0xb00f('0x2c')](_0xb00f('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0xb00f('0x23')]({'destination':function(_0x508372,_0x549856,_0x59ac1c){_0x59ac1c(null,path['join'](config['root'],_0xb00f('0x2b')));},'filename':function(_0x4a72a8,_0x3c0fcc,_0x429557){_0x429557(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x3c0fcc[_0xb00f('0x2a')]));}})});router[_0xb00f('0x21')]('/:id/customer_avatar',upload[_0xb00f('0x2c')](_0xb00f('0x2d')),controller[_0xb00f('0x2e')]);var upload=multer({'storage':multer[_0xb00f('0x23')]({'destination':function(_0x467b12,_0x59433c,_0x738a31){_0x738a31(null,path[_0xb00f('0x24')](config['root'],_0xb00f('0x2b')));},'filename':function(_0x5a7fe1,_0x28444f,_0x1dc7c7){_0x1dc7c7(null,util[_0xb00f('0x27')](_0xb00f('0x28'),Date[_0xb00f('0x29')](),_0x28444f['originalname']));}})});router['post'](_0xb00f('0x14'),upload[_0xb00f('0x2c')]('file'),controller['addSystemAvatar']);router[_0xb00f('0x21')](_0xb00f('0x2f'),controller[_0xb00f('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x310da2,_0x27d5a5,_0x4be295){const _0x499693=path[_0xb00f('0x24')](config['root'],_0xb00f('0x31'),_0xb00f('0x32'),'offline-chat');fs_extra['ensureDir'](_0x499693,function(){_0x4be295(null,_0x499693);});},'filename':function(_0x50e325,_0x801f6b,_0x37f9fc){const _0x227491=_0x801f6b[_0xb00f('0x2a')][_0xb00f('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1135a9=path[_0xb00f('0x34')](_0x227491);const _0x4c0780=Date[_0xb00f('0x29')]()+'-'+_0x227491[_0xb00f('0x33')](_0x1135a9,'')+_0x1135a9;_0x37f9fc(null,_0x4c0780);}})});router[_0xb00f('0x21')](_0xb00f('0x35'),offlineUploadMulter[_0xb00f('0x36')](),controller[_0xb00f('0x37')]);router[_0xb00f('0x21')](_0xb00f('0x16'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x38')]);router[_0xb00f('0x21')](_0xb00f('0x19'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x39')]);router[_0xb00f('0x21')](_0xb00f('0x1b'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x3a')]);router['post']('/:id/users',auth[_0xb00f('0x7')](),controller[_0xb00f('0x3b')]);router[_0xb00f('0x3c')]('/:id',auth['isAuthenticated'](),controller[_0xb00f('0x3d')]);router[_0xb00f('0x3e')](_0xb00f('0x9'),auth['isAuthenticated'](),controller[_0xb00f('0x3f')]);router[_0xb00f('0x3e')](_0xb00f('0xb'),auth[_0xb00f('0x7')](),controller[_0xb00f('0x40')]);router[_0xb00f('0x3e')](_0xb00f('0xd'),auth[_0xb00f('0x7')](),controller['removeAnswers']);router[_0xb00f('0x3e')]('/:id/users',auth[_0xb00f('0x7')](),controller[_0xb00f('0x41')]);module[_0xb00f('0x42')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 65964a3..c6b45e3 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 _0x0ac6=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','env'];(function(_0x53e25c,_0x5a668a){var _0x5dbc9b=function(_0x5f5848){while(--_0x5f5848){_0x53e25c['push'](_0x53e25c['shift']());}};_0x5dbc9b(++_0x5a668a);}(_0x0ac6,0x14c));var _0x60ac=function(_0x32d015,_0x2bd009){_0x32d015=_0x32d015-0x0;var _0x17ceee=_0x0ac6[_0x32d015];return _0x17ceee;};var beaverLogger=require(_0x60ac('0x0'));var express=require('express');var auth=require(_0x60ac('0x1'));var config=require('../config/environment');var router=express[_0x60ac('0x2')]();var isProduction=config[_0x60ac('0x3')]===_0x60ac('0x4')||![];function clientSideLogs(_0x4c4996,_0x27ac7b,_0x25c8f6){var _0x51bc54=_0x4c4996[_0x60ac('0x5')][_0x60ac('0x6')](_0x60ac('0x7'));if(!_0x51bc54){throw new Error(_0x60ac('0x8'));}return beaverLogger[_0x60ac('0x9')]({'uri':_0x60ac('0xa'),'logger':_0x51bc54,'enableCors':!isProduction})(_0x4c4996,_0x27ac7b,_0x25c8f6);}router[_0x60ac('0xb')](auth[_0x60ac('0xc')](),clientSideLogs);module[_0x60ac('0xd')]=router;
\ No newline at end of file
+var _0xde0b=['client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','express','../config/environment','Router','env','app','get'];(function(_0x1fc845,_0x106c5b){var _0x1118ff=function(_0x1328df){while(--_0x1328df){_0x1fc845['push'](_0x1fc845['shift']());}};_0x1118ff(++_0x106c5b);}(_0xde0b,0xd2));var _0xbde0=function(_0x4af779,_0x3b967d){_0x4af779=_0x4af779-0x0;var _0x41d726=_0xde0b[_0x4af779];return _0x41d726;};var beaverLogger=require('beaver-logger/server');var express=require(_0xbde0('0x0'));var auth=require('../components/auth/service');var config=require(_0xbde0('0x1'));var router=express[_0xbde0('0x2')]();var isProduction=config[_0xbde0('0x3')]==='production'||![];function clientSideLogs(_0x4ee419,_0x3f99cc,_0x348d87){var _0x7a9b80=_0x4ee419[_0xbde0('0x4')][_0xbde0('0x5')](_0xbde0('0x6'));if(!_0x7a9b80){throw new Error(_0xbde0('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0xbde0('0x8'),'logger':_0x7a9b80,'enableCors':!isProduction})(_0x4ee419,_0x3f99cc,_0x348d87);}router[_0xbde0('0x9')](auth[_0xbde0('0xa')](),clientSideLogs);module[_0xbde0('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index df8052f..fb03e5f 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 _0xe02c=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x14a83a,_0x54500b){var _0x474b3d=function(_0x252db6){while(--_0x252db6){_0x14a83a['push'](_0x14a83a['shift']());}};_0x474b3d(++_0x54500b);}(_0xe02c,0x143));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xce02('0x0'));module['exports']={'name':{'type':Sequelize[_0xce02('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xce02('0x2')](_0xce02('0x3'),_0xce02('0x4'),_0xce02('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xce02('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0x7')},'data2':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0x8')},'data3':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0x9')},'data4':{'type':Sequelize[_0xce02('0x1')],'comment':_0xce02('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xce02('0xb')},'data6':{'type':Sequelize[_0xce02('0xc')],'comment':_0xce02('0xd')},'data7':{'type':Sequelize[_0xce02('0xc')],'comment':_0xce02('0xe')}};
\ No newline at end of file
+var _0x0058=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x0058,0x171));var _0x8005=function(_0x420f60,_0x170446){_0x420f60=_0x420f60-0x0;var _0x365664=_0x0058[_0x420f60];return _0x365664;};'use strict';var Sequelize=require(_0x8005('0x0'));module[_0x8005('0x1')]={'name':{'type':Sequelize[_0x8005('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8005('0x3')](_0x8005('0x4'),_0x8005('0x5'),_0x8005('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8005('0x3')](_0x8005('0x7'),_0x8005('0x8'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x8005('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x8005('0x9')},'data5':{'type':Sequelize[_0x8005('0xa')],'comment':_0x8005('0xb')},'data6':{'type':Sequelize[_0x8005('0xa')],'comment':_0x8005('0xc')},'data7':{'type':Sequelize[_0x8005('0xa')],'comment':_0x8005('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 85b2a36..169c9c1 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 _0x8902=['id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','undefined','count','offset','limit','Content-Range','then','destroy','stack','send','padEnd','index','map','CloudProvider','type','key','model','name','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','findAll','service','MicrosoftAzure','catch','show','params','rawAttributes','intersection','includeAll','options','data3','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','update','find','oauth2MicrosoftAuthorize','findOne','user','error','get','state','from','base64','ascii'];(function(_0x31f917,_0x3a9037){var _0x31d77a=function(_0x5c1553){while(--_0x5c1553){_0x31f917['push'](_0x31f917['shift']());}};_0x31d77a(++_0x3a9037);}(_0x8902,0x6c));var _0x2890=function(_0x2494c2,_0x288476){_0x2494c2=_0x2494c2-0x0;var _0x16f60b=_0x8902[_0x2494c2];return _0x16f60b;};'use strict';var _=require(_0x2890('0x0'));var Redis=require(_0x2890('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x2890('0x2'));var config=require(_0x2890('0x3'));var logger=require('../../config/logger')(_0x2890('0x4'));var db=require(_0x2890('0x5'))['db'];var oauth=require(_0x2890('0x6'));config['redis']=_[_0x2890('0x7')](config[_0x2890('0x8')],{'host':_0x2890('0x9'),'port':0x18eb});var socket=require(_0x2890('0xa'))(new Redis(config[_0x2890('0x8')]));var redis=new Redis(config[_0x2890('0x8')]);function respondWithStatusCode(_0x60e0a2,_0x57d149){_0x57d149=_0x57d149||0xcc;return function(_0x2a1640){if(_0x2a1640){return _0x60e0a2[_0x2890('0xb')](_0x57d149);}return _0x60e0a2['status'](_0x57d149)[_0x2890('0xc')]();};}function respondWithResult(_0x12d51b,_0x42d367){_0x42d367=_0x42d367||0xc8;return function(_0x456bb2){if(_0x456bb2){return _0x12d51b[_0x2890('0xd')](_0x42d367)['json'](_0x456bb2);}};}function respondWithFilteredResult(_0x411bcf,_0x3a2820){return function(_0x4137aa){if(_0x4137aa){var _0x2a099d=typeof _0x3a2820['offset']==='undefined'&&typeof _0x3a2820['limit']===_0x2890('0xe');var _0x530cf9=_0x4137aa[_0x2890('0xf')];var _0x2e4c22=_0x2a099d?0x0:_0x3a2820[_0x2890('0x10')];var _0x1884a3=_0x2a099d?_0x4137aa[_0x2890('0xf')]:_0x3a2820[_0x2890('0x10')]+_0x3a2820[_0x2890('0x11')];var _0x5eb5bb;if(_0x1884a3>=_0x530cf9){_0x1884a3=_0x530cf9;_0x5eb5bb=0xc8;}else{_0x5eb5bb=0xce;}_0x411bcf[_0x2890('0xd')](_0x5eb5bb);return _0x411bcf['set'](_0x2890('0x12'),_0x2e4c22+'-'+_0x1884a3+'/'+_0x530cf9)['json'](_0x4137aa);}return null;};}function saveUpdates(_0x1a8ed0){return function(_0x2098d9){if(_0x2098d9){return _0x2098d9['update'](_0x1a8ed0)[_0x2890('0x13')](function(_0x44b1dd){return _0x44b1dd;});}return null;};}function removeEntity(_0x1b69c8){return function(_0x28ecbf){if(_0x28ecbf){return _0x28ecbf[_0x2890('0x14')]()[_0x2890('0x13')](function(){_0x1b69c8[_0x2890('0xd')](0xcc)[_0x2890('0xc')]();});}};}function handleEntityNotFound(_0x387f02){return function(_0x3c4077){if(!_0x3c4077){_0x387f02[_0x2890('0xb')](0x194);}return _0x3c4077;};}function handleError(_0x1c1288,_0x23afce){_0x23afce=_0x23afce||0x1f4;return function(_0x4b7b9f){logger['error'](_0x4b7b9f[_0x2890('0x15')]);if(_0x4b7b9f['name']){delete _0x4b7b9f['name'];}_0x1c1288[_0x2890('0xd')](_0x23afce)[_0x2890('0x16')](_0x4b7b9f);};}function maskClientSecret(_0x2f3315){return _[_0x2890('0x17')](_0x2f3315['slice'](0x0,0x3),0x14,'*');}exports[_0x2890('0x18')]=function(_0x5d6a02,_0x2ca81f){var _0xae9069={},_0x5d879e={},_0x53dcb2={'count':0x0,'rows':[]};var _0x3f8d2f=_[_0x2890('0x19')](db[_0x2890('0x1a')]['rawAttributes'],function(_0x4fc27d){return{'name':_0x4fc27d['fieldName'],'type':_0x4fc27d[_0x2890('0x1b')][_0x2890('0x1c')]};});_0x5d879e[_0x2890('0x1d')]=_[_0x2890('0x19')](_0x3f8d2f,_0x2890('0x1e'));_0x5d879e[_0x2890('0x1f')]=_[_0x2890('0x20')](_0x5d6a02[_0x2890('0x1f')]);_0x5d879e['filters']=_['intersection'](_0x5d879e[_0x2890('0x1d')],_0x5d879e[_0x2890('0x1f')]);_0xae9069[_0x2890('0x21')]=_['intersection'](_0x5d879e[_0x2890('0x1d')],qs[_0x2890('0x22')](_0x5d6a02[_0x2890('0x1f')]['fields']));_0xae9069[_0x2890('0x21')]=_0xae9069[_0x2890('0x21')][_0x2890('0x23')]?_0xae9069['attributes']:_0x5d879e['model'];if(!_0x5d6a02[_0x2890('0x1f')][_0x2890('0x24')]('nolimit')){_0xae9069[_0x2890('0x11')]=qs[_0x2890('0x11')](_0x5d6a02[_0x2890('0x1f')]['limit']);_0xae9069[_0x2890('0x10')]=qs['offset'](_0x5d6a02['query'][_0x2890('0x10')]);}_0xae9069[_0x2890('0x25')]=qs[_0x2890('0x26')](_0x5d6a02[_0x2890('0x1f')][_0x2890('0x26')]);_0xae9069[_0x2890('0x27')]=qs[_0x2890('0x28')](_['pick'](_0x5d6a02[_0x2890('0x1f')],_0x5d879e[_0x2890('0x28')]),_0x3f8d2f);if(_0x5d6a02[_0x2890('0x1f')]['filter']){_0xae9069[_0x2890('0x27')]=_[_0x2890('0x29')](_0xae9069['where'],{'$or':_['map'](_0x3f8d2f,function(_0x133b42){if(_0x133b42['type']!==_0x2890('0x2a')){var _0x2cc131={};_0x2cc131[_0x133b42[_0x2890('0x1e')]]={'$like':'%'+_0x5d6a02[_0x2890('0x1f')][_0x2890('0x2b')]+'%'};return _0x2cc131;}})});}_0xae9069=_[_0x2890('0x29')]({},_0xae9069,_0x5d6a02['options']);var _0x2ba4c1={'where':_0xae9069[_0x2890('0x27')]};return db[_0x2890('0x1a')][_0x2890('0xf')](_0x2ba4c1)['then'](function(_0x35a0bc){_0x53dcb2['count']=_0x35a0bc;if(_0x5d6a02[_0x2890('0x1f')]['includeAll']){_0xae9069['include']=[{'all':!![]}];}return db[_0x2890('0x1a')][_0x2890('0x2c')](_0xae9069);})[_0x2890('0x13')](function(_0x122075){_0x53dcb2['rows']=_[_0x2890('0x19')](_0x122075,function(_0x506e3e){if(_0x506e3e[_0x2890('0x2d')]===_0x2890('0x2e')){var _0xdfa9ce=encryptor['decryptString'](_0x506e3e['data3']);_0x506e3e['data3']=maskClientSecret(_0xdfa9ce);}return _0x506e3e;});return _0x53dcb2;})['then'](respondWithFilteredResult(_0x2ca81f,_0xae9069))[_0x2890('0x2f')](handleError(_0x2ca81f,null));};exports[_0x2890('0x30')]=function(_0x2a3f2e,_0x2e9ded){var _0x4bc095={'raw':!![],'where':{'id':_0x2a3f2e[_0x2890('0x31')]['id']}},_0x2002e3={};_0x2002e3['model']=_[_0x2890('0x20')](db[_0x2890('0x1a')][_0x2890('0x32')]);_0x2002e3['query']=_[_0x2890('0x20')](_0x2a3f2e[_0x2890('0x1f')]);_0x2002e3[_0x2890('0x28')]=_[_0x2890('0x33')](_0x2002e3[_0x2890('0x1d')],_0x2002e3[_0x2890('0x1f')]);_0x4bc095[_0x2890('0x21')]=_['intersection'](_0x2002e3['model'],qs['fields'](_0x2a3f2e[_0x2890('0x1f')]['fields']));_0x4bc095[_0x2890('0x21')]=_0x4bc095[_0x2890('0x21')][_0x2890('0x23')]?_0x4bc095['attributes']:_0x2002e3[_0x2890('0x1d')];if(_0x2a3f2e[_0x2890('0x1f')][_0x2890('0x34')]){_0x4bc095['include']=[{'all':!![]}];}_0x4bc095=_[_0x2890('0x29')]({},_0x4bc095,_0x2a3f2e[_0x2890('0x35')]);return db['CloudProvider']['find'](_0x4bc095)[_0x2890('0x13')](handleEntityNotFound(_0x2e9ded,null))[_0x2890('0x13')](function(_0x1a117c){if(_0x1a117c[_0x2890('0x2d')]===_0x2890('0x2e')){var _0x5b5119=encryptor['decryptString'](_0x1a117c[_0x2890('0x36')]);_0x1a117c[_0x2890('0x36')]=maskClientSecret(_0x5b5119);}return _0x1a117c;})[_0x2890('0x13')](respondWithResult(_0x2e9ded,null))[_0x2890('0x2f')](handleError(_0x2e9ded,null));};exports['create']=function(_0x421c16,_0x10dad1){if(!_0x421c16[_0x2890('0x37')][_0x2890('0x1e')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x421c16[_0x2890('0x37')][_0x2890('0x2d')])throw new Error(_0x2890('0x38'));var _0x1e0c04=db[_0x2890('0x1a')][_0x2890('0x32')][_0x2890('0x2d')][_0x2890('0x39')];if(!_0x1e0c04[_0x2890('0x3a')](_0x421c16[_0x2890('0x37')][_0x2890('0x2d')]))throw new Error(_0x2890('0x3b')+_0x1e0c04[_0x2890('0x3c')](',\x20'));if(_0x421c16['body'][_0x2890('0x2d')]==='MicrosoftAzure'&&_0x421c16[_0x2890('0x37')]['data3']){_0x421c16[_0x2890('0x37')]['data3']=encryptor[_0x2890('0x3d')](_0x421c16[_0x2890('0x37')]['data3']);}return db[_0x2890('0x1a')][_0x2890('0x3e')](_0x421c16[_0x2890('0x37')],{})['then'](respondWithResult(_0x10dad1,0xc9))[_0x2890('0x2f')](handleError(_0x10dad1,null));};exports[_0x2890('0x3f')]=function(_0x41f7e4,_0x5375b3){if(_0x41f7e4[_0x2890('0x37')]['id']){delete _0x41f7e4[_0x2890('0x37')]['id'];}return db[_0x2890('0x1a')][_0x2890('0x40')]({'where':{'id':_0x41f7e4[_0x2890('0x31')]['id']}})[_0x2890('0x13')](handleEntityNotFound(_0x5375b3,null))[_0x2890('0x13')](function(_0x2085f1){if(_0x2085f1['service']===_0x2890('0x2e')&&_0x41f7e4[_0x2890('0x37')][_0x2890('0x36')]){_0x41f7e4[_0x2890('0x37')][_0x2890('0x36')]=encryptor[_0x2890('0x3d')](_0x41f7e4[_0x2890('0x37')][_0x2890('0x36')]);}return _0x2085f1;})[_0x2890('0x13')](saveUpdates(_0x41f7e4[_0x2890('0x37')],null))[_0x2890('0x13')](respondWithResult(_0x5375b3,null))[_0x2890('0x2f')](handleError(_0x5375b3,null));};exports[_0x2890('0x14')]=function(_0x10c3b9,_0x1278d9){return db[_0x2890('0x1a')][_0x2890('0x40')]({'where':{'id':_0x10c3b9[_0x2890('0x31')]['id']}})['then'](handleEntityNotFound(_0x1278d9,null))['then'](removeEntity(_0x1278d9,null))[_0x2890('0x2f')](handleError(_0x1278d9,null));};exports[_0x2890('0x41')]=function(_0x2ad24c,_0x5901ba){return db[_0x2890('0x1a')][_0x2890('0x42')]({'where':{'id':_0x2ad24c[_0x2890('0x31')]['id']},'raw':!![]})[_0x2890('0x13')](function(_0x1f02de){if(!_0x1f02de)return _0x5901ba[_0x2890('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x1f02de,_0x2ad24c[_0x2890('0x43')]['id'])};})['then'](respondWithResult(_0x5901ba,null))[_0x2890('0x2f')](handleError(_0x5901ba,null));};exports['oauth2MicrosoftCallback']=function(_0x4673a7,_0x2809a3){var _0xf9ef4=_0x4673a7['body'];var _0x25cad5;var _0x48bfa6;if(_0xf9ef4[_0x2890('0x44')])throw _0xf9ef4;redis[_0x2890('0x45')](_0xf9ef4[_0x2890('0x46')])['then'](function(_0x1e8dc2){if(!_0x1e8dc2)throw new Error('Invalid\x20state\x20parameter');_0x25cad5=JSON['parse'](_0x1e8dc2);var _0x49b8dc=Buffer[_0x2890('0x47')](_0xf9ef4['state'],_0x2890('0x48'))['toString'](_0x2890('0x49'));_0x48bfa6=JSON['parse'](_0x49b8dc);if(!oauth['isValidIdToken'](_0xf9ef4[_0x2890('0x4a')],_0x25cad5[_0x2890('0x4b')]))throw new Error(_0x2890('0x4c'));redis[_0x2890('0x4d')](_0xf9ef4[_0x2890('0x46')]);return oauth[_0x2890('0x4e')](_0xf9ef4[_0x2890('0x4f')],_0x25cad5);})[_0x2890('0x13')](function(_0x45f3f6){_0x25cad5['data5']=_0x45f3f6[_0x2890('0x50')];_0x25cad5[_0x2890('0x51')]=_0x45f3f6[_0x2890('0x52')];return db[_0x2890('0x1a')][_0x2890('0x3f')]({'data5':_0x25cad5[_0x2890('0x53')],'data6':_0x25cad5[_0x2890('0x51')]},{'where':{'id':_0x25cad5['id']}});})[_0x2890('0x13')](function(){oauth[_0x2890('0x54')](_0x25cad5);socket[_0x2890('0x55')](_0x2890('0x56'),{'id':_0x48bfa6['id']});return;})[_0x2890('0x13')](respondWithStatusCode(_0x2809a3,null))[_0x2890('0x2f')](function(_0x1f8807){if(_0x48bfa6){socket[_0x2890('0x55')](_0x2890('0x57'),{'id':_0x48bfa6['id']});}if(!_0x25cad5){logger[_0x2890('0x44')](_0x2890('0x58'),_0x1f8807);return _0x2809a3[_0x2890('0xd')](0x1f4)[_0x2890('0x16')](_0x1f8807[_0x2890('0x59')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x25cad5['id'],JSON[_0x2890('0x5a')](_0x1f8807));});};
\ No newline at end of file
+var _0x87e3=['data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','error','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../mysqldb','./cloudProvider.oauth','defaults','redis','status','end','json','offset','undefined','limit','count','set','update','destroy','stack','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','CloudProvider','then','includeAll','findAll','service','MicrosoftAzure','decryptString','catch','show','params','keys','include','merge','find','data3','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','get','Invalid\x20state\x20parameter','parse','state','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5'];(function(_0x126743,_0x531a54){var _0x4c5c3e=function(_0x2f96ca){while(--_0x2f96ca){_0x126743['push'](_0x126743['shift']());}};_0x4c5c3e(++_0x531a54);}(_0x87e3,0xc5));var _0x387e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x87e3[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x387e('0x0'));var Redis=require(_0x387e('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x387e('0x2'));var config=require(_0x387e('0x3'));var logger=require('../../config/logger')('api');var db=require(_0x387e('0x4'))['db'];var oauth=require(_0x387e('0x5'));config['redis']=_[_0x387e('0x6')](config[_0x387e('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x387e('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x38976e,_0x8a3d8f){_0x8a3d8f=_0x8a3d8f||0xcc;return function(_0x165dd4){if(_0x165dd4){return _0x38976e['sendStatus'](_0x8a3d8f);}return _0x38976e[_0x387e('0x8')](_0x8a3d8f)[_0x387e('0x9')]();};}function respondWithResult(_0x2edf22,_0x3aa180){_0x3aa180=_0x3aa180||0xc8;return function(_0x14b025){if(_0x14b025){return _0x2edf22[_0x387e('0x8')](_0x3aa180)[_0x387e('0xa')](_0x14b025);}};}function respondWithFilteredResult(_0x1465a8,_0x4bff45){return function(_0x294e00){if(_0x294e00){var _0x2997c4=typeof _0x4bff45[_0x387e('0xb')]===_0x387e('0xc')&&typeof _0x4bff45[_0x387e('0xd')]===_0x387e('0xc');var _0x127243=_0x294e00[_0x387e('0xe')];var _0x1bac31=_0x2997c4?0x0:_0x4bff45[_0x387e('0xb')];var _0x3fcc90=_0x2997c4?_0x294e00[_0x387e('0xe')]:_0x4bff45['offset']+_0x4bff45[_0x387e('0xd')];var _0x127bdf;if(_0x3fcc90>=_0x127243){_0x3fcc90=_0x127243;_0x127bdf=0xc8;}else{_0x127bdf=0xce;}_0x1465a8[_0x387e('0x8')](_0x127bdf);return _0x1465a8[_0x387e('0xf')]('Content-Range',_0x1bac31+'-'+_0x3fcc90+'/'+_0x127243)['json'](_0x294e00);}return null;};}function saveUpdates(_0x3bee76){return function(_0x5be448){if(_0x5be448){return _0x5be448[_0x387e('0x10')](_0x3bee76)['then'](function(_0x1dad77){return _0x1dad77;});}return null;};}function removeEntity(_0x17ead2){return function(_0x1797a9){if(_0x1797a9){return _0x1797a9[_0x387e('0x11')]()['then'](function(){_0x17ead2[_0x387e('0x8')](0xcc)[_0x387e('0x9')]();});}};}function handleEntityNotFound(_0x518449){return function(_0x246567){if(!_0x246567){_0x518449['sendStatus'](0x194);}return _0x246567;};}function handleError(_0x4c8fdd,_0x4c7853){_0x4c7853=_0x4c7853||0x1f4;return function(_0x42a994){logger['error'](_0x42a994[_0x387e('0x12')]);if(_0x42a994[_0x387e('0x13')]){delete _0x42a994[_0x387e('0x13')];}_0x4c8fdd['status'](_0x4c7853)[_0x387e('0x14')](_0x42a994);};}function maskClientSecret(_0x1cefc8){return _[_0x387e('0x15')](_0x1cefc8[_0x387e('0x16')](0x0,0x3),0x14,'*');}exports[_0x387e('0x17')]=function(_0x3c3f6e,_0x525639){var _0x15d182={},_0x277f81={},_0x845fa0={'count':0x0,'rows':[]};var _0x4f7950=_[_0x387e('0x18')](db['CloudProvider'][_0x387e('0x19')],function(_0x39113e){return{'name':_0x39113e[_0x387e('0x1a')],'type':_0x39113e[_0x387e('0x1b')][_0x387e('0x1c')]};});_0x277f81[_0x387e('0x1d')]=_[_0x387e('0x18')](_0x4f7950,_0x387e('0x13'));_0x277f81[_0x387e('0x1e')]=_['keys'](_0x3c3f6e[_0x387e('0x1e')]);_0x277f81['filters']=_['intersection'](_0x277f81[_0x387e('0x1d')],_0x277f81[_0x387e('0x1e')]);_0x15d182[_0x387e('0x1f')]=_[_0x387e('0x20')](_0x277f81['model'],qs['fields'](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x21')]));_0x15d182[_0x387e('0x1f')]=_0x15d182['attributes'][_0x387e('0x22')]?_0x15d182['attributes']:_0x277f81[_0x387e('0x1d')];if(!_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x23')](_0x387e('0x24'))){_0x15d182['limit']=qs[_0x387e('0xd')](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0xd')]);_0x15d182[_0x387e('0xb')]=qs[_0x387e('0xb')](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0xb')]);}_0x15d182[_0x387e('0x25')]=qs[_0x387e('0x26')](_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x26')]);_0x15d182[_0x387e('0x27')]=qs[_0x387e('0x28')](_[_0x387e('0x29')](_0x3c3f6e[_0x387e('0x1e')],_0x277f81[_0x387e('0x28')]),_0x4f7950);if(_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x2a')]){_0x15d182[_0x387e('0x27')]=_['merge'](_0x15d182[_0x387e('0x27')],{'$or':_[_0x387e('0x18')](_0x4f7950,function(_0x202136){if(_0x202136[_0x387e('0x1b')]!==_0x387e('0x2b')){var _0x5afa5a={};_0x5afa5a[_0x202136[_0x387e('0x13')]]={'$like':'%'+_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x2a')]+'%'};return _0x5afa5a;}})});}_0x15d182=_['merge']({},_0x15d182,_0x3c3f6e[_0x387e('0x2c')]);var _0x235501={'where':_0x15d182[_0x387e('0x27')]};return db[_0x387e('0x2d')][_0x387e('0xe')](_0x235501)[_0x387e('0x2e')](function(_0x2c01db){_0x845fa0[_0x387e('0xe')]=_0x2c01db;if(_0x3c3f6e[_0x387e('0x1e')][_0x387e('0x2f')]){_0x15d182['include']=[{'all':!![]}];}return db['CloudProvider'][_0x387e('0x30')](_0x15d182);})[_0x387e('0x2e')](function(_0x317431){_0x845fa0['rows']=_['map'](_0x317431,function(_0x3a8f8f){if(_0x3a8f8f[_0x387e('0x31')]===_0x387e('0x32')){var _0x31c8f8=encryptor[_0x387e('0x33')](_0x3a8f8f['data3']);_0x3a8f8f['data3']=maskClientSecret(_0x31c8f8);}return _0x3a8f8f;});return _0x845fa0;})[_0x387e('0x2e')](respondWithFilteredResult(_0x525639,_0x15d182))[_0x387e('0x34')](handleError(_0x525639,null));};exports[_0x387e('0x35')]=function(_0x1faf90,_0x2a4328){var _0x6a6e3a={'raw':!![],'where':{'id':_0x1faf90[_0x387e('0x36')]['id']}},_0x4e493d={};_0x4e493d[_0x387e('0x1d')]=_[_0x387e('0x37')](db[_0x387e('0x2d')][_0x387e('0x19')]);_0x4e493d['query']=_[_0x387e('0x37')](_0x1faf90[_0x387e('0x1e')]);_0x4e493d[_0x387e('0x28')]=_[_0x387e('0x20')](_0x4e493d[_0x387e('0x1d')],_0x4e493d[_0x387e('0x1e')]);_0x6a6e3a[_0x387e('0x1f')]=_['intersection'](_0x4e493d[_0x387e('0x1d')],qs[_0x387e('0x21')](_0x1faf90[_0x387e('0x1e')][_0x387e('0x21')]));_0x6a6e3a[_0x387e('0x1f')]=_0x6a6e3a[_0x387e('0x1f')][_0x387e('0x22')]?_0x6a6e3a[_0x387e('0x1f')]:_0x4e493d['model'];if(_0x1faf90[_0x387e('0x1e')][_0x387e('0x2f')]){_0x6a6e3a[_0x387e('0x38')]=[{'all':!![]}];}_0x6a6e3a=_[_0x387e('0x39')]({},_0x6a6e3a,_0x1faf90[_0x387e('0x2c')]);return db[_0x387e('0x2d')][_0x387e('0x3a')](_0x6a6e3a)[_0x387e('0x2e')](handleEntityNotFound(_0x2a4328,null))['then'](function(_0x351e1c){if(_0x351e1c[_0x387e('0x31')]===_0x387e('0x32')){var _0x434332=encryptor['decryptString'](_0x351e1c[_0x387e('0x3b')]);_0x351e1c[_0x387e('0x3b')]=maskClientSecret(_0x434332);}return _0x351e1c;})[_0x387e('0x2e')](respondWithResult(_0x2a4328,null))[_0x387e('0x34')](handleError(_0x2a4328,null));};exports[_0x387e('0x3c')]=function(_0x53155e,_0x7b051c){if(!_0x53155e[_0x387e('0x3d')][_0x387e('0x13')])throw new Error(_0x387e('0x3e'));if(!_0x53155e[_0x387e('0x3d')][_0x387e('0x31')])throw new Error(_0x387e('0x3f'));var _0x5db50b=db[_0x387e('0x2d')][_0x387e('0x19')][_0x387e('0x31')][_0x387e('0x40')];if(!_0x5db50b[_0x387e('0x41')](_0x53155e[_0x387e('0x3d')][_0x387e('0x31')]))throw new Error(_0x387e('0x42')+_0x5db50b['join'](',\x20'));if(_0x53155e[_0x387e('0x3d')]['service']==='MicrosoftAzure'&&_0x53155e['body'][_0x387e('0x3b')]){_0x53155e[_0x387e('0x3d')]['data3']=encryptor[_0x387e('0x43')](_0x53155e['body'][_0x387e('0x3b')]);}return db[_0x387e('0x2d')][_0x387e('0x3c')](_0x53155e['body'],{})[_0x387e('0x2e')](respondWithResult(_0x7b051c,0xc9))['catch'](handleError(_0x7b051c,null));};exports[_0x387e('0x10')]=function(_0xb9087d,_0x2e9b64){if(_0xb9087d['body']['id']){delete _0xb9087d[_0x387e('0x3d')]['id'];}return db[_0x387e('0x2d')][_0x387e('0x3a')]({'where':{'id':_0xb9087d[_0x387e('0x36')]['id']}})[_0x387e('0x2e')](handleEntityNotFound(_0x2e9b64,null))['then'](function(_0x1f624e){if(_0x1f624e[_0x387e('0x31')]===_0x387e('0x32')&&_0xb9087d['body'][_0x387e('0x3b')]){_0xb9087d[_0x387e('0x3d')][_0x387e('0x3b')]=encryptor[_0x387e('0x43')](_0xb9087d[_0x387e('0x3d')]['data3']);}return _0x1f624e;})[_0x387e('0x2e')](saveUpdates(_0xb9087d[_0x387e('0x3d')],null))['then'](respondWithResult(_0x2e9b64,null))[_0x387e('0x34')](handleError(_0x2e9b64,null));};exports[_0x387e('0x11')]=function(_0x373757,_0x12c275){return db[_0x387e('0x2d')]['find']({'where':{'id':_0x373757[_0x387e('0x36')]['id']}})['then'](handleEntityNotFound(_0x12c275,null))[_0x387e('0x2e')](removeEntity(_0x12c275,null))[_0x387e('0x34')](handleError(_0x12c275,null));};exports[_0x387e('0x44')]=function(_0x9e261e,_0x503d99){return db['CloudProvider'][_0x387e('0x45')]({'where':{'id':_0x9e261e['params']['id']},'raw':!![]})[_0x387e('0x2e')](function(_0x461765){if(!_0x461765)return _0x503d99[_0x387e('0x46')](0x194);return{'url':oauth[_0x387e('0x47')](_0x461765,_0x9e261e['user']['id'])};})[_0x387e('0x2e')](respondWithResult(_0x503d99,null))[_0x387e('0x34')](handleError(_0x503d99,null));};exports['oauth2MicrosoftCallback']=function(_0x41de28,_0x78553c){var _0x49c6ab=_0x41de28[_0x387e('0x3d')];var _0x1c8e22;var _0x1d59e2;if(_0x49c6ab['error'])throw _0x49c6ab;redis[_0x387e('0x48')](_0x49c6ab['state'])[_0x387e('0x2e')](function(_0xb973db){if(!_0xb973db)throw new Error(_0x387e('0x49'));_0x1c8e22=JSON[_0x387e('0x4a')](_0xb973db);var _0x2485ce=Buffer['from'](_0x49c6ab[_0x387e('0x4b')],'base64')[_0x387e('0x4c')](_0x387e('0x4d'));_0x1d59e2=JSON[_0x387e('0x4a')](_0x2485ce);if(!oauth[_0x387e('0x4e')](_0x49c6ab[_0x387e('0x4f')],_0x1c8e22['oauth2Claims']))throw new Error(_0x387e('0x50'));redis[_0x387e('0x51')](_0x49c6ab[_0x387e('0x4b')]);return oauth[_0x387e('0x52')](_0x49c6ab[_0x387e('0x53')],_0x1c8e22);})[_0x387e('0x2e')](function(_0x165d5a){_0x1c8e22[_0x387e('0x54')]=_0x165d5a['access_token'];_0x1c8e22[_0x387e('0x55')]=_0x165d5a[_0x387e('0x56')];return db['CloudProvider'][_0x387e('0x10')]({'data5':_0x1c8e22[_0x387e('0x54')],'data6':_0x1c8e22[_0x387e('0x55')]},{'where':{'id':_0x1c8e22['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x1c8e22);socket[_0x387e('0x57')](_0x387e('0x58'),{'id':_0x1d59e2['id']});return;})[_0x387e('0x2e')](respondWithStatusCode(_0x78553c,null))[_0x387e('0x34')](function(_0x475e21){if(_0x1d59e2){socket['emit'](_0x387e('0x59'),{'id':_0x1d59e2['id']});}if(!_0x1c8e22){logger['error'](_0x387e('0x5a'),_0x475e21);return _0x78553c[_0x387e('0x8')](0x1f4)['send'](_0x475e21[_0x387e('0x5b')]);}logger[_0x387e('0x5c')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1c8e22['id'],JSON[_0x387e('0x5d')](_0x475e21));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index dd12bee..68df5aa 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 _0x6f1b=['../../config/logger','request-promise','rimraf','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0x3aa1a3,_0x148306){var _0x427f8e=function(_0x3f31e1){while(--_0x3f31e1){_0x3aa1a3['push'](_0x3aa1a3['shift']());}};_0x427f8e(++_0x148306);}(_0x6f1b,0x15e));var _0xb6f1=function(_0x1cd2d7,_0x281cda){_0x1cd2d7=_0x1cd2d7-0x0;var _0x5342fb=_0x6f1b[_0x1cd2d7];return _0x5342fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb6f1('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb6f1('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb6f1('0x2'));var config=require('../../config/environment');var attributes=require(_0xb6f1('0x3'));module['exports']=function(_0x51242e,_0x3e33a3){return _0x51242e[_0xb6f1('0x4')](_0xb6f1('0x5'),attributes,{'tableName':_0xb6f1('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc51=['util','../../config/logger','api','moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','cloud_providers','lodash'];(function(_0x1d04fc,_0x57ff67){var _0x41b7e8=function(_0x2b412f){while(--_0x2b412f){_0x1d04fc['push'](_0x1d04fc['shift']());}};_0x41b7e8(++_0x57ff67);}(_0xcc51,0xcb));var _0x1cc5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xcc51[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x1cc5('0x0'));var util=require(_0x1cc5('0x1'));var logger=require(_0x1cc5('0x2'))(_0x1cc5('0x3'));var moment=require(_0x1cc5('0x4'));var BPromise=require('bluebird');var rp=require(_0x1cc5('0x5'));var fs=require('fs');var path=require(_0x1cc5('0x6'));var rimraf=require(_0x1cc5('0x7'));var config=require('../../config/environment');var attributes=require(_0x1cc5('0x8'));module[_0x1cc5('0x9')]=function(_0x448c6f,_0x4fa5c4){return _0x448c6f[_0x1cc5('0xa')]('CloudProvider',attributes,{'tableName':_0x1cc5('0xb'),'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 4b56ccb..24f3268 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 _0x4079=['decryptString','data2','data5','access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','stringify','base64','randomBytes','toString','hex','client_id','data4','form_post','state','nonce','prompt','login','value','oauth2/','set','payload','aud','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data1'];(function(_0x4472ea,_0x1c5c44){var _0x37d760=function(_0x39526b){while(--_0x39526b){_0x4472ea['push'](_0x4472ea['shift']());}};_0x37d760(++_0x1c5c44);}(_0x4079,0xe6));var _0x9407=function(_0x3b8a6a,_0x56c2df){_0x3b8a6a=_0x3b8a6a-0x0;var _0x4b2128=_0x4079[_0x3b8a6a];return _0x4b2128;};'use strict';var _=require(_0x9407('0x0'));var crypto=require(_0x9407('0x1'));var jwt=require(_0x9407('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x9407('0x3'));var encryptor=require(_0x9407('0x4'));var config=require(_0x9407('0x5'));var logger=require(_0x9407('0x6'))(_0x9407('0x7'));var schedule=require(_0x9407('0x8'));var db=require(_0x9407('0x9'))['db'];config[_0x9407('0xa')]=_[_0x9407('0xb')](config[_0x9407('0xa')],{'host':_0x9407('0xc'),'port':0x18eb});var redis=new Redis(config[_0x9407('0xa')]);var MICROSOFT_AUTH_URL=_0x9407('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x9407('0xe'),_0x9407('0xf'),_0x9407('0x10'),_0x9407('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x9407('0xe'),_0x9407('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x9407('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x9407('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xe79757){var _0xcdd15f=_[_0x9407('0x14')](AZURE_AUTH_SCOPES[_0xe79757[_0x9407('0x15')]]);if(_0xe79757[_0x9407('0x15')]===_0x9407('0x16'))_0xcdd15f[_0x9407('0x17')](_0xe79757[_0x9407('0x18')]+_0x9407('0x19'));return _0xcdd15f[_0x9407('0x1a')]('\x20');}function getAccessTokenScope(_0x37dc6a){if(_0x37dc6a[_0x9407('0x15')]===_0x9407('0x1b'))return _0x9407('0x1c');if(_0x37dc6a[_0x9407('0x15')]===_0x9407('0x16'))return _0x37dc6a[_0x9407('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4c5713,_0x132243){var _0x5efb46=MICROSOFT_AUTH_URL[_0x9407('0x1d')](_0x9407('0x1e'),_0x4c5713['data2']);var _0x323189=['code','id_token'];var _0x2f999c=Buffer['from'](JSON[_0x9407('0x1f')]({'id':_0x132243}))['toString'](_0x9407('0x20'));var _0x19d694=crypto[_0x9407('0x21')](0x10)[_0x9407('0x22')](_0x9407('0x23'));var _0x5b30ae=getAuthorizationScopes(_0x4c5713);var _0x1bda52=[{'key':_0x9407('0x24'),'value':_0x4c5713['data1']},{'key':'response_type','value':encodeURIComponent(_0x323189[_0x9407('0x1a')]('\x20'))},{'key':'redirect_uri','value':_0x4c5713[_0x9407('0x25')]},{'key':'response_mode','value':_0x9407('0x26')},{'key':'scope','value':encodeURIComponent(_0x5b30ae)},{'key':_0x9407('0x27'),'value':_0x2f999c},{'key':_0x9407('0x28'),'value':_0x19d694},{'key':_0x9407('0x29'),'value':_0x9407('0x2a')}];var _0x230396=_0x5efb46+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9407('0x14')](_0x1bda52,function(_0x235084){return _0x235084['key']+'='+_0x235084[_0x9407('0x2b')];})[_0x9407('0x1a')]('&');_0x4c5713['oauth2Claims']={'issuer':_0x5efb46[_0x9407('0x1d')](_0x9407('0x2c'),''),'audience':_0x4c5713['data1'],'state':_0x2f999c,'nonce':_0x19d694};redis[_0x9407('0x2d')](_0x2f999c,JSON[_0x9407('0x1f')](_0x4c5713));return _0x230396;}function isValidIdToken(_0x7bb4b7,_0x3744d3){try{var _0x30c49f=jwt['decode'](_0x7bb4b7,{'complete':!![]});var _0x475614=_0x30c49f[_0x9407('0x2e')];if(_0x475614['iss']!==_0x3744d3['issuer'])return![];if(_0x475614[_0x9407('0x2f')]!==_0x3744d3[_0x9407('0x30')])return![];if(_0x475614['nonce']!==_0x3744d3[_0x9407('0x28')])return![];if(moment()['isAfter'](moment[_0x9407('0x31')](_0x475614[_0x9407('0x32')])))return![];return!![];}catch(_0x17810e){throw _0x17810e;}}function refreshOauth2MicrosoftAccessToken(_0xeeac74){return Promise[_0x9407('0x33')]()[_0x9407('0x34')](function(){if(_0xeeac74[_0x9407('0x35')])return _0xeeac74;return db[_0x9407('0x36')][_0x9407('0x37')]({'where':{'id':_0xeeac74['id']},'raw':!![]});})[_0x9407('0x34')](function(_0x44a0bf){var _0x1ea0cc={'grant_type':_0x9407('0x38'),'refresh_token':_0x44a0bf['data6'],'scope':getAccessTokenScope(_0x44a0bf),'redirect_uri':_0x44a0bf[_0x9407('0x25')],'client_id':_0x44a0bf[_0x9407('0x39')],'client_secret':encryptor[_0x9407('0x3a')](_0x44a0bf[_0x9407('0x35')])};var _0x234985={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x9407('0x1d')](_0x9407('0x1e'),_0x44a0bf[_0x9407('0x3b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1ea0cc,'json':!![]};return rp(_0x234985);})[_0x9407('0x34')](function(_0x57e02a){_0xeeac74[_0x9407('0x3c')]=_0x57e02a[_0x9407('0x3d')];_0xeeac74[_0x9407('0x3e')]=_0x57e02a[_0x9407('0x38')];return db[_0x9407('0x36')][_0x9407('0x3f')]({'data5':_0xeeac74[_0x9407('0x3c')],'data6':_0xeeac74[_0x9407('0x3e')]},{'where':{'id':_0xeeac74['id']}});})[_0x9407('0x34')](function(){return _0xeeac74;})[_0x9407('0x40')](function(_0x1fad7c){logger[_0x9407('0x41')](_0x9407('0x42'),_0xeeac74['id'],_0x1fad7c);});}function getOauth2MicrosoftAccessToken(_0xb1c69d,_0x3fde07){var _0x1b281c={'grant_type':'authorization_code','code':_0xb1c69d,'scope':getAccessTokenScope(_0x3fde07),'redirect_uri':_0x3fde07[_0x9407('0x25')],'client_id':_0x3fde07[_0x9407('0x39')],'client_secret':encryptor['decryptString'](_0x3fde07[_0x9407('0x35')])};var _0x4af167={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x9407('0x1d')](_0x9407('0x1e'),_0x3fde07[_0x9407('0x3b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1b281c,'json':!![]};return rp(_0x4af167);}function startRefreshInterval(_0x16c0a3){var _0x1dd025=schedule[_0x9407('0x43')];if(_0x1dd025[_0x16c0a3['id']])clearInterval(_0x1dd025[_0x16c0a3['id']]);_0x1dd025[_0x16c0a3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9407('0x44')](this,{'id':_0x16c0a3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9407('0x43')]=_0x1dd025;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x9407('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9407('0x34')](function(_0x20eca7){var _0x26eac9=_0x20eca7[_0x9407('0x14')](function(_0x378075){return refreshOauth2MicrosoftAccessToken(_0x378075)[_0x9407('0x34')](function(_0x35dd5a){startRefreshInterval(_0x35dd5a);});});return Promise[_0x9407('0x46')](_0x26eac9);})['catch'](function(_0x58f8bf){var _0x558582=_0x58f8bf?util['inspect'](_0x58f8bf,{'showHidden':![],'depth':null}):'';logger[_0x9407('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x558582);});}module[_0x9407('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x71b2=['Outlook365','replace','{TENANT_ID}','code','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','nonce','prompt','oauth2Claims','oauth2/','set','decode','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data2','data5','data6','update','catch','authorization_code','bind','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','push','data7','/.default','join'];(function(_0x4c809c,_0x38cece){var _0x423955=function(_0x1ed9a7){while(--_0x1ed9a7){_0x4c809c['push'](_0x4c809c['shift']());}};_0x423955(++_0x38cece);}(_0x71b2,0x154));var _0x271b=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x71b2[_0x1fa759];return _0x2da9f4;};'use strict';var _=require(_0x271b('0x0'));var crypto=require('crypto');var jwt=require(_0x271b('0x1'));var moment=require(_0x271b('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x271b('0x3'));var config=require(_0x271b('0x4'));var logger=require(_0x271b('0x5'))(_0x271b('0x6'));var schedule=require(_0x271b('0x7'));var db=require(_0x271b('0x8'))['db'];config[_0x271b('0x9')]=_[_0x271b('0xa')](config['redis'],{'host':_0x271b('0xb'),'port':0x18eb});var redis=new Redis(config[_0x271b('0x9')]);var MICROSOFT_AUTH_URL=_0x271b('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile','email',_0x271b('0xd'),_0x271b('0xe'),_0x271b('0xf'),_0x271b('0x10')],'Dynamics365':[_0x271b('0x11'),_0x271b('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x271b('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5806f9){var _0x11bca7=_[_0x271b('0x13')](AZURE_AUTH_SCOPES[_0x5806f9[_0x271b('0x14')]]);if(_0x5806f9[_0x271b('0x14')]==='Dynamics365')_0x11bca7[_0x271b('0x15')](_0x5806f9[_0x271b('0x16')]+_0x271b('0x17'));return _0x11bca7[_0x271b('0x18')]('\x20');}function getAccessTokenScope(_0x104700){if(_0x104700[_0x271b('0x14')]===_0x271b('0x19'))return _0x271b('0xe');if(_0x104700[_0x271b('0x14')]==='Dynamics365')return _0x104700[_0x271b('0x16')]+_0x271b('0x17');}function generateMicrosoftAuthorizationUrl(_0x583286,_0x271b8a){var _0x39fabb=MICROSOFT_AUTH_URL[_0x271b('0x1a')](_0x271b('0x1b'),_0x583286['data2']);var _0x773eb4=[_0x271b('0x1c'),'id_token'];var _0xfa6c08=Buffer['from'](JSON[_0x271b('0x1d')]({'id':_0x271b8a}))[_0x271b('0x1e')](_0x271b('0x1f'));var _0x59c0f7=crypto[_0x271b('0x20')](0x10)['toString'](_0x271b('0x21'));var _0x453b72=getAuthorizationScopes(_0x583286);var _0xd39d94=[{'key':_0x271b('0x22'),'value':_0x583286[_0x271b('0x23')]},{'key':_0x271b('0x24'),'value':encodeURIComponent(_0x773eb4[_0x271b('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x583286[_0x271b('0x25')]},{'key':_0x271b('0x26'),'value':_0x271b('0x27')},{'key':_0x271b('0x28'),'value':encodeURIComponent(_0x453b72)},{'key':'state','value':_0xfa6c08},{'key':_0x271b('0x29'),'value':_0x59c0f7},{'key':_0x271b('0x2a'),'value':'login'}];var _0x1d2516=_0x39fabb+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x271b('0x13')](_0xd39d94,function(_0x5d2ca7){return _0x5d2ca7['key']+'='+_0x5d2ca7['value'];})[_0x271b('0x18')]('&');_0x583286[_0x271b('0x2b')]={'issuer':_0x39fabb[_0x271b('0x1a')](_0x271b('0x2c'),''),'audience':_0x583286[_0x271b('0x23')],'state':_0xfa6c08,'nonce':_0x59c0f7};redis[_0x271b('0x2d')](_0xfa6c08,JSON['stringify'](_0x583286));return _0x1d2516;}function isValidIdToken(_0x3c538f,_0x1545e4){try{var _0x843335=jwt[_0x271b('0x2e')](_0x3c538f,{'complete':!![]});var _0x3acf71=_0x843335['payload'];if(_0x3acf71[_0x271b('0x2f')]!==_0x1545e4[_0x271b('0x30')])return![];if(_0x3acf71[_0x271b('0x31')]!==_0x1545e4[_0x271b('0x32')])return![];if(_0x3acf71[_0x271b('0x29')]!==_0x1545e4[_0x271b('0x29')])return![];if(moment()[_0x271b('0x33')](moment[_0x271b('0x34')](_0x3acf71[_0x271b('0x35')])))return![];return!![];}catch(_0x229e68){throw _0x229e68;}}function refreshOauth2MicrosoftAccessToken(_0x41d788){return Promise[_0x271b('0x36')]()[_0x271b('0x37')](function(){if(_0x41d788[_0x271b('0x38')])return _0x41d788;return db[_0x271b('0x39')][_0x271b('0x3a')]({'where':{'id':_0x41d788['id']},'raw':!![]});})[_0x271b('0x37')](function(_0x59ebeb){var _0x355c58={'grant_type':_0x271b('0x3b'),'refresh_token':_0x59ebeb['data6'],'scope':getAccessTokenScope(_0x59ebeb),'redirect_uri':_0x59ebeb[_0x271b('0x25')],'client_id':_0x59ebeb[_0x271b('0x23')],'client_secret':encryptor[_0x271b('0x3c')](_0x59ebeb[_0x271b('0x38')])};var _0x4f6797={'method':_0x271b('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x271b('0x1a')](_0x271b('0x1b'),_0x59ebeb[_0x271b('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x355c58,'json':!![]};return rp(_0x4f6797);})['then'](function(_0x2700b6){_0x41d788[_0x271b('0x3f')]=_0x2700b6['access_token'];_0x41d788[_0x271b('0x40')]=_0x2700b6[_0x271b('0x3b')];return db[_0x271b('0x39')][_0x271b('0x41')]({'data5':_0x41d788[_0x271b('0x3f')],'data6':_0x41d788[_0x271b('0x40')]},{'where':{'id':_0x41d788['id']}});})[_0x271b('0x37')](function(){return _0x41d788;})[_0x271b('0x42')](function(_0x4b1344){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x41d788['id'],_0x4b1344);});}function getOauth2MicrosoftAccessToken(_0x25b013,_0x5b690a){var _0x234824={'grant_type':_0x271b('0x43'),'code':_0x25b013,'scope':getAccessTokenScope(_0x5b690a),'redirect_uri':_0x5b690a[_0x271b('0x25')],'client_id':_0x5b690a[_0x271b('0x23')],'client_secret':encryptor['decryptString'](_0x5b690a[_0x271b('0x38')])};var _0x10aa39={'method':_0x271b('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x271b('0x1a')]('{TENANT_ID}',_0x5b690a[_0x271b('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x234824,'json':!![]};return rp(_0x10aa39);}function startRefreshInterval(_0x56a31e){var _0x2e3340=schedule['intervals'];if(_0x2e3340[_0x56a31e['id']])clearInterval(_0x2e3340[_0x56a31e['id']]);_0x2e3340[_0x56a31e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x271b('0x44')](this,{'id':_0x56a31e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2e3340;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x38b7cc){var _0x2525cc=_0x38b7cc[_0x271b('0x13')](function(_0x23f2b3){return refreshOauth2MicrosoftAccessToken(_0x23f2b3)['then'](function(_0x3692f9){startRefreshInterval(_0x3692f9);});});return Promise['all'](_0x2525cc);})[_0x271b('0x42')](function(_0x1ec035){var _0x5ef841=_0x1ec035?util[_0x271b('0x45')](_0x1ec035,{'showHidden':![],'depth':null}):'';logger[_0x271b('0x46')](_0x271b('0x47'),_0x5ef841);});}module[_0x271b('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 8aae128..e05b1c4 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 _0x8227=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3e8c83,_0x561dc7){var _0x488c0d=function(_0x5eff9f){while(--_0x5eff9f){_0x3e8c83['push'](_0x3e8c83['shift']());}};_0x488c0d(++_0x561dc7);}(_0x8227,0x146));var _0x7822=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8227[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7822('0x0'));var moment=require('moment');var BPromise=require(_0x7822('0x1'));var rs=require(_0x7822('0x2'));var fs=require('fs');var Redis=require(_0x7822('0x3'));var db=require(_0x7822('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7822('0x5'))(_0x7822('0x6'));var config=require(_0x7822('0x7'));var jayson=require(_0x7822('0x8'));var client=jayson[_0x7822('0x9')][_0x7822('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb55,_0x23d59f,_0x4c5213){return new BPromise(function(_0xe2a3cf,_0x5d749e){return client[_0x7822('0xb')](_0x3fdb55,_0x4c5213)[_0x7822('0xc')](function(_0x3ba7cb){logger[_0x7822('0xd')](_0x7822('0xe'),_0x23d59f,_0x7822('0xf'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x23d59f,_0x7822('0xf'),JSON['stringify'](_0x3ba7cb));if(_0x3ba7cb[_0x7822('0x10')]){if(_0x3ba7cb[_0x7822('0x10')][_0x7822('0x11')]===0x1f4){logger[_0x7822('0x10')](_0x7822('0xe'),_0x23d59f,_0x3ba7cb[_0x7822('0x10')]['message']);return _0x5d749e(_0x3ba7cb['error'][_0x7822('0x12')]);}logger[_0x7822('0x10')]('CloudProvider,\x20%s,\x20%s',_0x23d59f,_0x3ba7cb[_0x7822('0x10')][_0x7822('0x12')]);return _0xe2a3cf(_0x3ba7cb[_0x7822('0x10')][_0x7822('0x12')]);}else{logger[_0x7822('0xd')]('CloudProvider,\x20%s,\x20%s',_0x23d59f,'request\x20sent');_0xe2a3cf(_0x3ba7cb[_0x7822('0x13')][_0x7822('0x12')]);}})[_0x7822('0x14')](function(_0x144fdb){logger[_0x7822('0x10')](_0x7822('0xe'),_0x23d59f,_0x144fdb);_0x5d749e(_0x144fdb);});});}
\ No newline at end of file
+var _0xaa64=['rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5235b6,_0x13aab0){var _0x302d39=function(_0x63977c){while(--_0x63977c){_0x5235b6['push'](_0x5235b6['shift']());}};_0x302d39(++_0x13aab0);}(_0xaa64,0xf7));var _0x4aa6=function(_0x2818a7,_0xb38d51){_0x2818a7=_0x2818a7-0x0;var _0x3d7a89=_0xaa64[_0x2818a7];return _0x3d7a89;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require('moment');var BPromise=require(_0x4aa6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aa6('0x3'));var db=require(_0x4aa6('0x4'))['db'];var utils=require(_0x4aa6('0x5'));var logger=require('../../config/logger')(_0x4aa6('0x6'));var config=require(_0x4aa6('0x7'));var jayson=require(_0x4aa6('0x8'));var client=jayson[_0x4aa6('0x9')][_0x4aa6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7dd83d,_0x39c4b5,_0x49e174){return new BPromise(function(_0x529c89,_0xee21ba){return client[_0x4aa6('0xb')](_0x7dd83d,_0x49e174)['then'](function(_0x26619c){logger['info'](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));logger[_0x4aa6('0xe')](_0x4aa6('0xf'),_0x39c4b5,'request\x20sent',JSON[_0x4aa6('0x10')](_0x26619c));if(_0x26619c[_0x4aa6('0x11')]){if(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x12')]===0x1f4){logger[_0x4aa6('0x11')](_0x4aa6('0xc'),_0x39c4b5,_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);return _0xee21ba(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}logger['error'](_0x4aa6('0xc'),_0x39c4b5,_0x26619c['error']['message']);return _0x529c89(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}else{logger[_0x4aa6('0x14')](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));_0x529c89(_0x26619c[_0x4aa6('0x15')][_0x4aa6('0x13')]);}})[_0x4aa6('0x16')](function(_0x530ed0){logger[_0x4aa6('0x11')]('CloudProvider,\x20%s,\x20%s',_0x39c4b5,_0x530ed0);_0xee21ba(_0x530ed0);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index bee90a8..6cb0be8 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x132387,_0x45fbc5){var _0x426409=function(_0x205d43){while(--_0x205d43){_0x132387['push'](_0x132387['shift']());}};_0x426409(++_0x45fbc5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=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(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x5f2f,0x73));var _0xf5f2=function(_0x26ef11,_0x5be4e1){_0x26ef11=_0x26ef11-0x0;var _0x61ca13=_0x5f2f[_0x26ef11];return _0x61ca13;};'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 761fae9..69381b5 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 _0x1323=['name','sequelize','STRING'];(function(_0x447ce1,_0x11cf0b){var _0x4c1e7a=function(_0x6693b9){while(--_0x6693b9){_0x447ce1['push'](_0x447ce1['shift']());}};_0x4c1e7a(++_0x11cf0b);}(_0x1323,0x1f3));var _0x3132=function(_0x348c39,_0x2b1cf3){_0x348c39=_0x348c39-0x0;var _0x135ce4=_0x1323[_0x348c39];return _0x135ce4;};'use strict';var Sequelize=require(_0x3132('0x0'));module['exports']={'name':{'type':Sequelize[_0x3132('0x1')],'unique':_0x3132('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3132('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x3132('0x1')]},'phone':{'type':Sequelize[_0x3132('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3132('0x1')]},'street':{'type':Sequelize[_0x3132('0x1')]},'postalCode':{'type':Sequelize[_0x3132('0x1')]},'city':{'type':Sequelize[_0x3132('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3132('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3132('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x3132('0x1')]},'sCity':{'type':Sequelize[_0x3132('0x1')]},'sCountry':{'type':Sequelize[_0x3132('0x1')]},'description':{'type':Sequelize[_0x3132('0x1')]}};
\ No newline at end of file
+var _0xd6a1=['STRING','name','sequelize','exports'];(function(_0x4ebbc4,_0x4bd3ab){var _0x17c498=function(_0xa45a50){while(--_0xa45a50){_0x4ebbc4['push'](_0x4ebbc4['shift']());}};_0x17c498(++_0x4bd3ab);}(_0xd6a1,0x82));var _0x1d6a=function(_0x495203,_0x536f9d){_0x495203=_0x495203-0x0;var _0x1da659=_0xd6a1[_0x495203];return _0x1da659;};'use strict';var Sequelize=require(_0x1d6a('0x0'));module[_0x1d6a('0x1')]={'name':{'type':Sequelize[_0x1d6a('0x2')],'unique':_0x1d6a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1d6a('0x2')]},'companyId':{'type':Sequelize[_0x1d6a('0x2')]},'website':{'type':Sequelize[_0x1d6a('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1d6a('0x2')]},'type':{'type':Sequelize[_0x1d6a('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1d6a('0x2')]},'country':{'type':Sequelize[_0x1d6a('0x2')]},'email':{'type':Sequelize[_0x1d6a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1d6a('0x2')]},'sStreet':{'type':Sequelize[_0x1d6a('0x2')]},'sPostalCode':{'type':Sequelize[_0x1d6a('0x2')]},'sCity':{'type':Sequelize[_0x1d6a('0x2')]},'sCountry':{'type':Sequelize[_0x1d6a('0x2')]},'description':{'type':Sequelize[_0x1d6a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7825ace..313ae2a 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 _0xb8d5=['include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','ids','omit','getContacts','findOne','CmContact','rawAttributes','sort','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','then','get','UserProfileResource','destroy','end','error','name','index','CmCompany','describe','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','options','includeAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb8d5,0xc7));var _0x5b8d=function(_0x186d3b,_0x25d00c){_0x186d3b=_0x186d3b-0x0;var _0x278910=_0xb8d5[_0x186d3b];return _0x278910;};'use strict';var emlformat=require(_0x5b8d('0x0'));var rimraf=require(_0x5b8d('0x1'));var zipdir=require(_0x5b8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b8d('0x3'));var Mustache=require(_0x5b8d('0x4'));var util=require(_0x5b8d('0x5'));var path=require(_0x5b8d('0x6'));var sox=require(_0x5b8d('0x7'));var csv=require(_0x5b8d('0x8'));var ejs=require(_0x5b8d('0x9'));var fs=require('fs');var fs_extra=require(_0x5b8d('0xa'));var _=require(_0x5b8d('0xb'));var squel=require(_0x5b8d('0xc'));var crypto=require(_0x5b8d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b8d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b8d('0xf'));var Papa=require(_0x5b8d('0x10'));var Redis=require(_0x5b8d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b8d('0x12'));var as=require(_0x5b8d('0x13'));var hardwareService=require(_0x5b8d('0x14'));var logger=require('../../config/logger')(_0x5b8d('0x15'));var utils=require('../../config/utils');var config=require(_0x5b8d('0x16'));var licenseUtil=require(_0x5b8d('0x17'));var db=require(_0x5b8d('0x18'))['db'];function respondWithStatusCode(_0xb46210,_0x52416c){_0x52416c=_0x52416c||0xcc;return function(_0x56a76d){if(_0x56a76d){return _0xb46210[_0x5b8d('0x19')](_0x52416c);}return _0xb46210[_0x5b8d('0x1a')](_0x52416c)['end']();};}function respondWithResult(_0x26eca4,_0xe5d3fa){_0xe5d3fa=_0xe5d3fa||0xc8;return function(_0xaa4342){if(_0xaa4342){return _0x26eca4[_0x5b8d('0x1a')](_0xe5d3fa)[_0x5b8d('0x1b')](_0xaa4342);}};}function respondWithFilteredResult(_0x409b95,_0x514787){return function(_0x201ca9){if(_0x201ca9){var _0x2cf1eb=typeof _0x514787[_0x5b8d('0x1c')]===_0x5b8d('0x1d')&&typeof _0x514787[_0x5b8d('0x1e')]==='undefined';var _0x43936e=_0x201ca9[_0x5b8d('0x1f')];var _0x551cc8=_0x2cf1eb?0x0:_0x514787[_0x5b8d('0x1c')];var _0xff10e=_0x2cf1eb?_0x201ca9['count']:_0x514787[_0x5b8d('0x1c')]+_0x514787[_0x5b8d('0x1e')];var _0x39a348;if(_0xff10e>=_0x43936e){_0xff10e=_0x43936e;_0x39a348=0xc8;}else{_0x39a348=0xce;}_0x409b95[_0x5b8d('0x1a')](_0x39a348);return _0x409b95['set']('Content-Range',_0x551cc8+'-'+_0xff10e+'/'+_0x43936e)[_0x5b8d('0x1b')](_0x201ca9);}return null;};}function patchUpdates(_0x4f7017){return function(_0x248c62){try{jsonpatch[_0x5b8d('0x20')](_0x248c62,_0x4f7017,!![]);}catch(_0x590de0){return BPromise[_0x5b8d('0x21')](_0x590de0);}return _0x248c62['save']();};}function saveUpdates(_0x5c5627,_0x2b9997){return function(_0x49687c){if(_0x49687c){return _0x49687c['update'](_0x5c5627)[_0x5b8d('0x22')](function(_0x8fa4fc){return _0x8fa4fc;});}return null;};}function removeEntity(_0x5b0eba,_0x32531d){return function(_0x55f7dc){if(_0x55f7dc){return _0x55f7dc['destroy']()[_0x5b8d('0x22')](function(){var _0x432e4f=_0x55f7dc[_0x5b8d('0x23')]({'plain':!![]});var _0x5a965c='Companies';return db[_0x5b8d('0x24')][_0x5b8d('0x25')]({'where':{'type':_0x5a965c,'resourceId':_0x432e4f['id']}})['then'](function(){return _0x55f7dc;});})['then'](function(){_0x5b0eba[_0x5b8d('0x1a')](0xcc)[_0x5b8d('0x26')]();});}};}function handleEntityNotFound(_0x556b9b,_0x455b54){return function(_0x57870f){if(!_0x57870f){_0x556b9b[_0x5b8d('0x19')](0x194);}return _0x57870f;};}function handleError(_0x140206,_0x578254){_0x578254=_0x578254||0x1f4;return function(_0x2c3d61){logger[_0x5b8d('0x27')](_0x2c3d61['stack']);if(_0x2c3d61[_0x5b8d('0x28')]){delete _0x2c3d61[_0x5b8d('0x28')];}_0x140206['status'](_0x578254)['send'](_0x2c3d61);};}exports[_0x5b8d('0x29')]=function(_0xc12e56,_0x3db4c9){var _0x11ba31={},_0x1960da={},_0x2d4fda={'count':0x0,'rows':[]};return db[_0x5b8d('0x2a')][_0x5b8d('0x2b')]()[_0x5b8d('0x22')](function(_0xf3516c){_0x1960da['model']=_[_0x5b8d('0x2c')](_0xf3516c);_0x1960da[_0x5b8d('0x2d')]=_[_0x5b8d('0x2c')](_0xc12e56[_0x5b8d('0x2d')]);_0x1960da[_0x5b8d('0x2e')]=_[_0x5b8d('0x2f')](_0x1960da['model'],_0x1960da[_0x5b8d('0x2d')]);_0x11ba31['attributes']=_[_0x5b8d('0x2f')](_0x1960da['model'],qs[_0x5b8d('0x30')](_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x30')]));_0x11ba31[_0x5b8d('0x31')]=_0x11ba31['attributes'][_0x5b8d('0x32')]?_0x11ba31[_0x5b8d('0x31')]:_0x1960da[_0x5b8d('0x33')];if(!_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x34')](_0x5b8d('0x35'))){_0x11ba31['limit']=qs['limit'](_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x1e')]);_0x11ba31[_0x5b8d('0x1c')]=qs['offset'](_0xc12e56[_0x5b8d('0x2d')]['offset']);}_0x11ba31[_0x5b8d('0x36')]=qs['sort'](_0xc12e56['query']['sort']);_0x11ba31['where']=qs['filters'](_[_0x5b8d('0x37')](_0xc12e56[_0x5b8d('0x2d')],_0x1960da['filters']),_0xf3516c);if(_0xc12e56['query'][_0x5b8d('0x38')]){_0x11ba31[_0x5b8d('0x39')]=_[_0x5b8d('0x3a')](_0x11ba31[_0x5b8d('0x39')],{'$or':_[_0x5b8d('0x3b')](_0x11ba31[_0x5b8d('0x31')],function(_0x2ebe97){var _0x1a6751={};_0x1a6751[_0x2ebe97]={'$like':'%'+_0xc12e56[_0x5b8d('0x2d')]['filter']+'%'};return _0x1a6751;})});}_0x11ba31=_[_0x5b8d('0x3a')]({},_0x11ba31,_0xc12e56[_0x5b8d('0x3c')]);var _0x536ced={'where':_0x11ba31[_0x5b8d('0x39')]};return db[_0x5b8d('0x2a')][_0x5b8d('0x1f')](_0x536ced)['then'](function(_0xd23313){_0x2d4fda[_0x5b8d('0x1f')]=_0xd23313;if(_0xc12e56[_0x5b8d('0x2d')][_0x5b8d('0x3d')]){_0x11ba31[_0x5b8d('0x3e')]=[{'all':!![]}];}return db[_0x5b8d('0x2a')][_0x5b8d('0x3f')](_0x11ba31);})['then'](function(_0x4593c3){_0x2d4fda[_0x5b8d('0x40')]=_0x4593c3;return _0x2d4fda;})[_0x5b8d('0x22')](respondWithFilteredResult(_0x3db4c9,_0x11ba31))['catch'](handleError(_0x3db4c9,null));})[_0x5b8d('0x41')](handleError(_0x3db4c9,null));};exports[_0x5b8d('0x42')]=function(_0x4a5cb4,_0x16972a){var _0x40ba7c={'raw':![],'where':{'id':_0x4a5cb4[_0x5b8d('0x43')]['id']}},_0x5b2895={};_0x5b2895['model']=_[_0x5b8d('0x2c')](db[_0x5b8d('0x2a')]['rawAttributes']);_0x5b2895[_0x5b8d('0x2d')]=_['keys'](_0x4a5cb4[_0x5b8d('0x2d')]);_0x5b2895[_0x5b8d('0x2e')]=_[_0x5b8d('0x2f')](_0x5b2895[_0x5b8d('0x33')],_0x5b2895[_0x5b8d('0x2d')]);_0x40ba7c[_0x5b8d('0x31')]=_['intersection'](_0x5b2895['model'],qs[_0x5b8d('0x30')](_0x4a5cb4['query']['fields']));_0x40ba7c['attributes']=_0x40ba7c[_0x5b8d('0x31')][_0x5b8d('0x32')]?_0x40ba7c['attributes']:_0x5b2895['model'];if(_0x4a5cb4[_0x5b8d('0x2d')][_0x5b8d('0x3d')]){_0x40ba7c[_0x5b8d('0x3e')]=[{'all':!![]}];}_0x40ba7c=_[_0x5b8d('0x3a')]({},_0x40ba7c,_0x4a5cb4['options']);return db[_0x5b8d('0x2a')][_0x5b8d('0x44')](_0x40ba7c)[_0x5b8d('0x22')](handleEntityNotFound(_0x16972a,null))['then'](respondWithResult(_0x16972a,null))[_0x5b8d('0x41')](handleError(_0x16972a,null));};exports[_0x5b8d('0x45')]=function(_0x544b56,_0x1a29fa){return db['CmCompany']['create'](_0x544b56['body'],{})[_0x5b8d('0x22')](function(_0x580c32){var _0x4ce837=_0x544b56[_0x5b8d('0x46')][_0x5b8d('0x23')]({'plain':!![]});if(!_0x4ce837)throw new Error(_0x5b8d('0x47'));if(_0x4ce837[_0x5b8d('0x48')]===_0x5b8d('0x46')){var _0x1c8d6a=_0x580c32[_0x5b8d('0x23')]({'plain':!![]});var _0x474924=_0x5b8d('0x49');return db[_0x5b8d('0x4a')][_0x5b8d('0x44')]({'where':{'name':_0x474924,'userProfileId':_0x4ce837[_0x5b8d('0x4b')]},'raw':!![]})['then'](function(_0x1a5147){if(_0x1a5147&&_0x1a5147[_0x5b8d('0x4c')]===0x0){return db[_0x5b8d('0x24')]['create']({'name':_0x1c8d6a[_0x5b8d('0x28')],'resourceId':_0x1c8d6a['id'],'type':_0x1a5147[_0x5b8d('0x28')],'sectionId':_0x1a5147['id']},{})['then'](function(){return _0x580c32;});}else{return _0x580c32;}})['catch'](function(_0x1ac492){logger[_0x5b8d('0x27')](_0x5b8d('0x4d'),_0x1ac492);throw _0x1ac492;});}return _0x580c32;})[_0x5b8d('0x22')](respondWithResult(_0x1a29fa,0xc9))[_0x5b8d('0x41')](handleError(_0x1a29fa,null));};exports['update']=function(_0x25e632,_0x572b25){if(_0x25e632[_0x5b8d('0x4e')]['id']){delete _0x25e632[_0x5b8d('0x4e')]['id'];}return db[_0x5b8d('0x2a')]['find']({'where':{'id':_0x25e632[_0x5b8d('0x43')]['id']}})[_0x5b8d('0x22')](handleEntityNotFound(_0x572b25,null))['then'](saveUpdates(_0x25e632['body'],null))[_0x5b8d('0x22')](respondWithResult(_0x572b25,null))[_0x5b8d('0x41')](handleError(_0x572b25,null));};exports['destroy']=function(_0x8e8855,_0x14276b){return db[_0x5b8d('0x2a')]['find']({'where':{'id':_0x8e8855[_0x5b8d('0x43')]['id']}})['then'](handleEntityNotFound(_0x14276b,null))[_0x5b8d('0x22')](removeEntity(_0x14276b,null))[_0x5b8d('0x41')](handleError(_0x14276b,null));};exports['describe']=function(_0x1c0e3a,_0x331b68){return db[_0x5b8d('0x2a')][_0x5b8d('0x2b')]()[_0x5b8d('0x22')](respondWithResult(_0x331b68,null))[_0x5b8d('0x41')](handleError(_0x331b68,null));};exports['addContacts']=function(_0x17132d,_0x1d4a8d,_0x34d4fd){return db['CmContact']['find']({'where':{'id':_0x17132d[_0x5b8d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d4a8d,null))[_0x5b8d('0x22')](function(_0x5b36e9){if(_0x5b36e9){return _0x5b36e9[_0x5b8d('0x4f')](_0x17132d[_0x5b8d('0x4e')][_0x5b8d('0x50')],_[_0x5b8d('0x51')](_0x17132d[_0x5b8d('0x4e')],[_0x5b8d('0x50'),'id'])||{});}})[_0x5b8d('0x22')](respondWithResult(_0x1d4a8d,null))['catch'](handleError(_0x1d4a8d,null));};exports[_0x5b8d('0x52')]=function(_0xdbaaff,_0xb3df0,_0x38c5e8){var _0x192d95={};var _0x5b27f1={};var _0x59dcca;var _0x2a51d9;return db[_0x5b8d('0x2a')][_0x5b8d('0x53')]({'where':{'id':_0xdbaaff['params']['id']}})[_0x5b8d('0x22')](handleEntityNotFound(_0xb3df0,null))[_0x5b8d('0x22')](function(_0x5cd3c2){if(_0x5cd3c2){_0x59dcca=_0x5cd3c2;_0x5b27f1[_0x5b8d('0x33')]=_[_0x5b8d('0x2c')](db[_0x5b8d('0x54')][_0x5b8d('0x55')]);_0x5b27f1[_0x5b8d('0x2d')]=_[_0x5b8d('0x2c')](_0xdbaaff[_0x5b8d('0x2d')]);_0x5b27f1['filters']=_[_0x5b8d('0x2f')](_0x5b27f1[_0x5b8d('0x33')],_0x5b27f1[_0x5b8d('0x2d')]);_0x192d95['attributes']=_[_0x5b8d('0x2f')](_0x5b27f1[_0x5b8d('0x33')],qs[_0x5b8d('0x30')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x30')]));_0x192d95[_0x5b8d('0x31')]=_0x192d95[_0x5b8d('0x31')]['length']?_0x192d95[_0x5b8d('0x31')]:_0x5b27f1[_0x5b8d('0x33')];_0x192d95[_0x5b8d('0x36')]=qs[_0x5b8d('0x56')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x56')]);_0x192d95[_0x5b8d('0x39')]=qs[_0x5b8d('0x2e')](_[_0x5b8d('0x37')](_0xdbaaff[_0x5b8d('0x2d')],_0x5b27f1[_0x5b8d('0x2e')]));if(_0xdbaaff[_0x5b8d('0x2d')]['filter']){_0x192d95[_0x5b8d('0x39')]=_[_0x5b8d('0x3a')](_0x192d95[_0x5b8d('0x39')],{'$or':_[_0x5b8d('0x3b')](_0x192d95[_0x5b8d('0x31')],function(_0x19e58d){var _0x490f17={};_0x490f17[_0x19e58d]={'$like':'%'+_0xdbaaff['query'][_0x5b8d('0x38')]+'%'};return _0x490f17;})});}_0x192d95=_[_0x5b8d('0x3a')]({},_0x192d95,_0xdbaaff['options']);return _0x59dcca[_0x5b8d('0x52')](_0x192d95);}})['then'](function(_0x532ba0){if(_0x532ba0){_0x2a51d9=_0x532ba0['length'];if(!_0xdbaaff[_0x5b8d('0x2d')]['hasOwnProperty'](_0x5b8d('0x35'))){_0x192d95[_0x5b8d('0x1e')]=qs[_0x5b8d('0x1e')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x1e')]);_0x192d95[_0x5b8d('0x1c')]=qs[_0x5b8d('0x1c')](_0xdbaaff[_0x5b8d('0x2d')][_0x5b8d('0x1c')]);}return _0x59dcca[_0x5b8d('0x52')](_0x192d95);}})[_0x5b8d('0x22')](function(_0x5488e2){if(_0x5488e2){return _0x5488e2?{'count':_0x2a51d9,'rows':_0x5488e2}:null;}})['then'](respondWithResult(_0xb3df0,null))['catch'](handleError(_0xb3df0,null));};
\ No newline at end of file
+var _0x9397=['../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','destroy','then','get','Companies','UserProfileResource','sendStatus','error','stack','name','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','map','options','where','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x42b45b,_0x217c8a){var _0x13b752=function(_0xd550a5){while(--_0xd550a5){_0x42b45b['push'](_0x42b45b['shift']());}};_0x13b752(++_0x217c8a);}(_0x9397,0x99));var _0x7939=function(_0x26b367,_0x158299){_0x26b367=_0x26b367-0x0;var _0x5a7c9f=_0x9397[_0x26b367];return _0x5a7c9f;};'use strict';var emlformat=require(_0x7939('0x0'));var rimraf=require(_0x7939('0x1'));var zipdir=require(_0x7939('0x2'));var jsonpatch=require(_0x7939('0x3'));var rp=require(_0x7939('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7939('0x5'));var path=require('path');var sox=require(_0x7939('0x6'));var csv=require('to-csv');var ejs=require(_0x7939('0x7'));var fs=require('fs');var fs_extra=require(_0x7939('0x8'));var _=require(_0x7939('0x9'));var squel=require(_0x7939('0xa'));var crypto=require(_0x7939('0xb'));var jsforce=require(_0x7939('0xc'));var deskjs=require(_0x7939('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7939('0xe'));var Papa=require(_0x7939('0xf'));var Redis=require(_0x7939('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7939('0x11'));var hardwareService=require(_0x7939('0x12'));var logger=require(_0x7939('0x13'))(_0x7939('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7939('0x15'));var db=require(_0x7939('0x16'))['db'];function respondWithStatusCode(_0x37a40c,_0x170d11){_0x170d11=_0x170d11||0xcc;return function(_0x15f6f9){if(_0x15f6f9){return _0x37a40c['sendStatus'](_0x170d11);}return _0x37a40c['status'](_0x170d11)[_0x7939('0x17')]();};}function respondWithResult(_0x10e41f,_0x4ecfb4){_0x4ecfb4=_0x4ecfb4||0xc8;return function(_0x516947){if(_0x516947){return _0x10e41f[_0x7939('0x18')](_0x4ecfb4)['json'](_0x516947);}};}function respondWithFilteredResult(_0x266271,_0x355b6f){return function(_0x26a815){if(_0x26a815){var _0x3ce616=typeof _0x355b6f['offset']===_0x7939('0x19')&&typeof _0x355b6f[_0x7939('0x1a')]==='undefined';var _0x56c0a8=_0x26a815[_0x7939('0x1b')];var _0x4812fd=_0x3ce616?0x0:_0x355b6f[_0x7939('0x1c')];var _0x32a61c=_0x3ce616?_0x26a815[_0x7939('0x1b')]:_0x355b6f['offset']+_0x355b6f['limit'];var _0x7f876b;if(_0x32a61c>=_0x56c0a8){_0x32a61c=_0x56c0a8;_0x7f876b=0xc8;}else{_0x7f876b=0xce;}_0x266271[_0x7939('0x18')](_0x7f876b);return _0x266271['set'](_0x7939('0x1d'),_0x4812fd+'-'+_0x32a61c+'/'+_0x56c0a8)[_0x7939('0x1e')](_0x26a815);}return null;};}function patchUpdates(_0x597ca6){return function(_0x85ac5b){try{jsonpatch[_0x7939('0x1f')](_0x85ac5b,_0x597ca6,!![]);}catch(_0x9dce2c){return BPromise[_0x7939('0x20')](_0x9dce2c);}return _0x85ac5b[_0x7939('0x21')]();};}function saveUpdates(_0x1b3613,_0x244a64){return function(_0x26c3d9){if(_0x26c3d9){return _0x26c3d9['update'](_0x1b3613)['then'](function(_0x214739){return _0x214739;});}return null;};}function removeEntity(_0x46be45,_0x255e1d){return function(_0x275d32){if(_0x275d32){return _0x275d32[_0x7939('0x22')]()[_0x7939('0x23')](function(){var _0xd1687a=_0x275d32[_0x7939('0x24')]({'plain':!![]});var _0x277579=_0x7939('0x25');return db[_0x7939('0x26')]['destroy']({'where':{'type':_0x277579,'resourceId':_0xd1687a['id']}})['then'](function(){return _0x275d32;});})[_0x7939('0x23')](function(){_0x46be45['status'](0xcc)[_0x7939('0x17')]();});}};}function handleEntityNotFound(_0x22839a,_0x486a97){return function(_0x4c77ae){if(!_0x4c77ae){_0x22839a[_0x7939('0x27')](0x194);}return _0x4c77ae;};}function handleError(_0x358d05,_0x313dcb){_0x313dcb=_0x313dcb||0x1f4;return function(_0x1f581d){logger[_0x7939('0x28')](_0x1f581d[_0x7939('0x29')]);if(_0x1f581d[_0x7939('0x2a')]){delete _0x1f581d['name'];}_0x358d05[_0x7939('0x18')](_0x313dcb)['send'](_0x1f581d);};}exports['index']=function(_0x22bfef,_0x2f359e){var _0xdec873={},_0x2d73fb={},_0x3cfdc0={'count':0x0,'rows':[]};return db[_0x7939('0x2b')][_0x7939('0x2c')]()[_0x7939('0x23')](function(_0x51df1a){_0x2d73fb[_0x7939('0x2d')]=_[_0x7939('0x2e')](_0x51df1a);_0x2d73fb[_0x7939('0x2f')]=_['keys'](_0x22bfef['query']);_0x2d73fb['filters']=_[_0x7939('0x30')](_0x2d73fb[_0x7939('0x2d')],_0x2d73fb[_0x7939('0x2f')]);_0xdec873[_0x7939('0x31')]=_[_0x7939('0x30')](_0x2d73fb[_0x7939('0x2d')],qs[_0x7939('0x32')](_0x22bfef['query'][_0x7939('0x32')]));_0xdec873['attributes']=_0xdec873[_0x7939('0x31')][_0x7939('0x33')]?_0xdec873[_0x7939('0x31')]:_0x2d73fb['model'];if(!_0x22bfef[_0x7939('0x2f')][_0x7939('0x34')](_0x7939('0x35'))){_0xdec873[_0x7939('0x1a')]=qs[_0x7939('0x1a')](_0x22bfef[_0x7939('0x2f')][_0x7939('0x1a')]);_0xdec873[_0x7939('0x1c')]=qs[_0x7939('0x1c')](_0x22bfef['query'][_0x7939('0x1c')]);}_0xdec873[_0x7939('0x36')]=qs[_0x7939('0x37')](_0x22bfef[_0x7939('0x2f')]['sort']);_0xdec873['where']=qs[_0x7939('0x38')](_[_0x7939('0x39')](_0x22bfef[_0x7939('0x2f')],_0x2d73fb[_0x7939('0x38')]),_0x51df1a);if(_0x22bfef[_0x7939('0x2f')][_0x7939('0x3a')]){_0xdec873['where']=_[_0x7939('0x3b')](_0xdec873['where'],{'$or':_[_0x7939('0x3c')](_0xdec873[_0x7939('0x31')],function(_0x3b6686){var _0xfd6110={};_0xfd6110[_0x3b6686]={'$like':'%'+_0x22bfef[_0x7939('0x2f')]['filter']+'%'};return _0xfd6110;})});}_0xdec873=_[_0x7939('0x3b')]({},_0xdec873,_0x22bfef[_0x7939('0x3d')]);var _0x198756={'where':_0xdec873[_0x7939('0x3e')]};return db['CmCompany'][_0x7939('0x1b')](_0x198756)[_0x7939('0x23')](function(_0x21b90b){_0x3cfdc0['count']=_0x21b90b;if(_0x22bfef[_0x7939('0x2f')][_0x7939('0x3f')]){_0xdec873['include']=[{'all':!![]}];}return db[_0x7939('0x2b')][_0x7939('0x40')](_0xdec873);})[_0x7939('0x23')](function(_0x250338){_0x3cfdc0[_0x7939('0x41')]=_0x250338;return _0x3cfdc0;})[_0x7939('0x23')](respondWithFilteredResult(_0x2f359e,_0xdec873))[_0x7939('0x42')](handleError(_0x2f359e,null));})[_0x7939('0x42')](handleError(_0x2f359e,null));};exports[_0x7939('0x43')]=function(_0x40e523,_0x3a18dd){var _0xdf7d4={'raw':![],'where':{'id':_0x40e523['params']['id']}},_0x242619={};_0x242619[_0x7939('0x2d')]=_[_0x7939('0x2e')](db[_0x7939('0x2b')][_0x7939('0x44')]);_0x242619[_0x7939('0x2f')]=_[_0x7939('0x2e')](_0x40e523[_0x7939('0x2f')]);_0x242619[_0x7939('0x38')]=_[_0x7939('0x30')](_0x242619[_0x7939('0x2d')],_0x242619['query']);_0xdf7d4[_0x7939('0x31')]=_[_0x7939('0x30')](_0x242619['model'],qs[_0x7939('0x32')](_0x40e523['query'][_0x7939('0x32')]));_0xdf7d4[_0x7939('0x31')]=_0xdf7d4[_0x7939('0x31')][_0x7939('0x33')]?_0xdf7d4[_0x7939('0x31')]:_0x242619[_0x7939('0x2d')];if(_0x40e523[_0x7939('0x2f')]['includeAll']){_0xdf7d4[_0x7939('0x45')]=[{'all':!![]}];}_0xdf7d4=_[_0x7939('0x3b')]({},_0xdf7d4,_0x40e523['options']);return db[_0x7939('0x2b')][_0x7939('0x46')](_0xdf7d4)[_0x7939('0x23')](handleEntityNotFound(_0x3a18dd,null))[_0x7939('0x23')](respondWithResult(_0x3a18dd,null))[_0x7939('0x42')](handleError(_0x3a18dd,null));};exports[_0x7939('0x47')]=function(_0x2a18ba,_0x2ad43f){return db[_0x7939('0x2b')][_0x7939('0x47')](_0x2a18ba[_0x7939('0x48')],{})[_0x7939('0x23')](function(_0x3ae0d0){var _0x186825=_0x2a18ba[_0x7939('0x49')][_0x7939('0x24')]({'plain':!![]});if(!_0x186825)throw new Error(_0x7939('0x4a'));if(_0x186825[_0x7939('0x4b')]===_0x7939('0x49')){var _0x7d037e=_0x3ae0d0['get']({'plain':!![]});var _0x14f06a='Companies';return db[_0x7939('0x4c')][_0x7939('0x46')]({'where':{'name':_0x14f06a,'userProfileId':_0x186825[_0x7939('0x4d')]},'raw':!![]})[_0x7939('0x23')](function(_0x288c4c){if(_0x288c4c&&_0x288c4c[_0x7939('0x4e')]===0x0){return db['UserProfileResource'][_0x7939('0x47')]({'name':_0x7d037e[_0x7939('0x2a')],'resourceId':_0x7d037e['id'],'type':_0x288c4c[_0x7939('0x2a')],'sectionId':_0x288c4c['id']},{})[_0x7939('0x23')](function(){return _0x3ae0d0;});}else{return _0x3ae0d0;}})[_0x7939('0x42')](function(_0x3d1430){logger[_0x7939('0x28')](_0x7939('0x4f'),_0x3d1430);throw _0x3d1430;});}return _0x3ae0d0;})[_0x7939('0x23')](respondWithResult(_0x2ad43f,0xc9))[_0x7939('0x42')](handleError(_0x2ad43f,null));};exports['update']=function(_0x4c62f3,_0x4a0121){if(_0x4c62f3[_0x7939('0x48')]['id']){delete _0x4c62f3[_0x7939('0x48')]['id'];}return db[_0x7939('0x2b')][_0x7939('0x46')]({'where':{'id':_0x4c62f3[_0x7939('0x50')]['id']}})['then'](handleEntityNotFound(_0x4a0121,null))[_0x7939('0x23')](saveUpdates(_0x4c62f3['body'],null))['then'](respondWithResult(_0x4a0121,null))[_0x7939('0x42')](handleError(_0x4a0121,null));};exports['destroy']=function(_0x28d784,_0x227515){return db[_0x7939('0x2b')][_0x7939('0x46')]({'where':{'id':_0x28d784[_0x7939('0x50')]['id']}})[_0x7939('0x23')](handleEntityNotFound(_0x227515,null))[_0x7939('0x23')](removeEntity(_0x227515,null))[_0x7939('0x42')](handleError(_0x227515,null));};exports['describe']=function(_0x40404b,_0x48814d){return db[_0x7939('0x2b')][_0x7939('0x2c')]()[_0x7939('0x23')](respondWithResult(_0x48814d,null))[_0x7939('0x42')](handleError(_0x48814d,null));};exports[_0x7939('0x51')]=function(_0x200e62,_0x123137,_0x5f08cb){return db[_0x7939('0x52')]['find']({'where':{'id':_0x200e62[_0x7939('0x50')]['id']}})[_0x7939('0x23')](handleEntityNotFound(_0x123137,null))['then'](function(_0x4090c0){if(_0x4090c0){return _0x4090c0[_0x7939('0x51')](_0x200e62[_0x7939('0x48')][_0x7939('0x53')],_[_0x7939('0x54')](_0x200e62[_0x7939('0x48')],[_0x7939('0x53'),'id'])||{});}})[_0x7939('0x23')](respondWithResult(_0x123137,null))[_0x7939('0x42')](handleError(_0x123137,null));};exports[_0x7939('0x55')]=function(_0x4c9730,_0x577dd9,_0x1116ea){var _0x31524b={};var _0x1d0d19={};var _0x31ab7d;var _0x111cd9;return db[_0x7939('0x2b')][_0x7939('0x56')]({'where':{'id':_0x4c9730[_0x7939('0x50')]['id']}})[_0x7939('0x23')](handleEntityNotFound(_0x577dd9,null))[_0x7939('0x23')](function(_0x3042f1){if(_0x3042f1){_0x31ab7d=_0x3042f1;_0x1d0d19[_0x7939('0x2d')]=_[_0x7939('0x2e')](db[_0x7939('0x52')][_0x7939('0x44')]);_0x1d0d19[_0x7939('0x2f')]=_[_0x7939('0x2e')](_0x4c9730['query']);_0x1d0d19[_0x7939('0x38')]=_[_0x7939('0x30')](_0x1d0d19['model'],_0x1d0d19['query']);_0x31524b[_0x7939('0x31')]=_[_0x7939('0x30')](_0x1d0d19[_0x7939('0x2d')],qs[_0x7939('0x32')](_0x4c9730[_0x7939('0x2f')]['fields']));_0x31524b['attributes']=_0x31524b[_0x7939('0x31')][_0x7939('0x33')]?_0x31524b['attributes']:_0x1d0d19['model'];_0x31524b[_0x7939('0x36')]=qs[_0x7939('0x37')](_0x4c9730[_0x7939('0x2f')][_0x7939('0x37')]);_0x31524b[_0x7939('0x3e')]=qs[_0x7939('0x38')](_[_0x7939('0x39')](_0x4c9730[_0x7939('0x2f')],_0x1d0d19[_0x7939('0x38')]));if(_0x4c9730[_0x7939('0x2f')][_0x7939('0x3a')]){_0x31524b[_0x7939('0x3e')]=_['merge'](_0x31524b[_0x7939('0x3e')],{'$or':_['map'](_0x31524b[_0x7939('0x31')],function(_0x1b09fd){var _0x19670c={};_0x19670c[_0x1b09fd]={'$like':'%'+_0x4c9730[_0x7939('0x2f')]['filter']+'%'};return _0x19670c;})});}_0x31524b=_['merge']({},_0x31524b,_0x4c9730[_0x7939('0x3d')]);return _0x31ab7d['getContacts'](_0x31524b);}})['then'](function(_0x143513){if(_0x143513){_0x111cd9=_0x143513[_0x7939('0x33')];if(!_0x4c9730[_0x7939('0x2f')]['hasOwnProperty'](_0x7939('0x35'))){_0x31524b['limit']=qs[_0x7939('0x1a')](_0x4c9730[_0x7939('0x2f')][_0x7939('0x1a')]);_0x31524b[_0x7939('0x1c')]=qs[_0x7939('0x1c')](_0x4c9730[_0x7939('0x2f')][_0x7939('0x1c')]);}return _0x31ab7d[_0x7939('0x55')](_0x31524b);}})['then'](function(_0x1eba29){if(_0x1eba29){return _0x1eba29?{'count':_0x111cd9,'rows':_0x1eba29}:null;}})[_0x7939('0x23')](respondWithResult(_0x577dd9,null))[_0x7939('0x42')](handleError(_0x577dd9,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 407e4a4..e4d0b2e 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 _0x4c57=['api','bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x2ca865,_0x93e8bf){var _0x31510d=function(_0x182b9b){while(--_0x182b9b){_0x2ca865['push'](_0x2ca865['shift']());}};_0x31510d(++_0x93e8bf);}(_0x4c57,0x81));var _0x74c5=function(_0x5b942d,_0x1cc659){_0x5b942d=_0x5b942d-0x0;var _0x2e3f86=_0x4c57[_0x5b942d];return _0x2e3f86;};'use strict';var _=require(_0x74c5('0x0'));var util=require(_0x74c5('0x1'));var logger=require(_0x74c5('0x2'))(_0x74c5('0x3'));var moment=require('moment');var BPromise=require(_0x74c5('0x4'));var rp=require(_0x74c5('0x5'));var fs=require('fs');var path=require(_0x74c5('0x6'));var rimraf=require('rimraf');var config=require(_0x74c5('0x7'));var attributes=require('./cmCompany.attributes');module[_0x74c5('0x8')]=function(_0x4b8d2b,_0x4c512a){return _0x4b8d2b[_0x74c5('0x9')](_0x74c5('0xa'),attributes,{'tableName':_0x74c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebfa=['rimraf','../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','moment','bluebird','request-promise'];(function(_0x163d8f,_0x168394){var _0x3f3c38=function(_0x17318e){while(--_0x17318e){_0x163d8f['push'](_0x163d8f['shift']());}};_0x3f3c38(++_0x168394);}(_0xebfa,0xdd));var _0xaebf=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xebfa[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaebf('0x0'));var BPromise=require(_0xaebf('0x1'));var rp=require(_0xaebf('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaebf('0x3'));var config=require(_0xaebf('0x4'));var attributes=require(_0xaebf('0x5'));module['exports']=function(_0xe6f54e,_0x2f4286){return _0xe6f54e['define'](_0xaebf('0x6'),attributes,{'tableName':_0xaebf('0x7'),'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 34c7439..4a4b704 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 _0x1666=['http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x2aba0f,_0x29a10c){var _0x26e2ac=function(_0x278db7){while(--_0x278db7){_0x2aba0f['push'](_0x2aba0f['shift']());}};_0x26e2ac(++_0x29a10c);}(_0x1666,0x107));var _0x6166=function(_0x2197f7,_0x2a2d89){_0x2197f7=_0x2197f7-0x0;var _0x522991=_0x1666[_0x2197f7];return _0x522991;};'use strict';var _=require(_0x6166('0x0'));var util=require(_0x6166('0x1'));var moment=require(_0x6166('0x2'));var BPromise=require(_0x6166('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6166('0x4'));var db=require(_0x6166('0x5'))['db'];var utils=require(_0x6166('0x6'));var logger=require(_0x6166('0x7'))(_0x6166('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6166('0x9')][_0x6166('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf84b7,_0x3f84c0,_0x23b00c){return new BPromise(function(_0x544e39,_0x1eee6f){return client[_0x6166('0xb')](_0xf84b7,_0x23b00c)[_0x6166('0xc')](function(_0x5bab4b){logger[_0x6166('0xd')](_0x6166('0xe'),_0x3f84c0,_0x6166('0xf'));logger['debug'](_0x6166('0x10'),_0x3f84c0,_0x6166('0xf'),JSON['stringify'](_0x5bab4b));if(_0x5bab4b[_0x6166('0x11')]){if(_0x5bab4b[_0x6166('0x11')]['code']===0x1f4){logger[_0x6166('0x11')]('CmCompany,\x20%s,\x20%s',_0x3f84c0,_0x5bab4b['error'][_0x6166('0x12')]);return _0x1eee6f(_0x5bab4b['error'][_0x6166('0x12')]);}logger[_0x6166('0x11')](_0x6166('0xe'),_0x3f84c0,_0x5bab4b['error'][_0x6166('0x12')]);return _0x544e39(_0x5bab4b['error'][_0x6166('0x12')]);}else{logger[_0x6166('0xd')]('CmCompany,\x20%s,\x20%s',_0x3f84c0,'request\x20sent');_0x544e39(_0x5bab4b[_0x6166('0x13')][_0x6166('0x12')]);}})[_0x6166('0x14')](function(_0x4a26b9){logger['error'](_0x6166('0xe'),_0x3f84c0,_0x4a26b9);_0x1eee6f(_0x4a26b9);});});}
\ No newline at end of file
+var _0x29d1=['moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0x29d1,0x12f));var _0x129d=function(_0x9dc8be,_0x1bab69){_0x9dc8be=_0x9dc8be-0x0;var _0x115701=_0x29d1[_0x9dc8be];return _0x115701;};'use strict';var _=require(_0x129d('0x0'));var util=require('util');var moment=require(_0x129d('0x1'));var BPromise=require(_0x129d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x129d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x129d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x129d('0x5'));var jayson=require(_0x129d('0x6'));var client=jayson[_0x129d('0x7')][_0x129d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c51e5,_0x180663,_0x291770){return new BPromise(function(_0x5c8a6e,_0x4df997){return client[_0x129d('0x9')](_0x3c51e5,_0x291770)['then'](function(_0x2b5abb){logger[_0x129d('0xa')](_0x129d('0xb'),_0x180663,_0x129d('0xc'));logger[_0x129d('0xd')](_0x129d('0xe'),_0x180663,_0x129d('0xc'),JSON['stringify'](_0x2b5abb));if(_0x2b5abb[_0x129d('0xf')]){if(_0x2b5abb['error'][_0x129d('0x10')]===0x1f4){logger[_0x129d('0xf')]('CmCompany,\x20%s,\x20%s',_0x180663,_0x2b5abb['error']['message']);return _0x4df997(_0x2b5abb[_0x129d('0xf')][_0x129d('0x11')]);}logger[_0x129d('0xf')](_0x129d('0xb'),_0x180663,_0x2b5abb[_0x129d('0xf')]['message']);return _0x5c8a6e(_0x2b5abb[_0x129d('0xf')][_0x129d('0x11')]);}else{logger[_0x129d('0xa')](_0x129d('0xb'),_0x180663,_0x129d('0xc'));_0x5c8a6e(_0x2b5abb['result'][_0x129d('0x11')]);}})[_0x129d('0x12')](function(_0x4afde4){logger[_0x129d('0xf')]('CmCompany,\x20%s,\x20%s',_0x180663,_0x4afde4);_0x4df997(_0x4afde4);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4d29e3d..8d987cc 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 _0x1635=['../../config/environment','get','index','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x20c19f,_0xe79d0e){var _0x4e6151=function(_0x5744a9){while(--_0x5744a9){_0x20c19f['push'](_0x20c19f['shift']());}};_0x4e6151(++_0xe79d0e);}(_0x1635,0xea));var _0x5163=function(_0x2dd69d,_0x34fb32){_0x2dd69d=_0x2dd69d-0x0;var _0x31149b=_0x1635[_0x2dd69d];return _0x31149b;};'use strict';var multer=require(_0x5163('0x0'));var util=require(_0x5163('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5163('0x2'));var router=express[_0x5163('0x3')]();var fs_extra=require(_0x5163('0x4'));var auth=require(_0x5163('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5163('0x6'));var controller=require('./cmCompany.controller');router[_0x5163('0x7')]('/',auth['isAuthenticated'](),controller[_0x5163('0x8')]);router[_0x5163('0x7')]('/describe',auth[_0x5163('0x9')](),controller[_0x5163('0xa')]);router[_0x5163('0x7')](_0x5163('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x5163('0xc'),auth[_0x5163('0x9')](),controller[_0x5163('0xd')]);router[_0x5163('0xe')]('/',auth[_0x5163('0x9')](),controller[_0x5163('0xf')]);router[_0x5163('0xe')](_0x5163('0xc'),auth['isAuthenticated'](),controller['addContacts']);router[_0x5163('0x10')](_0x5163('0xb'),auth[_0x5163('0x9')](),controller['update']);router[_0x5163('0x11')](_0x5163('0xb'),auth[_0x5163('0x9')](),controller[_0x5163('0x12')]);module[_0x5163('0x13')]=router;
\ No newline at end of file
+var _0xa6f4=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x44f37d,_0x1dc5f5){var _0x36de2f=function(_0x5a899d){while(--_0x5a899d){_0x44f37d['push'](_0x44f37d['shift']());}};_0x36de2f(++_0x1dc5f5);}(_0xa6f4,0x1f2));var _0x4a6f=function(_0x4288fd,_0x147149){_0x4288fd=_0x4288fd-0x0;var _0x5502f0=_0xa6f4[_0x4288fd];return _0x5502f0;};'use strict';var multer=require(_0x4a6f('0x0'));var util=require(_0x4a6f('0x1'));var path=require(_0x4a6f('0x2'));var timeout=require(_0x4a6f('0x3'));var express=require(_0x4a6f('0x4'));var router=express[_0x4a6f('0x5')]();var fs_extra=require(_0x4a6f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4a6f('0x7'));var config=require(_0x4a6f('0x8'));var controller=require('./cmCompany.controller');router[_0x4a6f('0x9')]('/',auth[_0x4a6f('0xa')](),controller['index']);router['get']('/describe',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0xb')]);router[_0x4a6f('0x9')](_0x4a6f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4a6f('0x9')](_0x4a6f('0xd'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0xe')]);router[_0x4a6f('0xf')]('/',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x10')]);router[_0x4a6f('0xf')]('/:id/contacts',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x11')]);router[_0x4a6f('0x12')](_0x4a6f('0xc'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x13')]);router[_0x4a6f('0x14')](_0x4a6f('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index e54023d..7e2b7a9 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 _0xf306=['INTEGER','lodash','sequelize','exports','STRING','TEXT'];(function(_0x477daf,_0x324543){var _0x26dd75=function(_0x3502ae){while(--_0x3502ae){_0x477daf['push'](_0x477daf['shift']());}};_0x26dd75(++_0x324543);}(_0xf306,0x145));var _0x6f30=function(_0x1760e9,_0xbbfd0b){_0x1760e9=_0x1760e9-0x0;var _0x3fe586=_0xf306[_0x1760e9];return _0x3fe586;};'use strict';var _=require(_0x6f30('0x0'));var Sequelize=require(_0x6f30('0x1'));module[_0x6f30('0x2')]={'firstName':{'type':Sequelize[_0x6f30('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6f30('0x3')]},'street':{'type':Sequelize[_0x6f30('0x3')]},'postalCode':{'type':Sequelize[_0x6f30('0x3')]},'city':{'type':Sequelize[_0x6f30('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x6f30('0x3')]},'description':{'type':Sequelize[_0x6f30('0x4')]},'phone':{'type':Sequelize[_0x6f30('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6f30('0x3')]},'email':{'type':Sequelize[_0x6f30('0x3')]},'url':{'type':Sequelize[_0x6f30('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x6f30('0x3')]},'twitter':{'type':Sequelize[_0x6f30('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x6f30('0x3')]},'viber':{'type':Sequelize[_0x6f30('0x3')]},'line':{'type':Sequelize[_0x6f30('0x3')]},'wechat':{'type':Sequelize[_0x6f30('0x3')]},'telegram':{'type':Sequelize[_0x6f30('0x3')]},'UserId':{'type':Sequelize[_0x6f30('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x6f30('0x3')]},'priority':{'type':Sequelize[_0x6f30('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x6f30('0x3')]},'utcOffset':{'type':Sequelize[_0x6f30('0x5')]}};
\ No newline at end of file
+var _0x99bb=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x158339,_0x121062){var _0x5f3c50=function(_0x59b0fd){while(--_0x59b0fd){_0x158339['push'](_0x158339['shift']());}};_0x5f3c50(++_0x121062);}(_0x99bb,0x6c));var _0xb99b=function(_0xc35e79,_0x37df8f){_0xc35e79=_0xc35e79-0x0;var _0x2f2750=_0x99bb[_0xc35e79];return _0x2f2750;};'use strict';var _=require(_0xb99b('0x0'));var Sequelize=require(_0xb99b('0x1'));module[_0xb99b('0x2')]={'firstName':{'type':Sequelize[_0xb99b('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb99b('0x3')]},'street':{'type':Sequelize[_0xb99b('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb99b('0x3')]},'country':{'type':Sequelize[_0xb99b('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb99b('0x3')]},'description':{'type':Sequelize[_0xb99b('0x4')]},'phone':{'type':Sequelize[_0xb99b('0x3')]},'mobile':{'type':Sequelize[_0xb99b('0x3')]},'fax':{'type':Sequelize[_0xb99b('0x3')]},'email':{'type':Sequelize[_0xb99b('0x3')]},'url':{'type':Sequelize[_0xb99b('0x3')]},'facebook':{'type':Sequelize[_0xb99b('0x3')]},'fb_data':{'type':Sequelize[_0xb99b('0x3')]},'twitter':{'type':Sequelize[_0xb99b('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xb99b('0x3')]},'viber':{'type':Sequelize[_0xb99b('0x3')]},'line':{'type':Sequelize[_0xb99b('0x3')]},'wechat':{'type':Sequelize[_0xb99b('0x3')]},'telegram':{'type':Sequelize[_0xb99b('0x3')]},'UserId':{'type':Sequelize[_0xb99b('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xb99b('0x3')]},'priority':{'type':Sequelize[_0xb99b('0x5')](0x2)[_0xb99b('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb99b('0x7')],'defaultValue':Sequelize[_0xb99b('0x8')]},'dialTimezone':{'type':Sequelize[_0xb99b('0x3')]},'utcOffset':{'type':Sequelize[_0xb99b('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index da51ad1..f793e76 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 _0x8dd4=['../../components/parsers/qs','../../config/logger','../../config/environment/shared','redis','defaults','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','update','then','destroy','sendStatus','stack','name','send','describe','getOptions','query','catch','CmContact','find','tags','keys','length','cf_','displayName','analytics','CmCustomField','columnName','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','findAll','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','WhatsappInteraction','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','push','ListId','findOrCreate','spread','contact','all','Tag','color','Phones','params','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','omit','format','pickBy','startsWith','cf_%d','isEmpty','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','filters','intersection','fields','attributes','order','sort','pick','filter','map','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','nolimit','ContactId','options','includeAll','include','getHopperHistories','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','User','agent','binding','../../components/import/cm/csv2','stringify','exit','message','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','-createdAt','channel','includes','toLowerCase','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','callerid','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','DESC','range','findAndCountAll','alias','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','UserId','key','Owner','fullname','Tags','customerIp','customerPort','deviceModel','ratingMessage','referer','substatus','threadId','Interaction','sortBy','reverse','value','moment','bluebird','path','lodash','squel','papaparse','ioredis','../../components/contacts'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x8dd4,0x1dc));var _0x48dd=function(_0x2c78df,_0x4e8eae){_0x2c78df=_0x2c78df-0x0;var _0x1a602d=_0x8dd4[_0x2c78df];return _0x1a602d;};'use strict';var moment=require(_0x48dd('0x0'));var BPromise=require(_0x48dd('0x1'));var util=require('util');var path=require(_0x48dd('0x2'));var fs=require('fs');var _=require(_0x48dd('0x3'));var squel=require(_0x48dd('0x4'));var Papa=require(_0x48dd('0x5'));var Redis=require(_0x48dd('0x6'));var contacts=require(_0x48dd('0x7'));var qs=require(_0x48dd('0x8'));var logger=require(_0x48dd('0x9'))('api');var config=require('../../config/environment');var shared=require(_0x48dd('0xa'));var db=require('../../mysqldb')['db'];config[_0x48dd('0xb')]=_[_0x48dd('0xc')](config[_0x48dd('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48dd('0xb')]));require(_0x48dd('0xd'))[_0x48dd('0xe')](socket);function respondWithResult(_0x2c8ea6,_0x31a56e){_0x31a56e=_0x31a56e||0xc8;return function(_0x59ac9c){if(_0x59ac9c){return _0x2c8ea6[_0x48dd('0xf')](_0x31a56e)[_0x48dd('0x10')](_0x59ac9c);}};}function respondWithFilteredResult(_0xe39852,_0x222daf){return function(_0x120407){if(_0x120407){var _0x198343=typeof _0x222daf[_0x48dd('0x11')]===_0x48dd('0x12')&&typeof _0x222daf[_0x48dd('0x13')]==='undefined';var _0x17ccc8=_0x120407[_0x48dd('0x14')];var _0x57d1d2=_0x198343?0x0:_0x222daf[_0x48dd('0x11')];var _0x4ae985=_0x198343?_0x120407['count']:_0x222daf['offset']+_0x222daf['limit'];var _0x52c2ff;if(_0x4ae985>=_0x17ccc8){_0x4ae985=_0x17ccc8;_0x52c2ff=0xc8;}else{_0x52c2ff=0xce;}_0xe39852[_0x48dd('0xf')](_0x52c2ff);return _0xe39852[_0x48dd('0x15')]('Content-Range',_0x57d1d2+'-'+_0x4ae985+'/'+_0x17ccc8)[_0x48dd('0x10')](_0x120407);}return null;};}function saveUpdates(_0x8848f3){return function(_0x28511c){if(_0x28511c){return _0x28511c[_0x48dd('0x16')](_0x8848f3)[_0x48dd('0x17')](function(_0x2d069e){return _0x2d069e;});}return null;};}function removeEntity(_0x1ded92){return function(_0x1ace51){if(_0x1ace51){return _0x1ace51[_0x48dd('0x18')]()['then'](function(){_0x1ded92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2450bd){return function(_0x540d92){if(!_0x540d92){_0x2450bd[_0x48dd('0x19')](0x194);}return _0x540d92;};}function handleError(_0x3e2392,_0x56c7ae){_0x56c7ae=_0x56c7ae||0x1f4;return function(_0x678a){logger['error'](_0x678a[_0x48dd('0x1a')]);if(_0x678a[_0x48dd('0x1b')]){delete _0x678a[_0x48dd('0x1b')];}_0x3e2392['status'](_0x56c7ae)[_0x48dd('0x1c')](_0x678a);};}exports['index']=function(_0x153648,_0xfdd408){var _0x2d4b38={};return contacts[_0x48dd('0x1d')]()[_0x48dd('0x17')](function(_0x3eeacf){_0x2d4b38=qs[_0x48dd('0x1e')](_0x3eeacf,_0x153648);return contacts['findAll'](_0x153648[_0x48dd('0x1f')],_0x153648['user'],_0x2d4b38,_0x3eeacf);})[_0x48dd('0x17')](respondWithFilteredResult(_0xfdd408,_0x2d4b38))[_0x48dd('0x20')](handleError(_0xfdd408,null));};exports[_0x48dd('0x18')]=function(_0x36c45e,_0xd811c3){return db[_0x48dd('0x21')][_0x48dd('0x22')]({'where':{'id':_0x36c45e['params']['id']}})['then'](handleEntityNotFound(_0xd811c3,null))['then'](removeEntity(_0xd811c3,null))['catch'](handleError(_0xd811c3,null));};exports[_0x48dd('0x1d')]=function(_0x15ec62,_0x1de20d){return db['CmContact'][_0x48dd('0x1d')]()['then'](function(_0x1671a2){delete _0x1671a2[_0x48dd('0x23')];for(var _0x5022ae=0x0;_0x5022ae
','generateXOAuth2Token','user=','utf-8','toString','base64','randomstring','path','util','email','address','anonymous','generate','@xcally.com','head','value','name','split','length','slice','join','Anonymous','pop','isEmpty','html','0x1?_0x216222[_0x44f2('0xd')](0x0,-0x1)[_0x44f2('0xe')]('\x20'):_0x47b887[_0x44f2('0xa')];}return _0x44f2('0xf');}function getLastName(_0xf03a86){var _0x59c7d0=_[_0x44f2('0x8')](_0xf03a86[_0x44f2('0x9')]);if(_0x59c7d0&&_0x59c7d0[_0x44f2('0xa')]){var _0x44ea1d=_0x59c7d0[_0x44f2('0xa')][_0x44f2('0xb')](/\s+/);return _0x44ea1d[_0x44f2('0xc')]>0x1?_0x44ea1d[_0x44f2('0x10')]():'';}return'';}function getMails(_0x406721,_0x406822){var _0x7f0230='';for(var _0x4daf66=0x0;_0x4daf66<_0x406822[_0x44f2('0x9')]['length'];_0x4daf66+=0x1){if(_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0x4')]!==_0x406721){if(!_[_0x44f2('0x11')](_0x7f0230)){_0x7f0230+=',';}_0x7f0230+=_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0xa')]||_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0x4')]||'';_0x7f0230+='\x20<';_0x7f0230+=_0x406822[_0x44f2('0x9')][_0x4daf66][_0x44f2('0x4')]?_0x406822['value'][_0x4daf66][_0x44f2('0x4')]:'anonymous'+random['generate'](0x6)+_0x44f2('0x7');_0x7f0230+='>';}}return _0x7f0230;}function parseEmail(_0x50a010,_0x4064f8,_0x145bac){if(_0x4064f8[_0x44f2('0x12')]){var _0x349853=/