From: support
Date: Mon, 24 Oct 2022 16:24:56 +0000 (+0000)
Subject: Built motion from commit 1fd437e9.|2.6.19
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22javascript:void%28%27%7BtitleJs%7D%27%29/%22%22%29%20%27?a=commitdiff_plain;h=5a0630adbe3a87a3233169bdb98dc4a5ee53740c;p=motion2.git
Built motion from commit 1fd437e9.|2.6.19
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 2b19929..b90dd24 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-24T15:51:17.883Z",
+ "time": "2022-10-24T16:17:15.617Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0634d8c..18ef972 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-24T15:51:17.883Z",
+ "time": "2022-10-24T16:17:15.617Z",
"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 755341d..c4d3a3b 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 _0x2e63=['VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','exports'];(function(_0x2d1167,_0xce40cf){var _0x52ed8a=function(_0x3c4a83){while(--_0x3c4a83){_0x2d1167['push'](_0x2d1167['shift']());}};_0x52ed8a(++_0xce40cf);}(_0x2e63,0x6f));var _0x32e6=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x2e63[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require('sequelize');module[_0x32e6('0x0')]={'name':{'type':Sequelize[_0x32e6('0x1')],'get':function(_0x489a4f){return this[_0x32e6('0x2')](_0x32e6('0x3'));}},'action':{'type':Sequelize[_0x32e6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x32e6('0x5'),'integration',_0x32e6('0x6'),_0x32e6('0x7'),_0x32e6('0x8'),_0x32e6('0x9'),_0x32e6('0xa'),_0x32e6('0xb')]],'msg':_0x32e6('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x32e6('0x4')](0x1000),'comment':_0x32e6('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x32e6('0x4')](0x1000),'comment':_0x32e6('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x32e6('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x32e6('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xc360=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','script'];(function(_0x2b1e99,_0xcb3464){var _0x99721b=function(_0x242133){while(--_0x242133){_0x2b1e99['push'](_0x2b1e99['shift']());}};_0x99721b(++_0xcb3464);}(_0xc360,0x15f));var _0x0c36=function(_0x2b24d0,_0x49b3d7){_0x2b24d0=_0x2b24d0-0x0;var _0x1a2482=_0xc360[_0x2b24d0];return _0x1a2482;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c36('0x0')],'get':function(_0x1d1cff){return this[_0x0c36('0x1')](_0x0c36('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x0c36('0x3'),_0x0c36('0x4'),'motionbar',_0x0c36('0x5'),_0x0c36('0x6'),_0x0c36('0x7'),'bot',_0x0c36('0x8')]],'msg':_0x0c36('0x9')}},'comment':_0x0c36('0x9')},'data1':{'type':Sequelize[_0x0c36('0xa')](0x1000),'comment':_0x0c36('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0c36('0xc')},'data3':{'type':Sequelize[_0x0c36('0xa')](0x1000),'comment':_0x0c36('0xd')},'data4':{'type':Sequelize[_0x0c36('0xa')](0x1000),'comments':_0x0c36('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x0c36('0xf')},'data6':{'type':Sequelize[_0x0c36('0xa')],'comments':_0x0c36('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x0c36('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 439c93a..9de1314 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 _0x0f9d=['Action','find','params','catch','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','body'];(function(_0x356351,_0x9ce538){var _0x3e64aa=function(_0x3107f5){while(--_0x3107f5){_0x356351['push'](_0x356351['shift']());}};_0x3e64aa(++_0x9ce538);}(_0x0f9d,0x1d0));var _0xd0f9=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x0f9d[_0x15ca1a];return _0x507626;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0f9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0f9('0x1'));var rp=require(_0xd0f9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd0f9('0x3'));var util=require(_0xd0f9('0x4'));var path=require(_0xd0f9('0x5'));var sox=require('sox');var csv=require(_0xd0f9('0x6'));var ejs=require(_0xd0f9('0x7'));var fs=require('fs');var fs_extra=require(_0xd0f9('0x8'));var _=require(_0xd0f9('0x9'));var squel=require(_0xd0f9('0xa'));var crypto=require(_0xd0f9('0xb'));var jsforce=require(_0xd0f9('0xc'));var deskjs=require(_0xd0f9('0xd'));var toCsv=require(_0xd0f9('0x6'));var querystring=require(_0xd0f9('0xe'));var Papa=require(_0xd0f9('0xf'));var Redis=require(_0xd0f9('0x10'));var authService=require(_0xd0f9('0x11'));var qs=require(_0xd0f9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0f9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd0f9('0x14'));var licenseUtil=require(_0xd0f9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55963c,_0x379106){_0x379106=_0x379106||0xcc;return function(_0xcda502){if(_0xcda502){return _0x55963c[_0xd0f9('0x16')](_0x379106);}return _0x55963c[_0xd0f9('0x17')](_0x379106)[_0xd0f9('0x18')]();};}function respondWithResult(_0x25ad11,_0x2aca81){_0x2aca81=_0x2aca81||0xc8;return function(_0x123ea9){if(_0x123ea9){return _0x25ad11[_0xd0f9('0x17')](_0x2aca81)[_0xd0f9('0x19')](_0x123ea9);}};}function respondWithFilteredResult(_0x24f47a,_0x1738c4){return function(_0x2d8508){if(_0x2d8508){var _0x4f3634=typeof _0x1738c4[_0xd0f9('0x1a')]==='undefined'&&typeof _0x1738c4[_0xd0f9('0x1b')]===_0xd0f9('0x1c');var _0x5349e4=_0x2d8508[_0xd0f9('0x1d')];var _0x5c4f8f=_0x4f3634?0x0:_0x1738c4[_0xd0f9('0x1a')];var _0x5a9107=_0x4f3634?_0x2d8508[_0xd0f9('0x1d')]:_0x1738c4[_0xd0f9('0x1a')]+_0x1738c4[_0xd0f9('0x1b')];var _0x3043a5;if(_0x5a9107>=_0x5349e4){_0x5a9107=_0x5349e4;_0x3043a5=0xc8;}else{_0x3043a5=0xce;}_0x24f47a[_0xd0f9('0x17')](_0x3043a5);return _0x24f47a[_0xd0f9('0x1e')](_0xd0f9('0x1f'),_0x5c4f8f+'-'+_0x5a9107+'/'+_0x5349e4)['json'](_0x2d8508);}return null;};}function patchUpdates(_0x23e71a){return function(_0x3ad33f){try{jsonpatch[_0xd0f9('0x20')](_0x3ad33f,_0x23e71a,!![]);}catch(_0x5a41bc){return BPromise[_0xd0f9('0x21')](_0x5a41bc);}return _0x3ad33f['save']();};}function saveUpdates(_0x4180ce,_0x1b80cc){return function(_0x3aa1fa){if(_0x3aa1fa){return _0x3aa1fa[_0xd0f9('0x22')](_0x4180ce)['then'](function(_0x47c876){return _0x47c876;});}return null;};}function removeEntity(_0x24e495,_0x254a80){return function(_0x9a76ec){if(_0x9a76ec){return _0x9a76ec[_0xd0f9('0x23')]()[_0xd0f9('0x24')](function(){_0x24e495[_0xd0f9('0x17')](0xcc)[_0xd0f9('0x18')]();});}};}function handleEntityNotFound(_0x20a988,_0xfaed78){return function(_0x19454b){if(!_0x19454b){_0x20a988[_0xd0f9('0x16')](0x194);}return _0x19454b;};}function handleError(_0x2bb19b,_0x23c23b){_0x23c23b=_0x23c23b||0x1f4;return function(_0x36152a){logger[_0xd0f9('0x25')](_0x36152a[_0xd0f9('0x26')]);if(_0x36152a[_0xd0f9('0x27')]){delete _0x36152a['name'];}_0x2bb19b[_0xd0f9('0x17')](_0x23c23b)[_0xd0f9('0x28')](_0x36152a);};}exports[_0xd0f9('0x22')]=function(_0x151133,_0x578c74){if(_0x151133[_0xd0f9('0x29')]['id']){delete _0x151133[_0xd0f9('0x29')]['id'];}return db[_0xd0f9('0x2a')][_0xd0f9('0x2b')]({'where':{'id':_0x151133[_0xd0f9('0x2c')]['id']}})['then'](handleEntityNotFound(_0x578c74,null))['then'](saveUpdates(_0x151133[_0xd0f9('0x29')],null))['then'](respondWithResult(_0x578c74,null))[_0xd0f9('0x2d')](handleError(_0x578c74,null));};exports[_0xd0f9('0x23')]=function(_0x5539d0,_0x127ab8){return db[_0xd0f9('0x2a')]['find']({'where':{'id':_0x5539d0[_0xd0f9('0x2c')]['id']}})[_0xd0f9('0x24')](handleEntityNotFound(_0x127ab8,null))['then'](removeEntity(_0x127ab8,null))['catch'](handleError(_0x127ab8,null));};
\ No newline at end of file
+var _0x714b=['destroy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','send','body','Action','find','catch'];(function(_0x75b810,_0x5873cf){var _0x26de6b=function(_0x173af6){while(--_0x173af6){_0x75b810['push'](_0x75b810['shift']());}};_0x26de6b(++_0x5873cf);}(_0x714b,0xb1));var _0xb714=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x714b[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xb714('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb714('0x1'));var jsonpatch=require(_0xb714('0x2'));var rp=require(_0xb714('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb714('0x4'));var util=require('util');var path=require(_0xb714('0x5'));var sox=require('sox');var csv=require(_0xb714('0x6'));var ejs=require(_0xb714('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb714('0x8'));var squel=require(_0xb714('0x9'));var crypto=require(_0xb714('0xa'));var jsforce=require(_0xb714('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb714('0x6'));var querystring=require(_0xb714('0xc'));var Papa=require(_0xb714('0xd'));var Redis=require('ioredis');var authService=require(_0xb714('0xe'));var qs=require(_0xb714('0xf'));var as=require(_0xb714('0x10'));var hardwareService=require(_0xb714('0x11'));var logger=require(_0xb714('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xb714('0x13'));var licenseUtil=require(_0xb714('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c08d8,_0x50d65e){_0x50d65e=_0x50d65e||0xcc;return function(_0x4d2bb1){if(_0x4d2bb1){return _0x5c08d8[_0xb714('0x15')](_0x50d65e);}return _0x5c08d8[_0xb714('0x16')](_0x50d65e)[_0xb714('0x17')]();};}function respondWithResult(_0x87a208,_0x44d97c){_0x44d97c=_0x44d97c||0xc8;return function(_0x1be75b){if(_0x1be75b){return _0x87a208['status'](_0x44d97c)['json'](_0x1be75b);}};}function respondWithFilteredResult(_0x28ce68,_0x4cc930){return function(_0x4c48d4){if(_0x4c48d4){var _0x37eef8=typeof _0x4cc930[_0xb714('0x18')]===_0xb714('0x19')&&typeof _0x4cc930[_0xb714('0x1a')]===_0xb714('0x19');var _0x395b09=_0x4c48d4[_0xb714('0x1b')];var _0x3ff7a8=_0x37eef8?0x0:_0x4cc930['offset'];var _0x27717a=_0x37eef8?_0x4c48d4[_0xb714('0x1b')]:_0x4cc930[_0xb714('0x18')]+_0x4cc930[_0xb714('0x1a')];var _0xc61033;if(_0x27717a>=_0x395b09){_0x27717a=_0x395b09;_0xc61033=0xc8;}else{_0xc61033=0xce;}_0x28ce68[_0xb714('0x16')](_0xc61033);return _0x28ce68[_0xb714('0x1c')](_0xb714('0x1d'),_0x3ff7a8+'-'+_0x27717a+'/'+_0x395b09)[_0xb714('0x1e')](_0x4c48d4);}return null;};}function patchUpdates(_0x580ee2){return function(_0x40209a){try{jsonpatch[_0xb714('0x1f')](_0x40209a,_0x580ee2,!![]);}catch(_0x3177c3){return BPromise[_0xb714('0x20')](_0x3177c3);}return _0x40209a[_0xb714('0x21')]();};}function saveUpdates(_0x2aebc0,_0x1eab52){return function(_0x4c8519){if(_0x4c8519){return _0x4c8519[_0xb714('0x22')](_0x2aebc0)[_0xb714('0x23')](function(_0x3f4ec8){return _0x3f4ec8;});}return null;};}function removeEntity(_0x4be929,_0x17e48b){return function(_0x510c10){if(_0x510c10){return _0x510c10['destroy']()[_0xb714('0x23')](function(){_0x4be929[_0xb714('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2206d0,_0x1b6a9e){return function(_0x68a7e9){if(!_0x68a7e9){_0x2206d0[_0xb714('0x15')](0x194);}return _0x68a7e9;};}function handleError(_0x128b1a,_0x4d7951){_0x4d7951=_0x4d7951||0x1f4;return function(_0x39d0d6){logger[_0xb714('0x24')](_0x39d0d6[_0xb714('0x25')]);if(_0x39d0d6['name']){delete _0x39d0d6['name'];}_0x128b1a[_0xb714('0x16')](_0x4d7951)[_0xb714('0x26')](_0x39d0d6);};}exports[_0xb714('0x22')]=function(_0x2fb1df,_0x1b4b3c){if(_0x2fb1df['body']['id']){delete _0x2fb1df[_0xb714('0x27')]['id'];}return db[_0xb714('0x28')][_0xb714('0x29')]({'where':{'id':_0x2fb1df['params']['id']}})['then'](handleEntityNotFound(_0x1b4b3c,null))[_0xb714('0x23')](saveUpdates(_0x2fb1df[_0xb714('0x27')],null))['then'](respondWithResult(_0x1b4b3c,null))[_0xb714('0x2a')](handleError(_0x1b4b3c,null));};exports[_0xb714('0x2b')]=function(_0xc780de,_0x4b6955){return db[_0xb714('0x28')]['find']({'where':{'id':_0xc780de['params']['id']}})[_0xb714('0x23')](handleEntityNotFound(_0x4b6955,null))[_0xb714('0x23')](removeEntity(_0x4b6955,null))['catch'](handleError(_0x4b6955,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index be7dda5..514bee9 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 _0xcdd2=['./action.attributes','exports','define','Action','tools_actions','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x5df2c5,_0x20d5b3){var _0x225183=function(_0x125407){while(--_0x125407){_0x5df2c5['push'](_0x5df2c5['shift']());}};_0x225183(++_0x20d5b3);}(_0xcdd2,0x13d));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var logger=require('../../config/logger')(_0x2cdd('0x2'));var moment=require('moment');var BPromise=require(_0x2cdd('0x3'));var rp=require(_0x2cdd('0x4'));var fs=require('fs');var path=require(_0x2cdd('0x5'));var rimraf=require('rimraf');var config=require(_0x2cdd('0x6'));var attributes=require(_0x2cdd('0x7'));module[_0x2cdd('0x8')]=function(_0x1afa82,_0xc4bd9b){return _0x1afa82[_0x2cdd('0x9')](_0x2cdd('0xa'),attributes,{'tableName':_0x2cdd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0590=['moment','request-promise','rimraf','../../config/environment','exports','define','tools_actions','../../config/logger','api'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0590,0x166));var _0x0059=function(_0x5a5b56,_0x25b0cf){_0x5a5b56=_0x5a5b56-0x0;var _0xc6d035=_0x0590[_0x5a5b56];return _0xc6d035;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0059('0x0'))(_0x0059('0x1'));var moment=require(_0x0059('0x2'));var BPromise=require('bluebird');var rp=require(_0x0059('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0059('0x4'));var config=require(_0x0059('0x5'));var attributes=require('./action.attributes');module[_0x0059('0x6')]=function(_0xb88d6f,_0x489111){return _0xb88d6f[_0x0059('0x7')]('Action',attributes,{'tableName':_0x0059('0x8'),'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 94875d0..2494ec6 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b467cce..b91b120 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 _0x5206=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','exports'];(function(_0x1c8718,_0x45f266){var _0x6132bd=function(_0x11b8c7){while(--_0x11b8c7){_0x1c8718['push'](_0x1c8718['shift']());}};_0x6132bd(++_0x45f266);}(_0x5206,0x152));var _0x6520=function(_0x1bdfaa,_0x4fbb58){_0x1bdfaa=_0x1bdfaa-0x0;var _0x69adba=_0x5206[_0x1bdfaa];return _0x69adba;};'use strict';var multer=require('multer');var util=require(_0x6520('0x0'));var path=require(_0x6520('0x1'));var timeout=require('connect-timeout');var express=require(_0x6520('0x2'));var router=express[_0x6520('0x3')]();var fs_extra=require(_0x6520('0x4'));var auth=require(_0x6520('0x5'));var interaction=require(_0x6520('0x6'));var config=require(_0x6520('0x7'));var controller=require(_0x6520('0x8'));router[_0x6520('0x9')](_0x6520('0xa'),auth['isAuthenticated'](),controller[_0x6520('0xb')]);router['delete'](_0x6520('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x6520('0xc')]=router;
\ No newline at end of file
+var _0x891f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','update','delete','/:id','exports','multer','util','path','connect-timeout','express'];(function(_0x31ed0a,_0x248431){var _0x30a689=function(_0x426283){while(--_0x426283){_0x31ed0a['push'](_0x31ed0a['shift']());}};_0x30a689(++_0x248431);}(_0x891f,0x6b));var _0xf891=function(_0x41da2a,_0x252b01){_0x41da2a=_0x41da2a-0x0;var _0x15e039=_0x891f[_0x41da2a];return _0x15e039;};'use strict';var multer=require(_0xf891('0x0'));var util=require(_0xf891('0x1'));var path=require(_0xf891('0x2'));var timeout=require(_0xf891('0x3'));var express=require(_0xf891('0x4'));var router=express[_0xf891('0x5')]();var fs_extra=require(_0xf891('0x6'));var auth=require(_0xf891('0x7'));var interaction=require(_0xf891('0x8'));var config=require(_0xf891('0x9'));var controller=require('./action.controller');router[_0xf891('0xa')]('/:id',auth[_0xf891('0xb')](),controller[_0xf891('0xc')]);router[_0xf891('0xd')](_0xf891('0xe'),auth[_0xf891('0xb')](),controller['destroy']);module[_0xf891('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 1cfe351..728f055 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 _0xafc4=['sequelize','STRING','TEXT'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0xafc4,0x69));var _0x4afc=function(_0x261c61,_0x3df250){_0x261c61=_0x261c61-0x0;var _0x246268=_0xafc4[_0x261c61];return _0x246268;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x2de0ec,_0x38812f){var _0x13aa7b=function(_0x340176){while(--_0x340176){_0x2de0ec['push'](_0x2de0ec['shift']());}};_0x13aa7b(++_0x38812f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x24ca[_0x5a19fc];return _0x34b413;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 57bb4e4..c915987 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 _0xdc3a=['UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','field','function','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','left_join','right_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','value','ValidationErrorItem','AnalyticMetric','keyBy','output','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','toString','child_process','fork','../../components/export/','../../files/reports','savename','runReport','groupBy','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','get','CustomReports','UserProfileResource','end','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)'];(function(_0x50cecb,_0x293aaf){var _0xb3e974=function(_0x48d4df){while(--_0x48d4df){_0x50cecb['push'](_0x50cecb['shift']());}};_0xb3e974(++_0x293aaf);}(_0xdc3a,0x191));var _0xadc3=function(_0x1b59c6,_0x5add0d){_0x1b59c6=_0x1b59c6-0x0;var _0xf29f94=_0xdc3a[_0x1b59c6];return _0xf29f94;};'use strict';var emlformat=require(_0xadc3('0x0'));var rimraf=require(_0xadc3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xadc3('0x2'));var moment=require('moment');var BPromise=require(_0xadc3('0x3'));var Mustache=require(_0xadc3('0x4'));var util=require(_0xadc3('0x5'));var path=require(_0xadc3('0x6'));var sox=require('sox');var csv=require(_0xadc3('0x7'));var ejs=require(_0xadc3('0x8'));var fs=require('fs');var fs_extra=require(_0xadc3('0x9'));var _=require(_0xadc3('0xa'));var squel=require(_0xadc3('0xb'));var crypto=require(_0xadc3('0xc'));var jsforce=require(_0xadc3('0xd'));var deskjs=require(_0xadc3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xadc3('0xf'));var Papa=require(_0xadc3('0x10'));var Redis=require(_0xadc3('0x11'));var authService=require(_0xadc3('0x12'));var qs=require(_0xadc3('0x13'));var as=require(_0xadc3('0x14'));var hardwareService=require(_0xadc3('0x15'));var logger=require(_0xadc3('0x16'))(_0xadc3('0x17'));var utils=require(_0xadc3('0x18'));var config=require(_0xadc3('0x19'));var licenseUtil=require(_0xadc3('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require(_0xadc3('0x1b'))[_0xadc3('0x1c')];function respondWithStatusCode(_0x5adfa9,_0x162b77){_0x162b77=_0x162b77||0xcc;return function(_0x3bdc57){if(_0x3bdc57){return _0x5adfa9[_0xadc3('0x1d')](_0x162b77);}return _0x5adfa9[_0xadc3('0x1e')](_0x162b77)['end']();};}function respondWithResult(_0x340373,_0x5136f3){_0x5136f3=_0x5136f3||0xc8;return function(_0x258d9b){if(_0x258d9b){return _0x340373[_0xadc3('0x1e')](_0x5136f3)[_0xadc3('0x1f')](_0x258d9b);}};}function respondWithFilteredResult(_0x127037,_0x9c54cb){return function(_0x523c15){if(_0x523c15){var _0x3b0119=typeof _0x9c54cb[_0xadc3('0x20')]==='undefined'&&typeof _0x9c54cb[_0xadc3('0x21')]==='undefined';var _0x1a10ca=_0x523c15[_0xadc3('0x22')];var _0x23ba06=_0x3b0119?0x0:_0x9c54cb[_0xadc3('0x20')];var _0x15c1fd=_0x3b0119?_0x523c15['count']:_0x9c54cb[_0xadc3('0x20')]+_0x9c54cb[_0xadc3('0x21')];var _0x4df42c;if(_0x15c1fd>=_0x1a10ca){_0x15c1fd=_0x1a10ca;_0x4df42c=0xc8;}else{_0x4df42c=0xce;}_0x127037[_0xadc3('0x1e')](_0x4df42c);return _0x127037[_0xadc3('0x23')](_0xadc3('0x24'),_0x23ba06+'-'+_0x15c1fd+'/'+_0x1a10ca)[_0xadc3('0x1f')](_0x523c15);}return null;};}function patchUpdates(_0x4b1ee6){return function(_0x114791){try{jsonpatch[_0xadc3('0x25')](_0x114791,_0x4b1ee6,!![]);}catch(_0x475743){return BPromise['reject'](_0x475743);}return _0x114791[_0xadc3('0x26')]();};}function saveUpdates(_0x5eda33,_0x39f622){return function(_0x224141){if(_0x224141){return _0x224141[_0xadc3('0x27')](_0x5eda33)['then'](function(_0x42789e){return _0x42789e;});}return null;};}function removeEntity(_0x576e22,_0x19bba5){return function(_0x38e0b9){if(_0x38e0b9){return _0x38e0b9[_0xadc3('0x28')]()[_0xadc3('0x29')](function(){var _0x1af637=_0x38e0b9[_0xadc3('0x2a')]({'plain':!![]});var _0x4bca14=_0xadc3('0x2b');return db[_0xadc3('0x2c')]['destroy']({'where':{'type':_0x4bca14,'resourceId':_0x1af637['id']}})[_0xadc3('0x29')](function(){return _0x38e0b9;});})[_0xadc3('0x29')](function(){_0x576e22[_0xadc3('0x1e')](0xcc)[_0xadc3('0x2d')]();});}};}function handleEntityNotFound(_0x59e9e3,_0xe3a1fb){return function(_0x5c4c58){if(!_0x5c4c58){_0x59e9e3[_0xadc3('0x1d')](0x194);}return _0x5c4c58;};}function handleError(_0x406751,_0x556af5){_0x556af5=_0x556af5||0x1f4;return function(_0x3ee393){logger['error'](_0x3ee393[_0xadc3('0x2e')]);if(_0x3ee393[_0xadc3('0x2f')]){delete _0x3ee393[_0xadc3('0x2f')];}_0x406751[_0xadc3('0x1e')](_0x556af5)['send'](_0x3ee393);};}exports[_0xadc3('0x30')]=function(_0x3584a2,_0x10c72d){var _0x2b64fb={},_0xeadbb0={},_0x118840={'count':0x0,'rows':[]};var _0x2fb346=_[_0xadc3('0x31')](db[_0xadc3('0x32')][_0xadc3('0x33')],function(_0x1d9c2f){return{'name':_0x1d9c2f[_0xadc3('0x34')],'type':_0x1d9c2f[_0xadc3('0x35')]['key']};});_0xeadbb0[_0xadc3('0x36')]=_[_0xadc3('0x31')](_0x2fb346,_0xadc3('0x2f'));_0xeadbb0[_0xadc3('0x37')]=_[_0xadc3('0x38')](_0x3584a2[_0xadc3('0x37')]);_0xeadbb0[_0xadc3('0x39')]=_[_0xadc3('0x3a')](_0xeadbb0['model'],_0xeadbb0[_0xadc3('0x37')]);_0x2b64fb[_0xadc3('0x3b')]=_[_0xadc3('0x3a')](_0xeadbb0[_0xadc3('0x36')],qs[_0xadc3('0x3c')](_0x3584a2[_0xadc3('0x37')][_0xadc3('0x3c')]));_0x2b64fb['attributes']=_0x2b64fb['attributes']['length']?_0x2b64fb[_0xadc3('0x3b')]:_0xeadbb0[_0xadc3('0x36')];if(!_0x3584a2[_0xadc3('0x37')][_0xadc3('0x3d')]('nolimit')){_0x2b64fb[_0xadc3('0x21')]=qs[_0xadc3('0x21')](_0x3584a2[_0xadc3('0x37')][_0xadc3('0x21')]);_0x2b64fb[_0xadc3('0x20')]=qs[_0xadc3('0x20')](_0x3584a2[_0xadc3('0x37')][_0xadc3('0x20')]);}_0x2b64fb[_0xadc3('0x3e')]=qs[_0xadc3('0x3f')](_0x3584a2[_0xadc3('0x37')][_0xadc3('0x3f')]);_0x2b64fb[_0xadc3('0x40')]=qs[_0xadc3('0x39')](_[_0xadc3('0x41')](_0x3584a2['query'],_0xeadbb0[_0xadc3('0x39')]),_0x2fb346);if(_0x3584a2['query'][_0xadc3('0x42')]){_0x2b64fb[_0xadc3('0x40')]=_['merge'](_0x2b64fb['where'],{'$or':_[_0xadc3('0x31')](_0x2fb346,function(_0x18efe6){if(_0x18efe6['type']!==_0xadc3('0x43')){var _0x9f4ef9={};_0x9f4ef9[_0x18efe6[_0xadc3('0x2f')]]={'$like':'%'+_0x3584a2[_0xadc3('0x37')][_0xadc3('0x42')]+'%'};return _0x9f4ef9;}})});}_0x2b64fb=_[_0xadc3('0x44')]({},_0x2b64fb,_0x3584a2['options']);var _0xa9c466={'where':_0x2b64fb[_0xadc3('0x40')]};return db['AnalyticCustomReport']['count'](_0xa9c466)[_0xadc3('0x29')](function(_0x42b3b6){_0x118840[_0xadc3('0x22')]=_0x42b3b6;if(_0x3584a2[_0xadc3('0x37')][_0xadc3('0x45')]){_0x2b64fb[_0xadc3('0x46')]=[{'all':!![]}];}return db[_0xadc3('0x32')][_0xadc3('0x47')](_0x2b64fb);})[_0xadc3('0x29')](function(_0x172691){_0x118840['rows']=_0x172691;return _0x118840;})['then'](respondWithFilteredResult(_0x10c72d,_0x2b64fb))[_0xadc3('0x48')](handleError(_0x10c72d,null));};exports[_0xadc3('0x49')]=function(_0x2ed785,_0x25c931){var _0x31d2b9={'raw':![],'where':{'id':_0x2ed785[_0xadc3('0x4a')]['id']}},_0x2ca593={};_0x2ca593['model']=_[_0xadc3('0x38')](db[_0xadc3('0x32')][_0xadc3('0x33')]);_0x2ca593['query']=_[_0xadc3('0x38')](_0x2ed785['query']);_0x2ca593[_0xadc3('0x39')]=_['intersection'](_0x2ca593['model'],_0x2ca593['query']);_0x31d2b9[_0xadc3('0x3b')]=_[_0xadc3('0x3a')](_0x2ca593['model'],qs[_0xadc3('0x3c')](_0x2ed785[_0xadc3('0x37')][_0xadc3('0x3c')]));_0x31d2b9['attributes']=_0x31d2b9['attributes'][_0xadc3('0x4b')]?_0x31d2b9[_0xadc3('0x3b')]:_0x2ca593['model'];if(_0x2ed785['query'][_0xadc3('0x45')]){_0x31d2b9[_0xadc3('0x46')]=[{'all':!![]}];}_0x31d2b9=_[_0xadc3('0x44')]({},_0x31d2b9,_0x2ed785[_0xadc3('0x4c')]);return db[_0xadc3('0x32')][_0xadc3('0x4d')](_0x31d2b9)[_0xadc3('0x29')](handleEntityNotFound(_0x25c931,null))[_0xadc3('0x29')](respondWithResult(_0x25c931,null))[_0xadc3('0x48')](handleError(_0x25c931,null));};exports[_0xadc3('0x4e')]=function(_0x16285f,_0xb43e3){return db['AnalyticCustomReport'][_0xadc3('0x4e')](_0x16285f[_0xadc3('0x4f')],{})[_0xadc3('0x29')](function(_0x1fd40a){var _0xb9e602=_0x16285f[_0xadc3('0x50')][_0xadc3('0x2a')]({'plain':!![]});if(!_0xb9e602)throw new Error(_0xadc3('0x51'));if(_0xb9e602[_0xadc3('0x52')]===_0xadc3('0x50')){var _0x2bee87=_0x1fd40a[_0xadc3('0x2a')]({'plain':!![]});var _0x310140='Reports';return db[_0xadc3('0x53')]['find']({'where':{'name':_0x310140,'userProfileId':_0xb9e602['userProfileId']},'raw':!![]})[_0xadc3('0x29')](function(_0xaf6bee){if(_0xaf6bee&&_0xaf6bee[_0xadc3('0x54')]===0x0){return db[_0xadc3('0x2c')][_0xadc3('0x4e')]({'name':_0x2bee87['name'],'resourceId':_0x2bee87['id'],'type':_0xadc3('0x2b'),'sectionId':_0xaf6bee['id']},{})[_0xadc3('0x29')](function(){return _0x1fd40a;});}else{return _0x1fd40a;}})[_0xadc3('0x48')](function(_0x14a311){logger[_0xadc3('0x55')](_0xadc3('0x56'),_0x14a311);throw _0x14a311;});}return _0x1fd40a;})[_0xadc3('0x29')](respondWithResult(_0xb43e3,0xc9))[_0xadc3('0x48')](handleError(_0xb43e3,null));};exports[_0xadc3('0x27')]=function(_0x2b375f,_0x12657e){if(_0x2b375f[_0xadc3('0x4f')]['id']){delete _0x2b375f[_0xadc3('0x4f')]['id'];}return db[_0xadc3('0x32')]['find']({'where':{'id':_0x2b375f[_0xadc3('0x4a')]['id']}})[_0xadc3('0x29')](handleEntityNotFound(_0x12657e,null))['then'](saveUpdates(_0x2b375f['body'],null))['then'](respondWithResult(_0x12657e,null))[_0xadc3('0x48')](handleError(_0x12657e,null));};exports[_0xadc3('0x28')]=function(_0x197698,_0x10ba07){return db[_0xadc3('0x32')][_0xadc3('0x4d')]({'where':{'id':_0x197698[_0xadc3('0x4a')]['id']}})[_0xadc3('0x29')](handleEntityNotFound(_0x10ba07,null))[_0xadc3('0x29')](removeEntity(_0x10ba07,null))['catch'](handleError(_0x10ba07,null));};exports[_0xadc3('0x57')]=function(_0xc685cc,_0x8c1e96){var _0x3ade83=0xa;var _0x87890f=['join','left_join','right_join',_0xadc3('0x58')];var _0x51ddfa={'SUM':_0xadc3('0x59'),'COUNT':_0xadc3('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xadc3('0x5b'),'MIN':_0xadc3('0x5c'),'AVG':_0xadc3('0x5d'),'GROUP_CONCAT':_0xadc3('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xadc3('0x5f')};var _0x116b4e={'SEC_TO_TIME':_0xadc3('0x60'),'DATE':_0xadc3('0x61'),'HOUR':_0xadc3('0x62'),'ROUND':_0xadc3('0x63'),'UNIX_TIMESTAMP':_0xadc3('0x64')};var _0x114fe8=function(_0x2c8268){return!_[_0xadc3('0x65')]([_0xadc3('0x66'),_0xadc3('0x67'),_0xadc3('0x68'),_0xadc3('0x69')],_0x2c8268);};var _0x1718bb=function(_0x3fa852){if(!_0x3fa852||!_0x3fa852[_0xadc3('0x6a')][_0xadc3('0x4b')]){return'';}for(var _0x40a6c6='(',_0x3e2ade=0x0;_0x3e2ade<_0x3fa852[_0xadc3('0x6a')]['length'];_0x3e2ade+=0x1){_0x3e2ade>0x0&&(_0x40a6c6+='\x20'+_0x3fa852[_0xadc3('0x6b')]+'\x20');_0x40a6c6+=_0x3fa852[_0xadc3('0x6a')][_0x3e2ade][_0xadc3('0x6c')]?_0x1718bb(_0x3fa852['rules'][_0x3e2ade][_0xadc3('0x6c')]):_0x3fa852[_0xadc3('0x6a')][_0x3e2ade]['field']+'\x20'+_0x3fa852[_0xadc3('0x6a')][_0x3e2ade]['condition']+(_0x114fe8(_0x3fa852[_0xadc3('0x6a')][_0x3e2ade][_0xadc3('0x6d')])?'\x20'+_0x3fa852[_0xadc3('0x6a')][_0x3e2ade]['value']:'');}return _0x40a6c6+')';};var _0x383eec={'where':{'id':_0xc685cc[_0xadc3('0x4a')]['id']}},_0x5ec8c8,_0x45f208,_0xf9a3e2,_0xc9bd9c,_0x5d8d03;_0x383eec=_[_0xadc3('0x44')]({},_0x383eec,_0xc685cc['options']);return db['AnalyticCustomReport'][_0xadc3('0x4d')](_0x383eec)[_0xadc3('0x29')](function(_0x1f5bc6){if(_0x1f5bc6){_0x5ec8c8=_0x1f5bc6;return _0x1f5bc6[_0xadc3('0x6e')]();}return null;})[_0xadc3('0x29')](function(_0x13fb17){if(_0x13fb17){if(!_0x13fb17[_0xadc3('0x4b')]){throw new db[(_0xadc3('0x6f'))]['ValidationErrorItem'](_0xadc3('0x70'),0x193);}_0x45f208=_0x13fb17;return db['AnalyticMetric'][_0xadc3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x42416b){if(_0x42416b){_0xf9a3e2=_['keyBy'](_0x42416b,'id');var _0x304ddc;var _0x5513e4=squel[_0xadc3('0x71')]();_0x5513e4[_0xadc3('0x72')](_0x5ec8c8[_0xadc3('0x73')]);for(var _0x17572a=0x0;_0x17572a<_0x45f208[_0xadc3('0x4b')];_0x17572a+=0x1){_0x304ddc=_0x45f208[_0x17572a][_0xadc3('0x74')]?_0xf9a3e2[_0x45f208[_0x17572a][_0xadc3('0x74')]][_0xadc3('0x75')]:_0x45f208[_0x17572a][_0xadc3('0x76')];_0x304ddc=_0x45f208[_0x17572a][_0xadc3('0x77')]?_[_0xadc3('0x78')](_0x51ddfa[_0x45f208[_0x17572a][_0xadc3('0x77')]],'%s',_0x304ddc):_0x304ddc;_0x304ddc=_0x45f208[_0x17572a]['format']?_['replace'](_0x116b4e[_0x45f208[_0x17572a]['format']],'%s',_0x304ddc):_0x304ddc;if(_0x45f208[_0x17572a]['groupBy']){_0x5513e4[_0xadc3('0x6c')](_0x304ddc);}_0x45f208[_0x17572a][_0xadc3('0x79')]&&_0x5513e4[_0xadc3('0x3e')](_0x304ddc,_0x45f208[_0x17572a][_0xadc3('0x79')]===_0xadc3('0x7a')?![]:!![]);_0x5513e4['field'](_0x304ddc,_0x45f208[_0x17572a][_0xadc3('0x7b')]||_0x304ddc);}if(_0x5ec8c8['joins']){_0x5ec8c8[_0xadc3('0x7c')]=JSON[_0xadc3('0x7d')](_0x5ec8c8[_0xadc3('0x7c')]);for(var _0x1923d3=0x0;_0x1923d3<_0x5ec8c8['joins'][_0xadc3('0x4b')];_0x1923d3+=0x1){if(_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3][_0xadc3('0x35')]&&_['includes'](_0x87890f,_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3][_0xadc3('0x35')])&&_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3][_0xadc3('0x7e')]&&_0x5ec8c8['joins'][_0x1923d3][_0xadc3('0x7f')]&&_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3][_0xadc3('0x80')]){_0x5513e4[_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3][_0xadc3('0x35')]](_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3][_0xadc3('0x7f')],null,util[_0xadc3('0x81')](_0xadc3('0x82'),_0x5ec8c8[_0xadc3('0x73')],_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3][_0xadc3('0x7e')],_0x5ec8c8['joins'][_0x1923d3]['foreignTable'],_0x5ec8c8[_0xadc3('0x7c')][_0x1923d3]['foreignKey']));}}}if(_0x5ec8c8[_0xadc3('0x83')]){_0x5ec8c8[_0xadc3('0x83')]=JSON[_0xadc3('0x7d')](_0x5ec8c8['conditions']);_0x5513e4[_0xadc3('0x40')](_0x1718bb(_0x5ec8c8['conditions'][_0xadc3('0x6c')]));}_0x5d8d03=_0x5513e4[_0xadc3('0x84')]();_0x5513e4[_0xadc3('0x21')](_0x3ade83);_0x5513e4[_0xadc3('0x20')](0x0);logger[_0xadc3('0x85')](_0xadc3('0x86'),_0x5513e4['toString']());return dbH[_0xadc3('0x87')][_0xadc3('0x37')](_0x5513e4['toString'](),{'type':dbH[_0xadc3('0x87')][_0xadc3('0x88')][_0xadc3('0x89')]});}})[_0xadc3('0x29')](respondWithResult(_0x8c1e96,null))[_0xadc3('0x48')](handleError(_0x8c1e96,null));};function runReport(_0x500a52,_0x366196,_0x30a372){var _0x106e14=_0x366196[_0xadc3('0x2f')];var _0x4f8a05=0xa;var _0x19108a=[_0xadc3('0x8a'),_0xadc3('0x8b'),_0xadc3('0x8c'),_0xadc3('0x58')];var _0x2f6061={'SUM':'SUM(%s)','COUNT':_0xadc3('0x5a'),'COUNT DISTINCT':_0xadc3('0x8d'),'MAX':_0xadc3('0x5b'),'MIN':_0xadc3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xadc3('0x5e'),'GROUP_CONCAT ASC':_0xadc3('0x8e'),'GROUP_CONCAT DESC':_0xadc3('0x5f')};var _0x3cf37e={'SEC_TO_TIME':_0xadc3('0x60'),'DATE':_0xadc3('0x61'),'HOUR':_0xadc3('0x62'),'ROUND':_0xadc3('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2810a8=function(_0xf1774f){return!_['includes']([_0xadc3('0x66'),_0xadc3('0x67'),_0xadc3('0x68'),_0xadc3('0x69')],_0xf1774f);};var _0xd3583=function(_0xbec775){if(!_0xbec775||!_0xbec775[_0xadc3('0x6a')][_0xadc3('0x4b')]){return'';}for(var _0x26d23e='(',_0x161768=0x0;_0x161768<_0xbec775['rules']['length'];_0x161768+=0x1){_0x161768>0x0&&(_0x26d23e+='\x20'+_0xbec775[_0xadc3('0x6b')]+'\x20');_0x26d23e+=_0xbec775[_0xadc3('0x6a')][_0x161768][_0xadc3('0x6c')]?_0xd3583(_0xbec775['rules'][_0x161768]['group']):_0xbec775[_0xadc3('0x6a')][_0x161768]['field']+'\x20'+_0xbec775[_0xadc3('0x6a')][_0x161768][_0xadc3('0x6d')]+(_0x2810a8(_0xbec775[_0xadc3('0x6a')][_0x161768][_0xadc3('0x6d')])?'\x20'+_0xbec775[_0xadc3('0x6a')][_0x161768][_0xadc3('0x8f')]:'');}return _0x26d23e+')';};var _0x477005={'where':{'id':_0x500a52['id']}},_0x44f41a,_0x223d49,_0x12f3f8,_0x51e29c,_0x1ba141;_0x477005=_[_0xadc3('0x44')]({},_0x477005,_0x30a372);return db[_0xadc3('0x32')]['find'](_0x477005)[_0xadc3('0x29')](function(_0x1df6a2){if(_0x1df6a2){_0x44f41a=_0x1df6a2;return _0x1df6a2[_0xadc3('0x6e')]();}return null;})[_0xadc3('0x29')](function(_0x15ee66){if(_0x15ee66){if(!_0x15ee66[_0xadc3('0x4b')]){throw new db[(_0xadc3('0x6f'))][(_0xadc3('0x90'))](_0xadc3('0x70'),0x193);}_0x223d49=_0x15ee66;return db[_0xadc3('0x91')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2feeb0){if(_0x2feeb0){_0x12f3f8=_[_0xadc3('0x92')](_0x2feeb0,'id');var _0x2320ac;var _0x4d77e7=squel[_0xadc3('0x71')]();_0x4d77e7['from'](_0x44f41a['table']);for(var _0x3b86b2=0x0;_0x3b86b2<_0x223d49[_0xadc3('0x4b')];_0x3b86b2+=0x1){_0x2320ac=_0x223d49[_0x3b86b2][_0xadc3('0x74')]?_0x12f3f8[_0x223d49[_0x3b86b2]['MetricId']][_0xadc3('0x75')]:_0x223d49[_0x3b86b2]['field'];_0x2320ac=_0x223d49[_0x3b86b2][_0xadc3('0x77')]?_[_0xadc3('0x78')](_0x2f6061[_0x223d49[_0x3b86b2][_0xadc3('0x77')]],'%s',_0x2320ac):_0x2320ac;_0x2320ac=_0x223d49[_0x3b86b2]['format']?_[_0xadc3('0x78')](_0x3cf37e[_0x223d49[_0x3b86b2][_0xadc3('0x81')]],'%s',_0x2320ac):_0x2320ac;if(_0x223d49[_0x3b86b2]['groupBy']){_0x4d77e7[_0xadc3('0x6c')](_0x2320ac);}_0x223d49[_0x3b86b2][_0xadc3('0x79')]&&_0x4d77e7[_0xadc3('0x3e')](_0x2320ac,_0x223d49[_0x3b86b2][_0xadc3('0x79')]==='DESC'?![]:!![]);_0x4d77e7['field'](_0x2320ac,_0x223d49[_0x3b86b2]['alias']||_0x2320ac);}if(_0x44f41a['joins']){_0x44f41a[_0xadc3('0x7c')]=JSON[_0xadc3('0x7d')](_0x44f41a[_0xadc3('0x7c')]);for(var _0x5809c7=0x0;_0x5809c7<_0x44f41a[_0xadc3('0x7c')][_0xadc3('0x4b')];_0x5809c7+=0x1){if(_0x44f41a[_0xadc3('0x7c')][_0x5809c7][_0xadc3('0x35')]&&_[_0xadc3('0x65')](_0x19108a,_0x44f41a['joins'][_0x5809c7]['type'])&&_0x44f41a[_0xadc3('0x7c')][_0x5809c7][_0xadc3('0x7e')]&&_0x44f41a[_0xadc3('0x7c')][_0x5809c7][_0xadc3('0x7f')]&&_0x44f41a[_0xadc3('0x7c')][_0x5809c7]['foreignKey']){_0x4d77e7[_0x44f41a[_0xadc3('0x7c')][_0x5809c7]['type']](_0x44f41a[_0xadc3('0x7c')][_0x5809c7][_0xadc3('0x7f')],null,util[_0xadc3('0x81')](_0xadc3('0x82'),_0x44f41a[_0xadc3('0x73')],_0x44f41a[_0xadc3('0x7c')][_0x5809c7]['parentKey'],_0x44f41a[_0xadc3('0x7c')][_0x5809c7][_0xadc3('0x7f')],_0x44f41a[_0xadc3('0x7c')][_0x5809c7][_0xadc3('0x80')]));}}}if(_0x44f41a[_0xadc3('0x83')]){_0x44f41a['conditions']=JSON['parse'](_0x44f41a[_0xadc3('0x83')]);_0x4d77e7[_0xadc3('0x40')](_0xd3583(_0x44f41a['conditions'][_0xadc3('0x6c')]));}_0x1ba141=_0x4d77e7[_0xadc3('0x84')]();_0x4d77e7[_0xadc3('0x21')](_0x4f8a05);_0x4d77e7[_0xadc3('0x20')](0x0);return;}})[_0xadc3('0x29')](function(){if(_0x366196[_0xadc3('0x93')]==='web'){return null;}var _0x5a2714=_[_0xadc3('0x44')](_0x366196,{'name':_0x366196['fullPath']||_0x366196['name']||_0x44f41a[_0xadc3('0x2f')],'basename':_0x106e14,'savename':util[_0xadc3('0x81')](_0xadc3('0x94'),_0x366196[_0xadc3('0x2f')]||_0x44f41a[_0xadc3('0x2f')],require(_0xadc3('0x95'))[_0xadc3('0x96')](0x4),_0x366196[_0xadc3('0x93')]||_0xadc3('0x97')),'reportId':_0x44f41a['id'],'reportType':_0xadc3('0x98')});return db[_0xadc3('0x99')][_0xadc3('0x4e')](_0x5a2714,{'raw':!![]});})[_0xadc3('0x29')](function(_0x355412){if(_0x44f41a[_0xadc3('0x73')]===_0xadc3('0x9a')){_0x1ba141[_0xadc3('0x40')](_0x44f41a[_0xadc3('0x73')]+_0xadc3('0x9b'),_0x366196['startDate'],_0x366196[_0xadc3('0x9c')]);}else{_0x1ba141[_0xadc3('0x40')](_0x44f41a[_0xadc3('0x73')]+_0xadc3('0x9d'),_0x366196[_0xadc3('0x9e')],_0x366196['endDate']);}if(_0x355412){logger['info']('Run\x20Query:',_0x1ba141[_0xadc3('0x9f')]());require(_0xadc3('0xa0'))[_0xadc3('0xa1')](path['join'](__dirname,_0xadc3('0xa2'),_0x355412['output']),[_0x355412['id'],_0x1ba141[_0xadc3('0x9f')](),path[_0xadc3('0x8a')](__dirname,_0xadc3('0xa3'),_0x355412[_0xadc3('0xa4')]),_0x106e14]);return _0x355412;}else{var _0x4ddff6=squel[_0xadc3('0x71')]();_0x4ddff6[_0xadc3('0x72')]('('+_0x1ba141[_0xadc3('0x9f')]()+')','countTable');_0x4ddff6[_0xadc3('0x76')]('COUNT(*)',_0xadc3('0x22'));_0x1ba141['limit'](_0x366196[_0xadc3('0x21')]||_0x4f8a05);_0x1ba141[_0xadc3('0x20')](_0x366196['offset']||0x0);return dbH[_0xadc3('0x87')][_0xadc3('0x37')](_0x4ddff6[_0xadc3('0x9f')](),{'type':dbH[_0xadc3('0x87')][_0xadc3('0x88')][_0xadc3('0x89')]})[_0xadc3('0x29')](function(_0x4a0c95){if(!_0x4a0c95[_0xadc3('0x4b')]){_0x51e29c=0x0;}else{_0x51e29c=_0x4a0c95[0x0][_0xadc3('0x22')]||0x0;}return dbH[_0xadc3('0x87')][_0xadc3('0x37')](_0x1ba141[_0xadc3('0x9f')](),{'type':dbH[_0xadc3('0x87')][_0xadc3('0x88')]['SELECT']});})[_0xadc3('0x29')](function(_0x1cde3f){return{'rows':_0x1cde3f||[],'count':_0x51e29c};});}});}exports['run']=function(_0x2d9b5d,_0x5b7a5d){return runReport(_0x2d9b5d[_0xadc3('0x4a')],_0x2d9b5d[_0xadc3('0x37')],_0x2d9b5d['options'])[_0xadc3('0x29')](respondWithResult(_0x5b7a5d,null))['catch'](handleError(_0x5b7a5d,null));};exports[_0xadc3('0xa5')]=runReport;exports[_0xadc3('0x37')]=function(_0x57f0a4,_0x171eed){var _0x3d775d=0xa;var _0x4db8b3=[_0xadc3('0x8a'),_0xadc3('0x8b'),_0xadc3('0x8c'),'cross_join'];var _0x21d5b2={'SUM':_0xadc3('0x59'),'COUNT':_0xadc3('0x5a'),'COUNT DISTINCT':_0xadc3('0x8d'),'MAX':'MAX(%s)','MIN':_0xadc3('0x5c'),'AVG':_0xadc3('0x5d'),'GROUP_CONCAT':_0xadc3('0x5e'),'GROUP_CONCAT ASC':_0xadc3('0x8e'),'GROUP_CONCAT DESC':_0xadc3('0x5f')};var _0x3dfc54={'SEC_TO_TIME':_0xadc3('0x60'),'DATE':'DATE(%s)','HOUR':_0xadc3('0x62'),'ROUND':_0xadc3('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4381e2=function(_0x4a824d){return!_['includes']([_0xadc3('0x66'),_0xadc3('0x67'),_0xadc3('0x68'),_0xadc3('0x69')],_0x4a824d);};var _0x199a1f=function(_0x41578c){if(!_0x41578c||!_0x41578c[_0xadc3('0x6a')][_0xadc3('0x4b')]){return'';}for(var _0x37c55a='(',_0x202683=0x0;_0x202683<_0x41578c[_0xadc3('0x6a')][_0xadc3('0x4b')];_0x202683+=0x1){_0x202683>0x0&&(_0x37c55a+='\x20'+_0x41578c[_0xadc3('0x6b')]+'\x20');_0x37c55a+=_0x41578c['rules'][_0x202683][_0xadc3('0x6c')]?_0x199a1f(_0x41578c['rules'][_0x202683]['group']):_0x41578c['rules'][_0x202683][_0xadc3('0x76')]+'\x20'+_0x41578c[_0xadc3('0x6a')][_0x202683][_0xadc3('0x6d')]+(_0x4381e2(_0x41578c[_0xadc3('0x6a')][_0x202683][_0xadc3('0x6d')])?'\x20'+_0x41578c[_0xadc3('0x6a')][_0x202683][_0xadc3('0x8f')]:'');}return _0x37c55a+')';};var _0x3fdc3d={'where':{'id':_0x57f0a4['params']['id']}},_0x4695a5,_0x4492c8,_0x1e32b6,_0x16934c,_0x596a6a;_0x3fdc3d=_['merge']({},_0x3fdc3d,_0x57f0a4[_0xadc3('0x4c')]);return db[_0xadc3('0x32')]['find'](_0x3fdc3d)[_0xadc3('0x29')](function(_0x3d9975){if(_0x3d9975){_0x4695a5=_0x3d9975;return _0x3d9975['getFields']();}return null;})['then'](function(_0x262987){if(_0x262987){if(!_0x262987['length']){throw new db[(_0xadc3('0x6f'))][(_0xadc3('0x90'))](_0xadc3('0x70'),0x193);}_0x4492c8=_0x262987;return db[_0xadc3('0x91')]['findAll']({'raw':!![]});}return null;})[_0xadc3('0x29')](function(_0x5eff07){if(_0x5eff07){_0x1e32b6=_[_0xadc3('0x92')](_0x5eff07,'id');var _0x5e7979;var _0xb9024a=squel[_0xadc3('0x71')]();_0xb9024a[_0xadc3('0x72')](_0x4695a5[_0xadc3('0x73')]);for(var _0x7ccce7=0x0;_0x7ccce7<_0x4492c8[_0xadc3('0x4b')];_0x7ccce7+=0x1){_0x5e7979=_0x4492c8[_0x7ccce7]['MetricId']?_0x1e32b6[_0x4492c8[_0x7ccce7][_0xadc3('0x74')]][_0xadc3('0x75')]:_0x4492c8[_0x7ccce7][_0xadc3('0x76')];_0x5e7979=_0x4492c8[_0x7ccce7][_0xadc3('0x77')]?_[_0xadc3('0x78')](_0x21d5b2[_0x4492c8[_0x7ccce7][_0xadc3('0x77')]],'%s',_0x5e7979):_0x5e7979;_0x5e7979=_0x4492c8[_0x7ccce7][_0xadc3('0x81')]?_[_0xadc3('0x78')](_0x3dfc54[_0x4492c8[_0x7ccce7][_0xadc3('0x81')]],'%s',_0x5e7979):_0x5e7979;if(_0x4492c8[_0x7ccce7][_0xadc3('0xa6')]){_0xb9024a[_0xadc3('0x6c')](_0x5e7979);}_0x4492c8[_0x7ccce7][_0xadc3('0x79')]&&_0xb9024a[_0xadc3('0x3e')](_0x5e7979,_0x4492c8[_0x7ccce7]['orderBy']===_0xadc3('0x7a')?![]:!![]);_0xb9024a[_0xadc3('0x76')](_0x5e7979,_0x4492c8[_0x7ccce7][_0xadc3('0x7b')]||_0x5e7979);}if(_0x4695a5['joins']){_0x4695a5[_0xadc3('0x7c')]=JSON[_0xadc3('0x7d')](_0x4695a5[_0xadc3('0x7c')]);for(var _0x4424b7=0x0;_0x4424b7<_0x4695a5['joins'][_0xadc3('0x4b')];_0x4424b7+=0x1){if(_0x4695a5[_0xadc3('0x7c')][_0x4424b7]['type']&&_[_0xadc3('0x65')](_0x4db8b3,_0x4695a5[_0xadc3('0x7c')][_0x4424b7][_0xadc3('0x35')])&&_0x4695a5['joins'][_0x4424b7][_0xadc3('0x7e')]&&_0x4695a5['joins'][_0x4424b7]['foreignTable']&&_0x4695a5['joins'][_0x4424b7][_0xadc3('0x80')]){_0xb9024a[_0x4695a5[_0xadc3('0x7c')][_0x4424b7][_0xadc3('0x35')]](_0x4695a5[_0xadc3('0x7c')][_0x4424b7]['foreignTable'],null,util[_0xadc3('0x81')](_0xadc3('0x82'),_0x4695a5['table'],_0x4695a5[_0xadc3('0x7c')][_0x4424b7][_0xadc3('0x7e')],_0x4695a5[_0xadc3('0x7c')][_0x4424b7][_0xadc3('0x7f')],_0x4695a5[_0xadc3('0x7c')][_0x4424b7][_0xadc3('0x80')]));}}}if(_0x4695a5[_0xadc3('0x83')]){_0x4695a5[_0xadc3('0x83')]=JSON[_0xadc3('0x7d')](_0x4695a5[_0xadc3('0x83')]);_0xb9024a['where'](_0x199a1f(_0x4695a5[_0xadc3('0x83')][_0xadc3('0x6c')]));}_0x596a6a=_0xb9024a[_0xadc3('0x84')]();_0xb9024a[_0xadc3('0x21')](_0x3d775d);_0xb9024a[_0xadc3('0x20')](0x0);logger[_0xadc3('0x85')]('Limited\x20Query:',_0xb9024a[_0xadc3('0x9f')]());return dbH[_0xadc3('0x87')]['query'](_0xb9024a[_0xadc3('0x9f')](),{'type':dbH['sequelize'][_0xadc3('0x88')][_0xadc3('0x89')]});}})[_0xadc3('0x29')](function(){return{'sql':_0x596a6a[_0xadc3('0x9f')]()};})[_0xadc3('0x29')](respondWithResult(_0x171eed,null))[_0xadc3('0x48')](handleError(_0x171eed,null));};
\ No newline at end of file
+var _0x11fb=['save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','AnalyticCustomReport','rawAttributes','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','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','order','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','savename','COUNT(*)','SELECT','run','runReport','cross_join','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x11fb,0x131));var _0xb11f=function(_0x54957a,_0x2f0bcf){_0x54957a=_0x54957a-0x0;var _0x52d5d3=_0x11fb[_0x54957a];return _0x52d5d3;};'use strict';var emlformat=require(_0xb11f('0x0'));var rimraf=require(_0xb11f('0x1'));var zipdir=require(_0xb11f('0x2'));var jsonpatch=require(_0xb11f('0x3'));var rp=require(_0xb11f('0x4'));var moment=require(_0xb11f('0x5'));var BPromise=require(_0xb11f('0x6'));var Mustache=require(_0xb11f('0x7'));var util=require('util');var path=require(_0xb11f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb11f('0x9'));var fs=require('fs');var fs_extra=require(_0xb11f('0xa'));var _=require(_0xb11f('0xb'));var squel=require(_0xb11f('0xc'));var crypto=require(_0xb11f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb11f('0xe'));var toCsv=require(_0xb11f('0xf'));var querystring=require(_0xb11f('0x10'));var Papa=require(_0xb11f('0x11'));var Redis=require(_0xb11f('0x12'));var authService=require(_0xb11f('0x13'));var qs=require(_0xb11f('0x14'));var as=require(_0xb11f('0x15'));var hardwareService=require(_0xb11f('0x16'));var logger=require(_0xb11f('0x17'))(_0xb11f('0x18'));var utils=require(_0xb11f('0x19'));var config=require(_0xb11f('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb11f('0x1b'))['db'];var dbH=require(_0xb11f('0x1b'))[_0xb11f('0x1c')];function respondWithStatusCode(_0x5177ad,_0x40a2e3){_0x40a2e3=_0x40a2e3||0xcc;return function(_0x333360){if(_0x333360){return _0x5177ad[_0xb11f('0x1d')](_0x40a2e3);}return _0x5177ad[_0xb11f('0x1e')](_0x40a2e3)[_0xb11f('0x1f')]();};}function respondWithResult(_0x51e1c6,_0x193122){_0x193122=_0x193122||0xc8;return function(_0x2962e6){if(_0x2962e6){return _0x51e1c6[_0xb11f('0x1e')](_0x193122)[_0xb11f('0x20')](_0x2962e6);}};}function respondWithFilteredResult(_0x466f11,_0x15e48f){return function(_0x187a4f){if(_0x187a4f){var _0x3e4694=typeof _0x15e48f[_0xb11f('0x21')]===_0xb11f('0x22')&&typeof _0x15e48f[_0xb11f('0x23')]===_0xb11f('0x22');var _0x2dbb60=_0x187a4f[_0xb11f('0x24')];var _0x38df8b=_0x3e4694?0x0:_0x15e48f[_0xb11f('0x21')];var _0x14be34=_0x3e4694?_0x187a4f[_0xb11f('0x24')]:_0x15e48f[_0xb11f('0x21')]+_0x15e48f[_0xb11f('0x23')];var _0x317f53;if(_0x14be34>=_0x2dbb60){_0x14be34=_0x2dbb60;_0x317f53=0xc8;}else{_0x317f53=0xce;}_0x466f11[_0xb11f('0x1e')](_0x317f53);return _0x466f11['set'](_0xb11f('0x25'),_0x38df8b+'-'+_0x14be34+'/'+_0x2dbb60)[_0xb11f('0x20')](_0x187a4f);}return null;};}function patchUpdates(_0x3f1dd2){return function(_0x484c31){try{jsonpatch['apply'](_0x484c31,_0x3f1dd2,!![]);}catch(_0x4b13e3){return BPromise[_0xb11f('0x26')](_0x4b13e3);}return _0x484c31[_0xb11f('0x27')]();};}function saveUpdates(_0x2f11b9,_0x262bba){return function(_0x31d4e4){if(_0x31d4e4){return _0x31d4e4[_0xb11f('0x28')](_0x2f11b9)[_0xb11f('0x29')](function(_0x249ccb){return _0x249ccb;});}return null;};}function removeEntity(_0x2c5ad2,_0x21561e){return function(_0x2c42e1){if(_0x2c42e1){return _0x2c42e1[_0xb11f('0x2a')]()['then'](function(){var _0x31b137=_0x2c42e1['get']({'plain':!![]});var _0x4ccd02=_0xb11f('0x2b');return db[_0xb11f('0x2c')][_0xb11f('0x2a')]({'where':{'type':_0x4ccd02,'resourceId':_0x31b137['id']}})[_0xb11f('0x29')](function(){return _0x2c42e1;});})['then'](function(){_0x2c5ad2[_0xb11f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54be11,_0x14adf1){return function(_0x592c00){if(!_0x592c00){_0x54be11[_0xb11f('0x1d')](0x194);}return _0x592c00;};}function handleError(_0x3bb1a7,_0x5bd105){_0x5bd105=_0x5bd105||0x1f4;return function(_0x5113f8){logger[_0xb11f('0x2d')](_0x5113f8[_0xb11f('0x2e')]);if(_0x5113f8[_0xb11f('0x2f')]){delete _0x5113f8[_0xb11f('0x2f')];}_0x3bb1a7[_0xb11f('0x1e')](_0x5bd105)[_0xb11f('0x30')](_0x5113f8);};}exports['index']=function(_0x3b1d0f,_0x44f6ae){var _0x59efe7={},_0x59d8a9={},_0x4e7837={'count':0x0,'rows':[]};var _0x24a5dd=_[_0xb11f('0x31')](db['AnalyticCustomReport']['rawAttributes'],function(_0x4d63ef){return{'name':_0x4d63ef[_0xb11f('0x32')],'type':_0x4d63ef['type'][_0xb11f('0x33')]};});_0x59d8a9[_0xb11f('0x34')]=_[_0xb11f('0x31')](_0x24a5dd,_0xb11f('0x2f'));_0x59d8a9[_0xb11f('0x35')]=_[_0xb11f('0x36')](_0x3b1d0f[_0xb11f('0x35')]);_0x59d8a9['filters']=_[_0xb11f('0x37')](_0x59d8a9['model'],_0x59d8a9[_0xb11f('0x35')]);_0x59efe7[_0xb11f('0x38')]=_['intersection'](_0x59d8a9['model'],qs[_0xb11f('0x39')](_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x39')]));_0x59efe7[_0xb11f('0x38')]=_0x59efe7['attributes'][_0xb11f('0x3a')]?_0x59efe7[_0xb11f('0x38')]:_0x59d8a9[_0xb11f('0x34')];if(!_0x3b1d0f['query'][_0xb11f('0x3b')](_0xb11f('0x3c'))){_0x59efe7[_0xb11f('0x23')]=qs['limit'](_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x23')]);_0x59efe7[_0xb11f('0x21')]=qs[_0xb11f('0x21')](_0x3b1d0f[_0xb11f('0x35')]['offset']);}_0x59efe7['order']=qs[_0xb11f('0x3d')](_0x3b1d0f['query'][_0xb11f('0x3d')]);_0x59efe7[_0xb11f('0x3e')]=qs[_0xb11f('0x3f')](_[_0xb11f('0x40')](_0x3b1d0f[_0xb11f('0x35')],_0x59d8a9[_0xb11f('0x3f')]),_0x24a5dd);if(_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x41')]){_0x59efe7[_0xb11f('0x3e')]=_[_0xb11f('0x42')](_0x59efe7['where'],{'$or':_[_0xb11f('0x31')](_0x24a5dd,function(_0x2acac3){if(_0x2acac3[_0xb11f('0x43')]!==_0xb11f('0x44')){var _0x29c5e8={};_0x29c5e8[_0x2acac3[_0xb11f('0x2f')]]={'$like':'%'+_0x3b1d0f['query'][_0xb11f('0x41')]+'%'};return _0x29c5e8;}})});}_0x59efe7=_[_0xb11f('0x42')]({},_0x59efe7,_0x3b1d0f[_0xb11f('0x45')]);var _0x53051f={'where':_0x59efe7[_0xb11f('0x3e')]};return db['AnalyticCustomReport'][_0xb11f('0x24')](_0x53051f)['then'](function(_0x235091){_0x4e7837[_0xb11f('0x24')]=_0x235091;if(_0x3b1d0f[_0xb11f('0x35')][_0xb11f('0x46')]){_0x59efe7[_0xb11f('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xb11f('0x48')](_0x59efe7);})[_0xb11f('0x29')](function(_0x57206b){_0x4e7837[_0xb11f('0x49')]=_0x57206b;return _0x4e7837;})[_0xb11f('0x29')](respondWithFilteredResult(_0x44f6ae,_0x59efe7))[_0xb11f('0x4a')](handleError(_0x44f6ae,null));};exports[_0xb11f('0x4b')]=function(_0xd2cd95,_0x442b00){var _0x2212c4={'raw':![],'where':{'id':_0xd2cd95[_0xb11f('0x4c')]['id']}},_0x4baf4e={};_0x4baf4e['model']=_['keys'](db[_0xb11f('0x4d')][_0xb11f('0x4e')]);_0x4baf4e[_0xb11f('0x35')]=_[_0xb11f('0x36')](_0xd2cd95[_0xb11f('0x35')]);_0x4baf4e[_0xb11f('0x3f')]=_['intersection'](_0x4baf4e[_0xb11f('0x34')],_0x4baf4e[_0xb11f('0x35')]);_0x2212c4['attributes']=_[_0xb11f('0x37')](_0x4baf4e['model'],qs[_0xb11f('0x39')](_0xd2cd95[_0xb11f('0x35')][_0xb11f('0x39')]));_0x2212c4['attributes']=_0x2212c4[_0xb11f('0x38')]['length']?_0x2212c4[_0xb11f('0x38')]:_0x4baf4e[_0xb11f('0x34')];if(_0xd2cd95['query'][_0xb11f('0x46')]){_0x2212c4[_0xb11f('0x47')]=[{'all':!![]}];}_0x2212c4=_['merge']({},_0x2212c4,_0xd2cd95[_0xb11f('0x45')]);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x2212c4)[_0xb11f('0x29')](handleEntityNotFound(_0x442b00,null))[_0xb11f('0x29')](respondWithResult(_0x442b00,null))[_0xb11f('0x4a')](handleError(_0x442b00,null));};exports[_0xb11f('0x50')]=function(_0x351ee5,_0x2ce91e){return db[_0xb11f('0x4d')][_0xb11f('0x50')](_0x351ee5['body'],{})['then'](function(_0xf3cc2b){var _0x18eefb=_0x351ee5[_0xb11f('0x51')]['get']({'plain':!![]});if(!_0x18eefb)throw new Error(_0xb11f('0x52'));if(_0x18eefb[_0xb11f('0x53')]===_0xb11f('0x51')){var _0x1653e7=_0xf3cc2b['get']({'plain':!![]});var _0x492cef='Reports';return db[_0xb11f('0x54')][_0xb11f('0x4f')]({'where':{'name':_0x492cef,'userProfileId':_0x18eefb[_0xb11f('0x55')]},'raw':!![]})[_0xb11f('0x29')](function(_0x479815){if(_0x479815&&_0x479815[_0xb11f('0x56')]===0x0){return db['UserProfileResource'][_0xb11f('0x50')]({'name':_0x1653e7['name'],'resourceId':_0x1653e7['id'],'type':_0xb11f('0x2b'),'sectionId':_0x479815['id']},{})[_0xb11f('0x29')](function(){return _0xf3cc2b;});}else{return _0xf3cc2b;}})[_0xb11f('0x4a')](function(_0x5cb97f){logger[_0xb11f('0x2d')](_0xb11f('0x57'),_0x5cb97f);throw _0x5cb97f;});}return _0xf3cc2b;})['then'](respondWithResult(_0x2ce91e,0xc9))[_0xb11f('0x4a')](handleError(_0x2ce91e,null));};exports[_0xb11f('0x28')]=function(_0x3f032e,_0x593d17){if(_0x3f032e[_0xb11f('0x58')]['id']){delete _0x3f032e[_0xb11f('0x58')]['id'];}return db[_0xb11f('0x4d')][_0xb11f('0x4f')]({'where':{'id':_0x3f032e[_0xb11f('0x4c')]['id']}})[_0xb11f('0x29')](handleEntityNotFound(_0x593d17,null))[_0xb11f('0x29')](saveUpdates(_0x3f032e['body'],null))[_0xb11f('0x29')](respondWithResult(_0x593d17,null))[_0xb11f('0x4a')](handleError(_0x593d17,null));};exports[_0xb11f('0x2a')]=function(_0x3d8e8f,_0x1e2320){return db[_0xb11f('0x4d')][_0xb11f('0x4f')]({'where':{'id':_0x3d8e8f[_0xb11f('0x4c')]['id']}})[_0xb11f('0x29')](handleEntityNotFound(_0x1e2320,null))[_0xb11f('0x29')](removeEntity(_0x1e2320,null))['catch'](handleError(_0x1e2320,null));};exports[_0xb11f('0x59')]=function(_0x25ec45,_0x9fa56f){var _0x34421b=0xa;var _0x5e5dbb=[_0xb11f('0x5a'),'left_join',_0xb11f('0x5b'),'cross_join'];var _0x5a1eef={'SUM':_0xb11f('0x5c'),'COUNT':_0xb11f('0x5d'),'COUNT DISTINCT':_0xb11f('0x5e'),'MAX':_0xb11f('0x5f'),'MIN':_0xb11f('0x60'),'AVG':_0xb11f('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb11f('0x62')};var _0x3d9b24={'SEC_TO_TIME':_0xb11f('0x63'),'DATE':_0xb11f('0x64'),'HOUR':_0xb11f('0x65'),'ROUND':_0xb11f('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1985ad=function(_0x26174a){return!_[_0xb11f('0x67')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb11f('0x68'),'IS\x20NOT\x20EMPTY'],_0x26174a);};var _0x340531=function(_0xaf67f){if(!_0xaf67f||!_0xaf67f[_0xb11f('0x69')][_0xb11f('0x3a')]){return'';}for(var _0x4997fc='(',_0x49fc47=0x0;_0x49fc47<_0xaf67f['rules'][_0xb11f('0x3a')];_0x49fc47+=0x1){_0x49fc47>0x0&&(_0x4997fc+='\x20'+_0xaf67f[_0xb11f('0x6a')]+'\x20');_0x4997fc+=_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6b')]?_0x340531(_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6b')]):_0xaf67f[_0xb11f('0x69')][_0x49fc47]['field']+'\x20'+_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6c')]+(_0x1985ad(_0xaf67f[_0xb11f('0x69')][_0x49fc47][_0xb11f('0x6c')])?'\x20'+_0xaf67f['rules'][_0x49fc47][_0xb11f('0x6d')]:'');}return _0x4997fc+')';};var _0x314fa1={'where':{'id':_0x25ec45['params']['id']}},_0x3f7f96,_0x40692a,_0x56f0ad,_0x1cebe0,_0x4202b9;_0x314fa1=_[_0xb11f('0x42')]({},_0x314fa1,_0x25ec45[_0xb11f('0x45')]);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x314fa1)[_0xb11f('0x29')](function(_0x55ea29){if(_0x55ea29){_0x3f7f96=_0x55ea29;return _0x55ea29[_0xb11f('0x6e')]();}return null;})[_0xb11f('0x29')](function(_0x14db42){if(_0x14db42){if(!_0x14db42[_0xb11f('0x3a')]){throw new db[(_0xb11f('0x6f'))][(_0xb11f('0x70'))](_0xb11f('0x71'),0x193);}_0x40692a=_0x14db42;return db[_0xb11f('0x72')][_0xb11f('0x48')]({'raw':!![]});}return null;})[_0xb11f('0x29')](function(_0x34dd7e){if(_0x34dd7e){_0x56f0ad=_[_0xb11f('0x73')](_0x34dd7e,'id');var _0x5bd649;var _0x408b24=squel[_0xb11f('0x74')]();_0x408b24[_0xb11f('0x75')](_0x3f7f96[_0xb11f('0x76')]);for(var _0x3284f6=0x0;_0x3284f6<_0x40692a['length'];_0x3284f6+=0x1){_0x5bd649=_0x40692a[_0x3284f6][_0xb11f('0x77')]?_0x56f0ad[_0x40692a[_0x3284f6]['MetricId']][_0xb11f('0x78')]:_0x40692a[_0x3284f6][_0xb11f('0x79')];_0x5bd649=_0x40692a[_0x3284f6][_0xb11f('0x7a')]?_[_0xb11f('0x7b')](_0x5a1eef[_0x40692a[_0x3284f6][_0xb11f('0x7a')]],'%s',_0x5bd649):_0x5bd649;_0x5bd649=_0x40692a[_0x3284f6][_0xb11f('0x7c')]?_[_0xb11f('0x7b')](_0x3d9b24[_0x40692a[_0x3284f6][_0xb11f('0x7c')]],'%s',_0x5bd649):_0x5bd649;if(_0x40692a[_0x3284f6][_0xb11f('0x7d')]){_0x408b24[_0xb11f('0x6b')](_0x5bd649);}_0x40692a[_0x3284f6][_0xb11f('0x7e')]&&_0x408b24[_0xb11f('0x7f')](_0x5bd649,_0x40692a[_0x3284f6]['orderBy']==='DESC'?![]:!![]);_0x408b24[_0xb11f('0x79')](_0x5bd649,_0x40692a[_0x3284f6][_0xb11f('0x80')]||_0x5bd649);}if(_0x3f7f96[_0xb11f('0x81')]){_0x3f7f96['joins']=JSON[_0xb11f('0x82')](_0x3f7f96[_0xb11f('0x81')]);for(var _0x472f09=0x0;_0x472f09<_0x3f7f96['joins'][_0xb11f('0x3a')];_0x472f09+=0x1){if(_0x3f7f96['joins'][_0x472f09][_0xb11f('0x43')]&&_['includes'](_0x5e5dbb,_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x43')])&&_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x83')]&&_0x3f7f96[_0xb11f('0x81')][_0x472f09]['foreignTable']&&_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x84')]){_0x408b24[_0x3f7f96[_0xb11f('0x81')][_0x472f09]['type']](_0x3f7f96['joins'][_0x472f09]['foreignTable'],null,util[_0xb11f('0x7c')]('%s.%s\x20=\x20%s.%s',_0x3f7f96['table'],_0x3f7f96[_0xb11f('0x81')][_0x472f09]['parentKey'],_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x85')],_0x3f7f96[_0xb11f('0x81')][_0x472f09][_0xb11f('0x84')]));}}}if(_0x3f7f96[_0xb11f('0x86')]){_0x3f7f96[_0xb11f('0x86')]=JSON[_0xb11f('0x82')](_0x3f7f96[_0xb11f('0x86')]);_0x408b24[_0xb11f('0x3e')](_0x340531(_0x3f7f96[_0xb11f('0x86')][_0xb11f('0x6b')]));}_0x4202b9=_0x408b24['clone']();_0x408b24[_0xb11f('0x23')](_0x34421b);_0x408b24['offset'](0x0);logger[_0xb11f('0x87')](_0xb11f('0x88'),_0x408b24['toString']());return dbH[_0xb11f('0x89')]['query'](_0x408b24[_0xb11f('0x8a')](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')]['SELECT']});}})[_0xb11f('0x29')](respondWithResult(_0x9fa56f,null))[_0xb11f('0x4a')](handleError(_0x9fa56f,null));};function runReport(_0x145462,_0x3f860e,_0x4a46f4){var _0x5757e7=_0x3f860e[_0xb11f('0x2f')];var _0x398ebf=0xa;var _0x19f64a=[_0xb11f('0x5a'),_0xb11f('0x8c'),_0xb11f('0x5b'),'cross_join'];var _0x454310={'SUM':_0xb11f('0x5c'),'COUNT':_0xb11f('0x5d'),'COUNT DISTINCT':_0xb11f('0x5e'),'MAX':_0xb11f('0x5f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xb11f('0x8d'),'GROUP_CONCAT ASC':_0xb11f('0x8e'),'GROUP_CONCAT DESC':_0xb11f('0x62')};var _0x1dc041={'SEC_TO_TIME':_0xb11f('0x63'),'DATE':_0xb11f('0x64'),'HOUR':_0xb11f('0x65'),'ROUND':_0xb11f('0x66'),'UNIX_TIMESTAMP':_0xb11f('0x8f')};var _0x2fac8e=function(_0x10b162){return!_[_0xb11f('0x67')]([_0xb11f('0x90'),_0xb11f('0x91'),_0xb11f('0x68'),_0xb11f('0x92')],_0x10b162);};var _0x7f8c97=function(_0x15780b){if(!_0x15780b||!_0x15780b[_0xb11f('0x69')][_0xb11f('0x3a')]){return'';}for(var _0x2ace1f='(',_0x1ef2b1=0x0;_0x1ef2b1<_0x15780b[_0xb11f('0x69')][_0xb11f('0x3a')];_0x1ef2b1+=0x1){_0x1ef2b1>0x0&&(_0x2ace1f+='\x20'+_0x15780b[_0xb11f('0x6a')]+'\x20');_0x2ace1f+=_0x15780b[_0xb11f('0x69')][_0x1ef2b1][_0xb11f('0x6b')]?_0x7f8c97(_0x15780b['rules'][_0x1ef2b1]['group']):_0x15780b[_0xb11f('0x69')][_0x1ef2b1]['field']+'\x20'+_0x15780b[_0xb11f('0x69')][_0x1ef2b1][_0xb11f('0x6c')]+(_0x2fac8e(_0x15780b[_0xb11f('0x69')][_0x1ef2b1]['condition'])?'\x20'+_0x15780b[_0xb11f('0x69')][_0x1ef2b1]['value']:'');}return _0x2ace1f+')';};var _0x58b5f5={'where':{'id':_0x145462['id']}},_0x4b28c2,_0x39035c,_0x3527af,_0x33df96,_0x2ab825;_0x58b5f5=_['merge']({},_0x58b5f5,_0x4a46f4);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x58b5f5)[_0xb11f('0x29')](function(_0x363424){if(_0x363424){_0x4b28c2=_0x363424;return _0x363424[_0xb11f('0x6e')]();}return null;})[_0xb11f('0x29')](function(_0xa10855){if(_0xa10855){if(!_0xa10855[_0xb11f('0x3a')]){throw new db[(_0xb11f('0x6f'))][(_0xb11f('0x70'))](_0xb11f('0x71'),0x193);}_0x39035c=_0xa10855;return db[_0xb11f('0x72')]['findAll']({'raw':!![]});}return null;})[_0xb11f('0x29')](function(_0x2bc50a){if(_0x2bc50a){_0x3527af=_[_0xb11f('0x73')](_0x2bc50a,'id');var _0x15fadb;var _0x101ac4=squel[_0xb11f('0x74')]();_0x101ac4[_0xb11f('0x75')](_0x4b28c2[_0xb11f('0x76')]);for(var _0x19d190=0x0;_0x19d190<_0x39035c[_0xb11f('0x3a')];_0x19d190+=0x1){_0x15fadb=_0x39035c[_0x19d190][_0xb11f('0x77')]?_0x3527af[_0x39035c[_0x19d190][_0xb11f('0x77')]][_0xb11f('0x78')]:_0x39035c[_0x19d190]['field'];_0x15fadb=_0x39035c[_0x19d190][_0xb11f('0x7a')]?_['replace'](_0x454310[_0x39035c[_0x19d190][_0xb11f('0x7a')]],'%s',_0x15fadb):_0x15fadb;_0x15fadb=_0x39035c[_0x19d190][_0xb11f('0x7c')]?_['replace'](_0x1dc041[_0x39035c[_0x19d190][_0xb11f('0x7c')]],'%s',_0x15fadb):_0x15fadb;if(_0x39035c[_0x19d190][_0xb11f('0x7d')]){_0x101ac4[_0xb11f('0x6b')](_0x15fadb);}_0x39035c[_0x19d190][_0xb11f('0x7e')]&&_0x101ac4[_0xb11f('0x7f')](_0x15fadb,_0x39035c[_0x19d190][_0xb11f('0x7e')]==='DESC'?![]:!![]);_0x101ac4[_0xb11f('0x79')](_0x15fadb,_0x39035c[_0x19d190][_0xb11f('0x80')]||_0x15fadb);}if(_0x4b28c2[_0xb11f('0x81')]){_0x4b28c2[_0xb11f('0x81')]=JSON[_0xb11f('0x82')](_0x4b28c2[_0xb11f('0x81')]);for(var _0x5f522f=0x0;_0x5f522f<_0x4b28c2[_0xb11f('0x81')][_0xb11f('0x3a')];_0x5f522f+=0x1){if(_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x43')]&&_[_0xb11f('0x67')](_0x19f64a,_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x43')])&&_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x83')]&&_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x85')]&&_0x4b28c2['joins'][_0x5f522f][_0xb11f('0x84')]){_0x101ac4[_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x43')]](_0x4b28c2[_0xb11f('0x81')][_0x5f522f]['foreignTable'],null,util['format'](_0xb11f('0x93'),_0x4b28c2[_0xb11f('0x76')],_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x83')],_0x4b28c2[_0xb11f('0x81')][_0x5f522f]['foreignTable'],_0x4b28c2[_0xb11f('0x81')][_0x5f522f][_0xb11f('0x84')]));}}}if(_0x4b28c2['conditions']){_0x4b28c2[_0xb11f('0x86')]=JSON[_0xb11f('0x82')](_0x4b28c2[_0xb11f('0x86')]);_0x101ac4[_0xb11f('0x3e')](_0x7f8c97(_0x4b28c2['conditions'][_0xb11f('0x6b')]));}_0x2ab825=_0x101ac4[_0xb11f('0x94')]();_0x101ac4[_0xb11f('0x23')](_0x398ebf);_0x101ac4['offset'](0x0);return;}})['then'](function(){if(_0x3f860e[_0xb11f('0x95')]===_0xb11f('0x96')){return null;}var _0x38b26f=_['merge'](_0x3f860e,{'name':_0x3f860e[_0xb11f('0x97')]||_0x3f860e['name']||_0x4b28c2['name'],'basename':_0x5757e7,'savename':util['format'](_0xb11f('0x98'),_0x3f860e[_0xb11f('0x2f')]||_0x4b28c2[_0xb11f('0x2f')],require(_0xb11f('0x99'))[_0xb11f('0x9a')](0x4),_0x3f860e['output']||_0xb11f('0x9b')),'reportId':_0x4b28c2['id'],'reportType':_0xb11f('0x9c')});return db[_0xb11f('0x9d')][_0xb11f('0x50')](_0x38b26f,{'raw':!![]});})['then'](function(_0x105c96){if(_0x4b28c2[_0xb11f('0x76')]==='cdr'){_0x2ab825[_0xb11f('0x3e')](_0x4b28c2[_0xb11f('0x76')]+_0xb11f('0x9e'),_0x3f860e[_0xb11f('0x9f')],_0x3f860e[_0xb11f('0xa0')]);}else{_0x2ab825['where'](_0x4b28c2[_0xb11f('0x76')]+_0xb11f('0xa1'),_0x3f860e[_0xb11f('0x9f')],_0x3f860e[_0xb11f('0xa0')]);}if(_0x105c96){logger[_0xb11f('0xa2')](_0xb11f('0xa3'),_0x2ab825[_0xb11f('0x8a')]());require(_0xb11f('0xa4'))['fork'](path[_0xb11f('0x5a')](__dirname,'../../components/export/',_0x105c96['output']),[_0x105c96['id'],_0x2ab825['toString'](),path[_0xb11f('0x5a')](__dirname,'../../files/reports',_0x105c96[_0xb11f('0xa5')]),_0x5757e7]);return _0x105c96;}else{var _0x16dfb9=squel['select']();_0x16dfb9['from']('('+_0x2ab825[_0xb11f('0x8a')]()+')','countTable');_0x16dfb9[_0xb11f('0x79')](_0xb11f('0xa6'),_0xb11f('0x24'));_0x2ab825[_0xb11f('0x23')](_0x3f860e[_0xb11f('0x23')]||_0x398ebf);_0x2ab825['offset'](_0x3f860e[_0xb11f('0x21')]||0x0);return dbH[_0xb11f('0x89')][_0xb11f('0x35')](_0x16dfb9[_0xb11f('0x8a')](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')]['SELECT']})[_0xb11f('0x29')](function(_0xb1b446){if(!_0xb1b446[_0xb11f('0x3a')]){_0x33df96=0x0;}else{_0x33df96=_0xb1b446[0x0]['count']||0x0;}return dbH['sequelize'][_0xb11f('0x35')](_0x2ab825[_0xb11f('0x8a')](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')][_0xb11f('0xa7')]});})[_0xb11f('0x29')](function(_0x4c6ea3){return{'rows':_0x4c6ea3||[],'count':_0x33df96};});}});}exports[_0xb11f('0xa8')]=function(_0x3d3b8a,_0x39566d){return runReport(_0x3d3b8a[_0xb11f('0x4c')],_0x3d3b8a[_0xb11f('0x35')],_0x3d3b8a['options'])[_0xb11f('0x29')](respondWithResult(_0x39566d,null))[_0xb11f('0x4a')](handleError(_0x39566d,null));};exports[_0xb11f('0xa9')]=runReport;exports['query']=function(_0x26f696,_0x3f1bfb){var _0x1f6011=0xa;var _0x36c97f=['join','left_join',_0xb11f('0x5b'),_0xb11f('0xaa')];var _0x48e2f5={'SUM':_0xb11f('0x5c'),'COUNT':_0xb11f('0x5d'),'COUNT DISTINCT':_0xb11f('0x5e'),'MAX':_0xb11f('0x5f'),'MIN':_0xb11f('0x60'),'AVG':_0xb11f('0x61'),'GROUP_CONCAT':_0xb11f('0x8d'),'GROUP_CONCAT ASC':_0xb11f('0x8e'),'GROUP_CONCAT DESC':_0xb11f('0x62')};var _0x3ffe4c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb11f('0x64'),'HOUR':_0xb11f('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb11f('0x8f')};var _0x1def94=function(_0x4829c3){return!_[_0xb11f('0x67')]([_0xb11f('0x90'),_0xb11f('0x91'),_0xb11f('0x68'),'IS\x20NOT\x20EMPTY'],_0x4829c3);};var _0x3aa1dd=function(_0x3f0ece){if(!_0x3f0ece||!_0x3f0ece[_0xb11f('0x69')][_0xb11f('0x3a')]){return'';}for(var _0x583ee7='(',_0x5e15da=0x0;_0x5e15da<_0x3f0ece[_0xb11f('0x69')][_0xb11f('0x3a')];_0x5e15da+=0x1){_0x5e15da>0x0&&(_0x583ee7+='\x20'+_0x3f0ece[_0xb11f('0x6a')]+'\x20');_0x583ee7+=_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6b')]?_0x3aa1dd(_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6b')]):_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x79')]+'\x20'+_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6c')]+(_0x1def94(_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6c')])?'\x20'+_0x3f0ece[_0xb11f('0x69')][_0x5e15da][_0xb11f('0x6d')]:'');}return _0x583ee7+')';};var _0x265410={'where':{'id':_0x26f696[_0xb11f('0x4c')]['id']}},_0x2d0970,_0x46eb9a,_0x41c4e1,_0x5a79a3,_0x2106dd;_0x265410=_[_0xb11f('0x42')]({},_0x265410,_0x26f696[_0xb11f('0x45')]);return db[_0xb11f('0x4d')][_0xb11f('0x4f')](_0x265410)[_0xb11f('0x29')](function(_0x240f64){if(_0x240f64){_0x2d0970=_0x240f64;return _0x240f64[_0xb11f('0x6e')]();}return null;})['then'](function(_0x23875a){if(_0x23875a){if(!_0x23875a[_0xb11f('0x3a')]){throw new db['Sequelize'][(_0xb11f('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x46eb9a=_0x23875a;return db[_0xb11f('0x72')][_0xb11f('0x48')]({'raw':!![]});}return null;})[_0xb11f('0x29')](function(_0x241a71){if(_0x241a71){_0x41c4e1=_[_0xb11f('0x73')](_0x241a71,'id');var _0x44298;var _0x2ff93e=squel[_0xb11f('0x74')]();_0x2ff93e[_0xb11f('0x75')](_0x2d0970[_0xb11f('0x76')]);for(var _0x47cfa2=0x0;_0x47cfa2<_0x46eb9a['length'];_0x47cfa2+=0x1){_0x44298=_0x46eb9a[_0x47cfa2][_0xb11f('0x77')]?_0x41c4e1[_0x46eb9a[_0x47cfa2][_0xb11f('0x77')]][_0xb11f('0x78')]:_0x46eb9a[_0x47cfa2][_0xb11f('0x79')];_0x44298=_0x46eb9a[_0x47cfa2]['function']?_['replace'](_0x48e2f5[_0x46eb9a[_0x47cfa2]['function']],'%s',_0x44298):_0x44298;_0x44298=_0x46eb9a[_0x47cfa2][_0xb11f('0x7c')]?_[_0xb11f('0x7b')](_0x3ffe4c[_0x46eb9a[_0x47cfa2][_0xb11f('0x7c')]],'%s',_0x44298):_0x44298;if(_0x46eb9a[_0x47cfa2][_0xb11f('0x7d')]){_0x2ff93e[_0xb11f('0x6b')](_0x44298);}_0x46eb9a[_0x47cfa2][_0xb11f('0x7e')]&&_0x2ff93e[_0xb11f('0x7f')](_0x44298,_0x46eb9a[_0x47cfa2][_0xb11f('0x7e')]===_0xb11f('0xab')?![]:!![]);_0x2ff93e['field'](_0x44298,_0x46eb9a[_0x47cfa2][_0xb11f('0x80')]||_0x44298);}if(_0x2d0970[_0xb11f('0x81')]){_0x2d0970[_0xb11f('0x81')]=JSON[_0xb11f('0x82')](_0x2d0970[_0xb11f('0x81')]);for(var _0x198c5a=0x0;_0x198c5a<_0x2d0970[_0xb11f('0x81')][_0xb11f('0x3a')];_0x198c5a+=0x1){if(_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x43')]&&_['includes'](_0x36c97f,_0x2d0970['joins'][_0x198c5a][_0xb11f('0x43')])&&_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x83')]&&_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x85')]&&_0x2d0970['joins'][_0x198c5a][_0xb11f('0x84')]){_0x2ff93e[_0x2d0970['joins'][_0x198c5a][_0xb11f('0x43')]](_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x85')],null,util[_0xb11f('0x7c')](_0xb11f('0x93'),_0x2d0970[_0xb11f('0x76')],_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x83')],_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x85')],_0x2d0970[_0xb11f('0x81')][_0x198c5a][_0xb11f('0x84')]));}}}if(_0x2d0970[_0xb11f('0x86')]){_0x2d0970[_0xb11f('0x86')]=JSON[_0xb11f('0x82')](_0x2d0970[_0xb11f('0x86')]);_0x2ff93e['where'](_0x3aa1dd(_0x2d0970['conditions'][_0xb11f('0x6b')]));}_0x2106dd=_0x2ff93e[_0xb11f('0x94')]();_0x2ff93e[_0xb11f('0x23')](_0x1f6011);_0x2ff93e['offset'](0x0);logger[_0xb11f('0x87')](_0xb11f('0x88'),_0x2ff93e['toString']());return dbH[_0xb11f('0x89')][_0xb11f('0x35')](_0x2ff93e['toString'](),{'type':dbH[_0xb11f('0x89')][_0xb11f('0x8b')]['SELECT']});}})[_0xb11f('0x29')](function(){return{'sql':_0x2106dd['toString']()};})['then'](respondWithResult(_0x3f1bfb,null))[_0xb11f('0x4a')](handleError(_0x3f1bfb,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index bd373e3..8c41add 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 _0x6232=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','lodash'];(function(_0x4693b7,_0xdc6f8a){var _0x23fba2=function(_0x35d758){while(--_0x35d758){_0x4693b7['push'](_0x4693b7['shift']());}};_0x23fba2(++_0xdc6f8a);}(_0x6232,0x16a));var _0x2623=function(_0x345f35,_0x354c87){_0x345f35=_0x345f35-0x0;var _0x457ec4=_0x6232[_0x345f35];return _0x457ec4;};'use strict';var _=require(_0x2623('0x0'));var util=require('util');var logger=require(_0x2623('0x1'))(_0x2623('0x2'));var moment=require('moment');var BPromise=require(_0x2623('0x3'));var rp=require(_0x2623('0x4'));var fs=require('fs');var path=require(_0x2623('0x5'));var rimraf=require(_0x2623('0x6'));var config=require(_0x2623('0x7'));var attributes=require(_0x2623('0x8'));module[_0x2623('0x9')]=function(_0x53bfa5,_0x53987b){return _0x53bfa5[_0x2623('0xa')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda7b=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x23fc4b,_0x2602f8){var _0x9d10c1=function(_0x14096b){while(--_0x14096b){_0x23fc4b['push'](_0x23fc4b['shift']());}};_0x9d10c1(++_0x2602f8);}(_0xda7b,0x1f3));var _0xbda7=function(_0x4bfd80,_0x34ce14){_0x4bfd80=_0x4bfd80-0x0;var _0x920c6c=_0xda7b[_0x4bfd80];return _0x920c6c;};'use strict';var _=require(_0xbda7('0x0'));var util=require('util');var logger=require(_0xbda7('0x1'))('api');var moment=require(_0xbda7('0x2'));var BPromise=require(_0xbda7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbda7('0x4'));var rimraf=require(_0xbda7('0x5'));var config=require(_0xbda7('0x6'));var attributes=require(_0xbda7('0x7'));module[_0xbda7('0x8')]=function(_0x2fa8d3,_0x1ff07c){return _0x2fa8d3[_0xbda7('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xbda7('0xa'),'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 010bac8..b85feef 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 _0x612e=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x612e,0xfc));var _0xe612=function(_0x19cebc,_0x1d886b){_0x19cebc=_0x19cebc-0x0;var _0x5f0441=_0x612e[_0x19cebc];return _0x5f0441;};'use strict';var _=require(_0xe612('0x0'));var util=require('util');var moment=require(_0xe612('0x1'));var BPromise=require(_0xe612('0x2'));var rs=require(_0xe612('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe612('0x4'))['db'];var utils=require(_0xe612('0x5'));var logger=require(_0xe612('0x6'))(_0xe612('0x7'));var config=require(_0xe612('0x8'));var jayson=require(_0xe612('0x9'));var client=jayson[_0xe612('0xa')][_0xe612('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x323688,_0x409145,_0x4e55d6){return new BPromise(function(_0x5156fb,_0x365553){return client[_0xe612('0xc')](_0x323688,_0x4e55d6)[_0xe612('0xd')](function(_0x55be4c){logger[_0xe612('0xe')](_0xe612('0xf'),_0x409145,_0xe612('0x10'));logger['debug'](_0xe612('0x11'),_0x409145,'request\x20sent',JSON[_0xe612('0x12')](_0x55be4c));if(_0x55be4c[_0xe612('0x13')]){if(_0x55be4c[_0xe612('0x13')][_0xe612('0x14')]===0x1f4){logger[_0xe612('0x13')](_0xe612('0xf'),_0x409145,_0x55be4c[_0xe612('0x13')]['message']);return _0x365553(_0x55be4c[_0xe612('0x13')][_0xe612('0x15')]);}logger[_0xe612('0x13')](_0xe612('0xf'),_0x409145,_0x55be4c['error'][_0xe612('0x15')]);return _0x5156fb(_0x55be4c[_0xe612('0x13')][_0xe612('0x15')]);}else{logger[_0xe612('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x409145,_0xe612('0x10'));_0x5156fb(_0x55be4c[_0xe612('0x16')]['message']);}})[_0xe612('0x17')](function(_0x10c8d9){logger[_0xe612('0x13')](_0xe612('0xf'),_0x409145,_0x10c8d9);_0x365553(_0x10c8d9);});});}
\ No newline at end of file
+var _0x91c5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x91c5,0x1ae));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x591c('0x0'));var util=require(_0x591c('0x1'));var moment=require('moment');var BPromise=require(_0x591c('0x2'));var rs=require(_0x591c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x591c('0x4'))['db'];var utils=require(_0x591c('0x5'));var logger=require(_0x591c('0x6'))(_0x591c('0x7'));var config=require(_0x591c('0x8'));var jayson=require(_0x591c('0x9'));var client=jayson[_0x591c('0xa')][_0x591c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53b554,_0xba6cfe,_0x1e2569){return new BPromise(function(_0x3888bc,_0x496def){return client[_0x591c('0xc')](_0x53b554,_0x1e2569)[_0x591c('0xd')](function(_0x8ffeb1){logger[_0x591c('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xba6cfe,_0x591c('0xf'));logger[_0x591c('0x10')](_0x591c('0x11'),_0xba6cfe,_0x591c('0xf'),JSON['stringify'](_0x8ffeb1));if(_0x8ffeb1[_0x591c('0x12')]){if(_0x8ffeb1[_0x591c('0x12')][_0x591c('0x13')]===0x1f4){logger['error'](_0x591c('0x14'),_0xba6cfe,_0x8ffeb1['error'][_0x591c('0x15')]);return _0x496def(_0x8ffeb1[_0x591c('0x12')][_0x591c('0x15')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xba6cfe,_0x8ffeb1[_0x591c('0x12')][_0x591c('0x15')]);return _0x3888bc(_0x8ffeb1[_0x591c('0x12')][_0x591c('0x15')]);}else{logger['info'](_0x591c('0x14'),_0xba6cfe,_0x591c('0xf'));_0x3888bc(_0x8ffeb1[_0x591c('0x16')]['message']);}})[_0x591c('0x17')](function(_0x355469){logger[_0x591c('0x12')](_0x591c('0x14'),_0xba6cfe,_0x355469);_0x496def(_0x355469);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index de3b483..36b48d1 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 _0xb925=['get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x16724a,_0x403ef8){var _0x1df0ae=function(_0x30974d){while(--_0x30974d){_0x16724a['push'](_0x16724a['shift']());}};_0x1df0ae(++_0x403ef8);}(_0xb925,0x6f));var _0x5b92=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xb925[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0x5b92('0x0'));var util=require(_0x5b92('0x1'));var path=require(_0x5b92('0x2'));var timeout=require(_0x5b92('0x3'));var express=require(_0x5b92('0x4'));var router=express[_0x5b92('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5b92('0x6'));var interaction=require(_0x5b92('0x7'));var config=require(_0x5b92('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x5b92('0x9')]('/',auth[_0x5b92('0xa')](),controller[_0x5b92('0xb')]);router[_0x5b92('0x9')](_0x5b92('0xc'),auth[_0x5b92('0xa')](),controller['show']);router[_0x5b92('0x9')](_0x5b92('0xd'),auth[_0x5b92('0xa')](),controller[_0x5b92('0xe')]);router[_0x5b92('0x9')](_0x5b92('0xf'),auth['isAuthenticated'](),controller[_0x5b92('0x10')]);router['get'](_0x5b92('0x11'),auth[_0x5b92('0xa')](),controller[_0x5b92('0x12')]);router['post']('/',auth[_0x5b92('0xa')](),controller['create']);router[_0x5b92('0x13')](_0x5b92('0xc'),auth[_0x5b92('0xa')](),controller[_0x5b92('0x14')]);router[_0x5b92('0x15')](_0x5b92('0xc'),auth[_0x5b92('0xa')](),controller[_0x5b92('0x16')]);module[_0x5b92('0x17')]=router;
\ No newline at end of file
+var _0x90e0=['/:id/preview','preview','/:id/run','/:id/query','query','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show'];(function(_0xa787cb,_0x1b48c7){var _0x5964f8=function(_0x390d65){while(--_0x390d65){_0xa787cb['push'](_0xa787cb['shift']());}};_0x5964f8(++_0x1b48c7);}(_0x90e0,0x153));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x090e('0x0'));var util=require(_0x090e('0x1'));var path=require('path');var timeout=require(_0x090e('0x2'));var express=require(_0x090e('0x3'));var router=express[_0x090e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x090e('0x5'));var config=require(_0x090e('0x6'));var controller=require(_0x090e('0x7'));router['get']('/',auth[_0x090e('0x8')](),controller[_0x090e('0x9')]);router[_0x090e('0xa')](_0x090e('0xb'),auth[_0x090e('0x8')](),controller[_0x090e('0xc')]);router[_0x090e('0xa')](_0x090e('0xd'),auth[_0x090e('0x8')](),controller[_0x090e('0xe')]);router['get'](_0x090e('0xf'),auth[_0x090e('0x8')](),controller['run']);router[_0x090e('0xa')](_0x090e('0x10'),auth['isAuthenticated'](),controller[_0x090e('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x090e('0x12')](_0x090e('0xb'),auth['isAuthenticated'](),controller[_0x090e('0x13')]);router[_0x090e('0x14')](_0x090e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x090e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 63a70ab..2b2a457 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x14d233,_0x4289f7){var _0x2d4c76=function(_0x29ef14){while(--_0x29ef14){_0x14d233['push'](_0x14d233['shift']());}};_0x2d4c76(++_0x4289f7);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1b9f81,_0x3b6131){_0x1b9f81=_0x1b9f81-0x0;var _0x1c64e4=_0x3eea[_0x1b9f81];return _0x1c64e4;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x46ed,0x168));var _0xd46e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x46ed[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index cbfcde3..c8a9ed0 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 _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0x534fb9,_0x466466){_0x534fb9=_0x534fb9-0x0;var _0x57d679=_0x687b[_0x534fb9];return _0x57d679;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));};
\ No newline at end of file
+var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x5b9168,_0x203c8a){var _0x1c8403=function(_0x59b381){while(--_0x59b381){_0x5b9168['push'](_0x5b9168['shift']());}};_0x1c8403(++_0x203c8a);}(_0xba34,0x119));var _0x4ba3=function(_0x55a269,_0x3be6d9){_0x55a269=_0x55a269-0x0;var _0x29968a=_0xba34[_0x55a269];return _0x29968a;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index eb66b13..cb0345e 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 _0x62a5=['analytics_default_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x62a5,0x1d5));var _0x562a=function(_0x3b8c1e,_0x2e5b4b){_0x3b8c1e=_0x3b8c1e-0x0;var _0x41116b=_0x62a5[_0x3b8c1e];return _0x41116b;};'use strict';var _=require(_0x562a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x562a('0x1'));var moment=require(_0x562a('0x2'));var BPromise=require(_0x562a('0x3'));var rp=require(_0x562a('0x4'));var fs=require('fs');var path=require(_0x562a('0x5'));var rimraf=require(_0x562a('0x6'));var config=require(_0x562a('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x562a('0x8')]=function(_0x47b23f,_0x2fb1ed){return _0x47b23f[_0x562a('0x9')](_0x562a('0xa'),attributes,{'tableName':_0x562a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb1f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x4f0dc8,_0xb40b72){var _0x240785=function(_0x590c2d){while(--_0x590c2d){_0x4f0dc8['push'](_0x4f0dc8['shift']());}};_0x240785(++_0xb40b72);}(_0xdb1f,0x128));var _0xfdb1=function(_0x34b7e0,_0x2f90f2){_0x34b7e0=_0x34b7e0-0x0;var _0x320937=_0xdb1f[_0x34b7e0];return _0x320937;};'use strict';var _=require(_0xfdb1('0x0'));var util=require(_0xfdb1('0x1'));var logger=require(_0xfdb1('0x2'))('api');var moment=require(_0xfdb1('0x3'));var BPromise=require(_0xfdb1('0x4'));var rp=require(_0xfdb1('0x5'));var fs=require('fs');var path=require(_0xfdb1('0x6'));var rimraf=require(_0xfdb1('0x7'));var config=require(_0xfdb1('0x8'));var attributes=require(_0xfdb1('0x9'));module[_0xfdb1('0xa')]=function(_0x3aff69,_0x423aab){return _0x3aff69[_0xfdb1('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xfdb1('0xc'),'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 e8a127d..4ffc9ca 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 _0xf9e2=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x126f47,_0x2199e9){var _0x49508a=function(_0x20ba36){while(--_0x20ba36){_0x126f47['push'](_0x126f47['shift']());}};_0x49508a(++_0x2199e9);}(_0xf9e2,0x16f));var _0x2f9e=function(_0x352605,_0x1472ac){_0x352605=_0x352605-0x0;var _0x2d1220=_0xf9e2[_0x352605];return _0x2d1220;};'use strict';var _=require('lodash');var util=require(_0x2f9e('0x0'));var moment=require('moment');var BPromise=require(_0x2f9e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f9e('0x2'));var db=require(_0x2f9e('0x3'))['db'];var utils=require(_0x2f9e('0x4'));var logger=require(_0x2f9e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2f9e('0x6'));var client=jayson[_0x2f9e('0x7')][_0x2f9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24d820,_0x4bbb20,_0x3a9203){return new BPromise(function(_0x5d37ad,_0x379d03){return client[_0x2f9e('0x9')](_0x24d820,_0x3a9203)[_0x2f9e('0xa')](function(_0x22c715){logger[_0x2f9e('0xb')](_0x2f9e('0xc'),_0x4bbb20,_0x2f9e('0xd'));logger[_0x2f9e('0xe')](_0x2f9e('0xf'),_0x4bbb20,'request\x20sent',JSON[_0x2f9e('0x10')](_0x22c715));if(_0x22c715[_0x2f9e('0x11')]){if(_0x22c715['error']['code']===0x1f4){logger['error'](_0x2f9e('0xc'),_0x4bbb20,_0x22c715['error'][_0x2f9e('0x12')]);return _0x379d03(_0x22c715[_0x2f9e('0x11')]['message']);}logger[_0x2f9e('0x11')](_0x2f9e('0xc'),_0x4bbb20,_0x22c715['error'][_0x2f9e('0x12')]);return _0x5d37ad(_0x22c715[_0x2f9e('0x11')][_0x2f9e('0x12')]);}else{logger[_0x2f9e('0xb')](_0x2f9e('0xc'),_0x4bbb20,_0x2f9e('0xd'));_0x5d37ad(_0x22c715['result'][_0x2f9e('0x12')]);}})['catch'](function(_0xa3ed39){logger[_0x2f9e('0x11')](_0x2f9e('0xc'),_0x4bbb20,_0xa3ed39);_0x379d03(_0xa3ed39);});});}
\ No newline at end of file
+var _0xf08d=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x24cef0,_0x42a80f){var _0x2b767b=function(_0x2529ee){while(--_0x2529ee){_0x24cef0['push'](_0x24cef0['shift']());}};_0x2b767b(++_0x42a80f);}(_0xf08d,0xd0));var _0xdf08=function(_0x1e4fbf,_0x2862c4){_0x1e4fbf=_0x1e4fbf-0x0;var _0x2441a8=_0xf08d[_0x1e4fbf];return _0x2441a8;};'use strict';var _=require(_0xdf08('0x0'));var util=require(_0xdf08('0x1'));var moment=require(_0xdf08('0x2'));var BPromise=require(_0xdf08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf08('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf08('0x5'));var logger=require(_0xdf08('0x6'))(_0xdf08('0x7'));var config=require(_0xdf08('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdf08('0x9')][_0xdf08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2893f9,_0x137c59,_0x226707){return new BPromise(function(_0x45d7ee,_0x43dc03){return client[_0xdf08('0xb')](_0x2893f9,_0x226707)[_0xdf08('0xc')](function(_0x2481ff){logger['info'](_0xdf08('0xd'),_0x137c59,_0xdf08('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x137c59,_0xdf08('0xe'),JSON[_0xdf08('0xf')](_0x2481ff));if(_0x2481ff[_0xdf08('0x10')]){if(_0x2481ff[_0xdf08('0x10')]['code']===0x1f4){logger['error'](_0xdf08('0xd'),_0x137c59,_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);return _0x43dc03(_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);}logger['error'](_0xdf08('0xd'),_0x137c59,_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);return _0x45d7ee(_0x2481ff[_0xdf08('0x10')][_0xdf08('0x11')]);}else{logger[_0xdf08('0x12')](_0xdf08('0xd'),_0x137c59,_0xdf08('0xe'));_0x45d7ee(_0x2481ff['result'][_0xdf08('0x11')]);}})[_0xdf08('0x13')](function(_0x367399){logger['error'](_0xdf08('0xd'),_0x137c59,_0x367399);_0x43dc03(_0x367399);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 8d3fed8..bff2ccd 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 _0x8ac1=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete'];(function(_0x4f9baf,_0x17a0a1){var _0x5dd2dd=function(_0xc553ed){while(--_0xc553ed){_0x4f9baf['push'](_0x4f9baf['shift']());}};_0x5dd2dd(++_0x17a0a1);}(_0x8ac1,0x147));var _0x18ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8ac1[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x18ac('0x0'));var util=require(_0x18ac('0x1'));var path=require('path');var timeout=require(_0x18ac('0x2'));var express=require(_0x18ac('0x3'));var router=express[_0x18ac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x18ac('0x5'));var interaction=require(_0x18ac('0x6'));var config=require(_0x18ac('0x7'));var controller=require(_0x18ac('0x8'));router[_0x18ac('0x9')]('/',auth[_0x18ac('0xa')](),controller['index']);router[_0x18ac('0x9')](_0x18ac('0xb'),auth[_0x18ac('0xa')](),controller[_0x18ac('0xc')]);router[_0x18ac('0x9')](_0x18ac('0xd'),auth['isAuthenticated'](),controller[_0x18ac('0xe')]);router['get'](_0x18ac('0xf'),auth[_0x18ac('0xa')](),controller[_0x18ac('0x10')]);router[_0x18ac('0x9')](_0x18ac('0x11'),auth[_0x18ac('0xa')](),controller[_0x18ac('0x12')]);router[_0x18ac('0x13')]('/',auth['isAuthenticated'](),controller[_0x18ac('0x14')]);router[_0x18ac('0x15')](_0x18ac('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x18ac('0x16')](_0x18ac('0xb'),auth[_0x18ac('0xa')](),controller[_0x18ac('0x17')]);module[_0x18ac('0x18')]=router;
\ No newline at end of file
+var _0x9129=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x395162,_0x5af476){var _0x13f769=function(_0x300065){while(--_0x300065){_0x395162['push'](_0x395162['shift']());}};_0x13f769(++_0x5af476);}(_0x9129,0xcc));var _0x9912=function(_0xfee10f,_0x53470e){_0xfee10f=_0xfee10f-0x0;var _0xb91051=_0x9129[_0xfee10f];return _0xb91051;};'use strict';var multer=require(_0x9912('0x0'));var util=require(_0x9912('0x1'));var path=require('path');var timeout=require(_0x9912('0x2'));var express=require('express');var router=express[_0x9912('0x3')]();var fs_extra=require(_0x9912('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9912('0x5'));var controller=require(_0x9912('0x6'));router[_0x9912('0x7')]('/',auth[_0x9912('0x8')](),controller[_0x9912('0x9')]);router['get'](_0x9912('0xa'),auth[_0x9912('0x8')](),controller[_0x9912('0xb')]);router['get']('/:id/preview',auth[_0x9912('0x8')](),controller['preview']);router[_0x9912('0x7')]('/:id/run',auth[_0x9912('0x8')](),controller[_0x9912('0xc')]);router[_0x9912('0x7')](_0x9912('0xd'),auth[_0x9912('0x8')](),controller[_0x9912('0xe')]);router[_0x9912('0xf')]('/',auth['isAuthenticated'](),controller[_0x9912('0x10')]);router['put'](_0x9912('0xa'),auth[_0x9912('0x8')](),controller[_0x9912('0x11')]);router[_0x9912('0x12')](_0x9912('0xa'),auth[_0x9912('0x8')](),controller[_0x9912('0x13')]);module[_0x9912('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f9eee6a..f313113 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 _0x4a1a=['xlsx','DATE','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','exports','STRING','csv','pdf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4a1a,0x13f));var _0xa4a1=function(_0x2fd1af,_0x1104b3){_0x2fd1af=_0x2fd1af-0x0;var _0x542a14=_0x4a1a[_0x2fd1af];return _0x542a14;};'use strict';var Sequelize=require(_0xa4a1('0x0'));var moment=require('moment');module[_0xa4a1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xa4a1('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa4a1('0x3'),_0xa4a1('0x4'),_0xa4a1('0x5')),'allowNull':![],'defaultValue':_0xa4a1('0x3')},'savename':{'type':Sequelize[_0xa4a1('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa4a1('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xa4a1('0x7')},'type':{'type':Sequelize[_0xa4a1('0x8')](_0xa4a1('0x9'),_0xa4a1('0xa')),'allowNull':![],'defaultValue':_0xa4a1('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xa4a1('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe1d3=['manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','DATE'];(function(_0x2191fb,_0x216516){var _0x31d7a1=function(_0x2035f7){while(--_0x2035f7){_0x2191fb['push'](_0x2191fb['shift']());}};_0x31d7a1(++_0x216516);}(_0xe1d3,0x19c));var _0x3e1d=function(_0x1fb16c,_0x440bfd){_0x1fb16c=_0x1fb16c-0x0;var _0xee214e=_0xe1d3[_0x1fb16c];return _0xee214e;};'use strict';var Sequelize=require(_0x3e1d('0x0'));var moment=require(_0x3e1d('0x1'));module[_0x3e1d('0x2')]={'name':{'type':Sequelize[_0x3e1d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x3e1d('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x3e1d('0x4')](_0x3e1d('0x5'),_0x3e1d('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x3e1d('0x5')},'savename':{'type':Sequelize[_0x3e1d('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3e1d('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3e1d('0x4')](_0x3e1d('0x8'),_0x3e1d('0x9')),'allowNull':![],'defaultValue':_0x3e1d('0x8')},'reportId':{'type':Sequelize[_0x3e1d('0xa')](0xb)[_0x3e1d('0xb')]},'reportType':{'type':Sequelize[_0x3e1d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7dfb899..35a1db7 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 _0x708f=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','download','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','ExtractedReports','UserProfileSection'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x708f,0x137));var _0xf708=function(_0x18d047,_0x4e2cfb){_0x18d047=_0x18d047-0x0;var _0x28c3c2=_0x708f[_0x18d047];return _0x28c3c2;};'use strict';var emlformat=require(_0xf708('0x0'));var rimraf=require(_0xf708('0x1'));var zipdir=require(_0xf708('0x2'));var jsonpatch=require(_0xf708('0x3'));var rp=require(_0xf708('0x4'));var moment=require(_0xf708('0x5'));var BPromise=require(_0xf708('0x6'));var Mustache=require(_0xf708('0x7'));var util=require('util');var path=require(_0xf708('0x8'));var sox=require(_0xf708('0x9'));var csv=require(_0xf708('0xa'));var ejs=require(_0xf708('0xb'));var fs=require('fs');var fs_extra=require(_0xf708('0xc'));var _=require(_0xf708('0xd'));var squel=require(_0xf708('0xe'));var crypto=require(_0xf708('0xf'));var jsforce=require(_0xf708('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf708('0xa'));var querystring=require(_0xf708('0x11'));var Papa=require('papaparse');var Redis=require(_0xf708('0x12'));var authService=require(_0xf708('0x13'));var qs=require(_0xf708('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf708('0x15'));var logger=require(_0xf708('0x16'))('api');var utils=require(_0xf708('0x17'));var config=require(_0xf708('0x18'));var licenseUtil=require(_0xf708('0x19'));var db=require(_0xf708('0x1a'))['db'];function respondWithStatusCode(_0x4b4c76,_0x2a4f58){_0x2a4f58=_0x2a4f58||0xcc;return function(_0x31daa6){if(_0x31daa6){return _0x4b4c76[_0xf708('0x1b')](_0x2a4f58);}return _0x4b4c76[_0xf708('0x1c')](_0x2a4f58)['end']();};}function respondWithResult(_0x366454,_0x132e2b){_0x132e2b=_0x132e2b||0xc8;return function(_0x1bde54){if(_0x1bde54){return _0x366454[_0xf708('0x1c')](_0x132e2b)['json'](_0x1bde54);}};}function respondWithFilteredResult(_0x27d035,_0x5061bb){return function(_0x1bee5b){if(_0x1bee5b){var _0x5e3843=typeof _0x5061bb[_0xf708('0x1d')]==='undefined'&&typeof _0x5061bb['limit']===_0xf708('0x1e');var _0x2634af=_0x1bee5b[_0xf708('0x1f')];var _0x220dc0=_0x5e3843?0x0:_0x5061bb[_0xf708('0x1d')];var _0x273348=_0x5e3843?_0x1bee5b[_0xf708('0x1f')]:_0x5061bb['offset']+_0x5061bb[_0xf708('0x20')];var _0x1b41fe;if(_0x273348>=_0x2634af){_0x273348=_0x2634af;_0x1b41fe=0xc8;}else{_0x1b41fe=0xce;}_0x27d035[_0xf708('0x1c')](_0x1b41fe);return _0x27d035['set'](_0xf708('0x21'),_0x220dc0+'-'+_0x273348+'/'+_0x2634af)[_0xf708('0x22')](_0x1bee5b);}return null;};}function patchUpdates(_0x3faf84){return function(_0x316571){try{jsonpatch['apply'](_0x316571,_0x3faf84,!![]);}catch(_0x58090d){return BPromise[_0xf708('0x23')](_0x58090d);}return _0x316571[_0xf708('0x24')]();};}function saveUpdates(_0x389ea1,_0x27810a){return function(_0x17d410){if(_0x17d410){return _0x17d410[_0xf708('0x25')](_0x389ea1)[_0xf708('0x26')](function(_0x3f2278){return _0x3f2278;});}return null;};}function removeEntity(_0x11e3d5,_0x3621c2){return function(_0x272902){if(_0x272902){return _0x272902[_0xf708('0x27')]()[_0xf708('0x26')](function(){var _0x2b31c8=_0x272902['get']({'plain':!![]});var _0x1145a8='ExtractedReports';return db[_0xf708('0x28')]['destroy']({'where':{'type':_0x1145a8,'resourceId':_0x2b31c8['id']}})[_0xf708('0x26')](function(){return _0x272902;});})[_0xf708('0x26')](function(){_0x11e3d5['status'](0xcc)[_0xf708('0x29')]();});}};}function handleEntityNotFound(_0x4ad5f9,_0x57bc57){return function(_0x16b5bc){if(!_0x16b5bc){_0x4ad5f9[_0xf708('0x1b')](0x194);}return _0x16b5bc;};}function handleError(_0x4f54ef,_0x51fe4b){_0x51fe4b=_0x51fe4b||0x1f4;return function(_0x3ba109){logger[_0xf708('0x2a')](_0x3ba109[_0xf708('0x2b')]);if(_0x3ba109[_0xf708('0x2c')]){delete _0x3ba109[_0xf708('0x2c')];}_0x4f54ef[_0xf708('0x1c')](_0x51fe4b)[_0xf708('0x2d')](_0x3ba109);};}exports['index']=function(_0x52fefb,_0x399a71){var _0x18c376={},_0x64a590={},_0x4cd0f4={'count':0x0,'rows':[]};var _0x1fc842=_[_0xf708('0x2e')](db['AnalyticExtractedReport'][_0xf708('0x2f')],function(_0x1cc62b){return{'name':_0x1cc62b['fieldName'],'type':_0x1cc62b[_0xf708('0x30')][_0xf708('0x31')]};});_0x64a590[_0xf708('0x32')]=_['map'](_0x1fc842,_0xf708('0x2c'));_0x64a590[_0xf708('0x33')]=_[_0xf708('0x34')](_0x52fefb[_0xf708('0x33')]);_0x64a590[_0xf708('0x35')]=_[_0xf708('0x36')](_0x64a590[_0xf708('0x32')],_0x64a590['query']);_0x18c376[_0xf708('0x37')]=_[_0xf708('0x36')](_0x64a590['model'],qs[_0xf708('0x38')](_0x52fefb['query'][_0xf708('0x38')]));_0x18c376['attributes']=_0x18c376['attributes'][_0xf708('0x39')]?_0x18c376[_0xf708('0x37')]:_0x64a590[_0xf708('0x32')];if(!_0x52fefb[_0xf708('0x33')][_0xf708('0x3a')](_0xf708('0x3b'))){_0x18c376[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x52fefb['query'][_0xf708('0x20')]);_0x18c376[_0xf708('0x1d')]=qs[_0xf708('0x1d')](_0x52fefb[_0xf708('0x33')]['offset']);}_0x18c376[_0xf708('0x3c')]=qs[_0xf708('0x3d')](_0x52fefb[_0xf708('0x33')][_0xf708('0x3d')]);_0x18c376[_0xf708('0x3e')]=qs[_0xf708('0x35')](_['pick'](_0x52fefb[_0xf708('0x33')],_0x64a590[_0xf708('0x35')]),_0x1fc842);if(_0x52fefb['query'][_0xf708('0x3f')]){_0x18c376['where']=_[_0xf708('0x40')](_0x18c376[_0xf708('0x3e')],{'$or':_[_0xf708('0x2e')](_0x1fc842,function(_0x14f06f){if(_0x14f06f[_0xf708('0x30')]!==_0xf708('0x41')){var _0x4e7c08={};_0x4e7c08[_0x14f06f[_0xf708('0x2c')]]={'$like':'%'+_0x52fefb[_0xf708('0x33')][_0xf708('0x3f')]+'%'};return _0x4e7c08;}})});}_0x18c376=_[_0xf708('0x40')]({},_0x18c376,_0x52fefb[_0xf708('0x42')]);var _0x5cb532={'where':_0x18c376[_0xf708('0x3e')]};return db[_0xf708('0x43')][_0xf708('0x1f')](_0x5cb532)['then'](function(_0x2a90a1){_0x4cd0f4[_0xf708('0x1f')]=_0x2a90a1;if(_0x52fefb['query'][_0xf708('0x44')]){_0x18c376[_0xf708('0x45')]=[{'all':!![]}];}return db[_0xf708('0x43')][_0xf708('0x46')](_0x18c376);})[_0xf708('0x26')](function(_0x27bd3e){_0x4cd0f4[_0xf708('0x47')]=_0x27bd3e;return _0x4cd0f4;})['then'](respondWithFilteredResult(_0x399a71,_0x18c376))[_0xf708('0x48')](handleError(_0x399a71,null));};exports['show']=function(_0x562c08,_0x1d0819){var _0x228357={'raw':!![],'where':{'id':_0x562c08[_0xf708('0x49')]['id']}},_0x56623d={};_0x56623d[_0xf708('0x32')]=_[_0xf708('0x34')](db['AnalyticExtractedReport'][_0xf708('0x2f')]);_0x56623d['query']=_[_0xf708('0x34')](_0x562c08['query']);_0x56623d[_0xf708('0x35')]=_[_0xf708('0x36')](_0x56623d[_0xf708('0x32')],_0x56623d[_0xf708('0x33')]);_0x228357[_0xf708('0x37')]=_['intersection'](_0x56623d[_0xf708('0x32')],qs[_0xf708('0x38')](_0x562c08[_0xf708('0x33')][_0xf708('0x38')]));_0x228357['attributes']=_0x228357['attributes'][_0xf708('0x39')]?_0x228357[_0xf708('0x37')]:_0x56623d['model'];if(_0x562c08[_0xf708('0x33')]['includeAll']){_0x228357[_0xf708('0x45')]=[{'all':!![]}];}_0x228357=_[_0xf708('0x40')]({},_0x228357,_0x562c08[_0xf708('0x42')]);return db['AnalyticExtractedReport'][_0xf708('0x4a')](_0x228357)[_0xf708('0x26')](handleEntityNotFound(_0x1d0819,null))[_0xf708('0x26')](respondWithResult(_0x1d0819,null))['catch'](handleError(_0x1d0819,null));};exports[_0xf708('0x4b')]=function(_0x18dd24,_0x583617){return db['AnalyticExtractedReport'][_0xf708('0x4b')](_0x18dd24[_0xf708('0x4c')],{})[_0xf708('0x26')](function(_0x118979){var _0x379cdf=_0x18dd24[_0xf708('0x4d')][_0xf708('0x4e')]({'plain':!![]});if(!_0x379cdf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x379cdf['role']===_0xf708('0x4d')){var _0x3a592f=_0x118979['get']({'plain':!![]});var _0x2d4260=_0xf708('0x4f');return db[_0xf708('0x50')]['find']({'where':{'name':_0x2d4260,'userProfileId':_0x379cdf[_0xf708('0x51')]},'raw':!![]})[_0xf708('0x26')](function(_0x50a05c){if(_0x50a05c&&_0x50a05c[_0xf708('0x52')]===0x0){return db[_0xf708('0x28')][_0xf708('0x4b')]({'name':_0x3a592f[_0xf708('0x2c')],'resourceId':_0x3a592f['id'],'type':_0x50a05c[_0xf708('0x2c')],'sectionId':_0x50a05c['id']},{})[_0xf708('0x26')](function(){return _0x118979;});}else{return _0x118979;}})['catch'](function(_0x36ff78){logger['error'](_0xf708('0x53'),_0x36ff78);throw _0x36ff78;});}return _0x118979;})[_0xf708('0x26')](respondWithResult(_0x583617,0xc9))[_0xf708('0x48')](handleError(_0x583617,null));};exports['update']=function(_0x2bf1e6,_0x2c7161){if(_0x2bf1e6['body']['id']){delete _0x2bf1e6[_0xf708('0x4c')]['id'];}return db[_0xf708('0x43')][_0xf708('0x4a')]({'where':{'id':_0x2bf1e6[_0xf708('0x49')]['id']}})[_0xf708('0x26')](handleEntityNotFound(_0x2c7161,null))[_0xf708('0x26')](saveUpdates(_0x2bf1e6[_0xf708('0x4c')],null))['then'](respondWithResult(_0x2c7161,null))['catch'](handleError(_0x2c7161,null));};exports[_0xf708('0x27')]=function(_0x532ca9,_0x3da6a2){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x532ca9[_0xf708('0x49')]['id']}})[_0xf708('0x26')](handleEntityNotFound(_0x3da6a2,null))['then'](removeEntity(_0x3da6a2,null))[_0xf708('0x48')](handleError(_0x3da6a2,null));};exports['download']=function(_0x5e6b3d,_0x281a70,_0x127657){return db[_0xf708('0x43')][_0xf708('0x4a')]({'where':{'id':_0x5e6b3d[_0xf708('0x49')]['id']},'attributes':[_0xf708('0x2c'),_0xf708('0x54'),_0xf708('0x55'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x281a70,null))[_0xf708('0x26')](function(_0x4667f3){if(_0x4667f3){if(!fs[_0xf708('0x56')](path[_0xf708('0x57')](config[_0xf708('0x58')],_0xf708('0x59'),_0x4667f3[_0xf708('0x55')]))){throw new db[(_0xf708('0x5a'))][(_0xf708('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5e6b3d[_0xf708('0x33')][_0xf708('0x5c')]){return _0x281a70[_0xf708('0x1b')](0xc8);}return _0x281a70[_0xf708('0x5d')](path[_0xf708('0x57')](config['root'],_0xf708('0x59'),_0x4667f3['savename']),util[_0xf708('0x5e')](_0xf708('0x5f'),_0x4667f3[_0xf708('0x54')]||_0x4667f3[_0xf708('0x2c')],_0x4667f3[_0xf708('0x60')][_0xf708('0x61')]()));}})[_0xf708('0x48')](handleError(_0x281a70,null));};
\ No newline at end of file
+var _0xba48=['options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','update','download','basename','savename','output','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','AnalyticExtractedReport','fieldName','type','key','model','map','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','params','rawAttributes','keys','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba48,0x12f));var _0x8ba4=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xba48[_0x186376];return _0x2dbdd9;};'use strict';var emlformat=require(_0x8ba4('0x0'));var rimraf=require(_0x8ba4('0x1'));var zipdir=require(_0x8ba4('0x2'));var jsonpatch=require(_0x8ba4('0x3'));var rp=require(_0x8ba4('0x4'));var moment=require(_0x8ba4('0x5'));var BPromise=require(_0x8ba4('0x6'));var Mustache=require('mustache');var util=require(_0x8ba4('0x7'));var path=require(_0x8ba4('0x8'));var sox=require(_0x8ba4('0x9'));var csv=require(_0x8ba4('0xa'));var ejs=require(_0x8ba4('0xb'));var fs=require('fs');var fs_extra=require(_0x8ba4('0xc'));var _=require('lodash');var squel=require(_0x8ba4('0xd'));var crypto=require(_0x8ba4('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ba4('0xa'));var querystring=require('querystring');var Papa=require(_0x8ba4('0xf'));var Redis=require('ioredis');var authService=require(_0x8ba4('0x10'));var qs=require(_0x8ba4('0x11'));var as=require(_0x8ba4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ba4('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8ba4('0x14'));var licenseUtil=require(_0x8ba4('0x15'));var db=require(_0x8ba4('0x16'))['db'];function respondWithStatusCode(_0x2d2b88,_0xd5cf5b){_0xd5cf5b=_0xd5cf5b||0xcc;return function(_0x1d79a7){if(_0x1d79a7){return _0x2d2b88[_0x8ba4('0x17')](_0xd5cf5b);}return _0x2d2b88[_0x8ba4('0x18')](_0xd5cf5b)[_0x8ba4('0x19')]();};}function respondWithResult(_0x493854,_0x25d4f3){_0x25d4f3=_0x25d4f3||0xc8;return function(_0x5885af){if(_0x5885af){return _0x493854[_0x8ba4('0x18')](_0x25d4f3)[_0x8ba4('0x1a')](_0x5885af);}};}function respondWithFilteredResult(_0x4cc13d,_0x39123a){return function(_0x4e4fb2){if(_0x4e4fb2){var _0x146c2c=typeof _0x39123a[_0x8ba4('0x1b')]==='undefined'&&typeof _0x39123a[_0x8ba4('0x1c')]===_0x8ba4('0x1d');var _0x2f2fde=_0x4e4fb2[_0x8ba4('0x1e')];var _0x208289=_0x146c2c?0x0:_0x39123a[_0x8ba4('0x1b')];var _0x4932f0=_0x146c2c?_0x4e4fb2[_0x8ba4('0x1e')]:_0x39123a[_0x8ba4('0x1b')]+_0x39123a[_0x8ba4('0x1c')];var _0x170b31;if(_0x4932f0>=_0x2f2fde){_0x4932f0=_0x2f2fde;_0x170b31=0xc8;}else{_0x170b31=0xce;}_0x4cc13d['status'](_0x170b31);return _0x4cc13d[_0x8ba4('0x1f')](_0x8ba4('0x20'),_0x208289+'-'+_0x4932f0+'/'+_0x2f2fde)[_0x8ba4('0x1a')](_0x4e4fb2);}return null;};}function patchUpdates(_0x14072f){return function(_0x1b01a7){try{jsonpatch[_0x8ba4('0x21')](_0x1b01a7,_0x14072f,!![]);}catch(_0x468e48){return BPromise[_0x8ba4('0x22')](_0x468e48);}return _0x1b01a7[_0x8ba4('0x23')]();};}function saveUpdates(_0x7ba7f4,_0x1e6665){return function(_0x1f2fa8){if(_0x1f2fa8){return _0x1f2fa8['update'](_0x7ba7f4)[_0x8ba4('0x24')](function(_0x2a0493){return _0x2a0493;});}return null;};}function removeEntity(_0x30292b,_0x736f9c){return function(_0x1b6a68){if(_0x1b6a68){return _0x1b6a68[_0x8ba4('0x25')]()[_0x8ba4('0x24')](function(){var _0x4d8e59=_0x1b6a68[_0x8ba4('0x26')]({'plain':!![]});var _0xe3732c=_0x8ba4('0x27');return db[_0x8ba4('0x28')]['destroy']({'where':{'type':_0xe3732c,'resourceId':_0x4d8e59['id']}})[_0x8ba4('0x24')](function(){return _0x1b6a68;});})['then'](function(){_0x30292b[_0x8ba4('0x18')](0xcc)[_0x8ba4('0x19')]();});}};}function handleEntityNotFound(_0x504d02,_0x2bf764){return function(_0x447f07){if(!_0x447f07){_0x504d02[_0x8ba4('0x17')](0x194);}return _0x447f07;};}function handleError(_0x3afcea,_0x141562){_0x141562=_0x141562||0x1f4;return function(_0x65ab5d){logger[_0x8ba4('0x29')](_0x65ab5d[_0x8ba4('0x2a')]);if(_0x65ab5d[_0x8ba4('0x2b')]){delete _0x65ab5d[_0x8ba4('0x2b')];}_0x3afcea[_0x8ba4('0x18')](_0x141562)[_0x8ba4('0x2c')](_0x65ab5d);};}exports['index']=function(_0x102a4e,_0x4fa9ef){var _0x1e01a9={},_0x353a61={},_0xd0503={'count':0x0,'rows':[]};var _0x132f38=_['map'](db[_0x8ba4('0x2d')]['rawAttributes'],function(_0x4902ee){return{'name':_0x4902ee[_0x8ba4('0x2e')],'type':_0x4902ee[_0x8ba4('0x2f')][_0x8ba4('0x30')]};});_0x353a61[_0x8ba4('0x31')]=_[_0x8ba4('0x32')](_0x132f38,_0x8ba4('0x2b'));_0x353a61['query']=_['keys'](_0x102a4e['query']);_0x353a61[_0x8ba4('0x33')]=_['intersection'](_0x353a61[_0x8ba4('0x31')],_0x353a61['query']);_0x1e01a9[_0x8ba4('0x34')]=_[_0x8ba4('0x35')](_0x353a61['model'],qs[_0x8ba4('0x36')](_0x102a4e[_0x8ba4('0x37')]['fields']));_0x1e01a9['attributes']=_0x1e01a9[_0x8ba4('0x34')][_0x8ba4('0x38')]?_0x1e01a9['attributes']:_0x353a61['model'];if(!_0x102a4e['query'][_0x8ba4('0x39')](_0x8ba4('0x3a'))){_0x1e01a9[_0x8ba4('0x1c')]=qs['limit'](_0x102a4e[_0x8ba4('0x37')][_0x8ba4('0x1c')]);_0x1e01a9['offset']=qs[_0x8ba4('0x1b')](_0x102a4e['query']['offset']);}_0x1e01a9[_0x8ba4('0x3b')]=qs['sort'](_0x102a4e[_0x8ba4('0x37')][_0x8ba4('0x3c')]);_0x1e01a9[_0x8ba4('0x3d')]=qs[_0x8ba4('0x33')](_[_0x8ba4('0x3e')](_0x102a4e[_0x8ba4('0x37')],_0x353a61[_0x8ba4('0x33')]),_0x132f38);if(_0x102a4e['query'][_0x8ba4('0x3f')]){_0x1e01a9[_0x8ba4('0x3d')]=_[_0x8ba4('0x40')](_0x1e01a9[_0x8ba4('0x3d')],{'$or':_[_0x8ba4('0x32')](_0x132f38,function(_0x4d5607){if(_0x4d5607[_0x8ba4('0x2f')]!==_0x8ba4('0x41')){var _0x56d218={};_0x56d218[_0x4d5607[_0x8ba4('0x2b')]]={'$like':'%'+_0x102a4e[_0x8ba4('0x37')][_0x8ba4('0x3f')]+'%'};return _0x56d218;}})});}_0x1e01a9=_[_0x8ba4('0x40')]({},_0x1e01a9,_0x102a4e['options']);var _0x5896f4={'where':_0x1e01a9[_0x8ba4('0x3d')]};return db[_0x8ba4('0x2d')][_0x8ba4('0x1e')](_0x5896f4)[_0x8ba4('0x24')](function(_0x39d40f){_0xd0503[_0x8ba4('0x1e')]=_0x39d40f;if(_0x102a4e[_0x8ba4('0x37')]['includeAll']){_0x1e01a9['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8ba4('0x42')](_0x1e01a9);})[_0x8ba4('0x24')](function(_0x316e5f){_0xd0503['rows']=_0x316e5f;return _0xd0503;})[_0x8ba4('0x24')](respondWithFilteredResult(_0x4fa9ef,_0x1e01a9))[_0x8ba4('0x43')](handleError(_0x4fa9ef,null));};exports['show']=function(_0x52466e,_0xd24ad5){var _0xc20218={'raw':!![],'where':{'id':_0x52466e[_0x8ba4('0x44')]['id']}},_0x1a378b={};_0x1a378b[_0x8ba4('0x31')]=_['keys'](db[_0x8ba4('0x2d')][_0x8ba4('0x45')]);_0x1a378b[_0x8ba4('0x37')]=_[_0x8ba4('0x46')](_0x52466e['query']);_0x1a378b[_0x8ba4('0x33')]=_['intersection'](_0x1a378b[_0x8ba4('0x31')],_0x1a378b['query']);_0xc20218[_0x8ba4('0x34')]=_[_0x8ba4('0x35')](_0x1a378b[_0x8ba4('0x31')],qs[_0x8ba4('0x36')](_0x52466e['query'][_0x8ba4('0x36')]));_0xc20218[_0x8ba4('0x34')]=_0xc20218[_0x8ba4('0x34')][_0x8ba4('0x38')]?_0xc20218['attributes']:_0x1a378b[_0x8ba4('0x31')];if(_0x52466e[_0x8ba4('0x37')][_0x8ba4('0x47')]){_0xc20218[_0x8ba4('0x48')]=[{'all':!![]}];}_0xc20218=_['merge']({},_0xc20218,_0x52466e[_0x8ba4('0x49')]);return db[_0x8ba4('0x2d')][_0x8ba4('0x4a')](_0xc20218)[_0x8ba4('0x24')](handleEntityNotFound(_0xd24ad5,null))[_0x8ba4('0x24')](respondWithResult(_0xd24ad5,null))[_0x8ba4('0x43')](handleError(_0xd24ad5,null));};exports[_0x8ba4('0x4b')]=function(_0x4fca59,_0x1924e7){return db[_0x8ba4('0x2d')]['create'](_0x4fca59[_0x8ba4('0x4c')],{})[_0x8ba4('0x24')](function(_0x4fa705){var _0x292e6e=_0x4fca59[_0x8ba4('0x4d')]['get']({'plain':!![]});if(!_0x292e6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x292e6e['role']===_0x8ba4('0x4d')){var _0x52acc8=_0x4fa705[_0x8ba4('0x26')]({'plain':!![]});var _0x2e5019='ExtractedReports';return db[_0x8ba4('0x4e')]['find']({'where':{'name':_0x2e5019,'userProfileId':_0x292e6e[_0x8ba4('0x4f')]},'raw':!![]})[_0x8ba4('0x24')](function(_0x350e24){if(_0x350e24&&_0x350e24[_0x8ba4('0x50')]===0x0){return db['UserProfileResource'][_0x8ba4('0x4b')]({'name':_0x52acc8[_0x8ba4('0x2b')],'resourceId':_0x52acc8['id'],'type':_0x350e24[_0x8ba4('0x2b')],'sectionId':_0x350e24['id']},{})[_0x8ba4('0x24')](function(){return _0x4fa705;});}else{return _0x4fa705;}})[_0x8ba4('0x43')](function(_0x46bd03){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46bd03);throw _0x46bd03;});}return _0x4fa705;})[_0x8ba4('0x24')](respondWithResult(_0x1924e7,0xc9))['catch'](handleError(_0x1924e7,null));};exports[_0x8ba4('0x51')]=function(_0x48f276,_0x1953fe){if(_0x48f276[_0x8ba4('0x4c')]['id']){delete _0x48f276[_0x8ba4('0x4c')]['id'];}return db[_0x8ba4('0x2d')][_0x8ba4('0x4a')]({'where':{'id':_0x48f276[_0x8ba4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1953fe,null))[_0x8ba4('0x24')](saveUpdates(_0x48f276[_0x8ba4('0x4c')],null))['then'](respondWithResult(_0x1953fe,null))['catch'](handleError(_0x1953fe,null));};exports['destroy']=function(_0x221d0c,_0x4b0bdb){return db[_0x8ba4('0x2d')]['find']({'where':{'id':_0x221d0c['params']['id']}})['then'](handleEntityNotFound(_0x4b0bdb,null))[_0x8ba4('0x24')](removeEntity(_0x4b0bdb,null))[_0x8ba4('0x43')](handleError(_0x4b0bdb,null));};exports[_0x8ba4('0x52')]=function(_0x4c54ef,_0x56b018,_0xed9e06){return db[_0x8ba4('0x2d')][_0x8ba4('0x4a')]({'where':{'id':_0x4c54ef[_0x8ba4('0x44')]['id']},'attributes':['name',_0x8ba4('0x53'),_0x8ba4('0x54'),_0x8ba4('0x55')],'raw':!![]})[_0x8ba4('0x24')](handleEntityNotFound(_0x56b018,null))['then'](function(_0x1f1cb9){if(_0x1f1cb9){if(!fs['existsSync'](path[_0x8ba4('0x56')](config[_0x8ba4('0x57')],'server/files/reports',_0x1f1cb9[_0x8ba4('0x54')]))){throw new db[(_0x8ba4('0x58'))]['ValidationError'](_0x8ba4('0x59'));}if(_0x4c54ef['query'][_0x8ba4('0x5a')]){return _0x56b018['sendStatus'](0xc8);}return _0x56b018[_0x8ba4('0x52')](path[_0x8ba4('0x56')](config[_0x8ba4('0x57')],_0x8ba4('0x5b'),_0x1f1cb9[_0x8ba4('0x54')]),util[_0x8ba4('0x5c')](_0x8ba4('0x5d'),_0x1f1cb9[_0x8ba4('0x53')]||_0x1f1cb9[_0x8ba4('0x2b')],_0x1f1cb9[_0x8ba4('0x55')]['toLowerCase']()));}})['catch'](handleError(_0x56b018,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 29bbf35..0f86691 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 _0x3fc5=['moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','util','api'];(function(_0x582f7e,_0x4c080e){var _0x29528e=function(_0x88354){while(--_0x88354){_0x582f7e['push'](_0x582f7e['shift']());}};_0x29528e(++_0x4c080e);}(_0x3fc5,0x13d));var _0x53fc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3fc5[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x53fc('0x0'));var logger=require('../../config/logger')(_0x53fc('0x1'));var moment=require(_0x53fc('0x2'));var BPromise=require('bluebird');var rp=require(_0x53fc('0x3'));var fs=require('fs');var path=require(_0x53fc('0x4'));var rimraf=require(_0x53fc('0x5'));var config=require(_0x53fc('0x6'));var attributes=require(_0x53fc('0x7'));module['exports']=function(_0x12ee8a,_0x524d1b){return _0x12ee8a[_0x53fc('0x8')](_0x53fc('0x9'),attributes,{'tableName':_0x53fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e74=['exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x1c4c46,_0x3f3e8b){var _0x38e0e0=function(_0xa8038a){while(--_0xa8038a){_0x1c4c46['push'](_0x1c4c46['shift']());}};_0x38e0e0(++_0x3f3e8b);}(_0x7e74,0x16f));var _0x47e7=function(_0x29a0d7,_0x4ecd68){_0x29a0d7=_0x29a0d7-0x0;var _0x3e336f=_0x7e74[_0x29a0d7];return _0x3e336f;};'use strict';var _=require(_0x47e7('0x0'));var util=require(_0x47e7('0x1'));var logger=require(_0x47e7('0x2'))(_0x47e7('0x3'));var moment=require(_0x47e7('0x4'));var BPromise=require(_0x47e7('0x5'));var rp=require(_0x47e7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47e7('0x7'));var config=require(_0x47e7('0x8'));var attributes=require(_0x47e7('0x9'));module[_0x47e7('0xa')]=function(_0x4b110b,_0x2123f5){return _0x4b110b[_0x47e7('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x47e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 11d4ca3..63610a1 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 _0xf218=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x4622df,_0x27eb7c){var _0x5990fe=function(_0x5531ac){while(--_0x5531ac){_0x4622df['push'](_0x4622df['shift']());}};_0x5990fe(++_0x27eb7c);}(_0xf218,0xa9));var _0x8f21=function(_0x421513,_0x4879e1){_0x421513=_0x421513-0x0;var _0x186ee1=_0xf218[_0x421513];return _0x186ee1;};'use strict';var _=require(_0x8f21('0x0'));var util=require(_0x8f21('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8f21('0x2'));var fs=require('fs');var Redis=require(_0x8f21('0x3'));var db=require(_0x8f21('0x4'))['db'];var utils=require(_0x8f21('0x5'));var logger=require(_0x8f21('0x6'))(_0x8f21('0x7'));var config=require(_0x8f21('0x8'));var jayson=require(_0x8f21('0x9'));var client=jayson[_0x8f21('0xa')][_0x8f21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15e9ca,_0x47d97f,_0x2d6191){return new BPromise(function(_0x50bc9a,_0x5e3d65){return client[_0x8f21('0xc')](_0x15e9ca,_0x2d6191)['then'](function(_0xd0473d){logger[_0x8f21('0xd')](_0x8f21('0xe'),_0x47d97f,_0x8f21('0xf'));logger[_0x8f21('0x10')](_0x8f21('0x11'),_0x47d97f,_0x8f21('0xf'),JSON[_0x8f21('0x12')](_0xd0473d));if(_0xd0473d[_0x8f21('0x13')]){if(_0xd0473d[_0x8f21('0x13')][_0x8f21('0x14')]===0x1f4){logger[_0x8f21('0x13')](_0x8f21('0xe'),_0x47d97f,_0xd0473d[_0x8f21('0x13')][_0x8f21('0x15')]);return _0x5e3d65(_0xd0473d['error']['message']);}logger[_0x8f21('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47d97f,_0xd0473d[_0x8f21('0x13')][_0x8f21('0x15')]);return _0x50bc9a(_0xd0473d['error']['message']);}else{logger[_0x8f21('0xd')](_0x8f21('0xe'),_0x47d97f,_0x8f21('0xf'));_0x50bc9a(_0xd0473d['result'][_0x8f21('0x15')]);}})[_0x8f21('0x16')](function(_0x1c76ea){logger[_0x8f21('0x13')](_0x8f21('0xe'),_0x47d97f,_0x1c76ea);_0x5e3d65(_0x1c76ea);});});}
\ No newline at end of file
+var _0xe51d=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring'];(function(_0xd902ad,_0x34a4db){var _0x2dda06=function(_0x29e470){while(--_0x29e470){_0xd902ad['push'](_0xd902ad['shift']());}};_0x2dda06(++_0x34a4db);}(_0xe51d,0x9c));var _0xde51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe51d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xde51('0x0'));var util=require(_0xde51('0x1'));var moment=require('moment');var BPromise=require(_0xde51('0x2'));var rs=require(_0xde51('0x3'));var fs=require('fs');var Redis=require(_0xde51('0x4'));var db=require(_0xde51('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde51('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde51('0x7'));var client=jayson[_0xde51('0x8')][_0xde51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d1507,_0x21477c,_0x38ec14){return new BPromise(function(_0x2d6634,_0x3ff147){return client[_0xde51('0xa')](_0x5d1507,_0x38ec14)['then'](function(_0x5a95af){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x21477c,'request\x20sent');logger['debug'](_0xde51('0xb'),_0x21477c,_0xde51('0xc'),JSON[_0xde51('0xd')](_0x5a95af));if(_0x5a95af['error']){if(_0x5a95af[_0xde51('0xe')][_0xde51('0xf')]===0x1f4){logger[_0xde51('0xe')](_0xde51('0x10'),_0x21477c,_0x5a95af[_0xde51('0xe')][_0xde51('0x11')]);return _0x3ff147(_0x5a95af[_0xde51('0xe')][_0xde51('0x11')]);}logger[_0xde51('0xe')](_0xde51('0x10'),_0x21477c,_0x5a95af[_0xde51('0xe')][_0xde51('0x11')]);return _0x2d6634(_0x5a95af['error'][_0xde51('0x11')]);}else{logger[_0xde51('0x12')](_0xde51('0x10'),_0x21477c,'request\x20sent');_0x2d6634(_0x5a95af[_0xde51('0x13')][_0xde51('0x11')]);}})['catch'](function(_0x358ee5){logger[_0xde51('0xe')](_0xde51('0x10'),_0x21477c,_0x358ee5);_0x3ff147(_0x358ee5);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 204b8e3..b2876c8 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 _0xf8fc=['create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id/download','isAuthenticated','download'];(function(_0x391d23,_0x1bf2a6){var _0x196779=function(_0x41471c){while(--_0x41471c){_0x391d23['push'](_0x391d23['shift']());}};_0x196779(++_0x1bf2a6);}(_0xf8fc,0x100));var _0xcf8f=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xf8fc[_0x2adbeb];return _0x5e18a6;};'use strict';var multer=require(_0xcf8f('0x0'));var util=require(_0xcf8f('0x1'));var path=require(_0xcf8f('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf8f('0x3'));var router=express[_0xcf8f('0x4')]();var fs_extra=require(_0xcf8f('0x5'));var auth=require(_0xcf8f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf8f('0x7'));var controller=require(_0xcf8f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xcf8f('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcf8f('0xa')](_0xcf8f('0xb'),auth[_0xcf8f('0xc')](),controller[_0xcf8f('0xd')]);router['post']('/',auth[_0xcf8f('0xc')](),controller[_0xcf8f('0xe')]);router[_0xcf8f('0xf')]('/:id',auth[_0xcf8f('0xc')](),controller['update']);router['delete']('/:id',auth[_0xcf8f('0xc')](),controller[_0xcf8f('0x10')]);module[_0xcf8f('0x11')]=router;
\ No newline at end of file
+var _0x4f59=['isAuthenticated','index','show','/:id/download','download','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4f59,0x68));var _0x94f5=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x4f59[_0xb875ee];return _0x4c7f3a;};'use strict';var multer=require(_0x94f5('0x0'));var util=require(_0x94f5('0x1'));var path=require(_0x94f5('0x2'));var timeout=require(_0x94f5('0x3'));var express=require(_0x94f5('0x4'));var router=express[_0x94f5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x94f5('0x6'));var interaction=require(_0x94f5('0x7'));var config=require(_0x94f5('0x8'));var controller=require(_0x94f5('0x9'));router[_0x94f5('0xa')]('/',auth[_0x94f5('0xb')](),controller[_0x94f5('0xc')]);router[_0x94f5('0xa')]('/:id',auth[_0x94f5('0xb')](),controller[_0x94f5('0xd')]);router[_0x94f5('0xa')](_0x94f5('0xe'),auth[_0x94f5('0xb')](),controller[_0x94f5('0xf')]);router['post']('/',auth[_0x94f5('0xb')](),controller[_0x94f5('0x10')]);router[_0x94f5('0x11')]('/:id',auth[_0x94f5('0xb')](),controller[_0x94f5('0x12')]);router[_0x94f5('0x13')](_0x94f5('0x14'),auth[_0x94f5('0xb')](),controller[_0x94f5('0x15')]);module[_0x94f5('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c612751..1422d0a 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 _0x72e8=['sequelize','STRING','BOOLEAN'];(function(_0x2ad0c1,_0x7f1bd6){var _0x5c1a2e=function(_0x26ece1){while(--_0x26ece1){_0x2ad0c1['push'](_0x2ad0c1['shift']());}};_0x5c1a2e(++_0x7f1bd6);}(_0x72e8,0x180));var _0x872e=function(_0xe2bc12,_0x22c4a9){_0xe2bc12=_0xe2bc12-0x0;var _0x3cd963=_0x72e8[_0xe2bc12];return _0x3cd963;};'use strict';var Sequelize=require(_0x872e('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x872e('0x1')]},'format':{'type':Sequelize[_0x872e('0x1')]},'groupBy':{'type':Sequelize[_0x872e('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x872e('0x1')]},'custom':{'type':Sequelize[_0x872e('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf3e9=['STRING','BOOLEAN','sequelize','exports'];(function(_0x352392,_0x3337c7){var _0x567118=function(_0x142120){while(--_0x142120){_0x352392['push'](_0x352392['shift']());}};_0x567118(++_0x3337c7);}(_0xf3e9,0x14e));var _0x9f3e=function(_0x3883a0,_0x38ddbf){_0x3883a0=_0x3883a0-0x0;var _0x16dc7e=_0xf3e9[_0x3883a0];return _0x16dc7e;};'use strict';var Sequelize=require(_0x9f3e('0x0'));module[_0x9f3e('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x9f3e('0x2')]},'function':{'type':Sequelize[_0x9f3e('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9f3e('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9f3e('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index c284e94..5b71c86 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 _0xa4f9=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','findAll','rows','catch','show','params','fields','length','include','find','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x656f5c,_0x91ffe7){var _0x2beab5=function(_0x314c9b){while(--_0x314c9b){_0x656f5c['push'](_0x656f5c['shift']());}};_0x2beab5(++_0x91ffe7);}(_0xa4f9,0x1cf));var _0x9a4f=function(_0x52b608,_0x167590){_0x52b608=_0x52b608-0x0;var _0x354586=_0xa4f9[_0x52b608];return _0x354586;};'use strict';var emlformat=require(_0x9a4f('0x0'));var rimraf=require(_0x9a4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a4f('0x2'));var rp=require(_0x9a4f('0x3'));var moment=require(_0x9a4f('0x4'));var BPromise=require(_0x9a4f('0x5'));var Mustache=require(_0x9a4f('0x6'));var util=require(_0x9a4f('0x7'));var path=require(_0x9a4f('0x8'));var sox=require(_0x9a4f('0x9'));var csv=require(_0x9a4f('0xa'));var ejs=require(_0x9a4f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a4f('0xc'));var squel=require(_0x9a4f('0xd'));var crypto=require(_0x9a4f('0xe'));var jsforce=require(_0x9a4f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9a4f('0xa'));var querystring=require(_0x9a4f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a4f('0x11'));var authService=require(_0x9a4f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9a4f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a4f('0x14'))(_0x9a4f('0x15'));var utils=require(_0x9a4f('0x16'));var config=require(_0x9a4f('0x17'));var licenseUtil=require(_0x9a4f('0x18'));var db=require(_0x9a4f('0x19'))['db'];function respondWithStatusCode(_0x2b8baf,_0x6c6371){_0x6c6371=_0x6c6371||0xcc;return function(_0x2b1e91){if(_0x2b1e91){return _0x2b8baf[_0x9a4f('0x1a')](_0x6c6371);}return _0x2b8baf['status'](_0x6c6371)[_0x9a4f('0x1b')]();};}function respondWithResult(_0x3f82b3,_0x45822b){_0x45822b=_0x45822b||0xc8;return function(_0x5833ac){if(_0x5833ac){return _0x3f82b3['status'](_0x45822b)[_0x9a4f('0x1c')](_0x5833ac);}};}function respondWithFilteredResult(_0x2f1ed9,_0x1b9bf7){return function(_0x5b5f0e){if(_0x5b5f0e){var _0x327f39=typeof _0x1b9bf7[_0x9a4f('0x1d')]===_0x9a4f('0x1e')&&typeof _0x1b9bf7['limit']==='undefined';var _0x29fb52=_0x5b5f0e['count'];var _0xe88cd3=_0x327f39?0x0:_0x1b9bf7[_0x9a4f('0x1d')];var _0x53635f=_0x327f39?_0x5b5f0e[_0x9a4f('0x1f')]:_0x1b9bf7[_0x9a4f('0x1d')]+_0x1b9bf7[_0x9a4f('0x20')];var _0x3e36d9;if(_0x53635f>=_0x29fb52){_0x53635f=_0x29fb52;_0x3e36d9=0xc8;}else{_0x3e36d9=0xce;}_0x2f1ed9[_0x9a4f('0x21')](_0x3e36d9);return _0x2f1ed9[_0x9a4f('0x22')](_0x9a4f('0x23'),_0xe88cd3+'-'+_0x53635f+'/'+_0x29fb52)['json'](_0x5b5f0e);}return null;};}function patchUpdates(_0x46c756){return function(_0x1eb0df){try{jsonpatch[_0x9a4f('0x24')](_0x1eb0df,_0x46c756,!![]);}catch(_0x2cc3d9){return BPromise[_0x9a4f('0x25')](_0x2cc3d9);}return _0x1eb0df['save']();};}function saveUpdates(_0x2ba826,_0x4ebed3){return function(_0xe8b38a){if(_0xe8b38a){return _0xe8b38a[_0x9a4f('0x26')](_0x2ba826)[_0x9a4f('0x27')](function(_0x498735){return _0x498735;});}return null;};}function removeEntity(_0x5c1df7,_0xd7af4f){return function(_0x141ec9){if(_0x141ec9){return _0x141ec9[_0x9a4f('0x28')]()[_0x9a4f('0x27')](function(){_0x5c1df7[_0x9a4f('0x21')](0xcc)[_0x9a4f('0x1b')]();});}};}function handleEntityNotFound(_0x43c2c7,_0x3958e4){return function(_0x4f1681){if(!_0x4f1681){_0x43c2c7['sendStatus'](0x194);}return _0x4f1681;};}function handleError(_0x2f5e32,_0x38bbd9){_0x38bbd9=_0x38bbd9||0x1f4;return function(_0xf48281){logger[_0x9a4f('0x29')](_0xf48281['stack']);if(_0xf48281['name']){delete _0xf48281[_0x9a4f('0x2a')];}_0x2f5e32[_0x9a4f('0x21')](_0x38bbd9)[_0x9a4f('0x2b')](_0xf48281);};}exports[_0x9a4f('0x2c')]=function(_0x5dd19f,_0x1ac219){var _0x16138d={},_0x4d51ed={},_0x586cdf={'count':0x0,'rows':[]};var _0x3f521c=_['map'](db['AnalyticFieldReport'][_0x9a4f('0x2d')],function(_0x3abd90){return{'name':_0x3abd90[_0x9a4f('0x2e')],'type':_0x3abd90[_0x9a4f('0x2f')]['key']};});_0x4d51ed[_0x9a4f('0x30')]=_[_0x9a4f('0x31')](_0x3f521c,'name');_0x4d51ed[_0x9a4f('0x32')]=_[_0x9a4f('0x33')](_0x5dd19f[_0x9a4f('0x32')]);_0x4d51ed[_0x9a4f('0x34')]=_[_0x9a4f('0x35')](_0x4d51ed['model'],_0x4d51ed['query']);_0x16138d[_0x9a4f('0x36')]=_[_0x9a4f('0x35')](_0x4d51ed[_0x9a4f('0x30')],qs['fields'](_0x5dd19f[_0x9a4f('0x32')]['fields']));_0x16138d[_0x9a4f('0x36')]=_0x16138d['attributes']['length']?_0x16138d[_0x9a4f('0x36')]:_0x4d51ed[_0x9a4f('0x30')];if(!_0x5dd19f['query'][_0x9a4f('0x37')]('nolimit')){_0x16138d[_0x9a4f('0x20')]=qs[_0x9a4f('0x20')](_0x5dd19f[_0x9a4f('0x32')][_0x9a4f('0x20')]);_0x16138d[_0x9a4f('0x1d')]=qs[_0x9a4f('0x1d')](_0x5dd19f[_0x9a4f('0x32')][_0x9a4f('0x1d')]);}_0x16138d['order']=qs[_0x9a4f('0x38')](_0x5dd19f[_0x9a4f('0x32')][_0x9a4f('0x38')]);_0x16138d[_0x9a4f('0x39')]=qs[_0x9a4f('0x34')](_['pick'](_0x5dd19f['query'],_0x4d51ed[_0x9a4f('0x34')]),_0x3f521c);if(_0x5dd19f[_0x9a4f('0x32')]['filter']){_0x16138d[_0x9a4f('0x39')]=_[_0x9a4f('0x3a')](_0x16138d[_0x9a4f('0x39')],{'$or':_[_0x9a4f('0x31')](_0x3f521c,function(_0x36d65d){if(_0x36d65d[_0x9a4f('0x2f')]!==_0x9a4f('0x3b')){var _0x5ea237={};_0x5ea237[_0x36d65d[_0x9a4f('0x2a')]]={'$like':'%'+_0x5dd19f['query'][_0x9a4f('0x3c')]+'%'};return _0x5ea237;}})});}_0x16138d=_[_0x9a4f('0x3a')]({},_0x16138d,_0x5dd19f[_0x9a4f('0x3d')]);var _0x2382e9={'where':_0x16138d[_0x9a4f('0x39')]};return db[_0x9a4f('0x3e')][_0x9a4f('0x1f')](_0x2382e9)[_0x9a4f('0x27')](function(_0x3b2283){_0x586cdf[_0x9a4f('0x1f')]=_0x3b2283;if(_0x5dd19f[_0x9a4f('0x32')][_0x9a4f('0x3f')]){_0x16138d['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9a4f('0x40')](_0x16138d);})[_0x9a4f('0x27')](function(_0x37998f){_0x586cdf[_0x9a4f('0x41')]=_0x37998f;return _0x586cdf;})['then'](respondWithFilteredResult(_0x1ac219,_0x16138d))[_0x9a4f('0x42')](handleError(_0x1ac219,null));};exports[_0x9a4f('0x43')]=function(_0x1634ea,_0x24c2a2){var _0x1baf81={'raw':![],'where':{'id':_0x1634ea[_0x9a4f('0x44')]['id']}},_0x2d90a5={};_0x2d90a5[_0x9a4f('0x30')]=_[_0x9a4f('0x33')](db[_0x9a4f('0x3e')][_0x9a4f('0x2d')]);_0x2d90a5[_0x9a4f('0x32')]=_[_0x9a4f('0x33')](_0x1634ea[_0x9a4f('0x32')]);_0x2d90a5[_0x9a4f('0x34')]=_[_0x9a4f('0x35')](_0x2d90a5[_0x9a4f('0x30')],_0x2d90a5['query']);_0x1baf81[_0x9a4f('0x36')]=_['intersection'](_0x2d90a5[_0x9a4f('0x30')],qs['fields'](_0x1634ea[_0x9a4f('0x32')][_0x9a4f('0x45')]));_0x1baf81[_0x9a4f('0x36')]=_0x1baf81[_0x9a4f('0x36')][_0x9a4f('0x46')]?_0x1baf81[_0x9a4f('0x36')]:_0x2d90a5[_0x9a4f('0x30')];if(_0x1634ea['query'][_0x9a4f('0x3f')]){_0x1baf81[_0x9a4f('0x47')]=[{'all':!![]}];}_0x1baf81=_[_0x9a4f('0x3a')]({},_0x1baf81,_0x1634ea['options']);return db[_0x9a4f('0x3e')][_0x9a4f('0x48')](_0x1baf81)['then'](handleEntityNotFound(_0x24c2a2,null))[_0x9a4f('0x27')](respondWithResult(_0x24c2a2,null))[_0x9a4f('0x42')](handleError(_0x24c2a2,null));};exports[_0x9a4f('0x49')]=function(_0x324bee,_0x1ae9fc){return db['AnalyticFieldReport'][_0x9a4f('0x49')](_0x324bee['body'],{})[_0x9a4f('0x27')](respondWithResult(_0x1ae9fc,0xc9))[_0x9a4f('0x42')](handleError(_0x1ae9fc,null));};exports['bulkCreate']=function(_0x1ec51e,_0xefc89d){return db[_0x9a4f('0x3e')][_0x9a4f('0x4a')](_0x1ec51e[_0x9a4f('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xefc89d,0xc9))[_0x9a4f('0x42')](handleError(_0xefc89d,null));};exports[_0x9a4f('0x26')]=function(_0x483523,_0xfdd10){if(_0x483523['body']['id']){delete _0x483523[_0x9a4f('0x4b')]['id'];}return db[_0x9a4f('0x3e')][_0x9a4f('0x48')]({'where':{'id':_0x483523[_0x9a4f('0x44')]['id']}})[_0x9a4f('0x27')](handleEntityNotFound(_0xfdd10,null))[_0x9a4f('0x27')](saveUpdates(_0x483523['body'],null))[_0x9a4f('0x27')](respondWithResult(_0xfdd10,null))[_0x9a4f('0x42')](handleError(_0xfdd10,null));};exports[_0x9a4f('0x28')]=function(_0x232bb5,_0x2dd0a5){return db['AnalyticFieldReport'][_0x9a4f('0x48')]({'where':{'id':_0x232bb5[_0x9a4f('0x44')]['id']}})[_0x9a4f('0x27')](handleEntityNotFound(_0x2dd0a5,null))[_0x9a4f('0x27')](removeEntity(_0x2dd0a5,null))[_0x9a4f('0x42')](handleError(_0x2dd0a5,null));};exports[_0x9a4f('0x4c')]=function(_0x5f5de1,_0x273698){return db['AnalyticFieldReport'][_0x9a4f('0x28')]({'where':{'id':_0x5f5de1[_0x9a4f('0x32')][_0x9a4f('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x273698,0xcc))[_0x9a4f('0x42')](handleError(_0x273698,null));};exports['addFields']=function(_0xce80ec,_0x19089a,_0x5f2f95){return db[_0x9a4f('0x4e')]['findOne']({'where':{'id':_0xce80ec[_0x9a4f('0x44')]['id']}})['then'](handleEntityNotFound(_0x19089a,null))[_0x9a4f('0x27')](function(_0x5c62e8){if(_0x5c62e8){return db['sequelize'][_0x9a4f('0x4f')](function(_0x46e37d){return db[_0x9a4f('0x3e')]['destroy']({'where':{'CustomReportId':_0xce80ec[_0x9a4f('0x44')]['id']},'transaction':_0x46e37d})[_0x9a4f('0x27')](function(_0x2fb047){var _0x4dce74=_[_0x9a4f('0x31')](_0xce80ec[_0x9a4f('0x4b')],function(_0x3418c9){delete _0x3418c9['id'];_0x3418c9[_0x9a4f('0x50')]=_0xce80ec[_0x9a4f('0x44')]['id'];return _0x3418c9;});return db['AnalyticFieldReport'][_0x9a4f('0x4a')](_0x4dce74,{'transaction':_0x46e37d});});})[_0x9a4f('0x27')](function(){return db[_0x9a4f('0x3e')]['findAll']({'where':{'CustomReportId':_0xce80ec['params']['id']}});});}})[_0x9a4f('0x27')](respondWithResult(_0x19089a,null))['catch'](handleError(_0x19089a,null));};
\ No newline at end of file
+var _0x7494=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','catch','show','rawAttributes','options','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7494,0x1e8));var _0x4749=function(_0x4b9ba1,_0x211e29){_0x4b9ba1=_0x4b9ba1-0x0;var _0x26b052=_0x7494[_0x4b9ba1];return _0x26b052;};'use strict';var emlformat=require(_0x4749('0x0'));var rimraf=require(_0x4749('0x1'));var zipdir=require(_0x4749('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4749('0x3'));var moment=require('moment');var BPromise=require(_0x4749('0x4'));var Mustache=require(_0x4749('0x5'));var util=require(_0x4749('0x6'));var path=require(_0x4749('0x7'));var sox=require(_0x4749('0x8'));var csv=require(_0x4749('0x9'));var ejs=require(_0x4749('0xa'));var fs=require('fs');var fs_extra=require(_0x4749('0xb'));var _=require('lodash');var squel=require(_0x4749('0xc'));var crypto=require(_0x4749('0xd'));var jsforce=require(_0x4749('0xe'));var deskjs=require(_0x4749('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4749('0x10'));var Papa=require('papaparse');var Redis=require(_0x4749('0x11'));var authService=require(_0x4749('0x12'));var qs=require(_0x4749('0x13'));var as=require(_0x4749('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4749('0x15'))('api');var utils=require(_0x4749('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4749('0x17'));var db=require(_0x4749('0x18'))['db'];function respondWithStatusCode(_0xd412d1,_0x171248){_0x171248=_0x171248||0xcc;return function(_0x45845e){if(_0x45845e){return _0xd412d1[_0x4749('0x19')](_0x171248);}return _0xd412d1[_0x4749('0x1a')](_0x171248)[_0x4749('0x1b')]();};}function respondWithResult(_0x55c44a,_0x203d33){_0x203d33=_0x203d33||0xc8;return function(_0x4fc66a){if(_0x4fc66a){return _0x55c44a[_0x4749('0x1a')](_0x203d33)[_0x4749('0x1c')](_0x4fc66a);}};}function respondWithFilteredResult(_0x1cbc3e,_0x2fcfa2){return function(_0x3bd2c5){if(_0x3bd2c5){var _0x378a70=typeof _0x2fcfa2['offset']===_0x4749('0x1d')&&typeof _0x2fcfa2[_0x4749('0x1e')]===_0x4749('0x1d');var _0x53576e=_0x3bd2c5['count'];var _0x1f235e=_0x378a70?0x0:_0x2fcfa2[_0x4749('0x1f')];var _0x362e4f=_0x378a70?_0x3bd2c5[_0x4749('0x20')]:_0x2fcfa2['offset']+_0x2fcfa2['limit'];var _0x14db2b;if(_0x362e4f>=_0x53576e){_0x362e4f=_0x53576e;_0x14db2b=0xc8;}else{_0x14db2b=0xce;}_0x1cbc3e[_0x4749('0x1a')](_0x14db2b);return _0x1cbc3e[_0x4749('0x21')](_0x4749('0x22'),_0x1f235e+'-'+_0x362e4f+'/'+_0x53576e)[_0x4749('0x1c')](_0x3bd2c5);}return null;};}function patchUpdates(_0x241a76){return function(_0x2794ea){try{jsonpatch['apply'](_0x2794ea,_0x241a76,!![]);}catch(_0x11b599){return BPromise[_0x4749('0x23')](_0x11b599);}return _0x2794ea['save']();};}function saveUpdates(_0x1ad389,_0x176420){return function(_0x8516d6){if(_0x8516d6){return _0x8516d6[_0x4749('0x24')](_0x1ad389)[_0x4749('0x25')](function(_0x14ad62){return _0x14ad62;});}return null;};}function removeEntity(_0x3b950c,_0x35f298){return function(_0xeab13c){if(_0xeab13c){return _0xeab13c[_0x4749('0x26')]()[_0x4749('0x25')](function(){_0x3b950c['status'](0xcc)[_0x4749('0x1b')]();});}};}function handleEntityNotFound(_0x91547d,_0x4e649d){return function(_0x9f1632){if(!_0x9f1632){_0x91547d[_0x4749('0x19')](0x194);}return _0x9f1632;};}function handleError(_0x4fef74,_0x36dd51){_0x36dd51=_0x36dd51||0x1f4;return function(_0x469f32){logger[_0x4749('0x27')](_0x469f32[_0x4749('0x28')]);if(_0x469f32[_0x4749('0x29')]){delete _0x469f32['name'];}_0x4fef74[_0x4749('0x1a')](_0x36dd51)[_0x4749('0x2a')](_0x469f32);};}exports['index']=function(_0x299b47,_0x53b71a){var _0x5072e9={},_0x1bc56e={},_0x9e49fc={'count':0x0,'rows':[]};var _0x967886=_[_0x4749('0x2b')](db[_0x4749('0x2c')]['rawAttributes'],function(_0x4a58c1){return{'name':_0x4a58c1[_0x4749('0x2d')],'type':_0x4a58c1[_0x4749('0x2e')][_0x4749('0x2f')]};});_0x1bc56e['model']=_[_0x4749('0x2b')](_0x967886,_0x4749('0x29'));_0x1bc56e[_0x4749('0x30')]=_[_0x4749('0x31')](_0x299b47['query']);_0x1bc56e[_0x4749('0x32')]=_[_0x4749('0x33')](_0x1bc56e[_0x4749('0x34')],_0x1bc56e[_0x4749('0x30')]);_0x5072e9['attributes']=_[_0x4749('0x33')](_0x1bc56e[_0x4749('0x34')],qs[_0x4749('0x35')](_0x299b47[_0x4749('0x30')][_0x4749('0x35')]));_0x5072e9[_0x4749('0x36')]=_0x5072e9[_0x4749('0x36')][_0x4749('0x37')]?_0x5072e9[_0x4749('0x36')]:_0x1bc56e['model'];if(!_0x299b47['query'][_0x4749('0x38')](_0x4749('0x39'))){_0x5072e9[_0x4749('0x1e')]=qs[_0x4749('0x1e')](_0x299b47['query'][_0x4749('0x1e')]);_0x5072e9[_0x4749('0x1f')]=qs[_0x4749('0x1f')](_0x299b47['query'][_0x4749('0x1f')]);}_0x5072e9[_0x4749('0x3a')]=qs[_0x4749('0x3b')](_0x299b47['query'][_0x4749('0x3b')]);_0x5072e9['where']=qs[_0x4749('0x32')](_[_0x4749('0x3c')](_0x299b47['query'],_0x1bc56e[_0x4749('0x32')]),_0x967886);if(_0x299b47[_0x4749('0x30')][_0x4749('0x3d')]){_0x5072e9[_0x4749('0x3e')]=_[_0x4749('0x3f')](_0x5072e9['where'],{'$or':_[_0x4749('0x2b')](_0x967886,function(_0x4fd305){if(_0x4fd305[_0x4749('0x2e')]!=='VIRTUAL'){var _0x5c0fdf={};_0x5c0fdf[_0x4fd305['name']]={'$like':'%'+_0x299b47[_0x4749('0x30')][_0x4749('0x3d')]+'%'};return _0x5c0fdf;}})});}_0x5072e9=_[_0x4749('0x3f')]({},_0x5072e9,_0x299b47['options']);var _0x43f449={'where':_0x5072e9[_0x4749('0x3e')]};return db['AnalyticFieldReport'][_0x4749('0x20')](_0x43f449)['then'](function(_0x6e6ba7){_0x9e49fc[_0x4749('0x20')]=_0x6e6ba7;if(_0x299b47[_0x4749('0x30')][_0x4749('0x40')]){_0x5072e9[_0x4749('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4749('0x42')](_0x5072e9);})[_0x4749('0x25')](function(_0xd9cf08){_0x9e49fc['rows']=_0xd9cf08;return _0x9e49fc;})[_0x4749('0x25')](respondWithFilteredResult(_0x53b71a,_0x5072e9))[_0x4749('0x43')](handleError(_0x53b71a,null));};exports[_0x4749('0x44')]=function(_0x50e3ca,_0x1b0ba3){var _0x2c6ae8={'raw':![],'where':{'id':_0x50e3ca['params']['id']}},_0x161790={};_0x161790[_0x4749('0x34')]=_['keys'](db[_0x4749('0x2c')][_0x4749('0x45')]);_0x161790['query']=_[_0x4749('0x31')](_0x50e3ca[_0x4749('0x30')]);_0x161790[_0x4749('0x32')]=_[_0x4749('0x33')](_0x161790[_0x4749('0x34')],_0x161790[_0x4749('0x30')]);_0x2c6ae8['attributes']=_[_0x4749('0x33')](_0x161790[_0x4749('0x34')],qs[_0x4749('0x35')](_0x50e3ca[_0x4749('0x30')][_0x4749('0x35')]));_0x2c6ae8[_0x4749('0x36')]=_0x2c6ae8[_0x4749('0x36')][_0x4749('0x37')]?_0x2c6ae8['attributes']:_0x161790[_0x4749('0x34')];if(_0x50e3ca[_0x4749('0x30')][_0x4749('0x40')]){_0x2c6ae8[_0x4749('0x41')]=[{'all':!![]}];}_0x2c6ae8=_[_0x4749('0x3f')]({},_0x2c6ae8,_0x50e3ca[_0x4749('0x46')]);return db[_0x4749('0x2c')][_0x4749('0x47')](_0x2c6ae8)[_0x4749('0x25')](handleEntityNotFound(_0x1b0ba3,null))[_0x4749('0x25')](respondWithResult(_0x1b0ba3,null))['catch'](handleError(_0x1b0ba3,null));};exports[_0x4749('0x48')]=function(_0x2d0638,_0x1eb7ae){return db['AnalyticFieldReport'][_0x4749('0x48')](_0x2d0638[_0x4749('0x49')],{})[_0x4749('0x25')](respondWithResult(_0x1eb7ae,0xc9))[_0x4749('0x43')](handleError(_0x1eb7ae,null));};exports['bulkCreate']=function(_0x39ad55,_0x863db4){return db[_0x4749('0x2c')][_0x4749('0x4a')](_0x39ad55[_0x4749('0x49')],{'raw':![],'individualHooks':!![]})[_0x4749('0x25')](respondWithResult(_0x863db4,0xc9))['catch'](handleError(_0x863db4,null));};exports[_0x4749('0x24')]=function(_0x4e8b51,_0x4afab3){if(_0x4e8b51['body']['id']){delete _0x4e8b51[_0x4749('0x49')]['id'];}return db[_0x4749('0x2c')][_0x4749('0x47')]({'where':{'id':_0x4e8b51[_0x4749('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4afab3,null))[_0x4749('0x25')](saveUpdates(_0x4e8b51['body'],null))[_0x4749('0x25')](respondWithResult(_0x4afab3,null))['catch'](handleError(_0x4afab3,null));};exports[_0x4749('0x26')]=function(_0x3ce349,_0x4b8815){return db[_0x4749('0x2c')][_0x4749('0x47')]({'where':{'id':_0x3ce349['params']['id']}})[_0x4749('0x25')](handleEntityNotFound(_0x4b8815,null))[_0x4749('0x25')](removeEntity(_0x4b8815,null))[_0x4749('0x43')](handleError(_0x4b8815,null));};exports[_0x4749('0x4c')]=function(_0x399242,_0x30f4bf){return db[_0x4749('0x2c')][_0x4749('0x26')]({'where':{'id':_0x399242[_0x4749('0x30')][_0x4749('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x4749('0x25')](respondWithResult(_0x30f4bf,0xcc))[_0x4749('0x43')](handleError(_0x30f4bf,null));};exports[_0x4749('0x4e')]=function(_0x541129,_0x30a1ca,_0x522f72){return db[_0x4749('0x4f')][_0x4749('0x50')]({'where':{'id':_0x541129[_0x4749('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30a1ca,null))[_0x4749('0x25')](function(_0x144513){if(_0x144513){return db[_0x4749('0x51')][_0x4749('0x52')](function(_0x1478da){return db[_0x4749('0x2c')][_0x4749('0x26')]({'where':{'CustomReportId':_0x541129['params']['id']},'transaction':_0x1478da})['then'](function(_0x2706de){var _0x3be598=_[_0x4749('0x2b')](_0x541129[_0x4749('0x49')],function(_0x42e934){delete _0x42e934['id'];_0x42e934[_0x4749('0x53')]=_0x541129[_0x4749('0x4b')]['id'];return _0x42e934;});return db[_0x4749('0x2c')][_0x4749('0x4a')](_0x3be598,{'transaction':_0x1478da});});})[_0x4749('0x25')](function(){return db[_0x4749('0x2c')][_0x4749('0x42')]({'where':{'CustomReportId':_0x541129[_0x4749('0x4b')]['id']}});});}})[_0x4749('0x25')](respondWithResult(_0x30a1ca,null))[_0x4749('0x43')](handleError(_0x30a1ca,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 4e29ec9..c462fdc 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 _0x2135=['rimraf','../../config/environment','./analyticFieldReport.attributes','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2146c3,_0x59a32a){var _0x7e73f=function(_0xe344b7){while(--_0xe344b7){_0x2146c3['push'](_0x2146c3['shift']());}};_0x7e73f(++_0x59a32a);}(_0x2135,0xad));var _0x5213=function(_0x2b266c,_0x39fd9f){_0x2b266c=_0x2b266c-0x0;var _0x3c38f2=_0x2135[_0x2b266c];return _0x3c38f2;};'use strict';var _=require(_0x5213('0x0'));var util=require(_0x5213('0x1'));var logger=require(_0x5213('0x2'))(_0x5213('0x3'));var moment=require(_0x5213('0x4'));var BPromise=require(_0x5213('0x5'));var rp=require(_0x5213('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5213('0x7'));var config=require(_0x5213('0x8'));var attributes=require(_0x5213('0x9'));module['exports']=function(_0x234f24,_0x2fa47e){return _0x234f24['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a7c=['exports','define','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a7c,0xf5));var _0xc7a7=function(_0x5685df,_0x2d90b1){_0x5685df=_0x5685df-0x0;var _0x598211=_0x7a7c[_0x5685df];return _0x598211;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var logger=require(_0xc7a7('0x2'))(_0xc7a7('0x3'));var moment=require('moment');var BPromise=require(_0xc7a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7a7('0x5'));var rimraf=require(_0xc7a7('0x6'));var config=require(_0xc7a7('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xc7a7('0x8')]=function(_0x3bb62b,_0x1f6fc4){return _0x3bb62b[_0xc7a7('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xc7a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 7a26b1f..bb2a851 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 _0x4341=['rpc','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x17a8b5,_0x2842bd){var _0x3c05c6=function(_0x3d85ee){while(--_0x3d85ee){_0x17a8b5['push'](_0x17a8b5['shift']());}};_0x3c05c6(++_0x2842bd);}(_0x4341,0x1dc));var _0x1434=function(_0x484ad6,_0x4efaee){_0x484ad6=_0x484ad6-0x0;var _0x4950d0=_0x4341[_0x484ad6];return _0x4950d0;};'use strict';var _=require(_0x1434('0x0'));var util=require(_0x1434('0x1'));var moment=require(_0x1434('0x2'));var BPromise=require('bluebird');var rs=require(_0x1434('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1434('0x4'))['db'];var utils=require(_0x1434('0x5'));var logger=require(_0x1434('0x6'))(_0x1434('0x7'));var config=require(_0x1434('0x8'));var jayson=require(_0x1434('0x9'));var client=jayson[_0x1434('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23bcf3,_0x3f1aca,_0x26d3f0){return new BPromise(function(_0x4e739b,_0x46cd0d){return client['request'](_0x23bcf3,_0x26d3f0)[_0x1434('0xb')](function(_0x4a9222){logger[_0x1434('0xc')](_0x1434('0xd'),_0x3f1aca,'request\x20sent');logger['debug'](_0x1434('0xe'),_0x3f1aca,_0x1434('0xf'),JSON[_0x1434('0x10')](_0x4a9222));if(_0x4a9222[_0x1434('0x11')]){if(_0x4a9222[_0x1434('0x11')][_0x1434('0x12')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3f1aca,_0x4a9222[_0x1434('0x11')][_0x1434('0x13')]);return _0x46cd0d(_0x4a9222['error'][_0x1434('0x13')]);}logger[_0x1434('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f1aca,_0x4a9222[_0x1434('0x11')][_0x1434('0x13')]);return _0x4e739b(_0x4a9222[_0x1434('0x11')][_0x1434('0x13')]);}else{logger['info'](_0x1434('0xd'),_0x3f1aca,_0x1434('0xf'));_0x4e739b(_0x4a9222[_0x1434('0x14')][_0x1434('0x13')]);}})['catch'](function(_0x4e24cf){logger[_0x1434('0x11')](_0x1434('0xd'),_0x3f1aca,_0x4e24cf);_0x46cd0d(_0x4e24cf);});});}
\ No newline at end of file
+var _0x017a=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5d897d,_0x8f648e){var _0x21a626=function(_0x43d4c9){while(--_0x43d4c9){_0x5d897d['push'](_0x5d897d['shift']());}};_0x21a626(++_0x8f648e);}(_0x017a,0x109));var _0xa017=function(_0x8dd49d,_0x44905f){_0x8dd49d=_0x8dd49d-0x0;var _0x9c74eb=_0x017a[_0x8dd49d];return _0x9c74eb;};'use strict';var _=require(_0xa017('0x0'));var util=require('util');var moment=require(_0xa017('0x1'));var BPromise=require(_0xa017('0x2'));var rs=require(_0xa017('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa017('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa017('0x5'))(_0xa017('0x6'));var config=require(_0xa017('0x7'));var jayson=require(_0xa017('0x8'));var client=jayson[_0xa017('0x9')][_0xa017('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d6701,_0x38fd91,_0x5b2eda){return new BPromise(function(_0x52f000,_0x4abacf){return client[_0xa017('0xb')](_0x2d6701,_0x5b2eda)['then'](function(_0x4e6559){logger[_0xa017('0xc')](_0xa017('0xd'),_0x38fd91,_0xa017('0xe'));logger['debug'](_0xa017('0xf'),_0x38fd91,_0xa017('0xe'),JSON[_0xa017('0x10')](_0x4e6559));if(_0x4e6559['error']){if(_0x4e6559[_0xa017('0x11')][_0xa017('0x12')]===0x1f4){logger[_0xa017('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x38fd91,_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);return _0x4abacf(_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);}logger['error'](_0xa017('0xd'),_0x38fd91,_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);return _0x52f000(_0x4e6559[_0xa017('0x11')][_0xa017('0x13')]);}else{logger[_0xa017('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x38fd91,_0xa017('0xe'));_0x52f000(_0x4e6559[_0xa017('0x14')][_0xa017('0x13')]);}})[_0xa017('0x15')](function(_0x55ed48){logger[_0xa017('0x11')](_0xa017('0xd'),_0x38fd91,_0x55ed48);_0x4abacf(_0x55ed48);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4cb677d..8be3023 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(_0x238247,_0x2d988c){var _0x5966db=function(_0xa89fb5){while(--_0xa89fb5){_0x238247['push'](_0x238247['shift']());}};_0x5966db(++_0x2d988c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x2654ec,_0x30d1ba){var _0x4c3b5=function(_0x464e80){while(--_0x464e80){_0x2654ec['push'](_0x2654ec['shift']());}};_0x4c3b5(++_0x30d1ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 e25a643..a86cbc9 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 _0xfaa4=['exports','STRING','name','TEXT','sequelize'];(function(_0x3764f8,_0x186d80){var _0x2fd9af=function(_0x3dda80){while(--_0x3dda80){_0x3764f8['push'](_0x3764f8['shift']());}};_0x2fd9af(++_0x186d80);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x271c43,_0xfa9cf5){_0x271c43=_0x271c43-0x0;var _0x28e9f9=_0xfaa4[_0x271c43];return _0x28e9f9;};'use strict';var Sequelize=require(_0x4faa('0x0'));module[_0x4faa('0x1')]={'name':{'type':Sequelize[_0x4faa('0x2')],'allowNull':![],'unique':_0x4faa('0x3')},'table':{'type':Sequelize[_0x4faa('0x2')]},'metric':{'type':Sequelize[_0x4faa('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1a83=['STRING','sequelize','exports'];(function(_0x2c4e32,_0x3a5590){var _0x1eac30=function(_0x236c8e){while(--_0x236c8e){_0x2c4e32['push'](_0x2c4e32['shift']());}};_0x1eac30(++_0x3a5590);}(_0x1a83,0x1c0));var _0x31a8=function(_0xf28cc5,_0x5a0cd2){_0xf28cc5=_0xf28cc5-0x0;var _0xd96383=_0x1a83[_0xf28cc5];return _0xd96383;};'use strict';var Sequelize=require(_0x31a8('0x0'));module[_0x31a8('0x1')]={'name':{'type':Sequelize[_0x31a8('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x31a8('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x31a8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 0182411..7506aa3 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3a4b19,_0x3be831){var _0x16f356=function(_0x3b242f){while(--_0x3b242f){_0x3a4b19['push'](_0x3a4b19['shift']());}};_0x16f356(++_0x3be831);}(_0x008c,0x188));var _0xc008=function(_0x11c4b6,_0x572fdb){_0x11c4b6=_0x11c4b6-0x0;var _0x2cb405=_0x008c[_0x11c4b6];return _0x2cb405;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x9957=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 719ad55..12dad25 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 _0x44fe=['./analyticMetric.attributes','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x44fe,0x16f));var _0xe44f=function(_0x27f970,_0x2249a6){_0x27f970=_0x27f970-0x0;var _0x3ae10f=_0x44fe[_0x27f970];return _0x3ae10f;};'use strict';var _=require(_0xe44f('0x0'));var util=require(_0xe44f('0x1'));var logger=require(_0xe44f('0x2'))(_0xe44f('0x3'));var moment=require(_0xe44f('0x4'));var BPromise=require(_0xe44f('0x5'));var rp=require(_0xe44f('0x6'));var fs=require('fs');var path=require(_0xe44f('0x7'));var rimraf=require(_0xe44f('0x8'));var config=require(_0xe44f('0x9'));var attributes=require(_0xe44f('0xa'));module['exports']=function(_0x4a41be,_0x1abe56){return _0x4a41be[_0xe44f('0xb')]('AnalyticMetric',attributes,{'tableName':_0xe44f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5419=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x1fb471,_0x5904f9){var _0x3b1354=function(_0x4dc5ef){while(--_0x4dc5ef){_0x1fb471['push'](_0x1fb471['shift']());}};_0x3b1354(++_0x5904f9);}(_0x5419,0x175));var _0x9541=function(_0x21bf3e,_0x82e5f2){_0x21bf3e=_0x21bf3e-0x0;var _0x3fdb5a=_0x5419[_0x21bf3e];return _0x3fdb5a;};'use strict';var _=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var logger=require(_0x9541('0x2'))(_0x9541('0x3'));var moment=require(_0x9541('0x4'));var BPromise=require(_0x9541('0x5'));var rp=require(_0x9541('0x6'));var fs=require('fs');var path=require(_0x9541('0x7'));var rimraf=require(_0x9541('0x8'));var config=require(_0x9541('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x9541('0xa')]=function(_0x1f9139,_0xbdabaf){return _0x1f9139[_0x9541('0xb')](_0x9541('0xc'),attributes,{'tableName':_0x9541('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 64638d2..0f8c5c1 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 _0x5020=['client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x5020,0x1ed));var _0x0502=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5020[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0502('0x0'));var util=require(_0x0502('0x1'));var moment=require(_0x0502('0x2'));var BPromise=require(_0x0502('0x3'));var rs=require(_0x0502('0x4'));var fs=require('fs');var Redis=require(_0x0502('0x5'));var db=require(_0x0502('0x6'))['db'];var utils=require(_0x0502('0x7'));var logger=require(_0x0502('0x8'))('rpc');var config=require(_0x0502('0x9'));var jayson=require(_0x0502('0xa'));var client=jayson[_0x0502('0xb')][_0x0502('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12c782,_0x11e20a,_0x401122){return new BPromise(function(_0x55d1d2,_0x340f75){return client[_0x0502('0xd')](_0x12c782,_0x401122)[_0x0502('0xe')](function(_0x29ca70){logger[_0x0502('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x11e20a,_0x0502('0x10'));logger[_0x0502('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x11e20a,'request\x20sent',JSON[_0x0502('0x12')](_0x29ca70));if(_0x29ca70[_0x0502('0x13')]){if(_0x29ca70[_0x0502('0x13')][_0x0502('0x14')]===0x1f4){logger[_0x0502('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x11e20a,_0x29ca70[_0x0502('0x13')][_0x0502('0x15')]);return _0x340f75(_0x29ca70['error'][_0x0502('0x15')]);}logger['error'](_0x0502('0x16'),_0x11e20a,_0x29ca70[_0x0502('0x13')][_0x0502('0x15')]);return _0x55d1d2(_0x29ca70[_0x0502('0x13')][_0x0502('0x15')]);}else{logger[_0x0502('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x11e20a,_0x0502('0x10'));_0x55d1d2(_0x29ca70['result'][_0x0502('0x15')]);}})[_0x0502('0x17')](function(_0x558982){logger['error'](_0x0502('0x16'),_0x11e20a,_0x558982);_0x340f75(_0x558982);});});}
\ No newline at end of file
+var _0x8162=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x11384d,_0x3294b4){var _0x4694f0=function(_0x876213){while(--_0x876213){_0x11384d['push'](_0x11384d['shift']());}};_0x4694f0(++_0x3294b4);}(_0x8162,0xb5));var _0x2816=function(_0x1fac98,_0x3a615e){_0x1fac98=_0x1fac98-0x0;var _0x56dfff=_0x8162[_0x1fac98];return _0x56dfff;};'use strict';var _=require(_0x2816('0x0'));var util=require(_0x2816('0x1'));var moment=require(_0x2816('0x2'));var BPromise=require(_0x2816('0x3'));var rs=require(_0x2816('0x4'));var fs=require('fs');var Redis=require(_0x2816('0x5'));var db=require(_0x2816('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2816('0x7'))(_0x2816('0x8'));var config=require(_0x2816('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2816('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274cee,_0x58c25c,_0x281757){return new BPromise(function(_0x573575,_0xb6f04f){return client[_0x2816('0xb')](_0x274cee,_0x281757)['then'](function(_0x12ac32){logger[_0x2816('0xc')](_0x2816('0xd'),_0x58c25c,_0x2816('0xe'));logger[_0x2816('0xf')](_0x2816('0x10'),_0x58c25c,_0x2816('0xe'),JSON[_0x2816('0x11')](_0x12ac32));if(_0x12ac32[_0x2816('0x12')]){if(_0x12ac32[_0x2816('0x12')][_0x2816('0x13')]===0x1f4){logger['error'](_0x2816('0xd'),_0x58c25c,_0x12ac32[_0x2816('0x12')][_0x2816('0x14')]);return _0xb6f04f(_0x12ac32['error'][_0x2816('0x14')]);}logger['error'](_0x2816('0xd'),_0x58c25c,_0x12ac32[_0x2816('0x12')][_0x2816('0x14')]);return _0x573575(_0x12ac32['error']['message']);}else{logger[_0x2816('0xc')](_0x2816('0xd'),_0x58c25c,_0x2816('0xe'));_0x573575(_0x12ac32[_0x2816('0x15')]['message']);}})[_0x2816('0x16')](function(_0x5be4a3){logger['error'](_0x2816('0xd'),_0x58c25c,_0x5be4a3);_0xb6f04f(_0x5be4a3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index f56f41e..edf382e 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 _0xbfda=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1efde3,_0x18c551){var _0x5d260e=function(_0x2b1e5f){while(--_0x2b1e5f){_0x1efde3['push'](_0x1efde3['shift']());}};_0x5d260e(++_0x18c551);}(_0xbfda,0x1dc));var _0xabfd=function(_0x57a402,_0x40596b){_0x57a402=_0x57a402-0x0;var _0x753a36=_0xbfda[_0x57a402];return _0x753a36;};'use strict';var multer=require(_0xabfd('0x0'));var util=require(_0xabfd('0x1'));var path=require(_0xabfd('0x2'));var timeout=require('connect-timeout');var express=require(_0xabfd('0x3'));var router=express['Router']();var fs_extra=require(_0xabfd('0x4'));var auth=require(_0xabfd('0x5'));var interaction=require(_0xabfd('0x6'));var config=require(_0xabfd('0x7'));var controller=require('./analyticMetric.controller');router[_0xabfd('0x8')]('/',auth['isAuthenticated'](),controller[_0xabfd('0x9')]);router['get'](_0xabfd('0xa'),auth['isAuthenticated'](),controller[_0xabfd('0xb')]);router[_0xabfd('0xc')]('/',auth[_0xabfd('0xd')](),controller[_0xabfd('0xe')]);router[_0xabfd('0xf')](_0xabfd('0xa'),auth['isAuthenticated'](),controller[_0xabfd('0x10')]);router[_0xabfd('0x11')](_0xabfd('0xa'),auth[_0xabfd('0xd')](),controller[_0xabfd('0x12')]);module[_0xabfd('0x13')]=router;
\ No newline at end of file
+var _0xafa5=['./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c59f0,_0x222e3d){var _0x1c87e8=function(_0x5ecba3){while(--_0x5ecba3){_0x5c59f0['push'](_0x5c59f0['shift']());}};_0x1c87e8(++_0x222e3d);}(_0xafa5,0x1af));var _0x5afa=function(_0x30e70e,_0x72c846){_0x30e70e=_0x30e70e-0x0;var _0x4a047d=_0xafa5[_0x30e70e];return _0x4a047d;};'use strict';var multer=require('multer');var util=require(_0x5afa('0x0'));var path=require(_0x5afa('0x1'));var timeout=require(_0x5afa('0x2'));var express=require(_0x5afa('0x3'));var router=express[_0x5afa('0x4')]();var fs_extra=require(_0x5afa('0x5'));var auth=require(_0x5afa('0x6'));var interaction=require(_0x5afa('0x7'));var config=require(_0x5afa('0x8'));var controller=require(_0x5afa('0x9'));router[_0x5afa('0xa')]('/',auth['isAuthenticated'](),controller[_0x5afa('0xb')]);router[_0x5afa('0xa')](_0x5afa('0xc'),auth[_0x5afa('0xd')](),controller[_0x5afa('0xe')]);router[_0x5afa('0xf')]('/',auth[_0x5afa('0xd')](),controller[_0x5afa('0x10')]);router[_0x5afa('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5afa('0x12')]);router[_0x5afa('0x13')](_0x5afa('0xc'),auth[_0x5afa('0xd')](),controller[_0x5afa('0x14')]);module[_0x5afa('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index dbb0a46..1fb0e6f 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 _0x014d=['sequelize','exports'];(function(_0x56e5c0,_0x505e34){var _0x21e3d0=function(_0xd57abd){while(--_0xd57abd){_0x56e5c0['push'](_0x56e5c0['shift']());}};_0x21e3d0(++_0x505e34);}(_0x014d,0x1b2));var _0xd014=function(_0x5ebeab,_0x1b48f3){_0x5ebeab=_0x5ebeab-0x0;var _0x188f5b=_0x014d[_0x5ebeab];return _0x188f5b;};'use strict';var Sequelize=require(_0xd014('0x0'));module[_0xd014('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x9726=['TEXT','sequelize'];(function(_0x4a80b7,_0x2b4239){var _0x23d634=function(_0x4383bd){while(--_0x4383bd){_0x4a80b7['push'](_0x4a80b7['shift']());}};_0x23d634(++_0x2b4239);}(_0x9726,0x177));var _0x6972=function(_0x7fcb0f,_0x2a5852){_0x7fcb0f=_0x7fcb0f-0x0;var _0x84ff73=_0x9726[_0x7fcb0f];return _0x84ff73;};'use strict';var Sequelize=require(_0x6972('0x0'));module['exports']={'tree':{'type':Sequelize[_0x6972('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 7bee239..c8445d0 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 _0xaab4=['destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','then','error','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','update'];(function(_0x23f0ba,_0x4a7be4){var _0x41bd76=function(_0x464c81){while(--_0x464c81){_0x23f0ba['push'](_0x23f0ba['shift']());}};_0x41bd76(++_0x4a7be4);}(_0xaab4,0xef));var _0x4aab=function(_0x1ab626,_0x456647){_0x1ab626=_0x1ab626-0x0;var _0x172722=_0xaab4[_0x1ab626];return _0x172722;};'use strict';var emlformat=require(_0x4aab('0x0'));var rimraf=require(_0x4aab('0x1'));var zipdir=require(_0x4aab('0x2'));var jsonpatch=require(_0x4aab('0x3'));var rp=require(_0x4aab('0x4'));var moment=require(_0x4aab('0x5'));var BPromise=require(_0x4aab('0x6'));var Mustache=require(_0x4aab('0x7'));var util=require(_0x4aab('0x8'));var path=require(_0x4aab('0x9'));var sox=require(_0x4aab('0xa'));var csv=require(_0x4aab('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aab('0xc'));var _=require(_0x4aab('0xd'));var squel=require(_0x4aab('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4aab('0xf'));var toCsv=require(_0x4aab('0xb'));var querystring=require(_0x4aab('0x10'));var Papa=require(_0x4aab('0x11'));var Redis=require(_0x4aab('0x12'));var authService=require(_0x4aab('0x13'));var qs=require(_0x4aab('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aab('0x15'));var logger=require(_0x4aab('0x16'))(_0x4aab('0x17'));var utils=require(_0x4aab('0x18'));var config=require(_0x4aab('0x19'));var licenseUtil=require(_0x4aab('0x1a'));var db=require(_0x4aab('0x1b'))['db'];function respondWithStatusCode(_0x27be1f,_0x210f0b){_0x210f0b=_0x210f0b||0xcc;return function(_0x5d9b3f){if(_0x5d9b3f){return _0x27be1f[_0x4aab('0x1c')](_0x210f0b);}return _0x27be1f[_0x4aab('0x1d')](_0x210f0b)[_0x4aab('0x1e')]();};}function respondWithResult(_0x26f8d5,_0x546c06){_0x546c06=_0x546c06||0xc8;return function(_0x358323){if(_0x358323){return _0x26f8d5[_0x4aab('0x1d')](_0x546c06)[_0x4aab('0x1f')](_0x358323);}};}function respondWithFilteredResult(_0x7a8e3b,_0x5ebb36){return function(_0x5e7b88){if(_0x5e7b88){var _0x3a83f4=typeof _0x5ebb36[_0x4aab('0x20')]===_0x4aab('0x21')&&typeof _0x5ebb36[_0x4aab('0x22')]===_0x4aab('0x21');var _0xd72116=_0x5e7b88[_0x4aab('0x23')];var _0x7b41b2=_0x3a83f4?0x0:_0x5ebb36['offset'];var _0x422ca5=_0x3a83f4?_0x5e7b88[_0x4aab('0x23')]:_0x5ebb36[_0x4aab('0x20')]+_0x5ebb36[_0x4aab('0x22')];var _0x40b813;if(_0x422ca5>=_0xd72116){_0x422ca5=_0xd72116;_0x40b813=0xc8;}else{_0x40b813=0xce;}_0x7a8e3b['status'](_0x40b813);return _0x7a8e3b[_0x4aab('0x24')](_0x4aab('0x25'),_0x7b41b2+'-'+_0x422ca5+'/'+_0xd72116)[_0x4aab('0x1f')](_0x5e7b88);}return null;};}function patchUpdates(_0xd93f85){return function(_0x346e27){try{jsonpatch[_0x4aab('0x26')](_0x346e27,_0xd93f85,!![]);}catch(_0xb895e9){return BPromise[_0x4aab('0x27')](_0xb895e9);}return _0x346e27[_0x4aab('0x28')]();};}function saveUpdates(_0x32961d,_0x32ded1){return function(_0x237e12){if(_0x237e12){return _0x237e12['update'](_0x32961d)[_0x4aab('0x29')](function(_0x30eff4){return _0x30eff4;});}return null;};}function removeEntity(_0x383adb,_0x3c0cfc){return function(_0x15dccd){if(_0x15dccd){return _0x15dccd['destroy']()[_0x4aab('0x29')](function(){_0x383adb[_0x4aab('0x1d')](0xcc)[_0x4aab('0x1e')]();});}};}function handleEntityNotFound(_0x34e8f5,_0x266ef0){return function(_0x502276){if(!_0x502276){_0x34e8f5['sendStatus'](0x194);}return _0x502276;};}function handleError(_0x58cc1a,_0x23bc14){_0x23bc14=_0x23bc14||0x1f4;return function(_0x4af5ff){logger[_0x4aab('0x2a')](_0x4af5ff[_0x4aab('0x2b')]);if(_0x4af5ff[_0x4aab('0x2c')]){delete _0x4af5ff['name'];}_0x58cc1a[_0x4aab('0x1d')](_0x23bc14)[_0x4aab('0x2d')](_0x4af5ff);};}exports['index']=function(_0x2ad245,_0x147a47){var _0x3f019e={},_0x2b304a={},_0x1317e5={'count':0x0,'rows':[]};var _0xd07a3a=_['map'](db[_0x4aab('0x2e')][_0x4aab('0x2f')],function(_0x296e37){return{'name':_0x296e37[_0x4aab('0x30')],'type':_0x296e37[_0x4aab('0x31')][_0x4aab('0x32')]};});_0x2b304a[_0x4aab('0x33')]=_['map'](_0xd07a3a,_0x4aab('0x2c'));_0x2b304a[_0x4aab('0x34')]=_[_0x4aab('0x35')](_0x2ad245[_0x4aab('0x34')]);_0x2b304a[_0x4aab('0x36')]=_[_0x4aab('0x37')](_0x2b304a[_0x4aab('0x33')],_0x2b304a[_0x4aab('0x34')]);_0x3f019e[_0x4aab('0x38')]=_['intersection'](_0x2b304a[_0x4aab('0x33')],qs['fields'](_0x2ad245[_0x4aab('0x34')][_0x4aab('0x39')]));_0x3f019e[_0x4aab('0x38')]=_0x3f019e[_0x4aab('0x38')][_0x4aab('0x3a')]?_0x3f019e['attributes']:_0x2b304a[_0x4aab('0x33')];if(!_0x2ad245['query'][_0x4aab('0x3b')]('nolimit')){_0x3f019e[_0x4aab('0x22')]=qs[_0x4aab('0x22')](_0x2ad245[_0x4aab('0x34')][_0x4aab('0x22')]);_0x3f019e[_0x4aab('0x20')]=qs[_0x4aab('0x20')](_0x2ad245[_0x4aab('0x34')][_0x4aab('0x20')]);}_0x3f019e[_0x4aab('0x3c')]=qs[_0x4aab('0x3d')](_0x2ad245['query'][_0x4aab('0x3d')]);_0x3f019e['where']=qs[_0x4aab('0x36')](_['pick'](_0x2ad245['query'],_0x2b304a[_0x4aab('0x36')]),_0xd07a3a);if(_0x2ad245['query']['filter']){_0x3f019e[_0x4aab('0x3e')]=_[_0x4aab('0x3f')](_0x3f019e[_0x4aab('0x3e')],{'$or':_[_0x4aab('0x40')](_0xd07a3a,function(_0x595577){if(_0x595577[_0x4aab('0x31')]!==_0x4aab('0x41')){var _0x2fa167={};_0x2fa167[_0x595577[_0x4aab('0x2c')]]={'$like':'%'+_0x2ad245[_0x4aab('0x34')][_0x4aab('0x42')]+'%'};return _0x2fa167;}})});}_0x3f019e=_[_0x4aab('0x3f')]({},_0x3f019e,_0x2ad245[_0x4aab('0x43')]);var _0x1a6fd6={'where':_0x3f019e['where']};return db[_0x4aab('0x2e')]['count'](_0x1a6fd6)['then'](function(_0x114fdd){_0x1317e5[_0x4aab('0x23')]=_0x114fdd;if(_0x2ad245[_0x4aab('0x34')][_0x4aab('0x44')]){_0x3f019e[_0x4aab('0x45')]=[{'all':!![]}];}return db[_0x4aab('0x2e')]['findAll'](_0x3f019e);})[_0x4aab('0x29')](function(_0x25d4d7){_0x1317e5[_0x4aab('0x46')]=_0x25d4d7;return _0x1317e5;})[_0x4aab('0x29')](respondWithFilteredResult(_0x147a47,_0x3f019e))[_0x4aab('0x47')](handleError(_0x147a47,null));};exports[_0x4aab('0x48')]=function(_0x1004ba,_0x458b53){var _0x1bd544={'raw':!![],'where':{'id':_0x1004ba['params']['id']}},_0x2e891c={};_0x2e891c[_0x4aab('0x33')]=_['keys'](db['AnalyticTreeReport'][_0x4aab('0x2f')]);_0x2e891c['query']=_['keys'](_0x1004ba[_0x4aab('0x34')]);_0x2e891c[_0x4aab('0x36')]=_[_0x4aab('0x37')](_0x2e891c[_0x4aab('0x33')],_0x2e891c[_0x4aab('0x34')]);_0x1bd544[_0x4aab('0x38')]=_['intersection'](_0x2e891c[_0x4aab('0x33')],qs[_0x4aab('0x39')](_0x1004ba[_0x4aab('0x34')][_0x4aab('0x39')]));_0x1bd544['attributes']=_0x1bd544[_0x4aab('0x38')]['length']?_0x1bd544[_0x4aab('0x38')]:_0x2e891c[_0x4aab('0x33')];if(_0x1004ba[_0x4aab('0x34')][_0x4aab('0x44')]){_0x1bd544[_0x4aab('0x45')]=[{'all':!![]}];}_0x1bd544=_[_0x4aab('0x3f')]({},_0x1bd544,_0x1004ba[_0x4aab('0x43')]);return db[_0x4aab('0x2e')][_0x4aab('0x49')](_0x1bd544)['then'](handleEntityNotFound(_0x458b53,null))[_0x4aab('0x29')](respondWithResult(_0x458b53,null))[_0x4aab('0x47')](handleError(_0x458b53,null));};exports[_0x4aab('0x4a')]=function(_0x1c2cf1,_0x3a1f60){return db[_0x4aab('0x2e')]['create'](_0x1c2cf1[_0x4aab('0x4b')],{})[_0x4aab('0x29')](respondWithResult(_0x3a1f60,0xc9))['catch'](handleError(_0x3a1f60,null));};exports[_0x4aab('0x4c')]=function(_0x933a34,_0x347e4d){if(_0x933a34[_0x4aab('0x4b')]['id']){delete _0x933a34[_0x4aab('0x4b')]['id'];}return db[_0x4aab('0x2e')][_0x4aab('0x49')]({'where':{'id':_0x933a34['params']['id']}})[_0x4aab('0x29')](handleEntityNotFound(_0x347e4d,null))[_0x4aab('0x29')](saveUpdates(_0x933a34[_0x4aab('0x4b')],null))[_0x4aab('0x29')](respondWithResult(_0x347e4d,null))[_0x4aab('0x47')](handleError(_0x347e4d,null));};exports[_0x4aab('0x4d')]=function(_0xed1450,_0x4ef18f){return db[_0x4aab('0x2e')][_0x4aab('0x49')]({'where':{'id':_0xed1450[_0x4aab('0x4e')]['id']}})[_0x4aab('0x29')](handleEntityNotFound(_0x4ef18f,null))[_0x4aab('0x29')](removeEntity(_0x4ef18f,null))['catch'](handleError(_0x4ef18f,null));};
\ No newline at end of file
+var _0xc425=['mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','AnalyticTreeReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x555ee4,_0x3ae4ae){var _0x5b3a5e=function(_0x4996ed){while(--_0x4996ed){_0x555ee4['push'](_0x555ee4['shift']());}};_0x5b3a5e(++_0x3ae4ae);}(_0xc425,0x11e));var _0x5c42=function(_0x137557,_0x29eb2b){_0x137557=_0x137557-0x0;var _0x4d1908=_0xc425[_0x137557];return _0x4d1908;};'use strict';var emlformat=require(_0x5c42('0x0'));var rimraf=require(_0x5c42('0x1'));var zipdir=require(_0x5c42('0x2'));var jsonpatch=require(_0x5c42('0x3'));var rp=require(_0x5c42('0x4'));var moment=require(_0x5c42('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c42('0x6'));var util=require(_0x5c42('0x7'));var path=require(_0x5c42('0x8'));var sox=require(_0x5c42('0x9'));var csv=require(_0x5c42('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c42('0xb'));var _=require('lodash');var squel=require(_0x5c42('0xc'));var crypto=require('crypto');var jsforce=require(_0x5c42('0xd'));var deskjs=require(_0x5c42('0xe'));var toCsv=require(_0x5c42('0xa'));var querystring=require(_0x5c42('0xf'));var Papa=require(_0x5c42('0x10'));var Redis=require('ioredis');var authService=require(_0x5c42('0x11'));var qs=require(_0x5c42('0x12'));var as=require(_0x5c42('0x13'));var hardwareService=require(_0x5c42('0x14'));var logger=require(_0x5c42('0x15'))('api');var utils=require(_0x5c42('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5c42('0x17'))['db'];function respondWithStatusCode(_0x2c1f93,_0x53482f){_0x53482f=_0x53482f||0xcc;return function(_0x492e44){if(_0x492e44){return _0x2c1f93['sendStatus'](_0x53482f);}return _0x2c1f93[_0x5c42('0x18')](_0x53482f)[_0x5c42('0x19')]();};}function respondWithResult(_0x374b9f,_0x11ff81){_0x11ff81=_0x11ff81||0xc8;return function(_0x217c96){if(_0x217c96){return _0x374b9f[_0x5c42('0x18')](_0x11ff81)[_0x5c42('0x1a')](_0x217c96);}};}function respondWithFilteredResult(_0x1e120c,_0x3c62b9){return function(_0x1522e1){if(_0x1522e1){var _0x5f583f=typeof _0x3c62b9[_0x5c42('0x1b')]===_0x5c42('0x1c')&&typeof _0x3c62b9[_0x5c42('0x1d')]===_0x5c42('0x1c');var _0x30408b=_0x1522e1[_0x5c42('0x1e')];var _0x5c3e63=_0x5f583f?0x0:_0x3c62b9[_0x5c42('0x1b')];var _0x405665=_0x5f583f?_0x1522e1[_0x5c42('0x1e')]:_0x3c62b9[_0x5c42('0x1b')]+_0x3c62b9[_0x5c42('0x1d')];var _0x2c47b3;if(_0x405665>=_0x30408b){_0x405665=_0x30408b;_0x2c47b3=0xc8;}else{_0x2c47b3=0xce;}_0x1e120c[_0x5c42('0x18')](_0x2c47b3);return _0x1e120c[_0x5c42('0x1f')]('Content-Range',_0x5c3e63+'-'+_0x405665+'/'+_0x30408b)['json'](_0x1522e1);}return null;};}function patchUpdates(_0xb7bd3c){return function(_0xf5bc22){try{jsonpatch[_0x5c42('0x20')](_0xf5bc22,_0xb7bd3c,!![]);}catch(_0x3bc1b9){return BPromise[_0x5c42('0x21')](_0x3bc1b9);}return _0xf5bc22[_0x5c42('0x22')]();};}function saveUpdates(_0x126274,_0xeff789){return function(_0x1dd10f){if(_0x1dd10f){return _0x1dd10f[_0x5c42('0x23')](_0x126274)[_0x5c42('0x24')](function(_0x162ce0){return _0x162ce0;});}return null;};}function removeEntity(_0x38095b,_0x1a1568){return function(_0x575ff0){if(_0x575ff0){return _0x575ff0[_0x5c42('0x25')]()[_0x5c42('0x24')](function(){_0x38095b['status'](0xcc)[_0x5c42('0x19')]();});}};}function handleEntityNotFound(_0x546988,_0x155983){return function(_0x490bc8){if(!_0x490bc8){_0x546988[_0x5c42('0x26')](0x194);}return _0x490bc8;};}function handleError(_0x1a4e43,_0x4f4f3a){_0x4f4f3a=_0x4f4f3a||0x1f4;return function(_0x405d6c){logger['error'](_0x405d6c[_0x5c42('0x27')]);if(_0x405d6c['name']){delete _0x405d6c[_0x5c42('0x28')];}_0x1a4e43[_0x5c42('0x18')](_0x4f4f3a)[_0x5c42('0x29')](_0x405d6c);};}exports[_0x5c42('0x2a')]=function(_0x48bb4f,_0x15e09e){var _0x108f1a={},_0x4d4a9d={},_0x41bebe={'count':0x0,'rows':[]};var _0x1ef65c=_[_0x5c42('0x2b')](db['AnalyticTreeReport'][_0x5c42('0x2c')],function(_0x161d18){return{'name':_0x161d18[_0x5c42('0x2d')],'type':_0x161d18['type']['key']};});_0x4d4a9d[_0x5c42('0x2e')]=_['map'](_0x1ef65c,_0x5c42('0x28'));_0x4d4a9d[_0x5c42('0x2f')]=_[_0x5c42('0x30')](_0x48bb4f[_0x5c42('0x2f')]);_0x4d4a9d[_0x5c42('0x31')]=_[_0x5c42('0x32')](_0x4d4a9d[_0x5c42('0x2e')],_0x4d4a9d[_0x5c42('0x2f')]);_0x108f1a[_0x5c42('0x33')]=_[_0x5c42('0x32')](_0x4d4a9d[_0x5c42('0x2e')],qs[_0x5c42('0x34')](_0x48bb4f['query'][_0x5c42('0x34')]));_0x108f1a['attributes']=_0x108f1a[_0x5c42('0x33')]['length']?_0x108f1a['attributes']:_0x4d4a9d['model'];if(!_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x35')](_0x5c42('0x36'))){_0x108f1a[_0x5c42('0x1d')]=qs[_0x5c42('0x1d')](_0x48bb4f['query'][_0x5c42('0x1d')]);_0x108f1a['offset']=qs[_0x5c42('0x1b')](_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x1b')]);}_0x108f1a['order']=qs[_0x5c42('0x37')](_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x37')]);_0x108f1a[_0x5c42('0x38')]=qs[_0x5c42('0x31')](_['pick'](_0x48bb4f['query'],_0x4d4a9d[_0x5c42('0x31')]),_0x1ef65c);if(_0x48bb4f['query']['filter']){_0x108f1a[_0x5c42('0x38')]=_[_0x5c42('0x39')](_0x108f1a[_0x5c42('0x38')],{'$or':_[_0x5c42('0x2b')](_0x1ef65c,function(_0x3b00c6){if(_0x3b00c6[_0x5c42('0x3a')]!==_0x5c42('0x3b')){var _0x3baa8b={};_0x3baa8b[_0x3b00c6[_0x5c42('0x28')]]={'$like':'%'+_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x3c')]+'%'};return _0x3baa8b;}})});}_0x108f1a=_[_0x5c42('0x39')]({},_0x108f1a,_0x48bb4f[_0x5c42('0x3d')]);var _0x4a053f={'where':_0x108f1a[_0x5c42('0x38')]};return db[_0x5c42('0x3e')]['count'](_0x4a053f)[_0x5c42('0x24')](function(_0x2b6088){_0x41bebe['count']=_0x2b6088;if(_0x48bb4f[_0x5c42('0x2f')][_0x5c42('0x3f')]){_0x108f1a[_0x5c42('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x5c42('0x41')](_0x108f1a);})['then'](function(_0x17c706){_0x41bebe[_0x5c42('0x42')]=_0x17c706;return _0x41bebe;})[_0x5c42('0x24')](respondWithFilteredResult(_0x15e09e,_0x108f1a))['catch'](handleError(_0x15e09e,null));};exports[_0x5c42('0x43')]=function(_0x3c8a9b,_0x1658cb){var _0x8e9afd={'raw':!![],'where':{'id':_0x3c8a9b[_0x5c42('0x44')]['id']}},_0x4b5847={};_0x4b5847[_0x5c42('0x2e')]=_[_0x5c42('0x30')](db['AnalyticTreeReport'][_0x5c42('0x2c')]);_0x4b5847[_0x5c42('0x2f')]=_[_0x5c42('0x30')](_0x3c8a9b['query']);_0x4b5847['filters']=_[_0x5c42('0x32')](_0x4b5847[_0x5c42('0x2e')],_0x4b5847[_0x5c42('0x2f')]);_0x8e9afd[_0x5c42('0x33')]=_['intersection'](_0x4b5847[_0x5c42('0x2e')],qs[_0x5c42('0x34')](_0x3c8a9b[_0x5c42('0x2f')]['fields']));_0x8e9afd[_0x5c42('0x33')]=_0x8e9afd[_0x5c42('0x33')]['length']?_0x8e9afd['attributes']:_0x4b5847[_0x5c42('0x2e')];if(_0x3c8a9b[_0x5c42('0x2f')][_0x5c42('0x3f')]){_0x8e9afd['include']=[{'all':!![]}];}_0x8e9afd=_[_0x5c42('0x39')]({},_0x8e9afd,_0x3c8a9b['options']);return db[_0x5c42('0x3e')][_0x5c42('0x45')](_0x8e9afd)[_0x5c42('0x24')](handleEntityNotFound(_0x1658cb,null))[_0x5c42('0x24')](respondWithResult(_0x1658cb,null))[_0x5c42('0x46')](handleError(_0x1658cb,null));};exports[_0x5c42('0x47')]=function(_0x436016,_0x37658b){return db[_0x5c42('0x3e')][_0x5c42('0x47')](_0x436016['body'],{})[_0x5c42('0x24')](respondWithResult(_0x37658b,0xc9))['catch'](handleError(_0x37658b,null));};exports[_0x5c42('0x23')]=function(_0x18df3a,_0x4a73d0){if(_0x18df3a['body']['id']){delete _0x18df3a[_0x5c42('0x48')]['id'];}return db[_0x5c42('0x3e')][_0x5c42('0x45')]({'where':{'id':_0x18df3a['params']['id']}})[_0x5c42('0x24')](handleEntityNotFound(_0x4a73d0,null))[_0x5c42('0x24')](saveUpdates(_0x18df3a[_0x5c42('0x48')],null))[_0x5c42('0x24')](respondWithResult(_0x4a73d0,null))['catch'](handleError(_0x4a73d0,null));};exports[_0x5c42('0x25')]=function(_0x41d4c1,_0x890e6a){return db['AnalyticTreeReport']['find']({'where':{'id':_0x41d4c1['params']['id']}})[_0x5c42('0x24')](handleEntityNotFound(_0x890e6a,null))[_0x5c42('0x24')](removeEntity(_0x890e6a,null))[_0x5c42('0x46')](handleError(_0x890e6a,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 354585c..1394cb5 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 _0x7612=['exports','define','AnalyticTreeReport','analytics_report_trees','lodash','bluebird','path','rimraf','./analyticTreeReport.attributes'];(function(_0x53f903,_0x381df0){var _0x4cb3fa=function(_0x359c74){while(--_0x359c74){_0x53f903['push'](_0x53f903['shift']());}};_0x4cb3fa(++_0x381df0);}(_0x7612,0x1bd));var _0x2761=function(_0x5a7618,_0x3f44c2){_0x5a7618=_0x5a7618-0x0;var _0x12dc65=_0x7612[_0x5a7618];return _0x12dc65;};'use strict';var _=require(_0x2761('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2761('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2761('0x2'));var rimraf=require(_0x2761('0x3'));var config=require('../../config/environment');var attributes=require(_0x2761('0x4'));module[_0x2761('0x5')]=function(_0x471207,_0x2d6fc9){return _0x471207[_0x2761('0x6')](_0x2761('0x7'),attributes,{'tableName':_0x2761('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed08=['path','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','lodash','api','moment','request-promise'];(function(_0x15f28f,_0x515cd0){var _0x1f6082=function(_0x47465b){while(--_0x47465b){_0x15f28f['push'](_0x15f28f['shift']());}};_0x1f6082(++_0x515cd0);}(_0xed08,0x152));var _0x8ed0=function(_0x3d8938,_0x3f1107){_0x3d8938=_0x3d8938-0x0;var _0x7562=_0xed08[_0x3d8938];return _0x7562;};'use strict';var _=require(_0x8ed0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ed0('0x1'));var moment=require(_0x8ed0('0x2'));var BPromise=require('bluebird');var rp=require(_0x8ed0('0x3'));var fs=require('fs');var path=require(_0x8ed0('0x4'));var rimraf=require('rimraf');var config=require(_0x8ed0('0x5'));var attributes=require(_0x8ed0('0x6'));module['exports']=function(_0x3f38e0,_0x24ba12){return _0x3f38e0[_0x8ed0('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0x8ed0('0x8'),'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 887f20e..d7210df 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2c687d,_0x492b42){var _0x13b09c=function(_0x4a9324){while(--_0x4a9324){_0x2c687d['push'](_0x2c687d['shift']());}};_0x13b09c(++_0x492b42);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x38f993,_0x20d110){var _0xaefddb=function(_0x4c51bb){while(--_0x4c51bb){_0x38f993['push'](_0x38f993['shift']());}};_0xaefddb(++_0x20d110);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 89b5ba0..6f31574 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 _0x1f65=['isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1f65,0x17a));var _0x51f6=function(_0x48f8d5,_0x34f897){_0x48f8d5=_0x48f8d5-0x0;var _0x47f9e5=_0x1f65[_0x48f8d5];return _0x47f9e5;};'use strict';var multer=require(_0x51f6('0x0'));var util=require(_0x51f6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x51f6('0x2'));var router=express['Router']();var fs_extra=require(_0x51f6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x51f6('0x4'));var config=require(_0x51f6('0x5'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x51f6('0x6')](),controller['index']);router[_0x51f6('0x7')](_0x51f6('0x8'),auth[_0x51f6('0x6')](),controller[_0x51f6('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x51f6('0xa')]);router[_0x51f6('0xb')](_0x51f6('0x8'),auth[_0x51f6('0x6')](),controller[_0x51f6('0xc')]);router[_0x51f6('0xd')](_0x51f6('0x8'),auth[_0x51f6('0x6')](),controller[_0x51f6('0xe')]);module[_0x51f6('0xf')]=router;
\ No newline at end of file
+var _0x24b8=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x326b39,_0x28db22){var _0x12c667=function(_0x371f73){while(--_0x371f73){_0x326b39['push'](_0x326b39['shift']());}};_0x12c667(++_0x28db22);}(_0x24b8,0x10b));var _0x824b=function(_0x2bf1d6,_0x410efd){_0x2bf1d6=_0x2bf1d6-0x0;var _0x1be08a=_0x24b8[_0x2bf1d6];return _0x1be08a;};'use strict';var multer=require(_0x824b('0x0'));var util=require(_0x824b('0x1'));var path=require(_0x824b('0x2'));var timeout=require(_0x824b('0x3'));var express=require(_0x824b('0x4'));var router=express[_0x824b('0x5')]();var fs_extra=require(_0x824b('0x6'));var auth=require(_0x824b('0x7'));var interaction=require(_0x824b('0x8'));var config=require(_0x824b('0x9'));var controller=require(_0x824b('0xa'));router['get']('/',auth[_0x824b('0xb')](),controller['index']);router['get']('/:id',auth[_0x824b('0xb')](),controller[_0x824b('0xc')]);router['post']('/',auth[_0x824b('0xb')](),controller['create']);router[_0x824b('0xd')](_0x824b('0xe'),auth['isAuthenticated'](),controller[_0x824b('0xf')]);router[_0x824b('0x10')](_0x824b('0xe'),auth['isAuthenticated'](),controller[_0x824b('0x11')]);module[_0x824b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 679cfb8..e8f13fa 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 _0x5bbd=['exports','STRING','sequelize'];(function(_0x18240a,_0x514f8e){var _0x5479e5=function(_0x11de18){while(--_0x11de18){_0x18240a['push'](_0x18240a['shift']());}};_0x5479e5(++_0x514f8e);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd5bb('0x0'));module[_0xd5bb('0x1')]={'name':{'type':Sequelize[_0xd5bb('0x2')]},'basename':{'type':Sequelize[_0xd5bb('0x2')]},'type':{'type':Sequelize[_0xd5bb('0x2')]}};
\ No newline at end of file
+var _0xe14d=['exports','STRING','sequelize'];(function(_0x24c39a,_0x48fc91){var _0x4c2fa6=function(_0x300241){while(--_0x300241){_0x24c39a['push'](_0x24c39a['shift']());}};_0x4c2fa6(++_0x48fc91);}(_0xe14d,0x1ee));var _0xde14=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xe14d[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'basename':{'type':Sequelize[_0xde14('0x2')]},'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 09a9a96..c26e1e0 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 _0x356e=['show','intersection','find','clone','length','createdAt','updatedAt','body','omit','create','params','file','originalname','filename','download','findOne','join','root','offline-chat/','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','apply','update','then','destroy','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch'];(function(_0x339482,_0x5f3fc3){var _0xb8441e=function(_0x4e5c46){while(--_0x4e5c46){_0x339482['push'](_0x339482['shift']());}};_0xb8441e(++_0x5f3fc3);}(_0x356e,0xb3));var _0xe356=function(_0x20db3c,_0x2fda98){_0x20db3c=_0x20db3c-0x0;var _0x10daa=_0x356e[_0x20db3c];return _0x10daa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe356('0x0'));var zipdir=require(_0xe356('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe356('0x2'));var BPromise=require(_0xe356('0x3'));var Mustache=require('mustache');var util=require(_0xe356('0x4'));var path=require(_0xe356('0x5'));var sox=require(_0xe356('0x6'));var csv=require(_0xe356('0x7'));var ejs=require(_0xe356('0x8'));var fs=require('fs');var fs_extra=require(_0xe356('0x9'));var _=require(_0xe356('0xa'));var squel=require(_0xe356('0xb'));var crypto=require(_0xe356('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe356('0xd'));var Papa=require(_0xe356('0xe'));var Redis=require(_0xe356('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe356('0x10'));var as=require(_0xe356('0x11'));var hardwareService=require(_0xe356('0x12'));var logger=require('../../config/logger')(_0xe356('0x13'));var utils=require(_0xe356('0x14'));var config=require(_0xe356('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe356('0x16'))['db'];function respondWithStatusCode(_0x250ad5,_0x521006){_0x521006=_0x521006||0xcc;return function(_0x44261c){if(_0x44261c){return _0x250ad5['sendStatus'](_0x521006);}return _0x250ad5[_0xe356('0x17')](_0x521006)['end']();};}function respondWithResult(_0x2a1009,_0x3fcf3f){_0x3fcf3f=_0x3fcf3f||0xc8;return function(_0x1e7d0d){if(_0x1e7d0d){return _0x2a1009['status'](_0x3fcf3f)[_0xe356('0x18')](_0x1e7d0d);}};}function respondWithFilteredResult(_0x34ff5c,_0x33b50e){return function(_0x5192f1){if(_0x5192f1){var _0x215ec1=typeof _0x33b50e[_0xe356('0x19')]===_0xe356('0x1a')&&typeof _0x33b50e[_0xe356('0x1b')]==='undefined';var _0x513c9b=_0x5192f1[_0xe356('0x1c')];var _0x379341=_0x215ec1?0x0:_0x33b50e['offset'];var _0x4fcd4d=_0x215ec1?_0x5192f1[_0xe356('0x1c')]:_0x33b50e['offset']+_0x33b50e[_0xe356('0x1b')];var _0x43e1ea;if(_0x4fcd4d>=_0x513c9b){_0x4fcd4d=_0x513c9b;_0x43e1ea=0xc8;}else{_0x43e1ea=0xce;}_0x34ff5c['status'](_0x43e1ea);return _0x34ff5c['set']('Content-Range',_0x379341+'-'+_0x4fcd4d+'/'+_0x513c9b)[_0xe356('0x18')](_0x5192f1);}return null;};}function patchUpdates(_0x2e6daf){return function(_0x870be5){try{jsonpatch[_0xe356('0x1d')](_0x870be5,_0x2e6daf,!![]);}catch(_0x1c5790){return BPromise['reject'](_0x1c5790);}return _0x870be5['save']();};}function saveUpdates(_0x3dc36e,_0x3e5eda){return function(_0x4dc6a3){if(_0x4dc6a3){return _0x4dc6a3[_0xe356('0x1e')](_0x3dc36e)[_0xe356('0x1f')](function(_0x2a8363){return _0x2a8363;});}return null;};}function removeEntity(_0x4cdc07,_0x37b33a){return function(_0x4074f7){if(_0x4074f7){return _0x4074f7[_0xe356('0x20')]()[_0xe356('0x1f')](function(){_0x4cdc07[_0xe356('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfc563b,_0x277d1c){return function(_0x398068){if(!_0x398068){_0xfc563b[_0xe356('0x21')](0x194);}return _0x398068;};}function handleError(_0x79c943,_0x457055){_0x457055=_0x457055||0x1f4;return function(_0x3d9c4f){logger[_0xe356('0x22')](_0x3d9c4f[_0xe356('0x23')]);if(_0x3d9c4f[_0xe356('0x24')]){delete _0x3d9c4f[_0xe356('0x24')];}_0x79c943[_0xe356('0x17')](_0x457055)[_0xe356('0x25')](_0x3d9c4f);};}exports[_0xe356('0x26')]=function(_0x1ad70a,_0x5bad07){var _0x13a1fa={},_0x468a6c={},_0x2624d6={'count':0x0,'rows':[]};var _0x14497f=_['map'](db[_0xe356('0x27')][_0xe356('0x28')],function(_0x5255f9){return{'name':_0x5255f9[_0xe356('0x29')],'type':_0x5255f9[_0xe356('0x2a')]['key']};});_0x468a6c['model']=_[_0xe356('0x2b')](_0x14497f,'name');_0x468a6c[_0xe356('0x2c')]=_[_0xe356('0x2d')](_0x1ad70a[_0xe356('0x2c')]);_0x468a6c[_0xe356('0x2e')]=_['intersection'](_0x468a6c[_0xe356('0x2f')],_0x468a6c[_0xe356('0x2c')]);_0x13a1fa[_0xe356('0x30')]=_['intersection'](_0x468a6c[_0xe356('0x2f')],qs[_0xe356('0x31')](_0x1ad70a['query'][_0xe356('0x31')]));_0x13a1fa['attributes']=_0x13a1fa[_0xe356('0x30')]['length']?_0x13a1fa['attributes']:_0x468a6c[_0xe356('0x2f')];if(!_0x1ad70a[_0xe356('0x2c')]['hasOwnProperty']('nolimit')){_0x13a1fa[_0xe356('0x1b')]=qs[_0xe356('0x1b')](_0x1ad70a[_0xe356('0x2c')]['limit']);_0x13a1fa['offset']=qs[_0xe356('0x19')](_0x1ad70a[_0xe356('0x2c')][_0xe356('0x19')]);}_0x13a1fa[_0xe356('0x32')]=qs[_0xe356('0x33')](_0x1ad70a[_0xe356('0x2c')][_0xe356('0x33')]);_0x13a1fa[_0xe356('0x34')]=qs['filters'](_[_0xe356('0x35')](_0x1ad70a['query'],_0x468a6c[_0xe356('0x2e')]),_0x14497f);if(_0x1ad70a[_0xe356('0x2c')][_0xe356('0x36')]){_0x13a1fa[_0xe356('0x34')]=_[_0xe356('0x37')](_0x13a1fa[_0xe356('0x34')],{'$or':_[_0xe356('0x2b')](_0x14497f,function(_0x23f5d2){if(_0x23f5d2[_0xe356('0x2a')]!=='VIRTUAL'){var _0x5d9553={};_0x5d9553[_0x23f5d2[_0xe356('0x24')]]={'$like':'%'+_0x1ad70a[_0xe356('0x2c')]['filter']+'%'};return _0x5d9553;}})});}_0x13a1fa=_[_0xe356('0x37')]({},_0x13a1fa,_0x1ad70a[_0xe356('0x38')]);var _0x9c260d={'where':_0x13a1fa[_0xe356('0x34')]};return db[_0xe356('0x27')][_0xe356('0x1c')](_0x9c260d)[_0xe356('0x1f')](function(_0x345b8f){_0x2624d6['count']=_0x345b8f;if(_0x1ad70a[_0xe356('0x2c')][_0xe356('0x39')]){_0x13a1fa[_0xe356('0x3a')]=[{'all':!![]}];}return db[_0xe356('0x27')][_0xe356('0x3b')](_0x13a1fa);})[_0xe356('0x1f')](function(_0x5bee5c){_0x2624d6['rows']=_0x5bee5c;return _0x2624d6;})[_0xe356('0x1f')](respondWithFilteredResult(_0x5bad07,_0x13a1fa))[_0xe356('0x3c')](handleError(_0x5bad07,null));};exports[_0xe356('0x3d')]=function(_0x204950,_0x3934d0){var _0x25cf53={'raw':!![],'where':{'id':_0x204950['params']['id']}},_0x57d5a9={};_0x57d5a9[_0xe356('0x2f')]=_[_0xe356('0x2d')](db[_0xe356('0x27')][_0xe356('0x28')]);_0x57d5a9['query']=_[_0xe356('0x2d')](_0x204950[_0xe356('0x2c')]);_0x57d5a9[_0xe356('0x2e')]=_[_0xe356('0x3e')](_0x57d5a9['model'],_0x57d5a9[_0xe356('0x2c')]);_0x25cf53['attributes']=_['intersection'](_0x57d5a9[_0xe356('0x2f')],qs[_0xe356('0x31')](_0x204950[_0xe356('0x2c')][_0xe356('0x31')]));_0x25cf53['attributes']=_0x25cf53[_0xe356('0x30')]['length']?_0x25cf53[_0xe356('0x30')]:_0x57d5a9[_0xe356('0x2f')];if(_0x204950['query']['includeAll']){_0x25cf53[_0xe356('0x3a')]=[{'all':!![]}];}_0x25cf53=_[_0xe356('0x37')]({},_0x25cf53,_0x204950[_0xe356('0x38')]);return db['Attachment'][_0xe356('0x3f')](_0x25cf53)[_0xe356('0x1f')](handleEntityNotFound(_0x3934d0,null))['then'](respondWithResult(_0x3934d0,null))[_0xe356('0x3c')](handleError(_0x3934d0,null));};exports[_0xe356('0x40')]=function(_0x35598a,_0x321313){var _0x5d094c={'where':{'id':_0x35598a['params']['id']}},_0x5f3a6f={};_0x5f3a6f[_0xe356('0x2f')]=_[_0xe356('0x2d')](db[_0xe356('0x27')][_0xe356('0x28')]);_0x5d094c[_0xe356('0x30')]=_[_0xe356('0x3e')](_0x5f3a6f[_0xe356('0x2f')],qs[_0xe356('0x31')](_0x35598a[_0xe356('0x2c')][_0xe356('0x31')]));_0x5d094c[_0xe356('0x30')]=_0x5d094c[_0xe356('0x30')][_0xe356('0x41')]?_0x5d094c['attributes']:_0x5f3a6f['model'];if(_0x35598a[_0xe356('0x2c')][_0xe356('0x39')]){_0x5d094c[_0xe356('0x3a')]=[{'all':!![]}];}_0x5d094c=_[_0xe356('0x37')]({},_0x5d094c,_0x35598a[_0xe356('0x38')]);return db['Attachment'][_0xe356('0x3f')](_0x5d094c)[_0xe356('0x1f')](handleEntityNotFound(_0x321313,null))[_0xe356('0x1f')](function(_0x504ee8){if(_0x504ee8){var _0x642725=_0x504ee8['get']({'plain':!![]});_0x642725=qs['omit'](_0x642725,['id',_0xe356('0x42'),_0xe356('0x43')]);_0x35598a[_0xe356('0x44')]=_[_0xe356('0x45')](_0x35598a[_0xe356('0x44')],['id',_0xe356('0x42'),_0xe356('0x43')]);return db['Attachment'][_0xe356('0x46')](_['merge'](_0x642725,_0x35598a[_0xe356('0x44')]),{'include':_0x35598a[_0xe356('0x2c')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xe356('0x1f')](respondWithResult(_0x321313,0xc9))[_0xe356('0x3c')](handleError(_0x321313,null));};exports[_0xe356('0x1e')]=function(_0x4872f2,_0x178d03){if(_0x4872f2[_0xe356('0x44')]['id']){delete _0x4872f2[_0xe356('0x44')]['id'];}return db[_0xe356('0x27')][_0xe356('0x3f')]({'where':{'id':_0x4872f2[_0xe356('0x47')]['id']}})[_0xe356('0x1f')](handleEntityNotFound(_0x178d03,null))[_0xe356('0x1f')](saveUpdates(_0x4872f2['body'],null))['then'](respondWithResult(_0x178d03,null))[_0xe356('0x3c')](handleError(_0x178d03,null));};exports[_0xe356('0x20')]=function(_0x4e56e1,_0x4ce922){return db[_0xe356('0x27')][_0xe356('0x3f')]({'where':{'id':_0x4e56e1['params']['id']}})[_0xe356('0x1f')](handleEntityNotFound(_0x4ce922,null))['then'](removeEntity(_0x4ce922,null))[_0xe356('0x3c')](handleError(_0x4ce922,null));};exports[_0xe356('0x46')]=function(_0xbec5e,_0x3f9e6a,_0x298e32){_0xbec5e[_0xe356('0x44')][_0xe356('0x24')]=_0xbec5e[_0xe356('0x48')][_0xe356('0x49')];_0xbec5e['body']['basename']=_0xbec5e[_0xe356('0x48')][_0xe356('0x4a')];_0xbec5e[_0xe356('0x44')][_0xe356('0x2a')]=_0xbec5e[_0xe356('0x48')]['mimetype'];return db[_0xe356('0x27')]['create'](_0xbec5e[_0xe356('0x44')])[_0xe356('0x1f')](respondWithResult(_0x3f9e6a,0xc9))[_0xe356('0x3c')](handleError(_0x3f9e6a,null));};exports[_0xe356('0x4b')]=function(_0x24def8,_0x29c6bf,_0x5d3918){return db['Attachment'][_0xe356('0x4c')]({'where':{'id':_0x24def8['params']['id']},'raw':!![]})[_0xe356('0x1f')](handleEntityNotFound(_0x29c6bf,null))[_0xe356('0x1f')](function(_0x3b44c0){if(_0x3b44c0){var _0x1855c5=_0x3b44c0['ChatOfflineMessageId']!==null;var _0x3fd0ce=path[_0xe356('0x4d')](config[_0xe356('0x4e')],'server/files/attachments/');if(_0x1855c5){_0x3fd0ce=path[_0xe356('0x4d')](_0x3fd0ce,_0xe356('0x4f'));}var _0x26a93f=path[_0xe356('0x4d')](_0x3fd0ce,_0x3b44c0['basename']);return _0x29c6bf[_0xe356('0x4b')](_0x26a93f);}})['catch'](handleError(_0x29c6bf,null));};
\ No newline at end of file
+var _0xd2a7=['server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','Attachment','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','clone','get','updatedAt','omit','body','create','find','file','basename','filename','mimetype','download','findOne'];(function(_0x464cee,_0x302661){var _0x1f6d44=function(_0xff2b71){while(--_0xff2b71){_0x464cee['push'](_0x464cee['shift']());}};_0x1f6d44(++_0x302661);}(_0xd2a7,0x1c5));var _0x7d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7d2a('0x0'));var rimraf=require(_0x7d2a('0x1'));var zipdir=require(_0x7d2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7d2a('0x3'));var BPromise=require(_0x7d2a('0x4'));var Mustache=require(_0x7d2a('0x5'));var util=require(_0x7d2a('0x6'));var path=require(_0x7d2a('0x7'));var sox=require(_0x7d2a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d2a('0x9'));var _=require(_0x7d2a('0xa'));var squel=require(_0x7d2a('0xb'));var crypto=require('crypto');var jsforce=require(_0x7d2a('0xc'));var deskjs=require(_0x7d2a('0xd'));var toCsv=require(_0x7d2a('0xe'));var querystring=require(_0x7d2a('0xf'));var Papa=require(_0x7d2a('0x10'));var Redis=require(_0x7d2a('0x11'));var authService=require(_0x7d2a('0x12'));var qs=require(_0x7d2a('0x13'));var as=require(_0x7d2a('0x14'));var hardwareService=require(_0x7d2a('0x15'));var logger=require('../../config/logger')(_0x7d2a('0x16'));var utils=require(_0x7d2a('0x17'));var config=require(_0x7d2a('0x18'));var licenseUtil=require(_0x7d2a('0x19'));var db=require(_0x7d2a('0x1a'))['db'];function respondWithStatusCode(_0x5e7724,_0x379962){_0x379962=_0x379962||0xcc;return function(_0x15c842){if(_0x15c842){return _0x5e7724[_0x7d2a('0x1b')](_0x379962);}return _0x5e7724[_0x7d2a('0x1c')](_0x379962)[_0x7d2a('0x1d')]();};}function respondWithResult(_0x54b05d,_0x2904b6){_0x2904b6=_0x2904b6||0xc8;return function(_0x265024){if(_0x265024){return _0x54b05d[_0x7d2a('0x1c')](_0x2904b6)[_0x7d2a('0x1e')](_0x265024);}};}function respondWithFilteredResult(_0x51093e,_0x19bd81){return function(_0x59d62a){if(_0x59d62a){var _0x347410=typeof _0x19bd81[_0x7d2a('0x1f')]===_0x7d2a('0x20')&&typeof _0x19bd81[_0x7d2a('0x21')]===_0x7d2a('0x20');var _0x17a13c=_0x59d62a['count'];var _0x33a8a6=_0x347410?0x0:_0x19bd81['offset'];var _0x17c313=_0x347410?_0x59d62a[_0x7d2a('0x22')]:_0x19bd81['offset']+_0x19bd81[_0x7d2a('0x21')];var _0x1d5661;if(_0x17c313>=_0x17a13c){_0x17c313=_0x17a13c;_0x1d5661=0xc8;}else{_0x1d5661=0xce;}_0x51093e[_0x7d2a('0x1c')](_0x1d5661);return _0x51093e[_0x7d2a('0x23')](_0x7d2a('0x24'),_0x33a8a6+'-'+_0x17c313+'/'+_0x17a13c)['json'](_0x59d62a);}return null;};}function patchUpdates(_0x1a9a28){return function(_0x3687d3){try{jsonpatch[_0x7d2a('0x25')](_0x3687d3,_0x1a9a28,!![]);}catch(_0x2c982e){return BPromise[_0x7d2a('0x26')](_0x2c982e);}return _0x3687d3[_0x7d2a('0x27')]();};}function saveUpdates(_0x69df9,_0x718410){return function(_0x51395f){if(_0x51395f){return _0x51395f[_0x7d2a('0x28')](_0x69df9)['then'](function(_0x28c8b7){return _0x28c8b7;});}return null;};}function removeEntity(_0x2e841c,_0x52c16b){return function(_0x2882a4){if(_0x2882a4){return _0x2882a4[_0x7d2a('0x29')]()[_0x7d2a('0x2a')](function(){_0x2e841c[_0x7d2a('0x1c')](0xcc)[_0x7d2a('0x1d')]();});}};}function handleEntityNotFound(_0x3c809f,_0x1e0f75){return function(_0x3c499b){if(!_0x3c499b){_0x3c809f['sendStatus'](0x194);}return _0x3c499b;};}function handleError(_0x200472,_0x55cc87){_0x55cc87=_0x55cc87||0x1f4;return function(_0x54ee07){logger[_0x7d2a('0x2b')](_0x54ee07['stack']);if(_0x54ee07[_0x7d2a('0x2c')]){delete _0x54ee07['name'];}_0x200472[_0x7d2a('0x1c')](_0x55cc87)[_0x7d2a('0x2d')](_0x54ee07);};}exports['index']=function(_0x3149ac,_0x3e50ef){var _0x27b998={},_0x1b32e6={},_0x46159f={'count':0x0,'rows':[]};var _0x1584d9=_[_0x7d2a('0x2e')](db[_0x7d2a('0x2f')][_0x7d2a('0x30')],function(_0x51d58a){return{'name':_0x51d58a['fieldName'],'type':_0x51d58a[_0x7d2a('0x31')][_0x7d2a('0x32')]};});_0x1b32e6['model']=_[_0x7d2a('0x2e')](_0x1584d9,'name');_0x1b32e6[_0x7d2a('0x33')]=_[_0x7d2a('0x34')](_0x3149ac['query']);_0x1b32e6['filters']=_[_0x7d2a('0x35')](_0x1b32e6[_0x7d2a('0x36')],_0x1b32e6[_0x7d2a('0x33')]);_0x27b998[_0x7d2a('0x37')]=_[_0x7d2a('0x35')](_0x1b32e6[_0x7d2a('0x36')],qs[_0x7d2a('0x38')](_0x3149ac['query'][_0x7d2a('0x38')]));_0x27b998['attributes']=_0x27b998[_0x7d2a('0x37')]['length']?_0x27b998['attributes']:_0x1b32e6['model'];if(!_0x3149ac['query']['hasOwnProperty'](_0x7d2a('0x39'))){_0x27b998[_0x7d2a('0x21')]=qs[_0x7d2a('0x21')](_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x21')]);_0x27b998[_0x7d2a('0x1f')]=qs[_0x7d2a('0x1f')](_0x3149ac['query']['offset']);}_0x27b998['order']=qs[_0x7d2a('0x3a')](_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x3a')]);_0x27b998[_0x7d2a('0x3b')]=qs['filters'](_[_0x7d2a('0x3c')](_0x3149ac[_0x7d2a('0x33')],_0x1b32e6[_0x7d2a('0x3d')]),_0x1584d9);if(_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x3e')]){_0x27b998[_0x7d2a('0x3b')]=_[_0x7d2a('0x3f')](_0x27b998['where'],{'$or':_['map'](_0x1584d9,function(_0x37091f){if(_0x37091f[_0x7d2a('0x31')]!==_0x7d2a('0x40')){var _0x415f98={};_0x415f98[_0x37091f[_0x7d2a('0x2c')]]={'$like':'%'+_0x3149ac[_0x7d2a('0x33')]['filter']+'%'};return _0x415f98;}})});}_0x27b998=_[_0x7d2a('0x3f')]({},_0x27b998,_0x3149ac[_0x7d2a('0x41')]);var _0x489f7e={'where':_0x27b998[_0x7d2a('0x3b')]};return db[_0x7d2a('0x2f')][_0x7d2a('0x22')](_0x489f7e)[_0x7d2a('0x2a')](function(_0x3e0105){_0x46159f[_0x7d2a('0x22')]=_0x3e0105;if(_0x3149ac[_0x7d2a('0x33')][_0x7d2a('0x42')]){_0x27b998['include']=[{'all':!![]}];}return db[_0x7d2a('0x2f')][_0x7d2a('0x43')](_0x27b998);})[_0x7d2a('0x2a')](function(_0x26fe1c){_0x46159f[_0x7d2a('0x44')]=_0x26fe1c;return _0x46159f;})[_0x7d2a('0x2a')](respondWithFilteredResult(_0x3e50ef,_0x27b998))[_0x7d2a('0x45')](handleError(_0x3e50ef,null));};exports[_0x7d2a('0x46')]=function(_0xe9ca9e,_0x16e2bd){var _0x30d678={'raw':!![],'where':{'id':_0xe9ca9e[_0x7d2a('0x47')]['id']}},_0x4e4c57={};_0x4e4c57['model']=_[_0x7d2a('0x34')](db[_0x7d2a('0x2f')][_0x7d2a('0x30')]);_0x4e4c57[_0x7d2a('0x33')]=_[_0x7d2a('0x34')](_0xe9ca9e[_0x7d2a('0x33')]);_0x4e4c57[_0x7d2a('0x3d')]=_[_0x7d2a('0x35')](_0x4e4c57[_0x7d2a('0x36')],_0x4e4c57[_0x7d2a('0x33')]);_0x30d678[_0x7d2a('0x37')]=_[_0x7d2a('0x35')](_0x4e4c57['model'],qs[_0x7d2a('0x38')](_0xe9ca9e['query'][_0x7d2a('0x38')]));_0x30d678[_0x7d2a('0x37')]=_0x30d678['attributes'][_0x7d2a('0x48')]?_0x30d678[_0x7d2a('0x37')]:_0x4e4c57[_0x7d2a('0x36')];if(_0xe9ca9e[_0x7d2a('0x33')][_0x7d2a('0x42')]){_0x30d678[_0x7d2a('0x49')]=[{'all':!![]}];}_0x30d678=_[_0x7d2a('0x3f')]({},_0x30d678,_0xe9ca9e[_0x7d2a('0x41')]);return db[_0x7d2a('0x2f')]['find'](_0x30d678)[_0x7d2a('0x2a')](handleEntityNotFound(_0x16e2bd,null))['then'](respondWithResult(_0x16e2bd,null))['catch'](handleError(_0x16e2bd,null));};exports[_0x7d2a('0x4a')]=function(_0x40fcb0,_0x49ad3c){var _0x18b7a3={'where':{'id':_0x40fcb0[_0x7d2a('0x47')]['id']}},_0x1cc870={};_0x1cc870['model']=_['keys'](db['Attachment'][_0x7d2a('0x30')]);_0x18b7a3[_0x7d2a('0x37')]=_[_0x7d2a('0x35')](_0x1cc870['model'],qs['fields'](_0x40fcb0[_0x7d2a('0x33')][_0x7d2a('0x38')]));_0x18b7a3[_0x7d2a('0x37')]=_0x18b7a3[_0x7d2a('0x37')]['length']?_0x18b7a3['attributes']:_0x1cc870[_0x7d2a('0x36')];if(_0x40fcb0[_0x7d2a('0x33')][_0x7d2a('0x42')]){_0x18b7a3[_0x7d2a('0x49')]=[{'all':!![]}];}_0x18b7a3=_['merge']({},_0x18b7a3,_0x40fcb0['options']);return db['Attachment']['find'](_0x18b7a3)[_0x7d2a('0x2a')](handleEntityNotFound(_0x49ad3c,null))[_0x7d2a('0x2a')](function(_0x50e0ab){if(_0x50e0ab){var _0x55d57e=_0x50e0ab[_0x7d2a('0x4b')]({'plain':!![]});_0x55d57e=qs['omit'](_0x55d57e,['id','createdAt',_0x7d2a('0x4c')]);_0x40fcb0['body']=_[_0x7d2a('0x4d')](_0x40fcb0[_0x7d2a('0x4e')],['id','createdAt',_0x7d2a('0x4c')]);return db['Attachment'][_0x7d2a('0x4f')](_[_0x7d2a('0x3f')](_0x55d57e,_0x40fcb0['body']),{'include':_0x40fcb0[_0x7d2a('0x33')][_0x7d2a('0x42')]?[{'all':!![]}]:undefined});}})[_0x7d2a('0x2a')](respondWithResult(_0x49ad3c,0xc9))[_0x7d2a('0x45')](handleError(_0x49ad3c,null));};exports[_0x7d2a('0x28')]=function(_0x78a4f4,_0x40992d){if(_0x78a4f4[_0x7d2a('0x4e')]['id']){delete _0x78a4f4[_0x7d2a('0x4e')]['id'];}return db[_0x7d2a('0x2f')][_0x7d2a('0x50')]({'where':{'id':_0x78a4f4[_0x7d2a('0x47')]['id']}})[_0x7d2a('0x2a')](handleEntityNotFound(_0x40992d,null))[_0x7d2a('0x2a')](saveUpdates(_0x78a4f4[_0x7d2a('0x4e')],null))[_0x7d2a('0x2a')](respondWithResult(_0x40992d,null))[_0x7d2a('0x45')](handleError(_0x40992d,null));};exports['destroy']=function(_0x372af0,_0x4475d5){return db[_0x7d2a('0x2f')][_0x7d2a('0x50')]({'where':{'id':_0x372af0[_0x7d2a('0x47')]['id']}})[_0x7d2a('0x2a')](handleEntityNotFound(_0x4475d5,null))['then'](removeEntity(_0x4475d5,null))[_0x7d2a('0x45')](handleError(_0x4475d5,null));};exports[_0x7d2a('0x4f')]=function(_0x2b2db1,_0x4a626a,_0x2133f6){_0x2b2db1[_0x7d2a('0x4e')][_0x7d2a('0x2c')]=_0x2b2db1[_0x7d2a('0x51')]['originalname'];_0x2b2db1[_0x7d2a('0x4e')][_0x7d2a('0x52')]=_0x2b2db1['file'][_0x7d2a('0x53')];_0x2b2db1['body']['type']=_0x2b2db1['file'][_0x7d2a('0x54')];return db[_0x7d2a('0x2f')][_0x7d2a('0x4f')](_0x2b2db1[_0x7d2a('0x4e')])[_0x7d2a('0x2a')](respondWithResult(_0x4a626a,0xc9))[_0x7d2a('0x45')](handleError(_0x4a626a,null));};exports[_0x7d2a('0x55')]=function(_0x57ffe8,_0x108d07,_0x58ff5c){return db[_0x7d2a('0x2f')][_0x7d2a('0x56')]({'where':{'id':_0x57ffe8[_0x7d2a('0x47')]['id']},'raw':!![]})[_0x7d2a('0x2a')](handleEntityNotFound(_0x108d07,null))[_0x7d2a('0x2a')](function(_0x5c3167){if(_0x5c3167){var _0x57afb7=_0x5c3167['ChatOfflineMessageId']!==null;var _0xf435ca=path['join'](config['root'],_0x7d2a('0x57'));if(_0x57afb7){_0xf435ca=path[_0x7d2a('0x58')](_0xf435ca,_0x7d2a('0x59'));}var _0x5b6026=path[_0x7d2a('0x58')](_0xf435ca,_0x5c3167[_0x7d2a('0x52')]);return _0x108d07[_0x7d2a('0x55')](_0x5b6026);}})[_0x7d2a('0x45')](handleError(_0x108d07,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index efc34b4..efe78e3 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 _0xd186=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd82509,_0x8ac7eb){var _0x3b1dc9=function(_0x2bc874){while(--_0x2bc874){_0xd82509['push'](_0xd82509['shift']());}};_0x3b1dc9(++_0x8ac7eb);}(_0xd186,0x1bc));var _0x6d18=function(_0x3452a,_0x3a45b5){_0x3452a=_0x3452a-0x0;var _0x4ccb08=_0xd186[_0x3452a];return _0x4ccb08;};'use strict';var _=require(_0x6d18('0x0'));var util=require(_0x6d18('0x1'));var logger=require(_0x6d18('0x2'))(_0x6d18('0x3'));var moment=require(_0x6d18('0x4'));var BPromise=require(_0x6d18('0x5'));var rp=require(_0x6d18('0x6'));var fs=require('fs');var path=require(_0x6d18('0x7'));var rimraf=require(_0x6d18('0x8'));var config=require(_0x6d18('0x9'));var attributes=require(_0x6d18('0xa'));module[_0x6d18('0xb')]=function(_0x3fc0f7,_0x94d4b9){return _0x3fc0f7[_0x6d18('0xc')](_0x6d18('0xd'),attributes,{'tableName':_0x6d18('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fac=['bluebird','request-promise','../../config/environment','exports','define','Attachment','lodash','util','../../config/logger','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7fac,0x1e6));var _0xc7fa=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x7fac[_0x478414];return _0x5eb6b9;};'use strict';var _=require(_0xc7fa('0x0'));var util=require(_0xc7fa('0x1'));var logger=require(_0xc7fa('0x2'))('api');var moment=require(_0xc7fa('0x3'));var BPromise=require(_0xc7fa('0x4'));var rp=require(_0xc7fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc7fa('0x6'));var attributes=require('./attachment.attributes');module[_0xc7fa('0x7')]=function(_0x1b33e7,_0x44bbac){return _0x1b33e7[_0xc7fa('0x8')](_0xc7fa('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index d4cdccb..34c5d63 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 _0xf53f=['create','options','raw','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateAttachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf53f,0x8d));var _0xff53=function(_0x88459d,_0x55943e){_0x88459d=_0x88459d-0x0;var _0x26d673=_0xf53f[_0x88459d];return _0x26d673;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var moment=require(_0xff53('0x2'));var BPromise=require(_0xff53('0x3'));var rs=require(_0xff53('0x4'));var fs=require('fs');var Redis=require(_0xff53('0x5'));var db=require(_0xff53('0x6'))['db'];var utils=require(_0xff53('0x7'));var logger=require(_0xff53('0x8'))(_0xff53('0x9'));var config=require(_0xff53('0xa'));var jayson=require(_0xff53('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b397,_0x5751e7,_0x1c27bb){return new BPromise(function(_0x122746,_0x1bc4b3){return client['request'](_0x27b397,_0x1c27bb)['then'](function(_0x3c001d){logger['info'](_0xff53('0xc'),_0x5751e7,_0xff53('0xd'));logger['debug'](_0xff53('0xe'),_0x5751e7,_0xff53('0xd'),JSON['stringify'](_0x3c001d));if(_0x3c001d[_0xff53('0xf')]){if(_0x3c001d[_0xff53('0xf')][_0xff53('0x10')]===0x1f4){logger['error'](_0xff53('0xc'),_0x5751e7,_0x3c001d[_0xff53('0xf')][_0xff53('0x11')]);return _0x1bc4b3(_0x3c001d['error'][_0xff53('0x11')]);}logger[_0xff53('0xf')]('Attachment,\x20%s,\x20%s',_0x5751e7,_0x3c001d['error']['message']);return _0x122746(_0x3c001d['error'][_0xff53('0x11')]);}else{logger[_0xff53('0x12')](_0xff53('0xc'),_0x5751e7,'request\x20sent');_0x122746(_0x3c001d[_0xff53('0x13')]['message']);}})['catch'](function(_0x12e90b){logger[_0xff53('0xf')](_0xff53('0xc'),_0x5751e7,_0x12e90b);_0x1bc4b3(_0x12e90b);});});}exports[_0xff53('0x14')]=function(_0x38883f){var _0x319ce5=this;return new Promise(function(_0x14b502,_0x5e9ba6){return db['Attachment'][_0xff53('0x15')](_0x38883f['body'],{'raw':_0x38883f[_0xff53('0x16')]?_0x38883f[_0xff53('0x16')][_0xff53('0x17')]===undefined?!![]:![]:!![]})[_0xff53('0x18')](function(_0x39b3d1){logger[_0xff53('0x12')](_0xff53('0x14'),_0x38883f);logger[_0xff53('0x19')](_0xff53('0x14'),_0x38883f,JSON['stringify'](_0x39b3d1));_0x14b502(_0x39b3d1);})[_0xff53('0x1a')](function(_0x5cd878){logger['error']('CreateAttachment',_0x5cd878['message'],_0x38883f);_0x5e9ba6(_0x319ce5[_0xff53('0xf')](0x1f4,_0x5cd878[_0xff53('0x11')]));});});};
\ No newline at end of file
+var _0xb6b1=['raw','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','Attachment','create','body','options'];(function(_0x4672e9,_0x5caff9){var _0x2407fd=function(_0x41bd9e){while(--_0x41bd9e){_0x4672e9['push'](_0x4672e9['shift']());}};_0x2407fd(++_0x5caff9);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0xb6b1[_0x5a2d3f];return _0x5c65d8;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Attachment,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});}exports[_0x1b6b('0x15')]=function(_0x2e608b){var _0x59e671=this;return new Promise(function(_0x923711,_0x15d44b){return db[_0x1b6b('0x16')][_0x1b6b('0x17')](_0x2e608b[_0x1b6b('0x18')],{'raw':_0x2e608b[_0x1b6b('0x19')]?_0x2e608b[_0x1b6b('0x19')][_0x1b6b('0x1a')]===undefined?!![]:![]:!![]})[_0x1b6b('0xa')](function(_0x20a5a3){logger['info'](_0x1b6b('0x15'),_0x2e608b);logger[_0x1b6b('0xc')](_0x1b6b('0x15'),_0x2e608b,JSON[_0x1b6b('0xe')](_0x20a5a3));_0x923711(_0x20a5a3);})[_0x1b6b('0x14')](function(_0x276713){logger[_0x1b6b('0xf')](_0x1b6b('0x15'),_0x276713[_0x1b6b('0x11')],_0x2e608b);_0x15d44b(_0x59e671['error'](0x1f4,_0x276713[_0x1b6b('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a4bfb11..ddd3fd8 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x31ceb1,_0x329fd0){var _0x24942c=function(_0x1905e7){while(--_0x1905e7){_0x31ceb1['push'](_0x31ceb1['shift']());}};_0x24942c(++_0x329fd0);}(_0x757a,0xde));var _0xa757=function(_0x1f7d14,_0xd9975){_0x1f7d14=_0x1f7d14-0x0;var _0x1cde99=_0x757a[_0x1f7d14];return _0x1cde99;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x354107,_0x57f4f9){var _0x1813e6=function(_0x2fa32e){while(--_0x2fa32e){_0x354107['push'](_0x354107['shift']());}};_0x1813e6(++_0x57f4f9);}(_0xadb5,0xad));var _0x5adb=function(_0x56fe22,_0x58a02f){_0x56fe22=_0x56fe22-0x0;var _0x3eee1e=_0xadb5[_0x56fe22];return _0x3eee1e;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 4ecee52..61d61ec 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 _0x6c03=['signToken','json','online','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x6c03,0x98));var _0x36c0=function(_0x272b7a,_0x1661fa){_0x272b7a=_0x272b7a-0x0;var _0x173883=_0x6c03[_0x272b7a];return _0x173883;};'use strict';var passport=require(_0x36c0('0x0'));var LocalStrategy=require(_0x36c0('0x1'))[_0x36c0('0x2')];var moment=require(_0x36c0('0x3'));var ActiveDirectory=require(_0x36c0('0x4'));var BPromise=require('bluebird');var util=require(_0x36c0('0x5'));var db=require(_0x36c0('0x6'))['db'];var authService=require(_0x36c0('0x7'));var utils=require(_0x36c0('0x8'));var config=require('../../config/environment');var logger=require(_0x36c0('0x9'))(_0x36c0('0xa'));function isActiveDirectoryConfigured(_0x14afae){var _0x278765=![];if(typeof _0x14afae[_0x36c0('0xb')]!=='undefined'){_0x278765=_0x14afae['activedirectory'][_0x36c0('0xc')]&&_0x14afae[_0x36c0('0xb')][_0x36c0('0xd')]&&_0x14afae[_0x36c0('0xb')][_0x36c0('0xe')];}return _0x278765;}function adAuthenticate(_0x553f01,_0xa4af92,_0x5a83b1){return new BPromise(function(_0x41c834,_0x2148dd){try{var _0x31a7a3=new ActiveDirectory(_0x553f01);_0x31a7a3[_0x36c0('0xf')](_0xa4af92,_0x5a83b1,function(_0x498d3d,_0x6ca64e){if(_0x498d3d){logger[_0x36c0('0x10')](_0x36c0('0x11'),_0xa4af92,util['inspect'](_0x498d3d,{'showHidden':![],'depth':null}));_0x2148dd('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x6ca64e){logger[_0x36c0('0x10')](_0x36c0('0x12'),_0xa4af92);_0x2148dd(_0x36c0('0x13'));}else{_0x41c834(_0x6ca64e);}});}catch(_0x40ea5a){_0x2148dd(_0x40ea5a);}});}function ActiveDirectoryAuthenticate(_0x5d4a5e,_0x332737,_0x3bebdc,_0x273f2b){var _0x37ef59,_0x579861;if(!isActiveDirectoryConfigured(config)){logger[_0x36c0('0x10')](_0x36c0('0x14'),_0x332737);return _0x273f2b(null,![],{'message':_0x36c0('0x13')});}return db[_0x36c0('0x15')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x36c0('0x16')],'raw':!![]})[_0x36c0('0x17')](function(_0x27599e){_0x37ef59=_0x27599e;if(!_0x37ef59[_0x36c0('0x18')]){logger[_0x36c0('0x10')](_0x36c0('0x19'),_0x332737);throw new Error(_0x36c0('0x13'));}return _0x5d4a5e['findOne']({'attributes':['id',_0x36c0('0x1a'),_0x36c0('0x1b'),_0x36c0('0x1c'),_0x36c0('0x1d'),_0x36c0('0x1e'),_0x36c0('0x1f'),_0x36c0('0x20'),'online'],'where':{'name':_0x332737,'role':{'$or':[_0x36c0('0x21'),'user',_0x36c0('0x22')]},'adSsoEnabled':!![]}});})[_0x36c0('0x17')](function(_0x16cbd8){if(!_0x16cbd8||_0x16cbd8&&_0x16cbd8[_0x36c0('0x1a')]!==_0x332737){throw new Error(_0x36c0('0x13'));}_0x579861=_0x16cbd8;var _0x3ba118=_0x579861[_0x36c0('0x1a')]+'@'+config[_0x36c0('0xb')][_0x36c0('0xe')];return adAuthenticate(config[_0x36c0('0xb')],_0x3ba118,_0x3bebdc);})[_0x36c0('0x17')](function(_0x247008){if(_0x579861[_0x36c0('0x1e')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x37ef59[_0x36c0('0x16')]>0x0){if(_0x579861[_0x36c0('0x1f')]){if(moment(_0x579861['blockedAt'])['add'](_0x37ef59[_0x36c0('0x16')],_0x36c0('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x36c0('0x24')](_0x579861,0x0,![],null)['then'](function(){return utils[_0x36c0('0x25')](_0x579861);})[_0x36c0('0x17')](function(){return _0x273f2b(null,_0x579861);});}else{return utils[_0x36c0('0x25')](_0x579861)['then'](function(){return _0x273f2b(null,_0x579861);});}}else{return utils[_0x36c0('0x25')](_0x579861)[_0x36c0('0x17')](function(){return _0x273f2b(null,_0x579861);});}})['catch'](function(_0x1da7a3){return _0x273f2b(null,![],_0x1da7a3);});}function handleError(_0x57fe10,_0x40be8b,_0x4a3067){return _0x57fe10[_0x36c0('0x26')](_0x40be8b||0x1f4)[_0x36c0('0x27')]({'message':_0x4a3067?_0x4a3067[_0x36c0('0x28')]||_0x4a3067:''});}exports[_0x36c0('0x29')]=function(_0x54be34,_0x140433,_0x116e20){passport[_0x36c0('0xf')](_0x36c0('0x2a'),function(_0x613a63,_0x2322dd,_0x307757){var _0x2808ad=_0x613a63||_0x307757;if(_0x2808ad){return handleError(_0x140433,0x191,_0x2808ad);}if(!_0x2322dd){return handleError(_0x140433,0x194,{'message':_0x36c0('0x2b')});}else{var _0x4b2cba={'payload':{'id':_0x2322dd['id'],'role':_0x2322dd[_0x36c0('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x36c0('0x2c')](_0x4b2cba)[_0x36c0('0x17')](function(_0x24c916){_0x140433[_0x36c0('0x2d')]({'id':_0x2322dd['id'],'token':_0x24c916,'statusCall':'','isAlreadyLogged':_0x2322dd[_0x36c0('0x2e')]});});}})(_0x54be34,_0x140433,_0x116e20);};passport[_0x36c0('0x2f')](_0x36c0('0x2a'),new LocalStrategy({'usernameField':_0x36c0('0x1a'),'passwordField':_0x36c0('0x1b')},function(_0x15f5eb,_0x43fb75,_0x40fad2){return ActiveDirectoryAuthenticate(db[_0x36c0('0x30')],_0x15f5eb,_0x43fb75,_0x40fad2);}));
\ No newline at end of file
+var _0xf5e8=['domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','admin','agent','minutes','clearBlockUser','getLicense','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url'];(function(_0x408719,_0x44c832){var _0x56fa67=function(_0x531690){while(--_0x531690){_0x408719['push'](_0x408719['shift']());}};_0x56fa67(++_0x44c832);}(_0xf5e8,0xfa));var _0x8f5e=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0xf5e8[_0x47568e];return _0x33815b;};'use strict';var passport=require(_0x8f5e('0x0'));var LocalStrategy=require(_0x8f5e('0x1'))[_0x8f5e('0x2')];var moment=require(_0x8f5e('0x3'));var ActiveDirectory=require(_0x8f5e('0x4'));var BPromise=require('bluebird');var util=require(_0x8f5e('0x5'));var db=require(_0x8f5e('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x8f5e('0x7'));var config=require(_0x8f5e('0x8'));var logger=require(_0x8f5e('0x9'))(_0x8f5e('0xa'));function isActiveDirectoryConfigured(_0x48ed61){var _0x49a02f=![];if(typeof _0x48ed61[_0x8f5e('0xb')]!==_0x8f5e('0xc')){_0x49a02f=_0x48ed61[_0x8f5e('0xb')]['baseDN']&&_0x48ed61[_0x8f5e('0xb')][_0x8f5e('0xd')]&&_0x48ed61[_0x8f5e('0xb')][_0x8f5e('0xe')];}return _0x49a02f;}function adAuthenticate(_0x2d3064,_0x352193,_0x488803){return new BPromise(function(_0x1afc61,_0xfa8aa2){try{var _0xa1642f=new ActiveDirectory(_0x2d3064);_0xa1642f[_0x8f5e('0xf')](_0x352193,_0x488803,function(_0x401607,_0x15796b){if(_0x401607){logger[_0x8f5e('0x10')](_0x8f5e('0x11'),_0x352193,util['inspect'](_0x401607,{'showHidden':![],'depth':null}));_0xfa8aa2(_0x8f5e('0x12'));}else if(!_0x15796b){logger[_0x8f5e('0x10')](_0x8f5e('0x13'),_0x352193);_0xfa8aa2(_0x8f5e('0x12'));}else{_0x1afc61(_0x15796b);}});}catch(_0x3879ad){_0xfa8aa2(_0x3879ad);}});}function ActiveDirectoryAuthenticate(_0x4cc268,_0x35aea9,_0x44d097,_0x21f48e){var _0x1a297e,_0x3efc37;if(!isActiveDirectoryConfigured(config)){logger[_0x8f5e('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x35aea9);return _0x21f48e(null,![],{'message':_0x8f5e('0x12')});}return db['Setting'][_0x8f5e('0x14')]({'where':{'id':0x1},'attributes':[_0x8f5e('0x15'),_0x8f5e('0x16')],'raw':!![]})[_0x8f5e('0x17')](function(_0x4aaf31){_0x1a297e=_0x4aaf31;if(!_0x1a297e['adSsoEnabled']){logger[_0x8f5e('0x10')](_0x8f5e('0x18'),_0x35aea9);throw new Error(_0x8f5e('0x12'));}return _0x4cc268[_0x8f5e('0x14')]({'attributes':['id',_0x8f5e('0x19'),_0x8f5e('0x1a'),'salt',_0x8f5e('0x1b'),_0x8f5e('0x1c'),_0x8f5e('0x1d'),'blockedAt','online'],'where':{'name':_0x35aea9,'role':{'$or':[_0x8f5e('0x1e'),'user',_0x8f5e('0x1f')]},'adSsoEnabled':!![]}});})['then'](function(_0x1488f0){if(!_0x1488f0||_0x1488f0&&_0x1488f0[_0x8f5e('0x19')]!==_0x35aea9){throw new Error(_0x8f5e('0x12'));}_0x3efc37=_0x1488f0;var _0x2fdcda=_0x3efc37[_0x8f5e('0x19')]+'@'+config[_0x8f5e('0xb')][_0x8f5e('0xe')];return adAuthenticate(config[_0x8f5e('0xb')],_0x2fdcda,_0x44d097);})[_0x8f5e('0x17')](function(_0x33bc36){if(_0x3efc37[_0x8f5e('0x1c')]){throw new Error(_0x8f5e('0x12'));}if(_0x1a297e['blockDuration']>0x0){if(_0x3efc37['blocked']){if(moment(_0x3efc37['blockedAt'])['add'](_0x1a297e['blockDuration'],_0x8f5e('0x20'))>moment()){throw new Error(_0x8f5e('0x12'));}return utils[_0x8f5e('0x21')](_0x3efc37,0x0,![],null)[_0x8f5e('0x17')](function(){return utils[_0x8f5e('0x22')](_0x3efc37);})[_0x8f5e('0x17')](function(){return _0x21f48e(null,_0x3efc37);});}else{return utils[_0x8f5e('0x22')](_0x3efc37)[_0x8f5e('0x17')](function(){return _0x21f48e(null,_0x3efc37);});}}else{return utils['getLicense'](_0x3efc37)[_0x8f5e('0x17')](function(){return _0x21f48e(null,_0x3efc37);});}})['catch'](function(_0x42d76f){return _0x21f48e(null,![],_0x42d76f);});}function handleError(_0x21a301,_0x1a0b72,_0x2430e5){return _0x21a301[_0x8f5e('0x23')](_0x1a0b72||0x1f4)[_0x8f5e('0x24')]({'message':_0x2430e5?_0x2430e5['message']||_0x2430e5:''});}exports[_0x8f5e('0x25')]=function(_0x1f6a74,_0x442d76,_0x12ec1f){passport[_0x8f5e('0xf')]('ad-login',function(_0x532ea7,_0x4d7ce9,_0xba3a96){var _0x4b1148=_0x532ea7||_0xba3a96;if(_0x4b1148){return handleError(_0x442d76,0x191,_0x4b1148);}if(!_0x4d7ce9){return handleError(_0x442d76,0x194,{'message':_0x8f5e('0x26')});}else{var _0x1c34b7={'payload':{'id':_0x4d7ce9['id'],'role':_0x4d7ce9[_0x8f5e('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x8f5e('0x27')](_0x1c34b7)[_0x8f5e('0x17')](function(_0x3905c0){_0x442d76['json']({'id':_0x4d7ce9['id'],'token':_0x3905c0,'statusCall':'','isAlreadyLogged':_0x4d7ce9[_0x8f5e('0x28')]});});}})(_0x1f6a74,_0x442d76,_0x12ec1f);};passport[_0x8f5e('0x29')](_0x8f5e('0x2a'),new LocalStrategy({'usernameField':_0x8f5e('0x19'),'passwordField':_0x8f5e('0x1a')},function(_0x3f36d9,_0x2eb85e,_0x7f3361){return ActiveDirectoryAuthenticate(db[_0x8f5e('0x2b')],_0x3f36d9,_0x2eb85e,_0x7f3361);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 0dd6182..a1b1658 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 _0x56dc=['express','./authActiveDirectory.controller','post','exports'];(function(_0x9a23f5,_0xfd4537){var _0x48eb4f=function(_0x57c6a0){while(--_0x57c6a0){_0x9a23f5['push'](_0x9a23f5['shift']());}};_0x48eb4f(++_0xfd4537);}(_0x56dc,0x1bc));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc56d('0x0'));var router=express['Router']();var controller=require(_0xc56d('0x1'));router[_0xc56d('0x2')]('/',controller['login']);module[_0xc56d('0x3')]=router;
\ No newline at end of file
+var _0x2cf4=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x214f40,_0x17e44b){var _0x22a380=function(_0x47a1c6){while(--_0x47a1c6){_0x214f40['push'](_0x214f40['shift']());}};_0x22a380(++_0x17e44b);}(_0x2cf4,0x11f));var _0x42cf=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x2cf4[_0x3cb3ca];return _0x214366;};'use strict';var express=require(_0x42cf('0x0'));var router=express[_0x42cf('0x1')]();var controller=require(_0x42cf('0x2'));router['post']('/',controller[_0x42cf('0x3')]);module[_0x42cf('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 3b78b86..95a7446 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(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x7a54,0x106));var _0x47a5=function(_0x21b107,_0x4e609e){_0x21b107=_0x21b107-0x0;var _0x4d3ed2=_0x7a54[_0x21b107];return _0x4d3ed2;};'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(_0x23603,_0x281eee){var _0x2357a1=function(_0x265b78){while(--_0x265b78){_0x23603['push'](_0x23603['shift']());}};_0x2357a1(++_0x281eee);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 6f5ca6d..ee6e203 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 _0x31d7=['exports','express','passport','Router','./authGoogle.controller','get','/callback','callback','login'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x31d7,0x160));var _0x731d=function(_0xd1557,_0x1351eb){_0xd1557=_0xd1557-0x0;var _0xcbd609=_0x31d7[_0xd1557];return _0xcbd609;};'use strict';var express=require(_0x731d('0x0'));var passport=require(_0x731d('0x1'));var router=express[_0x731d('0x2')]();var controller=require(_0x731d('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0x731d('0x4')](_0x731d('0x5'),controller[_0x731d('0x6')],authService['isMiddleware'],userController[_0x731d('0x7')],authService['setTokenCookie']);module[_0x731d('0x8')]=router;
\ No newline at end of file
+var _0x64d7=['setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x32b3b2,_0x4571ca){var _0x3f42cc=function(_0x170106){while(--_0x170106){_0x32b3b2['push'](_0x32b3b2['shift']());}};_0x3f42cc(++_0x4571ca);}(_0x64d7,0x19f));var _0x764d=function(_0xbb4325,_0x293598){_0xbb4325=_0xbb4325-0x0;var _0xf7423a=_0x64d7[_0xbb4325];return _0xf7423a;};'use strict';var express=require(_0x764d('0x0'));var passport=require('passport');var router=express[_0x764d('0x1')]();var controller=require(_0x764d('0x2'));var userController=require(_0x764d('0x3'));var authService=require(_0x764d('0x4'));router[_0x764d('0x5')]('/',controller[_0x764d('0x6')]);router[_0x764d('0x5')]('/callback',controller[_0x764d('0x7')],authService['isMiddleware'],userController[_0x764d('0x6')],authService[_0x764d('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index d8cd2f9..97a102f 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 _0xbbda=['Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','status','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','authenticate','minutes','clearBlockUser','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','Smtp','request','error','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot'];(function(_0xafa7e8,_0x501da3){var _0x314110=function(_0x277f85){while(--_0x277f85){_0xafa7e8['push'](_0xafa7e8['shift']());}};_0x314110(++_0x501da3);}(_0xbbda,0x16a));var _0xabbd=function(_0xc27749,_0x188efd){_0xc27749=_0xc27749-0x0;var _0x566bde=_0xbbda[_0xc27749];return _0x566bde;};'use strict';var util=require(_0xabbd('0x0'));var passport=require(_0xabbd('0x1'));var LocalStrategy=require(_0xabbd('0x2'))[_0xabbd('0x3')];var jayson=require(_0xabbd('0x4'));var _=require(_0xabbd('0x5'));var rs=require(_0xabbd('0x6'));var moment=require('moment');var db=require(_0xabbd('0x7'))['db'];var authService=require(_0xabbd('0x8'));var utils=require('../../config/utils');var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0xdee9c8,_0x374e80,_0xd706b0,_0x56e953){var _0x211a97,_0x27cf10;return db[_0xabbd('0x9')][_0xabbd('0xa')]({'where':{'id':0x1},'attributes':[_0xabbd('0xb'),_0xabbd('0xc')],'raw':!![]})['then'](function(_0x8cb2c9){_0x211a97=_0x8cb2c9;return _0xdee9c8[_0xabbd('0xa')]({'attributes':['id',_0xabbd('0xd'),_0xabbd('0xe'),_0xabbd('0xf'),_0xabbd('0x10'),_0xabbd('0x11'),_0xabbd('0x12'),_0xabbd('0x13'),_0xabbd('0x14')],'where':{'name':_0x374e80,'role':{'$or':[_0xabbd('0x15'),_0xabbd('0x16'),_0xabbd('0x17')]}}});})[_0xabbd('0x18')](function(_0x4a7335){if(!_0x4a7335||_0x4a7335&&_0x4a7335['name']!==_0x374e80){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x27cf10=_0x4a7335;return _0x27cf10;}})[_0xabbd('0x18')](function(){_0x27cf10[_0xabbd('0x19')](_0xd706b0,function(_0x57d3f9,_0x594ad7){var _0x1e33bc=_0x27cf10[_0xabbd('0x14')]+0x1;if(_0x57d3f9){return _0x56e953(_0x57d3f9);}else if(!_0x594ad7){if(_0x27cf10[_0xabbd('0x11')]){return _0x56e953(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x211a97[_0xabbd('0xb')]>0x0){if(_0x27cf10[_0xabbd('0x12')]){if(_0x211a97[_0xabbd('0xc')]>0x0){if(moment(_0x27cf10[_0xabbd('0x13')])['add'](_0x211a97[_0xabbd('0xc')],_0xabbd('0x1a'))>moment()){return _0x56e953(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xabbd('0x1b')](_0x27cf10,_0x1e33bc,![],null)[_0xabbd('0x18')](function(){return _0x56e953(null,![],{'message':_0xabbd('0x1c')});});}}else{return _0x56e953(null,![],{'message':_0xabbd('0x1c')});}}else{if(_0x1e33bc>=_0x211a97['allowedLoginAttempts']){return utils['clearBlockUser'](_0x27cf10,0x0,!![],moment())[_0xabbd('0x18')](function(){return _0x56e953(null,![],{'message':_0xabbd('0x1c')});});}else{return utils[_0xabbd('0x1b')](_0x27cf10,_0x1e33bc,![],null)['then'](function(){return _0x56e953(null,![],{'message':_0xabbd('0x1c')});});}}}else{return _0x56e953(null,![],{'message':_0xabbd('0x1c')});}}else{if(_0x27cf10[_0xabbd('0x11')]){return _0x56e953(null,![],{'message':_0xabbd('0x1c')});}else if(_0x211a97['allowedLoginAttempts']>0x0){if(_0x27cf10['blocked']){if(_0x211a97['blockDuration']>0x0){if(moment(_0x27cf10[_0xabbd('0x13')])['add'](_0x211a97[_0xabbd('0xc')],_0xabbd('0x1a'))>moment()){return _0x56e953(null,![],{'message':_0xabbd('0x1c')});}else{return utils[_0xabbd('0x1b')](_0x27cf10,0x0,![],null)[_0xabbd('0x18')](function(){return utils[_0xabbd('0x1d')](_0x27cf10);})[_0xabbd('0x18')](function(){return _0x56e953(null,_0x27cf10);});}}else{return _0x56e953(null,![],{'message':_0xabbd('0x1c')});}}else{return utils[_0xabbd('0x1b')](_0x27cf10,0x0,![],null)[_0xabbd('0x18')](function(){return utils[_0xabbd('0x1d')](_0x27cf10);})['then'](function(){return _0x56e953(null,_0x27cf10);})[_0xabbd('0x1e')](function(_0x118595){return _0x56e953(null,![],_0x118595);});}}else{if(_0x27cf10[_0xabbd('0x12')]){return _0x56e953(null,![],{'message':_0xabbd('0x1c')});}else{return utils['getLicense'](_0x27cf10)['then'](function(){return _0x56e953(null,_0x27cf10);});}}}});})[_0xabbd('0x1e')](function(_0xd7a2f){return _0x56e953(null,![],_0xd7a2f);});}function sendServiceMail(_0x1e4a2e){return db[_0xabbd('0x1f')][_0xabbd('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xabbd('0x21')],'include':[{'model':db[_0xabbd('0x22')],'as':'Smtp','include':[{'model':db[_0xabbd('0x23')],'as':_0xabbd('0x23')}]}]})[_0xabbd('0x18')](function(_0x5e580d){if(!_0x5e580d){throw new Error(_0xabbd('0x24'));}var _0x2cebc2=_0x5e580d[_0xabbd('0x25')]();var _0x595509={'account':_0x2cebc2,'message':_['merge']({'from':util[_0xabbd('0x26')](_0xabbd('0x27'),_0x5e580d[_0xabbd('0xd')],_0x5e580d[_0xabbd('0x21')]||_0x5e580d[_0xabbd('0x28')][_0xabbd('0x16')])},_0x1e4a2e)};return client[_0xabbd('0x29')]('SendMail',_0x595509);})[_0xabbd('0x18')](function(_0x21080d){if(_0x21080d[_0xabbd('0x2a')]){throw new Error(util[_0xabbd('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x21080d[_0xabbd('0x2a')][_0xabbd('0x2b')]||JSON[_0xabbd('0x2c')](_0x21080d[_0xabbd('0x2a')])));}return!![];});}function handleError(_0x500f79,_0x5e68fe,_0x2ebf08){return _0x500f79['status'](_0x5e68fe||0x1f4)[_0xabbd('0x2d')]({'message':_0x2ebf08?_0x2ebf08[_0xabbd('0x2b')]||_0x2ebf08:''});}exports[_0xabbd('0x2e')]=function(_0x177a72,_0x17596b,_0x12010c){passport[_0xabbd('0x19')](_0xabbd('0x2f'),function(_0x57364a,_0x342586,_0x386a6d){var _0x466818=_0x57364a||_0x386a6d;if(_0x466818){return handleError(_0x17596b,0x191,_0x466818);}if(!_0x342586){return handleError(_0x17596b,0x194,{'message':_0xabbd('0x30')});}else{var _0x1f7903={'payload':{'id':_0x342586['id'],'role':_0x342586[_0xabbd('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xabbd('0x31')](_0x1f7903)[_0xabbd('0x18')](function(_0x49f727){_0x17596b[_0xabbd('0x32')]({'id':_0x342586['id'],'token':_0x49f727,'statusCall':'','isAlreadyLogged':_0x342586[_0xabbd('0x33')]});});}})(_0x177a72,_0x17596b,_0x12010c);};exports[_0xabbd('0x34')]=function(_0x385cff,_0x1948ca){if(!_0x385cff['body'][_0xabbd('0x21')]){return handleError(_0x1948ca,0x1f4,{'message':_0xabbd('0x35')});}var _0x3c46a9=rs[_0xabbd('0x36')]();_0x385cff['body'][_0xabbd('0x21')]=_0x385cff[_0xabbd('0x37')][_0xabbd('0x21')][_0xabbd('0x38')]()[_0xabbd('0x39')]();var _0x1cf5ea;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xabbd('0xb'),_0xabbd('0xc')],'raw':!![]})[_0xabbd('0x18')](function(_0xdca88a){_0x1cf5ea=_0xdca88a;return db['User'][_0xabbd('0x20')]({'where':{'email':_0x385cff[_0xabbd('0x37')]['email']}});})[_0xabbd('0x18')](function(_0x132390){if(!_0x132390){throw new Error(_0xabbd('0x3a'));}if(_0x132390['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x132390[_0xabbd('0x12')]){if(moment(_0x132390['blockedAt'])[_0xabbd('0x3b')](_0x1cf5ea['blockDuration'],'minutes')>moment()){throw new Error(_0xabbd('0x3c'));}else{_0x132390[_0xabbd('0x12')]=![];_0x132390[_0xabbd('0x13')]=null;}}_0x132390[_0xabbd('0x3d')]=_0x3c46a9;_0x132390['resetPasswordExpires']=Date[_0xabbd('0x3e')]()+0x36ee80;return _0x132390['save']();})['then'](function(){return sendServiceMail({'to':_0x385cff[_0xabbd('0x37')][_0xabbd('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xabbd('0x3f')+_0xabbd('0x40')+_0xabbd('0x41')+_0x385cff[_0xabbd('0x42')][_0xabbd('0x43')]+_0xabbd('0x44')+_0x3c46a9+'\x0a\x0a'+_0xabbd('0x45')});})[_0xabbd('0x18')](function(){_0x1948ca['status'](0xc8)['send']({'message':_0xabbd('0x46')});})[_0xabbd('0x1e')](function(_0x31708e){return handleError(_0x1948ca,0x1f4,_0x31708e);});};exports['reset']=function(_0x4baa37,_0x46fa13){return db[_0xabbd('0x47')][_0xabbd('0x20')]({'where':{'resetPasswordToken':_0x4baa37[_0xabbd('0x48')][_0xabbd('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xabbd('0x18')](function(_0x5d5696){if(!_0x5d5696){throw new Error(_0xabbd('0x4a'));}return db[_0xabbd('0x9')][_0xabbd('0xa')]({'attributes':['id','securePassword',_0xabbd('0x4b'),_0xabbd('0x4c')]})['then'](function(_0x330dcb){if(_0x330dcb[_0xabbd('0x4d')])authService[_0xabbd('0x4e')](_0x4baa37[_0xabbd('0x37')][_0xabbd('0xe')]);if(!_0x330dcb[_0xabbd('0x4b')]||!_0x5d5696['previousPasswords'])return _0x5d5696;authService[_0xabbd('0x4f')](_0x4baa37[_0xabbd('0x37')][_0xabbd('0xe')],_0x5d5696[_0xabbd('0x50')],_0x330dcb[_0xabbd('0x4c')]);return _0x5d5696;})['then'](function(){_0x5d5696[_0xabbd('0xe')]=_0x4baa37['body'][_0xabbd('0xe')];_0x5d5696[_0xabbd('0x3d')]=null;_0x5d5696['resetPasswordExpires']=null;return _0x5d5696['save']();});})['then'](function(){_0x46fa13[_0xabbd('0x51')](0xc8)[_0xabbd('0x2d')]({'message':'Password\x20reset!'});})[_0xabbd('0x1e')](function(_0x4b19ad){return handleError(_0x46fa13,0x1f4,_0x4b19ad);});};passport[_0xabbd('0x52')](_0xabbd('0x2f'),new LocalStrategy({'usernameField':_0xabbd('0xd'),'passwordField':_0xabbd('0xe')},function(_0x180d9c,_0x3ee985,_0xe5ad44){return localAuthenticate(db[_0xabbd('0x47')],_0x180d9c,_0x3ee985,_0xe5ad44);}));
\ No newline at end of file
+var _0xa237=['merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','message','status','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','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','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','use','local-login','util','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions'];(function(_0x2e3531,_0x1f0a91){var _0x39f792=function(_0x453003){while(--_0x453003){_0x2e3531['push'](_0x2e3531['shift']());}};_0x39f792(++_0x1f0a91);}(_0xa237,0x7c));var _0x7a23=function(_0x12524e,_0x28d790){_0x12524e=_0x12524e-0x0;var _0x6274e=_0xa237[_0x12524e];return _0x6274e;};'use strict';var util=require(_0x7a23('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x7a23('0x1')];var jayson=require(_0x7a23('0x2'));var _=require(_0x7a23('0x3'));var rs=require(_0x7a23('0x4'));var moment=require(_0x7a23('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x7a23('0x6'));var utils=require(_0x7a23('0x7'));var client=jayson[_0x7a23('0x8')][_0x7a23('0x9')]({'port':0x232b});function localAuthenticate(_0x40e9a3,_0x20f11d,_0x1f8a97,_0x337eff){var _0x232784,_0x59100e;return db[_0x7a23('0xa')][_0x7a23('0xb')]({'where':{'id':0x1},'attributes':[_0x7a23('0xc'),_0x7a23('0xd')],'raw':!![]})[_0x7a23('0xe')](function(_0x5a8c2d){_0x232784=_0x5a8c2d;return _0x40e9a3[_0x7a23('0xb')]({'attributes':['id',_0x7a23('0xf'),_0x7a23('0x10'),'salt',_0x7a23('0x11'),'disabled',_0x7a23('0x12'),_0x7a23('0x13'),_0x7a23('0x14')],'where':{'name':_0x20f11d,'role':{'$or':[_0x7a23('0x15'),_0x7a23('0x16'),_0x7a23('0x17')]}}});})['then'](function(_0x5177aa){if(!_0x5177aa||_0x5177aa&&_0x5177aa[_0x7a23('0xf')]!==_0x20f11d){throw new Error(_0x7a23('0x18'));}else{_0x59100e=_0x5177aa;return _0x59100e;}})['then'](function(){_0x59100e['authenticate'](_0x1f8a97,function(_0x3d010a,_0x10f458){var _0x5b5637=_0x59100e[_0x7a23('0x14')]+0x1;if(_0x3d010a){return _0x337eff(_0x3d010a);}else if(!_0x10f458){if(_0x59100e[_0x7a23('0x19')]){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else if(_0x232784['allowedLoginAttempts']>0x0){if(_0x59100e[_0x7a23('0x12')]){if(_0x232784[_0x7a23('0xd')]>0x0){if(moment(_0x59100e['blockedAt'])[_0x7a23('0x1a')](_0x232784[_0x7a23('0xd')],_0x7a23('0x1b'))>moment()){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else{return utils[_0x7a23('0x1c')](_0x59100e,_0x5b5637,![],null)[_0x7a23('0xe')](function(){return _0x337eff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x337eff(null,![],{'message':_0x7a23('0x18')});}}else{if(_0x5b5637>=_0x232784[_0x7a23('0xc')]){return utils[_0x7a23('0x1c')](_0x59100e,0x0,!![],moment())[_0x7a23('0xe')](function(){return _0x337eff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x7a23('0x1c')](_0x59100e,_0x5b5637,![],null)[_0x7a23('0xe')](function(){return _0x337eff(null,![],{'message':_0x7a23('0x18')});});}}}else{return _0x337eff(null,![],{'message':_0x7a23('0x18')});}}else{if(_0x59100e[_0x7a23('0x19')]){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else if(_0x232784['allowedLoginAttempts']>0x0){if(_0x59100e[_0x7a23('0x12')]){if(_0x232784[_0x7a23('0xd')]>0x0){if(moment(_0x59100e[_0x7a23('0x13')])[_0x7a23('0x1a')](_0x232784['blockDuration'],'minutes')>moment()){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else{return utils['clearBlockUser'](_0x59100e,0x0,![],null)[_0x7a23('0xe')](function(){return utils[_0x7a23('0x1d')](_0x59100e);})[_0x7a23('0xe')](function(){return _0x337eff(null,_0x59100e);});}}else{return _0x337eff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x7a23('0x1c')](_0x59100e,0x0,![],null)[_0x7a23('0xe')](function(){return utils['getLicense'](_0x59100e);})[_0x7a23('0xe')](function(){return _0x337eff(null,_0x59100e);})[_0x7a23('0x1e')](function(_0x4f0e1a){return _0x337eff(null,![],_0x4f0e1a);});}}else{if(_0x59100e['blocked']){return _0x337eff(null,![],{'message':_0x7a23('0x18')});}else{return utils[_0x7a23('0x1d')](_0x59100e)[_0x7a23('0xe')](function(){return _0x337eff(null,_0x59100e);});}}}});})[_0x7a23('0x1e')](function(_0x5d70d4){return _0x337eff(null,![],_0x5d70d4);});}function sendServiceMail(_0x1a55e6){return db[_0x7a23('0x1f')][_0x7a23('0x20')]({'where':{'service':!![]},'attributes':['id',_0x7a23('0xf'),_0x7a23('0x21')],'include':[{'model':db[_0x7a23('0x22')],'as':_0x7a23('0x23'),'include':[{'model':db[_0x7a23('0x24')],'as':_0x7a23('0x24')}]}]})[_0x7a23('0xe')](function(_0x2bf609){if(!_0x2bf609){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1fa127=_0x2bf609[_0x7a23('0x25')]();var _0x2a0eb1={'account':_0x1fa127,'message':_[_0x7a23('0x26')]({'from':util['format'](_0x7a23('0x27'),_0x2bf609[_0x7a23('0xf')],_0x2bf609[_0x7a23('0x21')]||_0x2bf609[_0x7a23('0x23')]['user'])},_0x1a55e6)};return client[_0x7a23('0x28')](_0x7a23('0x29'),_0x2a0eb1);})[_0x7a23('0xe')](function(_0x5c42b8){if(_0x5c42b8[_0x7a23('0x2a')]){throw new Error(util[_0x7a23('0x2b')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5c42b8[_0x7a23('0x2a')][_0x7a23('0x2c')]||JSON['stringify'](_0x5c42b8['error'])));}return!![];});}function handleError(_0x45f19c,_0x31b285,_0x5e18f6){return _0x45f19c[_0x7a23('0x2d')](_0x31b285||0x1f4)['send']({'message':_0x5e18f6?_0x5e18f6[_0x7a23('0x2c')]||_0x5e18f6:''});}exports[_0x7a23('0x2e')]=function(_0x582ec2,_0x14d23b,_0x5a390a){passport[_0x7a23('0x2f')]('local-login',function(_0x4d17b6,_0x5dc53c,_0x37b939){var _0x2adcf6=_0x4d17b6||_0x37b939;if(_0x2adcf6){return handleError(_0x14d23b,0x191,_0x2adcf6);}if(!_0x5dc53c){return handleError(_0x14d23b,0x194,{'message':_0x7a23('0x30')});}else{var _0x48e73b={'payload':{'id':_0x5dc53c['id'],'role':_0x5dc53c[_0x7a23('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x48e73b)['then'](function(_0x592b17){_0x14d23b[_0x7a23('0x31')]({'id':_0x5dc53c['id'],'token':_0x592b17,'statusCall':'','isAlreadyLogged':_0x5dc53c[_0x7a23('0x32')]});});}})(_0x582ec2,_0x14d23b,_0x5a390a);};exports[_0x7a23('0x33')]=function(_0x777331,_0x2818ca){if(!_0x777331[_0x7a23('0x34')][_0x7a23('0x21')]){return handleError(_0x2818ca,0x1f4,{'message':_0x7a23('0x35')});}var _0x5d652f=rs[_0x7a23('0x36')]();_0x777331['body']['email']=_0x777331[_0x7a23('0x34')][_0x7a23('0x21')]['trim']()[_0x7a23('0x37')]();var _0x544d1b;return db[_0x7a23('0xa')][_0x7a23('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7a23('0xd')],'raw':!![]})[_0x7a23('0xe')](function(_0x3a43fc){_0x544d1b=_0x3a43fc;return db[_0x7a23('0x38')]['find']({'where':{'email':_0x777331[_0x7a23('0x34')]['email']}});})[_0x7a23('0xe')](function(_0xfe9755){if(!_0xfe9755){throw new Error(_0x7a23('0x39'));}if(_0xfe9755[_0x7a23('0x19')]){throw new Error(_0x7a23('0x3a'));}if(_0xfe9755[_0x7a23('0x12')]){if(moment(_0xfe9755[_0x7a23('0x13')])[_0x7a23('0x1a')](_0x544d1b['blockDuration'],_0x7a23('0x1b'))>moment()){throw new Error(_0x7a23('0x3b'));}else{_0xfe9755['blocked']=![];_0xfe9755[_0x7a23('0x13')]=null;}}_0xfe9755[_0x7a23('0x3c')]=_0x5d652f;_0xfe9755[_0x7a23('0x3d')]=Date[_0x7a23('0x3e')]()+0x36ee80;return _0xfe9755[_0x7a23('0x3f')]();})[_0x7a23('0xe')](function(){return sendServiceMail({'to':_0x777331[_0x7a23('0x34')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x7a23('0x40')+_0x7a23('0x41')+_0x777331[_0x7a23('0x42')][_0x7a23('0x43')]+_0x7a23('0x44')+_0x5d652f+'\x0a\x0a'+_0x7a23('0x45')});})[_0x7a23('0xe')](function(){_0x2818ca[_0x7a23('0x2d')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0xbe786d){return handleError(_0x2818ca,0x1f4,_0xbe786d);});};exports[_0x7a23('0x46')]=function(_0x2ed2cf,_0x451dbb){return db[_0x7a23('0x38')][_0x7a23('0x20')]({'where':{'resetPasswordToken':_0x2ed2cf[_0x7a23('0x47')][_0x7a23('0x48')],'resetPasswordExpires':{'$gt':Date[_0x7a23('0x3e')]()}}})['then'](function(_0x5641a1){if(!_0x5641a1){throw new Error(_0x7a23('0x49'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x7a23('0x4a'),'passwordHistoryLimit']})[_0x7a23('0xe')](function(_0x573aa4){if(_0x573aa4['securePassword'])authService[_0x7a23('0x4b')](_0x2ed2cf[_0x7a23('0x34')]['password']);if(!_0x573aa4[_0x7a23('0x4a')]||!_0x5641a1[_0x7a23('0x4c')])return _0x5641a1;authService[_0x7a23('0x4d')](_0x2ed2cf[_0x7a23('0x34')][_0x7a23('0x10')],_0x5641a1[_0x7a23('0x4c')],_0x573aa4[_0x7a23('0x4e')]);return _0x5641a1;})[_0x7a23('0xe')](function(){_0x5641a1[_0x7a23('0x10')]=_0x2ed2cf[_0x7a23('0x34')][_0x7a23('0x10')];_0x5641a1[_0x7a23('0x3c')]=null;_0x5641a1[_0x7a23('0x3d')]=null;return _0x5641a1['save']();});})[_0x7a23('0xe')](function(){_0x451dbb[_0x7a23('0x2d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x7a23('0x1e')](function(_0x102a1c){return handleError(_0x451dbb,0x1f4,_0x102a1c);});};passport[_0x7a23('0x4f')](_0x7a23('0x50'),new LocalStrategy({'usernameField':_0x7a23('0xf'),'passwordField':_0x7a23('0x10')},function(_0x2f0531,_0x5f4c28,_0x2182d6){return localAuthenticate(db['User'],_0x2f0531,_0x5f4c28,_0x2182d6);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 0850c55..51f4aa4 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 _0x700f=['express','Router','login','post','/forgot','forgot','reset','exports'];(function(_0x1b6916,_0x5ea45e){var _0x4b37a9=function(_0x50e648){while(--_0x50e648){_0x1b6916['push'](_0x1b6916['shift']());}};_0x4b37a9(++_0x5ea45e);}(_0x700f,0x118));var _0xf700=function(_0xca167c,_0x439d26){_0xca167c=_0xca167c-0x0;var _0x30cc8b=_0x700f[_0xca167c];return _0x30cc8b;};'use strict';var express=require(_0xf700('0x0'));var router=express[_0xf700('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xf700('0x2')]);router[_0xf700('0x3')](_0xf700('0x4'),controller[_0xf700('0x5')]);router[_0xf700('0x3')]('/reset/:token',controller[_0xf700('0x6')]);module[_0xf700('0x7')]=router;
\ No newline at end of file
+var _0x0d6a=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','/forgot','forgot'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0d6a,0x186));var _0xa0d6=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x0d6a[_0x4b2863];return _0x567d67;};'use strict';var express=require(_0xa0d6('0x0'));var router=express[_0xa0d6('0x1')]();var controller=require(_0xa0d6('0x2'));router[_0xa0d6('0x3')]('/',controller['login']);router[_0xa0d6('0x3')](_0xa0d6('0x4'),controller[_0xa0d6('0x5')]);router[_0xa0d6('0x3')](_0xa0d6('0x6'),controller[_0xa0d6('0x7')]);module[_0xa0d6('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 7da7b65..b4e58b6 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 _0x2658=['exports','STRING','BOOLEAN'];(function(_0x2787c5,_0x422f0b){var _0x1b53c5=function(_0x398028){while(--_0x398028){_0x2787c5['push'](_0x2787c5['shift']());}};_0x1b53c5(++_0x422f0b);}(_0x2658,0x102));var _0x8265=function(_0x1fb99e,_0x6afedb){_0x1fb99e=_0x1fb99e-0x0;var _0x4b9b71=_0x2658[_0x1fb99e];return _0x4b9b71;};'use strict';var Sequelize=require('sequelize');module[_0x8265('0x0')]={'name':{'type':Sequelize[_0x8265('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x8265('0x1')]},'description':{'type':Sequelize[_0x8265('0x1')]},'status':{'type':Sequelize[_0x8265('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8848=['BOOLEAN','INTEGER','STRING'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x8848,0x188));var _0x8884=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0x8848[_0x173f10];return _0x53142d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8884('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x8884('0x0')]},'description':{'type':Sequelize[_0x8884('0x0')]},'status':{'type':Sequelize[_0x8884('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8884('0x2')],'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 43a0df5..fec9b1f 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 _0x4833=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','set','json','reject','save','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','offset','order','sort','where','pick','merge','map','filter','options','includeAll','include','catch','params','filters','fields','find','create','body','addConditions','ids','omit','getConditions','findOne','Condition','hasOwnProperty','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4833,0x138));var _0x3483=function(_0x133425,_0x2d60f2){_0x133425=_0x133425-0x0;var _0x45c4a4=_0x4833[_0x133425];return _0x45c4a4;};'use strict';var emlformat=require(_0x3483('0x0'));var rimraf=require(_0x3483('0x1'));var zipdir=require(_0x3483('0x2'));var jsonpatch=require(_0x3483('0x3'));var rp=require(_0x3483('0x4'));var moment=require(_0x3483('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3483('0x6'));var path=require(_0x3483('0x7'));var sox=require(_0x3483('0x8'));var csv=require(_0x3483('0x9'));var ejs=require(_0x3483('0xa'));var fs=require('fs');var fs_extra=require(_0x3483('0xb'));var _=require(_0x3483('0xc'));var squel=require(_0x3483('0xd'));var crypto=require(_0x3483('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3483('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3483('0x10'));var Papa=require(_0x3483('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3483('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3483('0x13'))(_0x3483('0x14'));var utils=require('../../config/utils');var config=require(_0x3483('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3483('0x16'))['db'];function respondWithStatusCode(_0x15cbd9,_0x44bfa6){_0x44bfa6=_0x44bfa6||0xcc;return function(_0x3de257){if(_0x3de257){return _0x15cbd9[_0x3483('0x17')](_0x44bfa6);}return _0x15cbd9[_0x3483('0x18')](_0x44bfa6)[_0x3483('0x19')]();};}function respondWithResult(_0x1ddf05,_0x28a634){_0x28a634=_0x28a634||0xc8;return function(_0x23dc4a){if(_0x23dc4a){return _0x1ddf05[_0x3483('0x18')](_0x28a634)['json'](_0x23dc4a);}};}function respondWithFilteredResult(_0xaa6bb,_0x1ea568){return function(_0x17977d){if(_0x17977d){var _0x917d97=typeof _0x1ea568['offset']===_0x3483('0x1a')&&typeof _0x1ea568[_0x3483('0x1b')]===_0x3483('0x1a');var _0x5e5f15=_0x17977d[_0x3483('0x1c')];var _0x9f9787=_0x917d97?0x0:_0x1ea568['offset'];var _0x1b9f71=_0x917d97?_0x17977d[_0x3483('0x1c')]:_0x1ea568['offset']+_0x1ea568[_0x3483('0x1b')];var _0x56d7a0;if(_0x1b9f71>=_0x5e5f15){_0x1b9f71=_0x5e5f15;_0x56d7a0=0xc8;}else{_0x56d7a0=0xce;}_0xaa6bb['status'](_0x56d7a0);return _0xaa6bb[_0x3483('0x1d')]('Content-Range',_0x9f9787+'-'+_0x1b9f71+'/'+_0x5e5f15)[_0x3483('0x1e')](_0x17977d);}return null;};}function patchUpdates(_0x23a996){return function(_0x5c4f99){try{jsonpatch['apply'](_0x5c4f99,_0x23a996,!![]);}catch(_0xfb559a){return BPromise[_0x3483('0x1f')](_0xfb559a);}return _0x5c4f99[_0x3483('0x20')]();};}function saveUpdates(_0xae11d5,_0x5dc29b){return function(_0x47154e){if(_0x47154e){return _0x47154e['update'](_0xae11d5)[_0x3483('0x21')](function(_0x2c8b98){return _0x2c8b98;});}return null;};}function removeEntity(_0x4a3472,_0x3b2dc4){return function(_0x5f3eae){if(_0x5f3eae){return _0x5f3eae[_0x3483('0x22')]()['then'](function(){_0x4a3472[_0x3483('0x18')](0xcc)[_0x3483('0x19')]();});}};}function handleEntityNotFound(_0x23f46f,_0x37f83d){return function(_0x3da448){if(!_0x3da448){_0x23f46f[_0x3483('0x17')](0x194);}return _0x3da448;};}function handleError(_0x2f8dc5,_0x5eb640){_0x5eb640=_0x5eb640||0x1f4;return function(_0x25ef22){logger[_0x3483('0x23')](_0x25ef22[_0x3483('0x24')]);if(_0x25ef22[_0x3483('0x25')]){delete _0x25ef22[_0x3483('0x25')];}_0x2f8dc5[_0x3483('0x18')](_0x5eb640)[_0x3483('0x26')](_0x25ef22);};}exports[_0x3483('0x27')]=function(_0x361a72,_0x5e7e3c){var _0x50bb78={},_0x16f58f={},_0x2c3544={'count':0x0,'rows':[]};var _0x5b9c58=_['map'](db[_0x3483('0x28')][_0x3483('0x29')],function(_0x2bbe67){return{'name':_0x2bbe67[_0x3483('0x2a')],'type':_0x2bbe67[_0x3483('0x2b')][_0x3483('0x2c')]};});_0x16f58f[_0x3483('0x2d')]=_['map'](_0x5b9c58,_0x3483('0x25'));_0x16f58f[_0x3483('0x2e')]=_[_0x3483('0x2f')](_0x361a72[_0x3483('0x2e')]);_0x16f58f['filters']=_[_0x3483('0x30')](_0x16f58f[_0x3483('0x2d')],_0x16f58f[_0x3483('0x2e')]);_0x50bb78['attributes']=_[_0x3483('0x30')](_0x16f58f[_0x3483('0x2d')],qs['fields'](_0x361a72[_0x3483('0x2e')]['fields']));_0x50bb78[_0x3483('0x31')]=_0x50bb78[_0x3483('0x31')][_0x3483('0x32')]?_0x50bb78[_0x3483('0x31')]:_0x16f58f[_0x3483('0x2d')];if(!_0x361a72[_0x3483('0x2e')]['hasOwnProperty']('nolimit')){_0x50bb78['limit']=qs[_0x3483('0x1b')](_0x361a72['query'][_0x3483('0x1b')]);_0x50bb78[_0x3483('0x33')]=qs[_0x3483('0x33')](_0x361a72[_0x3483('0x2e')]['offset']);}_0x50bb78[_0x3483('0x34')]=qs[_0x3483('0x35')](_0x361a72[_0x3483('0x2e')]['sort']);_0x50bb78[_0x3483('0x36')]=qs['filters'](_[_0x3483('0x37')](_0x361a72[_0x3483('0x2e')],_0x16f58f['filters']),_0x5b9c58);if(_0x361a72[_0x3483('0x2e')]['filter']){_0x50bb78[_0x3483('0x36')]=_[_0x3483('0x38')](_0x50bb78[_0x3483('0x36')],{'$or':_[_0x3483('0x39')](_0x5b9c58,function(_0x589c3e){if(_0x589c3e[_0x3483('0x2b')]!=='VIRTUAL'){var _0x46e4b7={};_0x46e4b7[_0x589c3e[_0x3483('0x25')]]={'$like':'%'+_0x361a72[_0x3483('0x2e')][_0x3483('0x3a')]+'%'};return _0x46e4b7;}})});}_0x50bb78=_[_0x3483('0x38')]({},_0x50bb78,_0x361a72[_0x3483('0x3b')]);var _0x4dfb10={'where':_0x50bb78[_0x3483('0x36')]};return db['Automation']['count'](_0x4dfb10)[_0x3483('0x21')](function(_0x27a399){_0x2c3544[_0x3483('0x1c')]=_0x27a399;if(_0x361a72[_0x3483('0x2e')][_0x3483('0x3c')]){_0x50bb78[_0x3483('0x3d')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x50bb78);})['then'](function(_0x10d1ed){_0x2c3544['rows']=_0x10d1ed;return _0x2c3544;})[_0x3483('0x21')](respondWithFilteredResult(_0x5e7e3c,_0x50bb78))[_0x3483('0x3e')](handleError(_0x5e7e3c,null));};exports['show']=function(_0x4eb609,_0x2aed33){var _0x2a036c={'raw':![],'where':{'id':_0x4eb609[_0x3483('0x3f')]['id']}},_0x853eb0={};_0x853eb0[_0x3483('0x2d')]=_['keys'](db[_0x3483('0x28')][_0x3483('0x29')]);_0x853eb0[_0x3483('0x2e')]=_[_0x3483('0x2f')](_0x4eb609[_0x3483('0x2e')]);_0x853eb0[_0x3483('0x40')]=_[_0x3483('0x30')](_0x853eb0['model'],_0x853eb0[_0x3483('0x2e')]);_0x2a036c[_0x3483('0x31')]=_[_0x3483('0x30')](_0x853eb0['model'],qs[_0x3483('0x41')](_0x4eb609[_0x3483('0x2e')][_0x3483('0x41')]));_0x2a036c[_0x3483('0x31')]=_0x2a036c[_0x3483('0x31')][_0x3483('0x32')]?_0x2a036c['attributes']:_0x853eb0[_0x3483('0x2d')];if(_0x4eb609[_0x3483('0x2e')][_0x3483('0x3c')]){_0x2a036c['include']=[{'all':!![]}];}_0x2a036c=_[_0x3483('0x38')]({},_0x2a036c,_0x4eb609['options']);return db[_0x3483('0x28')][_0x3483('0x42')](_0x2a036c)['then'](handleEntityNotFound(_0x2aed33,null))[_0x3483('0x21')](respondWithResult(_0x2aed33,null))[_0x3483('0x3e')](handleError(_0x2aed33,null));};exports[_0x3483('0x43')]=function(_0x5b793f,_0x46af15){return db['Automation'][_0x3483('0x43')](_0x5b793f[_0x3483('0x44')],{})[_0x3483('0x21')](respondWithResult(_0x46af15,0xc9))[_0x3483('0x3e')](handleError(_0x46af15,null));};exports['update']=function(_0x210500,_0x4e8084){if(_0x210500['body']['id']){delete _0x210500[_0x3483('0x44')]['id'];}return db[_0x3483('0x28')][_0x3483('0x42')]({'where':{'id':_0x210500['params']['id']}})[_0x3483('0x21')](handleEntityNotFound(_0x4e8084,null))['then'](saveUpdates(_0x210500['body'],null))['then'](respondWithResult(_0x4e8084,null))[_0x3483('0x3e')](handleError(_0x4e8084,null));};exports[_0x3483('0x22')]=function(_0xa8c8d2,_0x50b771){return db[_0x3483('0x28')]['find']({'where':{'id':_0xa8c8d2[_0x3483('0x3f')]['id']}})['then'](handleEntityNotFound(_0x50b771,null))['then'](removeEntity(_0x50b771,null))[_0x3483('0x3e')](handleError(_0x50b771,null));};exports[_0x3483('0x45')]=function(_0x4d2ba4,_0x857b28,_0x42c009){return db['Condition'][_0x3483('0x42')]({'where':{'id':_0x4d2ba4[_0x3483('0x3f')]['id']}})[_0x3483('0x21')](handleEntityNotFound(_0x857b28,null))[_0x3483('0x21')](function(_0x6a0ba3){if(_0x6a0ba3){return _0x6a0ba3[_0x3483('0x45')](_0x4d2ba4['body'][_0x3483('0x46')],_[_0x3483('0x47')](_0x4d2ba4[_0x3483('0x44')],['ids','id'])||{});}})[_0x3483('0x21')](respondWithResult(_0x857b28,null))['catch'](handleError(_0x857b28,null));};exports[_0x3483('0x48')]=function(_0x253c49,_0x43cbdf,_0x49e969){var _0x5f488b={};var _0x7340d5={};var _0x470d70;var _0x17c7ec;return db[_0x3483('0x28')][_0x3483('0x49')]({'where':{'id':_0x253c49[_0x3483('0x3f')]['id']}})[_0x3483('0x21')](handleEntityNotFound(_0x43cbdf,null))[_0x3483('0x21')](function(_0x441073){if(_0x441073){_0x470d70=_0x441073;_0x7340d5[_0x3483('0x2d')]=_[_0x3483('0x2f')](db[_0x3483('0x4a')][_0x3483('0x29')]);_0x7340d5[_0x3483('0x2e')]=_[_0x3483('0x2f')](_0x253c49[_0x3483('0x2e')]);_0x7340d5[_0x3483('0x40')]=_[_0x3483('0x30')](_0x7340d5[_0x3483('0x2d')],_0x7340d5[_0x3483('0x2e')]);_0x5f488b[_0x3483('0x31')]=_[_0x3483('0x30')](_0x7340d5[_0x3483('0x2d')],qs[_0x3483('0x41')](_0x253c49['query']['fields']));_0x5f488b[_0x3483('0x31')]=_0x5f488b['attributes'][_0x3483('0x32')]?_0x5f488b[_0x3483('0x31')]:_0x7340d5[_0x3483('0x2d')];_0x5f488b[_0x3483('0x34')]=qs[_0x3483('0x35')](_0x253c49[_0x3483('0x2e')][_0x3483('0x35')]);_0x5f488b[_0x3483('0x36')]=qs['filters'](_[_0x3483('0x37')](_0x253c49[_0x3483('0x2e')],_0x7340d5['filters']));if(_0x253c49['query'][_0x3483('0x3a')]){_0x5f488b[_0x3483('0x36')]=_[_0x3483('0x38')](_0x5f488b[_0x3483('0x36')],{'$or':_[_0x3483('0x39')](_0x5f488b[_0x3483('0x31')],function(_0x2fe58a){var _0x39e6a0={};_0x39e6a0[_0x2fe58a]={'$like':'%'+_0x253c49[_0x3483('0x2e')][_0x3483('0x3a')]+'%'};return _0x39e6a0;})});}_0x5f488b=_[_0x3483('0x38')]({},_0x5f488b,_0x253c49[_0x3483('0x3b')]);return _0x470d70['getConditions'](_0x5f488b);}})[_0x3483('0x21')](function(_0xe55349){if(_0xe55349){_0x17c7ec=_0xe55349[_0x3483('0x32')];if(!_0x253c49[_0x3483('0x2e')][_0x3483('0x4b')](_0x3483('0x4c'))){_0x5f488b['limit']=qs['limit'](_0x253c49[_0x3483('0x2e')][_0x3483('0x1b')]);_0x5f488b['offset']=qs[_0x3483('0x33')](_0x253c49[_0x3483('0x2e')][_0x3483('0x33')]);}return _0x470d70['getConditions'](_0x5f488b);}})['then'](function(_0x189091){if(_0x189091){return _0x189091?{'count':_0x17c7ec,'rows':_0x189091}:null;}})[_0x3483('0x21')](respondWithResult(_0x43cbdf,null))['catch'](handleError(_0x43cbdf,null));};exports['addActions']=function(_0x3f4713,_0x381e5b,_0x16d3ce){return db['Action'][_0x3483('0x42')]({'where':{'id':_0x3f4713['params']['id']}})[_0x3483('0x21')](handleEntityNotFound(_0x381e5b,null))['then'](function(_0x5b2f48){if(_0x5b2f48){return _0x5b2f48[_0x3483('0x4d')](_0x3f4713[_0x3483('0x44')][_0x3483('0x46')],_[_0x3483('0x47')](_0x3f4713['body'],[_0x3483('0x46'),'id'])||{});}})[_0x3483('0x21')](respondWithResult(_0x381e5b,null))['catch'](handleError(_0x381e5b,null));};exports['getActions']=function(_0x36917d,_0xf8ee9d,_0x581b27){var _0x179964={};var _0x22ec5f={};var _0x555da5;var _0x5ad5a8;return db[_0x3483('0x28')][_0x3483('0x49')]({'where':{'id':_0x36917d['params']['id']}})[_0x3483('0x21')](handleEntityNotFound(_0xf8ee9d,null))[_0x3483('0x21')](function(_0x1b6ec5){if(_0x1b6ec5){_0x555da5=_0x1b6ec5;_0x22ec5f[_0x3483('0x2d')]=_[_0x3483('0x2f')](db[_0x3483('0x4e')][_0x3483('0x29')]);_0x22ec5f[_0x3483('0x2e')]=_[_0x3483('0x2f')](_0x36917d[_0x3483('0x2e')]);_0x22ec5f[_0x3483('0x40')]=_['intersection'](_0x22ec5f[_0x3483('0x2d')],_0x22ec5f[_0x3483('0x2e')]);_0x179964['attributes']=_['intersection'](_0x22ec5f[_0x3483('0x2d')],qs['fields'](_0x36917d[_0x3483('0x2e')][_0x3483('0x41')]));_0x179964[_0x3483('0x31')]=_0x179964[_0x3483('0x31')]['length']?_0x179964[_0x3483('0x31')]:_0x22ec5f[_0x3483('0x2d')];_0x179964[_0x3483('0x34')]=qs['sort'](_0x36917d[_0x3483('0x2e')]['sort']);_0x179964['where']=qs[_0x3483('0x40')](_[_0x3483('0x37')](_0x36917d[_0x3483('0x2e')],_0x22ec5f[_0x3483('0x40')]));if(_0x36917d['query'][_0x3483('0x3a')]){_0x179964[_0x3483('0x36')]=_['merge'](_0x179964[_0x3483('0x36')],{'$or':_[_0x3483('0x39')](_0x179964[_0x3483('0x31')],function(_0x900ed4){var _0xf131da={};_0xf131da[_0x900ed4]={'$like':'%'+_0x36917d[_0x3483('0x2e')]['filter']+'%'};return _0xf131da;})});}_0x179964=_['merge']({},_0x179964,_0x36917d[_0x3483('0x3b')]);return _0x555da5[_0x3483('0x4f')](_0x179964);}})[_0x3483('0x21')](function(_0xf9cdfa){if(_0xf9cdfa){_0x5ad5a8=_0xf9cdfa[_0x3483('0x32')];if(!_0x36917d[_0x3483('0x2e')][_0x3483('0x4b')]('nolimit')){_0x179964['limit']=qs[_0x3483('0x1b')](_0x36917d[_0x3483('0x2e')]['limit']);_0x179964[_0x3483('0x33')]=qs['offset'](_0x36917d['query'][_0x3483('0x33')]);}return _0x555da5[_0x3483('0x4f')](_0x179964);}})[_0x3483('0x21')](function(_0x1de80d){if(_0x1de80d){return _0x1de80d?{'count':_0x5ad5a8,'rows':_0x1de80d}:null;}})[_0x3483('0x21')](respondWithResult(_0xf8ee9d,null))['catch'](handleError(_0xf8ee9d,null));};
\ No newline at end of file
+var _0x1c1b=['limit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','Condition','ids','omit','getConditions','findOne','order','hasOwnProperty','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','status','stack','name','send','map','Automation','fieldName','type','key','keys','query','intersection','model','attributes','fields','length'];(function(_0x2797bc,_0x3617b0){var _0x24a66c=function(_0x2bc0ff){while(--_0x2bc0ff){_0x2797bc['push'](_0x2797bc['shift']());}};_0x24a66c(++_0x3617b0);}(_0x1c1b,0xc8));var _0xb1c1=function(_0x428dad,_0x7ff665){_0x428dad=_0x428dad-0x0;var _0x4d112f=_0x1c1b[_0x428dad];return _0x4d112f;};'use strict';var emlformat=require(_0xb1c1('0x0'));var rimraf=require(_0xb1c1('0x1'));var zipdir=require(_0xb1c1('0x2'));var jsonpatch=require(_0xb1c1('0x3'));var rp=require(_0xb1c1('0x4'));var moment=require(_0xb1c1('0x5'));var BPromise=require(_0xb1c1('0x6'));var Mustache=require(_0xb1c1('0x7'));var util=require(_0xb1c1('0x8'));var path=require(_0xb1c1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1c1('0xa'));var _=require(_0xb1c1('0xb'));var squel=require(_0xb1c1('0xc'));var crypto=require(_0xb1c1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1c1('0xe'));var querystring=require(_0xb1c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb1c1('0x10'));var authService=require(_0xb1c1('0x11'));var qs=require(_0xb1c1('0x12'));var as=require(_0xb1c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1c1('0x14'))(_0xb1c1('0x15'));var utils=require(_0xb1c1('0x16'));var config=require(_0xb1c1('0x17'));var licenseUtil=require(_0xb1c1('0x18'));var db=require(_0xb1c1('0x19'))['db'];function respondWithStatusCode(_0x4e55e7,_0x2b52b5){_0x2b52b5=_0x2b52b5||0xcc;return function(_0x2fdd7e){if(_0x2fdd7e){return _0x4e55e7[_0xb1c1('0x1a')](_0x2b52b5);}return _0x4e55e7['status'](_0x2b52b5)[_0xb1c1('0x1b')]();};}function respondWithResult(_0x54397f,_0x1d1ec4){_0x1d1ec4=_0x1d1ec4||0xc8;return function(_0x419f4e){if(_0x419f4e){return _0x54397f['status'](_0x1d1ec4)[_0xb1c1('0x1c')](_0x419f4e);}};}function respondWithFilteredResult(_0x2f8c31,_0x57182c){return function(_0x3db660){if(_0x3db660){var _0x18c2f5=typeof _0x57182c[_0xb1c1('0x1d')]===_0xb1c1('0x1e')&&typeof _0x57182c['limit']===_0xb1c1('0x1e');var _0x32d539=_0x3db660[_0xb1c1('0x1f')];var _0x41b19e=_0x18c2f5?0x0:_0x57182c[_0xb1c1('0x1d')];var _0x877e79=_0x18c2f5?_0x3db660['count']:_0x57182c[_0xb1c1('0x1d')]+_0x57182c['limit'];var _0x387ee3;if(_0x877e79>=_0x32d539){_0x877e79=_0x32d539;_0x387ee3=0xc8;}else{_0x387ee3=0xce;}_0x2f8c31['status'](_0x387ee3);return _0x2f8c31[_0xb1c1('0x20')](_0xb1c1('0x21'),_0x41b19e+'-'+_0x877e79+'/'+_0x32d539)[_0xb1c1('0x1c')](_0x3db660);}return null;};}function patchUpdates(_0x9f66f1){return function(_0x3d3622){try{jsonpatch[_0xb1c1('0x22')](_0x3d3622,_0x9f66f1,!![]);}catch(_0x56cc37){return BPromise[_0xb1c1('0x23')](_0x56cc37);}return _0x3d3622[_0xb1c1('0x24')]();};}function saveUpdates(_0x29e58a,_0x272cf8){return function(_0xfee761){if(_0xfee761){return _0xfee761['update'](_0x29e58a)[_0xb1c1('0x25')](function(_0x93abcd){return _0x93abcd;});}return null;};}function removeEntity(_0x19bb60,_0x63f135){return function(_0x539b2c){if(_0x539b2c){return _0x539b2c[_0xb1c1('0x26')]()[_0xb1c1('0x25')](function(){_0x19bb60[_0xb1c1('0x27')](0xcc)[_0xb1c1('0x1b')]();});}};}function handleEntityNotFound(_0x57bf46,_0x2ca9e5){return function(_0x383b02){if(!_0x383b02){_0x57bf46[_0xb1c1('0x1a')](0x194);}return _0x383b02;};}function handleError(_0x1ddd99,_0x181f16){_0x181f16=_0x181f16||0x1f4;return function(_0x27b12a){logger['error'](_0x27b12a[_0xb1c1('0x28')]);if(_0x27b12a['name']){delete _0x27b12a[_0xb1c1('0x29')];}_0x1ddd99[_0xb1c1('0x27')](_0x181f16)[_0xb1c1('0x2a')](_0x27b12a);};}exports['index']=function(_0x38434d,_0x3687c9){var _0x287af3={},_0x1a8b93={},_0x1fd7d9={'count':0x0,'rows':[]};var _0x2d1d3a=_[_0xb1c1('0x2b')](db[_0xb1c1('0x2c')]['rawAttributes'],function(_0xb2e091){return{'name':_0xb2e091[_0xb1c1('0x2d')],'type':_0xb2e091[_0xb1c1('0x2e')][_0xb1c1('0x2f')]};});_0x1a8b93['model']=_[_0xb1c1('0x2b')](_0x2d1d3a,'name');_0x1a8b93['query']=_[_0xb1c1('0x30')](_0x38434d[_0xb1c1('0x31')]);_0x1a8b93['filters']=_[_0xb1c1('0x32')](_0x1a8b93[_0xb1c1('0x33')],_0x1a8b93[_0xb1c1('0x31')]);_0x287af3[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0x1a8b93[_0xb1c1('0x33')],qs[_0xb1c1('0x35')](_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x35')]));_0x287af3[_0xb1c1('0x34')]=_0x287af3[_0xb1c1('0x34')][_0xb1c1('0x36')]?_0x287af3[_0xb1c1('0x34')]:_0x1a8b93[_0xb1c1('0x33')];if(!_0x38434d[_0xb1c1('0x31')]['hasOwnProperty']('nolimit')){_0x287af3[_0xb1c1('0x37')]=qs[_0xb1c1('0x37')](_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x37')]);_0x287af3[_0xb1c1('0x1d')]=qs[_0xb1c1('0x1d')](_0x38434d[_0xb1c1('0x31')]['offset']);}_0x287af3['order']=qs[_0xb1c1('0x38')](_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x38')]);_0x287af3['where']=qs[_0xb1c1('0x39')](_[_0xb1c1('0x3a')](_0x38434d[_0xb1c1('0x31')],_0x1a8b93[_0xb1c1('0x39')]),_0x2d1d3a);if(_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x3b')]){_0x287af3[_0xb1c1('0x3c')]=_[_0xb1c1('0x3d')](_0x287af3['where'],{'$or':_['map'](_0x2d1d3a,function(_0x38cb3d){if(_0x38cb3d['type']!==_0xb1c1('0x3e')){var _0x1705a4={};_0x1705a4[_0x38cb3d[_0xb1c1('0x29')]]={'$like':'%'+_0x38434d[_0xb1c1('0x31')][_0xb1c1('0x3b')]+'%'};return _0x1705a4;}})});}_0x287af3=_['merge']({},_0x287af3,_0x38434d['options']);var _0x13f7b2={'where':_0x287af3['where']};return db[_0xb1c1('0x2c')][_0xb1c1('0x1f')](_0x13f7b2)['then'](function(_0x67ca0){_0x1fd7d9[_0xb1c1('0x1f')]=_0x67ca0;if(_0x38434d['query'][_0xb1c1('0x3f')]){_0x287af3['include']=[{'all':!![]}];}return db[_0xb1c1('0x2c')][_0xb1c1('0x40')](_0x287af3);})[_0xb1c1('0x25')](function(_0x58a484){_0x1fd7d9[_0xb1c1('0x41')]=_0x58a484;return _0x1fd7d9;})[_0xb1c1('0x25')](respondWithFilteredResult(_0x3687c9,_0x287af3))[_0xb1c1('0x42')](handleError(_0x3687c9,null));};exports[_0xb1c1('0x43')]=function(_0x2d12b1,_0x42ecc5){var _0x32fa62={'raw':![],'where':{'id':_0x2d12b1[_0xb1c1('0x44')]['id']}},_0xe6964f={};_0xe6964f[_0xb1c1('0x33')]=_[_0xb1c1('0x30')](db[_0xb1c1('0x2c')][_0xb1c1('0x45')]);_0xe6964f[_0xb1c1('0x31')]=_['keys'](_0x2d12b1['query']);_0xe6964f[_0xb1c1('0x39')]=_[_0xb1c1('0x32')](_0xe6964f['model'],_0xe6964f[_0xb1c1('0x31')]);_0x32fa62[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0xe6964f[_0xb1c1('0x33')],qs['fields'](_0x2d12b1[_0xb1c1('0x31')][_0xb1c1('0x35')]));_0x32fa62[_0xb1c1('0x34')]=_0x32fa62['attributes'][_0xb1c1('0x36')]?_0x32fa62[_0xb1c1('0x34')]:_0xe6964f['model'];if(_0x2d12b1[_0xb1c1('0x31')][_0xb1c1('0x3f')]){_0x32fa62['include']=[{'all':!![]}];}_0x32fa62=_[_0xb1c1('0x3d')]({},_0x32fa62,_0x2d12b1[_0xb1c1('0x46')]);return db['Automation'][_0xb1c1('0x47')](_0x32fa62)[_0xb1c1('0x25')](handleEntityNotFound(_0x42ecc5,null))[_0xb1c1('0x25')](respondWithResult(_0x42ecc5,null))['catch'](handleError(_0x42ecc5,null));};exports['create']=function(_0x547016,_0x397003){return db['Automation'][_0xb1c1('0x48')](_0x547016[_0xb1c1('0x49')],{})[_0xb1c1('0x25')](respondWithResult(_0x397003,0xc9))['catch'](handleError(_0x397003,null));};exports['update']=function(_0xde9864,_0x3d57d0){if(_0xde9864[_0xb1c1('0x49')]['id']){delete _0xde9864[_0xb1c1('0x49')]['id'];}return db[_0xb1c1('0x2c')][_0xb1c1('0x47')]({'where':{'id':_0xde9864[_0xb1c1('0x44')]['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x3d57d0,null))[_0xb1c1('0x25')](saveUpdates(_0xde9864['body'],null))[_0xb1c1('0x25')](respondWithResult(_0x3d57d0,null))[_0xb1c1('0x42')](handleError(_0x3d57d0,null));};exports[_0xb1c1('0x26')]=function(_0x2f0b99,_0x2a58a3){return db[_0xb1c1('0x2c')]['find']({'where':{'id':_0x2f0b99[_0xb1c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a58a3,null))['then'](removeEntity(_0x2a58a3,null))[_0xb1c1('0x42')](handleError(_0x2a58a3,null));};exports['addConditions']=function(_0x1ea308,_0x4c67a1,_0x25c1c2){return db[_0xb1c1('0x4a')][_0xb1c1('0x47')]({'where':{'id':_0x1ea308['params']['id']}})['then'](handleEntityNotFound(_0x4c67a1,null))[_0xb1c1('0x25')](function(_0x473155){if(_0x473155){return _0x473155['addConditions'](_0x1ea308[_0xb1c1('0x49')][_0xb1c1('0x4b')],_[_0xb1c1('0x4c')](_0x1ea308[_0xb1c1('0x49')],[_0xb1c1('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x4c67a1,null))[_0xb1c1('0x42')](handleError(_0x4c67a1,null));};exports[_0xb1c1('0x4d')]=function(_0x13c306,_0x35d94c,_0x4896ee){var _0x56ec58={};var _0x19f1f4={};var _0x2eedef;var _0x3d1243;return db[_0xb1c1('0x2c')][_0xb1c1('0x4e')]({'where':{'id':_0x13c306[_0xb1c1('0x44')]['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x35d94c,null))['then'](function(_0x4ecbc4){if(_0x4ecbc4){_0x2eedef=_0x4ecbc4;_0x19f1f4[_0xb1c1('0x33')]=_[_0xb1c1('0x30')](db['Condition'][_0xb1c1('0x45')]);_0x19f1f4[_0xb1c1('0x31')]=_[_0xb1c1('0x30')](_0x13c306[_0xb1c1('0x31')]);_0x19f1f4[_0xb1c1('0x39')]=_[_0xb1c1('0x32')](_0x19f1f4[_0xb1c1('0x33')],_0x19f1f4[_0xb1c1('0x31')]);_0x56ec58[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0x19f1f4['model'],qs['fields'](_0x13c306['query'][_0xb1c1('0x35')]));_0x56ec58[_0xb1c1('0x34')]=_0x56ec58[_0xb1c1('0x34')][_0xb1c1('0x36')]?_0x56ec58['attributes']:_0x19f1f4[_0xb1c1('0x33')];_0x56ec58[_0xb1c1('0x4f')]=qs['sort'](_0x13c306['query']['sort']);_0x56ec58[_0xb1c1('0x3c')]=qs[_0xb1c1('0x39')](_[_0xb1c1('0x3a')](_0x13c306[_0xb1c1('0x31')],_0x19f1f4[_0xb1c1('0x39')]));if(_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x3b')]){_0x56ec58['where']=_[_0xb1c1('0x3d')](_0x56ec58['where'],{'$or':_[_0xb1c1('0x2b')](_0x56ec58[_0xb1c1('0x34')],function(_0x502b69){var _0x37edda={};_0x37edda[_0x502b69]={'$like':'%'+_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x3b')]+'%'};return _0x37edda;})});}_0x56ec58=_[_0xb1c1('0x3d')]({},_0x56ec58,_0x13c306['options']);return _0x2eedef['getConditions'](_0x56ec58);}})[_0xb1c1('0x25')](function(_0x3a9570){if(_0x3a9570){_0x3d1243=_0x3a9570[_0xb1c1('0x36')];if(!_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x50')](_0xb1c1('0x51'))){_0x56ec58[_0xb1c1('0x37')]=qs[_0xb1c1('0x37')](_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x37')]);_0x56ec58[_0xb1c1('0x1d')]=qs[_0xb1c1('0x1d')](_0x13c306[_0xb1c1('0x31')][_0xb1c1('0x1d')]);}return _0x2eedef[_0xb1c1('0x4d')](_0x56ec58);}})[_0xb1c1('0x25')](function(_0x34bba2){if(_0x34bba2){return _0x34bba2?{'count':_0x3d1243,'rows':_0x34bba2}:null;}})['then'](respondWithResult(_0x35d94c,null))[_0xb1c1('0x42')](handleError(_0x35d94c,null));};exports[_0xb1c1('0x52')]=function(_0x221284,_0x5ee748,_0x318bcb){return db[_0xb1c1('0x53')]['find']({'where':{'id':_0x221284[_0xb1c1('0x44')]['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x5ee748,null))[_0xb1c1('0x25')](function(_0x1d80ec){if(_0x1d80ec){return _0x1d80ec['addActions'](_0x221284[_0xb1c1('0x49')]['ids'],_[_0xb1c1('0x4c')](_0x221284[_0xb1c1('0x49')],['ids','id'])||{});}})[_0xb1c1('0x25')](respondWithResult(_0x5ee748,null))[_0xb1c1('0x42')](handleError(_0x5ee748,null));};exports[_0xb1c1('0x54')]=function(_0xb0e814,_0x397abf,_0x5c8ca6){var _0x1e91c7={};var _0x2c6605={};var _0x18acd9;var _0x1d95ec;return db['Automation'][_0xb1c1('0x4e')]({'where':{'id':_0xb0e814['params']['id']}})[_0xb1c1('0x25')](handleEntityNotFound(_0x397abf,null))[_0xb1c1('0x25')](function(_0x380cf2){if(_0x380cf2){_0x18acd9=_0x380cf2;_0x2c6605[_0xb1c1('0x33')]=_[_0xb1c1('0x30')](db[_0xb1c1('0x53')][_0xb1c1('0x45')]);_0x2c6605[_0xb1c1('0x31')]=_[_0xb1c1('0x30')](_0xb0e814[_0xb1c1('0x31')]);_0x2c6605[_0xb1c1('0x39')]=_[_0xb1c1('0x32')](_0x2c6605['model'],_0x2c6605[_0xb1c1('0x31')]);_0x1e91c7[_0xb1c1('0x34')]=_[_0xb1c1('0x32')](_0x2c6605['model'],qs[_0xb1c1('0x35')](_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x35')]));_0x1e91c7['attributes']=_0x1e91c7['attributes'][_0xb1c1('0x36')]?_0x1e91c7['attributes']:_0x2c6605[_0xb1c1('0x33')];_0x1e91c7[_0xb1c1('0x4f')]=qs[_0xb1c1('0x38')](_0xb0e814['query'][_0xb1c1('0x38')]);_0x1e91c7[_0xb1c1('0x3c')]=qs['filters'](_['pick'](_0xb0e814[_0xb1c1('0x31')],_0x2c6605['filters']));if(_0xb0e814['query'][_0xb1c1('0x3b')]){_0x1e91c7['where']=_[_0xb1c1('0x3d')](_0x1e91c7[_0xb1c1('0x3c')],{'$or':_['map'](_0x1e91c7[_0xb1c1('0x34')],function(_0x7670a9){var _0xf1094f={};_0xf1094f[_0x7670a9]={'$like':'%'+_0xb0e814[_0xb1c1('0x31')]['filter']+'%'};return _0xf1094f;})});}_0x1e91c7=_['merge']({},_0x1e91c7,_0xb0e814[_0xb1c1('0x46')]);return _0x18acd9[_0xb1c1('0x54')](_0x1e91c7);}})['then'](function(_0x413d83){if(_0x413d83){_0x1d95ec=_0x413d83[_0xb1c1('0x36')];if(!_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x50')](_0xb1c1('0x51'))){_0x1e91c7[_0xb1c1('0x37')]=qs[_0xb1c1('0x37')](_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x37')]);_0x1e91c7[_0xb1c1('0x1d')]=qs[_0xb1c1('0x1d')](_0xb0e814[_0xb1c1('0x31')][_0xb1c1('0x1d')]);}return _0x18acd9[_0xb1c1('0x54')](_0x1e91c7);}})[_0xb1c1('0x25')](function(_0x23a22e){if(_0x23a22e){return _0x23a22e?{'count':_0x1d95ec,'rows':_0x23a22e}:null;}})['then'](respondWithResult(_0x397abf,null))[_0xb1c1('0x42')](handleError(_0x397abf,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index c5c7135..54b1d54 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 _0xc9e0=['rimraf','../../config/environment','./automation.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5a8181,_0x926962){var _0x4326bb=function(_0x271398){while(--_0x271398){_0x5a8181['push'](_0x5a8181['shift']());}};_0x4326bb(++_0x926962);}(_0xc9e0,0x14f));var _0x0c9e=function(_0x1cbce4,_0xe099c7){_0x1cbce4=_0x1cbce4-0x0;var _0x5aea53=_0xc9e0[_0x1cbce4];return _0x5aea53;};'use strict';var _=require(_0x0c9e('0x0'));var util=require('util');var logger=require(_0x0c9e('0x1'))('api');var moment=require(_0x0c9e('0x2'));var BPromise=require(_0x0c9e('0x3'));var rp=require(_0x0c9e('0x4'));var fs=require('fs');var path=require(_0x0c9e('0x5'));var rimraf=require(_0x0c9e('0x6'));var config=require(_0x0c9e('0x7'));var attributes=require(_0x0c9e('0x8'));module[_0x0c9e('0x9')]=function(_0x3005eb,_0x19d165){return _0x3005eb[_0x0c9e('0xa')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2568=['tools_automations','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x265773,_0x5d1b6e){var _0x4ed75d=function(_0x3b7ce7){while(--_0x3b7ce7){_0x265773['push'](_0x265773['shift']());}};_0x4ed75d(++_0x5d1b6e);}(_0x2568,0xa9));var _0x8256=function(_0x2ca322,_0x37f83f){_0x2ca322=_0x2ca322-0x0;var _0x509bca=_0x2568[_0x2ca322];return _0x509bca;};'use strict';var _=require('lodash');var util=require(_0x8256('0x0'));var logger=require(_0x8256('0x1'))(_0x8256('0x2'));var moment=require(_0x8256('0x3'));var BPromise=require('bluebird');var rp=require(_0x8256('0x4'));var fs=require('fs');var path=require(_0x8256('0x5'));var rimraf=require('rimraf');var config=require(_0x8256('0x6'));var attributes=require(_0x8256('0x7'));module[_0x8256('0x8')]=function(_0x26804e,_0x36d18b){return _0x26804e[_0x8256('0x9')](_0x8256('0xa'),attributes,{'tableName':_0x8256('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 0bdab0b..91cc31a 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 _0xea28=['rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x75a08f,_0x2795c0){var _0x16688f=function(_0x16096d){while(--_0x16096d){_0x75a08f['push'](_0x75a08f['shift']());}};_0x16688f(++_0x2795c0);}(_0xea28,0x13a));var _0x8ea2=function(_0x27f503,_0x1f62b5){_0x27f503=_0x27f503-0x0;var _0x28226f=_0xea28[_0x27f503];return _0x28226f;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('Automation,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}
\ No newline at end of file
+var _0xf7d9=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x52fb0c,_0x97790b){var _0x11697d=function(_0x80af74){while(--_0x80af74){_0x52fb0c['push'](_0x52fb0c['shift']());}};_0x11697d(++_0x97790b);}(_0xf7d9,0x122));var _0x9f7d=function(_0x3523c5,_0x426d73){_0x3523c5=_0x3523c5-0x0;var _0x2f1beb=_0xf7d9[_0x3523c5];return _0x2f1beb;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6b9,_0xf09259,_0x2333e8){return new BPromise(function(_0x218628,_0x2893a5){return client[_0x9f7d('0xa')](_0x4dc6b9,_0x2333e8)[_0x9f7d('0xb')](function(_0x5290e2){logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,'request\x20sent');logger[_0x9f7d('0xe')](_0x9f7d('0xf'),_0xf09259,_0x9f7d('0x10'),JSON['stringify'](_0x5290e2));if(_0x5290e2[_0x9f7d('0x11')]){if(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x12')]===0x1f4){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2[_0x9f7d('0x11')]['message']);return _0x2893a5(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2['error'][_0x9f7d('0x13')]);return _0x218628(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}else{logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,_0x9f7d('0x10'));_0x218628(_0x5290e2[_0x9f7d('0x14')]['message']);}})['catch'](function(_0x402609){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x402609);_0x2893a5(_0x402609);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index ceb44ab..d4d0289 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 _0x45d1=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','getConditions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer'];(function(_0x41cf18,_0x2cc769){var _0x251cd4=function(_0x1aebeb){while(--_0x1aebeb){_0x41cf18['push'](_0x41cf18['shift']());}};_0x251cd4(++_0x2cc769);}(_0x45d1,0x1cb));var _0x145d=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0x45d1[_0x158da6];return _0x429c30;};'use strict';var multer=require(_0x145d('0x0'));var util=require(_0x145d('0x1'));var path=require('path');var timeout=require(_0x145d('0x2'));var express=require(_0x145d('0x3'));var router=express['Router']();var fs_extra=require(_0x145d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x145d('0x5'));var config=require(_0x145d('0x6'));var controller=require(_0x145d('0x7'));router[_0x145d('0x8')]('/',auth[_0x145d('0x9')](),controller[_0x145d('0xa')]);router[_0x145d('0x8')](_0x145d('0xb'),auth[_0x145d('0x9')](),controller['show']);router['get']('/:id/conditions',auth[_0x145d('0x9')](),controller[_0x145d('0xc')]);router[_0x145d('0x8')]('/:id/actions',auth[_0x145d('0x9')](),controller['getActions']);router[_0x145d('0xd')]('/',auth[_0x145d('0x9')](),controller[_0x145d('0xe')]);router[_0x145d('0xd')]('/:id/conditions',auth[_0x145d('0x9')](),controller[_0x145d('0xf')]);router['post'](_0x145d('0x10'),auth[_0x145d('0x9')](),controller[_0x145d('0x11')]);router[_0x145d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x145d('0x13')]);router[_0x145d('0x14')](_0x145d('0xb'),auth['isAuthenticated'](),controller[_0x145d('0x15')]);module[_0x145d('0x16')]=router;
\ No newline at end of file
+var _0x5044=['../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getActions','post','create','addConditions','/:id/actions','addActions','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ee5d1,_0x873e57){var _0x18bc14=function(_0xba1b9b){while(--_0xba1b9b){_0x4ee5d1['push'](_0x4ee5d1['shift']());}};_0x18bc14(++_0x873e57);}(_0x5044,0xc8));var _0x4504=function(_0x32032a,_0x24e8d1){_0x32032a=_0x32032a-0x0;var _0x5d5792=_0x5044[_0x32032a];return _0x5d5792;};'use strict';var multer=require('multer');var util=require(_0x4504('0x0'));var path=require('path');var timeout=require(_0x4504('0x1'));var express=require(_0x4504('0x2'));var router=express[_0x4504('0x3')]();var fs_extra=require(_0x4504('0x4'));var auth=require(_0x4504('0x5'));var interaction=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var controller=require(_0x4504('0x8'));router['get']('/',auth[_0x4504('0x9')](),controller[_0x4504('0xa')]);router[_0x4504('0xb')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0xd')]);router[_0x4504('0xb')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller['getConditions']);router[_0x4504('0xb')]('/:id/actions',auth[_0x4504('0x9')](),controller[_0x4504('0xf')]);router[_0x4504('0x10')]('/',auth[_0x4504('0x9')](),controller[_0x4504('0x11')]);router[_0x4504('0x10')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller[_0x4504('0x12')]);router[_0x4504('0x10')](_0x4504('0x13'),auth[_0x4504('0x9')](),controller[_0x4504('0x14')]);router['put'](_0x4504('0xc'),auth[_0x4504('0x9')](),controller['update']);router[_0x4504('0x15')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 4278df3..974af81 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 _0x18ec=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','always','Active/Disactive\x20AMD','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x18ec,0x6c));var _0xc18e=function(_0xbb4285,_0x334a04){_0xbb4285=_0xbb4285-0x0;var _0x38149d=_0x18ec[_0xbb4285];return _0x38149d;};'use strict';var Sequelize=require(_0xc18e('0x0'));module[_0xc18e('0x1')]={'name':{'type':Sequelize[_0xc18e('0x2')],'unique':_0xc18e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xc18e('0x4')),'allowNull':![],'defaultValue':_0xc18e('0x4')},'description':{'type':Sequelize[_0xc18e('0x2')]},'active':{'type':Sequelize[_0xc18e('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xc18e('0x6')](0x4)[_0xc18e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc18e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc18e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc18e('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc18e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc18e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc18e('0x6')](0x3)[_0xc18e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc18e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc18e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc18e('0x6')](0x3)[_0xc18e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc18e('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc18e('0x6')](0x5)[_0xc18e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc18e('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc18e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc18e('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc18e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc18e('0xd')},'dialTimezone':{'type':Sequelize[_0xc18e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc18e('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xc18e('0xe'),'onlyIfOpen'),'defaultValue':_0xc18e('0xf')},'dialAMDActive':{'type':Sequelize[_0xc18e('0x5')],'defaultValue':0x0,'comment':_0xc18e('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc18e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc18e('0x6')](0x9)[_0xc18e('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc18e('0x6')](0x9)[_0xc18e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc18e('0x11')},'dialAMDMinWordLength':{'type':Sequelize[_0xc18e('0x6')](0x9)[_0xc18e('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc18e('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc18e('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc18e('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xc18e('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc18e('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc18e('0x6')](0x5)[_0xc18e('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc18e('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc18e('0x6')](0x9)[_0xc18e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc18e('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc18e('0x17')]('DESC',_0xc18e('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xc18e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc18e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc18e('0x19')},'dialCutDigit':{'type':Sequelize[_0xc18e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc18e('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc18e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc18e('0x6')](0x5)[_0xc18e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc18e('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xc18e('0x6')](0x3)[_0xc18e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc18e('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc18e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc18e('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc18e('0x6')](0x3)[_0xc18e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc18e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc18e('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xc18e('0x6')](0x3)[_0xc18e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc18e('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc18e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc18e('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc18e('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc18e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc18e('0x22')}};
\ No newline at end of file
+var _0x5324=['ENUM','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x2a13f3,_0x38636a){var _0x8987ac=function(_0x4e9eef){while(--_0x4e9eef){_0x2a13f3['push'](_0x2a13f3['shift']());}};_0x8987ac(++_0x38636a);}(_0x5324,0x154));var _0x4532=function(_0x3e6f29,_0x4dda33){_0x3e6f29=_0x3e6f29-0x0;var _0xd8dd25=_0x5324[_0x3e6f29];return _0xd8dd25;};'use strict';var Sequelize=require(_0x4532('0x0'));module[_0x4532('0x1')]={'name':{'type':Sequelize[_0x4532('0x2')],'unique':_0x4532('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4532('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x4532('0x2')]},'active':{'type':Sequelize[_0x4532('0x5')],'defaultValue':0x0,'comment':_0x4532('0x6')},'limitCalls':{'type':Sequelize[_0x4532('0x7')](0x4)[_0x4532('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4532('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4532('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4532('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4532('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4532('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4532('0x10')},'dialTimezone':{'type':Sequelize[_0x4532('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4532('0x2')],'defaultValue':_0x4532('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x4532('0x12')),'defaultValue':_0x4532('0x13')},'dialAMDActive':{'type':Sequelize[_0x4532('0x5')],'defaultValue':0x0,'comment':_0x4532('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4532('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4532('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4532('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4532('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4532('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4532('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4532('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4532('0x7')](0x9)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4532('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x4532('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4532('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4532('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4532('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4532('0x1d')](_0x4532('0x1e'),'ASC'),'defaultValue':_0x4532('0x1e')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4532('0x1f')},'dialCutDigit':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4532('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4532('0x7')](0x3)[_0x4532('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4532('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4532('0x7')](0x5)[_0x4532('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4532('0x28')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 648d105..348c385 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 _0x58d6=['NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','ListId\x20=\x20?','fromQuery','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','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','omit','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','show','length','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','body','IvrCampaigns','update','findOne','CmHopper','findAll','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','scheduledAt','ContactId','ListId','select','field','phone'];(function(_0x3d5fc8,_0x3503d7){var _0xec8c82=function(_0x43bc49){while(--_0x43bc49){_0x3d5fc8['push'](_0x3d5fc8['shift']());}};_0xec8c82(++_0x3503d7);}(_0x58d6,0x1d3));var _0x658d=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0x58d6[_0x179c4a];return _0x5d1879;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x658d('0x0'));var zipdir=require(_0x658d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x658d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x658d('0x3'));var util=require(_0x658d('0x4'));var path=require(_0x658d('0x5'));var sox=require(_0x658d('0x6'));var csv=require('to-csv');var ejs=require(_0x658d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x658d('0x8'));var squel=require(_0x658d('0x9'));var crypto=require(_0x658d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x658d('0xb'));var toCsv=require(_0x658d('0xc'));var querystring=require(_0x658d('0xd'));var Papa=require('papaparse');var Redis=require(_0x658d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x658d('0xf'));var as=require(_0x658d('0x10'));var hardwareService=require(_0x658d('0x11'));var logger=require('../../config/logger')(_0x658d('0x12'));var utils=require(_0x658d('0x13'));var config=require(_0x658d('0x14'));var licenseUtil=require(_0x658d('0x15'));var db=require(_0x658d('0x16'))['db'];function respondWithStatusCode(_0x2a266b,_0x9efc8c){_0x9efc8c=_0x9efc8c||0xcc;return function(_0x51295b){if(_0x51295b){return _0x2a266b[_0x658d('0x17')](_0x9efc8c);}return _0x2a266b[_0x658d('0x18')](_0x9efc8c)[_0x658d('0x19')]();};}function respondWithResult(_0x47360e,_0x43de3d){_0x43de3d=_0x43de3d||0xc8;return function(_0x28a2d0){if(_0x28a2d0){return _0x47360e[_0x658d('0x18')](_0x43de3d)[_0x658d('0x1a')](_0x28a2d0);}};}function respondWithFilteredResult(_0x303606,_0x17b20f){return function(_0x284431){if(_0x284431){var _0x42aae9=typeof _0x17b20f[_0x658d('0x1b')]==='undefined'&&typeof _0x17b20f[_0x658d('0x1c')]===_0x658d('0x1d');var _0x3031b4=_0x284431[_0x658d('0x1e')];var _0x8bcf62=_0x42aae9?0x0:_0x17b20f[_0x658d('0x1b')];var _0x13aa47=_0x42aae9?_0x284431[_0x658d('0x1e')]:_0x17b20f[_0x658d('0x1b')]+_0x17b20f['limit'];var _0x544b7c;if(_0x13aa47>=_0x3031b4){_0x13aa47=_0x3031b4;_0x544b7c=0xc8;}else{_0x544b7c=0xce;}_0x303606[_0x658d('0x18')](_0x544b7c);return _0x303606[_0x658d('0x1f')](_0x658d('0x20'),_0x8bcf62+'-'+_0x13aa47+'/'+_0x3031b4)[_0x658d('0x1a')](_0x284431);}return null;};}function patchUpdates(_0x2f1335){return function(_0x1c0271){try{jsonpatch[_0x658d('0x21')](_0x1c0271,_0x2f1335,!![]);}catch(_0x641d4){return BPromise[_0x658d('0x22')](_0x641d4);}return _0x1c0271['save']();};}function saveUpdates(_0x559e74,_0x408996){return function(_0x3ac068){if(_0x3ac068){return _0x3ac068['update'](_0x559e74)[_0x658d('0x23')](function(_0x13cbc3){return _0x13cbc3;});}return null;};}function removeEntity(_0x3e95f5,_0x56dd20){return function(_0x4f9418){if(_0x4f9418){return _0x4f9418[_0x658d('0x24')]()[_0x658d('0x23')](function(){var _0x556ce9=_0x4f9418[_0x658d('0x25')]({'plain':!![]});var _0x41f238='IvrCampaigns';return db[_0x658d('0x26')][_0x658d('0x24')]({'where':{'type':_0x41f238,'resourceId':_0x556ce9['id']}})[_0x658d('0x23')](function(){return _0x4f9418;});})['then'](function(){_0x3e95f5[_0x658d('0x18')](0xcc)[_0x658d('0x19')]();});}};}function handleEntityNotFound(_0x12fce9,_0x18a265){return function(_0xb2f751){if(!_0xb2f751){_0x12fce9[_0x658d('0x17')](0x194);}return _0xb2f751;};}function handleError(_0x1924aa,_0x819481){_0x819481=_0x819481||0x1f4;return function(_0x918588){logger[_0x658d('0x27')](_0x918588[_0x658d('0x28')]);if(_0x918588[_0x658d('0x29')]){delete _0x918588['name'];}_0x1924aa[_0x658d('0x18')](_0x819481)[_0x658d('0x2a')](_0x918588);};}exports['index']=function(_0x11c191,_0xda355b){var _0x17db1a={},_0x1e189b={},_0xc62d8={'count':0x0,'rows':[]};var _0x9d8b62=_[_0x658d('0x2b')](db[_0x658d('0x2c')][_0x658d('0x2d')],function(_0x4b4f73){return{'name':_0x4b4f73[_0x658d('0x2e')],'type':_0x4b4f73['type'][_0x658d('0x2f')]};});_0x1e189b[_0x658d('0x30')]=_[_0x658d('0x2b')](_0x9d8b62,_0x658d('0x29'));_0x1e189b[_0x658d('0x31')]=_[_0x658d('0x32')](_0x11c191[_0x658d('0x31')]);_0x1e189b[_0x658d('0x33')]=_[_0x658d('0x34')](_0x1e189b[_0x658d('0x30')],_0x1e189b[_0x658d('0x31')]);_0x17db1a[_0x658d('0x35')]=_[_0x658d('0x34')](_0x1e189b[_0x658d('0x30')],qs[_0x658d('0x36')](_0x11c191[_0x658d('0x31')]['fields']));_0x17db1a['attributes']=_0x17db1a[_0x658d('0x35')]['length']?_0x17db1a[_0x658d('0x35')]:_0x1e189b[_0x658d('0x30')];if(!_0x11c191[_0x658d('0x31')][_0x658d('0x37')](_0x658d('0x38'))){_0x17db1a[_0x658d('0x1c')]=qs[_0x658d('0x1c')](_0x11c191[_0x658d('0x31')][_0x658d('0x1c')]);_0x17db1a['offset']=qs['offset'](_0x11c191[_0x658d('0x31')][_0x658d('0x1b')]);}_0x17db1a[_0x658d('0x39')]=qs[_0x658d('0x3a')](_0x11c191[_0x658d('0x31')][_0x658d('0x3a')]);_0x17db1a[_0x658d('0x3b')]=qs[_0x658d('0x33')](_[_0x658d('0x3c')](_0x11c191[_0x658d('0x31')],_0x1e189b[_0x658d('0x33')]),_0x9d8b62);if(_0x11c191['query'][_0x658d('0x3d')]){_0x17db1a[_0x658d('0x3b')]=_[_0x658d('0x3e')](_0x17db1a[_0x658d('0x3b')],{'$or':_[_0x658d('0x2b')](_0x9d8b62,function(_0x295387){if(_0x295387[_0x658d('0x3f')]!==_0x658d('0x40')){var _0x337afd={};_0x337afd[_0x295387['name']]={'$like':'%'+_0x11c191[_0x658d('0x31')][_0x658d('0x3d')]+'%'};return _0x337afd;}})});}_0x17db1a=_[_0x658d('0x3e')]({},_0x17db1a,_0x11c191[_0x658d('0x41')]);var _0x3e8698={'where':_0x17db1a[_0x658d('0x3b')]};return db[_0x658d('0x2c')]['count'](_0x3e8698)[_0x658d('0x23')](function(_0xdd974f){_0xc62d8[_0x658d('0x1e')]=_0xdd974f;if(_0x11c191[_0x658d('0x31')][_0x658d('0x42')]){_0x17db1a['include']=[{'all':!![]}];}return db[_0x658d('0x2c')]['findAll'](_0x17db1a);})['then'](function(_0xce7485){_0xc62d8[_0x658d('0x43')]=_0xce7485;return _0xc62d8;})[_0x658d('0x23')](respondWithFilteredResult(_0xda355b,_0x17db1a))['catch'](handleError(_0xda355b,null));};exports[_0x658d('0x44')]=function(_0x55b50f,_0xc28287){var _0x2a340c={'raw':![],'where':{'id':_0x55b50f['params']['id']}},_0x316c0f={};_0x316c0f[_0x658d('0x30')]=_['keys'](db[_0x658d('0x2c')][_0x658d('0x2d')]);_0x316c0f[_0x658d('0x31')]=_[_0x658d('0x32')](_0x55b50f['query']);_0x316c0f[_0x658d('0x33')]=_['intersection'](_0x316c0f[_0x658d('0x30')],_0x316c0f[_0x658d('0x31')]);_0x2a340c['attributes']=_['intersection'](_0x316c0f[_0x658d('0x30')],qs[_0x658d('0x36')](_0x55b50f['query'][_0x658d('0x36')]));_0x2a340c[_0x658d('0x35')]=_0x2a340c[_0x658d('0x35')][_0x658d('0x45')]?_0x2a340c['attributes']:_0x316c0f['model'];if(_0x55b50f[_0x658d('0x31')][_0x658d('0x42')]){_0x2a340c[_0x658d('0x46')]=[{'all':!![]}];}_0x2a340c=_[_0x658d('0x3e')]({},_0x2a340c,_0x55b50f[_0x658d('0x41')]);return db[_0x658d('0x2c')]['find'](_0x2a340c)['then'](handleEntityNotFound(_0xc28287,null))[_0x658d('0x23')](respondWithResult(_0xc28287,null))[_0x658d('0x47')](handleError(_0xc28287,null));};exports['create']=function(_0xd1f6e9,_0x3e4fc1){return db[_0x658d('0x2c')][_0x658d('0x48')](_0xd1f6e9['body'],{})['then'](function(_0xa188d1){var _0x279443=_0xd1f6e9[_0x658d('0x49')][_0x658d('0x25')]({'plain':!![]});if(!_0x279443)throw new Error(_0x658d('0x4a'));if(_0x279443[_0x658d('0x4b')]===_0x658d('0x49')){var _0x3a114c=_0xa188d1['get']({'plain':!![]});var _0x1b30b8='IvrCampaigns';return db[_0x658d('0x4c')][_0x658d('0x4d')]({'where':{'name':_0x1b30b8,'userProfileId':_0x279443[_0x658d('0x4e')]},'raw':!![]})[_0x658d('0x23')](function(_0x24cf3f){if(_0x24cf3f&&_0x24cf3f[_0x658d('0x4f')]===0x0){return db[_0x658d('0x26')][_0x658d('0x48')]({'name':_0x3a114c[_0x658d('0x29')],'resourceId':_0x3a114c['id'],'type':_0x24cf3f[_0x658d('0x29')],'sectionId':_0x24cf3f['id']},{})[_0x658d('0x23')](function(){return _0xa188d1;});}else{return _0xa188d1;}})['catch'](function(_0x5ec0d0){logger[_0x658d('0x27')](_0x658d('0x50'),_0x5ec0d0);throw _0x5ec0d0;});}return _0xa188d1;})['then'](respondWithResult(_0x3e4fc1,0xc9))[_0x658d('0x47')](handleError(_0x3e4fc1,null));};exports['clone']=function(_0x49106b,_0x2ad993){var _0x63457d={'where':{'id':_0x49106b[_0x658d('0x51')]['id']}},_0x283d7f={};_0x283d7f[_0x658d('0x30')]=_[_0x658d('0x32')](db[_0x658d('0x2c')][_0x658d('0x2d')]);_0x63457d[_0x658d('0x35')]=_[_0x658d('0x34')](_0x283d7f[_0x658d('0x30')],qs[_0x658d('0x36')](_0x49106b[_0x658d('0x31')][_0x658d('0x36')]));_0x63457d[_0x658d('0x35')]=_0x63457d[_0x658d('0x35')][_0x658d('0x45')]?_0x63457d[_0x658d('0x35')]:_0x283d7f[_0x658d('0x30')];if(_0x49106b[_0x658d('0x31')][_0x658d('0x42')]){_0x63457d[_0x658d('0x46')]=[{'all':!![]}];}_0x63457d=_[_0x658d('0x3e')]({},_0x63457d,_0x49106b[_0x658d('0x41')]);return db[_0x658d('0x2c')]['find'](_0x63457d)['then'](handleEntityNotFound(_0x2ad993,null))[_0x658d('0x23')](function(_0x30d8b9){if(_0x30d8b9){var _0x4fb904=_0x30d8b9[_0x658d('0x25')]({'plain':!![]});_0x4fb904=qs['omit'](_0x4fb904,['id',_0x658d('0x52'),_0x658d('0x53')]);_0x49106b['body']=_['omit'](_0x49106b[_0x658d('0x54')],['id',_0x658d('0x52'),_0x658d('0x53')]);return db['Campaign'][_0x658d('0x48')](_[_0x658d('0x3e')](_0x4fb904,_0x49106b[_0x658d('0x54')]),{'include':_0x49106b['query'][_0x658d('0x42')]?[{'all':!![]}]:undefined})[_0x658d('0x23')](function(_0x579ee2){var _0x16e70a=_0x49106b[_0x658d('0x49')]['get']({'plain':!![]});if(!_0x16e70a)throw new Error(_0x658d('0x4a'));if(_0x16e70a['role']===_0x658d('0x49')){var _0x7c51dd=_0x579ee2[_0x658d('0x25')]({'plain':!![]});var _0x47152a=_0x658d('0x55');return db['UserProfileSection'][_0x658d('0x4d')]({'where':{'name':_0x47152a,'userProfileId':_0x16e70a[_0x658d('0x4e')]},'raw':!![]})[_0x658d('0x23')](function(_0x4715e0){if(_0x4715e0&&_0x4715e0[_0x658d('0x4f')]===0x0){return db[_0x658d('0x26')][_0x658d('0x48')]({'name':_0x7c51dd['name'],'resourceId':_0x7c51dd['id'],'type':_0x4715e0['name'],'sectionId':_0x4715e0['id']},{})['then'](function(){return _0x579ee2;});}else{return _0x579ee2;}})[_0x658d('0x47')](function(_0xf18e7f){logger[_0x658d('0x27')](_0x658d('0x50'),_0xf18e7f);throw _0xf18e7f;});}return _0x579ee2;});}})[_0x658d('0x23')](respondWithResult(_0x2ad993,0xc9))[_0x658d('0x47')](handleError(_0x2ad993,null));};exports[_0x658d('0x56')]=function(_0x1b15af,_0x273aa7){if(_0x1b15af[_0x658d('0x54')]['id']){delete _0x1b15af[_0x658d('0x54')]['id'];}return db[_0x658d('0x2c')][_0x658d('0x4d')]({'where':{'id':_0x1b15af[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x273aa7,null))['then'](saveUpdates(_0x1b15af[_0x658d('0x54')],null))[_0x658d('0x23')](respondWithResult(_0x273aa7,null))[_0x658d('0x47')](handleError(_0x273aa7,null));};exports['destroy']=function(_0x3c226f,_0x430a95){return db[_0x658d('0x2c')][_0x658d('0x4d')]({'where':{'id':_0x3c226f[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x430a95,null))[_0x658d('0x23')](removeEntity(_0x430a95,null))[_0x658d('0x47')](handleError(_0x430a95,null));};exports['getHoppers']=function(_0x5d835a,_0x5c844c,_0x564078){var _0x38fdef={'raw':!![],'where':{}};var _0x265dbc={};var _0x2b5295={'count':0x0,'rows':[]};return db[_0x658d('0x2c')][_0x658d('0x57')]({'where':{'id':_0x5d835a[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x5c844c,null))[_0x658d('0x23')](function(_0x1547f8){if(_0x1547f8){_0x265dbc[_0x658d('0x30')]=_[_0x658d('0x32')](db['CmHopper'][_0x658d('0x2d')]);_0x265dbc[_0x658d('0x31')]=_[_0x658d('0x32')](_0x5d835a[_0x658d('0x31')]);_0x265dbc[_0x658d('0x33')]=_[_0x658d('0x34')](_0x265dbc['model'],_0x265dbc['query']);_0x38fdef[_0x658d('0x35')]=_[_0x658d('0x34')](_0x265dbc[_0x658d('0x30')],qs[_0x658d('0x36')](_0x5d835a[_0x658d('0x31')]['fields']));_0x38fdef[_0x658d('0x35')]=_0x38fdef[_0x658d('0x35')]['length']?_0x38fdef['attributes']:_0x265dbc[_0x658d('0x30')];if(!_0x5d835a[_0x658d('0x31')][_0x658d('0x37')](_0x658d('0x38'))){_0x38fdef[_0x658d('0x1c')]=qs['limit'](_0x5d835a[_0x658d('0x31')][_0x658d('0x1c')]);_0x38fdef[_0x658d('0x1b')]=qs[_0x658d('0x1b')](_0x5d835a[_0x658d('0x31')][_0x658d('0x1b')]);}_0x38fdef[_0x658d('0x39')]=qs['sort'](_0x5d835a['query'][_0x658d('0x3a')]);_0x38fdef[_0x658d('0x3b')]=qs[_0x658d('0x33')](_[_0x658d('0x3c')](_0x5d835a[_0x658d('0x31')],_0x265dbc[_0x658d('0x33')]));_0x38fdef[_0x658d('0x3b')]['CampaignId']=_0x1547f8['id'];if(_0x5d835a[_0x658d('0x31')]['filter']){_0x38fdef[_0x658d('0x3b')]=_[_0x658d('0x3e')](_0x38fdef[_0x658d('0x3b')],{'$or':_[_0x658d('0x2b')](_0x38fdef[_0x658d('0x35')],function(_0x37d605){var _0x402722={};_0x402722[_0x37d605]={'$like':'%'+_0x5d835a[_0x658d('0x31')][_0x658d('0x3d')]+'%'};return _0x402722;})});}_0x38fdef=_['merge']({},_0x38fdef,_0x5d835a[_0x658d('0x41')]);return db['CmHopper']['count']({'where':_0x38fdef[_0x658d('0x3b')]})[_0x658d('0x23')](function(_0x5f36cf){_0x2b5295[_0x658d('0x1e')]=_0x5f36cf;if(_0x5d835a['query'][_0x658d('0x42')]){_0x38fdef[_0x658d('0x46')]=[{'all':!![]}];}return db[_0x658d('0x58')][_0x658d('0x59')](_0x38fdef);})[_0x658d('0x23')](function(_0x38cc3b){_0x2b5295[_0x658d('0x43')]=_0x38cc3b;return _0x2b5295;});}})[_0x658d('0x23')](respondWithFilteredResult(_0x5c844c,_0x38fdef))[_0x658d('0x47')](handleError(_0x5c844c,null));};exports['getHopperHistories']=function(_0x210fee,_0x14f77e,_0xddcc7a){var _0x10cab6={'raw':!![],'where':{}};var _0x18a1ba={};var _0x28a5f8={'count':0x0,'rows':[]};return db[_0x658d('0x2c')][_0x658d('0x57')]({'where':{'id':_0x210fee[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x14f77e,null))['then'](function(_0x5eaa6c){if(_0x5eaa6c){_0x18a1ba[_0x658d('0x30')]=_[_0x658d('0x32')](db['CmHopperHistory'][_0x658d('0x2d')]);_0x18a1ba[_0x658d('0x31')]=_['keys'](_0x210fee[_0x658d('0x31')]);_0x18a1ba[_0x658d('0x33')]=_[_0x658d('0x34')](_0x18a1ba[_0x658d('0x30')],_0x18a1ba['query']);_0x10cab6['attributes']=_[_0x658d('0x34')](_0x18a1ba[_0x658d('0x30')],qs[_0x658d('0x36')](_0x210fee[_0x658d('0x31')]['fields']));_0x10cab6[_0x658d('0x35')]=_0x10cab6['attributes'][_0x658d('0x45')]?_0x10cab6[_0x658d('0x35')]:_0x18a1ba[_0x658d('0x30')];if(!_0x210fee[_0x658d('0x31')]['hasOwnProperty'](_0x658d('0x38'))){_0x10cab6[_0x658d('0x1c')]=qs[_0x658d('0x1c')](_0x210fee[_0x658d('0x31')][_0x658d('0x1c')]);_0x10cab6[_0x658d('0x1b')]=qs[_0x658d('0x1b')](_0x210fee[_0x658d('0x31')][_0x658d('0x1b')]);}_0x10cab6[_0x658d('0x39')]=qs[_0x658d('0x3a')](_0x210fee[_0x658d('0x31')][_0x658d('0x3a')]);_0x10cab6[_0x658d('0x3b')]=qs[_0x658d('0x33')](_[_0x658d('0x3c')](_0x210fee['query'],_0x18a1ba['filters']));_0x10cab6[_0x658d('0x3b')][_0x658d('0x5a')]=_0x5eaa6c['id'];if(_0x210fee[_0x658d('0x31')][_0x658d('0x3d')]){_0x10cab6[_0x658d('0x3b')]=_[_0x658d('0x3e')](_0x10cab6[_0x658d('0x3b')],{'$or':_[_0x658d('0x2b')](_0x10cab6[_0x658d('0x35')],function(_0x11444c){var _0x348f8b={};_0x348f8b[_0x11444c]={'$like':'%'+_0x210fee[_0x658d('0x31')][_0x658d('0x3d')]+'%'};return _0x348f8b;})});}_0x10cab6=_[_0x658d('0x3e')]({},_0x10cab6,_0x210fee['options']);return db[_0x658d('0x5b')][_0x658d('0x1e')]({'where':_0x10cab6['where']})[_0x658d('0x23')](function(_0x5866d5){_0x28a5f8[_0x658d('0x1e')]=_0x5866d5;if(_0x210fee['query'][_0x658d('0x42')]){_0x10cab6['include']=[{'all':!![]}];}return db[_0x658d('0x5b')][_0x658d('0x59')](_0x10cab6);})[_0x658d('0x23')](function(_0x12de37){_0x28a5f8[_0x658d('0x43')]=_0x12de37;return _0x28a5f8;});}})[_0x658d('0x23')](respondWithFilteredResult(_0x14f77e,_0x10cab6))[_0x658d('0x47')](handleError(_0x14f77e,null));};exports[_0x658d('0x5c')]=function(_0x3103c7,_0x9caad5,_0x167468){var _0x22cbe7={'raw':!![],'where':{}};var _0x153ef0={};var _0x4f285c={'count':0x0,'rows':[]};return db[_0x658d('0x2c')][_0x658d('0x57')]({'where':{'id':_0x3103c7[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x9caad5,null))[_0x658d('0x23')](function(_0x308a55){if(_0x308a55){_0x153ef0[_0x658d('0x30')]=_[_0x658d('0x32')](db[_0x658d('0x5d')][_0x658d('0x2d')]);_0x153ef0['query']=_[_0x658d('0x32')](_0x3103c7[_0x658d('0x31')]);_0x153ef0['filters']=_[_0x658d('0x34')](_0x153ef0[_0x658d('0x30')],_0x153ef0[_0x658d('0x31')]);_0x22cbe7['attributes']=_[_0x658d('0x34')](_0x153ef0[_0x658d('0x30')],qs[_0x658d('0x36')](_0x3103c7[_0x658d('0x31')][_0x658d('0x36')]));_0x22cbe7[_0x658d('0x35')]=_0x22cbe7[_0x658d('0x35')]['length']?_0x22cbe7[_0x658d('0x35')]:_0x153ef0[_0x658d('0x30')];if(!_0x3103c7[_0x658d('0x31')][_0x658d('0x37')](_0x658d('0x38'))){_0x22cbe7['limit']=qs[_0x658d('0x1c')](_0x3103c7[_0x658d('0x31')][_0x658d('0x1c')]);_0x22cbe7['offset']=qs[_0x658d('0x1b')](_0x3103c7[_0x658d('0x31')]['offset']);}_0x22cbe7['order']=qs[_0x658d('0x3a')](_0x3103c7['query'][_0x658d('0x3a')]);_0x22cbe7['where']=qs[_0x658d('0x33')](_[_0x658d('0x3c')](_0x3103c7[_0x658d('0x31')],_0x153ef0[_0x658d('0x33')]));_0x22cbe7[_0x658d('0x3b')]['CampaignId']=_0x308a55['id'];if(_0x3103c7['query'][_0x658d('0x3d')]){_0x22cbe7[_0x658d('0x3b')]=_[_0x658d('0x3e')](_0x22cbe7['where'],{'$or':_[_0x658d('0x2b')](_0x22cbe7[_0x658d('0x35')],function(_0x2611fb){var _0x5f4a59={};_0x5f4a59[_0x2611fb]={'$like':'%'+_0x3103c7[_0x658d('0x31')][_0x658d('0x3d')]+'%'};return _0x5f4a59;})});}_0x22cbe7=_[_0x658d('0x3e')]({},_0x22cbe7,_0x3103c7[_0x658d('0x41')]);return db[_0x658d('0x5d')]['count']({'where':_0x22cbe7['where']})[_0x658d('0x23')](function(_0x45ec08){_0x4f285c['count']=_0x45ec08;if(_0x3103c7[_0x658d('0x31')][_0x658d('0x42')]){_0x22cbe7[_0x658d('0x46')]=[{'all':!![]}];}return db[_0x658d('0x5d')][_0x658d('0x59')](_0x22cbe7);})['then'](function(_0xaf1039){_0x4f285c[_0x658d('0x43')]=_0xaf1039;return _0x4f285c;});}})[_0x658d('0x23')](respondWithFilteredResult(_0x9caad5,_0x22cbe7))[_0x658d('0x47')](handleError(_0x9caad5,null));};exports[_0x658d('0x5e')]=function(_0xf4d662,_0xca591d,_0x5b0627){var _0x4a4956={'raw':!![],'where':{}};var _0x12990d={};var _0x445e01={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xf4d662['params']['id']}})[_0x658d('0x23')](handleEntityNotFound(_0xca591d,null))['then'](function(_0x15da2e){if(_0x15da2e){_0x12990d[_0x658d('0x30')]=_[_0x658d('0x32')](db['CmHopperBlack']['rawAttributes']);_0x12990d[_0x658d('0x31')]=_[_0x658d('0x32')](_0xf4d662['query']);_0x12990d['filters']=_['intersection'](_0x12990d[_0x658d('0x30')],_0x12990d[_0x658d('0x31')]);_0x4a4956[_0x658d('0x35')]=_['intersection'](_0x12990d[_0x658d('0x30')],qs['fields'](_0xf4d662[_0x658d('0x31')][_0x658d('0x36')]));_0x4a4956[_0x658d('0x35')]=_0x4a4956['attributes'][_0x658d('0x45')]?_0x4a4956[_0x658d('0x35')]:_0x12990d[_0x658d('0x30')];if(!_0xf4d662[_0x658d('0x31')][_0x658d('0x37')](_0x658d('0x38'))){_0x4a4956[_0x658d('0x1c')]=qs[_0x658d('0x1c')](_0xf4d662[_0x658d('0x31')][_0x658d('0x1c')]);_0x4a4956[_0x658d('0x1b')]=qs[_0x658d('0x1b')](_0xf4d662[_0x658d('0x31')]['offset']);}_0x4a4956['order']=qs[_0x658d('0x3a')](_0xf4d662['query'][_0x658d('0x3a')]);_0x4a4956[_0x658d('0x3b')]=qs[_0x658d('0x33')](_[_0x658d('0x3c')](_0xf4d662[_0x658d('0x31')],_0x12990d[_0x658d('0x33')]));_0x4a4956[_0x658d('0x3b')][_0x658d('0x5a')]=_0x15da2e['id'];if(_0xf4d662[_0x658d('0x31')][_0x658d('0x3d')]){_0x4a4956[_0x658d('0x3b')]=_[_0x658d('0x3e')](_0x4a4956[_0x658d('0x3b')],{'$or':_['map'](_0x4a4956[_0x658d('0x35')],function(_0x11a2d3){var _0x10b453={};_0x10b453[_0x11a2d3]={'$like':'%'+_0xf4d662[_0x658d('0x31')][_0x658d('0x3d')]+'%'};return _0x10b453;})});}_0x4a4956=_[_0x658d('0x3e')]({},_0x4a4956,_0xf4d662[_0x658d('0x41')]);return db[_0x658d('0x5f')][_0x658d('0x1e')]({'where':_0x4a4956['where']})[_0x658d('0x23')](function(_0xd17d6d){_0x445e01[_0x658d('0x1e')]=_0xd17d6d;if(_0xf4d662[_0x658d('0x31')][_0x658d('0x42')]){_0x4a4956[_0x658d('0x46')]=[{'all':!![]}];}return db[_0x658d('0x5f')][_0x658d('0x59')](_0x4a4956);})['then'](function(_0x47336a){_0x445e01[_0x658d('0x43')]=_0x47336a;return _0x445e01;});}})['then'](respondWithFilteredResult(_0xca591d,_0x4a4956))[_0x658d('0x47')](handleError(_0xca591d,null));};exports[_0x658d('0x60')]=function(_0x2dbbe8,_0x2c6b70,_0x29eaf2){var _0x5c8167={};var _0x2685bf={};var _0x2716bd;var _0x393c73;return db[_0x658d('0x2c')]['findOne']({'where':{'id':_0x2dbbe8[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x2c6b70,null))['then'](function(_0x203863){if(_0x203863){_0x2716bd=_0x203863;_0x2685bf['model']=_['keys'](db[_0x658d('0x61')][_0x658d('0x2d')]);_0x2685bf[_0x658d('0x31')]=_[_0x658d('0x32')](_0x2dbbe8[_0x658d('0x31')]);_0x2685bf[_0x658d('0x33')]=_['intersection'](_0x2685bf[_0x658d('0x30')],_0x2685bf[_0x658d('0x31')]);_0x5c8167[_0x658d('0x35')]=_['intersection'](_0x2685bf[_0x658d('0x30')],qs[_0x658d('0x36')](_0x2dbbe8['query'][_0x658d('0x36')]));_0x5c8167[_0x658d('0x35')]=_0x5c8167[_0x658d('0x35')]['length']?_0x5c8167[_0x658d('0x35')]:_0x2685bf[_0x658d('0x30')];_0x5c8167['order']=qs[_0x658d('0x3a')](_0x2dbbe8[_0x658d('0x31')]['sort']);_0x5c8167['where']=qs[_0x658d('0x33')](_['pick'](_0x2dbbe8[_0x658d('0x31')],_0x2685bf[_0x658d('0x33')]));if(_0x2dbbe8[_0x658d('0x31')][_0x658d('0x3d')]){_0x5c8167[_0x658d('0x3b')]=_[_0x658d('0x3e')](_0x5c8167['where'],{'$or':_[_0x658d('0x2b')](_0x5c8167['attributes'],function(_0x544e39){var _0x1562fc={};_0x1562fc[_0x544e39]={'$like':'%'+_0x2dbbe8['query'][_0x658d('0x3d')]+'%'};return _0x1562fc;})});}_0x5c8167=_['merge']({},_0x5c8167,_0x2dbbe8['options']);return _0x2716bd[_0x658d('0x60')](_0x5c8167);}})[_0x658d('0x23')](function(_0x418185){if(_0x418185){_0x393c73=_0x418185[_0x658d('0x45')];if(!_0x2dbbe8[_0x658d('0x31')][_0x658d('0x37')](_0x658d('0x38'))){_0x5c8167['limit']=qs[_0x658d('0x1c')](_0x2dbbe8[_0x658d('0x31')][_0x658d('0x1c')]);_0x5c8167[_0x658d('0x1b')]=qs[_0x658d('0x1b')](_0x2dbbe8['query'][_0x658d('0x1b')]);}return _0x2716bd[_0x658d('0x60')](_0x5c8167);}})[_0x658d('0x23')](function(_0x2c910d){if(_0x2c910d){return _0x2c910d?{'count':_0x393c73,'rows':_0x2c910d}:null;}})[_0x658d('0x23')](respondWithResult(_0x2c6b70,null))['catch'](handleError(_0x2c6b70,null));};exports[_0x658d('0x62')]=function(_0x1f3304,_0xa7b32d,_0x61336f){var _0x432566,_0x55918c;var _0x351fcf=[];var _0x3b8a52=moment()[_0x658d('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x658d('0x2c')][_0x658d('0x4d')]({'where':{'id':_0x1f3304[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0xa7b32d,null))['then'](function(_0x1925df){if(_0x1925df){_0x55918c=_0x1925df;return _0x1925df[_0x658d('0x62')](_0x1f3304[_0x658d('0x54')][_0x658d('0x64')],_['omit'](_0x1f3304[_0x658d('0x54')],['ids','id'])||{});}return null;})[_0x658d('0x65')](function(_0x2e439c){var _0x4f12ab;var _0x65bbc7;_0x432566=_0x2e439c||[];var _0x725cf8=[];if(_0x2e439c){for(var _0x249e69=0x0;_0x249e69<_0x2e439c[_0x658d('0x45')];_0x249e69+=0x1){var _0x3b6ac9=_0x2e439c[_0x249e69][_0x658d('0x25')]({'plain':!![]});_0x55918c[_0x658d('0x66')]=_0x1f3304[_0x658d('0x54')][_0x658d('0x66')]?_0x1f3304[_0x658d('0x54')]['dialCheckDuplicateType']:_0x55918c[_0x658d('0x66')];switch(_0x55918c[_0x658d('0x66')]){case _0x658d('0x67'):_0x4f12ab=squel[_0x658d('0x68')]()[_0x658d('0x69')](_0x658d('0x6a'))['fromQuery'](['phone',_0x658d('0x6b'),_0x658d('0x6c'),_0x658d('0x6d'),_0x658d('0x5a'),_0x658d('0x52'),_0x658d('0x53')],squel[_0x658d('0x6e')]()[_0x658d('0x6f')](_0x658d('0x70'),'phone')[_0x658d('0x6f')](_0x658d('0x71'),_0x658d('0x6b'))[_0x658d('0x6f')]('id','ContactId')[_0x658d('0x6f')](_0x3b6ac9[_0x658d('0x72')][_0x658d('0x73')](),'ListId')[_0x658d('0x6f')](_0x1f3304['params']['id']['toString'](),_0x658d('0x5a'))[_0x658d('0x6f')]('\x27'+_0x3b8a52+'\x27',_0x658d('0x52'))[_0x658d('0x6f')]('\x27'+_0x3b8a52+'\x27','updatedAt')[_0x658d('0x74')]('cm_contacts')[_0x658d('0x3b')](_0x658d('0x75'))['where']('ListId\x20=\x20?',_0x3b6ac9['CmListId'][_0x658d('0x73')]())['where'](_0x658d('0x76'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x658d('0x6e')]()[_0x658d('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0x658d('0x74')]('cm_hopper_final')[_0x658d('0x3b')](_0x658d('0x77'),_0x1f3304[_0x658d('0x51')]['id'][_0x658d('0x73')]()))['where'](_0x658d('0x78'),squel[_0x658d('0x6e')]()[_0x658d('0x6f')](_0x658d('0x79'))[_0x658d('0x74')](_0x658d('0x6a'))[_0x658d('0x3b')](_0x658d('0x77'),_0x1f3304[_0x658d('0x51')]['id']['toString']())))[_0x658d('0x73')]();break;case _0x658d('0x7a'):_0x4f12ab=squel[_0x658d('0x68')]()[_0x658d('0x69')](_0x658d('0x6a'))['fromQuery']([_0x658d('0x70'),_0x658d('0x6b'),_0x658d('0x6c'),_0x658d('0x6d'),_0x658d('0x5a'),_0x658d('0x52'),_0x658d('0x53')],squel[_0x658d('0x6e')]()['field']('phone','phone')[_0x658d('0x6f')]('NOW()',_0x658d('0x6b'))['field']('id',_0x658d('0x6c'))[_0x658d('0x6f')](_0x3b6ac9[_0x658d('0x72')][_0x658d('0x73')](),_0x658d('0x6d'))[_0x658d('0x6f')](_0x1f3304[_0x658d('0x51')]['id'][_0x658d('0x73')](),'CampaignId')[_0x658d('0x6f')]('\x27'+_0x3b8a52+'\x27',_0x658d('0x52'))['field']('\x27'+_0x3b8a52+'\x27',_0x658d('0x53'))[_0x658d('0x74')](_0x658d('0x7b'))[_0x658d('0x3b')](_0x658d('0x75'))['where'](_0x658d('0x7c'),_0x3b6ac9[_0x658d('0x72')][_0x658d('0x73')]())[_0x658d('0x3b')](_0x658d('0x76'))[_0x658d('0x3b')](_0x658d('0x78'),squel[_0x658d('0x6e')]()[_0x658d('0x6f')](_0x658d('0x79'))[_0x658d('0x74')](_0x658d('0x6a'))[_0x658d('0x3b')]('CampaignId\x20=\x20?',_0x1f3304['params']['id'][_0x658d('0x73')]())))[_0x658d('0x73')]();break;default:_0x4f12ab=squel[_0x658d('0x68')]()[_0x658d('0x69')](_0x658d('0x6a'))[_0x658d('0x7d')](['phone',_0x658d('0x6b'),'ContactId',_0x658d('0x6d'),_0x658d('0x5a'),_0x658d('0x52'),'updatedAt'],squel['select']()[_0x658d('0x6f')](_0x658d('0x70'),_0x658d('0x70'))[_0x658d('0x6f')](_0x658d('0x71'),_0x658d('0x6b'))[_0x658d('0x6f')]('id','ContactId')[_0x658d('0x6f')](_0x3b6ac9[_0x658d('0x72')]['toString'](),'ListId')[_0x658d('0x6f')](_0x1f3304['params']['id'][_0x658d('0x73')](),_0x658d('0x5a'))[_0x658d('0x6f')]('\x27'+_0x3b8a52+'\x27','createdAt')[_0x658d('0x6f')]('\x27'+_0x3b8a52+'\x27',_0x658d('0x53'))[_0x658d('0x74')]('cm_contacts')['where'](_0x658d('0x75'))[_0x658d('0x3b')]('ListId\x20=\x20?',_0x3b6ac9[_0x658d('0x72')]['toString']())['where'](_0x658d('0x76')))[_0x658d('0x73')]();}_0x65bbc7=squel[_0x658d('0x68')]()[_0x658d('0x69')](_0x658d('0x7e'))[_0x658d('0x7d')]([_0x658d('0x7f'),_0x658d('0x6b'),_0x658d('0x70'),'OrderBy','createdAt',_0x658d('0x53')],squel[_0x658d('0x6e')]()[_0x658d('0x6f')](_0x658d('0x80'),'id')[_0x658d('0x6f')](_0x658d('0x71'),'scheduledAt')[_0x658d('0x6f')](_0x658d('0x81'),_0x658d('0x70'))[_0x658d('0x6f')](_0x658d('0x82'),'OrderBy')['field']('\x27'+_0x3b8a52+'\x27',_0x658d('0x52'))['field']('\x27'+_0x3b8a52+'\x27',_0x658d('0x53'))[_0x658d('0x74')](_0x658d('0x83'),'ci')[_0x658d('0x84')]('cm_hopper','h',_0x658d('0x85'))[_0x658d('0x3b')](_0x658d('0x86'),_0x3b6ac9[_0x658d('0x72')][_0x658d('0x73')]())['where']('h.CampaignId=?',_0x1f3304[_0x658d('0x51')]['id'][_0x658d('0x73')]())[_0x658d('0x3b')](_0x658d('0x87'),_0x3b8a52))[_0x658d('0x73')]();_0x725cf8[_0x658d('0x88')](db[_0x658d('0x89')][_0x658d('0x31')](_0x4f12ab));_0x351fcf[_0x658d('0x88')](db['sequelize']['query'](_0x65bbc7));}return BPromise[_0x658d('0x8a')](_0x725cf8);}})[_0x658d('0x23')](function(){return BPromise[_0x658d('0x8a')](_0x351fcf);})[_0x658d('0x23')](function(){return _0x432566;})['then'](respondWithResult(_0xa7b32d,null))[_0x658d('0x47')](handleError(_0xa7b32d,null));};exports['removeLists']=function(_0x12e939,_0x201aad,_0x13e792){return db[_0x658d('0x2c')][_0x658d('0x4d')]({'where':{'id':_0x12e939[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x201aad,null))[_0x658d('0x23')](function(_0x173f8b){if(_0x173f8b){return _0x173f8b[_0x658d('0x8b')](_0x12e939['query'][_0x658d('0x64')]);}})[_0x658d('0x23')](function(_0x33abe9){if(_0x33abe9){return db[_0x658d('0x58')][_0x658d('0x24')]({'where':{'ListId':_0x12e939[_0x658d('0x31')]['ids'],'CampaignId':_0x12e939[_0x658d('0x51')]['id']}})[_0x658d('0x23')](function(){return _0x33abe9;});}})[_0x658d('0x23')](respondWithStatusCode(_0x201aad,null))[_0x658d('0x47')](handleError(_0x201aad,null));};exports[_0x658d('0x8c')]=function(_0x243fb3,_0x42c8c0,_0x3fa4b4){var _0x1f5d51={};var _0x4d7697={};var _0x4a20cf;var _0x1da0d6;return db['Campaign']['findOne']({'where':{'id':_0x243fb3[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x42c8c0,null))[_0x658d('0x23')](function(_0x35a6e1){if(_0x35a6e1){_0x4a20cf=_0x35a6e1;_0x4d7697[_0x658d('0x30')]=_[_0x658d('0x32')](db['CmList']['rawAttributes']);_0x4d7697['query']=_[_0x658d('0x32')](_0x243fb3['query']);_0x4d7697['filters']=_['intersection'](_0x4d7697['model'],_0x4d7697[_0x658d('0x31')]);_0x1f5d51['attributes']=_[_0x658d('0x34')](_0x4d7697['model'],qs[_0x658d('0x36')](_0x243fb3[_0x658d('0x31')]['fields']));_0x1f5d51[_0x658d('0x35')]=_0x1f5d51[_0x658d('0x35')][_0x658d('0x45')]?_0x1f5d51['attributes']:_0x4d7697['model'];_0x1f5d51['order']=qs[_0x658d('0x3a')](_0x243fb3[_0x658d('0x31')][_0x658d('0x3a')]);_0x1f5d51[_0x658d('0x3b')]=qs[_0x658d('0x33')](_[_0x658d('0x3c')](_0x243fb3[_0x658d('0x31')],_0x4d7697[_0x658d('0x33')]));if(_0x243fb3[_0x658d('0x31')]['filter']){_0x1f5d51[_0x658d('0x3b')]=_['merge'](_0x1f5d51['where'],{'$or':_['map'](_0x1f5d51[_0x658d('0x35')],function(_0xf396d1){var _0x236395={};_0x236395[_0xf396d1]={'$like':'%'+_0x243fb3[_0x658d('0x31')][_0x658d('0x3d')]+'%'};return _0x236395;})});}_0x1f5d51=_['merge']({},_0x1f5d51,_0x243fb3['options']);return _0x4a20cf['getBlackLists'](_0x1f5d51);}})[_0x658d('0x23')](function(_0x4f2b85){if(_0x4f2b85){_0x1da0d6=_0x4f2b85[_0x658d('0x45')];if(!_0x243fb3[_0x658d('0x31')][_0x658d('0x37')]('nolimit')){_0x1f5d51[_0x658d('0x1c')]=qs['limit'](_0x243fb3[_0x658d('0x31')]['limit']);_0x1f5d51[_0x658d('0x1b')]=qs[_0x658d('0x1b')](_0x243fb3[_0x658d('0x31')][_0x658d('0x1b')]);}return _0x4a20cf[_0x658d('0x8c')](_0x1f5d51);}})['then'](function(_0x1c9e14){if(_0x1c9e14){return _0x1c9e14?{'count':_0x1da0d6,'rows':_0x1c9e14}:null;}})[_0x658d('0x23')](respondWithResult(_0x42c8c0,null))[_0x658d('0x47')](handleError(_0x42c8c0,null));};exports[_0x658d('0x8d')]=function(_0x30d5da,_0x2d1a08,_0x54a1b0){var _0xc305a0,_0x41a7c6;var _0x10318a=[];var _0xb52c9a=moment()[_0x658d('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x658d('0x2c')]['find']({'where':{'id':_0x30d5da[_0x658d('0x51')]['id']}})[_0x658d('0x23')](handleEntityNotFound(_0x2d1a08,null))[_0x658d('0x23')](function(_0x413e96){if(_0x413e96){_0x41a7c6=_0x413e96;return _0x413e96[_0x658d('0x8d')](_0x30d5da[_0x658d('0x54')][_0x658d('0x64')],_[_0x658d('0x8e')](_0x30d5da[_0x658d('0x54')],['ids','id'])||{});}return null;})['spread'](function(_0x22b198){var _0x1d8e8d;var _0x5c9606;_0xc305a0=_0x22b198||[];var _0x1941ba=[];if(_0x22b198){for(var _0x3ea974=0x0;_0x3ea974<_0x22b198[_0x658d('0x45')];_0x3ea974+=0x1){var _0x42f234=_0x22b198[_0x3ea974]['get']({'plain':!![]});_0x1d8e8d=squel[_0x658d('0x68')]()[_0x658d('0x69')](_0x658d('0x8f'))[_0x658d('0x7d')]([_0x658d('0x70'),_0x658d('0x6c'),_0x658d('0x6d'),_0x658d('0x5a'),_0x658d('0x52'),_0x658d('0x53')],squel['select']()[_0x658d('0x6f')](_0x658d('0x70'),_0x658d('0x70'))[_0x658d('0x6f')]('id',_0x658d('0x6c'))[_0x658d('0x6f')](_0x42f234[_0x658d('0x72')][_0x658d('0x73')](),_0x658d('0x6d'))[_0x658d('0x6f')](_0x30d5da['params']['id'][_0x658d('0x73')](),_0x658d('0x5a'))[_0x658d('0x6f')]('NOW()',_0x658d('0x52'))[_0x658d('0x6f')](_0x658d('0x71'),'updatedAt')['from'](_0x658d('0x7b'))[_0x658d('0x3b')](_0x658d('0x75'))[_0x658d('0x3b')](_0x658d('0x7c'),_0x42f234[_0x658d('0x72')][_0x658d('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x1941ba[_0x658d('0x88')](db[_0x658d('0x89')][_0x658d('0x31')](_0x1d8e8d));}return BPromise[_0x658d('0x8a')](_0x1941ba);}})[_0x658d('0x23')](function(){return _0xc305a0;})['then'](respondWithResult(_0x2d1a08,null))['catch'](handleError(_0x2d1a08,null));};exports[_0x658d('0x90')]=function(_0x5029e3,_0xab37a5,_0xf20281){return db['Campaign']['find']({'where':{'id':_0x5029e3['params']['id']}})[_0x658d('0x23')](handleEntityNotFound(_0xab37a5,null))[_0x658d('0x23')](function(_0x49c110){if(_0x49c110){return _0x49c110[_0x658d('0x90')](_0x5029e3['query'][_0x658d('0x64')]);}})[_0x658d('0x23')](function(_0x344af8){if(_0x344af8){return db[_0x658d('0x5f')][_0x658d('0x24')]({'where':{'ListId':_0x5029e3[_0x658d('0x31')][_0x658d('0x64')],'CampaignId':_0x5029e3[_0x658d('0x51')]['id']}})[_0x658d('0x23')](function(){return _0x344af8;});}})[_0x658d('0x23')](respondWithStatusCode(_0xab37a5,null))['catch'](handleError(_0xab37a5,null));};
\ No newline at end of file
+var _0xbaca=['save','then','get','sendStatus','error','stack','name','index','Campaign','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','autoAssociation','rawAttributes','include','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','from','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','into','cm_hopper','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','ci.item','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject'];(function(_0xa464a1,_0x4ec344){var _0x19e814=function(_0x37a871){while(--_0x37a871){_0xa464a1['push'](_0xa464a1['shift']());}};_0x19e814(++_0x4ec344);}(_0xbaca,0xfc));var _0xabac=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0xbaca[_0x351b46];return _0x1515df;};'use strict';var emlformat=require(_0xabac('0x0'));var rimraf=require(_0xabac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabac('0x2'));var rp=require(_0xabac('0x3'));var moment=require('moment');var BPromise=require(_0xabac('0x4'));var Mustache=require('mustache');var util=require(_0xabac('0x5'));var path=require(_0xabac('0x6'));var sox=require(_0xabac('0x7'));var csv=require(_0xabac('0x8'));var ejs=require(_0xabac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabac('0xa'));var crypto=require(_0xabac('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xabac('0x8'));var querystring=require(_0xabac('0xc'));var Papa=require(_0xabac('0xd'));var Redis=require('ioredis');var authService=require(_0xabac('0xe'));var qs=require(_0xabac('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabac('0x10'));var logger=require('../../config/logger')(_0xabac('0x11'));var utils=require(_0xabac('0x12'));var config=require(_0xabac('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xabac('0x14'))['db'];function respondWithStatusCode(_0xbd90d,_0x16f966){_0x16f966=_0x16f966||0xcc;return function(_0x5d9804){if(_0x5d9804){return _0xbd90d['sendStatus'](_0x16f966);}return _0xbd90d['status'](_0x16f966)[_0xabac('0x15')]();};}function respondWithResult(_0x40883b,_0x1484a4){_0x1484a4=_0x1484a4||0xc8;return function(_0x4e0a5){if(_0x4e0a5){return _0x40883b['status'](_0x1484a4)[_0xabac('0x16')](_0x4e0a5);}};}function respondWithFilteredResult(_0x3cbd4e,_0x267e31){return function(_0x3f54bc){if(_0x3f54bc){var _0x54381d=typeof _0x267e31[_0xabac('0x17')]===_0xabac('0x18')&&typeof _0x267e31[_0xabac('0x19')]===_0xabac('0x18');var _0x331da9=_0x3f54bc[_0xabac('0x1a')];var _0x3cd537=_0x54381d?0x0:_0x267e31['offset'];var _0x174d5b=_0x54381d?_0x3f54bc['count']:_0x267e31[_0xabac('0x17')]+_0x267e31[_0xabac('0x19')];var _0x42ccfb;if(_0x174d5b>=_0x331da9){_0x174d5b=_0x331da9;_0x42ccfb=0xc8;}else{_0x42ccfb=0xce;}_0x3cbd4e[_0xabac('0x1b')](_0x42ccfb);return _0x3cbd4e[_0xabac('0x1c')](_0xabac('0x1d'),_0x3cd537+'-'+_0x174d5b+'/'+_0x331da9)[_0xabac('0x16')](_0x3f54bc);}return null;};}function patchUpdates(_0x4313d7){return function(_0x42922d){try{jsonpatch[_0xabac('0x1e')](_0x42922d,_0x4313d7,!![]);}catch(_0x4ecae5){return BPromise[_0xabac('0x1f')](_0x4ecae5);}return _0x42922d[_0xabac('0x20')]();};}function saveUpdates(_0x459c84,_0x2b0586){return function(_0x3e8dc0){if(_0x3e8dc0){return _0x3e8dc0['update'](_0x459c84)[_0xabac('0x21')](function(_0x4ca55f){return _0x4ca55f;});}return null;};}function removeEntity(_0x5892f3,_0x159dc6){return function(_0xba977d){if(_0xba977d){return _0xba977d['destroy']()[_0xabac('0x21')](function(){var _0x55e6a5=_0xba977d[_0xabac('0x22')]({'plain':!![]});var _0x12d962='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x12d962,'resourceId':_0x55e6a5['id']}})[_0xabac('0x21')](function(){return _0xba977d;});})[_0xabac('0x21')](function(){_0x5892f3[_0xabac('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec8a4,_0x62dd1e){return function(_0x191d7c){if(!_0x191d7c){_0x2ec8a4[_0xabac('0x23')](0x194);}return _0x191d7c;};}function handleError(_0x3471ab,_0x3e4a13){_0x3e4a13=_0x3e4a13||0x1f4;return function(_0xb34291){logger[_0xabac('0x24')](_0xb34291[_0xabac('0x25')]);if(_0xb34291[_0xabac('0x26')]){delete _0xb34291[_0xabac('0x26')];}_0x3471ab[_0xabac('0x1b')](_0x3e4a13)['send'](_0xb34291);};}exports[_0xabac('0x27')]=function(_0x5714d4,_0x3a624d){var _0xf2ada5={},_0x571024={},_0x308f6f={'count':0x0,'rows':[]};var _0x1eb6ee=_['map'](db[_0xabac('0x28')]['rawAttributes'],function(_0x46f2c0){return{'name':_0x46f2c0[_0xabac('0x29')],'type':_0x46f2c0['type'][_0xabac('0x2a')]};});_0x571024[_0xabac('0x2b')]=_['map'](_0x1eb6ee,_0xabac('0x26'));_0x571024[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x5714d4[_0xabac('0x2c')]);_0x571024[_0xabac('0x2e')]=_['intersection'](_0x571024[_0xabac('0x2b')],_0x571024[_0xabac('0x2c')]);_0xf2ada5['attributes']=_[_0xabac('0x2f')](_0x571024[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x5714d4[_0xabac('0x2c')]['fields']));_0xf2ada5[_0xabac('0x31')]=_0xf2ada5[_0xabac('0x31')][_0xabac('0x32')]?_0xf2ada5[_0xabac('0x31')]:_0x571024[_0xabac('0x2b')];if(!_0x5714d4[_0xabac('0x2c')][_0xabac('0x33')](_0xabac('0x34'))){_0xf2ada5[_0xabac('0x19')]=qs[_0xabac('0x19')](_0x5714d4['query'][_0xabac('0x19')]);_0xf2ada5[_0xabac('0x17')]=qs[_0xabac('0x17')](_0x5714d4['query'][_0xabac('0x17')]);}_0xf2ada5[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x5714d4[_0xabac('0x2c')][_0xabac('0x36')]);_0xf2ada5[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x5714d4[_0xabac('0x2c')],_0x571024[_0xabac('0x2e')]),_0x1eb6ee);if(_0x5714d4[_0xabac('0x2c')][_0xabac('0x39')]){_0xf2ada5[_0xabac('0x37')]=_['merge'](_0xf2ada5[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x1eb6ee,function(_0x1ab8e7){if(_0x1ab8e7[_0xabac('0x3b')]!==_0xabac('0x3c')){var _0x403b06={};_0x403b06[_0x1ab8e7[_0xabac('0x26')]]={'$like':'%'+_0x5714d4['query'][_0xabac('0x39')]+'%'};return _0x403b06;}})});}_0xf2ada5=_[_0xabac('0x3d')]({},_0xf2ada5,_0x5714d4[_0xabac('0x3e')]);var _0x39c157={'where':_0xf2ada5['where']};return db[_0xabac('0x28')][_0xabac('0x1a')](_0x39c157)[_0xabac('0x21')](function(_0x201d51){_0x308f6f[_0xabac('0x1a')]=_0x201d51;if(_0x5714d4['query']['includeAll']){_0xf2ada5['include']=[{'all':!![]}];}return db['Campaign'][_0xabac('0x3f')](_0xf2ada5);})[_0xabac('0x21')](function(_0x1bb9bf){_0x308f6f[_0xabac('0x40')]=_0x1bb9bf;return _0x308f6f;})[_0xabac('0x21')](respondWithFilteredResult(_0x3a624d,_0xf2ada5))[_0xabac('0x41')](handleError(_0x3a624d,null));};exports[_0xabac('0x42')]=function(_0x41ffcd,_0x1b3f34){var _0x4f7792={'raw':![],'where':{'id':_0x41ffcd[_0xabac('0x43')]['id']}},_0x354541={};_0x354541[_0xabac('0x2b')]=_['keys'](db[_0xabac('0x28')]['rawAttributes']);_0x354541[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x41ffcd[_0xabac('0x2c')]);_0x354541[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x354541[_0xabac('0x2b')],_0x354541[_0xabac('0x2c')]);_0x4f7792[_0xabac('0x31')]=_['intersection'](_0x354541[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x41ffcd[_0xabac('0x2c')][_0xabac('0x30')]));_0x4f7792[_0xabac('0x31')]=_0x4f7792[_0xabac('0x31')][_0xabac('0x32')]?_0x4f7792[_0xabac('0x31')]:_0x354541[_0xabac('0x2b')];if(_0x41ffcd[_0xabac('0x2c')][_0xabac('0x44')]){_0x4f7792['include']=[{'all':!![]}];}_0x4f7792=_['merge']({},_0x4f7792,_0x41ffcd[_0xabac('0x3e')]);return db[_0xabac('0x28')][_0xabac('0x45')](_0x4f7792)[_0xabac('0x21')](handleEntityNotFound(_0x1b3f34,null))[_0xabac('0x21')](respondWithResult(_0x1b3f34,null))[_0xabac('0x41')](handleError(_0x1b3f34,null));};exports[_0xabac('0x46')]=function(_0x50ec3b,_0x50dd71){return db[_0xabac('0x28')][_0xabac('0x46')](_0x50ec3b[_0xabac('0x47')],{})[_0xabac('0x21')](function(_0x18449a){var _0x13227a=_0x50ec3b[_0xabac('0x48')][_0xabac('0x22')]({'plain':!![]});if(!_0x13227a)throw new Error(_0xabac('0x49'));if(_0x13227a[_0xabac('0x4a')]===_0xabac('0x48')){var _0x2af818=_0x18449a[_0xabac('0x22')]({'plain':!![]});var _0x199ab5=_0xabac('0x4b');return db[_0xabac('0x4c')][_0xabac('0x45')]({'where':{'name':_0x199ab5,'userProfileId':_0x13227a['userProfileId']},'raw':!![]})[_0xabac('0x21')](function(_0x54a04d){if(_0x54a04d&&_0x54a04d[_0xabac('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x2af818['name'],'resourceId':_0x2af818['id'],'type':_0x54a04d[_0xabac('0x26')],'sectionId':_0x54a04d['id']},{})['then'](function(){return _0x18449a;});}else{return _0x18449a;}})[_0xabac('0x41')](function(_0x1cb946){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cb946);throw _0x1cb946;});}return _0x18449a;})[_0xabac('0x21')](respondWithResult(_0x50dd71,0xc9))[_0xabac('0x41')](handleError(_0x50dd71,null));};exports['clone']=function(_0x2edc16,_0x2e6b2e){var _0x1c5553={'where':{'id':_0x2edc16[_0xabac('0x43')]['id']}},_0xcc22ed={};_0xcc22ed[_0xabac('0x2b')]=_[_0xabac('0x2d')](db[_0xabac('0x28')][_0xabac('0x4e')]);_0x1c5553[_0xabac('0x31')]=_[_0xabac('0x2f')](_0xcc22ed[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x2edc16[_0xabac('0x2c')][_0xabac('0x30')]));_0x1c5553[_0xabac('0x31')]=_0x1c5553[_0xabac('0x31')][_0xabac('0x32')]?_0x1c5553[_0xabac('0x31')]:_0xcc22ed[_0xabac('0x2b')];if(_0x2edc16[_0xabac('0x2c')][_0xabac('0x44')]){_0x1c5553[_0xabac('0x4f')]=[{'all':!![]}];}_0x1c5553=_['merge']({},_0x1c5553,_0x2edc16[_0xabac('0x3e')]);return db['Campaign'][_0xabac('0x45')](_0x1c5553)[_0xabac('0x21')](handleEntityNotFound(_0x2e6b2e,null))[_0xabac('0x21')](function(_0x3d6878){if(_0x3d6878){var _0x3f1b5a=_0x3d6878[_0xabac('0x22')]({'plain':!![]});_0x3f1b5a=qs[_0xabac('0x50')](_0x3f1b5a,['id',_0xabac('0x51'),_0xabac('0x52')]);_0x2edc16[_0xabac('0x47')]=_[_0xabac('0x50')](_0x2edc16[_0xabac('0x47')],['id','createdAt',_0xabac('0x52')]);return db[_0xabac('0x28')][_0xabac('0x46')](_[_0xabac('0x3d')](_0x3f1b5a,_0x2edc16[_0xabac('0x47')]),{'include':_0x2edc16['query'][_0xabac('0x44')]?[{'all':!![]}]:undefined})[_0xabac('0x21')](function(_0xf8ecbc){var _0x44ce6b=_0x2edc16[_0xabac('0x48')]['get']({'plain':!![]});if(!_0x44ce6b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44ce6b[_0xabac('0x4a')]===_0xabac('0x48')){var _0x490821=_0xf8ecbc[_0xabac('0x22')]({'plain':!![]});var _0x6bc7a4=_0xabac('0x4b');return db[_0xabac('0x4c')][_0xabac('0x45')]({'where':{'name':_0x6bc7a4,'userProfileId':_0x44ce6b[_0xabac('0x53')]},'raw':!![]})[_0xabac('0x21')](function(_0x25e25e){if(_0x25e25e&&_0x25e25e[_0xabac('0x4d')]===0x0){return db['UserProfileResource'][_0xabac('0x46')]({'name':_0x490821[_0xabac('0x26')],'resourceId':_0x490821['id'],'type':_0x25e25e[_0xabac('0x26')],'sectionId':_0x25e25e['id']},{})[_0xabac('0x21')](function(){return _0xf8ecbc;});}else{return _0xf8ecbc;}})[_0xabac('0x41')](function(_0x2ed8ca){logger[_0xabac('0x24')](_0xabac('0x54'),_0x2ed8ca);throw _0x2ed8ca;});}return _0xf8ecbc;});}})[_0xabac('0x21')](respondWithResult(_0x2e6b2e,0xc9))[_0xabac('0x41')](handleError(_0x2e6b2e,null));};exports[_0xabac('0x55')]=function(_0x42cbef,_0xc1b4ae){if(_0x42cbef[_0xabac('0x47')]['id']){delete _0x42cbef['body']['id'];}return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x42cbef['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0xc1b4ae,null))[_0xabac('0x21')](saveUpdates(_0x42cbef[_0xabac('0x47')],null))[_0xabac('0x21')](respondWithResult(_0xc1b4ae,null))[_0xabac('0x41')](handleError(_0xc1b4ae,null));};exports[_0xabac('0x56')]=function(_0x5507b4,_0x7c45b1){return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x5507b4[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x7c45b1,null))[_0xabac('0x21')](removeEntity(_0x7c45b1,null))[_0xabac('0x41')](handleError(_0x7c45b1,null));};exports['getHoppers']=function(_0x2ac6a8,_0x3573c7,_0x889cf2){var _0x135057={'raw':!![],'where':{}};var _0x3aa068={};var _0x1d6b8e={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x2ac6a8[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x3573c7,null))[_0xabac('0x21')](function(_0x30e525){if(_0x30e525){_0x3aa068['model']=_[_0xabac('0x2d')](db[_0xabac('0x58')][_0xabac('0x4e')]);_0x3aa068[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x2ac6a8[_0xabac('0x2c')]);_0x3aa068[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x3aa068[_0xabac('0x2b')],_0x3aa068[_0xabac('0x2c')]);_0x135057[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x3aa068['model'],qs['fields'](_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x30')]));_0x135057[_0xabac('0x31')]=_0x135057[_0xabac('0x31')][_0xabac('0x32')]?_0x135057[_0xabac('0x31')]:_0x3aa068[_0xabac('0x2b')];if(!_0x2ac6a8['query'][_0xabac('0x33')](_0xabac('0x34'))){_0x135057['limit']=qs[_0xabac('0x19')](_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x19')]);_0x135057['offset']=qs['offset'](_0x2ac6a8['query'][_0xabac('0x17')]);}_0x135057[_0xabac('0x35')]=qs['sort'](_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x36')]);_0x135057[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x2ac6a8[_0xabac('0x2c')],_0x3aa068[_0xabac('0x2e')]));_0x135057[_0xabac('0x37')][_0xabac('0x59')]=_0x30e525['id'];if(_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x39')]){_0x135057[_0xabac('0x37')]=_[_0xabac('0x3d')](_0x135057[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x135057['attributes'],function(_0x23dd76){var _0x19448b={};_0x19448b[_0x23dd76]={'$like':'%'+_0x2ac6a8[_0xabac('0x2c')][_0xabac('0x39')]+'%'};return _0x19448b;})});}_0x135057=_[_0xabac('0x3d')]({},_0x135057,_0x2ac6a8['options']);return db[_0xabac('0x58')][_0xabac('0x1a')]({'where':_0x135057[_0xabac('0x37')]})['then'](function(_0x30be11){_0x1d6b8e[_0xabac('0x1a')]=_0x30be11;if(_0x2ac6a8[_0xabac('0x2c')]['includeAll']){_0x135057['include']=[{'all':!![]}];}return db[_0xabac('0x58')][_0xabac('0x3f')](_0x135057);})['then'](function(_0x34a827){_0x1d6b8e[_0xabac('0x40')]=_0x34a827;return _0x1d6b8e;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x3573c7,_0x135057))['catch'](handleError(_0x3573c7,null));};exports[_0xabac('0x5a')]=function(_0x498dda,_0x4abe55,_0x2b9eba){var _0xa31a74={'raw':!![],'where':{}};var _0x39950c={};var _0x509ac1={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x498dda[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x4abe55,null))[_0xabac('0x21')](function(_0x445a94){if(_0x445a94){_0x39950c['model']=_[_0xabac('0x2d')](db['CmHopperHistory'][_0xabac('0x4e')]);_0x39950c[_0xabac('0x2c')]=_['keys'](_0x498dda[_0xabac('0x2c')]);_0x39950c[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x39950c[_0xabac('0x2b')],_0x39950c[_0xabac('0x2c')]);_0xa31a74['attributes']=_['intersection'](_0x39950c['model'],qs[_0xabac('0x30')](_0x498dda[_0xabac('0x2c')][_0xabac('0x30')]));_0xa31a74['attributes']=_0xa31a74[_0xabac('0x31')][_0xabac('0x32')]?_0xa31a74[_0xabac('0x31')]:_0x39950c['model'];if(!_0x498dda[_0xabac('0x2c')]['hasOwnProperty'](_0xabac('0x34'))){_0xa31a74[_0xabac('0x19')]=qs['limit'](_0x498dda['query'][_0xabac('0x19')]);_0xa31a74[_0xabac('0x17')]=qs['offset'](_0x498dda[_0xabac('0x2c')]['offset']);}_0xa31a74[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x498dda[_0xabac('0x2c')][_0xabac('0x36')]);_0xa31a74[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x498dda['query'],_0x39950c[_0xabac('0x2e')]));_0xa31a74[_0xabac('0x37')]['CampaignId']=_0x445a94['id'];if(_0x498dda[_0xabac('0x2c')][_0xabac('0x39')]){_0xa31a74[_0xabac('0x37')]=_[_0xabac('0x3d')](_0xa31a74[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0xa31a74['attributes'],function(_0x4896b0){var _0x229c23={};_0x229c23[_0x4896b0]={'$like':'%'+_0x498dda[_0xabac('0x2c')]['filter']+'%'};return _0x229c23;})});}_0xa31a74=_['merge']({},_0xa31a74,_0x498dda[_0xabac('0x3e')]);return db[_0xabac('0x5b')][_0xabac('0x1a')]({'where':_0xa31a74[_0xabac('0x37')]})[_0xabac('0x21')](function(_0x3fe47f){_0x509ac1['count']=_0x3fe47f;if(_0x498dda['query']['includeAll']){_0xa31a74['include']=[{'all':!![]}];}return db[_0xabac('0x5b')]['findAll'](_0xa31a74);})[_0xabac('0x21')](function(_0x309125){_0x509ac1['rows']=_0x309125;return _0x509ac1;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x4abe55,_0xa31a74))['catch'](handleError(_0x4abe55,null));};exports[_0xabac('0x5c')]=function(_0x1e10b6,_0x52cf62,_0x3dedae){var _0x168965={'raw':!![],'where':{}};var _0x5e445f={};var _0x4b8675={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x1e10b6[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x52cf62,null))[_0xabac('0x21')](function(_0x3b4670){if(_0x3b4670){_0x5e445f['model']=_['keys'](db['CmHopperFinal'][_0xabac('0x4e')]);_0x5e445f[_0xabac('0x2c')]=_['keys'](_0x1e10b6[_0xabac('0x2c')]);_0x5e445f[_0xabac('0x2e')]=_['intersection'](_0x5e445f[_0xabac('0x2b')],_0x5e445f['query']);_0x168965[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x5e445f[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x1e10b6['query'][_0xabac('0x30')]));_0x168965[_0xabac('0x31')]=_0x168965[_0xabac('0x31')][_0xabac('0x32')]?_0x168965[_0xabac('0x31')]:_0x5e445f[_0xabac('0x2b')];if(!_0x1e10b6[_0xabac('0x2c')][_0xabac('0x33')]('nolimit')){_0x168965['limit']=qs[_0xabac('0x19')](_0x1e10b6[_0xabac('0x2c')][_0xabac('0x19')]);_0x168965['offset']=qs['offset'](_0x1e10b6[_0xabac('0x2c')][_0xabac('0x17')]);}_0x168965[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x1e10b6[_0xabac('0x2c')]['sort']);_0x168965[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x1e10b6[_0xabac('0x2c')],_0x5e445f[_0xabac('0x2e')]));_0x168965[_0xabac('0x37')][_0xabac('0x59')]=_0x3b4670['id'];if(_0x1e10b6[_0xabac('0x2c')][_0xabac('0x39')]){_0x168965[_0xabac('0x37')]=_[_0xabac('0x3d')](_0x168965['where'],{'$or':_[_0xabac('0x3a')](_0x168965[_0xabac('0x31')],function(_0x3affbc){var _0x3da961={};_0x3da961[_0x3affbc]={'$like':'%'+_0x1e10b6[_0xabac('0x2c')]['filter']+'%'};return _0x3da961;})});}_0x168965=_[_0xabac('0x3d')]({},_0x168965,_0x1e10b6[_0xabac('0x3e')]);return db['CmHopperFinal'][_0xabac('0x1a')]({'where':_0x168965[_0xabac('0x37')]})[_0xabac('0x21')](function(_0x19c2da){_0x4b8675[_0xabac('0x1a')]=_0x19c2da;if(_0x1e10b6[_0xabac('0x2c')][_0xabac('0x44')]){_0x168965[_0xabac('0x4f')]=[{'all':!![]}];}return db[_0xabac('0x5d')][_0xabac('0x3f')](_0x168965);})[_0xabac('0x21')](function(_0x1a7ba1){_0x4b8675[_0xabac('0x40')]=_0x1a7ba1;return _0x4b8675;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x52cf62,_0x168965))[_0xabac('0x41')](handleError(_0x52cf62,null));};exports[_0xabac('0x5e')]=function(_0x3223cc,_0x5e96cb,_0x2b6b16){var _0x24d29c={'raw':!![],'where':{}};var _0x2e0c6f={};var _0x4e38ff={'count':0x0,'rows':[]};return db[_0xabac('0x28')][_0xabac('0x57')]({'where':{'id':_0x3223cc[_0xabac('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e96cb,null))['then'](function(_0x1d4d87){if(_0x1d4d87){_0x2e0c6f[_0xabac('0x2b')]=_[_0xabac('0x2d')](db['CmHopperBlack']['rawAttributes']);_0x2e0c6f['query']=_[_0xabac('0x2d')](_0x3223cc[_0xabac('0x2c')]);_0x2e0c6f['filters']=_['intersection'](_0x2e0c6f['model'],_0x2e0c6f[_0xabac('0x2c')]);_0x24d29c[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x2e0c6f[_0xabac('0x2b')],qs[_0xabac('0x30')](_0x3223cc['query'][_0xabac('0x30')]));_0x24d29c['attributes']=_0x24d29c[_0xabac('0x31')][_0xabac('0x32')]?_0x24d29c['attributes']:_0x2e0c6f[_0xabac('0x2b')];if(!_0x3223cc[_0xabac('0x2c')]['hasOwnProperty'](_0xabac('0x34'))){_0x24d29c['limit']=qs[_0xabac('0x19')](_0x3223cc[_0xabac('0x2c')][_0xabac('0x19')]);_0x24d29c[_0xabac('0x17')]=qs[_0xabac('0x17')](_0x3223cc[_0xabac('0x2c')][_0xabac('0x17')]);}_0x24d29c[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x3223cc[_0xabac('0x2c')][_0xabac('0x36')]);_0x24d29c[_0xabac('0x37')]=qs['filters'](_[_0xabac('0x38')](_0x3223cc[_0xabac('0x2c')],_0x2e0c6f[_0xabac('0x2e')]));_0x24d29c[_0xabac('0x37')][_0xabac('0x59')]=_0x1d4d87['id'];if(_0x3223cc[_0xabac('0x2c')][_0xabac('0x39')]){_0x24d29c[_0xabac('0x37')]=_['merge'](_0x24d29c[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x24d29c[_0xabac('0x31')],function(_0x379fd0){var _0x52c45c={};_0x52c45c[_0x379fd0]={'$like':'%'+_0x3223cc[_0xabac('0x2c')][_0xabac('0x39')]+'%'};return _0x52c45c;})});}_0x24d29c=_['merge']({},_0x24d29c,_0x3223cc[_0xabac('0x3e')]);return db[_0xabac('0x5f')][_0xabac('0x1a')]({'where':_0x24d29c[_0xabac('0x37')]})[_0xabac('0x21')](function(_0x5dbb72){_0x4e38ff['count']=_0x5dbb72;if(_0x3223cc['query'][_0xabac('0x44')]){_0x24d29c[_0xabac('0x4f')]=[{'all':!![]}];}return db[_0xabac('0x5f')][_0xabac('0x3f')](_0x24d29c);})[_0xabac('0x21')](function(_0xe37d20){_0x4e38ff[_0xabac('0x40')]=_0xe37d20;return _0x4e38ff;});}})[_0xabac('0x21')](respondWithFilteredResult(_0x5e96cb,_0x24d29c))['catch'](handleError(_0x5e96cb,null));};exports[_0xabac('0x60')]=function(_0x330324,_0x413f0e,_0x467f73){var _0x51c300={};var _0x2ab4bc={};var _0x2c272f;var _0x37a1bc;return db['Campaign']['findOne']({'where':{'id':_0x330324['params']['id']}})['then'](handleEntityNotFound(_0x413f0e,null))[_0xabac('0x21')](function(_0x1e8064){if(_0x1e8064){_0x2c272f=_0x1e8064;_0x2ab4bc['model']=_['keys'](db[_0xabac('0x61')][_0xabac('0x4e')]);_0x2ab4bc[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0x330324[_0xabac('0x2c')]);_0x2ab4bc[_0xabac('0x2e')]=_['intersection'](_0x2ab4bc['model'],_0x2ab4bc[_0xabac('0x2c')]);_0x51c300[_0xabac('0x31')]=_[_0xabac('0x2f')](_0x2ab4bc['model'],qs['fields'](_0x330324[_0xabac('0x2c')]['fields']));_0x51c300[_0xabac('0x31')]=_0x51c300['attributes']['length']?_0x51c300[_0xabac('0x31')]:_0x2ab4bc[_0xabac('0x2b')];_0x51c300[_0xabac('0x35')]=qs[_0xabac('0x36')](_0x330324['query']['sort']);_0x51c300[_0xabac('0x37')]=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0x330324[_0xabac('0x2c')],_0x2ab4bc[_0xabac('0x2e')]));if(_0x330324[_0xabac('0x2c')][_0xabac('0x39')]){_0x51c300['where']=_[_0xabac('0x3d')](_0x51c300[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x51c300[_0xabac('0x31')],function(_0x2effdd){var _0x2ce3d3={};_0x2ce3d3[_0x2effdd]={'$like':'%'+_0x330324[_0xabac('0x2c')][_0xabac('0x39')]+'%'};return _0x2ce3d3;})});}_0x51c300=_[_0xabac('0x3d')]({},_0x51c300,_0x330324['options']);return _0x2c272f[_0xabac('0x60')](_0x51c300);}})[_0xabac('0x21')](function(_0x5abf97){if(_0x5abf97){_0x37a1bc=_0x5abf97[_0xabac('0x32')];if(!_0x330324[_0xabac('0x2c')]['hasOwnProperty']('nolimit')){_0x51c300[_0xabac('0x19')]=qs[_0xabac('0x19')](_0x330324[_0xabac('0x2c')][_0xabac('0x19')]);_0x51c300[_0xabac('0x17')]=qs[_0xabac('0x17')](_0x330324[_0xabac('0x2c')]['offset']);}return _0x2c272f[_0xabac('0x60')](_0x51c300);}})[_0xabac('0x21')](function(_0x532ebe){if(_0x532ebe){return _0x532ebe?{'count':_0x37a1bc,'rows':_0x532ebe}:null;}})[_0xabac('0x21')](respondWithResult(_0x413f0e,null))['catch'](handleError(_0x413f0e,null));};exports[_0xabac('0x62')]=function(_0x70d28d,_0x5a790f,_0x24853c){var _0x5c5415,_0x33bad0;var _0x3da35c=[];var _0x2c0caa=moment()[_0xabac('0x63')](_0xabac('0x64'));return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x70d28d['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x5a790f,null))[_0xabac('0x21')](function(_0x26b5f2){if(_0x26b5f2){_0x33bad0=_0x26b5f2;return _0x26b5f2[_0xabac('0x62')](_0x70d28d[_0xabac('0x47')][_0xabac('0x65')],_[_0xabac('0x50')](_0x70d28d[_0xabac('0x47')],['ids','id'])||{});}return null;})[_0xabac('0x66')](function(_0x2f683){var _0x14fe10;var _0x4d86da;_0x5c5415=_0x2f683||[];var _0x507448=[];if(_0x2f683){for(var _0x39d47b=0x0;_0x39d47b<_0x2f683['length'];_0x39d47b+=0x1){var _0x56145f=_0x2f683[_0x39d47b]['get']({'plain':!![]});_0x33bad0['dialCheckDuplicateType']=_0x70d28d['body'][_0xabac('0x67')]?_0x70d28d['body'][_0xabac('0x67')]:_0x33bad0[_0xabac('0x67')];switch(_0x33bad0[_0xabac('0x67')]){case _0xabac('0x68'):_0x14fe10=squel[_0xabac('0x69')]()['into']('cm_hopper')[_0xabac('0x6a')]([_0xabac('0x6b'),_0xabac('0x6c'),_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),'createdAt',_0xabac('0x52')],squel[_0xabac('0x6f')]()['field'](_0xabac('0x6b'),_0xabac('0x6b'))[_0xabac('0x70')](_0xabac('0x71'),_0xabac('0x6c'))[_0xabac('0x70')]('id',_0xabac('0x6d'))[_0xabac('0x70')](_0x56145f[_0xabac('0x72')]['toString'](),_0xabac('0x6e'))[_0xabac('0x70')](_0x70d28d[_0xabac('0x43')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x2c0caa+'\x27',_0xabac('0x51'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))['from'](_0xabac('0x73'))[_0xabac('0x37')](_0xabac('0x74'))[_0xabac('0x37')](_0xabac('0x75'),_0x56145f['CmListId'][_0xabac('0x76')]())[_0xabac('0x37')](_0xabac('0x77'))[_0xabac('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xabac('0x6f')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xabac('0x78')]('cm_hopper_final')[_0xabac('0x37')]('CampaignId\x20=\x20?',_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')]()))[_0xabac('0x37')](_0xabac('0x79'),squel[_0xabac('0x6f')]()[_0xabac('0x70')]('COALESCE(phone,\x27\x27)')[_0xabac('0x78')]('cm_hopper')[_0xabac('0x37')](_0xabac('0x7a'),_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')]())))[_0xabac('0x76')]();break;case'onlyIfOpen':_0x14fe10=squel[_0xabac('0x69')]()[_0xabac('0x7b')](_0xabac('0x7c'))[_0xabac('0x6a')](['phone',_0xabac('0x6c'),_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),_0xabac('0x51'),_0xabac('0x52')],squel['select']()[_0xabac('0x70')]('phone','phone')[_0xabac('0x70')](_0xabac('0x71'),_0xabac('0x6c'))['field']('id',_0xabac('0x6d'))['field'](_0x56145f['CmListId'][_0xabac('0x76')](),_0xabac('0x6e'))[_0xabac('0x70')](_0x70d28d[_0xabac('0x43')]['id']['toString'](),_0xabac('0x59'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x51'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))[_0xabac('0x78')](_0xabac('0x73'))[_0xabac('0x37')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x56145f[_0xabac('0x72')][_0xabac('0x76')]())[_0xabac('0x37')](_0xabac('0x77'))[_0xabac('0x37')](_0xabac('0x79'),squel[_0xabac('0x6f')]()['field'](_0xabac('0x7d'))['from']('cm_hopper')[_0xabac('0x37')](_0xabac('0x7a'),_0x70d28d[_0xabac('0x43')]['id']['toString']())))['toString']();break;default:_0x14fe10=squel[_0xabac('0x69')]()[_0xabac('0x7b')](_0xabac('0x7c'))[_0xabac('0x6a')](['phone','scheduledAt',_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),_0xabac('0x51'),'updatedAt'],squel['select']()[_0xabac('0x70')](_0xabac('0x6b'),_0xabac('0x6b'))['field']('NOW()',_0xabac('0x6c'))['field']('id',_0xabac('0x6d'))[_0xabac('0x70')](_0x56145f[_0xabac('0x72')]['toString'](),'ListId')[_0xabac('0x70')](_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')](),_0xabac('0x59'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27','createdAt')[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))['from'](_0xabac('0x73'))[_0xabac('0x37')](_0xabac('0x74'))[_0xabac('0x37')](_0xabac('0x75'),_0x56145f[_0xabac('0x72')]['toString']())['where'](_0xabac('0x77')))[_0xabac('0x76')]();}_0x4d86da=squel[_0xabac('0x69')]()[_0xabac('0x7b')](_0xabac('0x7e'))[_0xabac('0x6a')]([_0xabac('0x7f'),_0xabac('0x6c'),_0xabac('0x6b'),'OrderBy','createdAt',_0xabac('0x52')],squel[_0xabac('0x6f')]()[_0xabac('0x70')]('h.id','id')['field'](_0xabac('0x71'),'scheduledAt')['field'](_0xabac('0x80'),_0xabac('0x6b'))[_0xabac('0x70')](_0xabac('0x81'),'OrderBy')['field']('\x27'+_0x2c0caa+'\x27',_0xabac('0x51'))[_0xabac('0x70')]('\x27'+_0x2c0caa+'\x27',_0xabac('0x52'))['from'](_0xabac('0x82'),'ci')['join'](_0xabac('0x7c'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xabac('0x37')](_0xabac('0x83'),_0x56145f[_0xabac('0x72')]['toString']())[_0xabac('0x37')](_0xabac('0x84'),_0x70d28d[_0xabac('0x43')]['id'][_0xabac('0x76')]())[_0xabac('0x37')](_0xabac('0x85'),_0x2c0caa))[_0xabac('0x76')]();_0x507448[_0xabac('0x86')](db[_0xabac('0x87')]['query'](_0x14fe10));_0x3da35c[_0xabac('0x86')](db[_0xabac('0x87')][_0xabac('0x2c')](_0x4d86da));}return BPromise['all'](_0x507448);}})[_0xabac('0x21')](function(){return BPromise[_0xabac('0x88')](_0x3da35c);})[_0xabac('0x21')](function(){return _0x5c5415;})[_0xabac('0x21')](respondWithResult(_0x5a790f,null))['catch'](handleError(_0x5a790f,null));};exports[_0xabac('0x89')]=function(_0x3fe4cd,_0x1852db,_0x17b65d){return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x3fe4cd['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x1852db,null))[_0xabac('0x21')](function(_0x3490ee){if(_0x3490ee){return _0x3490ee[_0xabac('0x89')](_0x3fe4cd[_0xabac('0x2c')][_0xabac('0x65')]);}})['then'](function(_0x512838){if(_0x512838){return db['CmHopper'][_0xabac('0x56')]({'where':{'ListId':_0x3fe4cd[_0xabac('0x2c')][_0xabac('0x65')],'CampaignId':_0x3fe4cd[_0xabac('0x43')]['id']}})[_0xabac('0x21')](function(){return _0x512838;});}})[_0xabac('0x21')](respondWithStatusCode(_0x1852db,null))[_0xabac('0x41')](handleError(_0x1852db,null));};exports[_0xabac('0x8a')]=function(_0xcf8beb,_0x3bdc03,_0x24f177){var _0x189bc3={};var _0x5b1034={};var _0x557670;var _0x11cb24;return db[_0xabac('0x28')]['findOne']({'where':{'id':_0xcf8beb['params']['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x3bdc03,null))[_0xabac('0x21')](function(_0x182471){if(_0x182471){_0x557670=_0x182471;_0x5b1034[_0xabac('0x2b')]=_[_0xabac('0x2d')](db['CmList'][_0xabac('0x4e')]);_0x5b1034[_0xabac('0x2c')]=_[_0xabac('0x2d')](_0xcf8beb['query']);_0x5b1034[_0xabac('0x2e')]=_[_0xabac('0x2f')](_0x5b1034[_0xabac('0x2b')],_0x5b1034[_0xabac('0x2c')]);_0x189bc3[_0xabac('0x31')]=_['intersection'](_0x5b1034['model'],qs[_0xabac('0x30')](_0xcf8beb['query']['fields']));_0x189bc3[_0xabac('0x31')]=_0x189bc3['attributes'][_0xabac('0x32')]?_0x189bc3[_0xabac('0x31')]:_0x5b1034['model'];_0x189bc3['order']=qs[_0xabac('0x36')](_0xcf8beb[_0xabac('0x2c')][_0xabac('0x36')]);_0x189bc3['where']=qs[_0xabac('0x2e')](_[_0xabac('0x38')](_0xcf8beb['query'],_0x5b1034['filters']));if(_0xcf8beb[_0xabac('0x2c')][_0xabac('0x39')]){_0x189bc3['where']=_[_0xabac('0x3d')](_0x189bc3[_0xabac('0x37')],{'$or':_[_0xabac('0x3a')](_0x189bc3[_0xabac('0x31')],function(_0xc5242e){var _0x36d829={};_0x36d829[_0xc5242e]={'$like':'%'+_0xcf8beb['query'][_0xabac('0x39')]+'%'};return _0x36d829;})});}_0x189bc3=_[_0xabac('0x3d')]({},_0x189bc3,_0xcf8beb[_0xabac('0x3e')]);return _0x557670['getBlackLists'](_0x189bc3);}})['then'](function(_0x16c0cf){if(_0x16c0cf){_0x11cb24=_0x16c0cf['length'];if(!_0xcf8beb[_0xabac('0x2c')][_0xabac('0x33')](_0xabac('0x34'))){_0x189bc3[_0xabac('0x19')]=qs[_0xabac('0x19')](_0xcf8beb['query']['limit']);_0x189bc3[_0xabac('0x17')]=qs[_0xabac('0x17')](_0xcf8beb[_0xabac('0x2c')][_0xabac('0x17')]);}return _0x557670[_0xabac('0x8a')](_0x189bc3);}})[_0xabac('0x21')](function(_0x4ed552){if(_0x4ed552){return _0x4ed552?{'count':_0x11cb24,'rows':_0x4ed552}:null;}})[_0xabac('0x21')](respondWithResult(_0x3bdc03,null))['catch'](handleError(_0x3bdc03,null));};exports[_0xabac('0x8b')]=function(_0x155341,_0xc44f98,_0x55c34d){var _0x277b6b,_0x48b17a;var _0x21fcd8=[];var _0x5bd78b=moment()[_0xabac('0x63')](_0xabac('0x64'));return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x155341[_0xabac('0x43')]['id']}})['then'](handleEntityNotFound(_0xc44f98,null))[_0xabac('0x21')](function(_0x41559e){if(_0x41559e){_0x48b17a=_0x41559e;return _0x41559e[_0xabac('0x8b')](_0x155341[_0xabac('0x47')][_0xabac('0x65')],_[_0xabac('0x50')](_0x155341['body'],[_0xabac('0x65'),'id'])||{});}return null;})['spread'](function(_0x3e237f){var _0x20446d;var _0x2d0fb0;_0x277b6b=_0x3e237f||[];var _0x37bfac=[];if(_0x3e237f){for(var _0x3316b6=0x0;_0x3316b6<_0x3e237f[_0xabac('0x32')];_0x3316b6+=0x1){var _0x3640f5=_0x3e237f[_0x3316b6][_0xabac('0x22')]({'plain':!![]});_0x20446d=squel['insert']()[_0xabac('0x7b')](_0xabac('0x8c'))[_0xabac('0x6a')]([_0xabac('0x6b'),_0xabac('0x6d'),_0xabac('0x6e'),_0xabac('0x59'),_0xabac('0x51'),_0xabac('0x52')],squel[_0xabac('0x6f')]()[_0xabac('0x70')](_0xabac('0x6b'),_0xabac('0x6b'))[_0xabac('0x70')]('id',_0xabac('0x6d'))['field'](_0x3640f5[_0xabac('0x72')][_0xabac('0x76')](),_0xabac('0x6e'))[_0xabac('0x70')](_0x155341[_0xabac('0x43')]['id']['toString'](),_0xabac('0x59'))[_0xabac('0x70')](_0xabac('0x71'),_0xabac('0x51'))[_0xabac('0x70')]('NOW()',_0xabac('0x52'))[_0xabac('0x78')](_0xabac('0x73'))[_0xabac('0x37')]('deletedAt\x20IS\x20NULL')[_0xabac('0x37')](_0xabac('0x75'),_0x3640f5['CmListId'][_0xabac('0x76')]())['where'](_0xabac('0x77')))['toString']();_0x37bfac[_0xabac('0x86')](db['sequelize'][_0xabac('0x2c')](_0x20446d));}return BPromise['all'](_0x37bfac);}})[_0xabac('0x21')](function(){return _0x277b6b;})['then'](respondWithResult(_0xc44f98,null))[_0xabac('0x41')](handleError(_0xc44f98,null));};exports[_0xabac('0x8d')]=function(_0x5cffca,_0x350f7b,_0x10f24d){return db[_0xabac('0x28')][_0xabac('0x45')]({'where':{'id':_0x5cffca[_0xabac('0x43')]['id']}})[_0xabac('0x21')](handleEntityNotFound(_0x350f7b,null))['then'](function(_0x1c9d3f){if(_0x1c9d3f){return _0x1c9d3f['removeBlackLists'](_0x5cffca['query'][_0xabac('0x65')]);}})['then'](function(_0x472f3f){if(_0x472f3f){return db[_0xabac('0x5f')][_0xabac('0x56')]({'where':{'ListId':_0x5cffca[_0xabac('0x2c')][_0xabac('0x65')],'CampaignId':_0x5cffca[_0xabac('0x43')]['id']}})[_0xabac('0x21')](function(){return _0x472f3f;});}})[_0xabac('0x21')](respondWithStatusCode(_0x350f7b,null))[_0xabac('0x41')](handleError(_0x350f7b,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5b5418f..6c848ec 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5bb215,_0x268c07){var _0x5c615f=function(_0x2d458c){while(--_0x2d458c){_0x5bb215['push'](_0x5bb215['shift']());}};_0x5c615f(++_0x268c07);}(_0x7a54,0x106));var _0x47a5=function(_0x186e9b,_0x4869b6){_0x186e9b=_0x186e9b-0x0;var _0x48177c=_0x7a54[_0x186e9b];return _0x48177c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 7859276..5d727c4 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 _0xbdeb=['then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x5f37fc,_0x3e6e09){var _0x32745d=function(_0x485ca7){while(--_0x485ca7){_0x5f37fc['push'](_0x5f37fc['shift']());}};_0x32745d(++_0x3e6e09);}(_0xbdeb,0x6f));var _0xbbde=function(_0x2fcccd,_0x4a8380){_0x2fcccd=_0x2fcccd-0x0;var _0x2423b4=_0xbdeb[_0x2fcccd];return _0x2423b4;};'use strict';var _=require('lodash');var util=require(_0xbbde('0x0'));var moment=require('moment');var BPromise=require(_0xbbde('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbde('0x2'));var db=require(_0xbbde('0x3'))['db'];var utils=require(_0xbbde('0x4'));var logger=require(_0xbbde('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbbde('0x6'));var client=jayson[_0xbbde('0x7')][_0xbbde('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a8482,_0x5e6273,_0x49966c){return new BPromise(function(_0x3215c9,_0x17df59){return client['request'](_0x1a8482,_0x49966c)[_0xbbde('0x9')](function(_0xec50fa){logger[_0xbbde('0xa')](_0xbbde('0xb'),_0x5e6273,_0xbbde('0xc'));logger[_0xbbde('0xd')](_0xbbde('0xe'),_0x5e6273,_0xbbde('0xc'),JSON[_0xbbde('0xf')](_0xec50fa));if(_0xec50fa[_0xbbde('0x10')]){if(_0xec50fa['error']['code']===0x1f4){logger[_0xbbde('0x10')]('Campaign,\x20%s,\x20%s',_0x5e6273,_0xec50fa[_0xbbde('0x10')]['message']);return _0x17df59(_0xec50fa[_0xbbde('0x10')][_0xbbde('0x11')]);}logger[_0xbbde('0x10')](_0xbbde('0xb'),_0x5e6273,_0xec50fa[_0xbbde('0x10')][_0xbbde('0x11')]);return _0x3215c9(_0xec50fa[_0xbbde('0x10')]['message']);}else{logger[_0xbbde('0xa')](_0xbbde('0xb'),_0x5e6273,'request\x20sent');_0x3215c9(_0xec50fa['result'][_0xbbde('0x11')]);}})['catch'](function(_0x88e8a5){logger['error'](_0xbbde('0xb'),_0x5e6273,_0x88e8a5);_0x17df59(_0x88e8a5);});});}exports[_0xbbde('0x12')]=function(_0x593e58){var _0x2073d1=this;return new Promise(function(_0x1bc7eb,_0xeb6b63){return db[_0xbbde('0x13')][_0xbbde('0x14')]({'raw':_0x593e58[_0xbbde('0x15')]?_0x593e58['options'][_0xbbde('0x16')]===undefined?!![]:![]:!![],'where':_0x593e58[_0xbbde('0x15')]?_0x593e58[_0xbbde('0x15')][_0xbbde('0x17')]||null:null,'attributes':_0x593e58[_0xbbde('0x15')]?_0x593e58['options'][_0xbbde('0x18')]||null:null,'limit':_0x593e58[_0xbbde('0x15')]?_0x593e58[_0xbbde('0x15')][_0xbbde('0x19')]||null:null,'include':_0x593e58[_0xbbde('0x15')]?_0x593e58[_0xbbde('0x15')][_0xbbde('0x1a')]?_[_0xbbde('0x1b')](_0x593e58[_0xbbde('0x15')][_0xbbde('0x1a')],function(_0x4ac50b){return{'model':db[_0x4ac50b[_0xbbde('0x1c')]],'as':_0x4ac50b['as'],'attributes':_0x4ac50b[_0xbbde('0x18')],'include':_0x4ac50b[_0xbbde('0x1a')]?_['map'](_0x4ac50b[_0xbbde('0x1a')],function(_0x34c327){return{'model':db[_0x34c327[_0xbbde('0x1c')]],'as':_0x34c327['as'],'attributes':_0x34c327[_0xbbde('0x18')],'include':_0x34c327[_0xbbde('0x1a')]?_['map'](_0x34c327[_0xbbde('0x1a')],function(_0x14243a){return{'model':db[_0x14243a['model']],'as':_0x14243a['as'],'attributes':_0x14243a[_0xbbde('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbbde('0x9')](function(_0x2854d7){logger[_0xbbde('0xa')](_0xbbde('0x12'),_0x593e58);logger['debug']('GetCampaign',_0x593e58,JSON[_0xbbde('0xf')](_0x2854d7));_0x1bc7eb(_0x2854d7);})[_0xbbde('0x1d')](function(_0x5ac8a2){logger[_0xbbde('0x10')](_0xbbde('0x12'),_0x5ac8a2[_0xbbde('0x11')],_0x593e58);_0xeb6b63(_0x2073d1[_0xbbde('0x10')](0x1f4,_0x5ac8a2[_0xbbde('0x11')]));});});};
\ No newline at end of file
+var _0x9234=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','map','include','model','lodash','moment','bluebird'];(function(_0x510bf0,_0x595be7){var _0xd9877f=function(_0x98aff){while(--_0x98aff){_0x510bf0['push'](_0x510bf0['shift']());}};_0xd9877f(++_0x595be7);}(_0x9234,0x1bd));var _0x4923=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x9234[_0x3cb30b];return _0x2ca717;};'use strict';var _=require(_0x4923('0x0'));var util=require('util');var moment=require(_0x4923('0x1'));var BPromise=require(_0x4923('0x2'));var rs=require(_0x4923('0x3'));var fs=require('fs');var Redis=require(_0x4923('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4923('0x5'));var logger=require(_0x4923('0x6'))('rpc');var config=require(_0x4923('0x7'));var jayson=require(_0x4923('0x8'));var client=jayson[_0x4923('0x9')][_0x4923('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b854,_0x133b0d,_0x2de396){return new BPromise(function(_0x548676,_0x1fffc2){return client['request'](_0x17b854,_0x2de396)[_0x4923('0xb')](function(_0x2c4057){logger[_0x4923('0xc')]('Campaign,\x20%s,\x20%s',_0x133b0d,_0x4923('0xd'));logger[_0x4923('0xe')](_0x4923('0xf'),_0x133b0d,_0x4923('0xd'),JSON[_0x4923('0x10')](_0x2c4057));if(_0x2c4057[_0x4923('0x11')]){if(_0x2c4057[_0x4923('0x11')][_0x4923('0x12')]===0x1f4){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x2c4057['error']['message']);return _0x1fffc2(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}logger[_0x4923('0x11')]('Campaign,\x20%s,\x20%s',_0x133b0d,_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);return _0x548676(_0x2c4057[_0x4923('0x11')][_0x4923('0x14')]);}else{logger[_0x4923('0xc')](_0x4923('0x13'),_0x133b0d,_0x4923('0xd'));_0x548676(_0x2c4057[_0x4923('0x15')][_0x4923('0x14')]);}})[_0x4923('0x16')](function(_0x559e4a){logger[_0x4923('0x11')](_0x4923('0x13'),_0x133b0d,_0x559e4a);_0x1fffc2(_0x559e4a);});});}exports[_0x4923('0x17')]=function(_0x1be04d){var _0x517b95=this;return new Promise(function(_0x50fd18,_0x16955b){return db['Campaign'][_0x4923('0x18')]({'raw':_0x1be04d[_0x4923('0x19')]?_0x1be04d['options'][_0x4923('0x1a')]===undefined?!![]:![]:!![],'where':_0x1be04d[_0x4923('0x19')]?_0x1be04d[_0x4923('0x19')][_0x4923('0x1b')]||null:null,'attributes':_0x1be04d['options']?_0x1be04d[_0x4923('0x19')][_0x4923('0x1c')]||null:null,'limit':_0x1be04d['options']?_0x1be04d[_0x4923('0x19')]['limit']||null:null,'include':_0x1be04d[_0x4923('0x19')]?_0x1be04d[_0x4923('0x19')]['include']?_[_0x4923('0x1d')](_0x1be04d[_0x4923('0x19')][_0x4923('0x1e')],function(_0x161cf9){return{'model':db[_0x161cf9[_0x4923('0x1f')]],'as':_0x161cf9['as'],'attributes':_0x161cf9[_0x4923('0x1c')],'include':_0x161cf9[_0x4923('0x1e')]?_['map'](_0x161cf9['include'],function(_0x23ec97){return{'model':db[_0x23ec97[_0x4923('0x1f')]],'as':_0x23ec97['as'],'attributes':_0x23ec97[_0x4923('0x1c')],'include':_0x23ec97[_0x4923('0x1e')]?_[_0x4923('0x1d')](_0x23ec97[_0x4923('0x1e')],function(_0x13681b){return{'model':db[_0x13681b[_0x4923('0x1f')]],'as':_0x13681b['as'],'attributes':_0x13681b[_0x4923('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4923('0xb')](function(_0x3a7852){logger['info'](_0x4923('0x17'),_0x1be04d);logger[_0x4923('0xe')](_0x4923('0x17'),_0x1be04d,JSON[_0x4923('0x10')](_0x3a7852));_0x50fd18(_0x3a7852);})[_0x4923('0x16')](function(_0x47158c){logger[_0x4923('0x11')](_0x4923('0x17'),_0x47158c[_0x4923('0x14')],_0x1be04d);_0x16955b(_0x517b95[_0x4923('0x11')](0x1f4,_0x47158c[_0x4923('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index fd7960f..7001a87 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 _0x4444=['put','delete','removeBlackLists','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./campaign.controller','index','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x3023b8,_0x11daa4){var _0x51bbc2=function(_0x1e92a4){while(--_0x1e92a4){_0x3023b8['push'](_0x3023b8['shift']());}};_0x51bbc2(++_0x11daa4);}(_0x4444,0xa3));var _0x4444=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x4444[_0x40dd56];return _0x4f850f;};'use strict';var multer=require(_0x4444('0x0'));var util=require(_0x4444('0x1'));var path=require('path');var timeout=require(_0x4444('0x2'));var express=require(_0x4444('0x3'));var router=express[_0x4444('0x4')]();var fs_extra=require(_0x4444('0x5'));var auth=require(_0x4444('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4444('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4444('0x8')]);router[_0x4444('0x9')](_0x4444('0xa'),auth[_0x4444('0xb')](),controller[_0x4444('0xc')]);router[_0x4444('0x9')]('/:id/hoppers',auth[_0x4444('0xb')](),controller[_0x4444('0xd')]);router[_0x4444('0x9')](_0x4444('0xe'),auth[_0x4444('0xb')](),controller[_0x4444('0xf')]);router[_0x4444('0x9')](_0x4444('0x10'),auth[_0x4444('0xb')](),controller[_0x4444('0x11')]);router[_0x4444('0x9')](_0x4444('0x12'),auth['isAuthenticated'](),controller[_0x4444('0x13')]);router['get'](_0x4444('0x14'),auth[_0x4444('0xb')](),controller[_0x4444('0x15')]);router[_0x4444('0x9')]('/:id/blacklists',auth[_0x4444('0xb')](),controller[_0x4444('0x16')]);router[_0x4444('0x17')]('/',auth[_0x4444('0xb')](),controller[_0x4444('0x18')]);router[_0x4444('0x17')](_0x4444('0x19'),auth[_0x4444('0xb')](),controller[_0x4444('0x1a')]);router[_0x4444('0x17')](_0x4444('0x14'),auth['isAuthenticated'](),controller[_0x4444('0x1b')]);router[_0x4444('0x17')]('/:id/blacklists',auth[_0x4444('0xb')](),controller[_0x4444('0x1c')]);router[_0x4444('0x1d')](_0x4444('0xa'),auth[_0x4444('0xb')](),controller['update']);router[_0x4444('0x1e')]('/:id',auth[_0x4444('0xb')](),controller['destroy']);router[_0x4444('0x1e')](_0x4444('0x14'),auth[_0x4444('0xb')](),controller['removeLists']);router[_0x4444('0x1e')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x4444('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0xc5b1=['update','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x1376c2,_0x2a07ef){var _0x39232a=function(_0x43d810){while(--_0x43d810){_0x1376c2['push'](_0x1376c2['shift']());}};_0x39232a(++_0x2a07ef);}(_0xc5b1,0x106));var _0x1c5b=function(_0x5740bb,_0x215865){_0x5740bb=_0x5740bb-0x0;var _0x60a2d2=_0xc5b1[_0x5740bb];return _0x60a2d2;};'use strict';var multer=require(_0x1c5b('0x0'));var util=require(_0x1c5b('0x1'));var path=require(_0x1c5b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c5b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c5b('0x4'));var config=require(_0x1c5b('0x5'));var controller=require('./campaign.controller');router[_0x1c5b('0x6')]('/',auth['isAuthenticated'](),controller[_0x1c5b('0x7')]);router[_0x1c5b('0x6')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xa')]);router['get'](_0x1c5b('0xb'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xc')]);router[_0x1c5b('0x6')](_0x1c5b('0xd'),auth['isAuthenticated'](),controller[_0x1c5b('0xe')]);router[_0x1c5b('0x6')](_0x1c5b('0xf'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x10')]);router['get']('/:id/hopper_black',auth[_0x1c5b('0x9')](),controller['getHopperBlacks']);router['get'](_0x1c5b('0x11'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x12')]);router[_0x1c5b('0x6')](_0x1c5b('0x13'),auth[_0x1c5b('0x9')](),controller['getBlackLists']);router[_0x1c5b('0x14')]('/',auth['isAuthenticated'](),controller[_0x1c5b('0x15')]);router[_0x1c5b('0x14')](_0x1c5b('0x16'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x17')]);router[_0x1c5b('0x14')](_0x1c5b('0x11'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x18')]);router[_0x1c5b('0x14')](_0x1c5b('0x13'),auth['isAuthenticated'](),controller[_0x1c5b('0x19')]);router['put']('/:id',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1a')]);router['delete']('/:id',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1b')]);router['delete'](_0x1c5b('0x11'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1c')]);router[_0x1c5b('0x1d')](_0x1c5b('0x13'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x1e')]);module[_0x1c5b('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 239d9a5..ef98ba9 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 _0x9596=['sequelize','STRING','TEXT','medium','VIRTUAL'];(function(_0x477730,_0x57edc6){var _0x2399a6=function(_0x215be4){while(--_0x215be4){_0x477730['push'](_0x477730['shift']());}};_0x2399a6(++_0x57edc6);}(_0x9596,0xc3));var _0x6959=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0x9596[_0x5f382f];return _0x3bb11b;};'use strict';var Sequelize=require(_0x6959('0x0'));module['exports']={'key':{'type':Sequelize[_0x6959('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x6959('0x2')],'length':_0x6959('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6959('0x1')]},'name':{'type':Sequelize[_0x6959('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x2ca6=['getDataValue','sequelize','exports','STRING','TEXT','medium','VIRTUAL'];(function(_0x390791,_0x56a05f){var _0x543bc6=function(_0x5a5e8f){while(--_0x5a5e8f){_0x390791['push'](_0x390791['shift']());}};_0x543bc6(++_0x56a05f);}(_0x2ca6,0xb0));var _0x62ca=function(_0x2489d5,_0x118404){_0x2489d5=_0x2489d5-0x0;var _0x453f4e=_0x2ca6[_0x2489d5];return _0x453f4e;};'use strict';var Sequelize=require(_0x62ca('0x0'));module[_0x62ca('0x1')]={'key':{'type':Sequelize[_0x62ca('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x62ca('0x3')],'length':_0x62ca('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x62ca('0x5')],'get':function(){return this[_0x62ca('0x6')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 9bab4e4..455191a 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 _0x5cf3=['name','send','index','CannedAnswer','rawAttributes','type','model','keys','filters','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','includeAll','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error'];(function(_0x4025c6,_0x5f0390){var _0x5558de=function(_0x2f85cb){while(--_0x2f85cb){_0x4025c6['push'](_0x4025c6['shift']());}};_0x5558de(++_0x5f0390);}(_0x5cf3,0x131));var _0x35cf=function(_0x4b55cb,_0x49791b){_0x4b55cb=_0x4b55cb-0x0;var _0x2631df=_0x5cf3[_0x4b55cb];return _0x2631df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35cf('0x0'));var zipdir=require(_0x35cf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35cf('0x2'));var moment=require(_0x35cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x35cf('0x4'));var util=require(_0x35cf('0x5'));var path=require(_0x35cf('0x6'));var sox=require(_0x35cf('0x7'));var csv=require(_0x35cf('0x8'));var ejs=require(_0x35cf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35cf('0xa'));var squel=require(_0x35cf('0xb'));var crypto=require(_0x35cf('0xc'));var jsforce=require(_0x35cf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x35cf('0xe'));var Papa=require(_0x35cf('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x35cf('0x10'));var as=require(_0x35cf('0x11'));var hardwareService=require(_0x35cf('0x12'));var logger=require(_0x35cf('0x13'))(_0x35cf('0x14'));var utils=require(_0x35cf('0x15'));var config=require(_0x35cf('0x16'));var licenseUtil=require(_0x35cf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x527695,_0x195282){_0x195282=_0x195282||0xcc;return function(_0x1d2ef0){if(_0x1d2ef0){return _0x527695[_0x35cf('0x18')](_0x195282);}return _0x527695[_0x35cf('0x19')](_0x195282)[_0x35cf('0x1a')]();};}function respondWithResult(_0x5f53c1,_0x4e054f){_0x4e054f=_0x4e054f||0xc8;return function(_0x1f984e){if(_0x1f984e){return _0x5f53c1[_0x35cf('0x19')](_0x4e054f)[_0x35cf('0x1b')](_0x1f984e);}};}function respondWithFilteredResult(_0x32d90f,_0x602d2d){return function(_0x5efab8){if(_0x5efab8){var _0x2a853c=typeof _0x602d2d[_0x35cf('0x1c')]==='undefined'&&typeof _0x602d2d['limit']==='undefined';var _0x50c02a=_0x5efab8[_0x35cf('0x1d')];var _0x1961c6=_0x2a853c?0x0:_0x602d2d[_0x35cf('0x1c')];var _0x12c11d=_0x2a853c?_0x5efab8['count']:_0x602d2d[_0x35cf('0x1c')]+_0x602d2d[_0x35cf('0x1e')];var _0x32755c;if(_0x12c11d>=_0x50c02a){_0x12c11d=_0x50c02a;_0x32755c=0xc8;}else{_0x32755c=0xce;}_0x32d90f['status'](_0x32755c);return _0x32d90f[_0x35cf('0x1f')](_0x35cf('0x20'),_0x1961c6+'-'+_0x12c11d+'/'+_0x50c02a)[_0x35cf('0x1b')](_0x5efab8);}return null;};}function patchUpdates(_0x354a8c){return function(_0x2a99b3){try{jsonpatch[_0x35cf('0x21')](_0x2a99b3,_0x354a8c,!![]);}catch(_0x1487a8){return BPromise[_0x35cf('0x22')](_0x1487a8);}return _0x2a99b3[_0x35cf('0x23')]();};}function saveUpdates(_0x451386,_0x442bdd){return function(_0x1b608c){if(_0x1b608c){return _0x1b608c[_0x35cf('0x24')](_0x451386)[_0x35cf('0x25')](function(_0x3b9f6d){return _0x3b9f6d;});}return null;};}function removeEntity(_0x503db3,_0x3e1683){return function(_0x5e45f9){if(_0x5e45f9){return _0x5e45f9[_0x35cf('0x26')]()[_0x35cf('0x25')](function(){var _0x3dc4d6=_0x5e45f9[_0x35cf('0x27')]({'plain':!![]});var _0x26490c=_0x35cf('0x28');return db[_0x35cf('0x29')]['destroy']({'where':{'type':_0x26490c,'resourceId':_0x3dc4d6['id']}})['then'](function(){return _0x5e45f9;});})[_0x35cf('0x25')](function(){_0x503db3[_0x35cf('0x19')](0xcc)[_0x35cf('0x1a')]();});}};}function handleEntityNotFound(_0x5e0fa1,_0x3c635b){return function(_0x126d53){if(!_0x126d53){_0x5e0fa1[_0x35cf('0x18')](0x194);}return _0x126d53;};}function handleError(_0x18cfd3,_0x346b35){_0x346b35=_0x346b35||0x1f4;return function(_0x18f006){logger[_0x35cf('0x2a')](_0x18f006['stack']);if(_0x18f006[_0x35cf('0x2b')]){delete _0x18f006[_0x35cf('0x2b')];}_0x18cfd3[_0x35cf('0x19')](_0x346b35)[_0x35cf('0x2c')](_0x18f006);};}exports[_0x35cf('0x2d')]=function(_0x249296,_0x499012){var _0x47f0f2={},_0x566624={},_0x1a7ead={'count':0x0,'rows':[]};var _0xadf2f8=_['map'](db[_0x35cf('0x2e')][_0x35cf('0x2f')],function(_0x5c72fa){return{'name':_0x5c72fa['fieldName'],'type':_0x5c72fa[_0x35cf('0x30')]['key']};});_0x566624[_0x35cf('0x31')]=_['map'](_0xadf2f8,_0x35cf('0x2b'));_0x566624['query']=_[_0x35cf('0x32')](_0x249296['query']);_0x566624[_0x35cf('0x33')]=_['intersection'](_0x566624[_0x35cf('0x31')],_0x566624[_0x35cf('0x34')]);_0x47f0f2['attributes']=_[_0x35cf('0x35')](_0x566624[_0x35cf('0x31')],qs[_0x35cf('0x36')](_0x249296[_0x35cf('0x34')][_0x35cf('0x36')]));_0x47f0f2[_0x35cf('0x37')]=_0x47f0f2[_0x35cf('0x37')][_0x35cf('0x38')]?_0x47f0f2[_0x35cf('0x37')]:_0x566624[_0x35cf('0x31')];if(!_0x249296[_0x35cf('0x34')]['hasOwnProperty'](_0x35cf('0x39'))){_0x47f0f2[_0x35cf('0x1e')]=qs[_0x35cf('0x1e')](_0x249296[_0x35cf('0x34')]['limit']);_0x47f0f2['offset']=qs[_0x35cf('0x1c')](_0x249296['query'][_0x35cf('0x1c')]);}_0x47f0f2[_0x35cf('0x3a')]=qs[_0x35cf('0x3b')](_0x249296[_0x35cf('0x34')][_0x35cf('0x3b')]);_0x47f0f2[_0x35cf('0x3c')]=qs[_0x35cf('0x33')](_[_0x35cf('0x3d')](_0x249296['query'],_0x566624[_0x35cf('0x33')]),_0xadf2f8);if(_0x249296[_0x35cf('0x34')][_0x35cf('0x3e')]){_0x47f0f2[_0x35cf('0x3c')]=_[_0x35cf('0x3f')](_0x47f0f2[_0x35cf('0x3c')],{'$or':[{'key':{'$like':'%'+_0x249296[_0x35cf('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0x249296[_0x35cf('0x34')][_0x35cf('0x3e')]+'%'}}]});}_0x47f0f2=_[_0x35cf('0x3f')]({},_0x47f0f2,_0x249296[_0x35cf('0x40')]);var _0x5c9e46={'where':_0x47f0f2['where']};return db['CannedAnswer']['count'](_0x5c9e46)[_0x35cf('0x25')](function(_0xdd747f){_0x1a7ead['count']=_0xdd747f;if(_0x249296[_0x35cf('0x34')]['includeAll']){_0x47f0f2[_0x35cf('0x41')]=[{'all':!![]}];}return db[_0x35cf('0x2e')]['findAll'](_0x47f0f2);})[_0x35cf('0x25')](function(_0x5c908c){_0x1a7ead[_0x35cf('0x42')]=_0x5c908c;return _0x1a7ead;})[_0x35cf('0x25')](respondWithFilteredResult(_0x499012,_0x47f0f2))[_0x35cf('0x43')](handleError(_0x499012,null));};exports[_0x35cf('0x44')]=function(_0x42346c,_0x5c3953){var _0x231fc5={'raw':!![],'where':{'id':_0x42346c[_0x35cf('0x45')]['id']}},_0x2aeb7a={};_0x2aeb7a[_0x35cf('0x31')]=_[_0x35cf('0x32')](db[_0x35cf('0x2e')][_0x35cf('0x2f')]);_0x2aeb7a[_0x35cf('0x34')]=_[_0x35cf('0x32')](_0x42346c['query']);_0x2aeb7a[_0x35cf('0x33')]=_[_0x35cf('0x35')](_0x2aeb7a[_0x35cf('0x31')],_0x2aeb7a[_0x35cf('0x34')]);_0x231fc5[_0x35cf('0x37')]=_[_0x35cf('0x35')](_0x2aeb7a[_0x35cf('0x31')],qs[_0x35cf('0x36')](_0x42346c[_0x35cf('0x34')]['fields']));_0x231fc5[_0x35cf('0x37')]=_0x231fc5[_0x35cf('0x37')]['length']?_0x231fc5['attributes']:_0x2aeb7a[_0x35cf('0x31')];if(_0x42346c[_0x35cf('0x34')][_0x35cf('0x46')]){_0x231fc5[_0x35cf('0x41')]=[{'all':!![]}];}_0x231fc5=_[_0x35cf('0x3f')]({},_0x231fc5,_0x42346c[_0x35cf('0x40')]);return db[_0x35cf('0x2e')][_0x35cf('0x47')](_0x231fc5)['then'](handleEntityNotFound(_0x5c3953,null))[_0x35cf('0x25')](respondWithResult(_0x5c3953,null))['catch'](handleError(_0x5c3953,null));};exports[_0x35cf('0x24')]=function(_0x59c23a,_0x564ca5){if(_0x59c23a[_0x35cf('0x48')]['id']){delete _0x59c23a[_0x35cf('0x48')]['id'];}return db[_0x35cf('0x2e')][_0x35cf('0x47')]({'where':{'id':_0x59c23a[_0x35cf('0x45')]['id']}})[_0x35cf('0x25')](handleEntityNotFound(_0x564ca5,null))[_0x35cf('0x25')](saveUpdates(_0x59c23a[_0x35cf('0x48')],null))[_0x35cf('0x25')](respondWithResult(_0x564ca5,null))[_0x35cf('0x43')](handleError(_0x564ca5,null));};exports[_0x35cf('0x26')]=function(_0x4675a8,_0x554be2){return db[_0x35cf('0x2e')][_0x35cf('0x47')]({'where':{'id':_0x4675a8[_0x35cf('0x45')]['id']}})[_0x35cf('0x25')](handleEntityNotFound(_0x554be2,null))[_0x35cf('0x25')](removeEntity(_0x554be2,null))[_0x35cf('0x43')](handleError(_0x554be2,null));};exports[_0x35cf('0x49')]=function(_0x1f8179,_0x518c91){var _0x5e0248={'key':_0x1f8179[_0x35cf('0x48')][_0x35cf('0x4a')]};if(_0x1f8179[_0x35cf('0x48')][_0x35cf('0x4b')]){_0x5e0248['MailAccountId']=_0x1f8179[_0x35cf('0x48')][_0x35cf('0x4b')];}else if(_0x1f8179['body'][_0x35cf('0x4c')]){_0x5e0248['SmsAccountId']=_0x1f8179['body'][_0x35cf('0x4c')];}else if(_0x1f8179[_0x35cf('0x48')]['OpenchannelAccountId']){_0x5e0248[_0x35cf('0x4d')]=_0x1f8179['body'][_0x35cf('0x4d')];}else if(_0x1f8179[_0x35cf('0x48')]['ChatWebsiteId']){_0x5e0248['ChatWebsiteId']=_0x1f8179['body'][_0x35cf('0x4e')];}return db[_0x35cf('0x2e')][_0x35cf('0x47')]({'where':_0x5e0248})[_0x35cf('0x25')](function(_0x3985c5){if(_0x3985c5){throw new db[(_0x35cf('0x4f'))][(_0x35cf('0x50'))](_0x35cf('0x51'));}return db[_0x35cf('0x2e')][_0x35cf('0x49')](_0x1f8179[_0x35cf('0x48')]);})[_0x35cf('0x25')](function(_0x562e51){var _0x2be6a0=_0x1f8179[_0x35cf('0x52')][_0x35cf('0x27')]({'plain':!![]});if(!_0x2be6a0)throw new Error(_0x35cf('0x53'));if(_0x2be6a0[_0x35cf('0x54')]===_0x35cf('0x52')){var _0x4e9419=_0x562e51[_0x35cf('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x35cf('0x47')]({'where':{'name':_0x35cf('0x28'),'userProfileId':_0x2be6a0[_0x35cf('0x55')]},'raw':!![]})['then'](function(_0x2a92d0){if(_0x2a92d0&&_0x2a92d0[_0x35cf('0x56')]===0x0){return db[_0x35cf('0x29')][_0x35cf('0x49')]({'name':_0x4e9419['name'],'resourceId':_0x4e9419['id'],'type':_0x2a92d0['name'],'sectionId':_0x2a92d0['id']},{})[_0x35cf('0x25')](function(){return _0x562e51;});}else{return _0x562e51;}})[_0x35cf('0x43')](function(_0x2f36ca){logger[_0x35cf('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f36ca);throw _0x2f36ca;});}return _0x562e51;})[_0x35cf('0x25')](respondWithResult(_0x518c91,0xc9))['catch'](handleError(_0x518c91,null));};
\ No newline at end of file
+var _0xffdc=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','CannedAnswer','rawAttributes','type'];(function(_0xd80a30,_0x15e548){var _0x1b0c5e=function(_0x4893d6){while(--_0x4893d6){_0xd80a30['push'](_0xd80a30['shift']());}};_0x1b0c5e(++_0x15e548);}(_0xffdc,0x182));var _0xcffd=function(_0x53a8bf,_0x59b79f){_0x53a8bf=_0x53a8bf-0x0;var _0x1cee30=_0xffdc[_0x53a8bf];return _0x1cee30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcffd('0x0'));var jsonpatch=require(_0xcffd('0x1'));var rp=require(_0xcffd('0x2'));var moment=require('moment');var BPromise=require(_0xcffd('0x3'));var Mustache=require(_0xcffd('0x4'));var util=require(_0xcffd('0x5'));var path=require('path');var sox=require(_0xcffd('0x6'));var csv=require(_0xcffd('0x7'));var ejs=require(_0xcffd('0x8'));var fs=require('fs');var fs_extra=require(_0xcffd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcffd('0xa'));var jsforce=require(_0xcffd('0xb'));var deskjs=require(_0xcffd('0xc'));var toCsv=require(_0xcffd('0x7'));var querystring=require(_0xcffd('0xd'));var Papa=require(_0xcffd('0xe'));var Redis=require(_0xcffd('0xf'));var authService=require(_0xcffd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcffd('0x11'));var hardwareService=require(_0xcffd('0x12'));var logger=require(_0xcffd('0x13'))(_0xcffd('0x14'));var utils=require(_0xcffd('0x15'));var config=require(_0xcffd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcffd('0x17'))['db'];function respondWithStatusCode(_0x84983f,_0x47879e){_0x47879e=_0x47879e||0xcc;return function(_0x2d87cc){if(_0x2d87cc){return _0x84983f[_0xcffd('0x18')](_0x47879e);}return _0x84983f[_0xcffd('0x19')](_0x47879e)['end']();};}function respondWithResult(_0x559b03,_0x70832c){_0x70832c=_0x70832c||0xc8;return function(_0xc38187){if(_0xc38187){return _0x559b03['status'](_0x70832c)[_0xcffd('0x1a')](_0xc38187);}};}function respondWithFilteredResult(_0x445a73,_0x23babd){return function(_0x57cc4f){if(_0x57cc4f){var _0x1d554a=typeof _0x23babd['offset']==='undefined'&&typeof _0x23babd[_0xcffd('0x1b')]===_0xcffd('0x1c');var _0x5b2721=_0x57cc4f[_0xcffd('0x1d')];var _0x2e2fdc=_0x1d554a?0x0:_0x23babd['offset'];var _0x3f143c=_0x1d554a?_0x57cc4f[_0xcffd('0x1d')]:_0x23babd[_0xcffd('0x1e')]+_0x23babd[_0xcffd('0x1b')];var _0x4ef531;if(_0x3f143c>=_0x5b2721){_0x3f143c=_0x5b2721;_0x4ef531=0xc8;}else{_0x4ef531=0xce;}_0x445a73[_0xcffd('0x19')](_0x4ef531);return _0x445a73[_0xcffd('0x1f')](_0xcffd('0x20'),_0x2e2fdc+'-'+_0x3f143c+'/'+_0x5b2721)[_0xcffd('0x1a')](_0x57cc4f);}return null;};}function patchUpdates(_0x20adad){return function(_0x177fe7){try{jsonpatch[_0xcffd('0x21')](_0x177fe7,_0x20adad,!![]);}catch(_0x1e60ea){return BPromise['reject'](_0x1e60ea);}return _0x177fe7[_0xcffd('0x22')]();};}function saveUpdates(_0x40f4e1,_0x8e199b){return function(_0x5895c9){if(_0x5895c9){return _0x5895c9[_0xcffd('0x23')](_0x40f4e1)[_0xcffd('0x24')](function(_0x473c82){return _0x473c82;});}return null;};}function removeEntity(_0x1c91a5,_0x39d8bd){return function(_0x5a8677){if(_0x5a8677){return _0x5a8677[_0xcffd('0x25')]()[_0xcffd('0x24')](function(){var _0x1ae068=_0x5a8677['get']({'plain':!![]});var _0x2aa886=_0xcffd('0x26');return db[_0xcffd('0x27')]['destroy']({'where':{'type':_0x2aa886,'resourceId':_0x1ae068['id']}})['then'](function(){return _0x5a8677;});})['then'](function(){_0x1c91a5['status'](0xcc)[_0xcffd('0x28')]();});}};}function handleEntityNotFound(_0x5b0787,_0x2ac475){return function(_0x30415f){if(!_0x30415f){_0x5b0787[_0xcffd('0x18')](0x194);}return _0x30415f;};}function handleError(_0x39dc42,_0x1684bc){_0x1684bc=_0x1684bc||0x1f4;return function(_0x30a96c){logger[_0xcffd('0x29')](_0x30a96c[_0xcffd('0x2a')]);if(_0x30a96c[_0xcffd('0x2b')]){delete _0x30a96c[_0xcffd('0x2b')];}_0x39dc42[_0xcffd('0x19')](_0x1684bc)[_0xcffd('0x2c')](_0x30a96c);};}exports[_0xcffd('0x2d')]=function(_0x3bded6,_0x4ef4a8){var _0x37e40e={},_0x4f4b35={},_0xe76191={'count':0x0,'rows':[]};var _0x103ff4=_['map'](db[_0xcffd('0x2e')][_0xcffd('0x2f')],function(_0x14c216){return{'name':_0x14c216['fieldName'],'type':_0x14c216[_0xcffd('0x30')][_0xcffd('0x31')]};});_0x4f4b35[_0xcffd('0x32')]=_['map'](_0x103ff4,_0xcffd('0x2b'));_0x4f4b35[_0xcffd('0x33')]=_[_0xcffd('0x34')](_0x3bded6[_0xcffd('0x33')]);_0x4f4b35[_0xcffd('0x35')]=_[_0xcffd('0x36')](_0x4f4b35[_0xcffd('0x32')],_0x4f4b35[_0xcffd('0x33')]);_0x37e40e[_0xcffd('0x37')]=_[_0xcffd('0x36')](_0x4f4b35['model'],qs[_0xcffd('0x38')](_0x3bded6[_0xcffd('0x33')][_0xcffd('0x38')]));_0x37e40e[_0xcffd('0x37')]=_0x37e40e['attributes'][_0xcffd('0x39')]?_0x37e40e['attributes']:_0x4f4b35[_0xcffd('0x32')];if(!_0x3bded6[_0xcffd('0x33')][_0xcffd('0x3a')]('nolimit')){_0x37e40e['limit']=qs[_0xcffd('0x1b')](_0x3bded6[_0xcffd('0x33')][_0xcffd('0x1b')]);_0x37e40e[_0xcffd('0x1e')]=qs[_0xcffd('0x1e')](_0x3bded6[_0xcffd('0x33')][_0xcffd('0x1e')]);}_0x37e40e['order']=qs[_0xcffd('0x3b')](_0x3bded6['query'][_0xcffd('0x3b')]);_0x37e40e[_0xcffd('0x3c')]=qs[_0xcffd('0x35')](_[_0xcffd('0x3d')](_0x3bded6[_0xcffd('0x33')],_0x4f4b35['filters']),_0x103ff4);if(_0x3bded6[_0xcffd('0x33')][_0xcffd('0x3e')]){_0x37e40e[_0xcffd('0x3c')]=_[_0xcffd('0x3f')](_0x37e40e[_0xcffd('0x3c')],{'$or':[{'key':{'$like':'%'+_0x3bded6[_0xcffd('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x3bded6[_0xcffd('0x33')][_0xcffd('0x3e')]+'%'}}]});}_0x37e40e=_[_0xcffd('0x3f')]({},_0x37e40e,_0x3bded6[_0xcffd('0x40')]);var _0x3545a2={'where':_0x37e40e['where']};return db[_0xcffd('0x2e')][_0xcffd('0x1d')](_0x3545a2)[_0xcffd('0x24')](function(_0xb8a04f){_0xe76191[_0xcffd('0x1d')]=_0xb8a04f;if(_0x3bded6[_0xcffd('0x33')][_0xcffd('0x41')]){_0x37e40e[_0xcffd('0x42')]=[{'all':!![]}];}return db[_0xcffd('0x2e')][_0xcffd('0x43')](_0x37e40e);})[_0xcffd('0x24')](function(_0x5333b2){_0xe76191[_0xcffd('0x44')]=_0x5333b2;return _0xe76191;})[_0xcffd('0x24')](respondWithFilteredResult(_0x4ef4a8,_0x37e40e))[_0xcffd('0x45')](handleError(_0x4ef4a8,null));};exports['show']=function(_0x5371e1,_0x4e5135){var _0x1eeb18={'raw':!![],'where':{'id':_0x5371e1['params']['id']}},_0x43b7bd={};_0x43b7bd['model']=_[_0xcffd('0x34')](db['CannedAnswer'][_0xcffd('0x2f')]);_0x43b7bd[_0xcffd('0x33')]=_['keys'](_0x5371e1[_0xcffd('0x33')]);_0x43b7bd['filters']=_['intersection'](_0x43b7bd[_0xcffd('0x32')],_0x43b7bd['query']);_0x1eeb18[_0xcffd('0x37')]=_[_0xcffd('0x36')](_0x43b7bd[_0xcffd('0x32')],qs['fields'](_0x5371e1[_0xcffd('0x33')]['fields']));_0x1eeb18[_0xcffd('0x37')]=_0x1eeb18[_0xcffd('0x37')][_0xcffd('0x39')]?_0x1eeb18[_0xcffd('0x37')]:_0x43b7bd[_0xcffd('0x32')];if(_0x5371e1['query'][_0xcffd('0x41')]){_0x1eeb18[_0xcffd('0x42')]=[{'all':!![]}];}_0x1eeb18=_['merge']({},_0x1eeb18,_0x5371e1[_0xcffd('0x40')]);return db['CannedAnswer'][_0xcffd('0x46')](_0x1eeb18)[_0xcffd('0x24')](handleEntityNotFound(_0x4e5135,null))['then'](respondWithResult(_0x4e5135,null))[_0xcffd('0x45')](handleError(_0x4e5135,null));};exports[_0xcffd('0x23')]=function(_0x8c83d5,_0x201e79){if(_0x8c83d5[_0xcffd('0x47')]['id']){delete _0x8c83d5[_0xcffd('0x47')]['id'];}return db[_0xcffd('0x2e')][_0xcffd('0x46')]({'where':{'id':_0x8c83d5[_0xcffd('0x48')]['id']}})[_0xcffd('0x24')](handleEntityNotFound(_0x201e79,null))[_0xcffd('0x24')](saveUpdates(_0x8c83d5[_0xcffd('0x47')],null))[_0xcffd('0x24')](respondWithResult(_0x201e79,null))[_0xcffd('0x45')](handleError(_0x201e79,null));};exports[_0xcffd('0x25')]=function(_0x11118f,_0x1fe955){return db[_0xcffd('0x2e')][_0xcffd('0x46')]({'where':{'id':_0x11118f[_0xcffd('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fe955,null))[_0xcffd('0x24')](removeEntity(_0x1fe955,null))['catch'](handleError(_0x1fe955,null));};exports[_0xcffd('0x49')]=function(_0x570880,_0x147ae0){var _0x303749={'key':_0x570880['body']['key']};if(_0x570880['body'][_0xcffd('0x4a')]){_0x303749['MailAccountId']=_0x570880[_0xcffd('0x47')][_0xcffd('0x4a')];}else if(_0x570880[_0xcffd('0x47')][_0xcffd('0x4b')]){_0x303749[_0xcffd('0x4b')]=_0x570880[_0xcffd('0x47')][_0xcffd('0x4b')];}else if(_0x570880[_0xcffd('0x47')][_0xcffd('0x4c')]){_0x303749[_0xcffd('0x4c')]=_0x570880['body'][_0xcffd('0x4c')];}else if(_0x570880[_0xcffd('0x47')][_0xcffd('0x4d')]){_0x303749[_0xcffd('0x4d')]=_0x570880[_0xcffd('0x47')]['ChatWebsiteId'];}return db[_0xcffd('0x2e')][_0xcffd('0x46')]({'where':_0x303749})[_0xcffd('0x24')](function(_0x566912){if(_0x566912){throw new db[(_0xcffd('0x4e'))][(_0xcffd('0x4f'))](_0xcffd('0x50'));}return db[_0xcffd('0x2e')][_0xcffd('0x49')](_0x570880[_0xcffd('0x47')]);})[_0xcffd('0x24')](function(_0x25208b){var _0x29126a=_0x570880[_0xcffd('0x51')][_0xcffd('0x52')]({'plain':!![]});if(!_0x29126a)throw new Error(_0xcffd('0x53'));if(_0x29126a['role']==='user'){var _0x365b60=_0x25208b[_0xcffd('0x52')]({'plain':!![]});return db[_0xcffd('0x54')][_0xcffd('0x46')]({'where':{'name':_0xcffd('0x26'),'userProfileId':_0x29126a['userProfileId']},'raw':!![]})['then'](function(_0x30f363){if(_0x30f363&&_0x30f363[_0xcffd('0x55')]===0x0){return db[_0xcffd('0x27')][_0xcffd('0x49')]({'name':_0x365b60[_0xcffd('0x2b')],'resourceId':_0x365b60['id'],'type':_0x30f363[_0xcffd('0x2b')],'sectionId':_0x30f363['id']},{})[_0xcffd('0x24')](function(){return _0x25208b;});}else{return _0x25208b;}})[_0xcffd('0x45')](function(_0xb8968d){logger[_0xcffd('0x29')](_0xcffd('0x56'),_0xb8968d);throw _0xb8968d;});}return _0x25208b;})[_0xcffd('0x24')](respondWithResult(_0x147ae0,0xc9))[_0xcffd('0x45')](handleError(_0x147ae0,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index f402303..1c44cf7 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 _0x2bdf=['path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','api','request-promise'];(function(_0x5d084e,_0x16fe70){var _0x32fb37=function(_0x1da934){while(--_0x1da934){_0x5d084e['push'](_0x5d084e['shift']());}};_0x32fb37(++_0x16fe70);}(_0x2bdf,0xbd));var _0xf2bd=function(_0x3df1d2,_0x5e118e){_0x3df1d2=_0x3df1d2-0x0;var _0x33d99c=_0x2bdf[_0x3df1d2];return _0x33d99c;};'use strict';var _=require('lodash');var util=require(_0xf2bd('0x0'));var logger=require('../../config/logger')(_0xf2bd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf2bd('0x2'));var fs=require('fs');var path=require(_0xf2bd('0x3'));var rimraf=require('rimraf');var config=require(_0xf2bd('0x4'));var attributes=require(_0xf2bd('0x5'));module[_0xf2bd('0x6')]=function(_0x55b3dd,_0x3fd9f0){return _0x55b3dd[_0xf2bd('0x7')](_0xf2bd('0x8'),attributes,{'tableName':_0xf2bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2bd('0xa'),'collate':_0xf2bd('0xb')});};
\ No newline at end of file
+var _0xeebc=['lodash','../../config/logger','moment','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x218d1b,_0x5cf934){var _0x405ad0=function(_0x1e7d68){while(--_0x1e7d68){_0x218d1b['push'](_0x218d1b['shift']());}};_0x405ad0(++_0x5cf934);}(_0xeebc,0x79));var _0xceeb=function(_0x491703,_0x349860){_0x491703=_0x491703-0x0;var _0x53d338=_0xeebc[_0x491703];return _0x53d338;};'use strict';var _=require(_0xceeb('0x0'));var util=require('util');var logger=require(_0xceeb('0x1'))('api');var moment=require(_0xceeb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xceeb('0x3'));var config=require(_0xceeb('0x4'));var attributes=require(_0xceeb('0x5'));module[_0xceeb('0x6')]=function(_0x3bef84,_0x287895){return _0x3bef84[_0xceeb('0x7')](_0xceeb('0x8'),attributes,{'tableName':_0xceeb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xceeb('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index ce8cb21..4aded27 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(_0x17c76f,_0x1f3f24){var _0x351090=function(_0x1191ec){while(--_0x1191ec){_0x17c76f['push'](_0x17c76f['shift']());}};_0x351090(++_0x1f3f24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x5420c5,_0x48d0ac){var _0x164f68=function(_0x15d032){while(--_0x15d032){_0x5420c5['push'](_0x5420c5['shift']());}};_0x164f68(++_0x48d0ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 b3a9249..4c7a613 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 _0x4955=['./cannedAnswer.controller','get','index','isAuthenticated','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4955,0x70));var _0x5495=function(_0x5b0328,_0x267672){_0x5b0328=_0x5b0328-0x0;var _0x325210=_0x4955[_0x5b0328];return _0x325210;};'use strict';var multer=require(_0x5495('0x0'));var util=require(_0x5495('0x1'));var path=require(_0x5495('0x2'));var timeout=require(_0x5495('0x3'));var express=require(_0x5495('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5495('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5495('0x6'));var controller=require(_0x5495('0x7'));router[_0x5495('0x8')]('/',auth['isAuthenticated'](),controller[_0x5495('0x9')]);router[_0x5495('0x8')]('/:id',auth[_0x5495('0xa')](),controller['show']);router[_0x5495('0xb')]('/',auth[_0x5495('0xa')](),controller[_0x5495('0xc')]);router[_0x5495('0xd')](_0x5495('0xe'),auth[_0x5495('0xa')](),controller['update']);router['delete']('/:id',auth[_0x5495('0xa')](),controller[_0x5495('0xf')]);module[_0x5495('0x10')]=router;
\ No newline at end of file
+var _0xb033=['isAuthenticated','index','/:id','show','post','create','put','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0xc1da2f,_0x4aa1c5){var _0x11f1b1=function(_0x346f6a){while(--_0x346f6a){_0xc1da2f['push'](_0xc1da2f['shift']());}};_0x11f1b1(++_0x4aa1c5);}(_0xb033,0x180));var _0x3b03=function(_0x3616e4,_0xf41415){_0x3616e4=_0x3616e4-0x0;var _0x20c9ab=_0xb033[_0x3616e4];return _0x20c9ab;};'use strict';var multer=require('multer');var util=require(_0x3b03('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b03('0x1'));var router=express[_0x3b03('0x2')]();var fs_extra=require(_0x3b03('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3b03('0x4'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x3b03('0x5')]('/',auth[_0x3b03('0x6')](),controller[_0x3b03('0x7')]);router[_0x3b03('0x5')](_0x3b03('0x8'),auth[_0x3b03('0x6')](),controller[_0x3b03('0x9')]);router[_0x3b03('0xa')]('/',auth[_0x3b03('0x6')](),controller[_0x3b03('0xb')]);router[_0x3b03('0xc')](_0x3b03('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3b03('0x8'),auth[_0x3b03('0x6')](),controller[_0x3b03('0xd')]);module[_0x3b03('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index cb77553..399ab9b 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 _0x24b3=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x24b3,0xd3));var _0x324b=function(_0x3477bb,_0xe6ddaa){_0x3477bb=_0x3477bb-0x0;var _0x549bc2=_0x24b3[_0x3477bb];return _0x549bc2;};'use strict';var Sequelize=require(_0x324b('0x0'));module[_0x324b('0x1')]={'calldate':{'type':Sequelize[_0x324b('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x324b('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x324b('0x3')]},'dstchannel':{'type':Sequelize[_0x324b('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x324b('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x324b('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x324b('0x3')]},'userfield':{'type':Sequelize[_0x324b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x324b('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x324b('0x3')]}};
\ No newline at end of file
+var _0xacc5=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x4ec40b,_0x242c15){var _0x360697=function(_0x1017e7){while(--_0x1017e7){_0x4ec40b['push'](_0x4ec40b['shift']());}};_0x360697(++_0x242c15);}(_0xacc5,0x104));var _0x5acc=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xacc5[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x5acc('0x0'));module[_0x5acc('0x1')]={'calldate':{'type':Sequelize[_0x5acc('0x2')],'allowNull':![],'defaultValue':_0x5acc('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5acc('0x4')]},'dst':{'type':Sequelize[_0x5acc('0x4')]},'dcontext':{'type':Sequelize[_0x5acc('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x5acc('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5acc('0x4')]},'amaflags':{'type':Sequelize[_0x5acc('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5acc('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x5acc('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x5acc('0x4')]},'type':{'type':Sequelize[_0x5acc('0x4')]},'tag':{'type':Sequelize[_0x5acc('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 0a820c6..3162bd6 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 _0x1db9=['merge','VIRTUAL','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x1db9,0x176));var _0x91db=function(_0x51cffd,_0x4377a0){_0x51cffd=_0x51cffd-0x0;var _0x433a56=_0x1db9[_0x51cffd];return _0x433a56;};'use strict';var emlformat=require(_0x91db('0x0'));var rimraf=require(_0x91db('0x1'));var zipdir=require(_0x91db('0x2'));var jsonpatch=require(_0x91db('0x3'));var rp=require(_0x91db('0x4'));var moment=require(_0x91db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x91db('0x6'));var util=require(_0x91db('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x91db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91db('0x9'));var squel=require(_0x91db('0xa'));var crypto=require(_0x91db('0xb'));var jsforce=require(_0x91db('0xc'));var deskjs=require(_0x91db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91db('0xe'));var Papa=require('papaparse');var Redis=require(_0x91db('0xf'));var authService=require(_0x91db('0x10'));var qs=require(_0x91db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91db('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x91db('0x13'));var licenseUtil=require(_0x91db('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x540c48,_0x2b9b98){_0x2b9b98=_0x2b9b98||0xcc;return function(_0x329277){if(_0x329277){return _0x540c48[_0x91db('0x15')](_0x2b9b98);}return _0x540c48[_0x91db('0x16')](_0x2b9b98)[_0x91db('0x17')]();};}function respondWithResult(_0x4c3124,_0x371158){_0x371158=_0x371158||0xc8;return function(_0x285052){if(_0x285052){return _0x4c3124[_0x91db('0x16')](_0x371158)[_0x91db('0x18')](_0x285052);}};}function respondWithFilteredResult(_0x2df307,_0x33b39d){return function(_0x260b56){if(_0x260b56){var _0x143bc4=typeof _0x33b39d[_0x91db('0x19')]===_0x91db('0x1a')&&typeof _0x33b39d[_0x91db('0x1b')]===_0x91db('0x1a');var _0x5f5440=_0x260b56[_0x91db('0x1c')];var _0x23d125=_0x143bc4?0x0:_0x33b39d[_0x91db('0x19')];var _0x42e66c=_0x143bc4?_0x260b56[_0x91db('0x1c')]:_0x33b39d[_0x91db('0x19')]+_0x33b39d['limit'];var _0x4ae820;if(_0x42e66c>=_0x5f5440){_0x42e66c=_0x5f5440;_0x4ae820=0xc8;}else{_0x4ae820=0xce;}_0x2df307[_0x91db('0x16')](_0x4ae820);return _0x2df307[_0x91db('0x1d')](_0x91db('0x1e'),_0x23d125+'-'+_0x42e66c+'/'+_0x5f5440)[_0x91db('0x18')](_0x260b56);}return null;};}function patchUpdates(_0x50cf9c){return function(_0x168dea){try{jsonpatch[_0x91db('0x1f')](_0x168dea,_0x50cf9c,!![]);}catch(_0x6e3ca6){return BPromise[_0x91db('0x20')](_0x6e3ca6);}return _0x168dea[_0x91db('0x21')]();};}function saveUpdates(_0x31b96c,_0xaad1f6){return function(_0x8e323f){if(_0x8e323f){return _0x8e323f[_0x91db('0x22')](_0x31b96c)[_0x91db('0x23')](function(_0x554454){return _0x554454;});}return null;};}function removeEntity(_0x58774f,_0x134caa){return function(_0x2ac8d5){if(_0x2ac8d5){return _0x2ac8d5['destroy']()[_0x91db('0x23')](function(){_0x58774f[_0x91db('0x16')](0xcc)[_0x91db('0x17')]();});}};}function handleEntityNotFound(_0x6e3a9c,_0x3729d3){return function(_0x4e2a8f){if(!_0x4e2a8f){_0x6e3a9c['sendStatus'](0x194);}return _0x4e2a8f;};}function handleError(_0x42e53f,_0x2f0b86){_0x2f0b86=_0x2f0b86||0x1f4;return function(_0x329118){logger['error'](_0x329118[_0x91db('0x24')]);if(_0x329118[_0x91db('0x25')]){delete _0x329118[_0x91db('0x25')];}_0x42e53f[_0x91db('0x16')](_0x2f0b86)['send'](_0x329118);};}exports[_0x91db('0x26')]=function(_0x2a00d1,_0x1805ef){var _0x49c504={},_0x2ff6c8={},_0x69fdc2={'count':0x0,'rows':[]};var _0x2d3ebd=_[_0x91db('0x27')](db[_0x91db('0x28')][_0x91db('0x29')],function(_0x2e6a27){return{'name':_0x2e6a27[_0x91db('0x2a')],'type':_0x2e6a27[_0x91db('0x2b')][_0x91db('0x2c')]};});_0x2ff6c8[_0x91db('0x2d')]=_[_0x91db('0x27')](_0x2d3ebd,_0x91db('0x25'));_0x2ff6c8[_0x91db('0x2e')]=_['keys'](_0x2a00d1[_0x91db('0x2e')]);_0x2ff6c8[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],_0x2ff6c8[_0x91db('0x2e')]);_0x49c504['attributes']=_[_0x91db('0x30')](_0x2ff6c8[_0x91db('0x2d')],qs[_0x91db('0x31')](_0x2a00d1['query'][_0x91db('0x31')]));_0x49c504['attributes']=_0x49c504[_0x91db('0x32')][_0x91db('0x33')]?_0x49c504[_0x91db('0x32')]:_0x2ff6c8[_0x91db('0x2d')];if(!_0x2a00d1['query'][_0x91db('0x34')](_0x91db('0x35'))){_0x49c504[_0x91db('0x1b')]=qs['limit'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x1b')]);_0x49c504['offset']=qs[_0x91db('0x19')](_0x2a00d1[_0x91db('0x2e')]['offset']);}_0x49c504[_0x91db('0x36')]=qs['sort'](_0x2a00d1[_0x91db('0x2e')][_0x91db('0x37')]);_0x49c504['where']=qs['filters'](_['pick'](_0x2a00d1[_0x91db('0x2e')],_0x2ff6c8[_0x91db('0x2f')]),_0x2d3ebd);if(_0x2a00d1['query'][_0x91db('0x38')]){_0x49c504[_0x91db('0x39')]=_[_0x91db('0x3a')](_0x49c504[_0x91db('0x39')],{'$or':_[_0x91db('0x27')](_0x2d3ebd,function(_0x3cccc7){if(_0x3cccc7[_0x91db('0x2b')]!==_0x91db('0x3b')){var _0xcdc472={};_0xcdc472[_0x3cccc7[_0x91db('0x25')]]={'$like':'%'+_0x2a00d1[_0x91db('0x2e')]['filter']+'%'};return _0xcdc472;}})});}_0x49c504=_[_0x91db('0x3a')]({},_0x49c504,_0x2a00d1['options']);var _0x14de6d={'where':_0x49c504[_0x91db('0x39')]};return db['Cdr'][_0x91db('0x1c')](_0x14de6d)[_0x91db('0x23')](function(_0x16a7e9){_0x69fdc2[_0x91db('0x1c')]=_0x16a7e9;if(_0x2a00d1[_0x91db('0x2e')]['includeAll']){_0x49c504[_0x91db('0x3c')]=[{'all':!![]}];}return db[_0x91db('0x28')][_0x91db('0x3d')](_0x49c504);})['then'](function(_0x4733a4){_0x69fdc2[_0x91db('0x3e')]=_0x4733a4;return _0x69fdc2;})[_0x91db('0x23')](respondWithFilteredResult(_0x1805ef,_0x49c504))['catch'](handleError(_0x1805ef,null));};exports[_0x91db('0x3f')]=function(_0x2b7830,_0x29831c){var _0x3d73a7={'raw':!![],'where':{'id':_0x2b7830['params']['id']}},_0x3609e1={};_0x3609e1[_0x91db('0x2d')]=_['keys'](db[_0x91db('0x28')][_0x91db('0x29')]);_0x3609e1[_0x91db('0x2e')]=_[_0x91db('0x40')](_0x2b7830[_0x91db('0x2e')]);_0x3609e1[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x3609e1[_0x91db('0x2d')],_0x3609e1[_0x91db('0x2e')]);_0x3d73a7[_0x91db('0x32')]=_[_0x91db('0x30')](_0x3609e1['model'],qs['fields'](_0x2b7830[_0x91db('0x2e')][_0x91db('0x31')]));_0x3d73a7[_0x91db('0x32')]=_0x3d73a7['attributes'][_0x91db('0x33')]?_0x3d73a7[_0x91db('0x32')]:_0x3609e1[_0x91db('0x2d')];if(_0x2b7830[_0x91db('0x2e')][_0x91db('0x41')]){_0x3d73a7['include']=[{'all':!![]}];}_0x3d73a7=_[_0x91db('0x3a')]({},_0x3d73a7,_0x2b7830['options']);return db[_0x91db('0x28')][_0x91db('0x42')](_0x3d73a7)[_0x91db('0x23')](handleEntityNotFound(_0x29831c,null))[_0x91db('0x23')](respondWithResult(_0x29831c,null))[_0x91db('0x43')](handleError(_0x29831c,null));};exports[_0x91db('0x44')]=function(_0x17f7b3,_0xd5a8fb){return db[_0x91db('0x28')]['create'](_0x17f7b3['body'],{})[_0x91db('0x23')](respondWithResult(_0xd5a8fb,0xc9))[_0x91db('0x43')](handleError(_0xd5a8fb,null));};exports[_0x91db('0x22')]=function(_0x410423,_0x27e224){if(_0x410423['body']['id']){delete _0x410423[_0x91db('0x45')]['id'];}return db[_0x91db('0x28')][_0x91db('0x42')]({'where':{'id':_0x410423[_0x91db('0x46')]['id']}})[_0x91db('0x23')](handleEntityNotFound(_0x27e224,null))['then'](saveUpdates(_0x410423[_0x91db('0x45')],null))[_0x91db('0x23')](respondWithResult(_0x27e224,null))[_0x91db('0x43')](handleError(_0x27e224,null));};exports[_0x91db('0x47')]=function(_0x50b269,_0x3d8dfb){return db['Cdr']['find']({'where':{'id':_0x50b269[_0x91db('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d8dfb,null))[_0x91db('0x23')](removeEntity(_0x3d8dfb,null))['catch'](handleError(_0x3d8dfb,null));};exports['describe']=function(_0x2c30ff,_0x371277){return db[_0x91db('0x28')]['describe']()[_0x91db('0x23')](respondWithResult(_0x371277,null))[_0x91db('0x43')](handleError(_0x371277,null));};
\ No newline at end of file
+var _0x8819=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','zip-dir','fast-json-patch'];(function(_0xaf63c5,_0x3ad012){var _0x4f4ac5=function(_0x4d36b4){while(--_0x4d36b4){_0xaf63c5['push'](_0xaf63c5['shift']());}};_0x4f4ac5(++_0x3ad012);}(_0x8819,0x94));var _0x9881=function(_0x27411f,_0x38e1d9){_0x27411f=_0x27411f-0x0;var _0x37d0f5=_0x8819[_0x27411f];return _0x37d0f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9881('0x0'));var jsonpatch=require(_0x9881('0x1'));var rp=require(_0x9881('0x2'));var moment=require(_0x9881('0x3'));var BPromise=require(_0x9881('0x4'));var Mustache=require('mustache');var util=require(_0x9881('0x5'));var path=require(_0x9881('0x6'));var sox=require(_0x9881('0x7'));var csv=require(_0x9881('0x8'));var ejs=require(_0x9881('0x9'));var fs=require('fs');var fs_extra=require(_0x9881('0xa'));var _=require('lodash');var squel=require(_0x9881('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9881('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9881('0xd'));var Redis=require('ioredis');var authService=require(_0x9881('0xe'));var qs=require(_0x9881('0xf'));var as=require(_0x9881('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9881('0x11'))(_0x9881('0x12'));var utils=require(_0x9881('0x13'));var config=require(_0x9881('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9881('0x15'))['db'];function respondWithStatusCode(_0x26ee3f,_0x5c6d2d){_0x5c6d2d=_0x5c6d2d||0xcc;return function(_0x42850e){if(_0x42850e){return _0x26ee3f['sendStatus'](_0x5c6d2d);}return _0x26ee3f['status'](_0x5c6d2d)['end']();};}function respondWithResult(_0x58f526,_0x12794f){_0x12794f=_0x12794f||0xc8;return function(_0x3178d7){if(_0x3178d7){return _0x58f526[_0x9881('0x16')](_0x12794f)[_0x9881('0x17')](_0x3178d7);}};}function respondWithFilteredResult(_0x39d127,_0x1d57ea){return function(_0x4b9d1b){if(_0x4b9d1b){var _0x411513=typeof _0x1d57ea[_0x9881('0x18')]===_0x9881('0x19')&&typeof _0x1d57ea['limit']==='undefined';var _0x4c92c9=_0x4b9d1b[_0x9881('0x1a')];var _0x4c3493=_0x411513?0x0:_0x1d57ea[_0x9881('0x18')];var _0x5a9848=_0x411513?_0x4b9d1b['count']:_0x1d57ea[_0x9881('0x18')]+_0x1d57ea[_0x9881('0x1b')];var _0x1cbac3;if(_0x5a9848>=_0x4c92c9){_0x5a9848=_0x4c92c9;_0x1cbac3=0xc8;}else{_0x1cbac3=0xce;}_0x39d127[_0x9881('0x16')](_0x1cbac3);return _0x39d127[_0x9881('0x1c')](_0x9881('0x1d'),_0x4c3493+'-'+_0x5a9848+'/'+_0x4c92c9)[_0x9881('0x17')](_0x4b9d1b);}return null;};}function patchUpdates(_0x1243cc){return function(_0x1ee450){try{jsonpatch[_0x9881('0x1e')](_0x1ee450,_0x1243cc,!![]);}catch(_0x32ca84){return BPromise[_0x9881('0x1f')](_0x32ca84);}return _0x1ee450[_0x9881('0x20')]();};}function saveUpdates(_0x300fa6,_0x174b39){return function(_0x58485d){if(_0x58485d){return _0x58485d['update'](_0x300fa6)[_0x9881('0x21')](function(_0x513545){return _0x513545;});}return null;};}function removeEntity(_0x499461,_0x1ba558){return function(_0x30ed15){if(_0x30ed15){return _0x30ed15['destroy']()['then'](function(){_0x499461[_0x9881('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bddc1,_0x161f8d){return function(_0x16eeca){if(!_0x16eeca){_0x2bddc1[_0x9881('0x22')](0x194);}return _0x16eeca;};}function handleError(_0x2c3cd1,_0x14e6f9){_0x14e6f9=_0x14e6f9||0x1f4;return function(_0x2f6b7c){logger[_0x9881('0x23')](_0x2f6b7c[_0x9881('0x24')]);if(_0x2f6b7c[_0x9881('0x25')]){delete _0x2f6b7c[_0x9881('0x25')];}_0x2c3cd1[_0x9881('0x16')](_0x14e6f9)[_0x9881('0x26')](_0x2f6b7c);};}exports['index']=function(_0x31956e,_0x41fe0d){var _0x5c2815={},_0x236979={},_0x3d7120={'count':0x0,'rows':[]};var _0x4970be=_[_0x9881('0x27')](db[_0x9881('0x28')][_0x9881('0x29')],function(_0x204f2b){return{'name':_0x204f2b[_0x9881('0x2a')],'type':_0x204f2b[_0x9881('0x2b')][_0x9881('0x2c')]};});_0x236979[_0x9881('0x2d')]=_['map'](_0x4970be,_0x9881('0x25'));_0x236979[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x31956e[_0x9881('0x2e')]);_0x236979[_0x9881('0x30')]=_[_0x9881('0x31')](_0x236979['model'],_0x236979[_0x9881('0x2e')]);_0x5c2815[_0x9881('0x32')]=_['intersection'](_0x236979[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x31956e[_0x9881('0x2e')][_0x9881('0x33')]));_0x5c2815[_0x9881('0x32')]=_0x5c2815['attributes'][_0x9881('0x34')]?_0x5c2815[_0x9881('0x32')]:_0x236979[_0x9881('0x2d')];if(!_0x31956e[_0x9881('0x2e')][_0x9881('0x35')](_0x9881('0x36'))){_0x5c2815[_0x9881('0x1b')]=qs[_0x9881('0x1b')](_0x31956e[_0x9881('0x2e')][_0x9881('0x1b')]);_0x5c2815[_0x9881('0x18')]=qs[_0x9881('0x18')](_0x31956e[_0x9881('0x2e')][_0x9881('0x18')]);}_0x5c2815[_0x9881('0x37')]=qs[_0x9881('0x38')](_0x31956e['query'][_0x9881('0x38')]);_0x5c2815['where']=qs[_0x9881('0x30')](_['pick'](_0x31956e[_0x9881('0x2e')],_0x236979[_0x9881('0x30')]),_0x4970be);if(_0x31956e['query'][_0x9881('0x39')]){_0x5c2815['where']=_[_0x9881('0x3a')](_0x5c2815[_0x9881('0x3b')],{'$or':_[_0x9881('0x27')](_0x4970be,function(_0x204fc3){if(_0x204fc3['type']!==_0x9881('0x3c')){var _0x3d183e={};_0x3d183e[_0x204fc3[_0x9881('0x25')]]={'$like':'%'+_0x31956e[_0x9881('0x2e')][_0x9881('0x39')]+'%'};return _0x3d183e;}})});}_0x5c2815=_[_0x9881('0x3a')]({},_0x5c2815,_0x31956e[_0x9881('0x3d')]);var _0x4feb70={'where':_0x5c2815[_0x9881('0x3b')]};return db['Cdr'][_0x9881('0x1a')](_0x4feb70)[_0x9881('0x21')](function(_0x1c0396){_0x3d7120['count']=_0x1c0396;if(_0x31956e[_0x9881('0x2e')][_0x9881('0x3e')]){_0x5c2815[_0x9881('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0x9881('0x40')](_0x5c2815);})[_0x9881('0x21')](function(_0x4fe13d){_0x3d7120[_0x9881('0x41')]=_0x4fe13d;return _0x3d7120;})[_0x9881('0x21')](respondWithFilteredResult(_0x41fe0d,_0x5c2815))[_0x9881('0x42')](handleError(_0x41fe0d,null));};exports[_0x9881('0x43')]=function(_0x424ed1,_0x1eae2f){var _0x2ac606={'raw':!![],'where':{'id':_0x424ed1[_0x9881('0x44')]['id']}},_0x4421bc={};_0x4421bc[_0x9881('0x2d')]=_['keys'](db[_0x9881('0x28')][_0x9881('0x29')]);_0x4421bc[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x424ed1[_0x9881('0x2e')]);_0x4421bc['filters']=_[_0x9881('0x31')](_0x4421bc[_0x9881('0x2d')],_0x4421bc[_0x9881('0x2e')]);_0x2ac606[_0x9881('0x32')]=_['intersection'](_0x4421bc[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x424ed1[_0x9881('0x2e')]['fields']));_0x2ac606[_0x9881('0x32')]=_0x2ac606[_0x9881('0x32')][_0x9881('0x34')]?_0x2ac606[_0x9881('0x32')]:_0x4421bc[_0x9881('0x2d')];if(_0x424ed1[_0x9881('0x2e')][_0x9881('0x3e')]){_0x2ac606[_0x9881('0x3f')]=[{'all':!![]}];}_0x2ac606=_[_0x9881('0x3a')]({},_0x2ac606,_0x424ed1[_0x9881('0x3d')]);return db['Cdr'][_0x9881('0x45')](_0x2ac606)[_0x9881('0x21')](handleEntityNotFound(_0x1eae2f,null))[_0x9881('0x21')](respondWithResult(_0x1eae2f,null))['catch'](handleError(_0x1eae2f,null));};exports[_0x9881('0x46')]=function(_0x24a52b,_0x1e1f0f){return db['Cdr']['create'](_0x24a52b[_0x9881('0x47')],{})[_0x9881('0x21')](respondWithResult(_0x1e1f0f,0xc9))[_0x9881('0x42')](handleError(_0x1e1f0f,null));};exports[_0x9881('0x48')]=function(_0x49c478,_0x514263){if(_0x49c478[_0x9881('0x47')]['id']){delete _0x49c478[_0x9881('0x47')]['id'];}return db[_0x9881('0x28')]['find']({'where':{'id':_0x49c478[_0x9881('0x44')]['id']}})[_0x9881('0x21')](handleEntityNotFound(_0x514263,null))['then'](saveUpdates(_0x49c478[_0x9881('0x47')],null))[_0x9881('0x21')](respondWithResult(_0x514263,null))[_0x9881('0x42')](handleError(_0x514263,null));};exports[_0x9881('0x49')]=function(_0x21720a,_0x32cb89){return db[_0x9881('0x28')]['find']({'where':{'id':_0x21720a[_0x9881('0x44')]['id']}})['then'](handleEntityNotFound(_0x32cb89,null))[_0x9881('0x21')](removeEntity(_0x32cb89,null))[_0x9881('0x42')](handleError(_0x32cb89,null));};exports[_0x9881('0x4a')]=function(_0x16ca26,_0x590acc){return db['Cdr'][_0x9881('0x4a')]()[_0x9881('0x21')](respondWithResult(_0x590acc,null))[_0x9881('0x42')](handleError(_0x590acc,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e3947f9..b390a9d 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(_0x243203,_0x2a9990){var _0x4707de=function(_0xc19be6){while(--_0xc19be6){_0x243203['push'](_0x243203['shift']());}};_0x4707de(++_0x2a9990);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xd94408,_0x31df46){var _0x5b06ee=function(_0x37911c){while(--_0x37911c){_0xd94408['push'](_0xd94408['shift']());}};_0x5b06ee(++_0x31df46);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index c53989f..68e4dec 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 _0xf38a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x494567,_0x1a98ce){var _0x500e3a=function(_0xd97c01){while(--_0xd97c01){_0x494567['push'](_0x494567['shift']());}};_0x500e3a(++_0x1a98ce);}(_0xf38a,0x1e3));var _0xaf38=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xf38a[_0x247fa1];return _0x244f35;};'use strict';var _=require(_0xaf38('0x0'));var util=require(_0xaf38('0x1'));var moment=require(_0xaf38('0x2'));var BPromise=require(_0xaf38('0x3'));var rs=require(_0xaf38('0x4'));var fs=require('fs');var Redis=require(_0xaf38('0x5'));var db=require(_0xaf38('0x6'))['db'];var utils=require(_0xaf38('0x7'));var logger=require(_0xaf38('0x8'))(_0xaf38('0x9'));var config=require(_0xaf38('0xa'));var jayson=require(_0xaf38('0xb'));var client=jayson[_0xaf38('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x346b15,_0x1fe0a0,_0x22a35c){return new BPromise(function(_0x1aab61,_0x3075fd){return client[_0xaf38('0xd')](_0x346b15,_0x22a35c)[_0xaf38('0xe')](function(_0x2c0908){logger[_0xaf38('0xf')](_0xaf38('0x10'),_0x1fe0a0,_0xaf38('0x11'));logger[_0xaf38('0x12')](_0xaf38('0x13'),_0x1fe0a0,_0xaf38('0x11'),JSON['stringify'](_0x2c0908));if(_0x2c0908[_0xaf38('0x14')]){if(_0x2c0908[_0xaf38('0x14')][_0xaf38('0x15')]===0x1f4){logger[_0xaf38('0x14')](_0xaf38('0x10'),_0x1fe0a0,_0x2c0908[_0xaf38('0x14')][_0xaf38('0x16')]);return _0x3075fd(_0x2c0908[_0xaf38('0x14')][_0xaf38('0x16')]);}logger[_0xaf38('0x14')]('Cdr,\x20%s,\x20%s',_0x1fe0a0,_0x2c0908[_0xaf38('0x14')][_0xaf38('0x16')]);return _0x1aab61(_0x2c0908[_0xaf38('0x14')]['message']);}else{logger[_0xaf38('0xf')](_0xaf38('0x10'),_0x1fe0a0,_0xaf38('0x11'));_0x1aab61(_0x2c0908['result'][_0xaf38('0x16')]);}})['catch'](function(_0x12a1d7){logger['error']('Cdr,\x20%s,\x20%s',_0x1fe0a0,_0x12a1d7);_0x3075fd(_0x12a1d7);});});}
\ No newline at end of file
+var _0x8669=['randomstring','ioredis','../../config/logger','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8669,0x1eb));var _0x9866=function(_0x23e015,_0x44c03d){_0x23e015=_0x23e015-0x0;var _0x5e5208=_0x8669[_0x23e015];return _0x5e5208;};'use strict';var _=require('lodash');var util=require(_0x9866('0x0'));var moment=require(_0x9866('0x1'));var BPromise=require(_0x9866('0x2'));var rs=require(_0x9866('0x3'));var fs=require('fs');var Redis=require(_0x9866('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9866('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9866('0x6'));var client=jayson[_0x9866('0x7')][_0x9866('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41d1d5,_0x3a2382,_0x5c67a7){return new BPromise(function(_0x541138,_0x4687a9){return client['request'](_0x41d1d5,_0x5c67a7)[_0x9866('0x9')](function(_0x157d36){logger[_0x9866('0xa')](_0x9866('0xb'),_0x3a2382,_0x9866('0xc'));logger[_0x9866('0xd')](_0x9866('0xe'),_0x3a2382,'request\x20sent',JSON['stringify'](_0x157d36));if(_0x157d36[_0x9866('0xf')]){if(_0x157d36[_0x9866('0xf')][_0x9866('0x10')]===0x1f4){logger['error'](_0x9866('0xb'),_0x3a2382,_0x157d36[_0x9866('0xf')]['message']);return _0x4687a9(_0x157d36[_0x9866('0xf')][_0x9866('0x11')]);}logger[_0x9866('0xf')](_0x9866('0xb'),_0x3a2382,_0x157d36[_0x9866('0xf')][_0x9866('0x11')]);return _0x541138(_0x157d36[_0x9866('0xf')][_0x9866('0x11')]);}else{logger['info'](_0x9866('0xb'),_0x3a2382,'request\x20sent');_0x541138(_0x157d36[_0x9866('0x12')][_0x9866('0x11')]);}})['catch'](function(_0x42daf2){logger[_0x9866('0xf')](_0x9866('0xb'),_0x3a2382,_0x42daf2);_0x4687a9(_0x42daf2);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 8d2a013..e7d226d 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(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x42f3e4,_0x2646fd){var _0x1d7aa6=function(_0x4a721d){while(--_0x4a721d){_0x42f3e4['push'](_0x42f3e4['shift']());}};_0x1d7aa6(++_0x2646fd);}(_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 8708566..2d1e417 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 _0xeaa4=['exports','noop','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaa4,0x143));var _0x4eaa=function(_0xc1e593,_0x1b1f5f){_0xc1e593=_0xc1e593-0x0;var _0x4c4648=_0xeaa4[_0xc1e593];return _0x4c4648;};'use strict';var Sequelize=require(_0x4eaa('0x0'));module[_0x4eaa('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4eaa('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4eaa('0x3')]},'interval':{'type':Sequelize[_0x4eaa('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x1912=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1912,0x9d));var _0x2191=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1912[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x2191('0x0'));module[_0x2191('0x1')]={'priority':{'type':Sequelize[_0x2191('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2191('0x3')],'allowNull':![],'defaultValue':_0x2191('0x4')},'appdata':{'type':Sequelize[_0x2191('0x5')]()},'description':{'type':Sequelize[_0x2191('0x3')]},'interval':{'type':Sequelize[_0x2191('0x3')],'defaultValue':_0x2191('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5078089..b758740 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 _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','ChatApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x44278,_0x1bd66f){var _0x2d97f9=function(_0x18a1a3){while(--_0x18a1a3){_0x44278['push'](_0x44278['shift']());}};_0x2d97f9(++_0x1bd66f);}(_0x70e0,0x17b));var _0x070e=function(_0x362f85,_0x2b44f1){_0x362f85=_0x362f85-0x0;var _0x266308=_0x70e0[_0x362f85];return _0x266308;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));};
\ No newline at end of file
+var _0x0db9=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','show','model','keys','rawAttributes','query','intersection','fields','attributes','includeAll','include','merge','options','catch','body','ChatApplication','find','destroy','params','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x0db9,0xa3));var _0x90db=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x0db9[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0x90db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x90db('0x1'));var moment=require(_0x90db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90db('0x3'));var util=require('util');var path=require(_0x90db('0x4'));var sox=require(_0x90db('0x5'));var csv=require('to-csv');var ejs=require(_0x90db('0x6'));var fs=require('fs');var fs_extra=require(_0x90db('0x7'));var _=require(_0x90db('0x8'));var squel=require(_0x90db('0x9'));var crypto=require(_0x90db('0xa'));var jsforce=require(_0x90db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x90db('0xc'));var querystring=require(_0x90db('0xd'));var Papa=require(_0x90db('0xe'));var Redis=require(_0x90db('0xf'));var authService=require(_0x90db('0x10'));var qs=require(_0x90db('0x11'));var as=require(_0x90db('0x12'));var hardwareService=require(_0x90db('0x13'));var logger=require(_0x90db('0x14'))(_0x90db('0x15'));var utils=require(_0x90db('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90db('0x17'));var db=require(_0x90db('0x18'))['db'];function respondWithStatusCode(_0x45ad3c,_0x436327){_0x436327=_0x436327||0xcc;return function(_0x1b410d){if(_0x1b410d){return _0x45ad3c[_0x90db('0x19')](_0x436327);}return _0x45ad3c[_0x90db('0x1a')](_0x436327)[_0x90db('0x1b')]();};}function respondWithResult(_0x7826f7,_0x309aea){_0x309aea=_0x309aea||0xc8;return function(_0x334e22){if(_0x334e22){return _0x7826f7[_0x90db('0x1a')](_0x309aea)[_0x90db('0x1c')](_0x334e22);}};}function respondWithFilteredResult(_0xda2abe,_0x544226){return function(_0x3124d4){if(_0x3124d4){var _0x5ef456=typeof _0x544226[_0x90db('0x1d')]===_0x90db('0x1e')&&typeof _0x544226[_0x90db('0x1f')]===_0x90db('0x1e');var _0x32ff04=_0x3124d4[_0x90db('0x20')];var _0x15e33e=_0x5ef456?0x0:_0x544226[_0x90db('0x1d')];var _0x24a16a=_0x5ef456?_0x3124d4[_0x90db('0x20')]:_0x544226['offset']+_0x544226[_0x90db('0x1f')];var _0x445a22;if(_0x24a16a>=_0x32ff04){_0x24a16a=_0x32ff04;_0x445a22=0xc8;}else{_0x445a22=0xce;}_0xda2abe['status'](_0x445a22);return _0xda2abe['set'](_0x90db('0x21'),_0x15e33e+'-'+_0x24a16a+'/'+_0x32ff04)[_0x90db('0x1c')](_0x3124d4);}return null;};}function patchUpdates(_0x300dc2){return function(_0x3a58c4){try{jsonpatch[_0x90db('0x22')](_0x3a58c4,_0x300dc2,!![]);}catch(_0x168eaf){return BPromise[_0x90db('0x23')](_0x168eaf);}return _0x3a58c4['save']();};}function saveUpdates(_0xb45340,_0x1aeab9){return function(_0x23934a){if(_0x23934a){return _0x23934a[_0x90db('0x24')](_0xb45340)['then'](function(_0x43028e){return _0x43028e;});}return null;};}function removeEntity(_0x5a98f6,_0x459068){return function(_0x19f9c6){if(_0x19f9c6){return _0x19f9c6['destroy']()[_0x90db('0x25')](function(){_0x5a98f6[_0x90db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8469,_0x3e3fbd){return function(_0x5b3c09){if(!_0x5b3c09){_0x2f8469[_0x90db('0x19')](0x194);}return _0x5b3c09;};}function handleError(_0xe026cf,_0x1cc660){_0x1cc660=_0x1cc660||0x1f4;return function(_0x94cd84){logger['error'](_0x94cd84[_0x90db('0x26')]);if(_0x94cd84[_0x90db('0x27')]){delete _0x94cd84[_0x90db('0x27')];}_0xe026cf[_0x90db('0x1a')](_0x1cc660)[_0x90db('0x28')](_0x94cd84);};}exports[_0x90db('0x29')]=function(_0x44b5b6,_0x3c7f67){var _0x4c6311={'raw':!![],'where':{'id':_0x44b5b6['params']['id']}},_0x3489d1={};_0x3489d1[_0x90db('0x2a')]=_[_0x90db('0x2b')](db['ChatApplication'][_0x90db('0x2c')]);_0x3489d1[_0x90db('0x2d')]=_[_0x90db('0x2b')](_0x44b5b6[_0x90db('0x2d')]);_0x3489d1['filters']=_[_0x90db('0x2e')](_0x3489d1[_0x90db('0x2a')],_0x3489d1[_0x90db('0x2d')]);_0x4c6311['attributes']=_['intersection'](_0x3489d1[_0x90db('0x2a')],qs[_0x90db('0x2f')](_0x44b5b6[_0x90db('0x2d')]['fields']));_0x4c6311[_0x90db('0x30')]=_0x4c6311[_0x90db('0x30')]['length']?_0x4c6311[_0x90db('0x30')]:_0x3489d1[_0x90db('0x2a')];if(_0x44b5b6['query'][_0x90db('0x31')]){_0x4c6311[_0x90db('0x32')]=[{'all':!![]}];}_0x4c6311=_[_0x90db('0x33')]({},_0x4c6311,_0x44b5b6[_0x90db('0x34')]);return db['ChatApplication']['find'](_0x4c6311)[_0x90db('0x25')](handleEntityNotFound(_0x3c7f67,null))['then'](respondWithResult(_0x3c7f67,null))[_0x90db('0x35')](handleError(_0x3c7f67,null));};exports[_0x90db('0x24')]=function(_0x45cebb,_0x540176){if(_0x45cebb[_0x90db('0x36')]['id']){delete _0x45cebb['body']['id'];}return db[_0x90db('0x37')][_0x90db('0x38')]({'where':{'id':_0x45cebb['params']['id']}})[_0x90db('0x25')](handleEntityNotFound(_0x540176,null))[_0x90db('0x25')](saveUpdates(_0x45cebb[_0x90db('0x36')],null))[_0x90db('0x25')](respondWithResult(_0x540176,null))[_0x90db('0x35')](handleError(_0x540176,null));};exports[_0x90db('0x39')]=function(_0x4de656,_0x88789f){return db[_0x90db('0x37')]['find']({'where':{'id':_0x4de656[_0x90db('0x3a')]['id']}})[_0x90db('0x25')](handleEntityNotFound(_0x88789f,null))[_0x90db('0x25')](removeEntity(_0x88789f,null))['catch'](handleError(_0x88789f,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9d244ac..4993361 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 _0x5959=['ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x25ea0a,_0x287721){var _0x38996c=function(_0x72959f){while(--_0x72959f){_0x25ea0a['push'](_0x25ea0a['shift']());}};_0x38996c(++_0x287721);}(_0x5959,0x17c));var _0x9595=function(_0x567d,_0x2f8123){_0x567d=_0x567d-0x0;var _0x3b7a37=_0x5959[_0x567d];return _0x3b7a37;};'use strict';var _=require(_0x9595('0x0'));var util=require(_0x9595('0x1'));var logger=require(_0x9595('0x2'))('api');var moment=require(_0x9595('0x3'));var BPromise=require(_0x9595('0x4'));var rp=require(_0x9595('0x5'));var fs=require('fs');var path=require(_0x9595('0x6'));var rimraf=require(_0x9595('0x7'));var config=require(_0x9595('0x8'));var attributes=require(_0x9595('0x9'));module['exports']=function(_0x20e2fb,_0x19b27c){return _0x20e2fb['define'](_0x9595('0xa'),attributes,{'tableName':_0x9595('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9595('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x28eb=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x28eb,0x105));var _0xb28e=function(_0x266ca7,_0x15005f){_0x266ca7=_0x266ca7-0x0;var _0x2969ca=_0x28eb[_0x266ca7];return _0x2969ca;};'use strict';var _=require(_0xb28e('0x0'));var util=require(_0xb28e('0x1'));var logger=require(_0xb28e('0x2'))('api');var moment=require(_0xb28e('0x3'));var BPromise=require(_0xb28e('0x4'));var rp=require(_0xb28e('0x5'));var fs=require('fs');var path=require(_0xb28e('0x6'));var rimraf=require(_0xb28e('0x7'));var config=require(_0xb28e('0x8'));var attributes=require(_0xb28e('0x9'));module['exports']=function(_0x42b823,_0x4638f9){return _0x42b823[_0xb28e('0xa')](_0xb28e('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb28e('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f5821d1..af7a4fd 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 _0x7a0c=['ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring'];(function(_0x59a901,_0xd01104){var _0x5b2b75=function(_0x4b6044){while(--_0x4b6044){_0x59a901['push'](_0x59a901['shift']());}};_0x5b2b75(++_0xd01104);}(_0x7a0c,0x14c));var _0xc7a0=function(_0x48ab6d,_0x13868d){_0x48ab6d=_0x48ab6d-0x0;var _0x1dcebe=_0x7a0c[_0x48ab6d];return _0x1dcebe;};'use strict';var _=require(_0xc7a0('0x0'));var util=require(_0xc7a0('0x1'));var moment=require(_0xc7a0('0x2'));var BPromise=require('bluebird');var rs=require(_0xc7a0('0x3'));var fs=require('fs');var Redis=require(_0xc7a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7a0('0x5'));var logger=require(_0xc7a0('0x6'))(_0xc7a0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc7a0('0x8')][_0xc7a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6290fa,_0x37311c,_0x4560bb){return new BPromise(function(_0x34dd90,_0x1dfca1){return client['request'](_0x6290fa,_0x4560bb)[_0xc7a0('0xa')](function(_0x477cbb){logger[_0xc7a0('0xb')]('ChatApplication,\x20%s,\x20%s',_0x37311c,_0xc7a0('0xc'));logger[_0xc7a0('0xd')](_0xc7a0('0xe'),_0x37311c,_0xc7a0('0xc'),JSON[_0xc7a0('0xf')](_0x477cbb));if(_0x477cbb[_0xc7a0('0x10')]){if(_0x477cbb[_0xc7a0('0x10')][_0xc7a0('0x11')]===0x1f4){logger['error'](_0xc7a0('0x12'),_0x37311c,_0x477cbb[_0xc7a0('0x10')][_0xc7a0('0x13')]);return _0x1dfca1(_0x477cbb['error'][_0xc7a0('0x13')]);}logger['error'](_0xc7a0('0x12'),_0x37311c,_0x477cbb[_0xc7a0('0x10')]['message']);return _0x34dd90(_0x477cbb['error'][_0xc7a0('0x13')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x37311c,'request\x20sent');_0x34dd90(_0x477cbb[_0xc7a0('0x14')][_0xc7a0('0x13')]);}})['catch'](function(_0x1e8d6a){logger[_0xc7a0('0x10')](_0xc7a0('0x12'),_0x37311c,_0x1e8d6a);_0x1dfca1(_0x1e8d6a);});});}
\ No newline at end of file
+var _0x906c=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x906c,0x192));var _0xc906=function(_0x4b759f,_0x25b082){_0x4b759f=_0x4b759f-0x0;var _0x4518cc=_0x906c[_0x4b759f];return _0x4518cc;};'use strict';var _=require(_0xc906('0x0'));var util=require('util');var moment=require(_0xc906('0x1'));var BPromise=require('bluebird');var rs=require(_0xc906('0x2'));var fs=require('fs');var Redis=require(_0xc906('0x3'));var db=require(_0xc906('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc906('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc906('0x6'));var client=jayson['client'][_0xc906('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x30cefe,_0x412740,_0x2ae2a1){return new BPromise(function(_0x5191ea,_0xfbb96c){return client[_0xc906('0x8')](_0x30cefe,_0x2ae2a1)[_0xc906('0x9')](function(_0x3a2697){logger['info'](_0xc906('0xa'),_0x412740,_0xc906('0xb'));logger[_0xc906('0xc')](_0xc906('0xd'),_0x412740,'request\x20sent',JSON['stringify'](_0x3a2697));if(_0x3a2697[_0xc906('0xe')]){if(_0x3a2697['error'][_0xc906('0xf')]===0x1f4){logger['error'](_0xc906('0xa'),_0x412740,_0x3a2697['error'][_0xc906('0x10')]);return _0xfbb96c(_0x3a2697[_0xc906('0xe')][_0xc906('0x10')]);}logger[_0xc906('0xe')](_0xc906('0xa'),_0x412740,_0x3a2697['error']['message']);return _0x5191ea(_0x3a2697[_0xc906('0xe')][_0xc906('0x10')]);}else{logger[_0xc906('0x11')](_0xc906('0xa'),_0x412740,'request\x20sent');_0x5191ea(_0x3a2697[_0xc906('0x12')][_0xc906('0x10')]);}})[_0xc906('0x13')](function(_0x4eba5f){logger[_0xc906('0xe')](_0xc906('0xa'),_0x412740,_0x4eba5f);_0xfbb96c(_0x4eba5f);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 9de271d..bae263c 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 _0x2d9b=['update','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show','put'];(function(_0x16b33f,_0x1e933f){var _0x27c5e0=function(_0x29a857){while(--_0x29a857){_0x16b33f['push'](_0x16b33f['shift']());}};_0x27c5e0(++_0x1e933f);}(_0x2d9b,0x17c));var _0xb2d9=function(_0x2b08dd,_0xabf45c){_0x2b08dd=_0x2b08dd-0x0;var _0x48ad5f=_0x2d9b[_0x2b08dd];return _0x48ad5f;};'use strict';var multer=require(_0xb2d9('0x0'));var util=require('util');var path=require(_0xb2d9('0x1'));var timeout=require(_0xb2d9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2d9('0x3'));var interaction=require(_0xb2d9('0x4'));var config=require('../../config/environment');var controller=require(_0xb2d9('0x5'));router['get'](_0xb2d9('0x6'),auth[_0xb2d9('0x7')](),controller[_0xb2d9('0x8')]);router[_0xb2d9('0x9')](_0xb2d9('0x6'),auth[_0xb2d9('0x7')](),controller[_0xb2d9('0xa')]);router['delete'](_0xb2d9('0x6'),auth['isAuthenticated'](),controller[_0xb2d9('0xb')]);module[_0xb2d9('0xc')]=router;
\ No newline at end of file
+var _0x212c=['isAuthenticated','show','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x352cd3,_0x3489ae){var _0x5a5be1=function(_0x58fdcd){while(--_0x58fdcd){_0x352cd3['push'](_0x352cd3['shift']());}};_0x5a5be1(++_0x3489ae);}(_0x212c,0x1af));var _0xc212=function(_0x3b7f17,_0x5ba525){_0x3b7f17=_0x3b7f17-0x0;var _0x1195dc=_0x212c[_0x3b7f17];return _0x1195dc;};'use strict';var multer=require(_0xc212('0x0'));var util=require(_0xc212('0x1'));var path=require(_0xc212('0x2'));var timeout=require(_0xc212('0x3'));var express=require('express');var router=express[_0xc212('0x4')]();var fs_extra=require(_0xc212('0x5'));var auth=require(_0xc212('0x6'));var interaction=require(_0xc212('0x7'));var config=require(_0xc212('0x8'));var controller=require('./chatApplication.controller');router[_0xc212('0x9')](_0xc212('0xa'),auth[_0xc212('0xb')](),controller[_0xc212('0xc')]);router[_0xc212('0xd')]('/:id',auth[_0xc212('0xb')](),controller[_0xc212('0xe')]);router[_0xc212('0xf')](_0xc212('0xa'),auth[_0xc212('0xb')](),controller['destroy']);module[_0xc212('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 825bcf6..ff84bdc 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 _0xc6f8=['STRING','BOOLEAN'];(function(_0x24e064,_0x240373){var _0x34abec=function(_0x244b5d){while(--_0x244b5d){_0x24e064['push'](_0x24e064['shift']());}};_0x34abec(++_0x240373);}(_0xc6f8,0x14c));var _0x8c6f=function(_0x56fe34,_0x5eb857){_0x56fe34=_0x56fe34-0x0;var _0xb6206d=_0xc6f8[_0x56fe34];return _0xb6206d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8c6f('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x8c6f('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6c99=['sequelize','exports','STRING'];(function(_0x2410da,_0x15fc59){var _0x17db47=function(_0x4b8ed3){while(--_0x4b8ed3){_0x2410da['push'](_0x2410da['shift']());}};_0x17db47(++_0x15fc59);}(_0x6c99,0x19b));var _0x96c9=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x6c99[_0x310504];return _0x5b36d0;};'use strict';var Sequelize=require(_0x96c9('0x0'));module[_0x96c9('0x1')]={'name':{'type':Sequelize[_0x96c9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x96c9('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index bf80641..343b117 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 _0xf3b9=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ChatGroup','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','options','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0xa711b,_0x81a280){var _0x1f061d=function(_0x4c7a37){while(--_0x4c7a37){_0xa711b['push'](_0xa711b['shift']());}};_0x1f061d(++_0x81a280);}(_0xf3b9,0x19d));var _0x9f3b=function(_0x1ec849,_0x386984){_0x1ec849=_0x1ec849-0x0;var _0x1fff97=_0xf3b9[_0x1ec849];return _0x1fff97;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f3b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f3b('0x1'));var rp=require('request-promise');var moment=require(_0x9f3b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9f3b('0x3'));var util=require(_0x9f3b('0x4'));var path=require(_0x9f3b('0x5'));var sox=require(_0x9f3b('0x6'));var csv=require(_0x9f3b('0x7'));var ejs=require(_0x9f3b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f3b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9f3b('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f3b('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x9f3b('0xc'));var as=require(_0x9f3b('0xd'));var hardwareService=require(_0x9f3b('0xe'));var logger=require(_0x9f3b('0xf'))(_0x9f3b('0x10'));var utils=require(_0x9f3b('0x11'));var config=require(_0x9f3b('0x12'));var licenseUtil=require(_0x9f3b('0x13'));var db=require(_0x9f3b('0x14'))['db'];config[_0x9f3b('0x15')]=_[_0x9f3b('0x16')](config[_0x9f3b('0x15')],{'host':_0x9f3b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9f3b('0x18'))[_0x9f3b('0x19')](socket);function respondWithStatusCode(_0x5693f0,_0x4345af){_0x4345af=_0x4345af||0xcc;return function(_0xe3a59b){if(_0xe3a59b){return _0x5693f0['sendStatus'](_0x4345af);}return _0x5693f0[_0x9f3b('0x1a')](_0x4345af)[_0x9f3b('0x1b')]();};}function respondWithResult(_0x1383f2,_0x56f409){_0x56f409=_0x56f409||0xc8;return function(_0x5412cf){if(_0x5412cf){return _0x1383f2['status'](_0x56f409)[_0x9f3b('0x1c')](_0x5412cf);}};}function respondWithFilteredResult(_0x3be6be,_0x3ec11f){return function(_0x51f096){if(_0x51f096){var _0xcba5bb=typeof _0x3ec11f[_0x9f3b('0x1d')]==='undefined'&&typeof _0x3ec11f['limit']===_0x9f3b('0x1e');var _0x49dcd6=_0x51f096['count'];var _0x3b17f5=_0xcba5bb?0x0:_0x3ec11f[_0x9f3b('0x1d')];var _0x5cce47=_0xcba5bb?_0x51f096[_0x9f3b('0x1f')]:_0x3ec11f[_0x9f3b('0x1d')]+_0x3ec11f[_0x9f3b('0x20')];var _0x438c98;if(_0x5cce47>=_0x49dcd6){_0x5cce47=_0x49dcd6;_0x438c98=0xc8;}else{_0x438c98=0xce;}_0x3be6be[_0x9f3b('0x1a')](_0x438c98);return _0x3be6be[_0x9f3b('0x21')](_0x9f3b('0x22'),_0x3b17f5+'-'+_0x5cce47+'/'+_0x49dcd6)['json'](_0x51f096);}return null;};}function patchUpdates(_0x54edaf){return function(_0x2838e4){try{jsonpatch[_0x9f3b('0x23')](_0x2838e4,_0x54edaf,!![]);}catch(_0x451d63){return BPromise[_0x9f3b('0x24')](_0x451d63);}return _0x2838e4[_0x9f3b('0x25')]();};}function saveUpdates(_0xe18230,_0x345ccc){return function(_0x24cbb4){if(_0x24cbb4){return _0x24cbb4[_0x9f3b('0x26')](_0xe18230)[_0x9f3b('0x27')](function(_0xa200e0){return _0xa200e0;});}return null;};}function removeEntity(_0x6fb490,_0x37adc2){return function(_0x3eb503){if(_0x3eb503){return _0x3eb503[_0x9f3b('0x28')]()[_0x9f3b('0x27')](function(){_0x6fb490[_0x9f3b('0x1a')](0xcc)[_0x9f3b('0x1b')]();});}};}function handleEntityNotFound(_0xd3a98e,_0x3c32bf){return function(_0x45ed77){if(!_0x45ed77){_0xd3a98e[_0x9f3b('0x29')](0x194);}return _0x45ed77;};}function handleError(_0x4a4658,_0xeb3b93){_0xeb3b93=_0xeb3b93||0x1f4;return function(_0x19f0ad){logger[_0x9f3b('0x2a')](_0x19f0ad['stack']);if(_0x19f0ad[_0x9f3b('0x2b')]){delete _0x19f0ad[_0x9f3b('0x2b')];}_0x4a4658[_0x9f3b('0x1a')](_0xeb3b93)[_0x9f3b('0x2c')](_0x19f0ad);};}exports[_0x9f3b('0x2d')]=function(_0x2ef7d3,_0x364445){var _0x5880f1={},_0x87cf5d={},_0x578160={'count':0x0,'rows':[]};var _0x2e5572=_[_0x9f3b('0x2e')](db['ChatGroup'][_0x9f3b('0x2f')],function(_0x13c14f){return{'name':_0x13c14f['fieldName'],'type':_0x13c14f[_0x9f3b('0x30')][_0x9f3b('0x31')]};});_0x87cf5d[_0x9f3b('0x32')]=_[_0x9f3b('0x2e')](_0x2e5572,'name');_0x87cf5d[_0x9f3b('0x33')]=_[_0x9f3b('0x34')](_0x2ef7d3[_0x9f3b('0x33')]);_0x87cf5d[_0x9f3b('0x35')]=_[_0x9f3b('0x36')](_0x87cf5d[_0x9f3b('0x32')],_0x87cf5d['query']);_0x5880f1[_0x9f3b('0x37')]=_[_0x9f3b('0x36')](_0x87cf5d[_0x9f3b('0x32')],qs['fields'](_0x2ef7d3[_0x9f3b('0x33')][_0x9f3b('0x38')]));_0x5880f1[_0x9f3b('0x37')]=_0x5880f1[_0x9f3b('0x37')][_0x9f3b('0x39')]?_0x5880f1[_0x9f3b('0x37')]:_0x87cf5d[_0x9f3b('0x32')];if(!_0x2ef7d3[_0x9f3b('0x33')][_0x9f3b('0x3a')](_0x9f3b('0x3b'))){_0x5880f1[_0x9f3b('0x20')]=qs[_0x9f3b('0x20')](_0x2ef7d3[_0x9f3b('0x33')][_0x9f3b('0x20')]);_0x5880f1[_0x9f3b('0x1d')]=qs[_0x9f3b('0x1d')](_0x2ef7d3[_0x9f3b('0x33')][_0x9f3b('0x1d')]);}_0x5880f1[_0x9f3b('0x3c')]=qs[_0x9f3b('0x3d')](_0x2ef7d3[_0x9f3b('0x33')][_0x9f3b('0x3d')]);_0x5880f1[_0x9f3b('0x3e')]=qs[_0x9f3b('0x35')](_[_0x9f3b('0x3f')](_0x2ef7d3[_0x9f3b('0x33')],_0x87cf5d['filters']),_0x2e5572);if(_0x2ef7d3[_0x9f3b('0x33')]['filter']){_0x5880f1[_0x9f3b('0x3e')]=_[_0x9f3b('0x40')](_0x5880f1[_0x9f3b('0x3e')],{'$or':_[_0x9f3b('0x2e')](_0x2e5572,function(_0x4815c9){if(_0x4815c9[_0x9f3b('0x30')]!==_0x9f3b('0x41')){var _0xf109bb={};_0xf109bb[_0x4815c9['name']]={'$like':'%'+_0x2ef7d3[_0x9f3b('0x33')][_0x9f3b('0x42')]+'%'};return _0xf109bb;}})});}_0x5880f1=_[_0x9f3b('0x40')]({},_0x5880f1,_0x2ef7d3['options']);var _0x1a7d77={'where':_0x5880f1['where']};return db[_0x9f3b('0x43')]['count'](_0x1a7d77)['then'](function(_0x2351a7){_0x578160[_0x9f3b('0x1f')]=_0x2351a7;if(_0x2ef7d3[_0x9f3b('0x33')][_0x9f3b('0x44')]){_0x5880f1[_0x9f3b('0x45')]=[{'all':!![]}];}return db[_0x9f3b('0x43')][_0x9f3b('0x46')](_0x5880f1);})['then'](function(_0x198a0d){_0x578160[_0x9f3b('0x47')]=_0x198a0d;return _0x578160;})[_0x9f3b('0x27')](respondWithFilteredResult(_0x364445,_0x5880f1))[_0x9f3b('0x48')](handleError(_0x364445,null));};exports[_0x9f3b('0x49')]=function(_0x41d6dd,_0xfc97b1){var _0x2338e0={'raw':!![],'where':{'id':_0x41d6dd[_0x9f3b('0x4a')]['id']}},_0x1571cc={};_0x1571cc['model']=_['keys'](db['ChatGroup'][_0x9f3b('0x2f')]);_0x1571cc[_0x9f3b('0x33')]=_['keys'](_0x41d6dd[_0x9f3b('0x33')]);_0x1571cc[_0x9f3b('0x35')]=_[_0x9f3b('0x36')](_0x1571cc[_0x9f3b('0x32')],_0x1571cc['query']);_0x2338e0['attributes']=_[_0x9f3b('0x36')](_0x1571cc[_0x9f3b('0x32')],qs['fields'](_0x41d6dd['query']['fields']));_0x2338e0[_0x9f3b('0x37')]=_0x2338e0['attributes']['length']?_0x2338e0[_0x9f3b('0x37')]:_0x1571cc[_0x9f3b('0x32')];if(_0x41d6dd[_0x9f3b('0x33')][_0x9f3b('0x44')]){_0x2338e0[_0x9f3b('0x45')]=[{'all':!![]}];}_0x2338e0=_[_0x9f3b('0x40')]({},_0x2338e0,_0x41d6dd['options']);return db[_0x9f3b('0x43')][_0x9f3b('0x4b')](_0x2338e0)[_0x9f3b('0x27')](handleEntityNotFound(_0xfc97b1,null))[_0x9f3b('0x27')](respondWithResult(_0xfc97b1,null))[_0x9f3b('0x48')](handleError(_0xfc97b1,null));};exports[_0x9f3b('0x4c')]=function(_0x250de6,_0x18f5fa){return db[_0x9f3b('0x43')][_0x9f3b('0x4c')](_0x250de6[_0x9f3b('0x4d')],{})[_0x9f3b('0x27')](respondWithResult(_0x18f5fa,0xc9))[_0x9f3b('0x48')](handleError(_0x18f5fa,null));};exports[_0x9f3b('0x26')]=function(_0x1ab9e2,_0x42168b){if(_0x1ab9e2[_0x9f3b('0x4d')]['id']){delete _0x1ab9e2[_0x9f3b('0x4d')]['id'];}return db[_0x9f3b('0x43')][_0x9f3b('0x4b')]({'where':{'id':_0x1ab9e2[_0x9f3b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42168b,null))[_0x9f3b('0x27')](saveUpdates(_0x1ab9e2['body'],null))[_0x9f3b('0x27')](respondWithResult(_0x42168b,null))['catch'](handleError(_0x42168b,null));};exports['destroy']=function(_0x1e201d,_0x3b6cba){return db[_0x9f3b('0x43')][_0x9f3b('0x4b')]({'where':{'id':_0x1e201d[_0x9f3b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b6cba,null))[_0x9f3b('0x27')](removeEntity(_0x3b6cba,null))[_0x9f3b('0x48')](handleError(_0x3b6cba,null));};exports['describe']=function(_0x5f0760,_0x2f27c3){return db[_0x9f3b('0x43')][_0x9f3b('0x4e')]()[_0x9f3b('0x27')](respondWithResult(_0x2f27c3,null))[_0x9f3b('0x48')](handleError(_0x2f27c3,null));};exports['getUnread']=function(_0x1bef9a,_0x592642,_0x4a7e29){return db[_0x9f3b('0x4f')][_0x9f3b('0x1f')]({'where':{'ChatGroupId':_0x1bef9a[_0x9f3b('0x4a')]['id'],'ToId':_0x1bef9a[_0x9f3b('0x50')]['id'],'read':![]}})[_0x9f3b('0x27')](function(_0x2ac5fe){return{'id':_['toInteger'](_0x1bef9a['params']['id']),'count':_0x2ac5fe};})['then'](respondWithResult(_0x592642,null))['catch'](handleError(_0x592642,null));};exports[_0x9f3b('0x51')]=function(_0x2af7c8,_0x51a4c4,_0x3514ac){return db['ChatGroup'][_0x9f3b('0x4b')]({'where':{'id':_0x2af7c8[_0x9f3b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x51a4c4,null))[_0x9f3b('0x27')](function(_0x5722a3){if(_0x5722a3){return _0x5722a3[_0x9f3b('0x51')](_0x2af7c8[_0x9f3b('0x4d')][_0x9f3b('0x52')],_['omit'](_0x2af7c8[_0x9f3b('0x4d')],[_0x9f3b('0x52'),'id'])||{});}})[_0x9f3b('0x27')](respondWithResult(_0x51a4c4,null))['catch'](handleError(_0x51a4c4,null));};exports[_0x9f3b('0x53')]=function(_0xbaf498,_0x23f54b,_0x5a4c75){var _0xc6cb63={};var _0x446fec={};var _0x70a3d8;var _0x3e5ff9;return db[_0x9f3b('0x43')][_0x9f3b('0x54')]({'where':{'id':_0xbaf498[_0x9f3b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x23f54b,null))['then'](function(_0x365aee){if(_0x365aee){_0x70a3d8=_0x365aee;_0x446fec[_0x9f3b('0x32')]=_[_0x9f3b('0x34')](db[_0x9f3b('0x55')][_0x9f3b('0x2f')]);_0x446fec[_0x9f3b('0x33')]=_['keys'](_0xbaf498[_0x9f3b('0x33')]);_0x446fec[_0x9f3b('0x35')]=_['intersection'](_0x446fec[_0x9f3b('0x32')],_0x446fec[_0x9f3b('0x33')]);_0xc6cb63['attributes']=_[_0x9f3b('0x36')](_0x446fec[_0x9f3b('0x32')],qs['fields'](_0xbaf498[_0x9f3b('0x33')]['fields']));_0xc6cb63[_0x9f3b('0x37')]=_0xc6cb63['attributes'][_0x9f3b('0x39')]?_0xc6cb63[_0x9f3b('0x37')]:_0x446fec[_0x9f3b('0x32')];_0xc6cb63[_0x9f3b('0x3c')]=qs[_0x9f3b('0x3d')](_0xbaf498[_0x9f3b('0x33')][_0x9f3b('0x3d')]);_0xc6cb63[_0x9f3b('0x3e')]=qs[_0x9f3b('0x35')](_[_0x9f3b('0x3f')](_0xbaf498[_0x9f3b('0x33')],_0x446fec[_0x9f3b('0x35')]));if(_0xbaf498[_0x9f3b('0x33')][_0x9f3b('0x42')]){_0xc6cb63[_0x9f3b('0x3e')]=_[_0x9f3b('0x40')](_0xc6cb63[_0x9f3b('0x3e')],{'$or':_[_0x9f3b('0x2e')](_0xc6cb63[_0x9f3b('0x37')],function(_0x5004c5){var _0x7c05eb={};_0x7c05eb[_0x5004c5]={'$like':'%'+_0xbaf498['query'][_0x9f3b('0x42')]+'%'};return _0x7c05eb;})});}_0xc6cb63=_['merge']({},_0xc6cb63,_0xbaf498['options']);return _0x70a3d8[_0x9f3b('0x53')](_0xc6cb63);}})['then'](function(_0x207f4a){if(_0x207f4a){_0x3e5ff9=_0x207f4a[_0x9f3b('0x39')];if(!_0xbaf498['query']['hasOwnProperty'](_0x9f3b('0x3b'))){_0xc6cb63[_0x9f3b('0x20')]=qs['limit'](_0xbaf498[_0x9f3b('0x33')][_0x9f3b('0x20')]);_0xc6cb63['offset']=qs[_0x9f3b('0x1d')](_0xbaf498[_0x9f3b('0x33')][_0x9f3b('0x1d')]);}return _0x70a3d8[_0x9f3b('0x53')](_0xc6cb63);}})[_0x9f3b('0x27')](function(_0x5e1d55){if(_0x5e1d55){return _0x5e1d55?{'count':_0x3e5ff9,'rows':_0x5e1d55}:null;}})['then'](respondWithResult(_0x23f54b,null))[_0x9f3b('0x48')](handleError(_0x23f54b,null));};exports[_0x9f3b('0x56')]=function(_0x271953,_0x578832,_0x3b85c7){return db[_0x9f3b('0x43')][_0x9f3b('0x4b')]({'where':{'id':_0x271953[_0x9f3b('0x4a')]['id']}})[_0x9f3b('0x27')](handleEntityNotFound(_0x578832,null))['then'](function(_0x28af91){if(_0x28af91){return _0x28af91['removeMembers'](_0x271953[_0x9f3b('0x33')][_0x9f3b('0x52')]);}})[_0x9f3b('0x27')](respondWithStatusCode(_0x578832,null))[_0x9f3b('0x48')](handleError(_0x578832,null));};exports[_0x9f3b('0x57')]=function(_0x109cb8,_0xb1c947,_0x4d992d){if(_0x109cb8[_0x9f3b('0x4d')]['id']){delete _0x109cb8['body']['id'];}return db['ChatGroup'][_0x9f3b('0x4b')]({'where':{'id':_0x109cb8[_0x9f3b('0x4a')]['id']}})[_0x9f3b('0x27')](handleEntityNotFound(_0xb1c947,null))[_0x9f3b('0x27')](function(_0x383e60){if(_0x383e60){_0x109cb8[_0x9f3b('0x4d')][_0x9f3b('0x58')]=_0x383e60['id'];return db[_0x9f3b('0x4f')][_0x9f3b('0x4c')](_0x109cb8[_0x9f3b('0x4d')]);}})['then'](respondWithResult(_0xb1c947,null))['catch'](handleError(_0xb1c947,null));};exports[_0x9f3b('0x59')]=function(_0x204bdc,_0x39061a,_0x16c41e){var _0x41377e={};var _0x4c0fdd={};var _0x51b94c;var _0x18d719;return db[_0x9f3b('0x43')][_0x9f3b('0x54')]({'where':{'id':_0x204bdc['params']['id']}})[_0x9f3b('0x27')](handleEntityNotFound(_0x39061a,null))['then'](function(_0x3eb22b){if(_0x3eb22b){_0x51b94c=_0x3eb22b;_0x4c0fdd[_0x9f3b('0x32')]=_[_0x9f3b('0x34')](db[_0x9f3b('0x4f')]['rawAttributes']);_0x4c0fdd[_0x9f3b('0x33')]=_['keys'](_0x204bdc[_0x9f3b('0x33')]);_0x4c0fdd[_0x9f3b('0x35')]=_[_0x9f3b('0x36')](_0x4c0fdd[_0x9f3b('0x32')],_0x4c0fdd[_0x9f3b('0x33')]);_0x41377e[_0x9f3b('0x37')]=_[_0x9f3b('0x36')](_0x4c0fdd[_0x9f3b('0x32')],qs[_0x9f3b('0x38')](_0x204bdc[_0x9f3b('0x33')][_0x9f3b('0x38')]));_0x41377e[_0x9f3b('0x37')]=_0x41377e[_0x9f3b('0x37')][_0x9f3b('0x39')]?_0x41377e[_0x9f3b('0x37')]:_0x4c0fdd[_0x9f3b('0x32')];_0x41377e['order']=qs[_0x9f3b('0x3d')](_0x204bdc['query'][_0x9f3b('0x3d')]);_0x41377e['where']=qs['filters'](_[_0x9f3b('0x3f')](_0x204bdc['query'],_0x4c0fdd[_0x9f3b('0x35')]));if(_0x204bdc['query'][_0x9f3b('0x42')]){_0x41377e[_0x9f3b('0x3e')]=_[_0x9f3b('0x40')](_0x41377e['where'],{'$or':_[_0x9f3b('0x2e')](_0x41377e[_0x9f3b('0x37')],function(_0x5b505a){var _0xf67e3={};_0xf67e3[_0x5b505a]={'$like':'%'+_0x204bdc[_0x9f3b('0x33')][_0x9f3b('0x42')]+'%'};return _0xf67e3;})});}if(_0x204bdc[_0x9f3b('0x33')][_0x9f3b('0x5a')]){var _0x3d35b1=_0x204bdc[_0x9f3b('0x33')][_0x9f3b('0x5a')][_0x9f3b('0x5b')](',');var _0x10d989={};_0x10d989[_0x3d35b1[0x0]]={'$gte':moment(_0x3d35b1[0x1])[_0x9f3b('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x41377e[_0x9f3b('0x3e')]=_['merge'](_0x41377e[_0x9f3b('0x3e')],_0x10d989);}_0x41377e=_[_0x9f3b('0x40')]({},_0x41377e,_0x204bdc[_0x9f3b('0x5d')]);return _0x51b94c[_0x9f3b('0x59')](_0x41377e);}})[_0x9f3b('0x27')](function(_0x3ecfa1){if(_0x3ecfa1){_0x18d719=_0x3ecfa1[_0x9f3b('0x39')];if(!_0x204bdc[_0x9f3b('0x33')][_0x9f3b('0x3a')](_0x9f3b('0x3b'))){_0x41377e[_0x9f3b('0x20')]=qs[_0x9f3b('0x20')](_0x204bdc['query']['limit']);_0x41377e[_0x9f3b('0x1d')]=qs['offset'](_0x204bdc[_0x9f3b('0x33')][_0x9f3b('0x1d')]);}return _0x51b94c[_0x9f3b('0x59')](_0x41377e);}})['then'](function(_0x4bad41){if(_0x4bad41){return _0x4bad41?{'count':_0x18d719,'rows':_0x4bad41}:null;}})['then'](respondWithResult(_0x39061a,null))[_0x9f3b('0x48')](handleError(_0x39061a,null));};
\ No newline at end of file
+var _0xb982=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','ChatGroup','findAll','rows','catch','show','length','include','create','body','find','params','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','pick','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xb982,0x1d3));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x2b98('0x0'));var rimraf=require(_0x2b98('0x1'));var zipdir=require(_0x2b98('0x2'));var jsonpatch=require(_0x2b98('0x3'));var rp=require(_0x2b98('0x4'));var moment=require(_0x2b98('0x5'));var BPromise=require(_0x2b98('0x6'));var Mustache=require(_0x2b98('0x7'));var util=require(_0x2b98('0x8'));var path=require('path');var sox=require(_0x2b98('0x9'));var csv=require(_0x2b98('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b98('0xb'));var _=require('lodash');var squel=require(_0x2b98('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2b98('0xd'));var Papa=require(_0x2b98('0xe'));var Redis=require(_0x2b98('0xf'));var authService=require(_0x2b98('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b98('0x11'));var logger=require(_0x2b98('0x12'))(_0x2b98('0x13'));var utils=require('../../config/utils');var config=require(_0x2b98('0x14'));var licenseUtil=require(_0x2b98('0x15'));var db=require(_0x2b98('0x16'))['db'];config[_0x2b98('0x17')]=_[_0x2b98('0x18')](config[_0x2b98('0x17')],{'host':_0x2b98('0x19'),'port':0x18eb});var socket=require(_0x2b98('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x2b98('0x1b')](socket);function respondWithStatusCode(_0x1534a6,_0x41f740){_0x41f740=_0x41f740||0xcc;return function(_0x58189a){if(_0x58189a){return _0x1534a6[_0x2b98('0x1c')](_0x41f740);}return _0x1534a6['status'](_0x41f740)[_0x2b98('0x1d')]();};}function respondWithResult(_0x592457,_0x36521f){_0x36521f=_0x36521f||0xc8;return function(_0x4e09e7){if(_0x4e09e7){return _0x592457[_0x2b98('0x1e')](_0x36521f)[_0x2b98('0x1f')](_0x4e09e7);}};}function respondWithFilteredResult(_0x580fff,_0x286e22){return function(_0x289c3a){if(_0x289c3a){var _0x1910eb=typeof _0x286e22[_0x2b98('0x20')]===_0x2b98('0x21')&&typeof _0x286e22['limit']==='undefined';var _0x46f101=_0x289c3a[_0x2b98('0x22')];var _0x685ea7=_0x1910eb?0x0:_0x286e22[_0x2b98('0x20')];var _0x3876bb=_0x1910eb?_0x289c3a[_0x2b98('0x22')]:_0x286e22[_0x2b98('0x20')]+_0x286e22[_0x2b98('0x23')];var _0x72a6ba;if(_0x3876bb>=_0x46f101){_0x3876bb=_0x46f101;_0x72a6ba=0xc8;}else{_0x72a6ba=0xce;}_0x580fff[_0x2b98('0x1e')](_0x72a6ba);return _0x580fff[_0x2b98('0x24')]('Content-Range',_0x685ea7+'-'+_0x3876bb+'/'+_0x46f101)['json'](_0x289c3a);}return null;};}function patchUpdates(_0x4d3e9b){return function(_0x3f2446){try{jsonpatch[_0x2b98('0x25')](_0x3f2446,_0x4d3e9b,!![]);}catch(_0x5d08a5){return BPromise[_0x2b98('0x26')](_0x5d08a5);}return _0x3f2446['save']();};}function saveUpdates(_0x4cab34,_0x457c37){return function(_0x414627){if(_0x414627){return _0x414627[_0x2b98('0x27')](_0x4cab34)[_0x2b98('0x28')](function(_0xcf3f7a){return _0xcf3f7a;});}return null;};}function removeEntity(_0x29339c,_0x313830){return function(_0x3f6498){if(_0x3f6498){return _0x3f6498[_0x2b98('0x29')]()[_0x2b98('0x28')](function(){_0x29339c['status'](0xcc)[_0x2b98('0x1d')]();});}};}function handleEntityNotFound(_0x4f80d9,_0x40c063){return function(_0x456a4a){if(!_0x456a4a){_0x4f80d9[_0x2b98('0x1c')](0x194);}return _0x456a4a;};}function handleError(_0x3f4a34,_0x3ce673){_0x3ce673=_0x3ce673||0x1f4;return function(_0x587de6){logger['error'](_0x587de6[_0x2b98('0x2a')]);if(_0x587de6['name']){delete _0x587de6[_0x2b98('0x2b')];}_0x3f4a34['status'](_0x3ce673)[_0x2b98('0x2c')](_0x587de6);};}exports['index']=function(_0x1d7d76,_0x1ec185){var _0x44e747={},_0x2b04fe={},_0x256709={'count':0x0,'rows':[]};var _0x486ae0=_[_0x2b98('0x2d')](db['ChatGroup'][_0x2b98('0x2e')],function(_0x21dff4){return{'name':_0x21dff4['fieldName'],'type':_0x21dff4[_0x2b98('0x2f')][_0x2b98('0x30')]};});_0x2b04fe[_0x2b98('0x31')]=_[_0x2b98('0x2d')](_0x486ae0,_0x2b98('0x2b'));_0x2b04fe[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x1d7d76[_0x2b98('0x32')]);_0x2b04fe[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0x2b04fe[_0x2b98('0x31')],_0x2b04fe[_0x2b98('0x32')]);_0x44e747[_0x2b98('0x36')]=_['intersection'](_0x2b04fe[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x37')]));_0x44e747['attributes']=_0x44e747[_0x2b98('0x36')]['length']?_0x44e747[_0x2b98('0x36')]:_0x2b04fe[_0x2b98('0x31')];if(!_0x1d7d76[_0x2b98('0x32')]['hasOwnProperty'](_0x2b98('0x38'))){_0x44e747[_0x2b98('0x23')]=qs[_0x2b98('0x23')](_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x23')]);_0x44e747[_0x2b98('0x20')]=qs[_0x2b98('0x20')](_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x20')]);}_0x44e747[_0x2b98('0x39')]=qs['sort'](_0x1d7d76['query'][_0x2b98('0x3a')]);_0x44e747[_0x2b98('0x3b')]=qs['filters'](_['pick'](_0x1d7d76[_0x2b98('0x32')],_0x2b04fe['filters']),_0x486ae0);if(_0x1d7d76[_0x2b98('0x32')]['filter']){_0x44e747[_0x2b98('0x3b')]=_['merge'](_0x44e747['where'],{'$or':_[_0x2b98('0x2d')](_0x486ae0,function(_0x4eb80c){if(_0x4eb80c[_0x2b98('0x2f')]!==_0x2b98('0x3c')){var _0x3f68ae={};_0x3f68ae[_0x4eb80c['name']]={'$like':'%'+_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x3d')]+'%'};return _0x3f68ae;}})});}_0x44e747=_[_0x2b98('0x3e')]({},_0x44e747,_0x1d7d76[_0x2b98('0x3f')]);var _0x768433={'where':_0x44e747[_0x2b98('0x3b')]};return db['ChatGroup']['count'](_0x768433)[_0x2b98('0x28')](function(_0x4324d1){_0x256709['count']=_0x4324d1;if(_0x1d7d76[_0x2b98('0x32')][_0x2b98('0x40')]){_0x44e747['include']=[{'all':!![]}];}return db[_0x2b98('0x41')][_0x2b98('0x42')](_0x44e747);})['then'](function(_0x3f2306){_0x256709[_0x2b98('0x43')]=_0x3f2306;return _0x256709;})[_0x2b98('0x28')](respondWithFilteredResult(_0x1ec185,_0x44e747))[_0x2b98('0x44')](handleError(_0x1ec185,null));};exports[_0x2b98('0x45')]=function(_0x55d9e8,_0x5cc2db){var _0x3dbdaf={'raw':!![],'where':{'id':_0x55d9e8['params']['id']}},_0xe7685d={};_0xe7685d[_0x2b98('0x31')]=_[_0x2b98('0x33')](db[_0x2b98('0x41')][_0x2b98('0x2e')]);_0xe7685d[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x55d9e8[_0x2b98('0x32')]);_0xe7685d[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0xe7685d[_0x2b98('0x31')],_0xe7685d['query']);_0x3dbdaf[_0x2b98('0x36')]=_[_0x2b98('0x35')](_0xe7685d[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x55d9e8[_0x2b98('0x32')][_0x2b98('0x37')]));_0x3dbdaf[_0x2b98('0x36')]=_0x3dbdaf['attributes'][_0x2b98('0x46')]?_0x3dbdaf[_0x2b98('0x36')]:_0xe7685d[_0x2b98('0x31')];if(_0x55d9e8[_0x2b98('0x32')][_0x2b98('0x40')]){_0x3dbdaf[_0x2b98('0x47')]=[{'all':!![]}];}_0x3dbdaf=_[_0x2b98('0x3e')]({},_0x3dbdaf,_0x55d9e8[_0x2b98('0x3f')]);return db[_0x2b98('0x41')]['find'](_0x3dbdaf)[_0x2b98('0x28')](handleEntityNotFound(_0x5cc2db,null))[_0x2b98('0x28')](respondWithResult(_0x5cc2db,null))[_0x2b98('0x44')](handleError(_0x5cc2db,null));};exports['create']=function(_0x53e6dc,_0x3fdcca){return db[_0x2b98('0x41')][_0x2b98('0x48')](_0x53e6dc[_0x2b98('0x49')],{})[_0x2b98('0x28')](respondWithResult(_0x3fdcca,0xc9))[_0x2b98('0x44')](handleError(_0x3fdcca,null));};exports['update']=function(_0x55bd9b,_0x3536ce){if(_0x55bd9b[_0x2b98('0x49')]['id']){delete _0x55bd9b[_0x2b98('0x49')]['id'];}return db['ChatGroup'][_0x2b98('0x4a')]({'where':{'id':_0x55bd9b['params']['id']}})['then'](handleEntityNotFound(_0x3536ce,null))[_0x2b98('0x28')](saveUpdates(_0x55bd9b['body'],null))[_0x2b98('0x28')](respondWithResult(_0x3536ce,null))['catch'](handleError(_0x3536ce,null));};exports[_0x2b98('0x29')]=function(_0x4ec7b0,_0x1bf8ed){return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x4ec7b0[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x1bf8ed,null))['then'](removeEntity(_0x1bf8ed,null))[_0x2b98('0x44')](handleError(_0x1bf8ed,null));};exports[_0x2b98('0x4c')]=function(_0x534949,_0x35cc0f){return db[_0x2b98('0x41')][_0x2b98('0x4c')]()[_0x2b98('0x28')](respondWithResult(_0x35cc0f,null))[_0x2b98('0x44')](handleError(_0x35cc0f,null));};exports['getUnread']=function(_0x23172d,_0x413afd,_0x4970fe){return db[_0x2b98('0x4d')]['count']({'where':{'ChatGroupId':_0x23172d[_0x2b98('0x4b')]['id'],'ToId':_0x23172d[_0x2b98('0x4e')]['id'],'read':![]}})[_0x2b98('0x28')](function(_0x5da52f){return{'id':_[_0x2b98('0x4f')](_0x23172d[_0x2b98('0x4b')]['id']),'count':_0x5da52f};})[_0x2b98('0x28')](respondWithResult(_0x413afd,null))[_0x2b98('0x44')](handleError(_0x413afd,null));};exports[_0x2b98('0x50')]=function(_0x1846e6,_0x2e13e1,_0x37d527){return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x1846e6[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x2e13e1,null))[_0x2b98('0x28')](function(_0x3a3bb8){if(_0x3a3bb8){return _0x3a3bb8[_0x2b98('0x50')](_0x1846e6['body'][_0x2b98('0x51')],_[_0x2b98('0x52')](_0x1846e6[_0x2b98('0x49')],[_0x2b98('0x51'),'id'])||{});}})['then'](respondWithResult(_0x2e13e1,null))[_0x2b98('0x44')](handleError(_0x2e13e1,null));};exports['getMembers']=function(_0x396153,_0x4e4c32,_0x20640a){var _0x13ec57={};var _0x5617d4={};var _0x38ed34;var _0xe0e0cd;return db[_0x2b98('0x41')][_0x2b98('0x53')]({'where':{'id':_0x396153[_0x2b98('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e4c32,null))[_0x2b98('0x28')](function(_0x4f255d){if(_0x4f255d){_0x38ed34=_0x4f255d;_0x5617d4[_0x2b98('0x31')]=_[_0x2b98('0x33')](db[_0x2b98('0x54')][_0x2b98('0x2e')]);_0x5617d4[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x396153['query']);_0x5617d4[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0x5617d4[_0x2b98('0x31')],_0x5617d4[_0x2b98('0x32')]);_0x13ec57[_0x2b98('0x36')]=_['intersection'](_0x5617d4[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x396153[_0x2b98('0x32')]['fields']));_0x13ec57[_0x2b98('0x36')]=_0x13ec57[_0x2b98('0x36')]['length']?_0x13ec57[_0x2b98('0x36')]:_0x5617d4[_0x2b98('0x31')];_0x13ec57[_0x2b98('0x39')]=qs[_0x2b98('0x3a')](_0x396153[_0x2b98('0x32')][_0x2b98('0x3a')]);_0x13ec57['where']=qs['filters'](_[_0x2b98('0x55')](_0x396153['query'],_0x5617d4[_0x2b98('0x34')]));if(_0x396153['query']['filter']){_0x13ec57['where']=_[_0x2b98('0x3e')](_0x13ec57[_0x2b98('0x3b')],{'$or':_[_0x2b98('0x2d')](_0x13ec57[_0x2b98('0x36')],function(_0x509f3e){var _0x4c9446={};_0x4c9446[_0x509f3e]={'$like':'%'+_0x396153[_0x2b98('0x32')]['filter']+'%'};return _0x4c9446;})});}_0x13ec57=_['merge']({},_0x13ec57,_0x396153[_0x2b98('0x3f')]);return _0x38ed34[_0x2b98('0x56')](_0x13ec57);}})[_0x2b98('0x28')](function(_0x24890f){if(_0x24890f){_0xe0e0cd=_0x24890f[_0x2b98('0x46')];if(!_0x396153[_0x2b98('0x32')][_0x2b98('0x57')](_0x2b98('0x38'))){_0x13ec57[_0x2b98('0x23')]=qs[_0x2b98('0x23')](_0x396153['query']['limit']);_0x13ec57[_0x2b98('0x20')]=qs[_0x2b98('0x20')](_0x396153['query']['offset']);}return _0x38ed34[_0x2b98('0x56')](_0x13ec57);}})[_0x2b98('0x28')](function(_0x1ff8d6){if(_0x1ff8d6){return _0x1ff8d6?{'count':_0xe0e0cd,'rows':_0x1ff8d6}:null;}})[_0x2b98('0x28')](respondWithResult(_0x4e4c32,null))[_0x2b98('0x44')](handleError(_0x4e4c32,null));};exports[_0x2b98('0x58')]=function(_0x5554dd,_0x4b227a,_0x2b4ee9){return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x5554dd[_0x2b98('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4b227a,null))[_0x2b98('0x28')](function(_0x5b6026){if(_0x5b6026){return _0x5b6026['removeMembers'](_0x5554dd[_0x2b98('0x32')]['ids']);}})['then'](respondWithStatusCode(_0x4b227a,null))[_0x2b98('0x44')](handleError(_0x4b227a,null));};exports[_0x2b98('0x59')]=function(_0x139ed6,_0x6be0ad,_0xd91ee){if(_0x139ed6[_0x2b98('0x49')]['id']){delete _0x139ed6[_0x2b98('0x49')]['id'];}return db[_0x2b98('0x41')][_0x2b98('0x4a')]({'where':{'id':_0x139ed6[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x6be0ad,null))[_0x2b98('0x28')](function(_0xca3056){if(_0xca3056){_0x139ed6[_0x2b98('0x49')][_0x2b98('0x5a')]=_0xca3056['id'];return db[_0x2b98('0x4d')][_0x2b98('0x48')](_0x139ed6['body']);}})[_0x2b98('0x28')](respondWithResult(_0x6be0ad,null))[_0x2b98('0x44')](handleError(_0x6be0ad,null));};exports[_0x2b98('0x5b')]=function(_0x22279e,_0x2f028c,_0x23d160){var _0x7f3d01={};var _0x15a30d={};var _0x469a38;var _0x29f32d;return db[_0x2b98('0x41')][_0x2b98('0x53')]({'where':{'id':_0x22279e[_0x2b98('0x4b')]['id']}})[_0x2b98('0x28')](handleEntityNotFound(_0x2f028c,null))['then'](function(_0xd2d251){if(_0xd2d251){_0x469a38=_0xd2d251;_0x15a30d['model']=_['keys'](db['ChatInternalMessage'][_0x2b98('0x2e')]);_0x15a30d[_0x2b98('0x32')]=_[_0x2b98('0x33')](_0x22279e[_0x2b98('0x32')]);_0x15a30d[_0x2b98('0x34')]=_[_0x2b98('0x35')](_0x15a30d[_0x2b98('0x31')],_0x15a30d[_0x2b98('0x32')]);_0x7f3d01[_0x2b98('0x36')]=_[_0x2b98('0x35')](_0x15a30d[_0x2b98('0x31')],qs[_0x2b98('0x37')](_0x22279e[_0x2b98('0x32')][_0x2b98('0x37')]));_0x7f3d01[_0x2b98('0x36')]=_0x7f3d01[_0x2b98('0x36')][_0x2b98('0x46')]?_0x7f3d01[_0x2b98('0x36')]:_0x15a30d[_0x2b98('0x31')];_0x7f3d01[_0x2b98('0x39')]=qs[_0x2b98('0x3a')](_0x22279e[_0x2b98('0x32')][_0x2b98('0x3a')]);_0x7f3d01[_0x2b98('0x3b')]=qs[_0x2b98('0x34')](_[_0x2b98('0x55')](_0x22279e[_0x2b98('0x32')],_0x15a30d['filters']));if(_0x22279e[_0x2b98('0x32')][_0x2b98('0x3d')]){_0x7f3d01[_0x2b98('0x3b')]=_[_0x2b98('0x3e')](_0x7f3d01['where'],{'$or':_[_0x2b98('0x2d')](_0x7f3d01[_0x2b98('0x36')],function(_0x218d80){var _0x2da025={};_0x2da025[_0x218d80]={'$like':'%'+_0x22279e[_0x2b98('0x32')][_0x2b98('0x3d')]+'%'};return _0x2da025;})});}if(_0x22279e[_0x2b98('0x32')]['$gte']){var _0x4197bd=_0x22279e[_0x2b98('0x32')][_0x2b98('0x5c')][_0x2b98('0x5d')](',');var _0xe45294={};_0xe45294[_0x4197bd[0x0]]={'$gte':moment(_0x4197bd[0x1])[_0x2b98('0x5e')](_0x2b98('0x5f'))};_0x7f3d01[_0x2b98('0x3b')]=_[_0x2b98('0x3e')](_0x7f3d01[_0x2b98('0x3b')],_0xe45294);}_0x7f3d01=_[_0x2b98('0x3e')]({},_0x7f3d01,_0x22279e[_0x2b98('0x3f')]);return _0x469a38[_0x2b98('0x5b')](_0x7f3d01);}})['then'](function(_0x32d91d){if(_0x32d91d){_0x29f32d=_0x32d91d['length'];if(!_0x22279e[_0x2b98('0x32')]['hasOwnProperty'](_0x2b98('0x38'))){_0x7f3d01[_0x2b98('0x23')]=qs['limit'](_0x22279e[_0x2b98('0x32')][_0x2b98('0x23')]);_0x7f3d01[_0x2b98('0x20')]=qs['offset'](_0x22279e[_0x2b98('0x32')][_0x2b98('0x20')]);}return _0x469a38[_0x2b98('0x5b')](_0x7f3d01);}})['then'](function(_0x2114bd){if(_0x2114bd){return _0x2114bd?{'count':_0x29f32d,'rows':_0x2114bd}:null;}})[_0x2b98('0x28')](respondWithResult(_0x2f028c,null))[_0x2b98('0x44')](handleError(_0x2f028c,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 7f4a13e..e544872 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 _0xbc6c=['update','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x2bebb2,_0x321313){var _0x277503=function(_0x15c37e){while(--_0x15c37e){_0x2bebb2['push'](_0x2bebb2['shift']());}};_0x277503(++_0x321313);}(_0xbc6c,0x101));var _0xcbc6=function(_0x319619,_0x58c07a){_0x319619=_0x319619-0x0;var _0x55cb02=_0xbc6c[_0x319619];return _0x55cb02;};'use strict';var EventEmitter=require(_0xcbc6('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcbc6('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcbc6('0x2')](0x0);var events={'afterCreate':_0xcbc6('0x3'),'afterUpdate':_0xcbc6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x51a997){return function(_0x2ab1ac,_0x15cead,_0x1a3bfb){ChatGroupEvents[_0xcbc6('0x5')](_0x51a997+':'+_0x2ab1ac['id'],_0x2ab1ac);ChatGroupEvents['emit'](_0x51a997,_0x2ab1ac);_0x1a3bfb(null);};}for(var e in events){if(events[_0xcbc6('0x6')](e)){var event=events[e];ChatGroup[_0xcbc6('0x7')](e,emitEvent(event));}}module[_0xcbc6('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x4888=['emit','hasOwnProperty','hook','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x41013b,_0x428de5){var _0x3f9601=function(_0x8587d3){while(--_0x8587d3){_0x41013b['push'](_0x41013b['shift']());}};_0x3f9601(++_0x428de5);}(_0x4888,0x198));var _0x8488=function(_0x5350ec,_0x316fd1){_0x5350ec=_0x5350ec-0x0;var _0x47da97=_0x4888[_0x5350ec];return _0x47da97;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8488('0x2')](0x0);var events={'afterCreate':_0x8488('0x3'),'afterUpdate':_0x8488('0x4'),'afterDestroy':_0x8488('0x5')};function emitEvent(_0x19e51d){return function(_0x571e4b,_0x267093,_0xf45c3f){ChatGroupEvents[_0x8488('0x6')](_0x19e51d+':'+_0x571e4b['id'],_0x571e4b);ChatGroupEvents[_0x8488('0x6')](_0x19e51d,_0x571e4b);_0xf45c3f(null);};}for(var e in events){if(events[_0x8488('0x7')](e)){var event=events[e];ChatGroup[_0x8488('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 65013e3..f486a26 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 _0xb56b=['./chatGroup.attributes','exports','chat_groups','lodash','util','moment','bluebird','request-promise','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb56b,0x159));var _0xbb56=function(_0x3cc8b4,_0x33bc7d){_0x3cc8b4=_0x3cc8b4-0x0;var _0x20ff15=_0xb56b[_0x3cc8b4];return _0x20ff15;};'use strict';var _=require(_0xbb56('0x0'));var util=require(_0xbb56('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbb56('0x2'));var BPromise=require(_0xbb56('0x3'));var rp=require(_0xbb56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbb56('0x5'));var attributes=require(_0xbb56('0x6'));module[_0xbb56('0x7')]=function(_0x5b41ba,_0x30260d){return _0x5b41ba['define']('ChatGroup',attributes,{'tableName':_0xbb56('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x26f6=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x5dee43,_0x35aa9b){var _0x3bcfb0=function(_0x22dad2){while(--_0x22dad2){_0x5dee43['push'](_0x5dee43['shift']());}};_0x3bcfb0(++_0x35aa9b);}(_0x26f6,0xfd));var _0x626f=function(_0x4897ae,_0x574381){_0x4897ae=_0x4897ae-0x0;var _0x8f8f7c=_0x26f6[_0x4897ae];return _0x8f8f7c;};'use strict';var _=require(_0x626f('0x0'));var util=require(_0x626f('0x1'));var logger=require(_0x626f('0x2'))('api');var moment=require(_0x626f('0x3'));var BPromise=require(_0x626f('0x4'));var rp=require(_0x626f('0x5'));var fs=require('fs');var path=require(_0x626f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x626f('0x7'));module[_0x626f('0x8')]=function(_0x35bf4d,_0x581fee){return _0x35bf4d[_0x626f('0x9')](_0x626f('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 5a92440..aaa3c5b 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 _0x4b47=['then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','request'];(function(_0x826fd8,_0x3f4104){var _0x2b5e49=function(_0x11e1d9){while(--_0x11e1d9){_0x826fd8['push'](_0x826fd8['shift']());}};_0x2b5e49(++_0x3f4104);}(_0x4b47,0x1b4));var _0x74b4=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x4b47[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x74b4('0x0'));var util=require('util');var moment=require(_0x74b4('0x1'));var BPromise=require(_0x74b4('0x2'));var rs=require(_0x74b4('0x3'));var fs=require('fs');var Redis=require(_0x74b4('0x4'));var db=require(_0x74b4('0x5'))['db'];var utils=require(_0x74b4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x74b4('0x7'));var jayson=require(_0x74b4('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x74b4('0x9')](config[_0x74b4('0xa')],{'host':_0x74b4('0xb'),'port':0x18eb});var socket=require(_0x74b4('0xc'))(new Redis(config[_0x74b4('0xa')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x2f4acd,_0x83da1b,_0x4f1886){return new BPromise(function(_0x513edb,_0x52c215){return client[_0x74b4('0xd')](_0x2f4acd,_0x4f1886)[_0x74b4('0xe')](function(_0x1e84a3){logger[_0x74b4('0xf')]('ChatGroup,\x20%s,\x20%s',_0x83da1b,_0x74b4('0x10'));logger['debug'](_0x74b4('0x11'),_0x83da1b,'request\x20sent',JSON[_0x74b4('0x12')](_0x1e84a3));if(_0x1e84a3[_0x74b4('0x13')]){if(_0x1e84a3[_0x74b4('0x13')][_0x74b4('0x14')]===0x1f4){logger['error'](_0x74b4('0x15'),_0x83da1b,_0x1e84a3[_0x74b4('0x13')]['message']);return _0x52c215(_0x1e84a3[_0x74b4('0x13')][_0x74b4('0x16')]);}logger[_0x74b4('0x13')](_0x74b4('0x15'),_0x83da1b,_0x1e84a3['error'][_0x74b4('0x16')]);return _0x513edb(_0x1e84a3[_0x74b4('0x13')]['message']);}else{logger['info'](_0x74b4('0x15'),_0x83da1b,_0x74b4('0x10'));_0x513edb(_0x1e84a3[_0x74b4('0x17')][_0x74b4('0x16')]);}})[_0x74b4('0x18')](function(_0x315a51){logger[_0x74b4('0x13')](_0x74b4('0x15'),_0x83da1b,_0x315a51);_0x52c215(_0x315a51);});});}
\ No newline at end of file
+var _0x1353=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x578432,_0x3977e0){var _0x2ee8b3=function(_0x5acd9f){while(--_0x5acd9f){_0x578432['push'](_0x578432['shift']());}};_0x2ee8b3(++_0x3977e0);}(_0x1353,0xb3));var _0x3135=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x1353[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x3135('0x0'));var util=require(_0x3135('0x1'));var moment=require(_0x3135('0x2'));var BPromise=require(_0x3135('0x3'));var rs=require(_0x3135('0x4'));var fs=require('fs');var Redis=require(_0x3135('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3135('0x6'));var logger=require(_0x3135('0x7'))(_0x3135('0x8'));var config=require(_0x3135('0x9'));var jayson=require(_0x3135('0xa'));var client=jayson['client'][_0x3135('0xb')]({'port':0x232a});config[_0x3135('0xc')]=_['defaults'](config[_0x3135('0xc')],{'host':_0x3135('0xd'),'port':0x18eb});var socket=require(_0x3135('0xe'))(new Redis(config[_0x3135('0xc')]));require(_0x3135('0xf'))['register'](socket);function respondWithRpcPromise(_0xab9e19,_0x1c0a36,_0x22c939){return new BPromise(function(_0x249bf0,_0x3721de){return client['request'](_0xab9e19,_0x22c939)[_0x3135('0x10')](function(_0x499acd){logger[_0x3135('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1c0a36,_0x3135('0x12'));logger[_0x3135('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1c0a36,_0x3135('0x12'),JSON['stringify'](_0x499acd));if(_0x499acd[_0x3135('0x14')]){if(_0x499acd[_0x3135('0x14')][_0x3135('0x15')]===0x1f4){logger['error'](_0x3135('0x16'),_0x1c0a36,_0x499acd['error']['message']);return _0x3721de(_0x499acd[_0x3135('0x14')][_0x3135('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x1c0a36,_0x499acd['error'][_0x3135('0x17')]);return _0x249bf0(_0x499acd[_0x3135('0x14')][_0x3135('0x17')]);}else{logger[_0x3135('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1c0a36,_0x3135('0x12'));_0x249bf0(_0x499acd[_0x3135('0x18')][_0x3135('0x17')]);}})[_0x3135('0x19')](function(_0x67a9fb){logger[_0x3135('0x14')](_0x3135('0x16'),_0x1c0a36,_0x67a9fb);_0x3721de(_0x67a9fb);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 43075f5..122411f 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 _0xff5f=['save','update','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0xf3b362,_0x37807e){var _0x3d0192=function(_0x43e69a){while(--_0x43e69a){_0xf3b362['push'](_0xf3b362['shift']());}};_0x3d0192(++_0x37807e);}(_0xff5f,0xd8));var _0xfff5=function(_0x317d4b,_0x3d96d4){_0x317d4b=_0x317d4b-0x0;var _0x299b0b=_0xff5f[_0x317d4b];return _0x299b0b;};'use strict';var ChatGroupEvents=require(_0xfff5('0x0'));var events=[_0xfff5('0x1'),'remove',_0xfff5('0x2')];function createListener(_0x29247e,_0x4312ab){return function(_0x48136c){_0x4312ab['emit'](_0x29247e,_0x48136c);};}function removeListener(_0x34d498,_0x4e5af6){return function(){ChatGroupEvents[_0xfff5('0x3')](_0x34d498,_0x4e5af6);};}exports[_0xfff5('0x4')]=function(_0x51bd21){for(var _0x3b6ff7=0x0,_0x31b7dc=events[_0xfff5('0x5')];_0x3b6ff7<_0x31b7dc;_0x3b6ff7++){var _0x15d5d3=events[_0x3b6ff7];var _0x53f30b=createListener(_0xfff5('0x6')+_0x15d5d3,_0x51bd21);ChatGroupEvents['on'](_0x15d5d3,_0x53f30b);}};
\ No newline at end of file
+var _0x6476=['chatGroup:','save','update','emit','register','length'];(function(_0x5048f6,_0xf9eadc){var _0x4aa085=function(_0x414ecb){while(--_0x414ecb){_0x5048f6['push'](_0x5048f6['shift']());}};_0x4aa085(++_0xf9eadc);}(_0x6476,0x17b));var _0x6647=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x6476[_0x12d033];return _0x3b4e80;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x6647('0x0'),'remove',_0x6647('0x1')];function createListener(_0x2e6339,_0x4d2fe3){return function(_0x58e57e){_0x4d2fe3[_0x6647('0x2')](_0x2e6339,_0x58e57e);};}function removeListener(_0x1123e8,_0x30e24e){return function(){ChatGroupEvents['removeListener'](_0x1123e8,_0x30e24e);};}exports[_0x6647('0x3')]=function(_0x305d41){for(var _0x37a4b1=0x0,_0x554295=events[_0x6647('0x4')];_0x37a4b1<_0x554295;_0x37a4b1++){var _0x40d8fc=events[_0x37a4b1];var _0x5991df=createListener(_0x6647('0x5')+_0x40d8fc,_0x305d41);ChatGroupEvents['on'](_0x40d8fc,_0x5991df);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1a6519b..0c22aeb 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 _0x9a18=['removeMembers','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','index','get','isAuthenticated','show','/:id/unread','getUnread','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','/:id','update','delete','destroy'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x9a18,0x13a));var _0x89a1=function(_0x90c0ea,_0xfe9689){_0x90c0ea=_0x90c0ea-0x0;var _0x8bd383=_0x9a18[_0x90c0ea];return _0x8bd383;};'use strict';var multer=require(_0x89a1('0x0'));var util=require(_0x89a1('0x1'));var path=require(_0x89a1('0x2'));var timeout=require(_0x89a1('0x3'));var express=require(_0x89a1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x89a1('0x5'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x89a1('0x6')]);router[_0x89a1('0x7')]('/describe',auth[_0x89a1('0x8')](),controller['describe']);router[_0x89a1('0x7')]('/:id',auth[_0x89a1('0x8')](),controller[_0x89a1('0x9')]);router[_0x89a1('0x7')](_0x89a1('0xa'),auth[_0x89a1('0x8')](),controller[_0x89a1('0xb')]);router[_0x89a1('0x7')]('/:id/members',auth[_0x89a1('0x8')](),controller['getMembers']);router[_0x89a1('0x7')](_0x89a1('0xc'),auth[_0x89a1('0x8')](),controller[_0x89a1('0xd')]);router[_0x89a1('0xe')]('/',auth[_0x89a1('0x8')](),controller[_0x89a1('0xf')]);router['post'](_0x89a1('0x10'),auth['isAuthenticated'](),controller[_0x89a1('0x11')]);router[_0x89a1('0xe')](_0x89a1('0xc'),auth[_0x89a1('0x8')](),controller[_0x89a1('0x12')]);router[_0x89a1('0x13')](_0x89a1('0x14'),auth[_0x89a1('0x8')](),controller[_0x89a1('0x15')]);router[_0x89a1('0x16')]('/:id',auth[_0x89a1('0x8')](),controller[_0x89a1('0x17')]);router[_0x89a1('0x16')](_0x89a1('0x10'),auth[_0x89a1('0x8')](),controller[_0x89a1('0x18')]);module[_0x89a1('0x19')]=router;
\ No newline at end of file
+var _0xcdde=['./chatGroup.controller','get','isAuthenticated','show','getUnread','/:id/members','/:id/messages','post','addMessage','/:id','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a5259,_0x34c361){var _0x402adc=function(_0x3ebd28){while(--_0x3ebd28){_0x3a5259['push'](_0x3a5259['shift']());}};_0x402adc(++_0x34c361);}(_0xcdde,0x1a7));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xecdd('0x0'));var util=require(_0xecdd('0x1'));var path=require(_0xecdd('0x2'));var timeout=require(_0xecdd('0x3'));var express=require(_0xecdd('0x4'));var router=express['Router']();var fs_extra=require(_0xecdd('0x5'));var auth=require(_0xecdd('0x6'));var interaction=require(_0xecdd('0x7'));var config=require(_0xecdd('0x8'));var controller=require(_0xecdd('0x9'));router[_0xecdd('0xa')]('/',auth[_0xecdd('0xb')](),controller['index']);router[_0xecdd('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xecdd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xecdd('0xc')]);router['get']('/:id/unread',auth[_0xecdd('0xb')](),controller[_0xecdd('0xd')]);router['get'](_0xecdd('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xecdd('0xa')](_0xecdd('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xecdd('0x10')]('/',auth[_0xecdd('0xb')](),controller['create']);router[_0xecdd('0x10')](_0xecdd('0xe'),auth[_0xecdd('0xb')](),controller['addMembers']);router['post'](_0xecdd('0xf'),auth[_0xecdd('0xb')](),controller[_0xecdd('0x11')]);router['put'](_0xecdd('0x12'),auth['isAuthenticated'](),controller[_0xecdd('0x13')]);router[_0xecdd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xecdd('0x15')]);router[_0xecdd('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0xecdd('0x16')]);module[_0xecdd('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index bbff2dd..62858e2 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 _0xf632=['exports','BOOLEAN','star','TEXT','STRING','DATE','ENUM','out','INTEGER','sequelize'];(function(_0x5251fe,_0x2b3eca){var _0x280649=function(_0x1209f7){while(--_0x1209f7){_0x5251fe['push'](_0x5251fe['shift']());}};_0x280649(++_0x2b3eca);}(_0xf632,0x77));var _0x2f63=function(_0x20d448,_0x538782){_0x20d448=_0x20d448-0x0;var _0x580bdb=_0xf632[_0x20d448];return _0x580bdb;};'use strict';var Sequelize=require(_0x2f63('0x0'));module[_0x2f63('0x1')]={'closed':{'type':Sequelize[_0x2f63('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':_0x2f63('0x3')},'ratingMessage':{'type':Sequelize[_0x2f63('0x4')]},'pathTranscript':{'type':Sequelize[_0x2f63('0x4')]},'mailTranscript':{'type':Sequelize[_0x2f63('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2f63('0x6')]},'disposition':{'type':Sequelize[_0x2f63('0x5')]},'secondDisposition':{'type':Sequelize[_0x2f63('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2f63('0x5')]},'browserVersion':{'type':Sequelize[_0x2f63('0x5')]},'osName':{'type':Sequelize[_0x2f63('0x5')]},'osVersion':{'type':Sequelize[_0x2f63('0x5')]},'deviceModel':{'type':Sequelize[_0x2f63('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x2f63('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2f63('0x4')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2f63('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x2f63('0x7')]('in',_0x2f63('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2f63('0x5')]},'customerPort':{'type':Sequelize[_0x2f63('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x2f63('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2f63('0x9')]}};
\ No newline at end of file
+var _0xa9c6=['thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0xf19481,_0x175a45){var _0x32ffb9=function(_0x3a8fed){while(--_0x3a8fed){_0xf19481['push'](_0xf19481['shift']());}};_0x32ffb9(++_0x175a45);}(_0xa9c6,0x12f));var _0x6a9c=function(_0x17d5af,_0x2ef8a7){_0x17d5af=_0x17d5af-0x0;var _0x4363c8=_0xa9c6[_0x17d5af];return _0x4363c8;};'use strict';var Sequelize=require(_0x6a9c('0x0'));module['exports']={'closed':{'type':Sequelize[_0x6a9c('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6a9c('0x2')]},'ratingType':{'type':Sequelize[_0x6a9c('0x3')](_0x6a9c('0x4'),_0x6a9c('0x5')),'defaultValue':_0x6a9c('0x4')},'ratingMessage':{'type':Sequelize[_0x6a9c('0x6')]},'pathTranscript':{'type':Sequelize[_0x6a9c('0x6')]},'mailTranscript':{'type':Sequelize[_0x6a9c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6a9c('0x8')]},'disposition':{'type':Sequelize[_0x6a9c('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x6a9c('0x7')]},'osName':{'type':Sequelize[_0x6a9c('0x7')]},'osVersion':{'type':Sequelize[_0x6a9c('0x7')]},'deviceModel':{'type':Sequelize[_0x6a9c('0x7')]},'deviceVendor':{'type':Sequelize[_0x6a9c('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6a9c('0x6')]},'customerIp':{'type':Sequelize[_0x6a9c('0x7')]},'formData':{'type':Sequelize[_0x6a9c('0x6')](_0x6a9c('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x6a9c('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6a9c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6a9c('0x7')]},'customerPort':{'type':Sequelize[_0x6a9c('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x6a9c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x6a9c('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index dd3f526..70d53bd 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 _0x7f1d=['limit','set','update','stack','name','send','render','merge','body','contact','agent','interaction','index','map','ChatInteraction','fieldName','key','chat','query','user','then','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options','create','find','params','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','join','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','User','agentAlias','System','customer','%s%d','Visitor','ContactId','alias','agent_fullname','createdAt','direction','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','include','includeAgent','push','addTags','setTags','omit','Tag','unix','toString','root','server','tmp','files','attachments','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','read','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count'];(function(_0x70404,_0x507113){var _0x2da0b9=function(_0x3fa2a9){while(--_0x3fa2a9){_0x70404['push'](_0x70404['shift']());}};_0x2da0b9(++_0x507113);}(_0x7f1d,0x170));var _0xd7f1=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x7f1d[_0x47aa64];return _0x549c7a;};'use strict';var rimraf=require(_0xd7f1('0x0'));var zipdir=require(_0xd7f1('0x1'));var rp=require(_0xd7f1('0x2'));var moment=require('moment');var BPromise=require(_0xd7f1('0x3'));var Mustache=require(_0xd7f1('0x4'));var util=require('util');var path=require('path');var ejs=require(_0xd7f1('0x5'));var fs=require('fs');var _=require(_0xd7f1('0x6'));var Redis=require(_0xd7f1('0x7'));var interaction=require(_0xd7f1('0x8'));var qs=require(_0xd7f1('0x9'));var pdf=require(_0xd7f1('0xa'));var logger=require('../../config/logger')('api');var config=require(_0xd7f1('0xb'));var db=require('../../mysqldb')['db'];config[_0xd7f1('0xc')]=_[_0xd7f1('0xd')](config[_0xd7f1('0xc')],{'host':_0xd7f1('0xe'),'port':0x18eb});var socket=require(_0xd7f1('0xf'))(new Redis(config[_0xd7f1('0xc')]));require(_0xd7f1('0x10'))['register'](socket);var jayson=require(_0xd7f1('0x11'));var client=jayson[_0xd7f1('0x12')][_0xd7f1('0x13')]({'port':0x232b});var client9004=jayson[_0xd7f1('0x12')][_0xd7f1('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x37f3cc,_0x5b86ae,_0x510b27,_0x237f1f){return new BPromise(function(_0x2969af,_0x360f6a){var _0x27ed70=_0x237f1f||client;return _0x27ed70['request'](_0x37f3cc,_0x510b27)['then'](function(_0x49b590){logger['info'](_0xd7f1('0x14'),_0x5b86ae,_0xd7f1('0x15'));logger[_0xd7f1('0x16')](_0xd7f1('0x17'),_0x5b86ae,_0xd7f1('0x15'),JSON['stringify'](_0x49b590));if(_0x49b590['error']){if(_0x49b590[_0xd7f1('0x18')]['code']===0x1f4){logger[_0xd7f1('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5b86ae,_0x49b590['error'][_0xd7f1('0x19')]);return _0x360f6a(_0x49b590[_0xd7f1('0x18')][_0xd7f1('0x19')]);}logger['error'](_0xd7f1('0x14'),_0x5b86ae,_0x49b590[_0xd7f1('0x18')][_0xd7f1('0x19')]);return _0x2969af(_0x49b590[_0xd7f1('0x18')][_0xd7f1('0x19')]);}else{logger[_0xd7f1('0x1a')](_0xd7f1('0x14'),_0x5b86ae,_0xd7f1('0x15'));_0x2969af(_0x49b590[_0xd7f1('0x1b')]['message']);}})[_0xd7f1('0x1c')](function(_0x51b831){logger[_0xd7f1('0x18')](_0xd7f1('0x14'),_0x5b86ae,_0x51b831);_0x360f6a(_0x51b831);});});}function respondWithStatusCode(_0x3b3acf,_0x3cb36f){_0x3cb36f=_0x3cb36f||0xcc;return function(_0x3e0c6c){if(_0x3e0c6c){return _0x3b3acf[_0xd7f1('0x1d')](_0x3cb36f);}return _0x3b3acf[_0xd7f1('0x1e')](_0x3cb36f)[_0xd7f1('0x1f')]();};}function respondWithResult(_0x50e104,_0x193926){_0x193926=_0x193926||0xc8;return function(_0x1bb71f){if(_0x1bb71f){return _0x50e104[_0xd7f1('0x1e')](_0x193926)[_0xd7f1('0x20')](_0x1bb71f);}};}function respondWithFilteredResult(_0x8c8457,_0x459cb2){return function(_0x2bb33b){if(_0x2bb33b){var _0x5c991a=typeof _0x459cb2[_0xd7f1('0x21')]==='undefined'&&typeof _0x459cb2['limit']===_0xd7f1('0x22');var _0x3f83f1=_0x2bb33b[_0xd7f1('0x23')];var _0x3b6fde=_0x5c991a?0x0:_0x459cb2[_0xd7f1('0x21')];var _0x44adab=_0x5c991a?_0x2bb33b['count']:_0x459cb2[_0xd7f1('0x21')]+_0x459cb2[_0xd7f1('0x24')];var _0x32c142;if(_0x44adab>=_0x3f83f1){_0x44adab=_0x3f83f1;_0x32c142=0xc8;}else{_0x32c142=0xce;}_0x8c8457[_0xd7f1('0x1e')](_0x32c142);return _0x8c8457[_0xd7f1('0x25')]('Content-Range',_0x3b6fde+'-'+_0x44adab+'/'+_0x3f83f1)[_0xd7f1('0x20')](_0x2bb33b);}return null;};}function saveUpdates(_0x17d20f){return function(_0x203e18){if(_0x203e18){return _0x203e18[_0xd7f1('0x26')](_0x17d20f)['then'](function(_0x176afa){return _0x176afa;});}return null;};}function removeEntity(_0x52b714){return function(_0x51144c){if(_0x51144c){return _0x51144c['destroy']()['then'](function(){_0x52b714[_0xd7f1('0x1e')](0xcc)[_0xd7f1('0x1f')]();});}};}function handleEntityNotFound(_0x4b2765){return function(_0x45344e){if(!_0x45344e){_0x4b2765['sendStatus'](0x194);}return _0x45344e;};}function handleError(_0x563be2,_0x7eb48e){_0x7eb48e=_0x7eb48e||0x1f4;return function(_0x41be5e){logger['error'](_0x41be5e[_0xd7f1('0x27')]);if(_0x41be5e[_0xd7f1('0x28')]){delete _0x41be5e[_0xd7f1('0x28')];}_0x563be2[_0xd7f1('0x1e')](_0x7eb48e)[_0xd7f1('0x29')](_0x41be5e);};}function getMustacheRender(_0x122baf,_0x36798d){return Mustache[_0xd7f1('0x2a')](_0x122baf,_[_0xd7f1('0x2b')](_0x36798d[_0xd7f1('0x2c')],{'contact':_0x36798d[_0xd7f1('0x2d')],'message':_0x36798d['message'],'agent':_0x36798d[_0xd7f1('0x2e')],'interaction':_0x36798d[_0xd7f1('0x2f')],'account':_0x36798d['account']}))||'';}exports[_0xd7f1('0x30')]=function(_0x158fa1,_0x42071d){var _0x35d25c={};var _0x4a0aeb=_[_0xd7f1('0x31')](db[_0xd7f1('0x32')]['rawAttributes'],function(_0x3cd225){return{'name':_0x3cd225[_0xd7f1('0x33')],'type':_0x3cd225['type'][_0xd7f1('0x34')]};});_0x35d25c=qs['getOptions'](_0x4a0aeb,_0x158fa1);return interaction['findAll'](_0xd7f1('0x35'),_0x158fa1[_0xd7f1('0x36')],_0x158fa1[_0xd7f1('0x37')],_0x35d25c,_0x4a0aeb)[_0xd7f1('0x38')](respondWithFilteredResult(_0x42071d,_0x35d25c))[_0xd7f1('0x1c')](handleError(_0x42071d,null));};exports[_0xd7f1('0x39')]=function(_0x5c2dc0,_0x3cf43c){var _0x2d8f44={'raw':![],'where':{'id':_0x5c2dc0['params']['id']}},_0x54a021={};_0x54a021[_0xd7f1('0x3a')]=_[_0xd7f1('0x3b')](db[_0xd7f1('0x32')][_0xd7f1('0x3c')]);_0x54a021[_0xd7f1('0x36')]=_[_0xd7f1('0x3b')](_0x5c2dc0[_0xd7f1('0x36')]);_0x54a021[_0xd7f1('0x3d')]=_[_0xd7f1('0x3e')](_0x54a021[_0xd7f1('0x3a')],_0x54a021['query']);_0x2d8f44[_0xd7f1('0x3f')]=_[_0xd7f1('0x3e')](_0x54a021[_0xd7f1('0x3a')],qs[_0xd7f1('0x40')](_0x5c2dc0[_0xd7f1('0x36')][_0xd7f1('0x40')]));_0x2d8f44[_0xd7f1('0x3f')]=_0x2d8f44['attributes'][_0xd7f1('0x41')]?_0x2d8f44[_0xd7f1('0x3f')]:_0x54a021['model'];if(_0x5c2dc0[_0xd7f1('0x36')][_0xd7f1('0x42')]){_0x2d8f44['include']=[{'all':!![]}];}_0x2d8f44=_['merge']({},_0x2d8f44,_0x5c2dc0[_0xd7f1('0x43')]);return db['ChatInteraction']['find'](_0x2d8f44)[_0xd7f1('0x38')](handleEntityNotFound(_0x3cf43c,null))[_0xd7f1('0x38')](respondWithResult(_0x3cf43c,null))[_0xd7f1('0x1c')](handleError(_0x3cf43c,null));};exports[_0xd7f1('0x44')]=function(_0x5f0cdc,_0x1bc89d){return db['ChatInteraction'][_0xd7f1('0x44')](_0x5f0cdc[_0xd7f1('0x2c')],{})[_0xd7f1('0x38')](respondWithResult(_0x1bc89d,0xc9))['catch'](handleError(_0x1bc89d,null));};exports[_0xd7f1('0x26')]=function(_0x2acebd,_0x1bef96){if(_0x2acebd[_0xd7f1('0x2c')]['id']){delete _0x2acebd[_0xd7f1('0x2c')]['id'];}return db[_0xd7f1('0x32')][_0xd7f1('0x45')]({'where':{'id':_0x2acebd['params']['id']}})[_0xd7f1('0x38')](handleEntityNotFound(_0x1bef96,null))[_0xd7f1('0x38')](saveUpdates(_0x2acebd[_0xd7f1('0x2c')],null))[_0xd7f1('0x38')](respondWithResult(_0x1bef96,null))[_0xd7f1('0x1c')](handleError(_0x1bef96,null));};exports['destroy']=function(_0x4a2a2a,_0x52bab0){return db['ChatInteraction']['find']({'where':{'id':_0x4a2a2a[_0xd7f1('0x46')]['id']}})['then'](handleEntityNotFound(_0x52bab0,null))[_0xd7f1('0x38')](removeEntity(_0x52bab0,null))[_0xd7f1('0x1c')](handleError(_0x52bab0,null));};exports[_0xd7f1('0x47')]=function(_0x4f9552,_0x35d9f0){return db['ChatInteraction'][_0xd7f1('0x47')]()[_0xd7f1('0x38')](respondWithResult(_0x35d9f0,null))[_0xd7f1('0x1c')](handleError(_0x35d9f0,null));};exports['createVidaooSession']=function(_0x3d8da8,_0x2077f7){var _0x343e9c=_0x3d8da8[_0xd7f1('0x46')]['id'];var _0xfba2db;var _0x2d5203;var _0x24eecb;return db[_0xd7f1('0x32')][_0xd7f1('0x48')]({'where':{'id':_0x343e9c}})[_0xd7f1('0x38')](function(_0x351e91){_0xfba2db=_0x351e91;return db[_0xd7f1('0x49')]['findOne']({'where':{'id':_0x351e91[_0xd7f1('0x4a')]},'attributes':['id','vidaooApiKey',_0xd7f1('0x4b'),_0xd7f1('0x4c'),_0xd7f1('0x4d'),_0xd7f1('0x4e')],'raw':!![]});})[_0xd7f1('0x38')](function(_0x4d223f){if(_0x4d223f&&_0x4d223f[_0xd7f1('0x4f')]&&_0x4d223f[_0xd7f1('0x4b')]){_0x2d5203=_0x4d223f;var _0x42b90a={'interaction':{'id':_0x343e9c},'agent':{'id':_0x3d8da8[_0xd7f1('0x37')]['id'],'name':_0x3d8da8['user'][_0xd7f1('0x28')],'fullname':_0x3d8da8[_0xd7f1('0x37')][_0xd7f1('0x50')],'email':_0x3d8da8[_0xd7f1('0x37')][_0xd7f1('0x51')]},'contact':_0x3d8da8['body'][_0xd7f1('0x2d')],'account':_0x3d8da8[_0xd7f1('0x2c')][_0xd7f1('0x52')]};var _0x2a70a4={'rejectUnauthorized':![],'method':_0xd7f1('0x53'),'url':_0xd7f1('0x54'),'headers':{'X-APIKEY':_0x4d223f[_0xd7f1('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3d8da8[_0xd7f1('0x37')][_0xd7f1('0x51')]],'buttons':null,'topic':_0x2d5203[_0xd7f1('0x4c')],'note':_[_0xd7f1('0x55')](_0x2d5203[_0xd7f1('0x4d')])?null:getMustacheRender(_0x2d5203[_0xd7f1('0x4d')],_0x42b90a),'metadata':null},'redirect':_0xd7f1('0x56'),'json':!![]};try{if(!_[_0xd7f1('0x55')](_0x2d5203[_0xd7f1('0x4e')])){var _0x2005b9=getMustacheRender(_0x2d5203[_0xd7f1('0x4e')],_0x42b90a);var _0x8ce093=JSON[_0xd7f1('0x57')](_0x2005b9);_0x2a70a4['body'][_0xd7f1('0x58')]=_0x8ce093;}}catch(_0x5b2d44){throw new db[(_0xd7f1('0x59'))][(_0xd7f1('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2a70a4);}else{throw new db[(_0xd7f1('0x59'))]['ValidationError'](_0xd7f1('0x5b'));}})[_0xd7f1('0x38')](function(_0x26b780){_0x24eecb=_0x26b780;if(_0x24eecb['id']){var _0x168a14={'body':_0x24eecb[_0xd7f1('0x5c')],'ChatWebsiteId':_0x2d5203['id'],'ChatInteractionId':_0xfba2db['id'],'direction':_0xd7f1('0x5d'),'UserId':_0x3d8da8['user']['id']};return db[_0xd7f1('0x5e')][_0xd7f1('0x44')](_0x168a14,{});}else{throw new db[(_0xd7f1('0x59'))][(_0xd7f1('0x5a'))](_0xd7f1('0x5f'));}})['then'](function(){return _0xfba2db[_0xd7f1('0x60')]({'vidaooSessionId':_0x24eecb['id']});})['then'](respondWithResult(_0x2077f7,null))[_0xd7f1('0x1c')](handleError(_0x2077f7,null));};exports[_0xd7f1('0x61')]=function(_0x18cc90,_0x31def8){if(_0x18cc90[_0xd7f1('0x2c')]['id']){delete _0x18cc90['body']['id'];}return db[_0xd7f1('0x32')]['find']({'where':{'id':_0x18cc90[_0xd7f1('0x46')]['id']},'include':[{'model':db[_0xd7f1('0x62')],'as':_0xd7f1('0x63')}]})[_0xd7f1('0x38')](handleEntityNotFound(_0x31def8,null))[_0xd7f1('0x38')](saveUpdates(_0x18cc90['body'],null))[_0xd7f1('0x38')](respondWithResult(_0x31def8,null))[_0xd7f1('0x1c')](handleError(_0x31def8,null));};exports[_0xd7f1('0x64')]=function(_0x2a3a27,_0xd38d03){if(_0x2a3a27[_0xd7f1('0x2c')]['id']){delete _0x2a3a27[_0xd7f1('0x2c')]['id'];}return db[_0xd7f1('0x32')][_0xd7f1('0x45')]({'where':{'id':_0x2a3a27['params']['id']}})['then'](function(_0x2c9f7b){if(!_0x2c9f7b){logger[_0xd7f1('0x18')](_0xd7f1('0x65'),_0xd7f1('0x64'),0x194,_0xd7f1('0x66'));_0xd38d03[_0xd7f1('0x1d')](0x194);}else{if(_0x2c9f7b[_0xd7f1('0x67')]){throw new db[(_0xd7f1('0x59'))][(_0xd7f1('0x5a'))](_0xd7f1('0x68'));}}return _0x2c9f7b;})['then'](function(_0xda5ae0){if(_0xda5ae0){return _0xda5ae0['update']({'closed':_0x2a3a27[_0xd7f1('0x2c')][_0xd7f1('0x69')],'disposition':_0x2a3a27[_0xd7f1('0x2c')][_0xd7f1('0x6a')]})[_0xd7f1('0x38')](function(_0x1d778a){return _0x1d778a;});}})[_0xd7f1('0x38')](function(){return respondWithRpcPromise(_0xd7f1('0x6b'),_0xd7f1('0x64'),_0x2a3a27[_0xd7f1('0x2c')],client9004);})[_0xd7f1('0x38')](respondWithResult(_0xd38d03,null))['catch'](handleError(_0xd38d03,null));};exports[_0xd7f1('0x6c')]=function(_0xdba8e2,_0xb1b415){_0xdba8e2['body'][_0xd7f1('0x28')]=_0xdba8e2[_0xd7f1('0x6d')][_0xd7f1('0x6e')];_0xdba8e2[_0xd7f1('0x2c')][_0xd7f1('0x6f')]=_0xdba8e2[_0xd7f1('0x6d')][_0xd7f1('0x70')];_0xdba8e2[_0xd7f1('0x2c')]['type']=_0xdba8e2[_0xd7f1('0x6d')]['mimetype'];return db[_0xd7f1('0x71')][_0xd7f1('0x44')](_0xdba8e2[_0xd7f1('0x2c')])[_0xd7f1('0x38')](respondWithResult(_0xb1b415,0xc9))[_0xd7f1('0x1c')](handleError(_0xb1b415,null));};exports[_0xd7f1('0x72')]=function(_0x18b2e8,_0x277a4d){return db[_0xd7f1('0x32')][_0xd7f1('0x48')]({'where':{'id':_0x18b2e8[_0xd7f1('0x46')]['id']},'raw':!![]})[_0xd7f1('0x38')](handleEntityNotFound(_0x277a4d,null))['then'](function(_0x16d9df){if(_0x16d9df){if(_0x16d9df[_0xd7f1('0x69')]){return _0x277a4d['status'](0x193)[_0xd7f1('0x20')]({'status':0x193,'message':_0xd7f1('0x73')});}return db[_0xd7f1('0x71')][_0xd7f1('0x48')]({'where':{'id':_0x18b2e8[_0xd7f1('0x36')][_0xd7f1('0x74')]},'raw':!![]})['then'](handleEntityNotFound(_0x277a4d,null));}})[_0xd7f1('0x38')](function(_0x2d2a50){if(_0x2d2a50){var _0x28b3b1=_0x2d2a50['ChatOfflineMessageId']!==null;var _0x14ece6=path[_0xd7f1('0x75')](config['root'],'server/files/attachments/');if(_0x28b3b1){_0x14ece6=path['join'](_0x14ece6,_0xd7f1('0x76'));}var _0xea926c=path[_0xd7f1('0x75')](_0x14ece6,_0x2d2a50[_0xd7f1('0x6f')]);return _0x277a4d[_0xd7f1('0x77')](_0xea926c);}})[_0xd7f1('0x1c')](handleError(_0x277a4d,null));};exports[_0xd7f1('0x78')]=function(_0x8cd360,_0x465cc4){var _0x3955c0=null;var _0xbf12a4=null;var _0x32be9b=null;if(_0x8cd360[_0xd7f1('0x2c')]['id']){delete _0x8cd360['body']['id'];}if(_0x8cd360[_0xd7f1('0x2c')][_0xd7f1('0x79')]){_0x32be9b=path[_0xd7f1('0x75')](config['root'],'server/files/chat/upload/',util[_0xd7f1('0x7a')](_0xd7f1('0x7b'),Date[_0xd7f1('0x7c')]()));_0x8cd360[_0xd7f1('0x2c')][_0xd7f1('0x7d')]=_0x32be9b;}return db[_0xd7f1('0x32')][_0xd7f1('0x45')]({'where':{'id':_0x8cd360['params']['id']},'include':[{'model':db[_0xd7f1('0x5e')],'as':_0xd7f1('0x7e'),'include':[{'model':db['User'],'as':_0xd7f1('0x7f')}]}]})['then'](handleEntityNotFound(_0x465cc4,null))[_0xd7f1('0x38')](saveUpdates(_0x8cd360[_0xd7f1('0x2c')],null))['then'](function(_0x3ac2d1){if(_0x3ac2d1){_0x3955c0=_0x3ac2d1;return db[_0xd7f1('0x49')][_0xd7f1('0x45')]({'where':{'id':_0x3955c0[_0xd7f1('0x4a')]}});}})[_0xd7f1('0x38')](function(_0x5a5d29){if(_0x5a5d29){_0xbf12a4=_0x5a5d29;return db[_0xd7f1('0x62')][_0xd7f1('0x45')]({'where':{'id':_0x3955c0['ContactId']}});}})['then'](function(_0xbb3400){if(_0xbb3400){if(_0x32be9b){var _0x145346=null;for(var _0x48a5ac=0x1;_0x48a5ac<_0x3955c0[_0xd7f1('0x7e')][_0xd7f1('0x41')];++_0x48a5ac){_0x145346=_0x3955c0[_0xd7f1('0x7e')][_0x48a5ac];var _0xaabcb7=_0x145346[_0xd7f1('0x67')]?util[_0xd7f1('0x7a')]('%s%d',_0xbf12a4[_0xd7f1('0x80')],_0x145346[_0xd7f1('0x67')]):_0xd7f1('0x81');var _0x240d0d=_0x8cd360['body'][_0xd7f1('0x82')]||util[_0xd7f1('0x7a')](_0xd7f1('0x83'),_0xd7f1('0x84'),_0x145346[_0xd7f1('0x85')]);switch(_0xbf12a4['agentIdentifier']){case'website_alias':_0xaabcb7=_0x145346['UserId']?util[_0xd7f1('0x7a')](_0xd7f1('0x83'),_0xbf12a4[_0xd7f1('0x80')],_0x145346[_0xd7f1('0x67')]):'System';break;case'agent_alias':_0xaabcb7=_0x145346['UserId']?_0x145346[_0xd7f1('0x7f')][_0xd7f1('0x86')]||_0x145346[_0xd7f1('0x7f')]['fullname']:_0xd7f1('0x81');break;case _0xd7f1('0x87'):_0xaabcb7=_0x145346['UserId']?_0x145346[_0xd7f1('0x7f')][_0xd7f1('0x50')]:'System';break;default:_0xaabcb7=_0x145346[_0xd7f1('0x67')]?util[_0xd7f1('0x7a')](_0xd7f1('0x83'),_0xbf12a4['agentAlias'],_0x145346[_0xd7f1('0x67')]):'System';}var _0x1e7cae=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x145346[_0xd7f1('0x88')])[_0xd7f1('0x7a')]('MM/DD/YYYY\x20HH:mm:ss'),_0x145346[_0xd7f1('0x89')]==='in'?_0x240d0d:_0xaabcb7,_0x145346[_0xd7f1('0x2c')]);if(!_0x145346[_0xd7f1('0x8a')]){fs[_0xd7f1('0x8b')](_0x32be9b,_0x1e7cae);}}return db['MailAccount'][_0xd7f1('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd7f1('0x8c'),'raw':!![],'include':[{'model':db[_0xd7f1('0x8d')],'as':_0xd7f1('0x8d'),'raw':!![]}]}]});}}})[_0xd7f1('0x38')](function(_0x449fc5){if(!_0x449fc5||!_0x449fc5[_0xd7f1('0x8c')]||!_0x8cd360[_0xd7f1('0x2c')])return _0x3955c0;var _0x1f6692=_0x449fc5[_0xd7f1('0x8e')]();return respondWithRpcPromise(_0xd7f1('0x8f'),_0xd7f1('0x90'),{'account':_0x1f6692,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x449fc5[_0xd7f1('0x28')],_0x449fc5[_0xd7f1('0x51')]||_0x449fc5[_0xd7f1('0x8c')][_0xd7f1('0x37')]),'to':_0x8cd360[_0xd7f1('0x2c')][_0xd7f1('0x79')],'subject':'Mail\x20Transcript','text':util['format'](_0xd7f1('0x91'),_0x8cd360['body']['mailTranscript']),'attachments':[{'path':_0x32be9b}]}})['then'](function(){return _0x3955c0;})[_0xd7f1('0x1c')](function(_0x3d52a8){logger['error'](_0x3d52a8);});})['then'](respondWithStatusCode(_0x465cc4,0xc8))[_0xd7f1('0x1c')](handleError(_0x465cc4,null));};exports[_0xd7f1('0x92')]=function(_0x3327c0,_0x593b3e){return db[_0xd7f1('0x5e')][_0xd7f1('0x45')]({'where':{'id':_0x3327c0['params']['id']}})[_0xd7f1('0x38')](handleEntityNotFound(_0x593b3e,null))[_0xd7f1('0x38')](function(_0x22856b){if(_0x22856b){return _0x22856b[_0xd7f1('0x92')](_0x3327c0[_0xd7f1('0x2c')][_0xd7f1('0x93')],_['omit'](_0x3327c0[_0xd7f1('0x2c')],[_0xd7f1('0x93'),'id'])||{});}})[_0xd7f1('0x38')](respondWithResult(_0x593b3e,null))[_0xd7f1('0x1c')](handleError(_0x593b3e,null));};exports[_0xd7f1('0x94')]=function(_0x4036ef,_0x1dfdaf){var _0x519cd5={'raw':![],'where':{}};var _0x52ea41={};var _0x364503={'count':0x0,'rows':[]};return db[_0xd7f1('0x32')][_0xd7f1('0x48')]({'where':{'id':_0x4036ef['params']['id']}})[_0xd7f1('0x38')](handleEntityNotFound(_0x1dfdaf,null))[_0xd7f1('0x38')](function(_0xf82973){if(_0xf82973){_0x52ea41[_0xd7f1('0x3a')]=_[_0xd7f1('0x3b')](db['ChatMessage'][_0xd7f1('0x3c')]);_0x52ea41[_0xd7f1('0x36')]=_[_0xd7f1('0x3b')](_0x4036ef[_0xd7f1('0x36')]);_0x52ea41[_0xd7f1('0x3d')]=_['intersection'](_0x52ea41[_0xd7f1('0x3a')],_0x52ea41['query']);_0x519cd5[_0xd7f1('0x3f')]=_[_0xd7f1('0x3e')](_0x52ea41[_0xd7f1('0x3a')],qs[_0xd7f1('0x40')](_0x4036ef['query'][_0xd7f1('0x40')]));_0x519cd5['attributes']=_0x519cd5['attributes']['length']?_0x519cd5[_0xd7f1('0x3f')]:_0x52ea41[_0xd7f1('0x3a')];if(!_0x4036ef['query'][_0xd7f1('0x95')](_0xd7f1('0x96'))){_0x519cd5[_0xd7f1('0x24')]=qs[_0xd7f1('0x24')](_0x4036ef[_0xd7f1('0x36')][_0xd7f1('0x24')]);_0x519cd5[_0xd7f1('0x21')]=qs['offset'](_0x4036ef['query'][_0xd7f1('0x21')]);}_0x519cd5[_0xd7f1('0x97')]=qs[_0xd7f1('0x98')](_0x4036ef['query'][_0xd7f1('0x98')]);_0x519cd5[_0xd7f1('0x99')]=qs[_0xd7f1('0x3d')](_[_0xd7f1('0x9a')](_0x4036ef[_0xd7f1('0x36')],_0x52ea41['filters']));_0x519cd5[_0xd7f1('0x99')][_0xd7f1('0x9b')]=_0xf82973['id'];if(_0x4036ef['query'][_0xd7f1('0x9c')]){_0x519cd5[_0xd7f1('0x99')]=_[_0xd7f1('0x2b')](_0x519cd5['where'],{'$or':_[_0xd7f1('0x31')](_0x519cd5[_0xd7f1('0x3f')],function(_0x1c3f2d){var _0x41a08d={};_0x41a08d[_0x1c3f2d]={'$like':'%'+_0x4036ef[_0xd7f1('0x36')][_0xd7f1('0x9c')]+'%'};return _0x41a08d;})});}if(_0x4036ef[_0xd7f1('0x36')][_0xd7f1('0x9d')]){var _0x44c328=_0x4036ef[_0xd7f1('0x36')][_0xd7f1('0x9d')][_0xd7f1('0x9e')](',');var _0x194e9a={};_0x194e9a[_0x44c328[0x0]]={'$gte':moment(_0x44c328[0x1])[_0xd7f1('0x7a')](_0xd7f1('0x9f'))};_0x519cd5[_0xd7f1('0x99')]=_[_0xd7f1('0x2b')](_0x519cd5[_0xd7f1('0x99')],_0x194e9a);}_0x519cd5=_[_0xd7f1('0x2b')]({},_0x519cd5,_0x4036ef[_0xd7f1('0x43')]);return db['ChatMessage'][_0xd7f1('0x23')]({'where':_0x519cd5['where']})[_0xd7f1('0x38')](function(_0xb19e0a){_0x364503['count']=_0xb19e0a;if(_0x4036ef[_0xd7f1('0x36')][_0xd7f1('0x42')]){_0x519cd5['include']=[{'all':!![]}];}return db[_0xd7f1('0x5e')][_0xd7f1('0xa0')](_0x519cd5);})[_0xd7f1('0x38')](function(_0x3fc5a6){_0x364503[_0xd7f1('0xa1')]=_0x3fc5a6;return _0x364503;});}})[_0xd7f1('0x38')](respondWithFilteredResult(_0x1dfdaf,_0x519cd5))['catch'](handleError(_0x1dfdaf,null));};exports[_0xd7f1('0xa2')]=function(_0x368e48,_0x2d8032){var _0x4f676c={'where':{}},_0x140ebb={},_0x5181be={'count':0x0,'rows':[]};return db[_0xd7f1('0x32')][_0xd7f1('0x48')]({'where':{'id':_0x368e48[_0xd7f1('0x46')]['id']}})[_0xd7f1('0x38')](handleEntityNotFound(_0x2d8032,null))[_0xd7f1('0x38')](function(_0x590828){if(_0x590828){_0x140ebb[_0xd7f1('0x3a')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x140ebb[_0xd7f1('0x36')]=_['keys'](_0x368e48['query']);_0x140ebb[_0xd7f1('0x3d')]=_['intersection'](_0x140ebb[_0xd7f1('0x3a')],_0x140ebb[_0xd7f1('0x36')]);_0x4f676c[_0xd7f1('0x3f')]=_['intersection'](_0x140ebb[_0xd7f1('0x3a')],qs[_0xd7f1('0x40')](_0x368e48[_0xd7f1('0x36')]['fields']));_0x4f676c[_0xd7f1('0x3f')]=_0x4f676c[_0xd7f1('0x3f')][_0xd7f1('0x41')]?_0x4f676c['attributes']:_0x140ebb[_0xd7f1('0x3a')];if(!_0x368e48['query'][_0xd7f1('0x95')](_0xd7f1('0x96'))){_0x4f676c[_0xd7f1('0x24')]=qs['limit'](_0x368e48[_0xd7f1('0x36')][_0xd7f1('0x24')]);_0x4f676c[_0xd7f1('0x21')]=qs[_0xd7f1('0x21')](_0x368e48[_0xd7f1('0x36')]['offset']);}_0x4f676c[_0xd7f1('0x97')]=qs[_0xd7f1('0x98')](_0x368e48[_0xd7f1('0x36')][_0xd7f1('0x98')]);_0x4f676c[_0xd7f1('0x99')]=qs[_0xd7f1('0x3d')](_['pick'](_0x368e48[_0xd7f1('0x36')],_0x140ebb[_0xd7f1('0x3d')]));_0x4f676c['where']['ChatInteractionId']=_0x590828['id'];if(_0x368e48[_0xd7f1('0x36')][_0xd7f1('0x9c')]){_0x4f676c[_0xd7f1('0x99')]=_[_0xd7f1('0x2b')](_0x4f676c['where'],{'$or':_[_0xd7f1('0x31')](_0x4f676c[_0xd7f1('0x3f')],function(_0x253327){var _0x345abc={};_0x345abc[_0x253327]={'$like':'%'+_0x368e48[_0xd7f1('0x36')][_0xd7f1('0x9c')]+'%'};return _0x345abc;})});}_0x4f676c[_0xd7f1('0x99')]['secret']=![];if(_0x368e48['query']['id']){_0x4f676c[_0xd7f1('0x99')]['id']={'$gt':_0x368e48[_0xd7f1('0x36')]['id']};}_0x4f676c=_[_0xd7f1('0x2b')]({},_0x4f676c,_0x368e48[_0xd7f1('0x43')]);return db['ChatMessage'][_0xd7f1('0x23')]({'where':_0x4f676c[_0xd7f1('0x99')]})[_0xd7f1('0x38')](function(_0x234c84){_0x5181be[_0xd7f1('0x23')]=_0x234c84;_0x4f676c[_0xd7f1('0xa3')]=[];if(_0x368e48[_0xd7f1('0x36')][_0xd7f1('0xa4')]){_0x4f676c[_0xd7f1('0xa3')][_0xd7f1('0xa5')]({'model':db[_0xd7f1('0x7f')],'as':_0xd7f1('0x7f'),'attributes':['id',_0xd7f1('0x50'),_0xd7f1('0x86')]});}if(_0x368e48[_0xd7f1('0x36')][_0xd7f1('0x42')]){_0x4f676c[_0xd7f1('0xa3')]=[{'all':!![]}];}return db['ChatMessage'][_0xd7f1('0xa0')](_0x4f676c);})[_0xd7f1('0x38')](function(_0x209e9d){_0x5181be['rows']=_0x209e9d;return _0x5181be;});}})[_0xd7f1('0x38')](respondWithFilteredResult(_0x2d8032,_0x4f676c))[_0xd7f1('0x1c')](handleError(_0x2d8032,null));};exports[_0xd7f1('0xa6')]=function(_0x479fda,_0x324210){return db['ChatInteraction']['find']({'where':{'id':_0x479fda['params']['id']}})[_0xd7f1('0x38')](handleEntityNotFound(_0x324210,null))[_0xd7f1('0x38')](function(_0x59066a){if(_0x59066a){return _0x59066a[_0xd7f1('0xa7')](_0x479fda[_0xd7f1('0x2c')]['ids'],_[_0xd7f1('0xa8')](_0x479fda[_0xd7f1('0x2c')],['ids','id'])||{})['spread'](function(){return db[_0xd7f1('0xa9')][_0xd7f1('0xa0')]({'attributes':['id',_0xd7f1('0x28'),'color'],'where':{'id':_0x479fda['body'][_0xd7f1('0x93')]}});})[_0xd7f1('0x38')](function(_0x3657c0){socket['emit']('chatInteractionTags:save',{'id':Number(_0x479fda[_0xd7f1('0x46')]['id']),'tags':_0x3657c0||[]});return{'id':Number(_0x479fda['params']['id']),'tags':_0x3657c0||[]};});}})[_0xd7f1('0x38')](respondWithResult(_0x324210,null))[_0xd7f1('0x1c')](handleError(_0x324210,null));};exports['removeTags']=function(_0x25b763,_0x25d799){return db[_0xd7f1('0x32')][_0xd7f1('0x45')]({'where':{'id':_0x25b763['params']['id']}})[_0xd7f1('0x38')](handleEntityNotFound(_0x25d799,null))[_0xd7f1('0x38')](function(_0x2d5a9a){if(_0x2d5a9a){return _0x2d5a9a['removeTags'](_0x25b763['query'][_0xd7f1('0x93')]);}})['then'](respondWithStatusCode(_0x25d799,null))[_0xd7f1('0x1c')](handleError(_0x25d799,null));};exports['download']=function(_0x3ab014,_0x2361bd){var _0x3a1f10=moment()[_0xd7f1('0xaa')]()[_0xd7f1('0xab')]();var _0x25572d=path[_0xd7f1('0x75')](config[_0xd7f1('0xac')],_0xd7f1('0xad'),'files',_0xd7f1('0xae'));var _0x562f63=path[_0xd7f1('0x75')](config['root'],_0xd7f1('0xad'),_0xd7f1('0xaf'),_0xd7f1('0xb0'));var _0x523288=path[_0xd7f1('0x75')](_0x25572d,_0x3a1f10);var _0x1c318a=util[_0xd7f1('0x7a')]('transcript-%d-%s.zip',_0x3ab014[_0xd7f1('0x46')]['id'],_0x3a1f10);var _0x34f908=path['join'](_0x25572d,_0x1c318a);var _0x1f84a1=[];_0x1f84a1[_0xd7f1('0xa5')]({'model':db[_0xd7f1('0x7f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1f84a1[_0xd7f1('0xa5')]({'model':db[_0xd7f1('0x62')],'as':_0xd7f1('0x63'),'attributes':['id',_0xd7f1('0xb1'),_0xd7f1('0xb2')],'raw':!![]});if(_0x3ab014[_0xd7f1('0x36')][_0xd7f1('0xb0')]){_0x1f84a1[_0xd7f1('0xa5')]({'model':db[_0xd7f1('0x71')],'as':'Attachment','raw':!![]});}var _0x34b26e=[{'model':db[_0xd7f1('0x5e')],'as':'Messages','attributes':['id','body',_0xd7f1('0x88'),_0xd7f1('0x89'),'secret','read'],'include':_0x1f84a1}];_0x34b26e['push']({'model':db[_0xd7f1('0x49')],'as':_0xd7f1('0xb3'),'attributes':['id',_0xd7f1('0x28')]});_0x34b26e['push']({'model':db[_0xd7f1('0x7f')],'as':_0xd7f1('0xb4'),'attributes':['id','fullname']});return db[_0xd7f1('0x32')][_0xd7f1('0x45')]({'where':{'id':_0x3ab014['params']['id']},'include':_0x34b26e})[_0xd7f1('0x38')](handleEntityNotFound(_0x2361bd,null))[_0xd7f1('0x38')](function(_0x4e2269){if(_0x4e2269){var _0x3ee709=_0x4e2269[_0xd7f1('0xb5')]({'plain':!![]});fs[_0xd7f1('0xb6')](_0x523288);var _0x4b259d={'channel':_0xd7f1('0xb7'),'account':_0x3ee709[_0xd7f1('0xb3')][_0xd7f1('0x28')],'agent':_0x3ee709['Owner']?_0x3ee709[_0xd7f1('0xb4')][_0xd7f1('0x50')]:_0xd7f1('0xb8'),'createdAt':moment(_0x3ee709[_0xd7f1('0x88')])[_0xd7f1('0x7a')](_0xd7f1('0x9f'))[_0xd7f1('0xab')](),'closedAt':_0x3ee709[_0xd7f1('0x69')]?moment(_0x3ee709[_0xd7f1('0xb9')])[_0xd7f1('0x7a')](_0xd7f1('0x9f'))['toString']():'','disposition':_0x3ee709['disposition'],'chatInfo':{'browser':_0x3ee709[_0xd7f1('0xba')],'os':_0x3ee709[_0xd7f1('0xbb')],'referer':_0x3ee709[_0xd7f1('0xbc')],'customerIp':_0x3ee709[_0xd7f1('0xbd')],'customerPort':_0x3ee709[_0xd7f1('0xbe')]?_0x3ee709[_0xd7f1('0xbe')]:_0xd7f1('0xb8')},'messages':_(_0x3ee709['Messages'])[_0xd7f1('0xbf')]()[_0xd7f1('0x9c')]({'secret':![]})[_0xd7f1('0x31')](function(_0xe4715e){if(_0xe4715e['Attachment']){var _0x6cc653=path[_0xd7f1('0x75')](_0x562f63,_0xe4715e[_0xd7f1('0x71')][_0xd7f1('0x6f')]);if(fs[_0xd7f1('0xc0')](_0x6cc653)){fs[_0xd7f1('0xc1')](_0x6cc653)[_0xd7f1('0xc2')](fs[_0xd7f1('0xc3')](path[_0xd7f1('0x75')](_0x523288,_0xe4715e['Attachment'][_0xd7f1('0x6f')])));}}return{'date':moment(_0xe4715e[_0xd7f1('0x88')])[_0xd7f1('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd7f1('0xab')](),'sender':_0xe4715e[_0xd7f1('0x89')]===_0xd7f1('0x5d')?_0xe4715e['User']?_0xe4715e[_0xd7f1('0x7f')]['fullname']:_0xd7f1('0x81'):_0xe4715e[_0xd7f1('0x63')]['firstName']+(_0xe4715e[_0xd7f1('0x63')][_0xd7f1('0xb2')]?'\x20'+_0xe4715e[_0xd7f1('0x63')][_0xd7f1('0xb2')]:''),'body':_0xe4715e[_0xd7f1('0x71')]?_0xe4715e[_0xd7f1('0x71')]['basename']:_0xe4715e[_0xd7f1('0x2c')],'direction':_0xe4715e['direction']===_0xd7f1('0x5d')?'A':'C','secret':_0xe4715e['secret'],'read':_0xe4715e[_0xd7f1('0xc4')],'attachment':_0xe4715e[_0xd7f1('0x71')]};})['value']()};return ejs['renderFile'](path[_0xd7f1('0x75')](config[_0xd7f1('0xac')],_0xd7f1('0xad'),_0xd7f1('0xc5'),'downloadInteraction.ejs'),{'interaction':_0x4b259d})[_0xd7f1('0x38')](function(_0x9b102a){var _0x522e30=path[_0xd7f1('0x75')](_0x523288,_0xd7f1('0xc6')+_0x3ee709['id']+'-'+_0x3a1f10+_0xd7f1('0xc7'));var _0x42c7da={'path':_0x522e30,'channel':_0xd7f1('0xb7'),'interactionId':_0x3ee709['id']};return pdf[_0xd7f1('0xc8')](_0x9b102a,_0x42c7da);})[_0xd7f1('0x38')](function(){return new Promise(function(_0x1ebba8,_0x4da180){zipdir(_0x523288,{'saveTo':_0x34f908},function(_0x2054ad,_0x595d0b){if(_0x2054ad)return _0x4da180(_0x2054ad);return _0x1ebba8(_0x595d0b);});})[_0xd7f1('0x38')](function(){return new BPromise(function(_0x246609,_0x5c1ac7){rimraf(_0x523288,function(_0x5dfa2e){if(_0x5dfa2e)_0x5c1ac7(_0x5dfa2e);return _0x246609();});});})[_0xd7f1('0x38')](function(){return _0x2361bd['download'](_0x34f908,_0x1c318a,function(_0x37286b){if(_0x37286b){logger['error']('err',_0x37286b);}else{fs[_0xd7f1('0xc9')](_0x34f908);}});});});}else{return _0x2361bd[_0xd7f1('0x1d')](0xc8);}})[_0xd7f1('0x1c')](handleError(_0x2361bd,null));};
\ No newline at end of file
+var _0x0e42=['create','destroy','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','vidaooTopic','follow','isNull','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','agentAlias','System','customer','%s%d','Visitor','ContactId','website_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','push','rows','addTags','omit','spread','Tag','color','emit','removeTags','toString','files','server','transcript-%d-%s.zip','firstName','attachments','ChatWebsite','Account','Owner','get','mkdirSync','Chat','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','direction','lastName','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','update','name','send','render','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','findAll','user','show','params','model','keys','ChatInteraction','filters','intersection','query','attributes','fields','length','includeAll','include','options','find'];(function(_0x1ed938,_0x3ee138){var _0x30b8a1=function(_0x4b7103){while(--_0x4b7103){_0x1ed938['push'](_0x1ed938['shift']());}};_0x30b8a1(++_0x3ee138);}(_0x0e42,0x14e));var _0x20e4=function(_0x14989b,_0xc4ae0){_0x14989b=_0x14989b-0x0;var _0x1c9f55=_0x0e42[_0x14989b];return _0x1c9f55;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x20e4('0x0'));var rp=require(_0x20e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x20e4('0x2'));var path=require(_0x20e4('0x3'));var ejs=require(_0x20e4('0x4'));var fs=require('fs');var _=require(_0x20e4('0x5'));var Redis=require(_0x20e4('0x6'));var interaction=require(_0x20e4('0x7'));var qs=require(_0x20e4('0x8'));var pdf=require(_0x20e4('0x9'));var logger=require(_0x20e4('0xa'))(_0x20e4('0xb'));var config=require(_0x20e4('0xc'));var db=require(_0x20e4('0xd'))['db'];config['redis']=_[_0x20e4('0xe')](config[_0x20e4('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x20e4('0x10'))(new Redis(config[_0x20e4('0xf')]));require(_0x20e4('0x11'))['register'](socket);var jayson=require(_0x20e4('0x12'));var client=jayson[_0x20e4('0x13')][_0x20e4('0x14')]({'port':0x232b});var client9004=jayson[_0x20e4('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0xf6d6a9,_0x110f51,_0x487461,_0x202f17){return new BPromise(function(_0x15ad61,_0x5be9d5){var _0x1cbf48=_0x202f17||client;return _0x1cbf48['request'](_0xf6d6a9,_0x487461)[_0x20e4('0x15')](function(_0x185292){logger['info'](_0x20e4('0x16'),_0x110f51,_0x20e4('0x17'));logger[_0x20e4('0x18')](_0x20e4('0x19'),_0x110f51,_0x20e4('0x17'),JSON[_0x20e4('0x1a')](_0x185292));if(_0x185292[_0x20e4('0x1b')]){if(_0x185292[_0x20e4('0x1b')][_0x20e4('0x1c')]===0x1f4){logger[_0x20e4('0x1b')](_0x20e4('0x16'),_0x110f51,_0x185292[_0x20e4('0x1b')][_0x20e4('0x1d')]);return _0x5be9d5(_0x185292[_0x20e4('0x1b')][_0x20e4('0x1d')]);}logger[_0x20e4('0x1b')](_0x20e4('0x16'),_0x110f51,_0x185292[_0x20e4('0x1b')][_0x20e4('0x1d')]);return _0x15ad61(_0x185292['error']['message']);}else{logger[_0x20e4('0x1e')](_0x20e4('0x16'),_0x110f51,_0x20e4('0x17'));_0x15ad61(_0x185292[_0x20e4('0x1f')][_0x20e4('0x1d')]);}})[_0x20e4('0x20')](function(_0x3bba22){logger[_0x20e4('0x1b')](_0x20e4('0x16'),_0x110f51,_0x3bba22);_0x5be9d5(_0x3bba22);});});}function respondWithStatusCode(_0xddec2b,_0x1b29e3){_0x1b29e3=_0x1b29e3||0xcc;return function(_0x5d17dc){if(_0x5d17dc){return _0xddec2b[_0x20e4('0x21')](_0x1b29e3);}return _0xddec2b[_0x20e4('0x22')](_0x1b29e3)[_0x20e4('0x23')]();};}function respondWithResult(_0x55b72c,_0x34f0b5){_0x34f0b5=_0x34f0b5||0xc8;return function(_0x3179aa){if(_0x3179aa){return _0x55b72c['status'](_0x34f0b5)['json'](_0x3179aa);}};}function respondWithFilteredResult(_0x43dad0,_0x435512){return function(_0x5e43cd){if(_0x5e43cd){var _0x4713b8=typeof _0x435512[_0x20e4('0x24')]===_0x20e4('0x25')&&typeof _0x435512[_0x20e4('0x26')]==='undefined';var _0x4781f4=_0x5e43cd[_0x20e4('0x27')];var _0x4cc6d5=_0x4713b8?0x0:_0x435512[_0x20e4('0x24')];var _0x1f6606=_0x4713b8?_0x5e43cd[_0x20e4('0x27')]:_0x435512[_0x20e4('0x24')]+_0x435512[_0x20e4('0x26')];var _0x290a54;if(_0x1f6606>=_0x4781f4){_0x1f6606=_0x4781f4;_0x290a54=0xc8;}else{_0x290a54=0xce;}_0x43dad0[_0x20e4('0x22')](_0x290a54);return _0x43dad0['set']('Content-Range',_0x4cc6d5+'-'+_0x1f6606+'/'+_0x4781f4)[_0x20e4('0x28')](_0x5e43cd);}return null;};}function saveUpdates(_0x1cf996){return function(_0xf8adbf){if(_0xf8adbf){return _0xf8adbf[_0x20e4('0x29')](_0x1cf996)[_0x20e4('0x15')](function(_0x45276){return _0x45276;});}return null;};}function removeEntity(_0xb6535a){return function(_0x456821){if(_0x456821){return _0x456821['destroy']()[_0x20e4('0x15')](function(){_0xb6535a['status'](0xcc)[_0x20e4('0x23')]();});}};}function handleEntityNotFound(_0x59c991){return function(_0x24131f){if(!_0x24131f){_0x59c991['sendStatus'](0x194);}return _0x24131f;};}function handleError(_0x4abc43,_0x3dd2a6){_0x3dd2a6=_0x3dd2a6||0x1f4;return function(_0x347144){logger['error'](_0x347144['stack']);if(_0x347144[_0x20e4('0x2a')]){delete _0x347144[_0x20e4('0x2a')];}_0x4abc43[_0x20e4('0x22')](_0x3dd2a6)[_0x20e4('0x2b')](_0x347144);};}function getMustacheRender(_0x4b258b,_0x1b3080){return Mustache[_0x20e4('0x2c')](_0x4b258b,_[_0x20e4('0x2d')](_0x1b3080[_0x20e4('0x2e')],{'contact':_0x1b3080[_0x20e4('0x2f')],'message':_0x1b3080[_0x20e4('0x1d')],'agent':_0x1b3080[_0x20e4('0x30')],'interaction':_0x1b3080[_0x20e4('0x31')],'account':_0x1b3080[_0x20e4('0x32')]}))||'';}exports[_0x20e4('0x33')]=function(_0x3aeec5,_0x1f7726){var _0x4cd982={};var _0x5d1c11=_[_0x20e4('0x34')](db['ChatInteraction'][_0x20e4('0x35')],function(_0x1e7e0d){return{'name':_0x1e7e0d[_0x20e4('0x36')],'type':_0x1e7e0d[_0x20e4('0x37')][_0x20e4('0x38')]};});_0x4cd982=qs['getOptions'](_0x5d1c11,_0x3aeec5);return interaction[_0x20e4('0x39')]('chat',_0x3aeec5['query'],_0x3aeec5[_0x20e4('0x3a')],_0x4cd982,_0x5d1c11)[_0x20e4('0x15')](respondWithFilteredResult(_0x1f7726,_0x4cd982))['catch'](handleError(_0x1f7726,null));};exports[_0x20e4('0x3b')]=function(_0x572852,_0x4ee3a8){var _0x57d49c={'raw':![],'where':{'id':_0x572852[_0x20e4('0x3c')]['id']}},_0x35bfb4={};_0x35bfb4[_0x20e4('0x3d')]=_[_0x20e4('0x3e')](db[_0x20e4('0x3f')][_0x20e4('0x35')]);_0x35bfb4['query']=_[_0x20e4('0x3e')](_0x572852['query']);_0x35bfb4[_0x20e4('0x40')]=_[_0x20e4('0x41')](_0x35bfb4['model'],_0x35bfb4[_0x20e4('0x42')]);_0x57d49c[_0x20e4('0x43')]=_[_0x20e4('0x41')](_0x35bfb4[_0x20e4('0x3d')],qs[_0x20e4('0x44')](_0x572852[_0x20e4('0x42')][_0x20e4('0x44')]));_0x57d49c[_0x20e4('0x43')]=_0x57d49c[_0x20e4('0x43')][_0x20e4('0x45')]?_0x57d49c[_0x20e4('0x43')]:_0x35bfb4['model'];if(_0x572852['query'][_0x20e4('0x46')]){_0x57d49c[_0x20e4('0x47')]=[{'all':!![]}];}_0x57d49c=_[_0x20e4('0x2d')]({},_0x57d49c,_0x572852[_0x20e4('0x48')]);return db[_0x20e4('0x3f')][_0x20e4('0x49')](_0x57d49c)[_0x20e4('0x15')](handleEntityNotFound(_0x4ee3a8,null))[_0x20e4('0x15')](respondWithResult(_0x4ee3a8,null))[_0x20e4('0x20')](handleError(_0x4ee3a8,null));};exports[_0x20e4('0x4a')]=function(_0x580d5c,_0x44b281){return db[_0x20e4('0x3f')][_0x20e4('0x4a')](_0x580d5c[_0x20e4('0x2e')],{})[_0x20e4('0x15')](respondWithResult(_0x44b281,0xc9))[_0x20e4('0x20')](handleError(_0x44b281,null));};exports['update']=function(_0x412be1,_0x248394){if(_0x412be1['body']['id']){delete _0x412be1[_0x20e4('0x2e')]['id'];}return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x412be1[_0x20e4('0x3c')]['id']}})['then'](handleEntityNotFound(_0x248394,null))['then'](saveUpdates(_0x412be1[_0x20e4('0x2e')],null))[_0x20e4('0x15')](respondWithResult(_0x248394,null))[_0x20e4('0x20')](handleError(_0x248394,null));};exports[_0x20e4('0x4b')]=function(_0x33bd67,_0x5bca1c){return db[_0x20e4('0x3f')][_0x20e4('0x49')]({'where':{'id':_0x33bd67[_0x20e4('0x3c')]['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x5bca1c,null))['then'](removeEntity(_0x5bca1c,null))[_0x20e4('0x20')](handleError(_0x5bca1c,null));};exports['describe']=function(_0x2eac7a,_0x413708){return db[_0x20e4('0x3f')][_0x20e4('0x4c')]()[_0x20e4('0x15')](respondWithResult(_0x413708,null))[_0x20e4('0x20')](handleError(_0x413708,null));};exports['createVidaooSession']=function(_0x39434c,_0x3c7ffb){var _0x419be2=_0x39434c['params']['id'];var _0x3d01a4;var _0x537bbb;var _0xb20207;return db[_0x20e4('0x3f')][_0x20e4('0x4d')]({'where':{'id':_0x419be2}})[_0x20e4('0x15')](function(_0x3864dd){_0x3d01a4=_0x3864dd;return db['ChatWebsite'][_0x20e4('0x4d')]({'where':{'id':_0x3864dd[_0x20e4('0x4e')]},'attributes':['id',_0x20e4('0x4f'),_0x20e4('0x50'),'vidaooTopic',_0x20e4('0x51'),_0x20e4('0x52')],'raw':!![]});})[_0x20e4('0x15')](function(_0x18fbbe){if(_0x18fbbe&&_0x18fbbe[_0x20e4('0x4f')]&&_0x18fbbe[_0x20e4('0x50')]){_0x537bbb=_0x18fbbe;var _0x13034c={'interaction':{'id':_0x419be2},'agent':{'id':_0x39434c[_0x20e4('0x3a')]['id'],'name':_0x39434c[_0x20e4('0x3a')][_0x20e4('0x2a')],'fullname':_0x39434c[_0x20e4('0x3a')][_0x20e4('0x53')],'email':_0x39434c[_0x20e4('0x3a')][_0x20e4('0x54')]},'contact':_0x39434c[_0x20e4('0x2e')]['contact'],'account':_0x39434c[_0x20e4('0x2e')][_0x20e4('0x32')]};var _0x404e69={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x18fbbe[_0x20e4('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x39434c[_0x20e4('0x3a')][_0x20e4('0x54')]],'buttons':null,'topic':_0x537bbb[_0x20e4('0x55')],'note':_['isNull'](_0x537bbb['vidaooNote'])?null:getMustacheRender(_0x537bbb['vidaooNote'],_0x13034c),'metadata':null},'redirect':_0x20e4('0x56'),'json':!![]};try{if(!_[_0x20e4('0x57')](_0x537bbb[_0x20e4('0x52')])){var _0x5029fc=getMustacheRender(_0x537bbb['vidaooMetadata'],_0x13034c);var _0x1e4332=JSON[_0x20e4('0x58')](_0x5029fc);_0x404e69['body']['metadata']=_0x1e4332;}}catch(_0x11a5a5){throw new db[(_0x20e4('0x59'))][(_0x20e4('0x5a'))](_0x20e4('0x5b'));}return rp(_0x404e69);}else{throw new db[(_0x20e4('0x59'))][(_0x20e4('0x5a'))](_0x20e4('0x5c'));}})[_0x20e4('0x15')](function(_0x5ba9e3){_0xb20207=_0x5ba9e3;if(_0xb20207['id']){var _0x477162={'body':_0xb20207[_0x20e4('0x5d')],'ChatWebsiteId':_0x537bbb['id'],'ChatInteractionId':_0x3d01a4['id'],'direction':_0x20e4('0x5e'),'UserId':_0x39434c[_0x20e4('0x3a')]['id']};return db[_0x20e4('0x5f')]['create'](_0x477162,{});}else{throw new db['Sequelize'][(_0x20e4('0x5a'))](_0x20e4('0x60'));}})['then'](function(){return _0x3d01a4[_0x20e4('0x61')]({'vidaooSessionId':_0xb20207['id']});})[_0x20e4('0x15')](respondWithResult(_0x3c7ffb,null))[_0x20e4('0x20')](handleError(_0x3c7ffb,null));};exports['customUpdate']=function(_0x5def37,_0x1856ce){if(_0x5def37[_0x20e4('0x2e')]['id']){delete _0x5def37[_0x20e4('0x2e')]['id'];}return db[_0x20e4('0x3f')][_0x20e4('0x49')]({'where':{'id':_0x5def37[_0x20e4('0x3c')]['id']},'include':[{'model':db['CmContact'],'as':_0x20e4('0x62')}]})[_0x20e4('0x15')](handleEntityNotFound(_0x1856ce,null))[_0x20e4('0x15')](saveUpdates(_0x5def37[_0x20e4('0x2e')],null))['then'](respondWithResult(_0x1856ce,null))[_0x20e4('0x20')](handleError(_0x1856ce,null));};exports['abandon']=function(_0x5090f7,_0x591705){if(_0x5090f7[_0x20e4('0x2e')]['id']){delete _0x5090f7[_0x20e4('0x2e')]['id'];}return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x5090f7['params']['id']}})[_0x20e4('0x15')](function(_0x462005){if(!_0x462005){logger[_0x20e4('0x1b')](_0x20e4('0x63'),'abandon',0x194,_0x20e4('0x64'));_0x591705[_0x20e4('0x21')](0x194);}else{if(_0x462005[_0x20e4('0x65')]){throw new db[(_0x20e4('0x59'))][(_0x20e4('0x5a'))]('Interaction\x20already\x20assigned');}}return _0x462005;})[_0x20e4('0x15')](function(_0x4e62b6){if(_0x4e62b6){return _0x4e62b6[_0x20e4('0x29')]({'closed':_0x5090f7['body'][_0x20e4('0x66')],'disposition':_0x5090f7['body'][_0x20e4('0x67')]})[_0x20e4('0x15')](function(_0x3f25d9){return _0x3f25d9;});}})[_0x20e4('0x15')](function(){return respondWithRpcPromise(_0x20e4('0x68'),_0x20e4('0x69'),_0x5090f7[_0x20e4('0x2e')],client9004);})[_0x20e4('0x15')](respondWithResult(_0x591705,null))[_0x20e4('0x20')](handleError(_0x591705,null));};exports[_0x20e4('0x6a')]=function(_0x10b27b,_0x22e38c){_0x10b27b[_0x20e4('0x2e')][_0x20e4('0x2a')]=_0x10b27b[_0x20e4('0x6b')][_0x20e4('0x6c')];_0x10b27b['body'][_0x20e4('0x6d')]=_0x10b27b['file']['filename'];_0x10b27b['body'][_0x20e4('0x37')]=_0x10b27b[_0x20e4('0x6b')][_0x20e4('0x6e')];return db[_0x20e4('0x6f')][_0x20e4('0x4a')](_0x10b27b[_0x20e4('0x2e')])[_0x20e4('0x15')](respondWithResult(_0x22e38c,0xc9))[_0x20e4('0x20')](handleError(_0x22e38c,null));};exports[_0x20e4('0x70')]=function(_0x17d0c5,_0x2d7f94){return db[_0x20e4('0x3f')][_0x20e4('0x4d')]({'where':{'id':_0x17d0c5['params']['id']},'raw':!![]})[_0x20e4('0x15')](handleEntityNotFound(_0x2d7f94,null))[_0x20e4('0x15')](function(_0x1fc07c){if(_0x1fc07c){if(_0x1fc07c[_0x20e4('0x66')]){return _0x2d7f94[_0x20e4('0x22')](0x193)['json']({'status':0x193,'message':_0x20e4('0x71')});}return db[_0x20e4('0x6f')]['findOne']({'where':{'id':_0x17d0c5[_0x20e4('0x42')][_0x20e4('0x72')]},'raw':!![]})[_0x20e4('0x15')](handleEntityNotFound(_0x2d7f94,null));}})[_0x20e4('0x15')](function(_0x2ce824){if(_0x2ce824){var _0x30597d=_0x2ce824[_0x20e4('0x73')]!==null;var _0x4f3935=path[_0x20e4('0x74')](config[_0x20e4('0x75')],_0x20e4('0x76'));if(_0x30597d){_0x4f3935=path['join'](_0x4f3935,_0x20e4('0x77'));}var _0x5a239a=path[_0x20e4('0x74')](_0x4f3935,_0x2ce824['basename']);return _0x2d7f94[_0x20e4('0x78')](_0x5a239a);}})[_0x20e4('0x20')](handleError(_0x2d7f94,null));};exports['close']=function(_0x1186b2,_0x159c3e){var _0xef777e=null;var _0x43c1c6=null;var _0x4a711d=null;if(_0x1186b2[_0x20e4('0x2e')]['id']){delete _0x1186b2[_0x20e4('0x2e')]['id'];}if(_0x1186b2['body'][_0x20e4('0x79')]){_0x4a711d=path[_0x20e4('0x74')](config[_0x20e4('0x75')],_0x20e4('0x7a'),util[_0x20e4('0x7b')](_0x20e4('0x7c'),Date[_0x20e4('0x7d')]()));_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x7e')]=_0x4a711d;}return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x1186b2[_0x20e4('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x20e4('0x7f'),'include':[{'model':db[_0x20e4('0x80')],'as':_0x20e4('0x80')}]}]})[_0x20e4('0x15')](handleEntityNotFound(_0x159c3e,null))[_0x20e4('0x15')](saveUpdates(_0x1186b2[_0x20e4('0x2e')],null))[_0x20e4('0x15')](function(_0x293710){if(_0x293710){_0xef777e=_0x293710;return db['ChatWebsite'][_0x20e4('0x49')]({'where':{'id':_0xef777e['ChatWebsiteId']}});}})[_0x20e4('0x15')](function(_0x12ffcf){if(_0x12ffcf){_0x43c1c6=_0x12ffcf;return db[_0x20e4('0x81')][_0x20e4('0x49')]({'where':{'id':_0xef777e['ContactId']}});}})['then'](function(_0x3cffb1){if(_0x3cffb1){if(_0x4a711d){var _0x3dff75=null;for(var _0x303d15=0x1;_0x303d15<_0xef777e[_0x20e4('0x7f')]['length'];++_0x303d15){_0x3dff75=_0xef777e['Messages'][_0x303d15];var _0x4bd331=_0x3dff75[_0x20e4('0x65')]?util[_0x20e4('0x7b')]('%s%d',_0x43c1c6[_0x20e4('0x82')],_0x3dff75[_0x20e4('0x65')]):_0x20e4('0x83');var _0x5cf134=_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x84')]||util[_0x20e4('0x7b')](_0x20e4('0x85'),_0x20e4('0x86'),_0x3dff75[_0x20e4('0x87')]);switch(_0x43c1c6['agentIdentifier']){case _0x20e4('0x88'):_0x4bd331=_0x3dff75[_0x20e4('0x65')]?util[_0x20e4('0x7b')](_0x20e4('0x85'),_0x43c1c6[_0x20e4('0x82')],_0x3dff75[_0x20e4('0x65')]):_0x20e4('0x83');break;case'agent_alias':_0x4bd331=_0x3dff75['UserId']?_0x3dff75[_0x20e4('0x80')][_0x20e4('0x89')]||_0x3dff75[_0x20e4('0x80')]['fullname']:_0x20e4('0x83');break;case _0x20e4('0x8a'):_0x4bd331=_0x3dff75['UserId']?_0x3dff75[_0x20e4('0x80')][_0x20e4('0x53')]:_0x20e4('0x83');break;default:_0x4bd331=_0x3dff75[_0x20e4('0x65')]?util[_0x20e4('0x7b')](_0x20e4('0x85'),_0x43c1c6['agentAlias'],_0x3dff75['UserId']):_0x20e4('0x83');}var _0x1abbaf=util[_0x20e4('0x7b')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3dff75[_0x20e4('0x8b')])['format'](_0x20e4('0x8c')),_0x3dff75['direction']==='in'?_0x5cf134:_0x4bd331,_0x3dff75[_0x20e4('0x2e')]);if(!_0x3dff75[_0x20e4('0x8d')]){fs[_0x20e4('0x8e')](_0x4a711d,_0x1abbaf);}}return db['MailAccount'][_0x20e4('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0x20e4('0x8f')],'as':_0x20e4('0x90'),'raw':!![],'include':[{'model':db[_0x20e4('0x91')],'as':_0x20e4('0x91'),'raw':!![]}]}]});}}})['then'](function(_0x12a861){if(!_0x12a861||!_0x12a861['Smtp']||!_0x1186b2[_0x20e4('0x2e')])return _0xef777e;var _0x147bda=_0x12a861[_0x20e4('0x92')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x147bda,'message':{'from':util[_0x20e4('0x7b')](_0x20e4('0x93'),_0x12a861[_0x20e4('0x2a')],_0x12a861[_0x20e4('0x54')]||_0x12a861[_0x20e4('0x90')]['user']),'to':_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x79')],'subject':_0x20e4('0x94'),'text':util[_0x20e4('0x7b')](_0x20e4('0x95'),_0x1186b2[_0x20e4('0x2e')][_0x20e4('0x79')]),'attachments':[{'path':_0x4a711d}]}})['then'](function(){return _0xef777e;})[_0x20e4('0x20')](function(_0x3f6872){logger[_0x20e4('0x1b')](_0x3f6872);});})[_0x20e4('0x15')](respondWithStatusCode(_0x159c3e,0xc8))[_0x20e4('0x20')](handleError(_0x159c3e,null));};exports[_0x20e4('0x96')]=function(_0x3772a4,_0x6d2f3c){return db[_0x20e4('0x5f')][_0x20e4('0x49')]({'where':{'id':_0x3772a4['params']['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x6d2f3c,null))[_0x20e4('0x15')](function(_0x47e2de){if(_0x47e2de){return _0x47e2de[_0x20e4('0x96')](_0x3772a4['body'][_0x20e4('0x97')],_['omit'](_0x3772a4[_0x20e4('0x2e')],[_0x20e4('0x97'),'id'])||{});}})[_0x20e4('0x15')](respondWithResult(_0x6d2f3c,null))['catch'](handleError(_0x6d2f3c,null));};exports[_0x20e4('0x98')]=function(_0x28b358,_0x7f2445){var _0x153539={'raw':![],'where':{}};var _0x4a196c={};var _0x32d4f7={'count':0x0,'rows':[]};return db[_0x20e4('0x3f')][_0x20e4('0x4d')]({'where':{'id':_0x28b358[_0x20e4('0x3c')]['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x7f2445,null))[_0x20e4('0x15')](function(_0x5157cd){if(_0x5157cd){_0x4a196c[_0x20e4('0x3d')]=_['keys'](db[_0x20e4('0x5f')][_0x20e4('0x35')]);_0x4a196c[_0x20e4('0x42')]=_[_0x20e4('0x3e')](_0x28b358[_0x20e4('0x42')]);_0x4a196c[_0x20e4('0x40')]=_[_0x20e4('0x41')](_0x4a196c[_0x20e4('0x3d')],_0x4a196c[_0x20e4('0x42')]);_0x153539['attributes']=_[_0x20e4('0x41')](_0x4a196c[_0x20e4('0x3d')],qs[_0x20e4('0x44')](_0x28b358[_0x20e4('0x42')][_0x20e4('0x44')]));_0x153539[_0x20e4('0x43')]=_0x153539['attributes'][_0x20e4('0x45')]?_0x153539[_0x20e4('0x43')]:_0x4a196c['model'];if(!_0x28b358[_0x20e4('0x42')][_0x20e4('0x99')](_0x20e4('0x9a'))){_0x153539['limit']=qs['limit'](_0x28b358[_0x20e4('0x42')][_0x20e4('0x26')]);_0x153539[_0x20e4('0x24')]=qs[_0x20e4('0x24')](_0x28b358[_0x20e4('0x42')][_0x20e4('0x24')]);}_0x153539[_0x20e4('0x9b')]=qs['sort'](_0x28b358[_0x20e4('0x42')][_0x20e4('0x9c')]);_0x153539[_0x20e4('0x9d')]=qs[_0x20e4('0x40')](_[_0x20e4('0x9e')](_0x28b358[_0x20e4('0x42')],_0x4a196c['filters']));_0x153539['where'][_0x20e4('0x9f')]=_0x5157cd['id'];if(_0x28b358[_0x20e4('0x42')][_0x20e4('0xa0')]){_0x153539[_0x20e4('0x9d')]=_[_0x20e4('0x2d')](_0x153539['where'],{'$or':_[_0x20e4('0x34')](_0x153539[_0x20e4('0x43')],function(_0x268ffd){var _0x3e76b9={};_0x3e76b9[_0x268ffd]={'$like':'%'+_0x28b358['query']['filter']+'%'};return _0x3e76b9;})});}if(_0x28b358[_0x20e4('0x42')][_0x20e4('0xa1')]){var _0x368a28=_0x28b358[_0x20e4('0x42')][_0x20e4('0xa1')][_0x20e4('0xa2')](',');var _0x53520f={};_0x53520f[_0x368a28[0x0]]={'$gte':moment(_0x368a28[0x1])[_0x20e4('0x7b')](_0x20e4('0xa3'))};_0x153539[_0x20e4('0x9d')]=_[_0x20e4('0x2d')](_0x153539['where'],_0x53520f);}_0x153539=_[_0x20e4('0x2d')]({},_0x153539,_0x28b358[_0x20e4('0x48')]);return db[_0x20e4('0x5f')][_0x20e4('0x27')]({'where':_0x153539[_0x20e4('0x9d')]})[_0x20e4('0x15')](function(_0x5ee5ed){_0x32d4f7[_0x20e4('0x27')]=_0x5ee5ed;if(_0x28b358[_0x20e4('0x42')]['includeAll']){_0x153539['include']=[{'all':!![]}];}return db[_0x20e4('0x5f')]['findAll'](_0x153539);})[_0x20e4('0x15')](function(_0x4177be){_0x32d4f7['rows']=_0x4177be;return _0x32d4f7;});}})['then'](respondWithFilteredResult(_0x7f2445,_0x153539))['catch'](handleError(_0x7f2445,null));};exports[_0x20e4('0xa4')]=function(_0x28b305,_0x880704){var _0xfb5f24={'where':{}},_0x9f9772={},_0x38ad8d={'count':0x0,'rows':[]};return db[_0x20e4('0x3f')]['findOne']({'where':{'id':_0x28b305['params']['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x880704,null))[_0x20e4('0x15')](function(_0x1b1a0e){if(_0x1b1a0e){_0x9f9772[_0x20e4('0x3d')]=_['keys'](db[_0x20e4('0x5f')]['rawAttributes']);_0x9f9772[_0x20e4('0x42')]=_[_0x20e4('0x3e')](_0x28b305[_0x20e4('0x42')]);_0x9f9772[_0x20e4('0x40')]=_[_0x20e4('0x41')](_0x9f9772[_0x20e4('0x3d')],_0x9f9772['query']);_0xfb5f24[_0x20e4('0x43')]=_[_0x20e4('0x41')](_0x9f9772[_0x20e4('0x3d')],qs[_0x20e4('0x44')](_0x28b305[_0x20e4('0x42')][_0x20e4('0x44')]));_0xfb5f24[_0x20e4('0x43')]=_0xfb5f24[_0x20e4('0x43')][_0x20e4('0x45')]?_0xfb5f24['attributes']:_0x9f9772[_0x20e4('0x3d')];if(!_0x28b305['query'][_0x20e4('0x99')](_0x20e4('0x9a'))){_0xfb5f24['limit']=qs[_0x20e4('0x26')](_0x28b305[_0x20e4('0x42')]['limit']);_0xfb5f24['offset']=qs[_0x20e4('0x24')](_0x28b305[_0x20e4('0x42')]['offset']);}_0xfb5f24[_0x20e4('0x9b')]=qs[_0x20e4('0x9c')](_0x28b305[_0x20e4('0x42')][_0x20e4('0x9c')]);_0xfb5f24['where']=qs[_0x20e4('0x40')](_[_0x20e4('0x9e')](_0x28b305[_0x20e4('0x42')],_0x9f9772[_0x20e4('0x40')]));_0xfb5f24[_0x20e4('0x9d')][_0x20e4('0x9f')]=_0x1b1a0e['id'];if(_0x28b305[_0x20e4('0x42')]['filter']){_0xfb5f24[_0x20e4('0x9d')]=_[_0x20e4('0x2d')](_0xfb5f24[_0x20e4('0x9d')],{'$or':_[_0x20e4('0x34')](_0xfb5f24[_0x20e4('0x43')],function(_0x52f208){var _0x408b95={};_0x408b95[_0x52f208]={'$like':'%'+_0x28b305[_0x20e4('0x42')]['filter']+'%'};return _0x408b95;})});}_0xfb5f24['where'][_0x20e4('0x8d')]=![];if(_0x28b305[_0x20e4('0x42')]['id']){_0xfb5f24['where']['id']={'$gt':_0x28b305[_0x20e4('0x42')]['id']};}_0xfb5f24=_[_0x20e4('0x2d')]({},_0xfb5f24,_0x28b305[_0x20e4('0x48')]);return db[_0x20e4('0x5f')][_0x20e4('0x27')]({'where':_0xfb5f24['where']})[_0x20e4('0x15')](function(_0x21c583){_0x38ad8d['count']=_0x21c583;_0xfb5f24['include']=[];if(_0x28b305[_0x20e4('0x42')]['includeAgent']){_0xfb5f24[_0x20e4('0x47')][_0x20e4('0xa5')]({'model':db[_0x20e4('0x80')],'as':_0x20e4('0x80'),'attributes':['id','fullname',_0x20e4('0x89')]});}if(_0x28b305[_0x20e4('0x42')][_0x20e4('0x46')]){_0xfb5f24[_0x20e4('0x47')]=[{'all':!![]}];}return db[_0x20e4('0x5f')]['findAll'](_0xfb5f24);})[_0x20e4('0x15')](function(_0xfc88fc){_0x38ad8d[_0x20e4('0xa6')]=_0xfc88fc;return _0x38ad8d;});}})[_0x20e4('0x15')](respondWithFilteredResult(_0x880704,_0xfb5f24))[_0x20e4('0x20')](handleError(_0x880704,null));};exports[_0x20e4('0xa7')]=function(_0x23a920,_0x3ad567){return db[_0x20e4('0x3f')][_0x20e4('0x49')]({'where':{'id':_0x23a920[_0x20e4('0x3c')]['id']}})[_0x20e4('0x15')](handleEntityNotFound(_0x3ad567,null))['then'](function(_0x5cda52){if(_0x5cda52){return _0x5cda52['setTags'](_0x23a920[_0x20e4('0x2e')]['ids'],_[_0x20e4('0xa8')](_0x23a920[_0x20e4('0x2e')],[_0x20e4('0x97'),'id'])||{})[_0x20e4('0xa9')](function(){return db[_0x20e4('0xaa')][_0x20e4('0x39')]({'attributes':['id',_0x20e4('0x2a'),_0x20e4('0xab')],'where':{'id':_0x23a920[_0x20e4('0x2e')][_0x20e4('0x97')]}});})[_0x20e4('0x15')](function(_0x33e1eb){socket[_0x20e4('0xac')]('chatInteractionTags:save',{'id':Number(_0x23a920[_0x20e4('0x3c')]['id']),'tags':_0x33e1eb||[]});return{'id':Number(_0x23a920[_0x20e4('0x3c')]['id']),'tags':_0x33e1eb||[]};});}})[_0x20e4('0x15')](respondWithResult(_0x3ad567,null))[_0x20e4('0x20')](handleError(_0x3ad567,null));};exports[_0x20e4('0xad')]=function(_0xe9a5de,_0x38dcd7){return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0xe9a5de['params']['id']}})['then'](handleEntityNotFound(_0x38dcd7,null))[_0x20e4('0x15')](function(_0x33712b){if(_0x33712b){return _0x33712b[_0x20e4('0xad')](_0xe9a5de[_0x20e4('0x42')]['ids']);}})[_0x20e4('0x15')](respondWithStatusCode(_0x38dcd7,null))[_0x20e4('0x20')](handleError(_0x38dcd7,null));};exports[_0x20e4('0x78')]=function(_0x5985a7,_0x36b332){var _0xe45735=moment()['unix']()[_0x20e4('0xae')]();var _0x520ebf=path[_0x20e4('0x74')](config[_0x20e4('0x75')],'server',_0x20e4('0xaf'),'tmp');var _0x1baceb=path[_0x20e4('0x74')](config[_0x20e4('0x75')],_0x20e4('0xb0'),_0x20e4('0xaf'),'attachments');var _0xba5e76=path[_0x20e4('0x74')](_0x520ebf,_0xe45735);var _0x492287=util[_0x20e4('0x7b')](_0x20e4('0xb1'),_0x5985a7[_0x20e4('0x3c')]['id'],_0xe45735);var _0x413ec8=path[_0x20e4('0x74')](_0x520ebf,_0x492287);var _0xcddf31=[];_0xcddf31['push']({'model':db['User'],'as':_0x20e4('0x80'),'attributes':['id',_0x20e4('0x53')],'raw':!![]});_0xcddf31[_0x20e4('0xa5')]({'model':db['CmContact'],'as':_0x20e4('0x62'),'attributes':['id',_0x20e4('0xb2'),'lastName'],'raw':!![]});if(_0x5985a7['query'][_0x20e4('0xb3')]){_0xcddf31[_0x20e4('0xa5')]({'model':db[_0x20e4('0x6f')],'as':'Attachment','raw':!![]});}var _0x20b1fd=[{'model':db[_0x20e4('0x5f')],'as':_0x20e4('0x7f'),'attributes':['id',_0x20e4('0x2e'),_0x20e4('0x8b'),'direction',_0x20e4('0x8d'),'read'],'include':_0xcddf31}];_0x20b1fd[_0x20e4('0xa5')]({'model':db[_0x20e4('0xb4')],'as':_0x20e4('0xb5'),'attributes':['id',_0x20e4('0x2a')]});_0x20b1fd[_0x20e4('0xa5')]({'model':db[_0x20e4('0x80')],'as':_0x20e4('0xb6'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x20e4('0x49')]({'where':{'id':_0x5985a7[_0x20e4('0x3c')]['id']},'include':_0x20b1fd})[_0x20e4('0x15')](handleEntityNotFound(_0x36b332,null))[_0x20e4('0x15')](function(_0x2ac219){if(_0x2ac219){var _0xc052e=_0x2ac219[_0x20e4('0xb7')]({'plain':!![]});fs[_0x20e4('0xb8')](_0xba5e76);var _0x40d6e8={'channel':_0x20e4('0xb9'),'account':_0xc052e['Account']['name'],'agent':_0xc052e[_0x20e4('0xb6')]?_0xc052e[_0x20e4('0xb6')][_0x20e4('0x53')]:'N.A.','createdAt':moment(_0xc052e[_0x20e4('0x8b')])[_0x20e4('0x7b')](_0x20e4('0xa3'))[_0x20e4('0xae')](),'closedAt':_0xc052e[_0x20e4('0x66')]?moment(_0xc052e['closedAt'])[_0x20e4('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0xc052e['disposition'],'chatInfo':{'browser':_0xc052e['browserName'],'os':_0xc052e[_0x20e4('0xba')],'referer':_0xc052e[_0x20e4('0xbb')],'customerIp':_0xc052e['customerIp'],'customerPort':_0xc052e[_0x20e4('0xbc')]?_0xc052e['customerPort']:'N.A.'},'messages':_(_0xc052e[_0x20e4('0x7f')])[_0x20e4('0xbd')]()['filter']({'secret':![]})[_0x20e4('0x34')](function(_0x55d9ff){if(_0x55d9ff[_0x20e4('0x6f')]){var _0x27b663=path['join'](_0x1baceb,_0x55d9ff[_0x20e4('0x6f')][_0x20e4('0x6d')]);if(fs[_0x20e4('0xbe')](_0x27b663)){fs[_0x20e4('0xbf')](_0x27b663)[_0x20e4('0xc0')](fs['createWriteStream'](path[_0x20e4('0x74')](_0xba5e76,_0x55d9ff[_0x20e4('0x6f')]['basename'])));}}return{'date':moment(_0x55d9ff[_0x20e4('0x8b')])[_0x20e4('0x7b')](_0x20e4('0xa3'))['toString'](),'sender':_0x55d9ff[_0x20e4('0xc1')]===_0x20e4('0x5e')?_0x55d9ff[_0x20e4('0x80')]?_0x55d9ff[_0x20e4('0x80')]['fullname']:_0x20e4('0x83'):_0x55d9ff['Contact']['firstName']+(_0x55d9ff[_0x20e4('0x62')][_0x20e4('0xc2')]?'\x20'+_0x55d9ff[_0x20e4('0x62')][_0x20e4('0xc2')]:''),'body':_0x55d9ff['Attachment']?_0x55d9ff[_0x20e4('0x6f')]['basename']:_0x55d9ff[_0x20e4('0x2e')],'direction':_0x55d9ff[_0x20e4('0xc1')]===_0x20e4('0x5e')?'A':'C','secret':_0x55d9ff['secret'],'read':_0x55d9ff[_0x20e4('0xc3')],'attachment':_0x55d9ff[_0x20e4('0x6f')]};})[_0x20e4('0xc4')]()};return ejs[_0x20e4('0xc5')](path[_0x20e4('0x74')](config['root'],_0x20e4('0xb0'),_0x20e4('0xc6'),_0x20e4('0xc7')),{'interaction':_0x40d6e8})['then'](function(_0x463bbb){var _0x1cc618=path[_0x20e4('0x74')](_0xba5e76,'transcript-'+_0xc052e['id']+'-'+_0xe45735+_0x20e4('0xc8'));var _0x26b1c3={'path':_0x1cc618,'channel':_0x20e4('0xb9'),'interactionId':_0xc052e['id']};return pdf[_0x20e4('0xc9')](_0x463bbb,_0x26b1c3);})[_0x20e4('0x15')](function(){return new Promise(function(_0x4fdc64,_0xe1d666){zipdir(_0xba5e76,{'saveTo':_0x413ec8},function(_0x28f7ec,_0x1a97cb){if(_0x28f7ec)return _0xe1d666(_0x28f7ec);return _0x4fdc64(_0x1a97cb);});})[_0x20e4('0x15')](function(){return new BPromise(function(_0x253233,_0x1886a5){rimraf(_0xba5e76,function(_0x7bb7dc){if(_0x7bb7dc)_0x1886a5(_0x7bb7dc);return _0x253233();});});})[_0x20e4('0x15')](function(){return _0x36b332[_0x20e4('0x78')](_0x413ec8,_0x492287,function(_0x55ffd8){if(_0x55ffd8){logger[_0x20e4('0x1b')](_0x20e4('0xca'),_0x55ffd8);}else{fs[_0x20e4('0xcb')](_0x413ec8);}});});});}else{return _0x36b332[_0x20e4('0x21')](0xc8);}})[_0x20e4('0x20')](handleError(_0x36b332,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 23a76dc..87bc9b0 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 _0x1634=['findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map'];(function(_0x3112d0,_0x55961c){var _0x2ea0e1=function(_0x16c64c){while(--_0x16c64c){_0x3112d0['push'](_0x3112d0['shift']());}};_0x2ea0e1(++_0x55961c);}(_0x1634,0x198));var _0x4163=function(_0x52a755,_0x237d81){_0x52a755=_0x52a755-0x0;var _0x280129=_0x1634[_0x52a755];return _0x280129;};'use strict';var EventEmitter=require(_0x4163('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4163('0x1')];var ChatMessage=require(_0x4163('0x2'))['db'][_0x4163('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4163('0x4')](0x0);var events={'afterCreate':_0x4163('0x5'),'afterUpdate':_0x4163('0x6'),'afterDestroy':_0x4163('0x7')};function emitEvent(_0x5b5321){return function(_0x5b27db,_0x3dec77,_0x106c6e){_0x5b27db[_0x4163('0x8')]({'attributes':['id'],'raw':!![]})[_0x4163('0x9')](function(_0x1a7af2){_0x5b27db['setDataValue'](_0x4163('0xa'),_0x1a7af2[_0x4163('0xb')](function(_0x206953){return{'id':_0x206953['id']};}));return ChatMessage[_0x4163('0xc')]({'where':{'ChatInteractionId':_0x5b27db['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xba6389){_0x5b27db[_0x4163('0xd')](_0x4163('0xe'),_0xba6389[_0x4163('0xf')]);ChatInteractionEvents['emit'](_0x5b5321+':'+_0x5b27db['id'],_0x5b27db);ChatInteractionEvents[_0x4163('0x10')](_0x5b5321,_0x5b27db);_0x106c6e(null);})[_0x4163('0x11')](_0x106c6e(null));};}for(var e in events){if(events[_0x4163('0x12')](e)){var event=events[e];ChatInteraction[_0x4163('0x13')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x4514=['events','../../mysqldb','ChatInteraction','setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x4514,0xfc));var _0x4451=function(_0x27900c,_0x2868fd){_0x27900c=_0x27900c-0x0;var _0x3ea8e0=_0x4514[_0x27900c];return _0x3ea8e0;};'use strict';var EventEmitter=require(_0x4451('0x0'));var ChatInteraction=require(_0x4451('0x1'))['db'][_0x4451('0x2')];var ChatMessage=require(_0x4451('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4451('0x3')](0x0);var events={'afterCreate':_0x4451('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3be86e){return function(_0x1c621f,_0x348baf,_0x13e94b){_0x1c621f[_0x4451('0x5')]({'attributes':['id'],'raw':!![]})[_0x4451('0x6')](function(_0x55d661){_0x1c621f[_0x4451('0x7')](_0x4451('0x8'),_0x55d661[_0x4451('0x9')](function(_0x2d83be){return{'id':_0x2d83be['id']};}));return ChatMessage[_0x4451('0xa')]({'where':{'ChatInteractionId':_0x1c621f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4451('0x6')](function(_0x484370){_0x1c621f[_0x4451('0x7')](_0x4451('0xb'),_0x484370[_0x4451('0xc')]);ChatInteractionEvents[_0x4451('0xd')](_0x3be86e+':'+_0x1c621f['id'],_0x1c621f);ChatInteractionEvents[_0x4451('0xd')](_0x3be86e,_0x1c621f);_0x13e94b(null);})[_0x4451('0xe')](_0x13e94b(null));};}for(var e in events){if(events[_0x4451('0xf')](e)){var event=events[e];ChatInteraction[_0x4451('0x10')](e,emitEvent(event));}}module[_0x4451('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 46b3f66..927a5eb 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 _0x9f07=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions'];(function(_0x15148b,_0x4dd6cf){var _0x3bdf7f=function(_0x4dcec8){while(--_0x4dcec8){_0x15148b['push'](_0x15148b['shift']());}};_0x3bdf7f(++_0x4dd6cf);}(_0x9f07,0x71));var _0x79f0=function(_0x29326c,_0x125d69){_0x29326c=_0x29326c-0x0;var _0x20aba9=_0x9f07[_0x29326c];return _0x20aba9;};'use strict';var _=require(_0x79f0('0x0'));var util=require(_0x79f0('0x1'));var logger=require(_0x79f0('0x2'))(_0x79f0('0x3'));var moment=require(_0x79f0('0x4'));var BPromise=require('bluebird');var rp=require(_0x79f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79f0('0x6'));var config=require(_0x79f0('0x7'));var attributes=require(_0x79f0('0x8'));module[_0x79f0('0x9')]=function(_0x76e394,_0x734381){return _0x76e394[_0x79f0('0xa')](_0x79f0('0xb'),attributes,{'tableName':_0x79f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a08fa,_0xd9b1cf,_0x17318f){if(_0x2a08fa[_0x79f0('0xd')](_0x79f0('0xe'))){_0x2a08fa['closedAt']=moment()[_0x79f0('0xf')](_0x79f0('0x10'));}_0x17318f(null,_0x2a08fa);}},'charset':'utf8mb4','collate':_0x79f0('0x11')});};
\ No newline at end of file
+var _0xcd82=['utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xcd82,0x11e));var _0x2cd8=function(_0x1ac5ed,_0x37c9ea){_0x1ac5ed=_0x1ac5ed-0x0;var _0x56cda8=_0xcd82[_0x1ac5ed];return _0x56cda8;};'use strict';var _=require(_0x2cd8('0x0'));var util=require(_0x2cd8('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2cd8('0x2'));var rp=require(_0x2cd8('0x3'));var fs=require('fs');var path=require(_0x2cd8('0x4'));var rimraf=require(_0x2cd8('0x5'));var config=require('../../config/environment');var attributes=require(_0x2cd8('0x6'));module[_0x2cd8('0x7')]=function(_0x15bc39,_0x2932af){return _0x15bc39['define'](_0x2cd8('0x8'),attributes,{'tableName':_0x2cd8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1241e2,_0x242932,_0x3406ba){if(_0x1241e2[_0x2cd8('0xa')](_0x2cd8('0xb'))){_0x1241e2['closedAt']=moment()[_0x2cd8('0xc')](_0x2cd8('0xd'));}_0x3406ba(null,_0x1241e2);}},'charset':'utf8mb4','collate':_0x2cd8('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 52e8290..47189e8 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 _0x3c32=['error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','info','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x28b057,_0x205efa){var _0x781d8d=function(_0x23aeb4){while(--_0x23aeb4){_0x28b057['push'](_0x28b057['shift']());}};_0x781d8d(++_0x205efa);}(_0x3c32,0x11d));var _0x23c3=function(_0x55028d,_0x3d7980){_0x55028d=_0x55028d-0x0;var _0x17fd1e=_0x3c32[_0x55028d];return _0x17fd1e;};'use strict';var _=require(_0x23c3('0x0'));var util=require('util');var moment=require(_0x23c3('0x1'));var BPromise=require(_0x23c3('0x2'));var rs=require(_0x23c3('0x3'));var fs=require('fs');var Redis=require(_0x23c3('0x4'));var db=require(_0x23c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c3('0x6'))(_0x23c3('0x7'));var config=require(_0x23c3('0x8'));var jayson=require(_0x23c3('0x9'));var client=jayson[_0x23c3('0xa')][_0x23c3('0xb')]({'port':0x232a});config['redis']=_[_0x23c3('0xc')](config[_0x23c3('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23c3('0xd')]));require(_0x23c3('0xe'))['register'](socket);function respondWithRpcPromise(_0x212d6b,_0xe9304b,_0xd580b1){return new BPromise(function(_0x70e6d6,_0x553657){return client['request'](_0x212d6b,_0xd580b1)[_0x23c3('0xf')](function(_0x4ea131){logger['info'](_0x23c3('0x10'),_0xe9304b,_0x23c3('0x11'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xe9304b,_0x23c3('0x11'),JSON[_0x23c3('0x12')](_0x4ea131));if(_0x4ea131['error']){if(_0x4ea131[_0x23c3('0x13')][_0x23c3('0x14')]===0x1f4){logger[_0x23c3('0x13')](_0x23c3('0x10'),_0xe9304b,_0x4ea131[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x553657(_0x4ea131[_0x23c3('0x13')][_0x23c3('0x15')]);}logger[_0x23c3('0x13')]('ChatInteraction,\x20%s,\x20%s',_0xe9304b,_0x4ea131[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x70e6d6(_0x4ea131['error'][_0x23c3('0x15')]);}else{logger['info'](_0x23c3('0x10'),_0xe9304b,_0x23c3('0x11'));_0x70e6d6(_0x4ea131[_0x23c3('0x16')][_0x23c3('0x15')]);}})[_0x23c3('0x17')](function(_0x28ee27){logger['error'](_0x23c3('0x10'),_0xe9304b,_0x28ee27);_0x553657(_0x28ee27);});});}exports[_0x23c3('0x18')]=function(_0x2f17cf){var _0x55bf1e=this;return new Promise(function(_0x3d60e0,_0x5aa35e){return db[_0x23c3('0x19')][_0x23c3('0x1a')](_0x2f17cf['body'],{'raw':_0x2f17cf[_0x23c3('0x1b')]?_0x2f17cf[_0x23c3('0x1b')][_0x23c3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f17cf[_0x23c3('0x1b')]?_0x2f17cf[_0x23c3('0x1b')][_0x23c3('0x1d')]||null:null,'attributes':_0x2f17cf[_0x23c3('0x1b')]?_0x2f17cf[_0x23c3('0x1b')][_0x23c3('0x1e')]||null:null,'limit':_0x2f17cf[_0x23c3('0x1b')]?_0x2f17cf[_0x23c3('0x1b')][_0x23c3('0x1f')]||null:null})['then'](function(_0x4e451b){logger[_0x23c3('0x20')](_0x23c3('0x18'),_0x2f17cf);logger['debug']('UpdateChatInteraction',_0x2f17cf,JSON[_0x23c3('0x12')](_0x4e451b));_0x3d60e0(_0x4e451b);})[_0x23c3('0x17')](function(_0x1465a5){logger[_0x23c3('0x13')](_0x23c3('0x18'),_0x1465a5[_0x23c3('0x15')],_0x2f17cf);_0x5aa35e(_0x55bf1e[_0x23c3('0x13')](0x1f4,_0x1465a5[_0x23c3('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x1f97a7){return new Promise(function(_0x45dee2,_0x3c4e86){return db['ChatInteraction']['find']({'where':_0x1f97a7['options']?_0x1f97a7['options'][_0x23c3('0x1d')]||null:null})['then'](function(_0x1a1ed0){if(_0x1a1ed0){return _0x1a1ed0['addTags'](_0x1f97a7[_0x23c3('0x21')][_0x23c3('0x22')],_[_0x23c3('0x23')](_0x1f97a7[_0x23c3('0x21')],['ids','id'])||{});}})[_0x23c3('0x24')](function(_0x5e5c0d){logger[_0x23c3('0x20')](_0x23c3('0x25'),_0x1f97a7);logger['debug'](_0x23c3('0x25'),_0x1f97a7,JSON[_0x23c3('0x12')](_0x5e5c0d));_0x45dee2(_0x5e5c0d);})[_0x23c3('0x17')](function(_0x368c0e){logger[_0x23c3('0x13')](_0x23c3('0x25'),_0x368c0e['message'],_0x1f97a7);_0x3c4e86(_this[_0x23c3('0x13')](0x1f4,_0x368c0e[_0x23c3('0x15')]));});});};
\ No newline at end of file
+var _0x837b=['omit','ids','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags'];(function(_0x106517,_0x9ada4d){var _0x5a6280=function(_0x33805e){while(--_0x33805e){_0x106517['push'](_0x106517['shift']());}};_0x5a6280(++_0x9ada4d);}(_0x837b,0x14c));var _0xb837=function(_0x2c7f80,_0x2b0052){_0x2c7f80=_0x2c7f80-0x0;var _0x11fe38=_0x837b[_0x2c7f80];return _0x11fe38;};'use strict';var _=require(_0xb837('0x0'));var util=require('util');var moment=require(_0xb837('0x1'));var BPromise=require('bluebird');var rs=require(_0xb837('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb837('0x3'))['db'];var utils=require(_0xb837('0x4'));var logger=require(_0xb837('0x5'))(_0xb837('0x6'));var config=require('../../config/environment');var jayson=require(_0xb837('0x7'));var client=jayson[_0xb837('0x8')]['http']({'port':0x232a});config[_0xb837('0x9')]=_[_0xb837('0xa')](config['redis'],{'host':_0xb837('0xb'),'port':0x18eb});var socket=require(_0xb837('0xc'))(new Redis(config[_0xb837('0x9')]));require(_0xb837('0xd'))['register'](socket);function respondWithRpcPromise(_0x318b8a,_0x4c78a2,_0x161000){return new BPromise(function(_0x377511,_0x39575a){return client[_0xb837('0xe')](_0x318b8a,_0x161000)[_0xb837('0xf')](function(_0x3f0eaf){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4c78a2,_0xb837('0x10'));logger[_0xb837('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4c78a2,_0xb837('0x10'),JSON[_0xb837('0x12')](_0x3f0eaf));if(_0x3f0eaf[_0xb837('0x13')]){if(_0x3f0eaf[_0xb837('0x13')][_0xb837('0x14')]===0x1f4){logger[_0xb837('0x13')](_0xb837('0x15'),_0x4c78a2,_0x3f0eaf[_0xb837('0x13')][_0xb837('0x16')]);return _0x39575a(_0x3f0eaf[_0xb837('0x13')][_0xb837('0x16')]);}logger[_0xb837('0x13')](_0xb837('0x15'),_0x4c78a2,_0x3f0eaf['error'][_0xb837('0x16')]);return _0x377511(_0x3f0eaf[_0xb837('0x13')][_0xb837('0x16')]);}else{logger[_0xb837('0x17')](_0xb837('0x15'),_0x4c78a2,_0xb837('0x10'));_0x377511(_0x3f0eaf['result']['message']);}})[_0xb837('0x18')](function(_0x3f7107){logger['error'](_0xb837('0x15'),_0x4c78a2,_0x3f7107);_0x39575a(_0x3f7107);});});}exports[_0xb837('0x19')]=function(_0x2fcd94){var _0x458587=this;return new Promise(function(_0x40e6fc,_0x15ef9d){return db[_0xb837('0x1a')][_0xb837('0x1b')](_0x2fcd94[_0xb837('0x1c')],{'raw':_0x2fcd94[_0xb837('0x1d')]?_0x2fcd94[_0xb837('0x1d')][_0xb837('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fcd94[_0xb837('0x1d')]?_0x2fcd94[_0xb837('0x1d')]['where']||null:null,'attributes':_0x2fcd94[_0xb837('0x1d')]?_0x2fcd94[_0xb837('0x1d')][_0xb837('0x1f')]||null:null,'limit':_0x2fcd94['options']?_0x2fcd94[_0xb837('0x1d')][_0xb837('0x20')]||null:null})[_0xb837('0xf')](function(_0x2ed1cb){logger[_0xb837('0x17')](_0xb837('0x19'),_0x2fcd94);logger[_0xb837('0x11')]('UpdateChatInteraction',_0x2fcd94,JSON[_0xb837('0x12')](_0x2ed1cb));_0x40e6fc(_0x2ed1cb);})['catch'](function(_0x3413a9){logger[_0xb837('0x13')](_0xb837('0x19'),_0x3413a9['message'],_0x2fcd94);_0x15ef9d(_0x458587['error'](0x1f4,_0x3413a9[_0xb837('0x16')]));});});};exports[_0xb837('0x21')]=function(_0x1446d0){return new Promise(function(_0xcea74c,_0x12d1a1){return db['ChatInteraction'][_0xb837('0x22')]({'where':_0x1446d0[_0xb837('0x1d')]?_0x1446d0['options'][_0xb837('0x23')]||null:null})[_0xb837('0xf')](function(_0x582ab4){if(_0x582ab4){return _0x582ab4[_0xb837('0x24')](_0x1446d0['body']['ids'],_[_0xb837('0x25')](_0x1446d0['body'],[_0xb837('0x26'),'id'])||{});}})[_0xb837('0x27')](function(_0x45a6e9){logger[_0xb837('0x17')]('AddTags',_0x1446d0);logger['debug'](_0xb837('0x28'),_0x1446d0,JSON[_0xb837('0x12')](_0x45a6e9));_0xcea74c(_0x45a6e9);})[_0xb837('0x18')](function(_0x3a74a9){logger['error']('AddTags',_0x3a74a9['message'],_0x1446d0);_0x12d1a1(_this['error'](0x1f4,_0x3a74a9[_0xb837('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 25d4073..4be20a1 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 _0xd6e1=['emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x4ce422,_0x100a18){var _0x4ae250=function(_0x309ac0){while(--_0x309ac0){_0x4ce422['push'](_0x4ce422['shift']());}};_0x4ae250(++_0x100a18);}(_0xd6e1,0x9c));var _0x1d6e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd6e1[_0x21a9d9];return _0x46adce;};'use strict';var ChatInteractionEvents=require(_0x1d6e('0x0'));var events=[_0x1d6e('0x1'),_0x1d6e('0x2'),_0x1d6e('0x3')];function createListener(_0x2fdb6d,_0x1b5666){return function(_0x360601){_0x1b5666[_0x1d6e('0x4')](_0x2fdb6d,_0x360601);};}function removeListener(_0x5b24d4,_0x5ad7cb){return function(){ChatInteractionEvents[_0x1d6e('0x5')](_0x5b24d4,_0x5ad7cb);};}exports['register']=function(_0x7e022f){for(var _0x44f06f=0x0,_0x2a3bba=events[_0x1d6e('0x6')];_0x44f06f<_0x2a3bba;_0x44f06f++){var _0x5a218c=events[_0x44f06f];var _0x2da0ae=createListener(_0x1d6e('0x7')+_0x5a218c,_0x7e022f);ChatInteractionEvents['on'](_0x5a218c,_0x2da0ae);}};
\ No newline at end of file
+var _0x1b9c=['removeListener','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x183214,_0x2b0629){var _0x701714=function(_0x24f5fc){while(--_0x24f5fc){_0x183214['push'](_0x183214['shift']());}};_0x701714(++_0x2b0629);}(_0x1b9c,0x1ad));var _0xc1b9=function(_0x473773,_0x55bf3c){_0x473773=_0x473773-0x0;var _0x14a95c=_0x1b9c[_0x473773];return _0x14a95c;};'use strict';var ChatInteractionEvents=require(_0xc1b9('0x0'));var events=[_0xc1b9('0x1'),'remove',_0xc1b9('0x2')];function createListener(_0xe4413e,_0x5551a4){return function(_0x8d93c4){_0x5551a4['emit'](_0xe4413e,_0x8d93c4);};}function removeListener(_0x90b4e4,_0x5593de){return function(){ChatInteractionEvents[_0xc1b9('0x3')](_0x90b4e4,_0x5593de);};}exports['register']=function(_0x21e501){for(var _0x56a1f5=0x0,_0x52ac80=events[_0xc1b9('0x4')];_0x56a1f5<_0x52ac80;_0x56a1f5++){var _0x1b9fe7=events[_0x56a1f5];var _0x584782=createListener(_0xc1b9('0x5')+_0x1b9fe7,_0x21e501);ChatInteractionEvents['on'](_0x1b9fe7,_0x584782);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index ea8e41b..00163cc 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 _0x335e=['originalname','replace','single','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','now'];(function(_0xb4e052,_0x1d3cb6){var _0x5197e7=function(_0x9bc429){while(--_0x9bc429){_0xb4e052['push'](_0xb4e052['shift']());}};_0x5197e7(++_0x1d3cb6);}(_0x335e,0xaf));var _0xe335=function(_0x48d9cc,_0x5a0935){_0x48d9cc=_0x48d9cc-0x0;var _0x41078e=_0x335e[_0x48d9cc];return _0x41078e;};'use strict';var multer=require('multer');var util=require(_0xe335('0x0'));var path=require(_0xe335('0x1'));var timeout=require(_0xe335('0x2'));var express=require(_0xe335('0x3'));var router=express['Router']();var fs_extra=require(_0xe335('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe335('0x5'));var config=require(_0xe335('0x6'));var controller=require(_0xe335('0x7'));router[_0xe335('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe335('0x8')](_0xe335('0x9'),auth[_0xe335('0xa')](),controller['describe']);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller[_0xe335('0xb')]);router[_0xe335('0x8')](_0xe335('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xe335('0xd')]);router[_0xe335('0x8')](_0xe335('0xe'),auth[_0xe335('0xa')](),controller[_0xe335('0xf')]);router[_0xe335('0x8')](_0xe335('0x10'),auth[_0xe335('0x11')](),controller[_0xe335('0x12')]);router[_0xe335('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xe335('0x13')]);router[_0xe335('0x14')]('/',auth[_0xe335('0xa')](),controller[_0xe335('0x15')]);router['post'](_0xe335('0x16'),auth['isAuthenticated'](),controller[_0xe335('0x17')]);var upload=multer({'storage':multer[_0xe335('0x18')]({'destination':function(_0x38c0c1,_0x5e9233,_0xee2c17){_0xee2c17(null,path['join'](config[_0xe335('0x19')],'server/files/attachments/'));},'filename':function(_0x398658,_0x566249,_0x130f03){_0x130f03(null,util[_0xe335('0x1a')](_0xe335('0x1b'),Date[_0xe335('0x1c')](),_0x566249[_0xe335('0x1d')][_0xe335('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe335('0x14')]('/:id/attachment_upload',upload[_0xe335('0x1f')]('file'),controller['attachmentUpload']);router['post'](_0xe335('0xe'),auth[_0xe335('0x11')](),controller['addMessage']);router['post'](_0xe335('0x20'),auth[_0xe335('0xa')](),interaction[_0xe335('0x21')](_0xe335('0x22'),_0xe335('0x23')),controller[_0xe335('0x24')]);router[_0xe335('0x25')](_0xe335('0x26'),auth[_0xe335('0xa')](),interaction[_0xe335('0x21')](_0xe335('0x22'),_0xe335('0x27')),controller[_0xe335('0x28')]);router['put'](_0xe335('0x29'),controller[_0xe335('0x2a')]);router[_0xe335('0x25')](_0xe335('0x2b'),auth[_0xe335('0x11')](),controller[_0xe335('0x2c')]);router[_0xe335('0x25')](_0xe335('0x2d'),controller[_0xe335('0x2e')]);router[_0xe335('0x2f')](_0xe335('0x26'),auth[_0xe335('0xa')](),interaction[_0xe335('0x21')]('chat','chatinteraction:destroy'),controller[_0xe335('0x30')]);router[_0xe335('0x2f')](_0xe335('0x20'),auth[_0xe335('0xa')](),controller[_0xe335('0x31')]);module[_0xe335('0x32')]=router;
\ No newline at end of file
+var _0x6dc2=['/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','chat','chatinteraction:addtags','addTags','tracked','chatinteraction:update','put','customUpdate','/:id/abandon','abandon','close','chatinteraction:destroy','destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages'];(function(_0xddfab6,_0x57f0f6){var _0x238867=function(_0x13e72e){while(--_0x13e72e){_0xddfab6['push'](_0xddfab6['shift']());}};_0x238867(++_0x57f0f6);}(_0x6dc2,0xc5));var _0x26dc=function(_0x26e9c6,_0x3b7098){_0x26e9c6=_0x26e9c6-0x0;var _0x461ebc=_0x6dc2[_0x26e9c6];return _0x461ebc;};'use strict';var multer=require(_0x26dc('0x0'));var util=require(_0x26dc('0x1'));var path=require(_0x26dc('0x2'));var timeout=require(_0x26dc('0x3'));var express=require(_0x26dc('0x4'));var router=express[_0x26dc('0x5')]();var fs_extra=require(_0x26dc('0x6'));var auth=require(_0x26dc('0x7'));var interaction=require(_0x26dc('0x8'));var config=require(_0x26dc('0x9'));var controller=require(_0x26dc('0xa'));router[_0x26dc('0xb')]('/',auth[_0x26dc('0xc')](),controller[_0x26dc('0xd')]);router[_0x26dc('0xb')](_0x26dc('0xe'),auth[_0x26dc('0xc')](),controller[_0x26dc('0xf')]);router[_0x26dc('0xb')](_0x26dc('0x10'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x12')]);router[_0x26dc('0xb')](_0x26dc('0x13'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x14')]);router[_0x26dc('0xb')](_0x26dc('0x15'),auth['isAuthenticated'](),controller[_0x26dc('0x16')]);router[_0x26dc('0xb')](_0x26dc('0x17'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x18')]);router[_0x26dc('0xb')](_0x26dc('0x19'),auth[_0x26dc('0xc')](),controller[_0x26dc('0x1a')]);router[_0x26dc('0x1b')]('/',auth['isAuthenticated'](),controller[_0x26dc('0x1c')]);router[_0x26dc('0x1b')]('/:id/vidaoo',auth[_0x26dc('0xc')](),controller[_0x26dc('0x1d')]);var upload=multer({'storage':multer[_0x26dc('0x1e')]({'destination':function(_0x11bf94,_0x1b880c,_0xf92c3f){_0xf92c3f(null,path['join'](config[_0x26dc('0x1f')],_0x26dc('0x20')));},'filename':function(_0x5f243b,_0x4712b0,_0x21eba9){_0x21eba9(null,util[_0x26dc('0x21')]('%s-%s',Date['now'](),_0x4712b0[_0x26dc('0x22')][_0x26dc('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x26dc('0x1b')](_0x26dc('0x24'),upload[_0x26dc('0x25')]('file'),controller[_0x26dc('0x26')]);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x26dc('0x27')]);router[_0x26dc('0x1b')]('/:id/tags',auth[_0x26dc('0xc')](),interaction['tracked'](_0x26dc('0x28'),_0x26dc('0x29')),controller[_0x26dc('0x2a')]);router['put'](_0x26dc('0x10'),auth['isAuthenticated'](),interaction[_0x26dc('0x2b')](_0x26dc('0x28'),_0x26dc('0x2c')),controller['update']);router[_0x26dc('0x2d')]('/:id/custom_update',controller[_0x26dc('0x2e')]);router['put'](_0x26dc('0x2f'),auth[_0x26dc('0x11')](),controller[_0x26dc('0x30')]);router['put']('/:id/close',controller[_0x26dc('0x31')]);router['delete']('/:id',auth[_0x26dc('0xc')](),interaction[_0x26dc('0x2b')](_0x26dc('0x28'),_0x26dc('0x32')),controller[_0x26dc('0x33')]);router[_0x26dc('0x34')](_0x26dc('0x35'),auth[_0x26dc('0xc')](),controller['removeTags']);module[_0x26dc('0x36')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 5cd9022..b9f1378 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 _0x25ee=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x1419fb,_0x5bd084){var _0x2b3c60=function(_0x2a749a){while(--_0x2a749a){_0x1419fb['push'](_0x1419fb['shift']());}};_0x2b3c60(++_0x5bd084);}(_0x25ee,0x1f2));var _0xe25e=function(_0x303e03,_0x48c0cf){_0x303e03=_0x303e03-0x0;var _0xc72223=_0x25ee[_0x303e03];return _0xc72223;};'use strict';var Sequelize=require(_0xe25e('0x0'));module[_0xe25e('0x1')]={'body':{'type':Sequelize[_0xe25e('0x2')](_0xe25e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe25e('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe25e('0x5')]}};
\ No newline at end of file
+var _0x2435=['BOOLEAN','INTEGER','TEXT','medium'];(function(_0x14a63a,_0x5a0ad1){var _0x1cc157=function(_0x136390){while(--_0x136390){_0x14a63a['push'](_0x14a63a['shift']());}};_0x1cc157(++_0x5a0ad1);}(_0x2435,0x146));var _0x5243=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x2435[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5243('0x0')](_0x5243('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5243('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5243('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index e3fa093..ccc8872 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 _0x0196=['crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','status','end','offset','undefined','limit','count','set','json','apply','reject','then','sendStatus','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','keys','find','create','body','params','destroy','describe','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','read','-createdAt','all','rimraf','request-promise','mustache','util','path','ejs','lodash','squel'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x0196,0xc4));var _0x6019=function(_0x226da5,_0x393d1a){_0x226da5=_0x226da5-0x0;var _0x57ce5e=_0x0196[_0x226da5];return _0x57ce5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6019('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6019('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6019('0x2'));var util=require(_0x6019('0x3'));var path=require(_0x6019('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6019('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6019('0x6'));var squel=require(_0x6019('0x7'));var crypto=require(_0x6019('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6019('0x9'));var toCsv=require(_0x6019('0xa'));var querystring=require(_0x6019('0xb'));var Papa=require('papaparse');var Redis=require(_0x6019('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6019('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6019('0xe'));var logger=require('../../config/logger')(_0x6019('0xf'));var utils=require(_0x6019('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6019('0x11'))['db'];config[_0x6019('0x12')]=_[_0x6019('0x13')](config[_0x6019('0x12')],{'host':_0x6019('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6019('0x12')]));require('./chatInternalMessage.socket')[_0x6019('0x15')](socket);function respondWithStatusCode(_0xccf2c0,_0xba4a54){_0xba4a54=_0xba4a54||0xcc;return function(_0xe9e3a1){if(_0xe9e3a1){return _0xccf2c0['sendStatus'](_0xba4a54);}return _0xccf2c0[_0x6019('0x16')](_0xba4a54)[_0x6019('0x17')]();};}function respondWithResult(_0x58be2e,_0x3595de){_0x3595de=_0x3595de||0xc8;return function(_0x552129){if(_0x552129){return _0x58be2e[_0x6019('0x16')](_0x3595de)['json'](_0x552129);}};}function respondWithFilteredResult(_0x5d49f6,_0x20e0c8){return function(_0x5256bc){if(_0x5256bc){var _0x3e03fc=typeof _0x20e0c8[_0x6019('0x18')]===_0x6019('0x19')&&typeof _0x20e0c8[_0x6019('0x1a')]===_0x6019('0x19');var _0x136c0a=_0x5256bc['count'];var _0x39777c=_0x3e03fc?0x0:_0x20e0c8[_0x6019('0x18')];var _0x1ac0a4=_0x3e03fc?_0x5256bc[_0x6019('0x1b')]:_0x20e0c8[_0x6019('0x18')]+_0x20e0c8[_0x6019('0x1a')];var _0x352c73;if(_0x1ac0a4>=_0x136c0a){_0x1ac0a4=_0x136c0a;_0x352c73=0xc8;}else{_0x352c73=0xce;}_0x5d49f6[_0x6019('0x16')](_0x352c73);return _0x5d49f6[_0x6019('0x1c')]('Content-Range',_0x39777c+'-'+_0x1ac0a4+'/'+_0x136c0a)[_0x6019('0x1d')](_0x5256bc);}return null;};}function patchUpdates(_0x2e34c6){return function(_0x428230){try{jsonpatch[_0x6019('0x1e')](_0x428230,_0x2e34c6,!![]);}catch(_0xfd5b16){return BPromise[_0x6019('0x1f')](_0xfd5b16);}return _0x428230['save']();};}function saveUpdates(_0x2f305c,_0x4a6f36){return function(_0x2c26da){if(_0x2c26da){return _0x2c26da['update'](_0x2f305c)[_0x6019('0x20')](function(_0x4eedf6){return _0x4eedf6;});}return null;};}function removeEntity(_0x29bbf6,_0x7536e3){return function(_0x17b096){if(_0x17b096){return _0x17b096['destroy']()[_0x6019('0x20')](function(){_0x29bbf6['status'](0xcc)[_0x6019('0x17')]();});}};}function handleEntityNotFound(_0x348656,_0x53dc39){return function(_0x139db2){if(!_0x139db2){_0x348656[_0x6019('0x21')](0x194);}return _0x139db2;};}function handleError(_0x2f07bb,_0x4392ef){_0x4392ef=_0x4392ef||0x1f4;return function(_0x4a873b){logger[_0x6019('0x22')](_0x4a873b[_0x6019('0x23')]);if(_0x4a873b[_0x6019('0x24')]){delete _0x4a873b[_0x6019('0x24')];}_0x2f07bb[_0x6019('0x16')](_0x4392ef)[_0x6019('0x25')](_0x4a873b);};}exports['index']=function(_0x212551,_0x4e956b){var _0x4d8666={},_0x912959={},_0x20e833={'count':0x0,'rows':[]};var _0x34895d=_[_0x6019('0x26')](db[_0x6019('0x27')][_0x6019('0x28')],function(_0x33f219){return{'name':_0x33f219[_0x6019('0x29')],'type':_0x33f219[_0x6019('0x2a')][_0x6019('0x2b')]};});_0x912959[_0x6019('0x2c')]=_[_0x6019('0x26')](_0x34895d,_0x6019('0x24'));_0x912959[_0x6019('0x2d')]=_['keys'](_0x212551[_0x6019('0x2d')]);_0x912959[_0x6019('0x2e')]=_[_0x6019('0x2f')](_0x912959[_0x6019('0x2c')],_0x912959[_0x6019('0x2d')]);_0x4d8666['attributes']=_[_0x6019('0x2f')](_0x912959[_0x6019('0x2c')],qs[_0x6019('0x30')](_0x212551['query'][_0x6019('0x30')]));_0x4d8666[_0x6019('0x31')]=_0x4d8666[_0x6019('0x31')][_0x6019('0x32')]?_0x4d8666[_0x6019('0x31')]:_0x912959[_0x6019('0x2c')];if(!_0x212551[_0x6019('0x2d')][_0x6019('0x33')]('nolimit')){_0x4d8666[_0x6019('0x1a')]=qs['limit'](_0x212551[_0x6019('0x2d')][_0x6019('0x1a')]);_0x4d8666[_0x6019('0x18')]=qs[_0x6019('0x18')](_0x212551[_0x6019('0x2d')][_0x6019('0x18')]);}_0x4d8666['order']=qs[_0x6019('0x34')](_0x212551[_0x6019('0x2d')][_0x6019('0x34')]);_0x4d8666[_0x6019('0x35')]=qs[_0x6019('0x2e')](_[_0x6019('0x36')](_0x212551[_0x6019('0x2d')],_0x912959[_0x6019('0x2e')]),_0x34895d);if(_0x212551['query'][_0x6019('0x37')]){_0x4d8666[_0x6019('0x35')]=_['merge'](_0x4d8666[_0x6019('0x35')],{'$or':_[_0x6019('0x26')](_0x34895d,function(_0x149238){if(_0x149238[_0x6019('0x2a')]!=='VIRTUAL'){var _0xe4fbd6={};_0xe4fbd6[_0x149238['name']]={'$like':'%'+_0x212551['query']['filter']+'%'};return _0xe4fbd6;}})});}_0x4d8666=_[_0x6019('0x38')]({},_0x4d8666,_0x212551[_0x6019('0x39')]);var _0x36053e={'where':_0x4d8666['where']};return db[_0x6019('0x27')][_0x6019('0x1b')](_0x36053e)['then'](function(_0x330527){_0x20e833[_0x6019('0x1b')]=_0x330527;if(_0x212551[_0x6019('0x2d')][_0x6019('0x3a')]){_0x4d8666['include']=[{'all':!![]}];}return db[_0x6019('0x27')][_0x6019('0x3b')](_0x4d8666);})[_0x6019('0x20')](function(_0x5a4278){_0x20e833['rows']=_0x5a4278;return _0x20e833;})['then'](respondWithFilteredResult(_0x4e956b,_0x4d8666))[_0x6019('0x3c')](handleError(_0x4e956b,null));};exports[_0x6019('0x3d')]=function(_0x4db31c,_0x4e294e){var _0x2e4c86={'raw':!![],'where':{'id':_0x4db31c['params']['id']}},_0x239048={};_0x239048['model']=_[_0x6019('0x3e')](db['ChatInternalMessage'][_0x6019('0x28')]);_0x239048[_0x6019('0x2d')]=_['keys'](_0x4db31c[_0x6019('0x2d')]);_0x239048[_0x6019('0x2e')]=_[_0x6019('0x2f')](_0x239048['model'],_0x239048[_0x6019('0x2d')]);_0x2e4c86[_0x6019('0x31')]=_[_0x6019('0x2f')](_0x239048[_0x6019('0x2c')],qs[_0x6019('0x30')](_0x4db31c['query'][_0x6019('0x30')]));_0x2e4c86[_0x6019('0x31')]=_0x2e4c86[_0x6019('0x31')][_0x6019('0x32')]?_0x2e4c86['attributes']:_0x239048[_0x6019('0x2c')];if(_0x4db31c[_0x6019('0x2d')][_0x6019('0x3a')]){_0x2e4c86['include']=[{'all':!![]}];}_0x2e4c86=_[_0x6019('0x38')]({},_0x2e4c86,_0x4db31c[_0x6019('0x39')]);return db[_0x6019('0x27')][_0x6019('0x3f')](_0x2e4c86)[_0x6019('0x20')](handleEntityNotFound(_0x4e294e,null))[_0x6019('0x20')](respondWithResult(_0x4e294e,null))[_0x6019('0x3c')](handleError(_0x4e294e,null));};exports['create']=function(_0x4dac8c,_0x552b24){return db[_0x6019('0x27')][_0x6019('0x40')](_0x4dac8c['body'],{})[_0x6019('0x20')](respondWithResult(_0x552b24,0xc9))[_0x6019('0x3c')](handleError(_0x552b24,null));};exports['update']=function(_0x2aa943,_0x289ee1){if(_0x2aa943[_0x6019('0x41')]['id']){delete _0x2aa943[_0x6019('0x41')]['id'];}return db[_0x6019('0x27')][_0x6019('0x3f')]({'where':{'id':_0x2aa943[_0x6019('0x42')]['id']}})[_0x6019('0x20')](handleEntityNotFound(_0x289ee1,null))['then'](saveUpdates(_0x2aa943[_0x6019('0x41')],null))[_0x6019('0x20')](respondWithResult(_0x289ee1,null))['catch'](handleError(_0x289ee1,null));};exports[_0x6019('0x43')]=function(_0x1d024e,_0x2bd0ec){return db['ChatInternalMessage'][_0x6019('0x3f')]({'where':{'id':_0x1d024e[_0x6019('0x42')]['id']}})[_0x6019('0x20')](handleEntityNotFound(_0x2bd0ec,null))[_0x6019('0x20')](removeEntity(_0x2bd0ec,null))[_0x6019('0x3c')](handleError(_0x2bd0ec,null));};exports['describe']=function(_0x47950e,_0x23fa0a){return db['ChatInternalMessage'][_0x6019('0x44')]()['then'](respondWithResult(_0x23fa0a,null))[_0x6019('0x3c')](handleError(_0x23fa0a,null));};function wrapUser(_0x411cbd){return function(_0x19fa24){var _0x1983ff=_0x411cbd['get']({'plain':!![]});_0x1983ff[_0x6019('0x45')]=[];if(_0x19fa24){_0x1983ff['lastMessageAt']=_0x19fa24[_0x6019('0x46')];_0x1983ff['lastMessage']=_0x19fa24;}else{_0x1983ff[_0x6019('0x47')]=moment(0x0)[_0x6019('0x48')](_0x6019('0x49'));_0x1983ff[_0x6019('0x4a')]={};}return _0x1983ff;};}exports[_0x6019('0x4b')]=function(_0x580929,_0x5ee2ae,_0x5cbae0){var _0x437715=[];return db[_0x6019('0x4c')]['findAll']({'where':{'role':[_0x6019('0x4d'),_0x6019('0x4e'),_0x6019('0x4f')]},'attributes':['id',_0x6019('0x50'),_0x6019('0x24'),_0x6019('0x51'),_0x6019('0x52'),_0x6019('0x53'),_0x6019('0x54'),_0x6019('0x55'),_0x6019('0x56'),_0x6019('0x57')],'order':qs['sort'](_0x6019('0x58')),'include':[{'model':db['VoiceQueue'],'as':_0x6019('0x59'),'attributes':['id',_0x6019('0x24'),_0x6019('0x2a')],'through':{'attributes':[]}}]})[_0x6019('0x20')](function(_0x4eb425){if(_0x4eb425){var _0x36dc3f=_0x580929[_0x6019('0x4f')]['get']({'plain':!![]});if(!_0x36dc3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36dc3f[_0x6019('0x51')]===_0x6019('0x4f')){return db[_0x6019('0x5a')]['find']({'where':{'name':_0x6019('0x5b'),'userProfileId':_0x36dc3f[_0x6019('0x5c')]},'raw':!![]})[_0x6019('0x20')](function(_0x1de5f4){if(_0x1de5f4){if(_0x1de5f4[_0x6019('0x5d')]===0x0){return db[_0x6019('0x5e')]['findAll']({'where':{'sectionId':_0x1de5f4['id']},'raw':!![]})['then'](function(_0x1cfab8){var _0x4617f8=[];if(_[_0x6019('0x5f')](_0x1cfab8)){_0x4617f8=_[_0x6019('0x37')](_0x4eb425,function(_0x51180d){if(_0x51180d[_0x6019('0x51')]!=='agent'){return _0x51180d;}});return _0x4617f8;}else{for(var _0x62e373=0x0;_0x62e373<_0x4eb425[_0x6019('0x32')];_0x62e373++){var _0x16ddcb=_0x4eb425[_0x62e373];if(_0x16ddcb['role']===_0x6019('0x4d')){var _0xe7ed64=_[_0x6019('0x3f')](_0x1cfab8,function(_0x32531f){return _0x32531f['resourceId']===_0x16ddcb['id'];});if(_0xe7ed64)_0x4617f8[_0x6019('0x60')](_0x16ddcb);}else{_0x4617f8[_0x6019('0x60')](_0x16ddcb);}}return _0x4617f8;}});}else{return _0x4eb425;}}else{var _0x104896=_[_0x6019('0x37')](_0x4eb425,function(_0x211f36){if(_0x211f36[_0x6019('0x51')]!==_0x6019('0x4d')){return _0x211f36;}});return _0x104896;}});}else{return _0x4eb425;}}})['then'](function(_0x123c5a){var _0x11918f=[];if(_0x123c5a){_0x437715=_0x123c5a;for(var _0x34a851=0x0;_0x34a851<_0x123c5a[_0x6019('0x32')];_0x34a851+=0x1){_0x437715[_0x34a851][_0x6019('0x45')]=[];_0x11918f[_0x6019('0x60')](db[_0x6019('0x27')][_0x6019('0x3f')]({'where':{'FromId':[_0x580929['user']['id'],_0x123c5a[_0x34a851]['id']],'ToId':[_0x580929[_0x6019('0x4f')]['id'],_0x123c5a[_0x34a851]['id']],'ChatGroupId':null},'attributes':['id',_0x6019('0x46'),_0x6019('0x61'),_0x6019('0x62'),_0x6019('0x63'),'body'],'order':qs[_0x6019('0x34')](_0x6019('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6019('0x20')](wrapUser(_0x123c5a[_0x34a851])));}return BPromise[_0x6019('0x65')](_0x11918f);}return[];})[_0x6019('0x20')](function(_0x3cc741){return{'rows':_0x3cc741,'count':_0x3cc741[_0x6019('0x32')]};})['then'](respondWithResult(_0x5ee2ae,null))['catch'](handleError(_0x5ee2ae,null));};
\ No newline at end of file
+var _0xf038=['get','messages','lastMessageAt','createdAt','format','lastMessage','getUsers','User','agent','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','push','user','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','describe'];(function(_0x23b204,_0x4b773c){var _0x29ac3b=function(_0x26dedf){while(--_0x26dedf){_0x23b204['push'](_0x23b204['shift']());}};_0x29ac3b(++_0x4b773c);}(_0xf038,0x1ea));var _0x8f03=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0xf038[_0x12e3e3];return _0x26602e;};'use strict';var emlformat=require(_0x8f03('0x0'));var rimraf=require(_0x8f03('0x1'));var zipdir=require(_0x8f03('0x2'));var jsonpatch=require(_0x8f03('0x3'));var rp=require(_0x8f03('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8f03('0x5'));var util=require(_0x8f03('0x6'));var path=require(_0x8f03('0x7'));var sox=require(_0x8f03('0x8'));var csv=require(_0x8f03('0x9'));var ejs=require(_0x8f03('0xa'));var fs=require('fs');var fs_extra=require(_0x8f03('0xb'));var _=require(_0x8f03('0xc'));var squel=require(_0x8f03('0xd'));var crypto=require(_0x8f03('0xe'));var jsforce=require(_0x8f03('0xf'));var deskjs=require(_0x8f03('0x10'));var toCsv=require(_0x8f03('0x9'));var querystring=require(_0x8f03('0x11'));var Papa=require('papaparse');var Redis=require(_0x8f03('0x12'));var authService=require(_0x8f03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8f03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f03('0x15'))(_0x8f03('0x16'));var utils=require(_0x8f03('0x17'));var config=require(_0x8f03('0x18'));var licenseUtil=require(_0x8f03('0x19'));var db=require(_0x8f03('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8f03('0x1b'),'port':0x18eb});var socket=require(_0x8f03('0x1c'))(new Redis(config[_0x8f03('0x1d')]));require(_0x8f03('0x1e'))['register'](socket);function respondWithStatusCode(_0x5bdbf2,_0x44f3cb){_0x44f3cb=_0x44f3cb||0xcc;return function(_0x58b779){if(_0x58b779){return _0x5bdbf2[_0x8f03('0x1f')](_0x44f3cb);}return _0x5bdbf2[_0x8f03('0x20')](_0x44f3cb)[_0x8f03('0x21')]();};}function respondWithResult(_0x512ca9,_0x295d6){_0x295d6=_0x295d6||0xc8;return function(_0x3d2c7f){if(_0x3d2c7f){return _0x512ca9[_0x8f03('0x20')](_0x295d6)['json'](_0x3d2c7f);}};}function respondWithFilteredResult(_0xca857d,_0x295a48){return function(_0x330af9){if(_0x330af9){var _0xd11178=typeof _0x295a48[_0x8f03('0x22')]==='undefined'&&typeof _0x295a48['limit']===_0x8f03('0x23');var _0x474fdb=_0x330af9[_0x8f03('0x24')];var _0x5e368c=_0xd11178?0x0:_0x295a48[_0x8f03('0x22')];var _0x2738d5=_0xd11178?_0x330af9[_0x8f03('0x24')]:_0x295a48[_0x8f03('0x22')]+_0x295a48[_0x8f03('0x25')];var _0x14c714;if(_0x2738d5>=_0x474fdb){_0x2738d5=_0x474fdb;_0x14c714=0xc8;}else{_0x14c714=0xce;}_0xca857d[_0x8f03('0x20')](_0x14c714);return _0xca857d['set'](_0x8f03('0x26'),_0x5e368c+'-'+_0x2738d5+'/'+_0x474fdb)[_0x8f03('0x27')](_0x330af9);}return null;};}function patchUpdates(_0x5402bb){return function(_0xfc4058){try{jsonpatch[_0x8f03('0x28')](_0xfc4058,_0x5402bb,!![]);}catch(_0x49632f){return BPromise[_0x8f03('0x29')](_0x49632f);}return _0xfc4058[_0x8f03('0x2a')]();};}function saveUpdates(_0x580f02,_0x5b8919){return function(_0x37f537){if(_0x37f537){return _0x37f537[_0x8f03('0x2b')](_0x580f02)['then'](function(_0x385ce1){return _0x385ce1;});}return null;};}function removeEntity(_0xe11c87,_0x44b20d){return function(_0x49d176){if(_0x49d176){return _0x49d176[_0x8f03('0x2c')]()[_0x8f03('0x2d')](function(){_0xe11c87[_0x8f03('0x20')](0xcc)[_0x8f03('0x21')]();});}};}function handleEntityNotFound(_0x1f8071,_0x15d017){return function(_0x4f8b08){if(!_0x4f8b08){_0x1f8071['sendStatus'](0x194);}return _0x4f8b08;};}function handleError(_0x3907f8,_0x55c641){_0x55c641=_0x55c641||0x1f4;return function(_0xdcaa50){logger['error'](_0xdcaa50[_0x8f03('0x2e')]);if(_0xdcaa50[_0x8f03('0x2f')]){delete _0xdcaa50[_0x8f03('0x2f')];}_0x3907f8[_0x8f03('0x20')](_0x55c641)[_0x8f03('0x30')](_0xdcaa50);};}exports[_0x8f03('0x31')]=function(_0x525ee5,_0x3357f2){var _0x56bf55={},_0x562cb9={},_0x546482={'count':0x0,'rows':[]};var _0x49ec7f=_[_0x8f03('0x32')](db[_0x8f03('0x33')][_0x8f03('0x34')],function(_0x3ce409){return{'name':_0x3ce409['fieldName'],'type':_0x3ce409['type']['key']};});_0x562cb9[_0x8f03('0x35')]=_[_0x8f03('0x32')](_0x49ec7f,_0x8f03('0x2f'));_0x562cb9['query']=_['keys'](_0x525ee5[_0x8f03('0x36')]);_0x562cb9[_0x8f03('0x37')]=_['intersection'](_0x562cb9[_0x8f03('0x35')],_0x562cb9[_0x8f03('0x36')]);_0x56bf55[_0x8f03('0x38')]=_[_0x8f03('0x39')](_0x562cb9[_0x8f03('0x35')],qs[_0x8f03('0x3a')](_0x525ee5[_0x8f03('0x36')][_0x8f03('0x3a')]));_0x56bf55['attributes']=_0x56bf55[_0x8f03('0x38')]['length']?_0x56bf55[_0x8f03('0x38')]:_0x562cb9[_0x8f03('0x35')];if(!_0x525ee5[_0x8f03('0x36')][_0x8f03('0x3b')](_0x8f03('0x3c'))){_0x56bf55['limit']=qs[_0x8f03('0x25')](_0x525ee5[_0x8f03('0x36')]['limit']);_0x56bf55[_0x8f03('0x22')]=qs[_0x8f03('0x22')](_0x525ee5[_0x8f03('0x36')]['offset']);}_0x56bf55[_0x8f03('0x3d')]=qs['sort'](_0x525ee5[_0x8f03('0x36')][_0x8f03('0x3e')]);_0x56bf55[_0x8f03('0x3f')]=qs['filters'](_[_0x8f03('0x40')](_0x525ee5[_0x8f03('0x36')],_0x562cb9[_0x8f03('0x37')]),_0x49ec7f);if(_0x525ee5[_0x8f03('0x36')][_0x8f03('0x41')]){_0x56bf55['where']=_[_0x8f03('0x42')](_0x56bf55['where'],{'$or':_[_0x8f03('0x32')](_0x49ec7f,function(_0x395873){if(_0x395873['type']!=='VIRTUAL'){var _0x14ad0f={};_0x14ad0f[_0x395873[_0x8f03('0x2f')]]={'$like':'%'+_0x525ee5[_0x8f03('0x36')][_0x8f03('0x41')]+'%'};return _0x14ad0f;}})});}_0x56bf55=_[_0x8f03('0x42')]({},_0x56bf55,_0x525ee5['options']);var _0x4825cf={'where':_0x56bf55[_0x8f03('0x3f')]};return db[_0x8f03('0x33')][_0x8f03('0x24')](_0x4825cf)['then'](function(_0x268498){_0x546482[_0x8f03('0x24')]=_0x268498;if(_0x525ee5[_0x8f03('0x36')][_0x8f03('0x43')]){_0x56bf55[_0x8f03('0x44')]=[{'all':!![]}];}return db[_0x8f03('0x33')][_0x8f03('0x45')](_0x56bf55);})['then'](function(_0x2a44ea){_0x546482[_0x8f03('0x46')]=_0x2a44ea;return _0x546482;})[_0x8f03('0x2d')](respondWithFilteredResult(_0x3357f2,_0x56bf55))[_0x8f03('0x47')](handleError(_0x3357f2,null));};exports[_0x8f03('0x48')]=function(_0xcdef67,_0x5eb5cb){var _0x3fb31e={'raw':!![],'where':{'id':_0xcdef67[_0x8f03('0x49')]['id']}},_0x75adeb={};_0x75adeb[_0x8f03('0x35')]=_[_0x8f03('0x4a')](db[_0x8f03('0x33')][_0x8f03('0x34')]);_0x75adeb[_0x8f03('0x36')]=_[_0x8f03('0x4a')](_0xcdef67['query']);_0x75adeb['filters']=_['intersection'](_0x75adeb[_0x8f03('0x35')],_0x75adeb['query']);_0x3fb31e['attributes']=_['intersection'](_0x75adeb[_0x8f03('0x35')],qs[_0x8f03('0x3a')](_0xcdef67[_0x8f03('0x36')][_0x8f03('0x3a')]));_0x3fb31e[_0x8f03('0x38')]=_0x3fb31e[_0x8f03('0x38')]['length']?_0x3fb31e[_0x8f03('0x38')]:_0x75adeb[_0x8f03('0x35')];if(_0xcdef67[_0x8f03('0x36')][_0x8f03('0x43')]){_0x3fb31e[_0x8f03('0x44')]=[{'all':!![]}];}_0x3fb31e=_['merge']({},_0x3fb31e,_0xcdef67[_0x8f03('0x4b')]);return db[_0x8f03('0x33')]['find'](_0x3fb31e)[_0x8f03('0x2d')](handleEntityNotFound(_0x5eb5cb,null))['then'](respondWithResult(_0x5eb5cb,null))[_0x8f03('0x47')](handleError(_0x5eb5cb,null));};exports[_0x8f03('0x4c')]=function(_0x1f58e0,_0x4cc274){return db['ChatInternalMessage']['create'](_0x1f58e0[_0x8f03('0x4d')],{})[_0x8f03('0x2d')](respondWithResult(_0x4cc274,0xc9))[_0x8f03('0x47')](handleError(_0x4cc274,null));};exports[_0x8f03('0x2b')]=function(_0x368dde,_0x5aa2e0){if(_0x368dde[_0x8f03('0x4d')]['id']){delete _0x368dde[_0x8f03('0x4d')]['id'];}return db[_0x8f03('0x33')][_0x8f03('0x4e')]({'where':{'id':_0x368dde['params']['id']}})['then'](handleEntityNotFound(_0x5aa2e0,null))[_0x8f03('0x2d')](saveUpdates(_0x368dde[_0x8f03('0x4d')],null))['then'](respondWithResult(_0x5aa2e0,null))[_0x8f03('0x47')](handleError(_0x5aa2e0,null));};exports[_0x8f03('0x2c')]=function(_0x2bad2c,_0x3a9d72){return db[_0x8f03('0x33')][_0x8f03('0x4e')]({'where':{'id':_0x2bad2c['params']['id']}})[_0x8f03('0x2d')](handleEntityNotFound(_0x3a9d72,null))[_0x8f03('0x2d')](removeEntity(_0x3a9d72,null))[_0x8f03('0x47')](handleError(_0x3a9d72,null));};exports[_0x8f03('0x4f')]=function(_0x254ef0,_0x1473a5){return db['ChatInternalMessage'][_0x8f03('0x4f')]()[_0x8f03('0x2d')](respondWithResult(_0x1473a5,null))[_0x8f03('0x47')](handleError(_0x1473a5,null));};function wrapUser(_0x2c3d18){return function(_0xe298a5){var _0xe75147=_0x2c3d18[_0x8f03('0x50')]({'plain':!![]});_0xe75147[_0x8f03('0x51')]=[];if(_0xe298a5){_0xe75147[_0x8f03('0x52')]=_0xe298a5[_0x8f03('0x53')];_0xe75147['lastMessage']=_0xe298a5;}else{_0xe75147[_0x8f03('0x52')]=moment(0x0)[_0x8f03('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0xe75147[_0x8f03('0x55')]={};}return _0xe75147;};}exports[_0x8f03('0x56')]=function(_0x2fb0ea,_0x2b61ea,_0x40a581){var _0x17a829=[];return db[_0x8f03('0x57')]['findAll']({'where':{'role':[_0x8f03('0x58'),_0x8f03('0x59'),'user']},'attributes':['id',_0x8f03('0x5a'),'name','role',_0x8f03('0x5b'),_0x8f03('0x5c'),_0x8f03('0x5d'),_0x8f03('0x5e'),_0x8f03('0x5f'),_0x8f03('0x60')],'order':qs[_0x8f03('0x3e')](_0x8f03('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x8f03('0x62'),'attributes':['id',_0x8f03('0x2f'),_0x8f03('0x63')],'through':{'attributes':[]}}]})[_0x8f03('0x2d')](function(_0xaac356){if(_0xaac356){var _0x11d991=_0x2fb0ea['user'][_0x8f03('0x50')]({'plain':!![]});if(!_0x11d991)throw new Error(_0x8f03('0x64'));if(_0x11d991[_0x8f03('0x65')]==='user'){return db[_0x8f03('0x66')][_0x8f03('0x4e')]({'where':{'name':'Agents','userProfileId':_0x11d991[_0x8f03('0x67')]},'raw':!![]})[_0x8f03('0x2d')](function(_0x5b68f7){if(_0x5b68f7){if(_0x5b68f7[_0x8f03('0x68')]===0x0){return db[_0x8f03('0x69')][_0x8f03('0x45')]({'where':{'sectionId':_0x5b68f7['id']},'raw':!![]})['then'](function(_0x2afc0f){var _0x43b0fa=[];if(_[_0x8f03('0x6a')](_0x2afc0f)){_0x43b0fa=_[_0x8f03('0x41')](_0xaac356,function(_0x54bbbe){if(_0x54bbbe['role']!==_0x8f03('0x58')){return _0x54bbbe;}});return _0x43b0fa;}else{for(var _0x42fb2=0x0;_0x42fb2<_0xaac356[_0x8f03('0x6b')];_0x42fb2++){var _0xdfb7c6=_0xaac356[_0x42fb2];if(_0xdfb7c6[_0x8f03('0x65')]===_0x8f03('0x58')){var _0x2e4dc7=_[_0x8f03('0x4e')](_0x2afc0f,function(_0x14fc38){return _0x14fc38['resourceId']===_0xdfb7c6['id'];});if(_0x2e4dc7)_0x43b0fa[_0x8f03('0x6c')](_0xdfb7c6);}else{_0x43b0fa[_0x8f03('0x6c')](_0xdfb7c6);}}return _0x43b0fa;}});}else{return _0xaac356;}}else{var _0x202322=_[_0x8f03('0x41')](_0xaac356,function(_0x4a9833){if(_0x4a9833['role']!==_0x8f03('0x58')){return _0x4a9833;}});return _0x202322;}});}else{return _0xaac356;}}})[_0x8f03('0x2d')](function(_0x4e4947){var _0x20845e=[];if(_0x4e4947){_0x17a829=_0x4e4947;for(var _0x38d747=0x0;_0x38d747<_0x4e4947['length'];_0x38d747+=0x1){_0x17a829[_0x38d747][_0x8f03('0x51')]=[];_0x20845e[_0x8f03('0x6c')](db[_0x8f03('0x33')]['find']({'where':{'FromId':[_0x2fb0ea[_0x8f03('0x6d')]['id'],_0x4e4947[_0x38d747]['id']],'ToId':[_0x2fb0ea[_0x8f03('0x6d')]['id'],_0x4e4947[_0x38d747]['id']],'ChatGroupId':null},'attributes':['id',_0x8f03('0x53'),_0x8f03('0x6e'),_0x8f03('0x6f'),'read','body'],'order':qs[_0x8f03('0x3e')](_0x8f03('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8f03('0x2d')](wrapUser(_0x4e4947[_0x38d747])));}return BPromise[_0x8f03('0x71')](_0x20845e);}return[];})[_0x8f03('0x2d')](function(_0xc87025){return{'rows':_0xc87025,'count':_0xc87025[_0x8f03('0x6b')]};})[_0x8f03('0x2d')](respondWithResult(_0x2b61ea,null))[_0x8f03('0x47')](handleError(_0x2b61ea,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 79cf113..4e29dd7 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 _0x840a=['../../mysqldb','ChatInternalMessage','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x46a60f,_0x1bec56){var _0x216028=function(_0x336f76){while(--_0x336f76){_0x46a60f['push'](_0x46a60f['shift']());}};_0x216028(++_0x1bec56);}(_0x840a,0x77));var _0xa840=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x840a[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xa840('0x0'));var ChatInternalMessage=require(_0xa840('0x1'))['db'][_0xa840('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa840('0x3'),'afterUpdate':'update','afterDestroy':_0xa840('0x4')};function emitEvent(_0x3561b6){return function(_0x4ed806,_0x702a4b,_0x27cba5){ChatInternalMessageEvents[_0xa840('0x5')](_0x3561b6+':'+_0x4ed806['id'],_0x4ed806);ChatInternalMessageEvents[_0xa840('0x5')](_0x3561b6,_0x4ed806);_0x27cba5(null);};}for(var e in events){if(events[_0xa840('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa840('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x943a=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x943a,0x84));var _0xa943=function(_0x4baac8,_0x5f1dc7){_0x4baac8=_0x4baac8-0x0;var _0x56ebc5=_0x943a[_0x4baac8];return _0x56ebc5;};'use strict';var EventEmitter=require(_0xa943('0x0'));var ChatInternalMessage=require(_0xa943('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa943('0x2'),'afterUpdate':_0xa943('0x3'),'afterDestroy':_0xa943('0x4')};function emitEvent(_0x47a2cb){return function(_0x56f1fd,_0x186955,_0x2bbb60){ChatInternalMessageEvents[_0xa943('0x5')](_0x47a2cb+':'+_0x56f1fd['id'],_0x56f1fd);ChatInternalMessageEvents[_0xa943('0x5')](_0x47a2cb,_0x56f1fd);_0x2bbb60(null);};}for(var e in events){if(events[_0xa943('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xa943('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 37523a3..0b48223 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 _0x9b65=['rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path'];(function(_0x5bcafb,_0x37dc03){var _0xa29d82=function(_0x24477a){while(--_0x24477a){_0x5bcafb['push'](_0x5bcafb['shift']());}};_0xa29d82(++_0x37dc03);}(_0x9b65,0x19a));var _0x59b6=function(_0x1dfd46,_0x52efef){_0x1dfd46=_0x1dfd46-0x0;var _0x1702da=_0x9b65[_0x1dfd46];return _0x1702da;};'use strict';var _=require('lodash');var util=require(_0x59b6('0x0'));var logger=require('../../config/logger')(_0x59b6('0x1'));var moment=require(_0x59b6('0x2'));var BPromise=require(_0x59b6('0x3'));var rp=require(_0x59b6('0x4'));var fs=require('fs');var path=require(_0x59b6('0x5'));var rimraf=require(_0x59b6('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x59b6('0x7')]=function(_0x22c82c,_0x45ea56){return _0x22c82c[_0x59b6('0x8')](_0x59b6('0x9'),attributes,{'tableName':_0x59b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x59b6('0xb'),'collate':_0x59b6('0xc')});};
\ No newline at end of file
+var _0x4f54=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1301df,_0x58d8ff){var _0x26c233=function(_0x42c800){while(--_0x42c800){_0x1301df['push'](_0x1301df['shift']());}};_0x26c233(++_0x58d8ff);}(_0x4f54,0x1c6));var _0x44f5=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4f54[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x44f5('0x0'));var util=require('util');var logger=require(_0x44f5('0x1'))(_0x44f5('0x2'));var moment=require(_0x44f5('0x3'));var BPromise=require(_0x44f5('0x4'));var rp=require(_0x44f5('0x5'));var fs=require('fs');var path=require(_0x44f5('0x6'));var rimraf=require(_0x44f5('0x7'));var config=require('../../config/environment');var attributes=require(_0x44f5('0x8'));module['exports']=function(_0xee464d,_0x191305){return _0xee464d['define'](_0x44f5('0x9'),attributes,{'tableName':_0x44f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x44f5('0xb'),'collate':_0x44f5('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e0a9b9c..f5ad55c 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 _0xed95=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x1b3b4a,_0x27562f){var _0x5c82e7=function(_0x2fa764){while(--_0x2fa764){_0x1b3b4a['push'](_0x1b3b4a['shift']());}};_0x5c82e7(++_0x27562f);}(_0xed95,0x1d0));var _0x5ed9=function(_0x9222a6,_0x4b32e7){_0x9222a6=_0x9222a6-0x0;var _0x1233f1=_0xed95[_0x9222a6];return _0x1233f1;};'use strict';var _=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var moment=require(_0x5ed9('0x2'));var BPromise=require(_0x5ed9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ed9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ed9('0x5'));var logger=require('../../config/logger')(_0x5ed9('0x6'));var config=require(_0x5ed9('0x7'));var jayson=require(_0x5ed9('0x8'));var client=jayson['client'][_0x5ed9('0x9')]({'port':0x232a});config[_0x5ed9('0xa')]=_['defaults'](config[_0x5ed9('0xa')],{'host':_0x5ed9('0xb'),'port':0x18eb});var socket=require(_0x5ed9('0xc'))(new Redis(config[_0x5ed9('0xa')]));require(_0x5ed9('0xd'))[_0x5ed9('0xe')](socket);function respondWithRpcPromise(_0x53907c,_0x2f858a,_0xfe757d){return new BPromise(function(_0x49473c,_0x269522){return client[_0x5ed9('0xf')](_0x53907c,_0xfe757d)[_0x5ed9('0x10')](function(_0x4a929a){logger['info'](_0x5ed9('0x11'),_0x2f858a,_0x5ed9('0x12'));logger['debug'](_0x5ed9('0x13'),_0x2f858a,'request\x20sent',JSON['stringify'](_0x4a929a));if(_0x4a929a['error']){if(_0x4a929a[_0x5ed9('0x14')][_0x5ed9('0x15')]===0x1f4){logger[_0x5ed9('0x14')](_0x5ed9('0x11'),_0x2f858a,_0x4a929a[_0x5ed9('0x14')]['message']);return _0x269522(_0x4a929a[_0x5ed9('0x14')][_0x5ed9('0x16')]);}logger['error'](_0x5ed9('0x11'),_0x2f858a,_0x4a929a[_0x5ed9('0x14')][_0x5ed9('0x16')]);return _0x49473c(_0x4a929a[_0x5ed9('0x14')][_0x5ed9('0x16')]);}else{logger[_0x5ed9('0x17')](_0x5ed9('0x11'),_0x2f858a,'request\x20sent');_0x49473c(_0x4a929a[_0x5ed9('0x18')][_0x5ed9('0x16')]);}})[_0x5ed9('0x19')](function(_0x46a55b){logger[_0x5ed9('0x14')](_0x5ed9('0x11'),_0x2f858a,_0x46a55b);_0x269522(_0x46a55b);});});}
\ No newline at end of file
+var _0x934a=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x934a,0x127));var _0xa934=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0x934a[_0x2714ec];return _0x2608e5;};'use strict';var _=require(_0xa934('0x0'));var util=require('util');var moment=require(_0xa934('0x1'));var BPromise=require(_0xa934('0x2'));var rs=require(_0xa934('0x3'));var fs=require('fs');var Redis=require(_0xa934('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa934('0x5'));var logger=require(_0xa934('0x6'))(_0xa934('0x7'));var config=require(_0xa934('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa934('0x9')][_0xa934('0xa')]({'port':0x232a});config[_0xa934('0xb')]=_['defaults'](config[_0xa934('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa934('0xc'))(new Redis(config[_0xa934('0xb')]));require(_0xa934('0xd'))[_0xa934('0xe')](socket);function respondWithRpcPromise(_0x17372b,_0x3d3774,_0x27e438){return new BPromise(function(_0x31c980,_0x116e97){return client[_0xa934('0xf')](_0x17372b,_0x27e438)[_0xa934('0x10')](function(_0xd58e8c){logger[_0xa934('0x11')](_0xa934('0x12'),_0x3d3774,'request\x20sent');logger[_0xa934('0x13')](_0xa934('0x14'),_0x3d3774,'request\x20sent',JSON[_0xa934('0x15')](_0xd58e8c));if(_0xd58e8c['error']){if(_0xd58e8c['error'][_0xa934('0x16')]===0x1f4){logger[_0xa934('0x17')](_0xa934('0x12'),_0x3d3774,_0xd58e8c[_0xa934('0x17')][_0xa934('0x18')]);return _0x116e97(_0xd58e8c[_0xa934('0x17')][_0xa934('0x18')]);}logger[_0xa934('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3d3774,_0xd58e8c['error'][_0xa934('0x18')]);return _0x31c980(_0xd58e8c['error'][_0xa934('0x18')]);}else{logger[_0xa934('0x11')](_0xa934('0x12'),_0x3d3774,_0xa934('0x19'));_0x31c980(_0xd58e8c[_0xa934('0x1a')][_0xa934('0x18')]);}})[_0xa934('0x1b')](function(_0x2c13ff){logger[_0xa934('0x17')](_0xa934('0x12'),_0x3d3774,_0x2c13ff);_0x116e97(_0x2c13ff);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 43a6af1..88734fc 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 _0xc61a=['save','remove','update','emit','removeListener','register','length','./chatInternalMessage.events'];(function(_0x3b9705,_0x4a421e){var _0x239319=function(_0x32ebe1){while(--_0x32ebe1){_0x3b9705['push'](_0x3b9705['shift']());}};_0x239319(++_0x4a421e);}(_0xc61a,0x15f));var _0xac61=function(_0x16d6b4,_0x50360d){_0x16d6b4=_0x16d6b4-0x0;var _0x11f272=_0xc61a[_0x16d6b4];return _0x11f272;};'use strict';var ChatInternalMessageEvents=require(_0xac61('0x0'));var events=[_0xac61('0x1'),_0xac61('0x2'),_0xac61('0x3')];function createListener(_0x48f7a6,_0x38fd8f){return function(_0x2bb724){_0x38fd8f[_0xac61('0x4')](_0x48f7a6,_0x2bb724);};}function removeListener(_0x2c3de8,_0x44b23a){return function(){ChatInternalMessageEvents[_0xac61('0x5')](_0x2c3de8,_0x44b23a);};}exports[_0xac61('0x6')]=function(_0xc18d16){for(var _0x152717=0x0,_0x44cba3=events[_0xac61('0x7')];_0x152717<_0x44cba3;_0x152717++){var _0xbe935f=events[_0x152717];var _0x1c0d76=createListener('chatInternalMessage:'+_0xbe935f,_0xc18d16);ChatInternalMessageEvents['on'](_0xbe935f,_0x1c0d76);}};
\ No newline at end of file
+var _0xd378=['update','emit','removeListener','register','remove'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xd378,0x1d0));var _0x8d37=function(_0x547b1c,_0xae1569){_0x547b1c=_0x547b1c-0x0;var _0x13defa=_0xd378[_0x547b1c];return _0x13defa;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x8d37('0x0'),_0x8d37('0x1')];function createListener(_0x3c77bc,_0x6426e7){return function(_0x39ed33){_0x6426e7[_0x8d37('0x2')](_0x3c77bc,_0x39ed33);};}function removeListener(_0x29ab0d,_0x2bcfe2){return function(){ChatInternalMessageEvents[_0x8d37('0x3')](_0x29ab0d,_0x2bcfe2);};}exports[_0x8d37('0x4')]=function(_0x48efda){for(var _0x486b67=0x0,_0x41d501=events['length'];_0x486b67<_0x41d501;_0x486b67++){var _0x4e4679=events[_0x486b67];var _0x405812=createListener('chatInternalMessage:'+_0x4e4679,_0x48efda);ChatInternalMessageEvents['on'](_0x4e4679,_0x405812);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index a161f6a..1b2a28c 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 _0x3fa7=['update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','create','put'];(function(_0x5d3eaa,_0x4420df){var _0x283dd1=function(_0x133e69){while(--_0x133e69){_0x5d3eaa['push'](_0x5d3eaa['shift']());}};_0x283dd1(++_0x4420df);}(_0x3fa7,0x1b8));var _0x73fa=function(_0x20a35e,_0x1e4cc9){_0x20a35e=_0x20a35e-0x0;var _0x5a0cfd=_0x3fa7[_0x20a35e];return _0x5a0cfd;};'use strict';var multer=require('multer');var util=require(_0x73fa('0x0'));var path=require(_0x73fa('0x1'));var timeout=require(_0x73fa('0x2'));var express=require('express');var router=express[_0x73fa('0x3')]();var fs_extra=require(_0x73fa('0x4'));var auth=require(_0x73fa('0x5'));var interaction=require(_0x73fa('0x6'));var config=require(_0x73fa('0x7'));var controller=require(_0x73fa('0x8'));router[_0x73fa('0x9')]('/',auth[_0x73fa('0xa')](),controller[_0x73fa('0xb')]);router[_0x73fa('0x9')](_0x73fa('0xc'),auth[_0x73fa('0xa')](),controller[_0x73fa('0xd')]);router[_0x73fa('0x9')](_0x73fa('0xe'),auth[_0x73fa('0xa')](),controller[_0x73fa('0xf')]);router['get'](_0x73fa('0x10'),auth[_0x73fa('0xa')](),controller[_0x73fa('0x11')]);router['post']('/',auth[_0x73fa('0xa')](),controller[_0x73fa('0x12')]);router[_0x73fa('0x13')](_0x73fa('0x10'),controller[_0x73fa('0x14')]);router['delete'](_0x73fa('0x10'),auth[_0x73fa('0xa')](),controller[_0x73fa('0x15')]);module[_0x73fa('0x16')]=router;
\ No newline at end of file
+var _0x6dfe=['path','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','show','post','create','put','update','delete','exports','util'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0x6dfe,0x1a3));var _0xe6df=function(_0x59bfb8,_0x5dde3f){_0x59bfb8=_0x59bfb8-0x0;var _0x428495=_0x6dfe[_0x59bfb8];return _0x428495;};'use strict';var multer=require('multer');var util=require(_0xe6df('0x0'));var path=require(_0xe6df('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe6df('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe6df('0x3'));var interaction=require(_0xe6df('0x4'));var config=require('../../config/environment');var controller=require(_0xe6df('0x5'));router[_0xe6df('0x6')]('/',auth[_0xe6df('0x7')](),controller[_0xe6df('0x8')]);router[_0xe6df('0x6')](_0xe6df('0x9'),auth['isAuthenticated'](),controller[_0xe6df('0xa')]);router[_0xe6df('0x6')](_0xe6df('0xb'),auth[_0xe6df('0x7')](),controller['getUsers']);router[_0xe6df('0x6')](_0xe6df('0xc'),auth[_0xe6df('0x7')](),controller[_0xe6df('0xd')]);router[_0xe6df('0xe')]('/',auth[_0xe6df('0x7')](),controller[_0xe6df('0xf')]);router[_0xe6df('0x10')](_0xe6df('0xc'),controller[_0xe6df('0x11')]);router[_0xe6df('0x12')](_0xe6df('0xc'),auth[_0xe6df('0x7')](),controller['destroy']);module[_0xe6df('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index d9ad3cc..aaa71b5 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 _0xd8b0=['exports','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0d8b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0d8b('0x3')]('in',_0x0d8b('0x4')),'defaultValue':_0x0d8b('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0d8b('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xce3a=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x2b6061,_0xd17e1a){var _0x1efbe1=function(_0x26b4ee){while(--_0x26b4ee){_0x2b6061['push'](_0x2b6061['shift']());}};_0x1efbe1(++_0xd17e1a);}(_0xce3a,0x194));var _0xace3=function(_0x3a657f,_0x25679f){_0x3a657f=_0x3a657f-0x0;var _0x415e94=_0xce3a[_0x3a657f];return _0x415e94;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'body':{'type':Sequelize[_0xace3('0x2')](_0xace3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xace3('0x5')]('in',_0xace3('0x6')),'defaultValue':_0xace3('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xace3('0x7')]},'providerName':{'type':Sequelize[_0xace3('0x8')]},'providerResponse':{'type':Sequelize[_0xace3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index e5934be..6114a1e 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 _0x1f93=['destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','model','fields','find','create','body','update','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3657d2,_0x354f60){var _0x3eef68=function(_0x3a4633){while(--_0x3a4633){_0x3657d2['push'](_0x3657d2['shift']());}};_0x3eef68(++_0x354f60);}(_0x1f93,0xd8));var _0x31f9=function(_0x1f3f78,_0x5cab65){_0x1f3f78=_0x1f3f78-0x0;var _0x4eca9a=_0x1f93[_0x1f3f78];return _0x4eca9a;};'use strict';var emlformat=require(_0x31f9('0x0'));var rimraf=require(_0x31f9('0x1'));var zipdir=require(_0x31f9('0x2'));var jsonpatch=require(_0x31f9('0x3'));var rp=require('request-promise');var moment=require(_0x31f9('0x4'));var BPromise=require(_0x31f9('0x5'));var Mustache=require(_0x31f9('0x6'));var util=require(_0x31f9('0x7'));var path=require('path');var sox=require(_0x31f9('0x8'));var csv=require('to-csv');var ejs=require(_0x31f9('0x9'));var fs=require('fs');var fs_extra=require(_0x31f9('0xa'));var _=require('lodash');var squel=require(_0x31f9('0xb'));var crypto=require(_0x31f9('0xc'));var jsforce=require(_0x31f9('0xd'));var deskjs=require(_0x31f9('0xe'));var toCsv=require(_0x31f9('0xf'));var querystring=require('querystring');var Papa=require(_0x31f9('0x10'));var Redis=require(_0x31f9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x31f9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31f9('0x13'));var logger=require(_0x31f9('0x14'))(_0x31f9('0x15'));var utils=require(_0x31f9('0x16'));var config=require(_0x31f9('0x17'));var licenseUtil=require(_0x31f9('0x18'));var db=require(_0x31f9('0x19'))['db'];config[_0x31f9('0x1a')]=_[_0x31f9('0x1b')](config[_0x31f9('0x1a')],{'host':_0x31f9('0x1c'),'port':0x18eb});var socket=require(_0x31f9('0x1d'))(new Redis(config[_0x31f9('0x1a')]));require(_0x31f9('0x1e'))[_0x31f9('0x1f')](socket);var jayson=require(_0x31f9('0x20'));var client=jayson[_0x31f9('0x21')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14a6da,_0x65c02f,_0x358912,_0x163a33){return new BPromise(function(_0x42f592,_0xa50f0a){var _0x306dc0=_0x163a33||client;return _0x306dc0[_0x31f9('0x22')](_0x14a6da,_0x358912)[_0x31f9('0x23')](function(_0x3490fb){logger[_0x31f9('0x24')]('ChatMessage,\x20%s,\x20%s',_0x65c02f,_0x31f9('0x25'));logger[_0x31f9('0x26')](_0x31f9('0x27'),_0x65c02f,_0x31f9('0x25'),JSON[_0x31f9('0x28')](_0x3490fb));if(_0x3490fb[_0x31f9('0x29')]){if(_0x3490fb[_0x31f9('0x29')][_0x31f9('0x2a')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x65c02f,_0x3490fb[_0x31f9('0x29')][_0x31f9('0x2b')]);return _0xa50f0a(_0x3490fb['error'][_0x31f9('0x2b')]);}logger[_0x31f9('0x29')](_0x31f9('0x2c'),_0x65c02f,_0x3490fb[_0x31f9('0x29')][_0x31f9('0x2b')]);return _0x42f592(_0x3490fb[_0x31f9('0x29')][_0x31f9('0x2b')]);}else{logger[_0x31f9('0x24')](_0x31f9('0x2c'),_0x65c02f,'request\x20sent');_0x42f592(_0x3490fb[_0x31f9('0x2d')][_0x31f9('0x2b')]);}})[_0x31f9('0x2e')](function(_0x3a1e83){logger[_0x31f9('0x29')]('ChatMessage,\x20%s,\x20%s',_0x65c02f,_0x3a1e83);_0xa50f0a(_0x3a1e83);});});}function respondWithStatusCode(_0x25c382,_0x29448e){_0x29448e=_0x29448e||0xcc;return function(_0x143531){if(_0x143531){return _0x25c382[_0x31f9('0x2f')](_0x29448e);}return _0x25c382[_0x31f9('0x30')](_0x29448e)['end']();};}function respondWithResult(_0x2cec26,_0x18fde1){_0x18fde1=_0x18fde1||0xc8;return function(_0x37813a){if(_0x37813a){return _0x2cec26[_0x31f9('0x30')](_0x18fde1)[_0x31f9('0x31')](_0x37813a);}};}function respondWithFilteredResult(_0x2b3735,_0x309557){return function(_0x56d239){if(_0x56d239){var _0x24523c=typeof _0x309557[_0x31f9('0x32')]===_0x31f9('0x33')&&typeof _0x309557[_0x31f9('0x34')]===_0x31f9('0x33');var _0x235e0b=_0x56d239['count'];var _0x7eb962=_0x24523c?0x0:_0x309557['offset'];var _0x4e8755=_0x24523c?_0x56d239[_0x31f9('0x35')]:_0x309557[_0x31f9('0x32')]+_0x309557[_0x31f9('0x34')];var _0x448e0a;if(_0x4e8755>=_0x235e0b){_0x4e8755=_0x235e0b;_0x448e0a=0xc8;}else{_0x448e0a=0xce;}_0x2b3735[_0x31f9('0x30')](_0x448e0a);return _0x2b3735[_0x31f9('0x36')](_0x31f9('0x37'),_0x7eb962+'-'+_0x4e8755+'/'+_0x235e0b)[_0x31f9('0x31')](_0x56d239);}return null;};}function patchUpdates(_0x1e68c0){return function(_0x2eecf7){try{jsonpatch[_0x31f9('0x38')](_0x2eecf7,_0x1e68c0,!![]);}catch(_0x527f01){return BPromise[_0x31f9('0x39')](_0x527f01);}return _0x2eecf7['save']();};}function saveUpdates(_0x53cf0e,_0x4f0fee){return function(_0x29c576){if(_0x29c576){return _0x29c576['update'](_0x53cf0e)['then'](function(_0x381688){return _0x381688;});}return null;};}function removeEntity(_0x4e50d5,_0x1007b3){return function(_0x279cf4){if(_0x279cf4){return _0x279cf4[_0x31f9('0x3a')]()[_0x31f9('0x23')](function(){_0x4e50d5[_0x31f9('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5743b8,_0x260117){return function(_0x211769){if(!_0x211769){_0x5743b8['sendStatus'](0x194);}return _0x211769;};}function handleError(_0xe7add1,_0x5cecce){_0x5cecce=_0x5cecce||0x1f4;return function(_0x518923){logger[_0x31f9('0x29')](_0x518923[_0x31f9('0x3b')]);if(_0x518923[_0x31f9('0x3c')]){delete _0x518923[_0x31f9('0x3c')];}_0xe7add1['status'](_0x5cecce)['send'](_0x518923);};}exports[_0x31f9('0x3d')]=function(_0x21554e,_0x5202cc){var _0x44aa6f={},_0x421f56={},_0x157586={'count':0x0,'rows':[]};var _0x4af48b=_[_0x31f9('0x3e')](db[_0x31f9('0x3f')][_0x31f9('0x40')],function(_0x905314){return{'name':_0x905314[_0x31f9('0x41')],'type':_0x905314[_0x31f9('0x42')][_0x31f9('0x43')]};});_0x421f56['model']=_[_0x31f9('0x3e')](_0x4af48b,_0x31f9('0x3c'));_0x421f56[_0x31f9('0x44')]=_[_0x31f9('0x45')](_0x21554e[_0x31f9('0x44')]);_0x421f56[_0x31f9('0x46')]=_[_0x31f9('0x47')](_0x421f56['model'],_0x421f56[_0x31f9('0x44')]);_0x44aa6f['attributes']=_['intersection'](_0x421f56['model'],qs['fields'](_0x21554e[_0x31f9('0x44')]['fields']));_0x44aa6f[_0x31f9('0x48')]=_0x44aa6f[_0x31f9('0x48')][_0x31f9('0x49')]?_0x44aa6f[_0x31f9('0x48')]:_0x421f56['model'];if(!_0x21554e['query'][_0x31f9('0x4a')](_0x31f9('0x4b'))){_0x44aa6f['limit']=qs['limit'](_0x21554e[_0x31f9('0x44')][_0x31f9('0x34')]);_0x44aa6f['offset']=qs[_0x31f9('0x32')](_0x21554e[_0x31f9('0x44')]['offset']);}_0x44aa6f[_0x31f9('0x4c')]=qs[_0x31f9('0x4d')](_0x21554e[_0x31f9('0x44')][_0x31f9('0x4d')]);_0x44aa6f[_0x31f9('0x4e')]=qs[_0x31f9('0x46')](_[_0x31f9('0x4f')](_0x21554e[_0x31f9('0x44')],_0x421f56[_0x31f9('0x46')]),_0x4af48b);if(_0x21554e[_0x31f9('0x44')][_0x31f9('0x50')]){_0x44aa6f[_0x31f9('0x4e')]=_[_0x31f9('0x51')](_0x44aa6f[_0x31f9('0x4e')],{'$or':_[_0x31f9('0x3e')](_0x4af48b,function(_0x5bfaa5){if(_0x5bfaa5[_0x31f9('0x42')]!==_0x31f9('0x52')){var _0x1f4a03={};_0x1f4a03[_0x5bfaa5['name']]={'$like':'%'+_0x21554e[_0x31f9('0x44')][_0x31f9('0x50')]+'%'};return _0x1f4a03;}})});}_0x44aa6f=_[_0x31f9('0x51')]({},_0x44aa6f,_0x21554e[_0x31f9('0x53')]);var _0x561cb0={'where':_0x44aa6f['where']};return db[_0x31f9('0x3f')][_0x31f9('0x35')](_0x561cb0)[_0x31f9('0x23')](function(_0x5a1eb9){_0x157586[_0x31f9('0x35')]=_0x5a1eb9;if(_0x21554e[_0x31f9('0x44')][_0x31f9('0x54')]){_0x44aa6f[_0x31f9('0x55')]=[{'all':!![]}];}return db[_0x31f9('0x3f')][_0x31f9('0x56')](_0x44aa6f);})[_0x31f9('0x23')](function(_0x150ff0){_0x157586[_0x31f9('0x57')]=_0x150ff0;return _0x157586;})[_0x31f9('0x23')](respondWithFilteredResult(_0x5202cc,_0x44aa6f))[_0x31f9('0x2e')](handleError(_0x5202cc,null));};exports['show']=function(_0x531565,_0x569d2f){var _0x39c48a={'raw':!![],'where':{'id':_0x531565[_0x31f9('0x58')]['id']}},_0x21bd15={};_0x21bd15[_0x31f9('0x59')]=_[_0x31f9('0x45')](db[_0x31f9('0x3f')][_0x31f9('0x40')]);_0x21bd15[_0x31f9('0x44')]=_['keys'](_0x531565[_0x31f9('0x44')]);_0x21bd15[_0x31f9('0x46')]=_[_0x31f9('0x47')](_0x21bd15[_0x31f9('0x59')],_0x21bd15[_0x31f9('0x44')]);_0x39c48a[_0x31f9('0x48')]=_[_0x31f9('0x47')](_0x21bd15[_0x31f9('0x59')],qs[_0x31f9('0x5a')](_0x531565['query']['fields']));_0x39c48a[_0x31f9('0x48')]=_0x39c48a[_0x31f9('0x48')][_0x31f9('0x49')]?_0x39c48a[_0x31f9('0x48')]:_0x21bd15[_0x31f9('0x59')];if(_0x531565['query'][_0x31f9('0x54')]){_0x39c48a[_0x31f9('0x55')]=[{'all':!![]}];}_0x39c48a=_['merge']({},_0x39c48a,_0x531565[_0x31f9('0x53')]);return db['ChatMessage'][_0x31f9('0x5b')](_0x39c48a)[_0x31f9('0x23')](handleEntityNotFound(_0x569d2f,null))[_0x31f9('0x23')](respondWithResult(_0x569d2f,null))[_0x31f9('0x2e')](handleError(_0x569d2f,null));};exports[_0x31f9('0x5c')]=function(_0x2720ae,_0x24a5a1){return db['ChatMessage'][_0x31f9('0x5c')](_0x2720ae[_0x31f9('0x5d')],{})[_0x31f9('0x23')](respondWithResult(_0x24a5a1,0xc9))[_0x31f9('0x2e')](handleError(_0x24a5a1,null));};exports[_0x31f9('0x5e')]=function(_0x44d61b,_0x1ae87f){if(_0x44d61b[_0x31f9('0x5d')]['id']){delete _0x44d61b[_0x31f9('0x5d')]['id'];}return db['ChatMessage'][_0x31f9('0x5b')]({'where':{'id':_0x44d61b[_0x31f9('0x58')]['id']}})[_0x31f9('0x23')](handleEntityNotFound(_0x1ae87f,null))[_0x31f9('0x23')](saveUpdates(_0x44d61b[_0x31f9('0x5d')],null))[_0x31f9('0x23')](respondWithResult(_0x1ae87f,null))[_0x31f9('0x2e')](handleError(_0x1ae87f,null));};exports[_0x31f9('0x3a')]=function(_0x408388,_0x4cdcf4){return db[_0x31f9('0x3f')][_0x31f9('0x5b')]({'where':{'id':_0x408388[_0x31f9('0x58')]['id']}})[_0x31f9('0x23')](handleEntityNotFound(_0x4cdcf4,null))[_0x31f9('0x23')](removeEntity(_0x4cdcf4,null))['catch'](handleError(_0x4cdcf4,null));};exports[_0x31f9('0x5f')]=function(_0x59c1a2,_0x38b5bc){return db['ChatMessage'][_0x31f9('0x5f')]()['then'](respondWithResult(_0x38b5bc,null))[_0x31f9('0x2e')](handleError(_0x38b5bc,null));};var interaction_log=require(_0x31f9('0x14'))(_0x31f9('0x60'));exports[_0x31f9('0x61')]=function(_0x28abf7,_0x5a9c11,_0x4956ca){var _0x147929={'agent':{},'channel':'chat'};if(_0x28abf7[_0x31f9('0x5d')]['id']){delete _0x28abf7[_0x31f9('0x5d')]['id'];}_0x28abf7[_0x31f9('0x5d')][_0x31f9('0x62')]=!![];_0x28abf7[_0x31f9('0x5d')][_0x31f9('0x63')]=moment()[_0x31f9('0x64')](_0x31f9('0x65'));_0x28abf7[_0x31f9('0x5d')][_0x31f9('0x66')]=_0x28abf7['body'][_0x31f9('0x66')]||_0x28abf7['user']['id'];_0x147929[_0x31f9('0x67')]['id']=_0x28abf7[_0x31f9('0x5d')][_0x31f9('0x66')];return db['ChatMessage'][_0x31f9('0x5b')]({'where':{'id':_0x28abf7[_0x31f9('0x58')]['id'],'UserId':null}})[_0x31f9('0x23')](handleEntityNotFound(_0x5a9c11,null))['then'](saveUpdates(_0x28abf7[_0x31f9('0x5d')],null))[_0x31f9('0x23')](function(_0x123086){if(_0x123086){_0x147929[_0x31f9('0x2b')]=_0x123086[_0x31f9('0x68')]({'plain':!![]});return db[_0x31f9('0x69')]['find']({'where':{'id':_0x123086[_0x31f9('0x6a')]}});}return null;})[_0x31f9('0x23')](handleEntityNotFound(_0x5a9c11,null))[_0x31f9('0x23')](function(_0x43fefb){if(_0x43fefb){return _0x43fefb[_0x31f9('0x5e')]({'UserId':_0x28abf7[_0x31f9('0x5d')][_0x31f9('0x66')],'read1stAt':_['isNil'](_0x43fefb[_0x31f9('0x6b')])?moment()[_0x31f9('0x64')](_0x31f9('0x65')):undefined});}return null;})[_0x31f9('0x23')](function(_0x5b78d7){if(_0x5b78d7){_0x147929[_0x31f9('0x6c')]=_0x5b78d7['get']({'plain':!![]});interaction_log[_0x31f9('0x24')](_0x31f9('0x6d'),_0x28abf7[_0x31f9('0x6e')]['id'],_0x28abf7[_0x31f9('0x6e')][_0x31f9('0x3c')],_0x28abf7[_0x31f9('0x6e')][_0x31f9('0x6f')],_0x147929['interaction']['id'],_0x28abf7[_0x31f9('0x5d')]?JSON[_0x31f9('0x28')](_0x28abf7[_0x31f9('0x5d')]):_0x31f9('0x70'));return respondWithRpcPromise(_0x31f9('0x71'),_0x31f9('0x72'),_0x147929);}return null;})['then'](function(_0x3bc855){var _0x45c0b2=_0x31f9('0x73')+_0x3bc855[_0x31f9('0x2b')][_0x31f9('0x74')];return db['sequelize'][_0x31f9('0x44')](_0x45c0b2,{'type':db[_0x31f9('0x75')]['QueryTypes'][_0x31f9('0x76')],'raw':!![]})[_0x31f9('0x23')](function(_0x143a1c){return _0x143a1c;});})[_0x31f9('0x23')](function(_0x1057ee){if(_0x1057ee){_0x147929[_0x31f9('0x2b')][_0x31f9('0x77')]=_0x1057ee[0x0];if(!_0x28abf7[_0x31f9('0x5d')]['UserId'])return;return db[_0x31f9('0x78')][_0x31f9('0x5b')]({'where':{'id':_0x28abf7[_0x31f9('0x5d')][_0x31f9('0x66')],'role':'agent'},'attributes':['id',_0x31f9('0x3c'),_0x31f9('0x79'),_0x31f9('0x7a'),_0x31f9('0x7b')],'raw':!![]});}return null;})['then'](function(_0x5586bd){if(!_0x5586bd)return null;_0x147929[_0x31f9('0x2b')][_0x31f9('0x67')]=_0x5586bd;return _0x147929;})[_0x31f9('0x23')](function(_0x433b06){if(_0x433b06){if(_0x28abf7[_0x31f9('0x5d')]['manual']){_0x147929[_0x31f9('0x2b')][_0x31f9('0x7c')]=util[_0x31f9('0x64')](_0x31f9('0x7d'),_0x28abf7[_0x31f9('0x6e')][_0x31f9('0x3c')]);_0x147929[_0x31f9('0x2b')][_0x31f9('0x7e')]=_0x147929['channel'];_0x147929[_0x31f9('0x2b')][_0x31f9('0x7f')]=_0x147929[_0x31f9('0x7e')];_0x147929[_0x31f9('0x2b')][_0x31f9('0x80')]='accept';return respondWithRpcPromise(_0x31f9('0x81'),_0x31f9('0x81'),{'event':'acceptmessage','message':_[_0x31f9('0x51')](_0x147929[_0x31f9('0x2b')],JSON[_0x31f9('0x82')](_0x147929['interaction'][_0x31f9('0x83')]))},client9002)[_0x31f9('0x23')](function(){return _0x147929;});}return _0x147929;}return null;})[_0x31f9('0x23')](respondWithResult(_0x5a9c11,null))[_0x31f9('0x2e')](handleError(_0x5a9c11,null));};var interaction_log=require(_0x31f9('0x14'))('chat-interactions');exports['reject']=function(_0x5de05c,_0x7aae9,_0x46a1c4){var _0x5d46db={'agent':{},'channel':_0x31f9('0x84')};if(_0x5de05c[_0x31f9('0x5d')]['id']){delete _0x5de05c[_0x31f9('0x5d')]['id'];}_0x5de05c[_0x31f9('0x5d')][_0x31f9('0x66')]=_0x5de05c[_0x31f9('0x5d')]['UserId']||_0x5de05c[_0x31f9('0x6e')]['id'];_0x5d46db['agent']['id']=_0x5de05c['body'][_0x31f9('0x66')];return db[_0x31f9('0x3f')][_0x31f9('0x5b')]({'where':{'id':_0x5de05c[_0x31f9('0x58')]['id'],'UserId':null}})[_0x31f9('0x23')](handleEntityNotFound(_0x7aae9,null))['then'](function(_0xffbc3d){if(_0xffbc3d){_0x5d46db[_0x31f9('0x2b')]=_0xffbc3d[_0x31f9('0x68')]({'plain':!![]});return db[_0x31f9('0x69')][_0x31f9('0x5b')]({'where':{'id':_0xffbc3d[_0x31f9('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x7aae9,null))['then'](function(_0x40e19c){if(_0x40e19c){_0x5d46db[_0x31f9('0x6c')]=_0x40e19c['get']({'plain':!![]});interaction_log[_0x31f9('0x24')](_0x31f9('0x85'),_0x5de05c['user']['id'],_0x5de05c['user'][_0x31f9('0x3c')],_0x5de05c[_0x31f9('0x6e')]['role'],_0x5d46db[_0x31f9('0x6c')]['id'],_0x5de05c[_0x31f9('0x5d')]?JSON[_0x31f9('0x28')](_0x5de05c[_0x31f9('0x5d')]):_0x31f9('0x70'));return respondWithRpcPromise(_0x31f9('0x86'),_0x31f9('0x87'),_0x5d46db);}return null;})[_0x31f9('0x23')](function(_0x351ff2){var _0x682558=_0x31f9('0x73')+_0x351ff2[_0x31f9('0x2b')]['ContactId'];return db['sequelize'][_0x31f9('0x44')](_0x682558,{'type':db[_0x31f9('0x75')]['QueryTypes']['SELECT'],'raw':!![]})[_0x31f9('0x23')](function(_0x24f887){return _0x24f887;});})[_0x31f9('0x23')](function(_0x2d328e){if(_0x2d328e){_0x5d46db[_0x31f9('0x2b')][_0x31f9('0x77')]=_0x2d328e[0x0];if(!_0x5de05c[_0x31f9('0x5d')]['UserId'])return;return db[_0x31f9('0x78')][_0x31f9('0x5b')]({'where':{'id':_0x5de05c[_0x31f9('0x5d')][_0x31f9('0x66')],'role':'agent'},'attributes':['id',_0x31f9('0x3c'),_0x31f9('0x79'),_0x31f9('0x7a'),_0x31f9('0x7b')],'raw':!![]});}return null;})[_0x31f9('0x23')](function(_0x19edd4){if(!_0x19edd4)return null;_0x5d46db[_0x31f9('0x2b')][_0x31f9('0x67')]=_0x19edd4;return _0x5d46db;})['then'](function(_0x3ec04b){if(_0x3ec04b){_0x3ec04b[_0x31f9('0x2b')][_0x31f9('0x7c')]=util[_0x31f9('0x64')](_0x31f9('0x7d'),_0x5de05c[_0x31f9('0x6e')][_0x31f9('0x3c')]);_0x3ec04b[_0x31f9('0x2b')]['channel']=_0x5d46db[_0x31f9('0x7e')];_0x3ec04b[_0x31f9('0x2b')]['motionChannel']=_0x5d46db['channel'];_0x3ec04b[_0x31f9('0x2b')][_0x31f9('0x80')]=_0x31f9('0x39');respondWithRpcPromise('EventManager',_0x31f9('0x81'),{'event':_0x31f9('0x88'),'message':_[_0x31f9('0x51')](_0x5d46db[_0x31f9('0x2b')],JSON['parse'](_0x5d46db[_0x31f9('0x6c')]['formData']))},client9002);return _0x5d46db;}return null;})[_0x31f9('0x23')](respondWithResult(_0x7aae9,null))[_0x31f9('0x2e')](handleError(_0x7aae9,null));};
\ No newline at end of file
+var _0x30dd=['Sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','accept','EventManager','acceptmessage','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','QueryTypes','contact','SIP/%s','event','rejectmessage','parse','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','undefined','count','offset','set','Content-Range','json','apply','destroy','end','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','show','params','options','find','create','body','update','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','format','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x30dd,0x1ab));var _0xd30d=function(_0x3fb9f7,_0x297de6){_0x3fb9f7=_0x3fb9f7-0x0;var _0x70fabc=_0x30dd[_0x3fb9f7];return _0x70fabc;};'use strict';var emlformat=require(_0xd30d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd30d('0x1'));var rp=require(_0xd30d('0x2'));var moment=require(_0xd30d('0x3'));var BPromise=require(_0xd30d('0x4'));var Mustache=require(_0xd30d('0x5'));var util=require(_0xd30d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd30d('0x7'));var ejs=require(_0xd30d('0x8'));var fs=require('fs');var fs_extra=require(_0xd30d('0x9'));var _=require(_0xd30d('0xa'));var squel=require(_0xd30d('0xb'));var crypto=require(_0xd30d('0xc'));var jsforce=require(_0xd30d('0xd'));var deskjs=require(_0xd30d('0xe'));var toCsv=require(_0xd30d('0x7'));var querystring=require(_0xd30d('0xf'));var Papa=require(_0xd30d('0x10'));var Redis=require(_0xd30d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd30d('0x12'));var as=require(_0xd30d('0x13'));var hardwareService=require(_0xd30d('0x14'));var logger=require(_0xd30d('0x15'))(_0xd30d('0x16'));var utils=require(_0xd30d('0x17'));var config=require(_0xd30d('0x18'));var licenseUtil=require(_0xd30d('0x19'));var db=require(_0xd30d('0x1a'))['db'];config[_0xd30d('0x1b')]=_[_0xd30d('0x1c')](config['redis'],{'host':_0xd30d('0x1d'),'port':0x18eb});var socket=require(_0xd30d('0x1e'))(new Redis(config[_0xd30d('0x1b')]));require('./chatMessage.socket')[_0xd30d('0x1f')](socket);var jayson=require(_0xd30d('0x20'));var client=jayson['client'][_0xd30d('0x21')]({'port':0x232c});var client9002=jayson[_0xd30d('0x22')][_0xd30d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5cc3bf,_0x1dcffe,_0x32c1e5,_0x344bae){return new BPromise(function(_0x37713f,_0x3cb322){var _0x7e0d63=_0x344bae||client;return _0x7e0d63[_0xd30d('0x23')](_0x5cc3bf,_0x32c1e5)[_0xd30d('0x24')](function(_0x3dbff2){logger[_0xd30d('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1dcffe,_0xd30d('0x26'));logger[_0xd30d('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1dcffe,_0xd30d('0x26'),JSON['stringify'](_0x3dbff2));if(_0x3dbff2[_0xd30d('0x28')]){if(_0x3dbff2[_0xd30d('0x28')]['code']===0x1f4){logger[_0xd30d('0x28')](_0xd30d('0x29'),_0x1dcffe,_0x3dbff2[_0xd30d('0x28')][_0xd30d('0x2a')]);return _0x3cb322(_0x3dbff2[_0xd30d('0x28')]['message']);}logger[_0xd30d('0x28')]('ChatMessage,\x20%s,\x20%s',_0x1dcffe,_0x3dbff2[_0xd30d('0x28')]['message']);return _0x37713f(_0x3dbff2[_0xd30d('0x28')][_0xd30d('0x2a')]);}else{logger[_0xd30d('0x25')](_0xd30d('0x29'),_0x1dcffe,_0xd30d('0x26'));_0x37713f(_0x3dbff2[_0xd30d('0x2b')][_0xd30d('0x2a')]);}})[_0xd30d('0x2c')](function(_0x1a1814){logger[_0xd30d('0x28')](_0xd30d('0x29'),_0x1dcffe,_0x1a1814);_0x3cb322(_0x1a1814);});});}function respondWithStatusCode(_0x19d376,_0xd16469){_0xd16469=_0xd16469||0xcc;return function(_0x51d91d){if(_0x51d91d){return _0x19d376[_0xd30d('0x2d')](_0xd16469);}return _0x19d376[_0xd30d('0x2e')](_0xd16469)['end']();};}function respondWithResult(_0xa4c709,_0x207608){_0x207608=_0x207608||0xc8;return function(_0x540479){if(_0x540479){return _0xa4c709[_0xd30d('0x2e')](_0x207608)['json'](_0x540479);}};}function respondWithFilteredResult(_0x4b3de9,_0x4a7857){return function(_0x2b3945){if(_0x2b3945){var _0x10b7c5=typeof _0x4a7857['offset']===_0xd30d('0x2f')&&typeof _0x4a7857['limit']==='undefined';var _0x5f178a=_0x2b3945[_0xd30d('0x30')];var _0x99a141=_0x10b7c5?0x0:_0x4a7857['offset'];var _0x441c46=_0x10b7c5?_0x2b3945[_0xd30d('0x30')]:_0x4a7857[_0xd30d('0x31')]+_0x4a7857['limit'];var _0x39970c;if(_0x441c46>=_0x5f178a){_0x441c46=_0x5f178a;_0x39970c=0xc8;}else{_0x39970c=0xce;}_0x4b3de9[_0xd30d('0x2e')](_0x39970c);return _0x4b3de9[_0xd30d('0x32')](_0xd30d('0x33'),_0x99a141+'-'+_0x441c46+'/'+_0x5f178a)[_0xd30d('0x34')](_0x2b3945);}return null;};}function patchUpdates(_0x29851c){return function(_0x2bf8d2){try{jsonpatch[_0xd30d('0x35')](_0x2bf8d2,_0x29851c,!![]);}catch(_0x9c538d){return BPromise['reject'](_0x9c538d);}return _0x2bf8d2['save']();};}function saveUpdates(_0x580399,_0x38cac9){return function(_0x23246d){if(_0x23246d){return _0x23246d['update'](_0x580399)['then'](function(_0x118920){return _0x118920;});}return null;};}function removeEntity(_0x53c508,_0x2883b1){return function(_0x4e63c6){if(_0x4e63c6){return _0x4e63c6[_0xd30d('0x36')]()[_0xd30d('0x24')](function(){_0x53c508[_0xd30d('0x2e')](0xcc)[_0xd30d('0x37')]();});}};}function handleEntityNotFound(_0x4b616e,_0x14917a){return function(_0x5d71c0){if(!_0x5d71c0){_0x4b616e[_0xd30d('0x2d')](0x194);}return _0x5d71c0;};}function handleError(_0x3ec58f,_0x353ac6){_0x353ac6=_0x353ac6||0x1f4;return function(_0x5d70a9){logger['error'](_0x5d70a9['stack']);if(_0x5d70a9[_0xd30d('0x38')]){delete _0x5d70a9['name'];}_0x3ec58f[_0xd30d('0x2e')](_0x353ac6)[_0xd30d('0x39')](_0x5d70a9);};}exports[_0xd30d('0x3a')]=function(_0x294c50,_0x1ec303){var _0x20c6c9={},_0x2f151d={},_0x33beb0={'count':0x0,'rows':[]};var _0x5d5c42=_[_0xd30d('0x3b')](db[_0xd30d('0x3c')][_0xd30d('0x3d')],function(_0x28eeb5){return{'name':_0x28eeb5[_0xd30d('0x3e')],'type':_0x28eeb5['type'][_0xd30d('0x3f')]};});_0x2f151d[_0xd30d('0x40')]=_[_0xd30d('0x3b')](_0x5d5c42,_0xd30d('0x38'));_0x2f151d[_0xd30d('0x41')]=_[_0xd30d('0x42')](_0x294c50[_0xd30d('0x41')]);_0x2f151d[_0xd30d('0x43')]=_[_0xd30d('0x44')](_0x2f151d[_0xd30d('0x40')],_0x2f151d[_0xd30d('0x41')]);_0x20c6c9[_0xd30d('0x45')]=_[_0xd30d('0x44')](_0x2f151d[_0xd30d('0x40')],qs['fields'](_0x294c50[_0xd30d('0x41')][_0xd30d('0x46')]));_0x20c6c9[_0xd30d('0x45')]=_0x20c6c9[_0xd30d('0x45')][_0xd30d('0x47')]?_0x20c6c9[_0xd30d('0x45')]:_0x2f151d['model'];if(!_0x294c50[_0xd30d('0x41')]['hasOwnProperty']('nolimit')){_0x20c6c9[_0xd30d('0x48')]=qs[_0xd30d('0x48')](_0x294c50[_0xd30d('0x41')]['limit']);_0x20c6c9[_0xd30d('0x31')]=qs[_0xd30d('0x31')](_0x294c50[_0xd30d('0x41')][_0xd30d('0x31')]);}_0x20c6c9[_0xd30d('0x49')]=qs[_0xd30d('0x4a')](_0x294c50[_0xd30d('0x41')][_0xd30d('0x4a')]);_0x20c6c9[_0xd30d('0x4b')]=qs[_0xd30d('0x43')](_['pick'](_0x294c50[_0xd30d('0x41')],_0x2f151d[_0xd30d('0x43')]),_0x5d5c42);if(_0x294c50[_0xd30d('0x41')][_0xd30d('0x4c')]){_0x20c6c9[_0xd30d('0x4b')]=_[_0xd30d('0x4d')](_0x20c6c9[_0xd30d('0x4b')],{'$or':_[_0xd30d('0x3b')](_0x5d5c42,function(_0x1d873d){if(_0x1d873d[_0xd30d('0x4e')]!=='VIRTUAL'){var _0x50dd3e={};_0x50dd3e[_0x1d873d[_0xd30d('0x38')]]={'$like':'%'+_0x294c50['query'][_0xd30d('0x4c')]+'%'};return _0x50dd3e;}})});}_0x20c6c9=_[_0xd30d('0x4d')]({},_0x20c6c9,_0x294c50['options']);var _0x4dec84={'where':_0x20c6c9[_0xd30d('0x4b')]};return db[_0xd30d('0x3c')][_0xd30d('0x30')](_0x4dec84)[_0xd30d('0x24')](function(_0x1672c1){_0x33beb0['count']=_0x1672c1;if(_0x294c50[_0xd30d('0x41')][_0xd30d('0x4f')]){_0x20c6c9[_0xd30d('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0xd30d('0x51')](_0x20c6c9);})[_0xd30d('0x24')](function(_0x44ea6a){_0x33beb0[_0xd30d('0x52')]=_0x44ea6a;return _0x33beb0;})['then'](respondWithFilteredResult(_0x1ec303,_0x20c6c9))[_0xd30d('0x2c')](handleError(_0x1ec303,null));};exports[_0xd30d('0x53')]=function(_0x2ec9e4,_0x47c512){var _0xce43c7={'raw':!![],'where':{'id':_0x2ec9e4[_0xd30d('0x54')]['id']}},_0x5dffb6={};_0x5dffb6['model']=_[_0xd30d('0x42')](db[_0xd30d('0x3c')][_0xd30d('0x3d')]);_0x5dffb6['query']=_[_0xd30d('0x42')](_0x2ec9e4[_0xd30d('0x41')]);_0x5dffb6[_0xd30d('0x43')]=_['intersection'](_0x5dffb6['model'],_0x5dffb6[_0xd30d('0x41')]);_0xce43c7['attributes']=_[_0xd30d('0x44')](_0x5dffb6[_0xd30d('0x40')],qs[_0xd30d('0x46')](_0x2ec9e4[_0xd30d('0x41')][_0xd30d('0x46')]));_0xce43c7[_0xd30d('0x45')]=_0xce43c7[_0xd30d('0x45')][_0xd30d('0x47')]?_0xce43c7[_0xd30d('0x45')]:_0x5dffb6[_0xd30d('0x40')];if(_0x2ec9e4[_0xd30d('0x41')]['includeAll']){_0xce43c7[_0xd30d('0x50')]=[{'all':!![]}];}_0xce43c7=_[_0xd30d('0x4d')]({},_0xce43c7,_0x2ec9e4[_0xd30d('0x55')]);return db[_0xd30d('0x3c')][_0xd30d('0x56')](_0xce43c7)['then'](handleEntityNotFound(_0x47c512,null))[_0xd30d('0x24')](respondWithResult(_0x47c512,null))[_0xd30d('0x2c')](handleError(_0x47c512,null));};exports['create']=function(_0x437882,_0x144cac){return db[_0xd30d('0x3c')][_0xd30d('0x57')](_0x437882[_0xd30d('0x58')],{})['then'](respondWithResult(_0x144cac,0xc9))[_0xd30d('0x2c')](handleError(_0x144cac,null));};exports[_0xd30d('0x59')]=function(_0x33fd1c,_0x52b686){if(_0x33fd1c[_0xd30d('0x58')]['id']){delete _0x33fd1c[_0xd30d('0x58')]['id'];}return db[_0xd30d('0x3c')][_0xd30d('0x56')]({'where':{'id':_0x33fd1c[_0xd30d('0x54')]['id']}})[_0xd30d('0x24')](handleEntityNotFound(_0x52b686,null))['then'](saveUpdates(_0x33fd1c[_0xd30d('0x58')],null))[_0xd30d('0x24')](respondWithResult(_0x52b686,null))[_0xd30d('0x2c')](handleError(_0x52b686,null));};exports[_0xd30d('0x36')]=function(_0x1fb840,_0x42528d){return db[_0xd30d('0x3c')]['find']({'where':{'id':_0x1fb840['params']['id']}})[_0xd30d('0x24')](handleEntityNotFound(_0x42528d,null))[_0xd30d('0x24')](removeEntity(_0x42528d,null))[_0xd30d('0x2c')](handleError(_0x42528d,null));};exports[_0xd30d('0x5a')]=function(_0x3fbec7,_0x44db0a){return db[_0xd30d('0x3c')][_0xd30d('0x5a')]()[_0xd30d('0x24')](respondWithResult(_0x44db0a,null))['catch'](handleError(_0x44db0a,null));};var interaction_log=require(_0xd30d('0x15'))(_0xd30d('0x5b'));exports['accept']=function(_0x158269,_0x586c46,_0x2ebca8){var _0x4bb854={'agent':{},'channel':_0xd30d('0x5c')};if(_0x158269['body']['id']){delete _0x158269['body']['id'];}_0x158269['body'][_0xd30d('0x5d')]=!![];_0x158269[_0xd30d('0x58')][_0xd30d('0x5e')]=moment()['format'](_0xd30d('0x5f'));_0x158269[_0xd30d('0x58')][_0xd30d('0x60')]=_0x158269[_0xd30d('0x58')]['UserId']||_0x158269[_0xd30d('0x61')]['id'];_0x4bb854['agent']['id']=_0x158269[_0xd30d('0x58')][_0xd30d('0x60')];return db[_0xd30d('0x3c')][_0xd30d('0x56')]({'where':{'id':_0x158269[_0xd30d('0x54')]['id'],'UserId':null}})[_0xd30d('0x24')](handleEntityNotFound(_0x586c46,null))[_0xd30d('0x24')](saveUpdates(_0x158269['body'],null))[_0xd30d('0x24')](function(_0x205a18){if(_0x205a18){_0x4bb854[_0xd30d('0x2a')]=_0x205a18['get']({'plain':!![]});return db[_0xd30d('0x62')][_0xd30d('0x56')]({'where':{'id':_0x205a18[_0xd30d('0x63')]}});}return null;})[_0xd30d('0x24')](handleEntityNotFound(_0x586c46,null))[_0xd30d('0x24')](function(_0x5b911e){if(_0x5b911e){return _0x5b911e[_0xd30d('0x59')]({'UserId':_0x158269['body'][_0xd30d('0x60')],'read1stAt':_['isNil'](_0x5b911e['read1stAt'])?moment()[_0xd30d('0x64')](_0xd30d('0x5f')):undefined});}return null;})['then'](function(_0x18b257){if(_0x18b257){_0x4bb854[_0xd30d('0x65')]=_0x18b257[_0xd30d('0x66')]({'plain':!![]});interaction_log['info'](_0xd30d('0x67'),_0x158269[_0xd30d('0x61')]['id'],_0x158269['user'][_0xd30d('0x38')],_0x158269[_0xd30d('0x61')]['role'],_0x4bb854[_0xd30d('0x65')]['id'],_0x158269[_0xd30d('0x58')]?JSON[_0xd30d('0x68')](_0x158269[_0xd30d('0x58')]):_0xd30d('0x69'));return respondWithRpcPromise(_0xd30d('0x6a'),'acceptMessage',_0x4bb854);}return null;})[_0xd30d('0x24')](function(_0x1d68bd){var _0x5b28e4=_0xd30d('0x6b')+_0x1d68bd['message'][_0xd30d('0x6c')];return db['sequelize']['query'](_0x5b28e4,{'type':db[_0xd30d('0x6d')]['QueryTypes'][_0xd30d('0x6e')],'raw':!![]})['then'](function(_0x882260){return _0x882260;});})[_0xd30d('0x24')](function(_0xa3775){if(_0xa3775){_0x4bb854[_0xd30d('0x2a')]['contact']=_0xa3775[0x0];if(!_0x158269[_0xd30d('0x58')][_0xd30d('0x60')])return;return db[_0xd30d('0x6f')][_0xd30d('0x56')]({'where':{'id':_0x158269[_0xd30d('0x58')][_0xd30d('0x60')],'role':_0xd30d('0x70')},'attributes':['id',_0xd30d('0x38'),_0xd30d('0x71'),_0xd30d('0x72'),_0xd30d('0x73')],'raw':!![]});}return null;})[_0xd30d('0x24')](function(_0x341e4){if(!_0x341e4)return null;_0x4bb854[_0xd30d('0x2a')][_0xd30d('0x70')]=_0x341e4;return _0x4bb854;})[_0xd30d('0x24')](function(_0x5f42a7){if(_0x5f42a7){if(_0x158269[_0xd30d('0x58')][_0xd30d('0x74')]){_0x4bb854[_0xd30d('0x2a')][_0xd30d('0x75')]=util[_0xd30d('0x64')]('SIP/%s',_0x158269[_0xd30d('0x61')]['name']);_0x4bb854[_0xd30d('0x2a')][_0xd30d('0x76')]=_0x4bb854[_0xd30d('0x76')];_0x4bb854['message'][_0xd30d('0x77')]=_0x4bb854[_0xd30d('0x76')];_0x4bb854[_0xd30d('0x2a')]['event']=_0xd30d('0x78');return respondWithRpcPromise(_0xd30d('0x79'),_0xd30d('0x79'),{'event':_0xd30d('0x7a'),'message':_[_0xd30d('0x4d')](_0x4bb854['message'],JSON['parse'](_0x4bb854[_0xd30d('0x65')][_0xd30d('0x7b')]))},client9002)[_0xd30d('0x24')](function(){return _0x4bb854;});}return _0x4bb854;}return null;})[_0xd30d('0x24')](respondWithResult(_0x586c46,null))[_0xd30d('0x2c')](handleError(_0x586c46,null));};var interaction_log=require(_0xd30d('0x15'))(_0xd30d('0x5b'));exports[_0xd30d('0x7c')]=function(_0x32dc0f,_0x3ca5c1,_0x1c4423){var _0x4c7d1b={'agent':{},'channel':'chat'};if(_0x32dc0f[_0xd30d('0x58')]['id']){delete _0x32dc0f[_0xd30d('0x58')]['id'];}_0x32dc0f['body']['UserId']=_0x32dc0f['body']['UserId']||_0x32dc0f[_0xd30d('0x61')]['id'];_0x4c7d1b[_0xd30d('0x70')]['id']=_0x32dc0f[_0xd30d('0x58')][_0xd30d('0x60')];return db[_0xd30d('0x3c')][_0xd30d('0x56')]({'where':{'id':_0x32dc0f[_0xd30d('0x54')]['id'],'UserId':null}})[_0xd30d('0x24')](handleEntityNotFound(_0x3ca5c1,null))[_0xd30d('0x24')](function(_0x1ed0b4){if(_0x1ed0b4){_0x4c7d1b['message']=_0x1ed0b4[_0xd30d('0x66')]({'plain':!![]});return db[_0xd30d('0x62')][_0xd30d('0x56')]({'where':{'id':_0x1ed0b4[_0xd30d('0x63')]}});}return null;})[_0xd30d('0x24')](handleEntityNotFound(_0x3ca5c1,null))[_0xd30d('0x24')](function(_0x11df78){if(_0x11df78){_0x4c7d1b['interaction']=_0x11df78[_0xd30d('0x66')]({'plain':!![]});interaction_log[_0xd30d('0x25')](_0xd30d('0x7d'),_0x32dc0f['user']['id'],_0x32dc0f[_0xd30d('0x61')][_0xd30d('0x38')],_0x32dc0f['user'][_0xd30d('0x7e')],_0x4c7d1b['interaction']['id'],_0x32dc0f[_0xd30d('0x58')]?JSON[_0xd30d('0x68')](_0x32dc0f[_0xd30d('0x58')]):_0xd30d('0x69'));return respondWithRpcPromise(_0xd30d('0x7f'),'rejectMessage',_0x4c7d1b);}return null;})[_0xd30d('0x24')](function(_0x81597c){var _0x5acd99=_0xd30d('0x6b')+_0x81597c[_0xd30d('0x2a')][_0xd30d('0x6c')];return db['sequelize'][_0xd30d('0x41')](_0x5acd99,{'type':db['Sequelize'][_0xd30d('0x80')]['SELECT'],'raw':!![]})[_0xd30d('0x24')](function(_0x1e25e1){return _0x1e25e1;});})[_0xd30d('0x24')](function(_0x12b5d7){if(_0x12b5d7){_0x4c7d1b['message'][_0xd30d('0x81')]=_0x12b5d7[0x0];if(!_0x32dc0f[_0xd30d('0x58')][_0xd30d('0x60')])return;return db[_0xd30d('0x6f')][_0xd30d('0x56')]({'where':{'id':_0x32dc0f[_0xd30d('0x58')]['UserId'],'role':_0xd30d('0x70')},'attributes':['id',_0xd30d('0x38'),'fullname',_0xd30d('0x72'),_0xd30d('0x73')],'raw':!![]});}return null;})[_0xd30d('0x24')](function(_0x16d8b2){if(!_0x16d8b2)return null;_0x4c7d1b[_0xd30d('0x2a')][_0xd30d('0x70')]=_0x16d8b2;return _0x4c7d1b;})[_0xd30d('0x24')](function(_0x225488){if(_0x225488){_0x225488['message'][_0xd30d('0x75')]=util[_0xd30d('0x64')](_0xd30d('0x82'),_0x32dc0f['user'][_0xd30d('0x38')]);_0x225488['message']['channel']=_0x4c7d1b[_0xd30d('0x76')];_0x225488[_0xd30d('0x2a')][_0xd30d('0x77')]=_0x4c7d1b[_0xd30d('0x76')];_0x225488['message'][_0xd30d('0x83')]=_0xd30d('0x7c');respondWithRpcPromise('EventManager','EventManager',{'event':_0xd30d('0x84'),'message':_['merge'](_0x4c7d1b[_0xd30d('0x2a')],JSON[_0xd30d('0x85')](_0x4c7d1b[_0xd30d('0x65')][_0xd30d('0x7b')]))},client9002);return _0x4c7d1b;}return null;})[_0xd30d('0x24')](respondWithResult(_0x3ca5c1,null))[_0xd30d('0x2c')](handleError(_0x3ca5c1,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index bf98a55..769a6a0 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 _0xcc6f=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x4922db,_0x21c496){var _0x294b2c=function(_0x2efc91){while(--_0x2efc91){_0x4922db['push'](_0x4922db['shift']());}};_0x294b2c(++_0x21c496);}(_0xcc6f,0xb5));var _0xfcc6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcc6f[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xfcc6('0x0'));var ChatMessage=require(_0xfcc6('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfcc6('0x2'),'afterUpdate':_0xfcc6('0x3'),'afterDestroy':_0xfcc6('0x4')};function emitEvent(_0x9bfabb){return function(_0x444a6b,_0x13b0b6,_0xa051ac){ChatMessageEvents['emit'](_0x9bfabb+':'+_0x444a6b['id'],_0x444a6b);ChatMessageEvents[_0xfcc6('0x5')](_0x9bfabb,_0x444a6b);_0xa051ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xfcc6('0x6')](e,emitEvent(event));}}module[_0xfcc6('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x54aa=['../../mysqldb','ChatMessage','save','emit','exports','events'];(function(_0x238cd5,_0x5eaefc){var _0x196bfb=function(_0x5c7d53){while(--_0x5c7d53){_0x238cd5['push'](_0x238cd5['shift']());}};_0x196bfb(++_0x5eaefc);}(_0x54aa,0x1a9));var _0xa54a=function(_0x596c48,_0x5f4b40){_0x596c48=_0x596c48-0x0;var _0x2508d0=_0x54aa[_0x596c48];return _0x2508d0;};'use strict';var EventEmitter=require(_0xa54a('0x0'));var ChatMessage=require(_0xa54a('0x1'))['db'][_0xa54a('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa54a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x11e72c){return function(_0x53829d,_0x5147b6,_0x35d176){ChatMessageEvents['emit'](_0x11e72c+':'+_0x53829d['id'],_0x53829d);ChatMessageEvents[_0xa54a('0x4')](_0x11e72c,_0x53829d);_0x35d176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xa54a('0x5')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 85ba3a1..dbbf3f3 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 _0xc913=['./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x7c0070,_0x4ecf28){var _0x46a772=function(_0x44083b){while(--_0x44083b){_0x7c0070['push'](_0x7c0070['shift']());}};_0x46a772(++_0x4ecf28);}(_0xc913,0xd9));var _0x3c91=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0xc913[_0x5a99db];return _0x3aad62;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c91('0x0'))(_0x3c91('0x1'));var moment=require(_0x3c91('0x2'));var BPromise=require(_0x3c91('0x3'));var rp=require(_0x3c91('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c91('0x5'));var config=require(_0x3c91('0x6'));var attributes=require(_0x3c91('0x7'));module[_0x3c91('0x8')]=function(_0x340d56,_0x9b69d){return _0x340d56['define'](_0x3c91('0x9'),attributes,{'tableName':_0x3c91('0xa'),'paranoid':![],'indexes':[{'name':_0x3c91('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31756f,_0x2df461,_0x459f45){var _0x4c769d=_0x340d56[_0x3c91('0xc')];var _0x4ebcee=_0x31756f[_0x3c91('0xd')]({'plain':!![]});if(_0x4ebcee[_0x3c91('0xe')][_0x3c91('0xf')]()==='in'||_0x4ebcee[_0x3c91('0xe')]['toLowerCase']()===_0x3c91('0x10')&&!_0x4ebcee[_0x3c91('0x11')]&&!_[_0x3c91('0x12')](_0x4ebcee['UserId'])){_0x4c769d[_0x3c91('0x13')][_0x3c91('0x14')]({'where':{'id':_0x4ebcee[_0x3c91('0x15')]}})[_0x3c91('0x16')](function(_0x168267){if(_0x168267){_0x168267[_0x3c91('0x17')]({'lastMsgAt':_0x4ebcee[_0x3c91('0x18')],'lastMsgDirection':_0x4ebcee[_0x3c91('0xe')][_0x3c91('0xf')]()});}})['catch'](function(_0x23e8b8){console[_0x3c91('0x19')](_0x23e8b8);});}_0x459f45();}},'charset':_0x3c91('0x1a'),'collate':_0x3c91('0x1b')});};
\ No newline at end of file
+var _0x1403=['secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0x1403,0x9b));var _0x3140=function(_0x4873e7,_0xadd09b){_0x4873e7=_0x4873e7-0x0;var _0x589ef4=_0x1403[_0x4873e7];return _0x589ef4;};'use strict';var _=require('lodash');var util=require(_0x3140('0x0'));var logger=require(_0x3140('0x1'))(_0x3140('0x2'));var moment=require(_0x3140('0x3'));var BPromise=require(_0x3140('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3140('0x5'));var rimraf=require(_0x3140('0x6'));var config=require(_0x3140('0x7'));var attributes=require(_0x3140('0x8'));module['exports']=function(_0x5cb034,_0x5cfeb0){return _0x5cb034[_0x3140('0x9')](_0x3140('0xa'),attributes,{'tableName':_0x3140('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3140('0xc')],'type':_0x3140('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47d0f4,_0x269c6b,_0xa63ba6){var _0x2491e3=_0x5cb034[_0x3140('0xe')];var _0x35818a=_0x47d0f4[_0x3140('0xf')]({'plain':!![]});if(_0x35818a[_0x3140('0x10')][_0x3140('0x11')]()==='in'||_0x35818a[_0x3140('0x10')][_0x3140('0x11')]()===_0x3140('0x12')&&!_0x35818a[_0x3140('0x13')]&&!_[_0x3140('0x14')](_0x35818a[_0x3140('0x15')])){_0x2491e3[_0x3140('0x16')][_0x3140('0x17')]({'where':{'id':_0x35818a[_0x3140('0x18')]}})['then'](function(_0x505750){if(_0x505750){_0x505750['update']({'lastMsgAt':_0x35818a[_0x3140('0x19')],'lastMsgDirection':_0x35818a[_0x3140('0x10')][_0x3140('0x11')]()});}})['catch'](function(_0x136b5b){console[_0x3140('0x1a')](_0x136b5b);});}_0xa63ba6();}},'charset':_0x3140('0x1b'),'collate':_0x3140('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 060fc34..2aa7d8b 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 _0x3475=['register','request','then','info','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','ChatMessage','body','options','raw','CreateChatMessage','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x113c74,_0xd2f035){var _0x1909bb=function(_0x4c3212){while(--_0x4c3212){_0x113c74['push'](_0x113c74['shift']());}};_0x1909bb(++_0xd2f035);}(_0x3475,0xbc));var _0x5347=function(_0x33ccfb,_0x5503c7){_0x33ccfb=_0x33ccfb-0x0;var _0x5e4f46=_0x3475[_0x33ccfb];return _0x5e4f46;};'use strict';var _=require(_0x5347('0x0'));var util=require(_0x5347('0x1'));var moment=require(_0x5347('0x2'));var BPromise=require(_0x5347('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5347('0x4'));var db=require(_0x5347('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5347('0x6'))(_0x5347('0x7'));var config=require('../../config/environment');var jayson=require(_0x5347('0x8'));var client=jayson[_0x5347('0x9')][_0x5347('0xa')]({'port':0x232a});config[_0x5347('0xb')]=_[_0x5347('0xc')](config['redis'],{'host':_0x5347('0xd'),'port':0x18eb});var socket=require(_0x5347('0xe'))(new Redis(config[_0x5347('0xb')]));require(_0x5347('0xf'))[_0x5347('0x10')](socket);function respondWithRpcPromise(_0x5ce222,_0x4db134,_0x403a8c){return new BPromise(function(_0x18b5e2,_0x343354){return client[_0x5347('0x11')](_0x5ce222,_0x403a8c)[_0x5347('0x12')](function(_0x4f9626){logger[_0x5347('0x13')]('ChatMessage,\x20%s,\x20%s',_0x4db134,_0x5347('0x14'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4db134,_0x5347('0x14'),JSON[_0x5347('0x15')](_0x4f9626));if(_0x4f9626['error']){if(_0x4f9626[_0x5347('0x16')][_0x5347('0x17')]===0x1f4){logger[_0x5347('0x16')](_0x5347('0x18'),_0x4db134,_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);return _0x343354(_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);}logger[_0x5347('0x16')](_0x5347('0x18'),_0x4db134,_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);return _0x18b5e2(_0x4f9626[_0x5347('0x16')][_0x5347('0x19')]);}else{logger[_0x5347('0x13')](_0x5347('0x18'),_0x4db134,_0x5347('0x14'));_0x18b5e2(_0x4f9626[_0x5347('0x1a')][_0x5347('0x19')]);}})['catch'](function(_0x1238fa){logger[_0x5347('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4db134,_0x1238fa);_0x343354(_0x1238fa);});});}exports['CreateChatMessage']=function(_0x187b3a){var _0x406e75=this;return new Promise(function(_0xe62d2a,_0x19fe45){return db[_0x5347('0x1b')]['create'](_0x187b3a[_0x5347('0x1c')],{'raw':_0x187b3a[_0x5347('0x1d')]?_0x187b3a['options'][_0x5347('0x1e')]===undefined?!![]:![]:!![]})[_0x5347('0x12')](function(_0x1199d2){logger[_0x5347('0x13')](_0x5347('0x1f'),_0x187b3a);logger[_0x5347('0x20')](_0x5347('0x1f'),_0x187b3a,JSON[_0x5347('0x15')](_0x1199d2));_0xe62d2a(_0x1199d2);})[_0x5347('0x21')](function(_0x20db23){logger[_0x5347('0x16')](_0x5347('0x1f'),_0x20db23[_0x5347('0x19')],_0x187b3a);_0x19fe45(_0x406e75[_0x5347('0x16')](0x1f4,_0x20db23[_0x5347('0x19')]));});});};
\ No newline at end of file
+var _0xd399=['http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','ChatMessage','create','body','options','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3251d0,_0x4d310c){var _0x28dd57=function(_0x19bcb4){while(--_0x19bcb4){_0x3251d0['push'](_0x3251d0['shift']());}};_0x28dd57(++_0x4d310c);}(_0xd399,0x181));var _0x9d39=function(_0x4d71b7,_0x3a110d){_0x4d71b7=_0x4d71b7-0x0;var _0x252631=_0xd399[_0x4d71b7];return _0x252631;};'use strict';var _=require(_0x9d39('0x0'));var util=require(_0x9d39('0x1'));var moment=require(_0x9d39('0x2'));var BPromise=require(_0x9d39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d39('0x4'));var db=require(_0x9d39('0x5'))['db'];var utils=require(_0x9d39('0x6'));var logger=require(_0x9d39('0x7'))(_0x9d39('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d39('0x9'));var client=jayson[_0x9d39('0xa')][_0x9d39('0xb')]({'port':0x232a});config['redis']=_[_0x9d39('0xc')](config[_0x9d39('0xd')],{'host':_0x9d39('0xe'),'port':0x18eb});var socket=require(_0x9d39('0xf'))(new Redis(config[_0x9d39('0xd')]));require(_0x9d39('0x10'))[_0x9d39('0x11')](socket);function respondWithRpcPromise(_0x482e61,_0x49a963,_0x1b4583){return new BPromise(function(_0x17d13e,_0x43572f){return client[_0x9d39('0x12')](_0x482e61,_0x1b4583)[_0x9d39('0x13')](function(_0x2886e6){logger[_0x9d39('0x14')]('ChatMessage,\x20%s,\x20%s',_0x49a963,'request\x20sent');logger[_0x9d39('0x15')](_0x9d39('0x16'),_0x49a963,_0x9d39('0x17'),JSON[_0x9d39('0x18')](_0x2886e6));if(_0x2886e6[_0x9d39('0x19')]){if(_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1a')]===0x1f4){logger[_0x9d39('0x19')]('ChatMessage,\x20%s,\x20%s',_0x49a963,_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1b')]);return _0x43572f(_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1b')]);}logger[_0x9d39('0x19')]('ChatMessage,\x20%s,\x20%s',_0x49a963,_0x2886e6[_0x9d39('0x19')][_0x9d39('0x1b')]);return _0x17d13e(_0x2886e6[_0x9d39('0x19')]['message']);}else{logger['info'](_0x9d39('0x1c'),_0x49a963,_0x9d39('0x17'));_0x17d13e(_0x2886e6[_0x9d39('0x1d')]['message']);}})[_0x9d39('0x1e')](function(_0x8f9a6c){logger[_0x9d39('0x19')](_0x9d39('0x1c'),_0x49a963,_0x8f9a6c);_0x43572f(_0x8f9a6c);});});}exports['CreateChatMessage']=function(_0x48c2fd){var _0x750458=this;return new Promise(function(_0x284f67,_0xd2ced7){return db[_0x9d39('0x1f')][_0x9d39('0x20')](_0x48c2fd[_0x9d39('0x21')],{'raw':_0x48c2fd[_0x9d39('0x22')]?_0x48c2fd['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x23f0fe){logger[_0x9d39('0x14')](_0x9d39('0x23'),_0x48c2fd);logger[_0x9d39('0x15')](_0x9d39('0x23'),_0x48c2fd,JSON['stringify'](_0x23f0fe));_0x284f67(_0x23f0fe);})[_0x9d39('0x1e')](function(_0x406060){logger[_0x9d39('0x19')](_0x9d39('0x23'),_0x406060['message'],_0x48c2fd);_0xd2ced7(_0x750458[_0x9d39('0x19')](0x1f4,_0x406060[_0x9d39('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index fa1ab85..a467ca0 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 _0x9fc5=['save','remove','emit','removeListener','register','length','chatMessage:'];(function(_0x147d4c,_0xc24f70){var _0x1811fc=function(_0x15c2ee){while(--_0x15c2ee){_0x147d4c['push'](_0x147d4c['shift']());}};_0x1811fc(++_0xc24f70);}(_0x9fc5,0xb6));var _0x59fc=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x9fc5[_0x2405bc];return _0x5272d4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x59fc('0x0'),_0x59fc('0x1'),'update'];function createListener(_0x4647c5,_0x24cd55){return function(_0x46c819){_0x24cd55[_0x59fc('0x2')](_0x4647c5,_0x46c819);};}function removeListener(_0x44979c,_0x1b0778){return function(){ChatMessageEvents[_0x59fc('0x3')](_0x44979c,_0x1b0778);};}exports[_0x59fc('0x4')]=function(_0x4cb94d){for(var _0x3bde0b=0x0,_0x13897f=events[_0x59fc('0x5')];_0x3bde0b<_0x13897f;_0x3bde0b++){var _0x55fa6d=events[_0x3bde0b];var _0xdd2bb9=createListener(_0x59fc('0x6')+_0x55fa6d,_0x4cb94d);ChatMessageEvents['on'](_0x55fa6d,_0xdd2bb9);}};
\ No newline at end of file
+var _0x60c2=['removeListener','register','length','save','remove','update','emit'];(function(_0x527771,_0x466d7b){var _0x1e9a21=function(_0x67cad8){while(--_0x67cad8){_0x527771['push'](_0x527771['shift']());}};_0x1e9a21(++_0x466d7b);}(_0x60c2,0x8f));var _0x260c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x60c2[_0xa464c9];return _0x3d73c4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x260c('0x0'),_0x260c('0x1'),_0x260c('0x2')];function createListener(_0x3ad4c5,_0x2f5bc8){return function(_0x759b92){_0x2f5bc8[_0x260c('0x3')](_0x3ad4c5,_0x759b92);};}function removeListener(_0x309bde,_0x17a599){return function(){ChatMessageEvents[_0x260c('0x4')](_0x309bde,_0x17a599);};}exports[_0x260c('0x5')]=function(_0x13c7d0){for(var _0x558b0c=0x0,_0x14fab2=events[_0x260c('0x6')];_0x558b0c<_0x14fab2;_0x558b0c++){var _0x3b432d=events[_0x558b0c];var _0xf22c37=createListener('chatMessage:'+_0x3b432d,_0x13c7d0);ChatMessageEvents['on'](_0x3b432d,_0xf22c37);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 67d1ae2..69bfecb 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 _0xb582=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','chat','chatmessage:create','create','put','update','reject','destroy','exports','path','connect-timeout','express'];(function(_0x1f0ebc,_0x519687){var _0x17ada6=function(_0x207a39){while(--_0x207a39){_0x1f0ebc['push'](_0x1f0ebc['shift']());}};_0x17ada6(++_0x519687);}(_0xb582,0x1dd));var _0x2b58=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb582[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b58('0x0'));var timeout=require(_0x2b58('0x1'));var express=require(_0x2b58('0x2'));var router=express[_0x2b58('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b58('0x4'));var interaction=require(_0x2b58('0x5'));var config=require(_0x2b58('0x6'));var controller=require(_0x2b58('0x7'));router[_0x2b58('0x8')]('/',auth[_0x2b58('0x9')](),controller[_0x2b58('0xa')]);router[_0x2b58('0x8')](_0x2b58('0xb'),auth[_0x2b58('0x9')](),controller[_0x2b58('0xc')]);router[_0x2b58('0x8')](_0x2b58('0xd'),auth[_0x2b58('0x9')](),controller[_0x2b58('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x2b58('0xf')](_0x2b58('0x10'),_0x2b58('0x11')),controller[_0x2b58('0x12')]);router[_0x2b58('0x13')]('/:id',controller[_0x2b58('0x14')]);router[_0x2b58('0x13')]('/:id/accept',auth[_0x2b58('0x9')](),controller['accept']);router[_0x2b58('0x13')]('/:id/reject',auth[_0x2b58('0x9')](),controller[_0x2b58('0x15')]);router['delete'](_0x2b58('0xd'),auth[_0x2b58('0x9')](),controller[_0x2b58('0x16')]);module[_0x2b58('0x17')]=router;
\ No newline at end of file
+var _0x3dcb=['../../config/environment','isAuthenticated','get','/describe','describe','show','post','chat','chatmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29e24c,_0x168327){var _0x1bfa32=function(_0x46f400){while(--_0x46f400){_0x29e24c['push'](_0x29e24c['shift']());}};_0x1bfa32(++_0x168327);}(_0x3dcb,0x13d));var _0xb3dc=function(_0x4f5a83,_0x2e5c25){_0x4f5a83=_0x4f5a83-0x0;var _0xd165f9=_0x3dcb[_0x4f5a83];return _0xd165f9;};'use strict';var multer=require(_0xb3dc('0x0'));var util=require(_0xb3dc('0x1'));var path=require(_0xb3dc('0x2'));var timeout=require(_0xb3dc('0x3'));var express=require('express');var router=express[_0xb3dc('0x4')]();var fs_extra=require(_0xb3dc('0x5'));var auth=require(_0xb3dc('0x6'));var interaction=require(_0xb3dc('0x7'));var config=require(_0xb3dc('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xb3dc('0x9')](),controller['index']);router[_0xb3dc('0xa')](_0xb3dc('0xb'),auth[_0xb3dc('0x9')](),controller[_0xb3dc('0xc')]);router[_0xb3dc('0xa')]('/:id',auth[_0xb3dc('0x9')](),controller[_0xb3dc('0xd')]);router[_0xb3dc('0xe')]('/',auth[_0xb3dc('0x9')](),interaction['tracked'](_0xb3dc('0xf'),_0xb3dc('0x10')),controller[_0xb3dc('0x11')]);router[_0xb3dc('0x12')](_0xb3dc('0x13'),controller[_0xb3dc('0x14')]);router['put'](_0xb3dc('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xb3dc('0x12')](_0xb3dc('0x16'),auth[_0xb3dc('0x9')](),controller['reject']);router[_0xb3dc('0x17')]('/:id',auth[_0xb3dc('0x9')](),controller[_0xb3dc('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 43561e0..ff5c171 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x39664c,_0x47c3c6){var _0x220cb8=function(_0x130d40){while(--_0x130d40){_0x39664c['push'](_0x39664c['shift']());}};_0x220cb8(++_0x47c3c6);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e18a,_0x2d220a){_0x4e18a=_0x4e18a-0x0;var _0x56cc08=_0xb10b[_0x4e18a];return _0x56cc08;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x757a=['exports','TEXT'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x757a,0xde));var _0xa757=function(_0x10734c,_0x5ba664){_0x10734c=_0x10734c-0x0;var _0x40e81d=_0x757a[_0x10734c];return _0x40e81d;};'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 c8ece0b..525bd4b 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(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7a54,0x106));var _0x47a5=function(_0x5d9f6a,_0x25b34c){_0x5d9f6a=_0x5d9f6a-0x0;var _0x18b0ba=_0x7a54[_0x5d9f6a];return _0x18b0ba;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x495e47,_0x1cfb0e){var _0x2ce11c=function(_0x43057f){while(--_0x43057f){_0x495e47['push'](_0x495e47['shift']());}};_0x2ce11c(++_0x1cfb0e);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 2717ac7..712d6eb 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 _0x11e5=['emit','hasOwnProperty','hook','events','ChatOfflineMessage','setMaxListeners','update','remove'];(function(_0x4ba86d,_0x3a6310){var _0x5521b6=function(_0x35a646){while(--_0x35a646){_0x4ba86d['push'](_0x4ba86d['shift']());}};_0x5521b6(++_0x3a6310);}(_0x11e5,0x8b));var _0x511e=function(_0x22b0cb,_0x5a764a){_0x22b0cb=_0x22b0cb-0x0;var _0x444178=_0x11e5[_0x22b0cb];return _0x444178;};'use strict';var EventEmitter=require(_0x511e('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x511e('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x511e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x511e('0x3'),'afterDestroy':_0x511e('0x4')};function emitEvent(_0x101e06){return function(_0x5cab33,_0x249e4d,_0x4fbd4f){ChatOfflineMessageEvents['emit'](_0x101e06+':'+_0x5cab33['id'],_0x5cab33);ChatOfflineMessageEvents[_0x511e('0x5')](_0x101e06,_0x5cab33);_0x4fbd4f(null);};}for(var e in events){if(events[_0x511e('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x511e('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xa6a4=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x43fba9,_0x36b884){var _0x24cb3e=function(_0x7f8441){while(--_0x7f8441){_0x43fba9['push'](_0x43fba9['shift']());}};_0x24cb3e(++_0x36b884);}(_0xa6a4,0xe9));var _0x4a6a=function(_0x43fb6b,_0xd25c0f){_0x43fb6b=_0x43fb6b-0x0;var _0x16dd9e=_0xa6a4[_0x43fb6b];return _0x16dd9e;};'use strict';var EventEmitter=require(_0x4a6a('0x0'));var ChatOfflineMessage=require(_0x4a6a('0x1'))['db'][_0x4a6a('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4a6a('0x3')](0x0);var events={'afterCreate':_0x4a6a('0x4'),'afterUpdate':_0x4a6a('0x5'),'afterDestroy':_0x4a6a('0x6')};function emitEvent(_0x1d70ef){return function(_0x5f53ea,_0x4a946a,_0x36aa0c){ChatOfflineMessageEvents[_0x4a6a('0x7')](_0x1d70ef+':'+_0x5f53ea['id'],_0x5f53ea);ChatOfflineMessageEvents[_0x4a6a('0x7')](_0x1d70ef,_0x5f53ea);_0x36aa0c(null);};}for(var e in events){if(events[_0x4a6a('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x4a6a('0x9')](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 c35f78d..2571d00 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 _0x6433=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x5c7b86,_0x361fde){var _0x189239=function(_0x36887c){while(--_0x36887c){_0x5c7b86['push'](_0x5c7b86['shift']());}};_0x189239(++_0x361fde);}(_0x6433,0xa5));var _0x3643=function(_0x178808,_0x3563f0){_0x178808=_0x178808-0x0;var _0x413b3f=_0x6433[_0x178808];return _0x413b3f;};'use strict';var attributes=require(_0x3643('0x0'));module[_0x3643('0x1')]=function(_0x585ea3){return _0x585ea3[_0x3643('0x2')](_0x3643('0x3'),attributes,{'tableName':_0x3643('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3643('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x52f6=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x2493a0,_0x30e38d){var _0x261a78=function(_0x309150){while(--_0x309150){_0x2493a0['push'](_0x2493a0['shift']());}};_0x261a78(++_0x30e38d);}(_0x52f6,0x157));var _0x652f=function(_0x38448c,_0xf81883){_0x38448c=_0x38448c-0x0;var _0x441f82=_0x52f6[_0x38448c];return _0x441f82;};'use strict';var attributes=require(_0x652f('0x0'));module[_0x652f('0x1')]=function(_0x33bc2f){return _0x33bc2f[_0x652f('0x2')](_0x652f('0x3'),attributes,{'tableName':_0x652f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x652f('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index fc401f5..942cef7 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 _0x0f09=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0f09,0x1a5));var _0x90f0=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x0f09[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require(_0x90f0('0x0'));var moment=require(_0x90f0('0x1'));var BPromise=require(_0x90f0('0x2'));var rs=require(_0x90f0('0x3'));var fs=require('fs');var Redis=require(_0x90f0('0x4'));var db=require(_0x90f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90f0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90f0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4741a3,_0x17e4ba,_0x2d3559){return new BPromise(function(_0x51edf1,_0x2fa7fc){return client[_0x90f0('0x8')](_0x4741a3,_0x2d3559)[_0x90f0('0x9')](function(_0x39f16e){logger[_0x90f0('0xa')](_0x90f0('0xb'),_0x17e4ba,_0x90f0('0xc'));logger[_0x90f0('0xd')](_0x90f0('0xe'),_0x17e4ba,_0x90f0('0xc'),JSON['stringify'](_0x39f16e));if(_0x39f16e[_0x90f0('0xf')]){if(_0x39f16e[_0x90f0('0xf')][_0x90f0('0x10')]===0x1f4){logger[_0x90f0('0xf')](_0x90f0('0xb'),_0x17e4ba,_0x39f16e[_0x90f0('0xf')]['message']);return _0x2fa7fc(_0x39f16e[_0x90f0('0xf')][_0x90f0('0x11')]);}logger[_0x90f0('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x17e4ba,_0x39f16e[_0x90f0('0xf')]['message']);return _0x51edf1(_0x39f16e['error']['message']);}else{logger[_0x90f0('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x17e4ba,_0x90f0('0xc'));_0x51edf1(_0x39f16e['result'][_0x90f0('0x11')]);}})[_0x90f0('0x12')](function(_0x4f75d5){logger['error'](_0x90f0('0xb'),_0x17e4ba,_0x4f75d5);_0x2fa7fc(_0x4f75d5);});});}
\ No newline at end of file
+var _0x6726=['request\x20sent','debug','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x46c644,_0x5eca5a){var _0x1058fa=function(_0x28073f){while(--_0x28073f){_0x46c644['push'](_0x46c644['shift']());}};_0x1058fa(++_0x5eca5a);}(_0x6726,0xdb));var _0x6672=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x6726[_0x65c903];return _0x23e1d7;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var moment=require(_0x6672('0x1'));var BPromise=require('bluebird');var rs=require(_0x6672('0x2'));var fs=require('fs');var Redis=require(_0x6672('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6672('0x4'));var logger=require('../../config/logger')(_0x6672('0x5'));var config=require(_0x6672('0x6'));var jayson=require(_0x6672('0x7'));var client=jayson[_0x6672('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa1d3b7,_0x303146,_0x263321){return new BPromise(function(_0x379b90,_0xc53855){return client[_0x6672('0x9')](_0xa1d3b7,_0x263321)[_0x6672('0xa')](function(_0x3c093b){logger[_0x6672('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x303146,_0x6672('0xc'));logger[_0x6672('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x303146,_0x6672('0xc'),JSON[_0x6672('0xe')](_0x3c093b));if(_0x3c093b[_0x6672('0xf')]){if(_0x3c093b[_0x6672('0xf')][_0x6672('0x10')]===0x1f4){logger[_0x6672('0xf')](_0x6672('0x11'),_0x303146,_0x3c093b[_0x6672('0xf')][_0x6672('0x12')]);return _0xc53855(_0x3c093b['error'][_0x6672('0x12')]);}logger[_0x6672('0xf')](_0x6672('0x11'),_0x303146,_0x3c093b[_0x6672('0xf')][_0x6672('0x12')]);return _0x379b90(_0x3c093b[_0x6672('0xf')][_0x6672('0x12')]);}else{logger['info'](_0x6672('0x11'),_0x303146,_0x6672('0xc'));_0x379b90(_0x3c093b[_0x6672('0x13')][_0x6672('0x12')]);}})[_0x6672('0x14')](function(_0x6884f){logger[_0x6672('0xf')](_0x6672('0x11'),_0x303146,_0x6884f);_0xc53855(_0x6884f);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 9986b3e..bdc43ab 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 _0xa792=['util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','put','/:id','update','delete','exports','multer'];(function(_0x4ebe52,_0x42faf2){var _0x4c0e8c=function(_0x47cdf1){while(--_0x47cdf1){_0x4ebe52['push'](_0x4ebe52['shift']());}};_0x4c0e8c(++_0x42faf2);}(_0xa792,0x98));var _0x2a79=function(_0x5911db,_0x5e9a5f){_0x5911db=_0x5911db-0x0;var _0x4f14ae=_0xa792[_0x5911db];return _0x4f14ae;};'use strict';var multer=require(_0x2a79('0x0'));var util=require(_0x2a79('0x1'));var path=require('path');var timeout=require(_0x2a79('0x2'));var express=require(_0x2a79('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2a79('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2a79('0x5'));var controller=require(_0x2a79('0x6'));router['get']('/',auth[_0x2a79('0x7')](),controller[_0x2a79('0x8')]);router[_0x2a79('0x9')](_0x2a79('0xa'),auth['isAuthenticated'](),controller[_0x2a79('0xb')]);router[_0x2a79('0x9')]('/:id',auth[_0x2a79('0x7')](),controller['show']);router['post']('/',auth[_0x2a79('0x7')](),controller['create']);router[_0x2a79('0xc')](_0x2a79('0xd'),auth[_0x2a79('0x7')](),controller[_0x2a79('0xe')]);router[_0x2a79('0xf')](_0x2a79('0xd'),auth[_0x2a79('0x7')](),controller['destroy']);module[_0x2a79('0x10')]=router;
\ No newline at end of file
+var _0xe2c3=['isAuthenticated','index','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0xe2c3,0x1c1));var _0x3e2c=function(_0x45bd84,_0x4a61bb){_0x45bd84=_0x45bd84-0x0;var _0x551b62=_0xe2c3[_0x45bd84];return _0x551b62;};'use strict';var multer=require(_0x3e2c('0x0'));var util=require(_0x3e2c('0x1'));var path=require(_0x3e2c('0x2'));var timeout=require(_0x3e2c('0x3'));var express=require('express');var router=express[_0x3e2c('0x4')]();var fs_extra=require(_0x3e2c('0x5'));var auth=require(_0x3e2c('0x6'));var interaction=require(_0x3e2c('0x7'));var config=require(_0x3e2c('0x8'));var controller=require(_0x3e2c('0x9'));router[_0x3e2c('0xa')]('/',auth[_0x3e2c('0xb')](),controller[_0x3e2c('0xc')]);router[_0x3e2c('0xa')]('/describe',auth[_0x3e2c('0xb')](),controller[_0x3e2c('0xd')]);router[_0x3e2c('0xa')](_0x3e2c('0xe'),auth[_0x3e2c('0xb')](),controller[_0x3e2c('0xf')]);router[_0x3e2c('0x10')]('/',auth[_0x3e2c('0xb')](),controller[_0x3e2c('0x11')]);router['put'](_0x3e2c('0xe'),auth[_0x3e2c('0xb')](),controller['update']);router[_0x3e2c('0x12')](_0x3e2c('0xe'),auth[_0x3e2c('0xb')](),controller['destroy']);module[_0x3e2c('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c4b5678..a9ac3a9 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 _0x70ab=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x70ab,0x1e1));var _0xb70a=function(_0x4b5a9f,_0x3bbdf0){_0x4b5a9f=_0x4b5a9f-0x0;var _0x53163a=_0x70ab[_0x4b5a9f];return _0x53163a;};'use strict';var Sequelize=require(_0xb70a('0x0'));module[_0xb70a('0x1')]={'name':{'type':Sequelize[_0xb70a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb70a('0x3')](_0xb70a('0x4'),_0xb70a('0x5')),'defaultValue':_0xb70a('0x4')},'selector':{'type':Sequelize[_0xb70a('0x2')]},'timeout':{'type':Sequelize[_0xb70a('0x6')]}};
\ No newline at end of file
+var _0xaee1=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x51f2c0,_0xb7c46e){var _0x34ffd5=function(_0x2238c0){while(--_0x2238c0){_0x51f2c0['push'](_0x51f2c0['shift']());}};_0x34ffd5(++_0xb7c46e);}(_0xaee1,0x8a));var _0x1aee=function(_0x583c9c,_0x1cfa5a){_0x583c9c=_0x583c9c-0x0;var _0x3b5d86=_0xaee1[_0x583c9c];return _0x3b5d86;};'use strict';var Sequelize=require(_0x1aee('0x0'));module[_0x1aee('0x1')]={'name':{'type':Sequelize[_0x1aee('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1aee('0x3')](_0x1aee('0x4'),_0x1aee('0x5')),'defaultValue':_0x1aee('0x4')},'selector':{'type':Sequelize[_0x1aee('0x2')]},'timeout':{'type':Sequelize[_0x1aee('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 9360dc5..e45154a 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 _0x8917=['../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x2e9bd9,_0x1c98df){var _0x1bddf6=function(_0x209089){while(--_0x209089){_0x2e9bd9['push'](_0x2e9bd9['shift']());}};_0x1bddf6(++_0x1c98df);}(_0x8917,0x1d7));var _0x7891=function(_0x4d5cf9,_0x44c875){_0x4d5cf9=_0x4d5cf9-0x0;var _0x348451=_0x8917[_0x4d5cf9];return _0x348451;};'use strict';var emlformat=require(_0x7891('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7891('0x1'));var jsonpatch=require(_0x7891('0x2'));var rp=require(_0x7891('0x3'));var moment=require(_0x7891('0x4'));var BPromise=require(_0x7891('0x5'));var Mustache=require(_0x7891('0x6'));var util=require(_0x7891('0x7'));var path=require(_0x7891('0x8'));var sox=require(_0x7891('0x9'));var csv=require('to-csv');var ejs=require(_0x7891('0xa'));var fs=require('fs');var fs_extra=require(_0x7891('0xb'));var _=require(_0x7891('0xc'));var squel=require(_0x7891('0xd'));var crypto=require(_0x7891('0xe'));var jsforce=require(_0x7891('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7891('0x10'));var querystring=require('querystring');var Papa=require(_0x7891('0x11'));var Redis=require(_0x7891('0x12'));var authService=require(_0x7891('0x13'));var qs=require(_0x7891('0x14'));var as=require(_0x7891('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7891('0x16'))(_0x7891('0x17'));var utils=require(_0x7891('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7891('0x19'));var db=require(_0x7891('0x1a'))['db'];function respondWithStatusCode(_0x1a1dbc,_0x31692f){_0x31692f=_0x31692f||0xcc;return function(_0x1b481e){if(_0x1b481e){return _0x1a1dbc['sendStatus'](_0x31692f);}return _0x1a1dbc[_0x7891('0x1b')](_0x31692f)[_0x7891('0x1c')]();};}function respondWithResult(_0x2517f1,_0xc56bc0){_0xc56bc0=_0xc56bc0||0xc8;return function(_0x71e75c){if(_0x71e75c){return _0x2517f1[_0x7891('0x1b')](_0xc56bc0)['json'](_0x71e75c);}};}function respondWithFilteredResult(_0x1fa45b,_0x21a74f){return function(_0x5bfe12){if(_0x5bfe12){var _0x23286b=typeof _0x21a74f[_0x7891('0x1d')]==='undefined'&&typeof _0x21a74f[_0x7891('0x1e')]===_0x7891('0x1f');var _0x250f65=_0x5bfe12[_0x7891('0x20')];var _0x9ff8c2=_0x23286b?0x0:_0x21a74f[_0x7891('0x1d')];var _0x457f50=_0x23286b?_0x5bfe12[_0x7891('0x20')]:_0x21a74f[_0x7891('0x1d')]+_0x21a74f[_0x7891('0x1e')];var _0x20da1e;if(_0x457f50>=_0x250f65){_0x457f50=_0x250f65;_0x20da1e=0xc8;}else{_0x20da1e=0xce;}_0x1fa45b['status'](_0x20da1e);return _0x1fa45b['set'](_0x7891('0x21'),_0x9ff8c2+'-'+_0x457f50+'/'+_0x250f65)[_0x7891('0x22')](_0x5bfe12);}return null;};}function patchUpdates(_0x30b2ae){return function(_0x4c76fe){try{jsonpatch['apply'](_0x4c76fe,_0x30b2ae,!![]);}catch(_0x19a628){return BPromise[_0x7891('0x23')](_0x19a628);}return _0x4c76fe[_0x7891('0x24')]();};}function saveUpdates(_0x36f66a,_0x155a97){return function(_0xf09f20){if(_0xf09f20){return _0xf09f20[_0x7891('0x25')](_0x36f66a)['then'](function(_0x28a917){return _0x28a917;});}return null;};}function removeEntity(_0xab091c,_0x27f2e0){return function(_0x2de356){if(_0x2de356){return _0x2de356[_0x7891('0x26')]()[_0x7891('0x27')](function(){_0xab091c[_0x7891('0x1b')](0xcc)[_0x7891('0x1c')]();});}};}function handleEntityNotFound(_0x24372f,_0x2acda5){return function(_0x55108b){if(!_0x55108b){_0x24372f[_0x7891('0x28')](0x194);}return _0x55108b;};}function handleError(_0x369740,_0x397d03){_0x397d03=_0x397d03||0x1f4;return function(_0x12ed70){logger['error'](_0x12ed70[_0x7891('0x29')]);if(_0x12ed70['name']){delete _0x12ed70[_0x7891('0x2a')];}_0x369740[_0x7891('0x1b')](_0x397d03)[_0x7891('0x2b')](_0x12ed70);};}exports['show']=function(_0x4009f8,_0x1a6bef){var _0x44442f={'raw':!![],'where':{'id':_0x4009f8[_0x7891('0x2c')]['id']}},_0x263f13={};_0x263f13[_0x7891('0x2d')]=_[_0x7891('0x2e')](db['ChatProactiveAction'][_0x7891('0x2f')]);_0x263f13['query']=_[_0x7891('0x2e')](_0x4009f8[_0x7891('0x30')]);_0x263f13[_0x7891('0x31')]=_[_0x7891('0x32')](_0x263f13[_0x7891('0x2d')],_0x263f13[_0x7891('0x30')]);_0x44442f[_0x7891('0x33')]=_['intersection'](_0x263f13[_0x7891('0x2d')],qs[_0x7891('0x34')](_0x4009f8[_0x7891('0x30')][_0x7891('0x34')]));_0x44442f[_0x7891('0x33')]=_0x44442f[_0x7891('0x33')][_0x7891('0x35')]?_0x44442f['attributes']:_0x263f13['model'];if(_0x4009f8['query']['includeAll']){_0x44442f[_0x7891('0x36')]=[{'all':!![]}];}_0x44442f=_[_0x7891('0x37')]({},_0x44442f,_0x4009f8[_0x7891('0x38')]);return db[_0x7891('0x39')][_0x7891('0x3a')](_0x44442f)[_0x7891('0x27')](handleEntityNotFound(_0x1a6bef,null))['then'](respondWithResult(_0x1a6bef,null))[_0x7891('0x3b')](handleError(_0x1a6bef,null));};exports[_0x7891('0x3c')]=function(_0x19e258,_0x2c1c67){return db[_0x7891('0x39')][_0x7891('0x3c')](_0x19e258[_0x7891('0x3d')],{})['then'](respondWithResult(_0x2c1c67,0xc9))[_0x7891('0x3b')](handleError(_0x2c1c67,null));};exports['update']=function(_0x16ca6d,_0x5ba995){if(_0x16ca6d[_0x7891('0x3d')]['id']){delete _0x16ca6d[_0x7891('0x3d')]['id'];}return db[_0x7891('0x39')][_0x7891('0x3a')]({'where':{'id':_0x16ca6d[_0x7891('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5ba995,null))[_0x7891('0x27')](saveUpdates(_0x16ca6d[_0x7891('0x3d')],null))[_0x7891('0x27')](respondWithResult(_0x5ba995,null))[_0x7891('0x3b')](handleError(_0x5ba995,null));};exports[_0x7891('0x26')]=function(_0x516d5c,_0x4e63ee){return db['ChatProactiveAction'][_0x7891('0x3a')]({'where':{'id':_0x516d5c[_0x7891('0x2c')]['id']}})[_0x7891('0x27')](handleEntityNotFound(_0x4e63ee,null))[_0x7891('0x27')](removeEntity(_0x4e63ee,null))[_0x7891('0x3b')](handleError(_0x4e63ee,null));};
\ No newline at end of file
+var _0xab36=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0xb3b5ed,_0x386a22){var _0x373859=function(_0x2b71fb){while(--_0x2b71fb){_0xb3b5ed['push'](_0xb3b5ed['shift']());}};_0x373859(++_0x386a22);}(_0xab36,0x1df));var _0x6ab3=function(_0x1b673b,_0x3b3ac0){_0x1b673b=_0x1b673b-0x0;var _0x3ee6f0=_0xab36[_0x1b673b];return _0x3ee6f0;};'use strict';var emlformat=require(_0x6ab3('0x0'));var rimraf=require(_0x6ab3('0x1'));var zipdir=require(_0x6ab3('0x2'));var jsonpatch=require(_0x6ab3('0x3'));var rp=require(_0x6ab3('0x4'));var moment=require('moment');var BPromise=require(_0x6ab3('0x5'));var Mustache=require(_0x6ab3('0x6'));var util=require(_0x6ab3('0x7'));var path=require('path');var sox=require(_0x6ab3('0x8'));var csv=require(_0x6ab3('0x9'));var ejs=require(_0x6ab3('0xa'));var fs=require('fs');var fs_extra=require(_0x6ab3('0xb'));var _=require(_0x6ab3('0xc'));var squel=require(_0x6ab3('0xd'));var crypto=require('crypto');var jsforce=require(_0x6ab3('0xe'));var deskjs=require(_0x6ab3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6ab3('0x10'));var Papa=require('papaparse');var Redis=require(_0x6ab3('0x11'));var authService=require(_0x6ab3('0x12'));var qs=require(_0x6ab3('0x13'));var as=require(_0x6ab3('0x14'));var hardwareService=require(_0x6ab3('0x15'));var logger=require(_0x6ab3('0x16'))('api');var utils=require(_0x6ab3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6ab3('0x18'));var db=require(_0x6ab3('0x19'))['db'];function respondWithStatusCode(_0x183508,_0x2fe47b){_0x2fe47b=_0x2fe47b||0xcc;return function(_0x23d0ae){if(_0x23d0ae){return _0x183508['sendStatus'](_0x2fe47b);}return _0x183508[_0x6ab3('0x1a')](_0x2fe47b)[_0x6ab3('0x1b')]();};}function respondWithResult(_0x32acd8,_0x313481){_0x313481=_0x313481||0xc8;return function(_0x1412c2){if(_0x1412c2){return _0x32acd8['status'](_0x313481)[_0x6ab3('0x1c')](_0x1412c2);}};}function respondWithFilteredResult(_0x51a0c4,_0x246b5b){return function(_0x27595a){if(_0x27595a){var _0xc20d35=typeof _0x246b5b[_0x6ab3('0x1d')]===_0x6ab3('0x1e')&&typeof _0x246b5b[_0x6ab3('0x1f')]===_0x6ab3('0x1e');var _0xfa65b4=_0x27595a[_0x6ab3('0x20')];var _0x586dcb=_0xc20d35?0x0:_0x246b5b[_0x6ab3('0x1d')];var _0x5db46c=_0xc20d35?_0x27595a[_0x6ab3('0x20')]:_0x246b5b[_0x6ab3('0x1d')]+_0x246b5b[_0x6ab3('0x1f')];var _0x2c1b52;if(_0x5db46c>=_0xfa65b4){_0x5db46c=_0xfa65b4;_0x2c1b52=0xc8;}else{_0x2c1b52=0xce;}_0x51a0c4[_0x6ab3('0x1a')](_0x2c1b52);return _0x51a0c4[_0x6ab3('0x21')](_0x6ab3('0x22'),_0x586dcb+'-'+_0x5db46c+'/'+_0xfa65b4)['json'](_0x27595a);}return null;};}function patchUpdates(_0x253bb2){return function(_0x22b143){try{jsonpatch[_0x6ab3('0x23')](_0x22b143,_0x253bb2,!![]);}catch(_0x4cb92c){return BPromise[_0x6ab3('0x24')](_0x4cb92c);}return _0x22b143['save']();};}function saveUpdates(_0x4bf937,_0x1ac3c6){return function(_0x4e6680){if(_0x4e6680){return _0x4e6680[_0x6ab3('0x25')](_0x4bf937)[_0x6ab3('0x26')](function(_0x30aec0){return _0x30aec0;});}return null;};}function removeEntity(_0x1f0579,_0x344e9f){return function(_0x30af9e){if(_0x30af9e){return _0x30af9e[_0x6ab3('0x27')]()[_0x6ab3('0x26')](function(){_0x1f0579[_0x6ab3('0x1a')](0xcc)[_0x6ab3('0x1b')]();});}};}function handleEntityNotFound(_0x16cfb2,_0x1284d8){return function(_0x10d362){if(!_0x10d362){_0x16cfb2[_0x6ab3('0x28')](0x194);}return _0x10d362;};}function handleError(_0x5d75f6,_0x23cb5b){_0x23cb5b=_0x23cb5b||0x1f4;return function(_0x554cf0){logger[_0x6ab3('0x29')](_0x554cf0[_0x6ab3('0x2a')]);if(_0x554cf0[_0x6ab3('0x2b')]){delete _0x554cf0[_0x6ab3('0x2b')];}_0x5d75f6[_0x6ab3('0x1a')](_0x23cb5b)[_0x6ab3('0x2c')](_0x554cf0);};}exports['show']=function(_0x5b5647,_0x365edb){var _0x57c04b={'raw':!![],'where':{'id':_0x5b5647[_0x6ab3('0x2d')]['id']}},_0x5370d7={};_0x5370d7[_0x6ab3('0x2e')]=_[_0x6ab3('0x2f')](db[_0x6ab3('0x30')][_0x6ab3('0x31')]);_0x5370d7[_0x6ab3('0x32')]=_[_0x6ab3('0x2f')](_0x5b5647[_0x6ab3('0x32')]);_0x5370d7['filters']=_[_0x6ab3('0x33')](_0x5370d7[_0x6ab3('0x2e')],_0x5370d7[_0x6ab3('0x32')]);_0x57c04b[_0x6ab3('0x34')]=_[_0x6ab3('0x33')](_0x5370d7[_0x6ab3('0x2e')],qs[_0x6ab3('0x35')](_0x5b5647[_0x6ab3('0x32')]['fields']));_0x57c04b[_0x6ab3('0x34')]=_0x57c04b['attributes']['length']?_0x57c04b[_0x6ab3('0x34')]:_0x5370d7['model'];if(_0x5b5647[_0x6ab3('0x32')][_0x6ab3('0x36')]){_0x57c04b[_0x6ab3('0x37')]=[{'all':!![]}];}_0x57c04b=_[_0x6ab3('0x38')]({},_0x57c04b,_0x5b5647[_0x6ab3('0x39')]);return db[_0x6ab3('0x30')][_0x6ab3('0x3a')](_0x57c04b)[_0x6ab3('0x26')](handleEntityNotFound(_0x365edb,null))[_0x6ab3('0x26')](respondWithResult(_0x365edb,null))[_0x6ab3('0x3b')](handleError(_0x365edb,null));};exports[_0x6ab3('0x3c')]=function(_0x22e39a,_0xdfe14b){return db[_0x6ab3('0x30')]['create'](_0x22e39a[_0x6ab3('0x3d')],{})[_0x6ab3('0x26')](respondWithResult(_0xdfe14b,0xc9))[_0x6ab3('0x3b')](handleError(_0xdfe14b,null));};exports[_0x6ab3('0x25')]=function(_0x315c99,_0xd70937){if(_0x315c99['body']['id']){delete _0x315c99[_0x6ab3('0x3d')]['id'];}return db['ChatProactiveAction'][_0x6ab3('0x3a')]({'where':{'id':_0x315c99[_0x6ab3('0x2d')]['id']}})['then'](handleEntityNotFound(_0xd70937,null))[_0x6ab3('0x26')](saveUpdates(_0x315c99[_0x6ab3('0x3d')],null))['then'](respondWithResult(_0xd70937,null))['catch'](handleError(_0xd70937,null));};exports[_0x6ab3('0x27')]=function(_0x4a3988,_0x2ec0c7){return db[_0x6ab3('0x30')]['find']({'where':{'id':_0x4a3988['params']['id']}})[_0x6ab3('0x26')](handleEntityNotFound(_0x2ec0c7,null))[_0x6ab3('0x26')](removeEntity(_0x2ec0c7,null))['catch'](handleError(_0x2ec0c7,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 72fdd05..681b57d 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 _0x9ff3=['exports','define','chat_proactive_actions','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x9ff3,0x159));var _0x39ff=function(_0x451680,_0x9187d8){_0x451680=_0x451680-0x0;var _0x1ba454=_0x9ff3[_0x451680];return _0x1ba454;};'use strict';var _=require('lodash');var util=require(_0x39ff('0x0'));var logger=require(_0x39ff('0x1'))('api');var moment=require('moment');var BPromise=require(_0x39ff('0x2'));var rp=require(_0x39ff('0x3'));var fs=require('fs');var path=require(_0x39ff('0x4'));var rimraf=require(_0x39ff('0x5'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x39ff('0x6')]=function(_0x1c3d09,_0x48c1fa){return _0x1c3d09[_0x39ff('0x7')]('ChatProactiveAction',attributes,{'tableName':_0x39ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22f0=['api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x1ec8b7,_0x1d1b94){var _0x281722=function(_0x556075){while(--_0x556075){_0x1ec8b7['push'](_0x1ec8b7['shift']());}};_0x281722(++_0x1d1b94);}(_0x22f0,0xf9));var _0x022f=function(_0x2c6a9c,_0x244ed9){_0x2c6a9c=_0x2c6a9c-0x0;var _0x21591f=_0x22f0[_0x2c6a9c];return _0x21591f;};'use strict';var _=require(_0x022f('0x0'));var util=require(_0x022f('0x1'));var logger=require(_0x022f('0x2'))(_0x022f('0x3'));var moment=require(_0x022f('0x4'));var BPromise=require('bluebird');var rp=require(_0x022f('0x5'));var fs=require('fs');var path=require(_0x022f('0x6'));var rimraf=require(_0x022f('0x7'));var config=require(_0x022f('0x8'));var attributes=require(_0x022f('0x9'));module[_0x022f('0xa')]=function(_0x1ad02f,_0x10f4bd){return _0x1ad02f[_0x022f('0xb')](_0x022f('0xc'),attributes,{'tableName':_0x022f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index cbacfc8..7146693 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 _0x5e36=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x5e36,0x97));var _0x65e3=function(_0x32b5d2,_0x6c38e6){_0x32b5d2=_0x32b5d2-0x0;var _0x43e2ec=_0x5e36[_0x32b5d2];return _0x43e2ec;};'use strict';var _=require(_0x65e3('0x0'));var util=require(_0x65e3('0x1'));var moment=require(_0x65e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x65e3('0x3'));var fs=require('fs');var Redis=require(_0x65e3('0x4'));var db=require(_0x65e3('0x5'))['db'];var utils=require(_0x65e3('0x6'));var logger=require(_0x65e3('0x7'))(_0x65e3('0x8'));var config=require(_0x65e3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x65e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e7385,_0x4a7bf3,_0x2d64f9){return new BPromise(function(_0x1ea9ac,_0x391f0d){return client[_0x65e3('0xb')](_0x3e7385,_0x2d64f9)[_0x65e3('0xc')](function(_0x1c3ba1){logger[_0x65e3('0xd')](_0x65e3('0xe'),_0x4a7bf3,_0x65e3('0xf'));logger[_0x65e3('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4a7bf3,_0x65e3('0xf'),JSON[_0x65e3('0x11')](_0x1c3ba1));if(_0x1c3ba1[_0x65e3('0x12')]){if(_0x1c3ba1[_0x65e3('0x12')][_0x65e3('0x13')]===0x1f4){logger['error'](_0x65e3('0xe'),_0x4a7bf3,_0x1c3ba1[_0x65e3('0x12')]['message']);return _0x391f0d(_0x1c3ba1[_0x65e3('0x12')][_0x65e3('0x14')]);}logger[_0x65e3('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x4a7bf3,_0x1c3ba1['error'][_0x65e3('0x14')]);return _0x1ea9ac(_0x1c3ba1[_0x65e3('0x12')][_0x65e3('0x14')]);}else{logger[_0x65e3('0xd')](_0x65e3('0xe'),_0x4a7bf3,'request\x20sent');_0x1ea9ac(_0x1c3ba1['result'][_0x65e3('0x14')]);}})[_0x65e3('0x15')](function(_0x3165b2){logger[_0x65e3('0x12')](_0x65e3('0xe'),_0x4a7bf3,_0x3165b2);_0x391f0d(_0x3165b2);});});}
\ No newline at end of file
+var _0xa117=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0xa117,0x11c));var _0x7a11=function(_0x348567,_0x151fc1){_0x348567=_0x348567-0x0;var _0x2deeef=_0xa117[_0x348567];return _0x2deeef;};'use strict';var _=require(_0x7a11('0x0'));var util=require(_0x7a11('0x1'));var moment=require(_0x7a11('0x2'));var BPromise=require(_0x7a11('0x3'));var rs=require(_0x7a11('0x4'));var fs=require('fs');var Redis=require(_0x7a11('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a11('0x6'));var logger=require(_0x7a11('0x7'))(_0x7a11('0x8'));var config=require(_0x7a11('0x9'));var jayson=require(_0x7a11('0xa'));var client=jayson['client'][_0x7a11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x385b18,_0x41306b,_0x5814bc){return new BPromise(function(_0x4879df,_0x276463){return client['request'](_0x385b18,_0x5814bc)[_0x7a11('0xc')](function(_0x44a722){logger[_0x7a11('0xd')](_0x7a11('0xe'),_0x41306b,'request\x20sent');logger[_0x7a11('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x41306b,'request\x20sent',JSON[_0x7a11('0x10')](_0x44a722));if(_0x44a722['error']){if(_0x44a722[_0x7a11('0x11')][_0x7a11('0x12')]===0x1f4){logger[_0x7a11('0x11')](_0x7a11('0xe'),_0x41306b,_0x44a722[_0x7a11('0x11')]['message']);return _0x276463(_0x44a722[_0x7a11('0x11')][_0x7a11('0x13')]);}logger[_0x7a11('0x11')](_0x7a11('0xe'),_0x41306b,_0x44a722['error'][_0x7a11('0x13')]);return _0x4879df(_0x44a722[_0x7a11('0x11')][_0x7a11('0x13')]);}else{logger[_0x7a11('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x41306b,_0x7a11('0x14'));_0x4879df(_0x44a722[_0x7a11('0x15')][_0x7a11('0x13')]);}})['catch'](function(_0x4e3818){logger[_0x7a11('0x11')](_0x7a11('0xe'),_0x41306b,_0x4e3818);_0x276463(_0x4e3818);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 30be541..f71d08d 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 _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x3eb6d1,_0x25131d){var _0x68df02=function(_0x20e40a){while(--_0x20e40a){_0x3eb6d1['push'](_0x3eb6d1['shift']());}};_0x68df02(++_0x25131d);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x565faf,_0x5f3718){_0x565faf=_0x565faf-0x0;var _0x42292f=_0xf2ca[_0x565faf];return _0x42292f;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router;
\ No newline at end of file
+var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5b449b,_0x5fdca9){_0x5b449b=_0x5b449b-0x0;var _0x43660a=_0xb4c7[_0x5b449b];return _0x43660a;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 9b17191..7cc356b 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 _0x8a44=['roundrobin','sequelize','STRING','name','rrmemory','beepall'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x8a44,0x18d));var _0x48a4=function(_0x3f7815,_0x362d63){_0x3f7815=_0x3f7815-0x0;var _0x31ab67=_0x8a44[_0x3f7815];return _0x31ab67;};'use strict';var Sequelize=require(_0x48a4('0x0'));module['exports']={'name':{'type':Sequelize[_0x48a4('0x1')],'unique':_0x48a4('0x2'),'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['ENUM'](_0x48a4('0x3'),_0x48a4('0x4'),_0x48a4('0x5'))}};
\ No newline at end of file
+var _0xeac8=['STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x13c304,_0x4791de){var _0x12696e=function(_0x2070d4){while(--_0x2070d4){_0x13c304['push'](_0x13c304['shift']());}};_0x12696e(++_0x4791de);}(_0xeac8,0x1d6));var _0x8eac=function(_0x2e8496,_0xa4934a){_0x2e8496=_0x2e8496-0x0;var _0x31979b=_0xeac8[_0x2e8496];return _0x31979b;};'use strict';var Sequelize=require(_0x8eac('0x0'));module[_0x8eac('0x1')]={'name':{'type':Sequelize[_0x8eac('0x2')],'unique':_0x8eac('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8eac('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8eac('0x4')](_0x8eac('0x5'),_0x8eac('0x6'),_0x8eac('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4129ce6..1b56e4f 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 _0x76eb=['select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','union','value','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','get','ChatQueues','UserProfileResource','end','error','stack','name','send','index','map','ChatQueue','type','key','getOptions','where','include','findAll','rows','show','model','keys','rawAttributes','filters','query','attributes','fields','length','includeAll','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserChatQueue','intersection','hasOwnProperty','nolimit','order','sort','pick','filter','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','options','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams'];(function(_0x31c183,_0x3aa6eb){var _0x48e56c=function(_0x1d01fa){while(--_0x1d01fa){_0x31c183['push'](_0x31c183['shift']());}};_0x48e56c(++_0x3aa6eb);}(_0x76eb,0x176));var _0xb76e=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0x76eb[_0x35ebae];return _0x1924cf;};'use strict';var BPromise=require('bluebird');var util=require(_0xb76e('0x0'));var _=require(_0xb76e('0x1'));var squel=require('squel');var Redis=require(_0xb76e('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xb76e('0x3'))(_0xb76e('0x4'));var config=require(_0xb76e('0x5'));var db=require(_0xb76e('0x6'))['db'];config['redis']=_[_0xb76e('0x7')](config[_0xb76e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb76e('0x9'))(new Redis(config[_0xb76e('0x8')]));require('./chatQueue.socket')[_0xb76e('0xa')](socket);function respondWithStatusCode(_0x59e14a,_0x530ea5){_0x530ea5=_0x530ea5||0xcc;return function(_0x55dc2a){if(_0x55dc2a){return _0x59e14a[_0xb76e('0xb')](_0x530ea5);}return _0x59e14a['status'](_0x530ea5)['end']();};}function respondWithResult(_0x5078f5,_0x35f6b0){_0x35f6b0=_0x35f6b0||0xc8;return function(_0x5ca6da){if(_0x5ca6da){return _0x5078f5[_0xb76e('0xc')](_0x35f6b0)[_0xb76e('0xd')](_0x5ca6da);}};}function respondWithFilteredResult(_0x5bb31e,_0x8b0b1e){return function(_0x2e656f){if(_0x2e656f){var _0x47ecf9=typeof _0x8b0b1e[_0xb76e('0xe')]==='undefined'&&typeof _0x8b0b1e[_0xb76e('0xf')]===_0xb76e('0x10');var _0x2dcb7f=_0x2e656f[_0xb76e('0x11')];var _0x509272=_0x47ecf9?0x0:_0x8b0b1e[_0xb76e('0xe')];var _0x325d8c=_0x47ecf9?_0x2e656f['count']:_0x8b0b1e['offset']+_0x8b0b1e['limit'];var _0xbc6184;if(_0x325d8c>=_0x2dcb7f){_0x325d8c=_0x2dcb7f;_0xbc6184=0xc8;}else{_0xbc6184=0xce;}_0x5bb31e[_0xb76e('0xc')](_0xbc6184);return _0x5bb31e[_0xb76e('0x12')](_0xb76e('0x13'),_0x509272+'-'+_0x325d8c+'/'+_0x2dcb7f)[_0xb76e('0xd')](_0x2e656f);}return null;};}function saveUpdates(_0x44c3cb){return function(_0x3d131b){if(_0x3d131b){return _0x3d131b['update'](_0x44c3cb)[_0xb76e('0x14')](function(_0x4e56a4){return _0x4e56a4;});}return null;};}function removeEntity(_0x5ba985){return function(_0x30896f){if(_0x30896f){return _0x30896f[_0xb76e('0x15')]()[_0xb76e('0x14')](function(){var _0x22e5a0=_0x30896f[_0xb76e('0x16')]({'plain':!![]});var _0x1a2c3c=_0xb76e('0x17');return db[_0xb76e('0x18')][_0xb76e('0x15')]({'where':{'type':_0x1a2c3c,'resourceId':_0x22e5a0['id']}})[_0xb76e('0x14')](function(){return _0x30896f;});})[_0xb76e('0x14')](function(){_0x5ba985['status'](0xcc)[_0xb76e('0x19')]();});}};}function handleEntityNotFound(_0x5d7207){return function(_0x1ddf97){if(!_0x1ddf97){_0x5d7207[_0xb76e('0xb')](0x194);}return _0x1ddf97;};}function handleError(_0x89f626,_0x429441){_0x429441=_0x429441||0x1f4;return function(_0x361712){logger[_0xb76e('0x1a')](_0x361712[_0xb76e('0x1b')]);if(_0x361712[_0xb76e('0x1c')]){delete _0x361712['name'];}_0x89f626[_0xb76e('0xc')](_0x429441)[_0xb76e('0x1d')](_0x361712);};}exports[_0xb76e('0x1e')]=function(_0x58ff59,_0x33344){var _0x1419c8={};var _0x265e4e={'count':0x0,'rows':[]};var _0x50e21e=_[_0xb76e('0x1f')](db[_0xb76e('0x20')]['rawAttributes'],function(_0x7ba9ba){return{'name':_0x7ba9ba['fieldName'],'type':_0x7ba9ba[_0xb76e('0x21')][_0xb76e('0x22')]};});_0x1419c8=qs[_0xb76e('0x23')](_0x50e21e,_0x58ff59);var _0x13c832={'where':_0x1419c8[_0xb76e('0x24')]};return db[_0xb76e('0x20')][_0xb76e('0x11')](_0x13c832)[_0xb76e('0x14')](function(_0x11cc48){_0x265e4e['count']=_0x11cc48;_0x1419c8[_0xb76e('0x25')]=qs[_0xb76e('0x25')](_0x58ff59['query']);return db[_0xb76e('0x20')][_0xb76e('0x26')](_0x1419c8);})[_0xb76e('0x14')](function(_0x33719b){_0x265e4e[_0xb76e('0x27')]=_0x33719b;return _0x265e4e;})['then'](respondWithFilteredResult(_0x33344,_0x1419c8))['catch'](handleError(_0x33344,null));};exports[_0xb76e('0x28')]=function(_0x31cbb0,_0x493680){var _0x18a642={'raw':!![],'where':{'id':_0x31cbb0['params']['id']}},_0x1d063a={};_0x1d063a[_0xb76e('0x29')]=_[_0xb76e('0x2a')](db[_0xb76e('0x20')][_0xb76e('0x2b')]);_0x1d063a['query']=_[_0xb76e('0x2a')](_0x31cbb0['query']);_0x1d063a[_0xb76e('0x2c')]=_['intersection'](_0x1d063a[_0xb76e('0x29')],_0x1d063a[_0xb76e('0x2d')]);_0x18a642[_0xb76e('0x2e')]=_['intersection'](_0x1d063a[_0xb76e('0x29')],qs['fields'](_0x31cbb0[_0xb76e('0x2d')][_0xb76e('0x2f')]));_0x18a642[_0xb76e('0x2e')]=_0x18a642['attributes'][_0xb76e('0x30')]?_0x18a642[_0xb76e('0x2e')]:_0x1d063a[_0xb76e('0x29')];if(_0x31cbb0[_0xb76e('0x2d')][_0xb76e('0x31')]){_0x18a642[_0xb76e('0x25')]=[{'all':!![]}];}_0x18a642=_[_0xb76e('0x32')]({},_0x18a642,_0x31cbb0['options']);return db[_0xb76e('0x20')][_0xb76e('0x33')](_0x18a642)[_0xb76e('0x14')](handleEntityNotFound(_0x493680,null))[_0xb76e('0x14')](respondWithResult(_0x493680,null))[_0xb76e('0x34')](handleError(_0x493680,null));};exports[_0xb76e('0x35')]=function(_0x162568,_0x183a51){return db['ChatQueue'][_0xb76e('0x35')](_0x162568[_0xb76e('0x36')],{})[_0xb76e('0x14')](function(_0x49c01a){var _0x2a52d0=_0x162568['user'][_0xb76e('0x16')]({'plain':!![]});if(!_0x2a52d0)throw new Error(_0xb76e('0x37'));if(_0x2a52d0[_0xb76e('0x38')]===_0xb76e('0x39')){var _0x23d9d1=_0x49c01a['get']({'plain':!![]});var _0x4a08d8=_0xb76e('0x17');return db['UserProfileSection'][_0xb76e('0x33')]({'where':{'name':_0x4a08d8,'userProfileId':_0x2a52d0[_0xb76e('0x3a')]},'raw':!![]})['then'](function(_0x235e25){if(_0x235e25&&_0x235e25[_0xb76e('0x3b')]===0x0){return db['UserProfileResource']['create']({'name':_0x23d9d1[_0xb76e('0x1c')],'resourceId':_0x23d9d1['id'],'type':_0x235e25['name'],'sectionId':_0x235e25['id']},{})[_0xb76e('0x14')](function(){return _0x49c01a;});}else{return _0x49c01a;}})[_0xb76e('0x34')](function(_0xeb3b63){logger[_0xb76e('0x1a')](_0xb76e('0x3c'),_0xeb3b63);throw _0xeb3b63;});}return _0x49c01a;})[_0xb76e('0x14')](respondWithResult(_0x183a51,0xc9))[_0xb76e('0x34')](handleError(_0x183a51,null));};exports[_0xb76e('0x3d')]=function(_0xc39912,_0xc97790){if(_0xc39912[_0xb76e('0x36')]['id']){delete _0xc39912[_0xb76e('0x36')]['id'];}return db[_0xb76e('0x20')][_0xb76e('0x33')]({'where':{'id':_0xc39912[_0xb76e('0x3e')]['id']}})['then'](handleEntityNotFound(_0xc97790,null))[_0xb76e('0x14')](saveUpdates(_0xc39912['body'],null))['then'](respondWithResult(_0xc97790,null))['catch'](handleError(_0xc97790,null));};exports[_0xb76e('0x15')]=function(_0x295101,_0x5b8936){return db['ChatQueue']['find']({'where':{'id':_0x295101['params']['id']}})[_0xb76e('0x14')](handleEntityNotFound(_0x5b8936,null))[_0xb76e('0x14')](removeEntity(_0x5b8936,null))[_0xb76e('0x34')](handleError(_0x5b8936,null));};exports[_0xb76e('0x3f')]=function(_0x35a90f,_0x435c00){return db[_0xb76e('0x20')][_0xb76e('0x3f')]()[_0xb76e('0x14')](respondWithResult(_0x435c00,null))[_0xb76e('0x34')](handleError(_0x435c00,null));};exports[_0xb76e('0x40')]=function(_0xb70b4b,_0x386883){var _0x1f3db6={'raw':!![],'where':{}},_0xae27cc={},_0x3c517f;return db[_0xb76e('0x20')][_0xb76e('0x41')]({'where':{'id':_0xb70b4b[_0xb76e('0x3e')]['id']}})[_0xb76e('0x14')](handleEntityNotFound(_0x386883,null))[_0xb76e('0x14')](function(_0x1a2d0d){if(_0x1a2d0d){_0x3c517f=_0x1a2d0d[_0xb76e('0x16')]({'plain':!![]});_0xae27cc[_0xb76e('0x29')]=_[_0xb76e('0x2a')](db[_0xb76e('0x42')][_0xb76e('0x2b')]);_0xae27cc[_0xb76e('0x2d')]=_[_0xb76e('0x2a')](_0xb70b4b[_0xb76e('0x2d')]);_0xae27cc[_0xb76e('0x2c')]=_[_0xb76e('0x43')](_0xae27cc[_0xb76e('0x29')],_0xae27cc[_0xb76e('0x2d')]);_0x1f3db6[_0xb76e('0x2e')]=_[_0xb76e('0x43')](_0xae27cc['model'],qs['fields'](_0xb70b4b[_0xb76e('0x2d')][_0xb76e('0x2f')]));_0x1f3db6[_0xb76e('0x2e')]=_0x1f3db6[_0xb76e('0x2e')][_0xb76e('0x30')]?_0x1f3db6[_0xb76e('0x2e')]:_0xae27cc[_0xb76e('0x29')];if(!_0xb70b4b[_0xb76e('0x2d')][_0xb76e('0x44')](_0xb76e('0x45'))){_0x1f3db6[_0xb76e('0xf')]=qs['limit'](_0xb70b4b[_0xb76e('0x2d')][_0xb76e('0xf')]);_0x1f3db6[_0xb76e('0xe')]=qs[_0xb76e('0xe')](_0xb70b4b[_0xb76e('0x2d')][_0xb76e('0xe')]);}_0x1f3db6[_0xb76e('0x46')]=qs[_0xb76e('0x47')](_0xb70b4b[_0xb76e('0x2d')][_0xb76e('0x47')]);_0x1f3db6['where']=qs[_0xb76e('0x2c')](_[_0xb76e('0x48')](_0xb70b4b[_0xb76e('0x2d')],_0xae27cc[_0xb76e('0x2c')]));_0x1f3db6[_0xb76e('0x24')]['ChatQueueId']=_0x1a2d0d['id'];if(_0xb70b4b[_0xb76e('0x2d')][_0xb76e('0x49')]){_0x1f3db6[_0xb76e('0x24')]=_[_0xb76e('0x32')](_0x1f3db6['where'],{'$or':_[_0xb76e('0x1f')](_0x1f3db6['attributes'],function(_0x4d6cb4){var _0x1829a5={};_0x1829a5[_0x4d6cb4]={'$like':'%'+_0xb70b4b[_0xb76e('0x2d')][_0xb76e('0x49')]+'%'};return _0x1829a5;})});}_0x1f3db6=_[_0xb76e('0x32')]({},_0x1f3db6,_0xb70b4b['options']);return db[_0xb76e('0x42')]['findAll'](_0x1f3db6);}})[_0xb76e('0x14')](function(_0x5bd484){if(_0x5bd484){return db[_0xb76e('0x4a')][_0xb76e('0x4b')]({'where':{'id':_[_0xb76e('0x1f')](_0x5bd484,'UserId'),'role':_0xb76e('0x4c')},'attributes':['id','name',_0xb76e('0x4d'),_0xb76e('0x4e'),_0xb76e('0x4f')]});}})[_0xb76e('0x14')](function(_0x3bc75b){if(_0x3bc75b){return{'count':_0x3bc75b['count'],'rows':_[_0xb76e('0x1f')](_0x3bc75b[_0xb76e('0x27')],function(_0x2dcc91){return{'membername':_0x2dcc91['name'],'UserId':_0x2dcc91['id'],'queue_name':_0x3c517f['name'],'ChatQueueId':_0x3c517f['id'],'interface':util['format']('%s/%s',_0xb76e('0x50'),_0x2dcc91[_0xb76e('0x1c')]),'penalty':0x0,'paused':_0x2dcc91[_0xb76e('0x4d')],'createdAt':_0x2dcc91[_0xb76e('0x4f')],'updatedAt':_0x2dcc91[_0xb76e('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb76e('0x14')](respondWithFilteredResult(_0x386883,_0x1f3db6))[_0xb76e('0x34')](handleError(_0x386883,null));};exports[_0xb76e('0x51')]=function(_0x10c198,_0xa849d6){var _0x1e12f5={};var _0x36f5f3={};var _0x11bead;var _0x35feeb;return db[_0xb76e('0x20')][_0xb76e('0x41')]({'where':{'id':_0x10c198[_0xb76e('0x3e')]['id']}})[_0xb76e('0x14')](handleEntityNotFound(_0xa849d6,null))['then'](function(_0x1cf5e7){if(_0x1cf5e7){_0x11bead=_0x1cf5e7;_0x36f5f3[_0xb76e('0x29')]=_[_0xb76e('0x2a')](db[_0xb76e('0x52')]['rawAttributes']);_0x36f5f3['query']=_[_0xb76e('0x2a')](_0x10c198[_0xb76e('0x2d')]);_0x36f5f3['filters']=_[_0xb76e('0x43')](_0x36f5f3[_0xb76e('0x29')],_0x36f5f3['query']);_0x1e12f5['attributes']=_[_0xb76e('0x43')](_0x36f5f3[_0xb76e('0x29')],qs['fields'](_0x10c198[_0xb76e('0x2d')]['fields']));_0x1e12f5['attributes']=_0x1e12f5[_0xb76e('0x2e')][_0xb76e('0x30')]?_0x1e12f5[_0xb76e('0x2e')]:_0x36f5f3[_0xb76e('0x29')];_0x1e12f5[_0xb76e('0x46')]=qs[_0xb76e('0x47')](_0x10c198[_0xb76e('0x2d')][_0xb76e('0x47')]);_0x1e12f5[_0xb76e('0x24')]=qs[_0xb76e('0x2c')](_[_0xb76e('0x48')](_0x10c198['query'],_0x36f5f3[_0xb76e('0x2c')]));if(_0x10c198[_0xb76e('0x2d')][_0xb76e('0x49')]){_0x1e12f5['where']=_['merge'](_0x1e12f5['where'],{'$or':_[_0xb76e('0x1f')](_0x1e12f5[_0xb76e('0x2e')],function(_0x834b6c){var _0x25bc1e={};_0x25bc1e[_0x834b6c]={'$like':'%'+_0x10c198['query']['filter']+'%'};return _0x25bc1e;})});}_0x1e12f5=_[_0xb76e('0x32')]({},_0x1e12f5,_0x10c198[_0xb76e('0x53')]);return _0x11bead[_0xb76e('0x51')](_0x1e12f5);}})['then'](function(_0x42bc8f){if(_0x42bc8f){_0x35feeb=_0x42bc8f['length'];if(!_0x10c198[_0xb76e('0x2d')]['hasOwnProperty'](_0xb76e('0x45'))){_0x1e12f5[_0xb76e('0xf')]=qs[_0xb76e('0xf')](_0x10c198[_0xb76e('0x2d')][_0xb76e('0xf')]);_0x1e12f5[_0xb76e('0xe')]=qs[_0xb76e('0xe')](_0x10c198[_0xb76e('0x2d')][_0xb76e('0xe')]);}return _0x11bead['getTeams'](_0x1e12f5);}})[_0xb76e('0x14')](function(_0x5ab5f0){if(_0x5ab5f0){return _0x5ab5f0?{'count':_0x35feeb,'rows':_0x5ab5f0}:null;}})[_0xb76e('0x14')](respondWithResult(_0xa849d6,null))[_0xb76e('0x34')](handleError(_0xa849d6,null));};exports[_0xb76e('0x54')]=function(_0x46c0d1,_0x31307d){var _0x389f42=_0x46c0d1[_0xb76e('0x36')][_0xb76e('0x55')];return db[_0xb76e('0x52')][_0xb76e('0x26')]({'where':{'id':_0x389f42},'attributes':['id'],'include':[{'model':db[_0xb76e('0x4a')],'as':_0xb76e('0x56'),'attributes':['id',_0xb76e('0x1c'),_0xb76e('0x57'),_0xb76e('0x58'),_0xb76e('0x59')],'raw':!![]}]})[_0xb76e('0x14')](function(_0xed0b45){if(_0xed0b45){var _0x357851=_[_0xb76e('0x5a')](_0xed0b45,function(_0x414682){var _0x5480af=_0x414682[_0xb76e('0x16')]({'plain':!![]});return _0x5480af['Agents'];});return db[_0xb76e('0x20')][_0xb76e('0x33')]({'where':{'id':_0x46c0d1[_0xb76e('0x3e')]['id']}})[_0xb76e('0x14')](function(_0x202b7a){return db[_0xb76e('0x5b')][_0xb76e('0x5c')](function(_0x35f0e1){return _0x202b7a[_0xb76e('0x54')](_0x389f42,{'transaction':_0x35f0e1})[_0xb76e('0x14')](function(){return BPromise['each'](_0x357851,function(_0xb305d2){return db[_0xb76e('0x42')][_0xb76e('0x5d')]({'where':{'UserId':_0xb305d2['id'],'ChatQueueId':_0x46c0d1[_0xb76e('0x3e')]['id']},'transaction':_0x35f0e1});});})[_0xb76e('0x14')](function(){_0x357851[_0xb76e('0x5e')](function(_0x110ce1){socket[_0xb76e('0x5f')](_0xb76e('0x60'),{'UserId':_0x110ce1['id'],'ChatQueueId':_0x202b7a['id']});});});});});}})[_0xb76e('0x14')](respondWithStatusCode(_0x31307d,null))[_0xb76e('0x34')](handleError(_0x31307d,null));};exports[_0xb76e('0x61')]=function(_0x33589c,_0x3be4d6){return db[_0xb76e('0x52')][_0xb76e('0x26')]({'where':{'id':_0x33589c['query'][_0xb76e('0x55')]},'attributes':['id'],'include':[{'model':db[_0xb76e('0x4a')],'as':_0xb76e('0x56'),'attributes':['id'],'raw':!![]}]})[_0xb76e('0x14')](handleEntityNotFound(_0x3be4d6,null))[_0xb76e('0x14')](function(_0x4cefa9){var _0x23a3ce=_[_0xb76e('0x1f')](_0x4cefa9,'id');var _0x1e018f=[];var _0x51aa44=[];var _0x1d40f8=squel[_0xb76e('0x62')]();_0x1d40f8[_0xb76e('0x63')](_0xb76e('0x64'))['from'](_0xb76e('0x65'),'tq')[_0xb76e('0x66')](_0xb76e('0x67'),'ut',_0xb76e('0x68'))['where'](_0xb76e('0x69'),_0x33589c[_0xb76e('0x3e')]['id']);for(var _0x4a6e44=0x0;_0x4a6e44<_0x4cefa9['length'];_0x4a6e44+=0x1){let _0x3d5492=_0x4cefa9[_0x4a6e44];for(var _0x3d5143=0x0;_0x3d5143<_0x3d5492['Agents'][_0xb76e('0x30')];_0x3d5143+=0x1){let _0x2b672c=_0x3d5492[_0xb76e('0x56')][_0x3d5143];var _0x4adde5=_0x1d40f8['clone']();_0x4adde5[_0xb76e('0x24')](_0xb76e('0x6a'),_0x2b672c['id']);_0x51aa44[_0xb76e('0x6b')](db[_0xb76e('0x5b')][_0xb76e('0x2d')](_0x4adde5[_0xb76e('0x6c')](),{'type':db[_0xb76e('0x5b')][_0xb76e('0x6d')]['SELECT']})[_0xb76e('0x14')](function(_0x2b3d17){if(_0x2b3d17[_0xb76e('0x30')]===0x1){return _0x2b672c['id'];}else{var _0xefd865=_['every'](_[_0xb76e('0x1f')](_0x2b3d17,'TeamId'),function(_0xf977b8){return _['includes'](_0x23a3ce,_0xf977b8);});if(_0xefd865){return _0x2b672c['id'];}}}));}}return BPromise['all'](_0x51aa44)[_0xb76e('0x14')](function(_0x4a8ba3){_0x1e018f=_(_0x1e018f)[_0xb76e('0x6e')](_0x4a8ba3)['compact']()[_0xb76e('0x6f')]();return db['ChatQueue'][_0xb76e('0x33')]({'where':{'id':_0x33589c[_0xb76e('0x3e')]['id']}})[_0xb76e('0x14')](function(_0x163b60){return db['sequelize'][_0xb76e('0x5c')](function(_0x25c28e){return _0x163b60[_0xb76e('0x61')](_0x33589c[_0xb76e('0x2d')][_0xb76e('0x55')],{'transaction':_0x25c28e})[_0xb76e('0x14')](function(){if(!_['isEmpty'](_0x1e018f)){return _0x163b60[_0xb76e('0x70')](_0x1e018f,{'transaction':_0x25c28e});}})[_0xb76e('0x14')](function(){_0x1e018f['forEach'](function(_0x1b0e38){socket['emit']('userChatQueue:remove',{'UserId':_0x1b0e38,'ChatQueueId':_0x163b60['id']});});});});});});})[_0xb76e('0x14')](respondWithStatusCode(_0x3be4d6,null))[_0xb76e('0x34')](handleError(_0x3be4d6,null));};exports['addAgents']=function(_0xd57cb3,_0x44410f){return db['ChatQueue']['find']({'where':{'id':_0xd57cb3[_0xb76e('0x3e')]['id']}})[_0xb76e('0x14')](handleEntityNotFound(_0x44410f,null))['then'](function(_0x3abbb1){if(_0x3abbb1){return _0x3abbb1[_0xb76e('0x71')](_0xd57cb3['body'][_0xb76e('0x55')],_[_0xb76e('0x72')](_0xd57cb3['body'],[_0xb76e('0x55'),'id'])||{})['spread'](function(_0x23b708){for(var _0x433464=0x0;_0x433464<_0xd57cb3[_0xb76e('0x36')][_0xb76e('0x55')][_0xb76e('0x30')];_0x433464+=0x1){socket[_0xb76e('0x5f')](_0xb76e('0x60'),{'UserId':Number(_0xd57cb3[_0xb76e('0x36')][_0xb76e('0x55')][_0x433464]),'ChatQueueId':Number(_0xd57cb3[_0xb76e('0x3e')]['id'])});}return _0x23b708;});}})[_0xb76e('0x14')](respondWithResult(_0x44410f,null))[_0xb76e('0x34')](handleError(_0x44410f,null));};exports[_0xb76e('0x70')]=function(_0x51b78b,_0x12b11e){return db[_0xb76e('0x20')][_0xb76e('0x33')]({'where':{'id':_0x51b78b['params']['id']}})[_0xb76e('0x14')](handleEntityNotFound(_0x12b11e,null))[_0xb76e('0x14')](function(_0x3b1959){if(_0x3b1959){return _0x3b1959[_0xb76e('0x70')](_0x51b78b[_0xb76e('0x2d')][_0xb76e('0x55')])[_0xb76e('0x14')](function(){if(_[_0xb76e('0x73')](_0x51b78b[_0xb76e('0x2d')]['ids'])){for(var _0x4f9ce5=0x0;_0x4f9ce5<_0x51b78b[_0xb76e('0x2d')][_0xb76e('0x55')][_0xb76e('0x30')];_0x4f9ce5+=0x1){socket[_0xb76e('0x5f')](_0xb76e('0x74'),{'UserId':Number(_0x51b78b[_0xb76e('0x2d')][_0xb76e('0x55')][_0x4f9ce5]),'ChatQueueId':Number(_0x51b78b['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x51b78b[_0xb76e('0x2d')][_0xb76e('0x55')]),'ChatQueueId':Number(_0x51b78b[_0xb76e('0x3e')]['id'])});}});}})[_0xb76e('0x14')](respondWithStatusCode(_0x12b11e,null))[_0xb76e('0x34')](handleError(_0x12b11e,null));};exports[_0xb76e('0x75')]=function(_0x1aecfc,_0x58edba){var _0xbcdc57={};var _0x1511c3={};var _0x21f9c5;var _0x114f14;return db[_0xb76e('0x20')]['findOne']({'where':{'id':_0x1aecfc['params']['id']}})[_0xb76e('0x14')](handleEntityNotFound(_0x58edba,null))[_0xb76e('0x14')](function(_0x282f70){if(_0x282f70){_0x21f9c5=_0x282f70;_0x1511c3[_0xb76e('0x29')]=_[_0xb76e('0x2a')](db['User'][_0xb76e('0x2b')]);_0x1511c3[_0xb76e('0x2d')]=_[_0xb76e('0x2a')](_0x1aecfc[_0xb76e('0x2d')]);_0x1511c3[_0xb76e('0x2c')]=_[_0xb76e('0x43')](_0x1511c3[_0xb76e('0x29')],_0x1511c3[_0xb76e('0x2d')]);_0xbcdc57['attributes']=_[_0xb76e('0x43')](_0x1511c3[_0xb76e('0x29')],qs[_0xb76e('0x2f')](_0x1aecfc[_0xb76e('0x2d')][_0xb76e('0x2f')]));_0xbcdc57[_0xb76e('0x2e')]=_0xbcdc57[_0xb76e('0x2e')][_0xb76e('0x30')]?_0xbcdc57[_0xb76e('0x2e')]:_0x1511c3[_0xb76e('0x29')];_0xbcdc57[_0xb76e('0x46')]=qs[_0xb76e('0x47')](_0x1aecfc[_0xb76e('0x2d')][_0xb76e('0x47')]);_0xbcdc57[_0xb76e('0x24')]=qs[_0xb76e('0x2c')](_['pick'](_0x1aecfc['query'],_0x1511c3[_0xb76e('0x2c')]));if(_0x1aecfc[_0xb76e('0x2d')]['filter']){_0xbcdc57[_0xb76e('0x24')]=_[_0xb76e('0x32')](_0xbcdc57[_0xb76e('0x24')],{'$or':_['map'](_0xbcdc57['attributes'],function(_0x49b232){var _0x2ddbf6={};_0x2ddbf6[_0x49b232]={'$like':'%'+_0x1aecfc[_0xb76e('0x2d')][_0xb76e('0x49')]+'%'};return _0x2ddbf6;})});}_0xbcdc57=_[_0xb76e('0x32')]({},_0xbcdc57,_0x1aecfc[_0xb76e('0x53')]);return _0x21f9c5['getAgents'](_0xbcdc57);}})[_0xb76e('0x14')](function(_0x26d387){if(_0x26d387){_0x114f14=_0x26d387[_0xb76e('0x30')];if(!_0x1aecfc[_0xb76e('0x2d')][_0xb76e('0x44')]('nolimit')){_0xbcdc57[_0xb76e('0xf')]=qs[_0xb76e('0xf')](_0x1aecfc['query']['limit']);_0xbcdc57[_0xb76e('0xe')]=qs[_0xb76e('0xe')](_0x1aecfc[_0xb76e('0x2d')][_0xb76e('0xe')]);}return _0x21f9c5[_0xb76e('0x75')](_0xbcdc57);}})['then'](function(_0x36a269){if(_0x36a269){return _0x36a269?{'count':_0x114f14,'rows':_0x36a269}:null;}})[_0xb76e('0x14')](respondWithResult(_0x58edba,null))[_0xb76e('0x34')](handleError(_0x58edba,null));};
\ No newline at end of file
+var _0x272f=['lodash','squel','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','type','getOptions','include','rows','catch','params','model','keys','rawAttributes','query','filters','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','destroy','describe','getMembers','intersection','hasOwnProperty','nolimit','sort','where','pick','ChatQueueId','filter','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','format','SIP','chatPause','createdAt','updatedAt','getTeams','findOne','Team','order','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util'];(function(_0x543f4d,_0x5953de){var _0x173378=function(_0x59aaff){while(--_0x59aaff){_0x543f4d['push'](_0x543f4d['shift']());}};_0x173378(++_0x5953de);}(_0x272f,0x1ee));var _0xf272=function(_0x225c4b,_0x45d0e9){_0x225c4b=_0x225c4b-0x0;var _0x3305b1=_0x272f[_0x225c4b];return _0x3305b1;};'use strict';var BPromise=require(_0xf272('0x0'));var util=require(_0xf272('0x1'));var _=require(_0xf272('0x2'));var squel=require(_0xf272('0x3'));var Redis=require(_0xf272('0x4'));var qs=require(_0xf272('0x5'));var logger=require('../../config/logger')(_0xf272('0x6'));var config=require('../../config/environment');var db=require(_0xf272('0x7'))['db'];config[_0xf272('0x8')]=_['defaults'](config[_0xf272('0x8')],{'host':_0xf272('0x9'),'port':0x18eb});var socket=require(_0xf272('0xa'))(new Redis(config[_0xf272('0x8')]));require(_0xf272('0xb'))[_0xf272('0xc')](socket);function respondWithStatusCode(_0x248ebc,_0x52769c){_0x52769c=_0x52769c||0xcc;return function(_0x849b2c){if(_0x849b2c){return _0x248ebc[_0xf272('0xd')](_0x52769c);}return _0x248ebc['status'](_0x52769c)[_0xf272('0xe')]();};}function respondWithResult(_0x265db8,_0x433a28){_0x433a28=_0x433a28||0xc8;return function(_0x3fea1b){if(_0x3fea1b){return _0x265db8[_0xf272('0xf')](_0x433a28)[_0xf272('0x10')](_0x3fea1b);}};}function respondWithFilteredResult(_0xb4f29e,_0x107e5c){return function(_0x991223){if(_0x991223){var _0x231901=typeof _0x107e5c['offset']===_0xf272('0x11')&&typeof _0x107e5c[_0xf272('0x12')]===_0xf272('0x11');var _0x4bfcf4=_0x991223[_0xf272('0x13')];var _0x505152=_0x231901?0x0:_0x107e5c[_0xf272('0x14')];var _0x4895e4=_0x231901?_0x991223[_0xf272('0x13')]:_0x107e5c[_0xf272('0x14')]+_0x107e5c[_0xf272('0x12')];var _0x2214f4;if(_0x4895e4>=_0x4bfcf4){_0x4895e4=_0x4bfcf4;_0x2214f4=0xc8;}else{_0x2214f4=0xce;}_0xb4f29e['status'](_0x2214f4);return _0xb4f29e[_0xf272('0x15')](_0xf272('0x16'),_0x505152+'-'+_0x4895e4+'/'+_0x4bfcf4)[_0xf272('0x10')](_0x991223);}return null;};}function saveUpdates(_0x26f93a){return function(_0x3f640c){if(_0x3f640c){return _0x3f640c[_0xf272('0x17')](_0x26f93a)[_0xf272('0x18')](function(_0x570a67){return _0x570a67;});}return null;};}function removeEntity(_0x4fb668){return function(_0x1c9620){if(_0x1c9620){return _0x1c9620['destroy']()['then'](function(){var _0x501675=_0x1c9620[_0xf272('0x19')]({'plain':!![]});var _0x2c68d0=_0xf272('0x1a');return db[_0xf272('0x1b')]['destroy']({'where':{'type':_0x2c68d0,'resourceId':_0x501675['id']}})['then'](function(){return _0x1c9620;});})['then'](function(){_0x4fb668[_0xf272('0xf')](0xcc)[_0xf272('0xe')]();});}};}function handleEntityNotFound(_0x46ec78){return function(_0x314337){if(!_0x314337){_0x46ec78[_0xf272('0xd')](0x194);}return _0x314337;};}function handleError(_0x1596e9,_0x59d556){_0x59d556=_0x59d556||0x1f4;return function(_0xb7cccb){logger[_0xf272('0x1c')](_0xb7cccb[_0xf272('0x1d')]);if(_0xb7cccb[_0xf272('0x1e')]){delete _0xb7cccb['name'];}_0x1596e9['status'](_0x59d556)[_0xf272('0x1f')](_0xb7cccb);};}exports[_0xf272('0x20')]=function(_0xcbf388,_0x1bddd1){var _0x29a87a={};var _0x5d6449={'count':0x0,'rows':[]};var _0x3db6b5=_[_0xf272('0x21')](db[_0xf272('0x22')]['rawAttributes'],function(_0x398a6d){return{'name':_0x398a6d['fieldName'],'type':_0x398a6d[_0xf272('0x23')]['key']};});_0x29a87a=qs[_0xf272('0x24')](_0x3db6b5,_0xcbf388);var _0x58ddaf={'where':_0x29a87a['where']};return db[_0xf272('0x22')][_0xf272('0x13')](_0x58ddaf)[_0xf272('0x18')](function(_0x571746){_0x5d6449[_0xf272('0x13')]=_0x571746;_0x29a87a[_0xf272('0x25')]=qs[_0xf272('0x25')](_0xcbf388['query']);return db[_0xf272('0x22')]['findAll'](_0x29a87a);})[_0xf272('0x18')](function(_0x273cd6){_0x5d6449[_0xf272('0x26')]=_0x273cd6;return _0x5d6449;})[_0xf272('0x18')](respondWithFilteredResult(_0x1bddd1,_0x29a87a))[_0xf272('0x27')](handleError(_0x1bddd1,null));};exports['show']=function(_0x2f1b53,_0x2bce85){var _0x176fdf={'raw':!![],'where':{'id':_0x2f1b53[_0xf272('0x28')]['id']}},_0x1ee4fa={};_0x1ee4fa[_0xf272('0x29')]=_[_0xf272('0x2a')](db[_0xf272('0x22')][_0xf272('0x2b')]);_0x1ee4fa[_0xf272('0x2c')]=_[_0xf272('0x2a')](_0x2f1b53[_0xf272('0x2c')]);_0x1ee4fa[_0xf272('0x2d')]=_['intersection'](_0x1ee4fa[_0xf272('0x29')],_0x1ee4fa[_0xf272('0x2c')]);_0x176fdf[_0xf272('0x2e')]=_['intersection'](_0x1ee4fa[_0xf272('0x29')],qs['fields'](_0x2f1b53[_0xf272('0x2c')][_0xf272('0x2f')]));_0x176fdf[_0xf272('0x2e')]=_0x176fdf[_0xf272('0x2e')][_0xf272('0x30')]?_0x176fdf['attributes']:_0x1ee4fa[_0xf272('0x29')];if(_0x2f1b53[_0xf272('0x2c')][_0xf272('0x31')]){_0x176fdf['include']=[{'all':!![]}];}_0x176fdf=_[_0xf272('0x32')]({},_0x176fdf,_0x2f1b53[_0xf272('0x33')]);return db['ChatQueue'][_0xf272('0x34')](_0x176fdf)['then'](handleEntityNotFound(_0x2bce85,null))[_0xf272('0x18')](respondWithResult(_0x2bce85,null))['catch'](handleError(_0x2bce85,null));};exports[_0xf272('0x35')]=function(_0x381655,_0x1ab4de){return db[_0xf272('0x22')][_0xf272('0x35')](_0x381655[_0xf272('0x36')],{})['then'](function(_0x393778){var _0xc02997=_0x381655['user'][_0xf272('0x19')]({'plain':!![]});if(!_0xc02997)throw new Error(_0xf272('0x37'));if(_0xc02997[_0xf272('0x38')]===_0xf272('0x39')){var _0x9461b4=_0x393778[_0xf272('0x19')]({'plain':!![]});var _0xba876=_0xf272('0x1a');return db[_0xf272('0x3a')]['find']({'where':{'name':_0xba876,'userProfileId':_0xc02997[_0xf272('0x3b')]},'raw':!![]})[_0xf272('0x18')](function(_0x22dc79){if(_0x22dc79&&_0x22dc79[_0xf272('0x3c')]===0x0){return db[_0xf272('0x1b')][_0xf272('0x35')]({'name':_0x9461b4['name'],'resourceId':_0x9461b4['id'],'type':_0x22dc79['name'],'sectionId':_0x22dc79['id']},{})['then'](function(){return _0x393778;});}else{return _0x393778;}})[_0xf272('0x27')](function(_0xd1f941){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd1f941);throw _0xd1f941;});}return _0x393778;})[_0xf272('0x18')](respondWithResult(_0x1ab4de,0xc9))[_0xf272('0x27')](handleError(_0x1ab4de,null));};exports[_0xf272('0x17')]=function(_0x4ee7d9,_0x15853f){if(_0x4ee7d9[_0xf272('0x36')]['id']){delete _0x4ee7d9[_0xf272('0x36')]['id'];}return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x4ee7d9[_0xf272('0x28')]['id']}})['then'](handleEntityNotFound(_0x15853f,null))[_0xf272('0x18')](saveUpdates(_0x4ee7d9[_0xf272('0x36')],null))[_0xf272('0x18')](respondWithResult(_0x15853f,null))['catch'](handleError(_0x15853f,null));};exports[_0xf272('0x3d')]=function(_0x47e1f7,_0x5b4d8b){return db[_0xf272('0x22')]['find']({'where':{'id':_0x47e1f7[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x5b4d8b,null))[_0xf272('0x18')](removeEntity(_0x5b4d8b,null))['catch'](handleError(_0x5b4d8b,null));};exports[_0xf272('0x3e')]=function(_0x45a672,_0x4eedbe){return db[_0xf272('0x22')][_0xf272('0x3e')]()[_0xf272('0x18')](respondWithResult(_0x4eedbe,null))[_0xf272('0x27')](handleError(_0x4eedbe,null));};exports[_0xf272('0x3f')]=function(_0x45d335,_0x15f662){var _0x12d767={'raw':!![],'where':{}},_0x5c57ab={},_0x45a9b0;return db['ChatQueue']['findOne']({'where':{'id':_0x45d335[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x15f662,null))['then'](function(_0x212225){if(_0x212225){_0x45a9b0=_0x212225[_0xf272('0x19')]({'plain':!![]});_0x5c57ab['model']=_[_0xf272('0x2a')](db['UserChatQueue']['rawAttributes']);_0x5c57ab[_0xf272('0x2c')]=_['keys'](_0x45d335['query']);_0x5c57ab[_0xf272('0x2d')]=_[_0xf272('0x40')](_0x5c57ab[_0xf272('0x29')],_0x5c57ab[_0xf272('0x2c')]);_0x12d767[_0xf272('0x2e')]=_[_0xf272('0x40')](_0x5c57ab['model'],qs[_0xf272('0x2f')](_0x45d335['query'][_0xf272('0x2f')]));_0x12d767['attributes']=_0x12d767[_0xf272('0x2e')]['length']?_0x12d767[_0xf272('0x2e')]:_0x5c57ab['model'];if(!_0x45d335[_0xf272('0x2c')][_0xf272('0x41')](_0xf272('0x42'))){_0x12d767['limit']=qs[_0xf272('0x12')](_0x45d335[_0xf272('0x2c')][_0xf272('0x12')]);_0x12d767[_0xf272('0x14')]=qs[_0xf272('0x14')](_0x45d335[_0xf272('0x2c')][_0xf272('0x14')]);}_0x12d767['order']=qs[_0xf272('0x43')](_0x45d335[_0xf272('0x2c')][_0xf272('0x43')]);_0x12d767[_0xf272('0x44')]=qs['filters'](_[_0xf272('0x45')](_0x45d335[_0xf272('0x2c')],_0x5c57ab[_0xf272('0x2d')]));_0x12d767[_0xf272('0x44')][_0xf272('0x46')]=_0x212225['id'];if(_0x45d335[_0xf272('0x2c')][_0xf272('0x47')]){_0x12d767[_0xf272('0x44')]=_['merge'](_0x12d767['where'],{'$or':_[_0xf272('0x21')](_0x12d767[_0xf272('0x2e')],function(_0x71664e){var _0x415d2f={};_0x415d2f[_0x71664e]={'$like':'%'+_0x45d335['query'][_0xf272('0x47')]+'%'};return _0x415d2f;})});}_0x12d767=_[_0xf272('0x32')]({},_0x12d767,_0x45d335[_0xf272('0x33')]);return db[_0xf272('0x48')][_0xf272('0x49')](_0x12d767);}})[_0xf272('0x18')](function(_0x23c0ff){if(_0x23c0ff){return db[_0xf272('0x4a')][_0xf272('0x4b')]({'where':{'id':_[_0xf272('0x21')](_0x23c0ff,_0xf272('0x4c')),'role':_0xf272('0x4d')},'attributes':['id','name','chatPause','updatedAt','createdAt']});}})[_0xf272('0x18')](function(_0x972763){if(_0x972763){return{'count':_0x972763[_0xf272('0x13')],'rows':_[_0xf272('0x21')](_0x972763[_0xf272('0x26')],function(_0x13f37f){return{'membername':_0x13f37f[_0xf272('0x1e')],'UserId':_0x13f37f['id'],'queue_name':_0x45a9b0[_0xf272('0x1e')],'ChatQueueId':_0x45a9b0['id'],'interface':util[_0xf272('0x4e')]('%s/%s',_0xf272('0x4f'),_0x13f37f[_0xf272('0x1e')]),'penalty':0x0,'paused':_0x13f37f[_0xf272('0x50')],'createdAt':_0x13f37f[_0xf272('0x51')],'updatedAt':_0x13f37f[_0xf272('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf272('0x18')](respondWithFilteredResult(_0x15f662,_0x12d767))['catch'](handleError(_0x15f662,null));};exports[_0xf272('0x53')]=function(_0x5cb010,_0x5387be){var _0x4e53d4={};var _0x2f0ba7={};var _0x535c00;var _0x5d1104;return db['ChatQueue'][_0xf272('0x54')]({'where':{'id':_0x5cb010[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x5387be,null))[_0xf272('0x18')](function(_0x4f89b3){if(_0x4f89b3){_0x535c00=_0x4f89b3;_0x2f0ba7[_0xf272('0x29')]=_[_0xf272('0x2a')](db[_0xf272('0x55')][_0xf272('0x2b')]);_0x2f0ba7[_0xf272('0x2c')]=_[_0xf272('0x2a')](_0x5cb010[_0xf272('0x2c')]);_0x2f0ba7[_0xf272('0x2d')]=_['intersection'](_0x2f0ba7[_0xf272('0x29')],_0x2f0ba7[_0xf272('0x2c')]);_0x4e53d4['attributes']=_['intersection'](_0x2f0ba7[_0xf272('0x29')],qs[_0xf272('0x2f')](_0x5cb010['query']['fields']));_0x4e53d4['attributes']=_0x4e53d4[_0xf272('0x2e')]['length']?_0x4e53d4[_0xf272('0x2e')]:_0x2f0ba7[_0xf272('0x29')];_0x4e53d4[_0xf272('0x56')]=qs['sort'](_0x5cb010[_0xf272('0x2c')][_0xf272('0x43')]);_0x4e53d4['where']=qs[_0xf272('0x2d')](_[_0xf272('0x45')](_0x5cb010['query'],_0x2f0ba7[_0xf272('0x2d')]));if(_0x5cb010[_0xf272('0x2c')][_0xf272('0x47')]){_0x4e53d4[_0xf272('0x44')]=_[_0xf272('0x32')](_0x4e53d4[_0xf272('0x44')],{'$or':_[_0xf272('0x21')](_0x4e53d4[_0xf272('0x2e')],function(_0x37380b){var _0x4ac7c6={};_0x4ac7c6[_0x37380b]={'$like':'%'+_0x5cb010[_0xf272('0x2c')][_0xf272('0x47')]+'%'};return _0x4ac7c6;})});}_0x4e53d4=_['merge']({},_0x4e53d4,_0x5cb010[_0xf272('0x33')]);return _0x535c00[_0xf272('0x53')](_0x4e53d4);}})[_0xf272('0x18')](function(_0x322e0b){if(_0x322e0b){_0x5d1104=_0x322e0b[_0xf272('0x30')];if(!_0x5cb010[_0xf272('0x2c')][_0xf272('0x41')](_0xf272('0x42'))){_0x4e53d4[_0xf272('0x12')]=qs['limit'](_0x5cb010[_0xf272('0x2c')][_0xf272('0x12')]);_0x4e53d4[_0xf272('0x14')]=qs[_0xf272('0x14')](_0x5cb010[_0xf272('0x2c')][_0xf272('0x14')]);}return _0x535c00['getTeams'](_0x4e53d4);}})[_0xf272('0x18')](function(_0x2f979b){if(_0x2f979b){return _0x2f979b?{'count':_0x5d1104,'rows':_0x2f979b}:null;}})[_0xf272('0x18')](respondWithResult(_0x5387be,null))[_0xf272('0x27')](handleError(_0x5387be,null));};exports['addTeams']=function(_0x4141ed,_0x25ad70){var _0x2c6ec3=_0x4141ed['body'][_0xf272('0x57')];return db[_0xf272('0x55')][_0xf272('0x49')]({'where':{'id':_0x2c6ec3},'attributes':['id'],'include':[{'model':db[_0xf272('0x4a')],'as':'Agents','attributes':['id','name',_0xf272('0x58'),_0xf272('0x59'),_0xf272('0x5a')],'raw':!![]}]})[_0xf272('0x18')](function(_0x11bbb9){if(_0x11bbb9){var _0x3c4a2e=_[_0xf272('0x5b')](_0x11bbb9,function(_0x51a356){var _0x3ae7c9=_0x51a356[_0xf272('0x19')]({'plain':!![]});return _0x3ae7c9[_0xf272('0x5c')];});return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x4141ed['params']['id']}})[_0xf272('0x18')](function(_0x44cb14){return db[_0xf272('0x5d')][_0xf272('0x5e')](function(_0x3cd0c0){return _0x44cb14['addTeams'](_0x2c6ec3,{'transaction':_0x3cd0c0})[_0xf272('0x18')](function(){return BPromise[_0xf272('0x5f')](_0x3c4a2e,function(_0x1f5e4e){return db[_0xf272('0x48')][_0xf272('0x60')]({'where':{'UserId':_0x1f5e4e['id'],'ChatQueueId':_0x4141ed['params']['id']},'transaction':_0x3cd0c0});});})[_0xf272('0x18')](function(){_0x3c4a2e['forEach'](function(_0x317f1f){socket[_0xf272('0x61')](_0xf272('0x62'),{'UserId':_0x317f1f['id'],'ChatQueueId':_0x44cb14['id']});});});});});}})['then'](respondWithStatusCode(_0x25ad70,null))['catch'](handleError(_0x25ad70,null));};exports[_0xf272('0x63')]=function(_0x30369e,_0xcfb7b6){return db['Team'][_0xf272('0x49')]({'where':{'id':_0x30369e[_0xf272('0x2c')][_0xf272('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf272('0x4a')],'as':_0xf272('0x5c'),'attributes':['id'],'raw':!![]}]})[_0xf272('0x18')](handleEntityNotFound(_0xcfb7b6,null))[_0xf272('0x18')](function(_0x42bb79){var _0xd493d7=_[_0xf272('0x21')](_0x42bb79,'id');var _0x694003=[];var _0x265812=[];var _0x236212=squel[_0xf272('0x64')]();_0x236212['field'](_0xf272('0x65'))['from'](_0xf272('0x66'),'tq')[_0xf272('0x67')]('user_has_teams','ut',_0xf272('0x68'))[_0xf272('0x44')](_0xf272('0x69'),_0x30369e[_0xf272('0x28')]['id']);for(var _0x9bc57b=0x0;_0x9bc57b<_0x42bb79[_0xf272('0x30')];_0x9bc57b+=0x1){let _0x4a7017=_0x42bb79[_0x9bc57b];for(var _0x3e9f36=0x0;_0x3e9f36<_0x4a7017[_0xf272('0x5c')][_0xf272('0x30')];_0x3e9f36+=0x1){let _0x3e952f=_0x4a7017[_0xf272('0x5c')][_0x3e9f36];var _0x44b688=_0x236212['clone']();_0x44b688[_0xf272('0x44')](_0xf272('0x6a'),_0x3e952f['id']);_0x265812['push'](db[_0xf272('0x5d')]['query'](_0x44b688[_0xf272('0x6b')](),{'type':db[_0xf272('0x5d')][_0xf272('0x6c')][_0xf272('0x6d')]})[_0xf272('0x18')](function(_0x1c0aaf){if(_0x1c0aaf['length']===0x1){return _0x3e952f['id'];}else{var _0x41404e=_[_0xf272('0x6e')](_[_0xf272('0x21')](_0x1c0aaf,_0xf272('0x6f')),function(_0x1ccbb0){return _['includes'](_0xd493d7,_0x1ccbb0);});if(_0x41404e){return _0x3e952f['id'];}}}));}}return BPromise[_0xf272('0x70')](_0x265812)[_0xf272('0x18')](function(_0x2610ed){_0x694003=_(_0x694003)[_0xf272('0x71')](_0x2610ed)[_0xf272('0x72')]()[_0xf272('0x73')]();return db['ChatQueue'][_0xf272('0x34')]({'where':{'id':_0x30369e['params']['id']}})['then'](function(_0x30333d){return db[_0xf272('0x5d')][_0xf272('0x5e')](function(_0x1e5e29){return _0x30333d['removeTeams'](_0x30369e[_0xf272('0x2c')][_0xf272('0x57')],{'transaction':_0x1e5e29})['then'](function(){if(!_[_0xf272('0x74')](_0x694003)){return _0x30333d[_0xf272('0x75')](_0x694003,{'transaction':_0x1e5e29});}})[_0xf272('0x18')](function(){_0x694003[_0xf272('0x76')](function(_0xa74252){socket['emit'](_0xf272('0x77'),{'UserId':_0xa74252,'ChatQueueId':_0x30333d['id']});});});});});});})[_0xf272('0x18')](respondWithStatusCode(_0xcfb7b6,null))[_0xf272('0x27')](handleError(_0xcfb7b6,null));};exports[_0xf272('0x78')]=function(_0x338761,_0x18db7f){return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x338761[_0xf272('0x28')]['id']}})[_0xf272('0x18')](handleEntityNotFound(_0x18db7f,null))[_0xf272('0x18')](function(_0x2cf6d2){if(_0x2cf6d2){return _0x2cf6d2['addAgents'](_0x338761['body']['ids'],_[_0xf272('0x79')](_0x338761[_0xf272('0x36')],['ids','id'])||{})['spread'](function(_0xf4891a){for(var _0x4ac5f0=0x0;_0x4ac5f0<_0x338761[_0xf272('0x36')][_0xf272('0x57')]['length'];_0x4ac5f0+=0x1){socket['emit'](_0xf272('0x62'),{'UserId':Number(_0x338761['body'][_0xf272('0x57')][_0x4ac5f0]),'ChatQueueId':Number(_0x338761[_0xf272('0x28')]['id'])});}return _0xf4891a;});}})[_0xf272('0x18')](respondWithResult(_0x18db7f,null))['catch'](handleError(_0x18db7f,null));};exports[_0xf272('0x75')]=function(_0x3f3123,_0x4ba569){return db[_0xf272('0x22')][_0xf272('0x34')]({'where':{'id':_0x3f3123['params']['id']}})['then'](handleEntityNotFound(_0x4ba569,null))[_0xf272('0x18')](function(_0x3adbcd){if(_0x3adbcd){return _0x3adbcd['removeAgents'](_0x3f3123['query'][_0xf272('0x57')])[_0xf272('0x18')](function(){if(_[_0xf272('0x7a')](_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')])){for(var _0x578f2d=0x0;_0x578f2d<_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')]['length'];_0x578f2d+=0x1){socket[_0xf272('0x61')]('userChatQueue:remove',{'UserId':Number(_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')][_0x578f2d]),'ChatQueueId':Number(_0x3f3123[_0xf272('0x28')]['id'])});}}else{socket['emit'](_0xf272('0x77'),{'UserId':Number(_0x3f3123[_0xf272('0x2c')][_0xf272('0x57')]),'ChatQueueId':Number(_0x3f3123[_0xf272('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ba569,null))[_0xf272('0x27')](handleError(_0x4ba569,null));};exports[_0xf272('0x7b')]=function(_0x321171,_0x1fa98a){var _0x37bec8={};var _0x5a4c65={};var _0x54dbee;var _0x5a035c;return db[_0xf272('0x22')][_0xf272('0x54')]({'where':{'id':_0x321171[_0xf272('0x28')]['id']}})['then'](handleEntityNotFound(_0x1fa98a,null))[_0xf272('0x18')](function(_0x1b48b9){if(_0x1b48b9){_0x54dbee=_0x1b48b9;_0x5a4c65[_0xf272('0x29')]=_[_0xf272('0x2a')](db[_0xf272('0x4a')][_0xf272('0x2b')]);_0x5a4c65[_0xf272('0x2c')]=_[_0xf272('0x2a')](_0x321171[_0xf272('0x2c')]);_0x5a4c65[_0xf272('0x2d')]=_[_0xf272('0x40')](_0x5a4c65[_0xf272('0x29')],_0x5a4c65['query']);_0x37bec8[_0xf272('0x2e')]=_[_0xf272('0x40')](_0x5a4c65['model'],qs[_0xf272('0x2f')](_0x321171[_0xf272('0x2c')][_0xf272('0x2f')]));_0x37bec8[_0xf272('0x2e')]=_0x37bec8[_0xf272('0x2e')][_0xf272('0x30')]?_0x37bec8['attributes']:_0x5a4c65[_0xf272('0x29')];_0x37bec8['order']=qs['sort'](_0x321171[_0xf272('0x2c')][_0xf272('0x43')]);_0x37bec8[_0xf272('0x44')]=qs['filters'](_[_0xf272('0x45')](_0x321171['query'],_0x5a4c65[_0xf272('0x2d')]));if(_0x321171[_0xf272('0x2c')]['filter']){_0x37bec8[_0xf272('0x44')]=_['merge'](_0x37bec8[_0xf272('0x44')],{'$or':_[_0xf272('0x21')](_0x37bec8[_0xf272('0x2e')],function(_0x2cd679){var _0x3891cb={};_0x3891cb[_0x2cd679]={'$like':'%'+_0x321171['query']['filter']+'%'};return _0x3891cb;})});}_0x37bec8=_[_0xf272('0x32')]({},_0x37bec8,_0x321171['options']);return _0x54dbee[_0xf272('0x7b')](_0x37bec8);}})['then'](function(_0x596135){if(_0x596135){_0x5a035c=_0x596135[_0xf272('0x30')];if(!_0x321171['query']['hasOwnProperty'](_0xf272('0x42'))){_0x37bec8[_0xf272('0x12')]=qs[_0xf272('0x12')](_0x321171[_0xf272('0x2c')]['limit']);_0x37bec8[_0xf272('0x14')]=qs['offset'](_0x321171[_0xf272('0x2c')][_0xf272('0x14')]);}return _0x54dbee[_0xf272('0x7b')](_0x37bec8);}})[_0xf272('0x18')](function(_0x3bf295){if(_0x3bf295){return _0x3bf295?{'count':_0x5a035c,'rows':_0x3bf295}:null;}})[_0xf272('0x18')](respondWithResult(_0x1fa98a,null))[_0xf272('0x27')](handleError(_0x1fa98a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 058e566..e320b01 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 _0x9406=['hasOwnProperty','hook','exports','ChatQueue','setMaxListeners','update','remove','emit'];(function(_0x13f9ae,_0xb03598){var _0x14d535=function(_0x39d44f){while(--_0x39d44f){_0x13f9ae['push'](_0x13f9ae['shift']());}};_0x14d535(++_0xb03598);}(_0x9406,0x14b));var _0x6940=function(_0x543881,_0x57a681){_0x543881=_0x543881-0x0;var _0x12311b=_0x9406[_0x543881];return _0x12311b;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x6940('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6940('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6940('0x2'),'afterDestroy':_0x6940('0x3')};function emitEvent(_0x5b8be7){return function(_0x5ce139,_0x3bc0ba,_0x421f62){ChatQueueEvents[_0x6940('0x4')](_0x5b8be7+':'+_0x5ce139['id'],_0x5ce139);ChatQueueEvents[_0x6940('0x4')](_0x5b8be7,_0x5ce139);_0x421f62(null);};}for(var e in events){if(events[_0x6940('0x5')](e)){var event=events[e];ChatQueue[_0x6940('0x6')](e,emitEvent(event));}}module[_0x6940('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x8eb1=['../../mysqldb','ChatQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8eb1,0x108));var _0x18eb=function(_0x30a04c,_0x1949e1){_0x30a04c=_0x30a04c-0x0;var _0x1da59b=_0x8eb1[_0x30a04c];return _0x1da59b;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x18eb('0x0'))['db'][_0x18eb('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x18eb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x18eb('0x3')};function emitEvent(_0x51b833){return function(_0x264b0e,_0x2bf482,_0x4a33b8){ChatQueueEvents['emit'](_0x51b833+':'+_0x264b0e['id'],_0x264b0e);ChatQueueEvents[_0x18eb('0x4')](_0x51b833,_0x264b0e);_0x4a33b8(null);};}for(var e in events){if(events[_0x18eb('0x5')](e)){var event=events[e];ChatQueue[_0x18eb('0x6')](e,emitEvent(event));}}module[_0x18eb('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index fbf978c..dff7294 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 _0xa39e=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','moment'];(function(_0x13c52d,_0x232bc0){var _0x5177b3=function(_0xdf3dac){while(--_0xdf3dac){_0x13c52d['push'](_0x13c52d['shift']());}};_0x5177b3(++_0x232bc0);}(_0xa39e,0xa5));var _0xea39=function(_0x1061de,_0x38998a){_0x1061de=_0x1061de-0x0;var _0x3b543f=_0xa39e[_0x1061de];return _0x3b543f;};'use strict';var _=require(_0xea39('0x0'));var util=require('util');var logger=require(_0xea39('0x1'))(_0xea39('0x2'));var moment=require(_0xea39('0x3'));var BPromise=require('bluebird');var rp=require(_0xea39('0x4'));var fs=require('fs');var path=require(_0xea39('0x5'));var rimraf=require(_0xea39('0x6'));var config=require(_0xea39('0x7'));var attributes=require(_0xea39('0x8'));module[_0xea39('0x9')]=function(_0x39ef56,_0x1e735d){return _0x39ef56[_0xea39('0xa')](_0xea39('0xb'),attributes,{'tableName':_0xea39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x78bb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x53a442,_0x1b0063){var _0x2e8e36=function(_0x191266){while(--_0x191266){_0x53a442['push'](_0x53a442['shift']());}};_0x2e8e36(++_0x1b0063);}(_0x78bb,0x74));var _0xb78b=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x78bb[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0xb78b('0x0'));var util=require(_0xb78b('0x1'));var logger=require(_0xb78b('0x2'))(_0xb78b('0x3'));var moment=require(_0xb78b('0x4'));var BPromise=require(_0xb78b('0x5'));var rp=require(_0xb78b('0x6'));var fs=require('fs');var path=require(_0xb78b('0x7'));var rimraf=require(_0xb78b('0x8'));var config=require(_0xb78b('0x9'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x15c70c,_0x28005f){return _0x15c70c['define'](_0xb78b('0xa'),attributes,{'tableName':_0xb78b('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 1e17bdd..adcc5a4 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 _0xd4a2=['defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowChatQueue','find','catch','lodash','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dc587,_0x2ebc6c){var _0x29f93a=function(_0x5ab3d4){while(--_0x5ab3d4){_0x3dc587['push'](_0x3dc587['shift']());}};_0x29f93a(++_0x2ebc6c);}(_0xd4a2,0x173));var _0x2d4a=function(_0x2a4fa7,_0x83dd47){_0x2a4fa7=_0x2a4fa7-0x0;var _0x2a66d2=_0xd4a2[_0x2a4fa7];return _0x2a66d2;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d4a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d4a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d4a('0x3'));var logger=require('../../config/logger')(_0x2d4a('0x4'));var config=require(_0x2d4a('0x5'));var jayson=require(_0x2d4a('0x6'));var client=jayson[_0x2d4a('0x7')][_0x2d4a('0x8')]({'port':0x232a});config['redis']=_[_0x2d4a('0x9')](config[_0x2d4a('0xa')],{'host':_0x2d4a('0xb'),'port':0x18eb});var socket=require(_0x2d4a('0xc'))(new Redis(config[_0x2d4a('0xa')]));require(_0x2d4a('0xd'))[_0x2d4a('0xe')](socket);function respondWithRpcPromise(_0x113839,_0x33b786,_0x4738dc){return new BPromise(function(_0x3abbbd,_0xce6af6){return client['request'](_0x113839,_0x4738dc)['then'](function(_0x4002de){logger['info'](_0x2d4a('0xf'),_0x33b786,_0x2d4a('0x10'));logger[_0x2d4a('0x11')](_0x2d4a('0x12'),_0x33b786,_0x2d4a('0x10'),JSON[_0x2d4a('0x13')](_0x4002de));if(_0x4002de[_0x2d4a('0x14')]){if(_0x4002de[_0x2d4a('0x14')]['code']===0x1f4){logger['error'](_0x2d4a('0xf'),_0x33b786,_0x4002de['error'][_0x2d4a('0x15')]);return _0xce6af6(_0x4002de[_0x2d4a('0x14')][_0x2d4a('0x15')]);}logger[_0x2d4a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x33b786,_0x4002de[_0x2d4a('0x14')]['message']);return _0x3abbbd(_0x4002de[_0x2d4a('0x14')]['message']);}else{logger[_0x2d4a('0x16')](_0x2d4a('0xf'),_0x33b786,_0x2d4a('0x10'));_0x3abbbd(_0x4002de[_0x2d4a('0x17')]['message']);}})['catch'](function(_0x5ac74b){logger[_0x2d4a('0x14')](_0x2d4a('0xf'),_0x33b786,_0x5ac74b);_0xce6af6(_0x5ac74b);});});}exports[_0x2d4a('0x18')]=function(_0x419df5){var _0x46c331=this;return new Promise(function(_0x2e4069,_0x56445a){return db['ChatQueue'][_0x2d4a('0x19')]({'raw':_0x419df5[_0x2d4a('0x1a')]?_0x419df5[_0x2d4a('0x1a')][_0x2d4a('0x1b')]===undefined?!![]:![]:!![],'where':_0x419df5[_0x2d4a('0x1a')]?_0x419df5[_0x2d4a('0x1a')][_0x2d4a('0x1c')]||null:null,'attributes':_0x419df5[_0x2d4a('0x1a')]?_0x419df5['options'][_0x2d4a('0x1d')]||null:null,'limit':_0x419df5[_0x2d4a('0x1a')]?_0x419df5[_0x2d4a('0x1a')][_0x2d4a('0x1e')]||null:null,'include':_0x419df5[_0x2d4a('0x1a')]?_0x419df5[_0x2d4a('0x1a')][_0x2d4a('0x1f')]?_[_0x2d4a('0x20')](_0x419df5['options']['include'],function(_0x5cc7d8){return{'model':db[_0x5cc7d8[_0x2d4a('0x21')]],'as':_0x5cc7d8['as'],'attributes':_0x5cc7d8['attributes'],'include':_0x5cc7d8[_0x2d4a('0x1f')]?_[_0x2d4a('0x20')](_0x5cc7d8[_0x2d4a('0x1f')],function(_0x1d2fa6){return{'model':db[_0x1d2fa6[_0x2d4a('0x21')]],'as':_0x1d2fa6['as'],'attributes':_0x1d2fa6[_0x2d4a('0x1d')],'include':_0x1d2fa6[_0x2d4a('0x1f')]?_[_0x2d4a('0x20')](_0x1d2fa6['include'],function(_0x436f53){return{'model':db[_0x436f53['model']],'as':_0x436f53['as'],'attributes':_0x436f53[_0x2d4a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2d4a('0x22')](function(_0xc497ce){logger[_0x2d4a('0x16')](_0x2d4a('0x18'),_0x419df5);logger[_0x2d4a('0x11')](_0x2d4a('0x18'),_0x419df5,JSON[_0x2d4a('0x13')](_0xc497ce));_0x2e4069(_0xc497ce);})['catch'](function(_0x45a4fa){logger[_0x2d4a('0x14')](_0x2d4a('0x18'),_0x45a4fa[_0x2d4a('0x15')],_0x419df5);_0x56445a(_0x46c331[_0x2d4a('0x14')](0x1f4,_0x45a4fa['message']));});});};exports[_0x2d4a('0x23')]=function(_0x31d8ae){var _0x27015d=this;return new Promise(function(_0x24bcc2,_0x2bb93d){return db['ChatQueue'][_0x2d4a('0x24')]({'raw':_0x31d8ae[_0x2d4a('0x1a')]?_0x31d8ae[_0x2d4a('0x1a')][_0x2d4a('0x1b')]===undefined?!![]:![]:!![],'where':_0x31d8ae[_0x2d4a('0x1a')]?_0x31d8ae[_0x2d4a('0x1a')]['where']||null:null,'attributes':_0x31d8ae[_0x2d4a('0x1a')]?_0x31d8ae[_0x2d4a('0x1a')][_0x2d4a('0x1d')]||null:null,'include':_0x31d8ae[_0x2d4a('0x1a')]?_0x31d8ae[_0x2d4a('0x1a')]['include']?_[_0x2d4a('0x20')](_0x31d8ae[_0x2d4a('0x1a')]['include'],function(_0x2b3093){return{'model':db[_0x2b3093[_0x2d4a('0x21')]],'as':_0x2b3093['as'],'attributes':_0x2b3093[_0x2d4a('0x1d')],'include':_0x2b3093[_0x2d4a('0x1f')]?_[_0x2d4a('0x20')](_0x2b3093[_0x2d4a('0x1f')],function(_0x487d2e){return{'model':db[_0x487d2e[_0x2d4a('0x21')]],'as':_0x487d2e['as'],'attributes':_0x487d2e[_0x2d4a('0x1d')],'include':_0x487d2e[_0x2d4a('0x1f')]?_[_0x2d4a('0x20')](_0x487d2e[_0x2d4a('0x1f')],function(_0x145f21){return{'model':db[_0x145f21['model']],'as':_0x145f21['as'],'attributes':_0x145f21['attributes']};}):[]};}):[]};}):[]:[]})[_0x2d4a('0x22')](function(_0x4b833b){logger[_0x2d4a('0x16')](_0x2d4a('0x23'),_0x31d8ae);logger['debug'](_0x2d4a('0x23'),_0x31d8ae,JSON[_0x2d4a('0x13')](_0x4b833b));_0x24bcc2(_0x4b833b);})[_0x2d4a('0x25')](function(_0x1035b9){logger[_0x2d4a('0x14')](_0x2d4a('0x23'),_0x1035b9[_0x2d4a('0x15')],_0x31d8ae);_0x2bb93d(_0x27015d[_0x2d4a('0x14')](0x1f4,_0x1035b9[_0x2d4a('0x15')]));});});};
\ No newline at end of file
+var _0xa0a3=['ChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','then','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','catch','GetChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x172318,_0x25c35f){_0x172318=_0x172318-0x0;var _0xf34564=_0xa0a3[_0x172318];return _0xf34564;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var moment=require(_0x3a0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a0a('0x2'));var fs=require('fs');var Redis=require(_0x3a0a('0x3'));var db=require(_0x3a0a('0x4'))['db'];var utils=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var config=require(_0x3a0a('0x8'));var jayson=require(_0x3a0a('0x9'));var client=jayson[_0x3a0a('0xa')][_0x3a0a('0xb')]({'port':0x232a});config[_0x3a0a('0xc')]=_[_0x3a0a('0xd')](config[_0x3a0a('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a0a('0xc')]));require(_0x3a0a('0xe'))[_0x3a0a('0xf')](socket);function respondWithRpcPromise(_0x3460be,_0x43e9ec,_0x272435){return new BPromise(function(_0x42235e,_0x53f366){return client['request'](_0x3460be,_0x272435)[_0x3a0a('0x10')](function(_0x3b1003){logger['info']('ChatQueue,\x20%s,\x20%s',_0x43e9ec,_0x3a0a('0x11'));logger[_0x3a0a('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x43e9ec,_0x3a0a('0x11'),JSON[_0x3a0a('0x13')](_0x3b1003));if(_0x3b1003[_0x3a0a('0x14')]){if(_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x15')]===0x1f4){logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x17')]);return _0x53f366(_0x3b1003[_0x3a0a('0x14')][_0x3a0a('0x17')]);}logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x3b1003[_0x3a0a('0x14')]['message']);return _0x42235e(_0x3b1003[_0x3a0a('0x14')]['message']);}else{logger[_0x3a0a('0x18')](_0x3a0a('0x16'),_0x43e9ec,_0x3a0a('0x11'));_0x42235e(_0x3b1003['result'][_0x3a0a('0x17')]);}})[_0x3a0a('0x19')](function(_0x4f0372){logger[_0x3a0a('0x14')](_0x3a0a('0x16'),_0x43e9ec,_0x4f0372);_0x53f366(_0x4f0372);});});}exports[_0x3a0a('0x1a')]=function(_0x36ca41){var _0x91d764=this;return new Promise(function(_0x423990,_0x3e99f9){return db[_0x3a0a('0x1b')][_0x3a0a('0x1c')]({'raw':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41['options']['raw']===undefined?!![]:![]:!![],'where':_0x36ca41['options']?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x1e')]||null:null,'attributes':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x1f')]||null:null,'limit':_0x36ca41['options']?_0x36ca41[_0x3a0a('0x1d')][_0x3a0a('0x20')]||null:null,'include':_0x36ca41[_0x3a0a('0x1d')]?_0x36ca41['options'][_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x36ca41['options']['include'],function(_0x16e93d){return{'model':db[_0x16e93d[_0x3a0a('0x23')]],'as':_0x16e93d['as'],'attributes':_0x16e93d[_0x3a0a('0x1f')],'include':_0x16e93d['include']?_[_0x3a0a('0x22')](_0x16e93d[_0x3a0a('0x21')],function(_0x130ca6){return{'model':db[_0x130ca6[_0x3a0a('0x23')]],'as':_0x130ca6['as'],'attributes':_0x130ca6[_0x3a0a('0x1f')],'include':_0x130ca6['include']?_['map'](_0x130ca6[_0x3a0a('0x21')],function(_0x3d01d8){return{'model':db[_0x3d01d8['model']],'as':_0x3d01d8['as'],'attributes':_0x3d01d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a0a('0x10')](function(_0x2e7481){logger[_0x3a0a('0x18')](_0x3a0a('0x1a'),_0x36ca41);logger['debug']('GetChatQueue',_0x36ca41,JSON[_0x3a0a('0x13')](_0x2e7481));_0x423990(_0x2e7481);})[_0x3a0a('0x19')](function(_0x177181){logger['error'](_0x3a0a('0x1a'),_0x177181[_0x3a0a('0x17')],_0x36ca41);_0x3e99f9(_0x91d764[_0x3a0a('0x14')](0x1f4,_0x177181[_0x3a0a('0x17')]));});});};exports[_0x3a0a('0x24')]=function(_0x3184cb){var _0x26ff5d=this;return new Promise(function(_0x1218fd,_0x21be1c){return db['ChatQueue'][_0x3a0a('0x25')]({'raw':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x26')]===undefined?!![]:![]:!![],'where':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb['options'][_0x3a0a('0x1e')]||null:null,'attributes':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x1f')]||null:null,'include':_0x3184cb[_0x3a0a('0x1d')]?_0x3184cb[_0x3a0a('0x1d')]['include']?_[_0x3a0a('0x22')](_0x3184cb[_0x3a0a('0x1d')][_0x3a0a('0x21')],function(_0x32c2e1){return{'model':db[_0x32c2e1[_0x3a0a('0x23')]],'as':_0x32c2e1['as'],'attributes':_0x32c2e1[_0x3a0a('0x1f')],'include':_0x32c2e1[_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x32c2e1['include'],function(_0x2301be){return{'model':db[_0x2301be[_0x3a0a('0x23')]],'as':_0x2301be['as'],'attributes':_0x2301be[_0x3a0a('0x1f')],'include':_0x2301be[_0x3a0a('0x21')]?_[_0x3a0a('0x22')](_0x2301be[_0x3a0a('0x21')],function(_0x2ab6d2){return{'model':db[_0x2ab6d2[_0x3a0a('0x23')]],'as':_0x2ab6d2['as'],'attributes':_0x2ab6d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a0a('0x10')](function(_0x143696){logger[_0x3a0a('0x18')](_0x3a0a('0x24'),_0x3184cb);logger[_0x3a0a('0x12')](_0x3a0a('0x24'),_0x3184cb,JSON[_0x3a0a('0x13')](_0x143696));_0x1218fd(_0x143696);})[_0x3a0a('0x19')](function(_0xea232d){logger['error'](_0x3a0a('0x24'),_0xea232d['message'],_0x3184cb);_0x21be1c(_0x26ff5d[_0x3a0a('0x14')](0x1f4,_0xea232d[_0x3a0a('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 322feba..8b2b003 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 _0x0bde=['save','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatQueueEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatQueueEvents['on'](_0x491dc7,_0x40b36a);}};
\ No newline at end of file
+var _0x00bb=['removeListener','length','chatQueue:','./chatQueue.events','save','remove','emit'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0x00bb,0x1d8));var _0xb00b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x00bb[_0x33032e];return _0x13316b;};'use strict';var ChatQueueEvents=require(_0xb00b('0x0'));var events=[_0xb00b('0x1'),_0xb00b('0x2'),'update'];function createListener(_0x170f94,_0x47a3bf){return function(_0x278c5e){_0x47a3bf[_0xb00b('0x3')](_0x170f94,_0x278c5e);};}function removeListener(_0x582ef9,_0x14b5d0){return function(){ChatQueueEvents[_0xb00b('0x4')](_0x582ef9,_0x14b5d0);};}exports['register']=function(_0x574cf8){for(var _0x532ffb=0x0,_0x36e363=events[_0xb00b('0x5')];_0x532ffb<_0x36e363;_0x532ffb++){var _0x41dfc9=events[_0x532ffb];var _0x37f07d=createListener(_0xb00b('0x6')+_0x41dfc9,_0x574cf8);ChatQueueEvents['on'](_0x41dfc9,_0x37f07d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 9cd180c..e926c52 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5373dc,_0x1c10d9){var _0x102fde=function(_0x2eecf5){while(--_0x2eecf5){_0x5373dc['push'](_0x5373dc['shift']());}};_0x102fde(++_0x1c10d9);}(_0x008c,0x188));var _0xc008=function(_0x419b6a,_0x265b43){_0x419b6a=_0x419b6a-0x0;var _0x229232=_0x008c[_0x419b6a];return _0x229232;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x15757e,_0x8031c2){_0x15757e=_0x15757e-0x0;var _0x5a5843=_0x3e74[_0x15757e];return _0x5a5843;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 39ae136..f29054d 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 _0x5b84=['sequelize','exports','STRING','DATE'];(function(_0x47a2a0,_0x3a8742){var _0x4d279d=function(_0x6e5f3a){while(--_0x6e5f3a){_0x47a2a0['push'](_0x47a2a0['shift']());}};_0x4d279d(++_0x3a8742);}(_0x5b84,0x1ac));var _0x45b8=function(_0x507b3f,_0xd4249c){_0x507b3f=_0x507b3f-0x0;var _0x428730=_0x5b84[_0x507b3f];return _0x428730;};'use strict';var moment=require('moment');var Sequelize=require(_0x45b8('0x0'));module[_0x45b8('0x1')]={'uniqueid':{'type':Sequelize[_0x45b8('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x45b8('0x3')]},'leaveAt':{'type':Sequelize[_0x45b8('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x45b8('0x3')]},'reason':{'type':Sequelize[_0x45b8('0x2')]}};
\ No newline at end of file
+var _0x71ef=['moment','exports','STRING','DATE'];(function(_0x5923e8,_0xc8d316){var _0x7a1148=function(_0x95a6bc){while(--_0x95a6bc){_0x5923e8['push'](_0x5923e8['shift']());}};_0x7a1148(++_0xc8d316);}(_0x71ef,0x140));var _0xf71e=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x71ef[_0x1399d6];return _0x4a9db4;};'use strict';var moment=require(_0xf71e('0x0'));var Sequelize=require('sequelize');module[_0xf71e('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf71e('0x2')]},'joinAt':{'type':Sequelize[_0xf71e('0x3')]},'leaveAt':{'type':Sequelize[_0xf71e('0x3')]},'acceptAt':{'type':Sequelize[_0xf71e('0x3')]},'exitAt':{'type':Sequelize[_0xf71e('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 27b7cb8..8fbcb94 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 _0x7f94=['ChatQueueReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','filter','merge','options','include','findAll','rows','catch','find','create','body','params','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map'];(function(_0x5217ee,_0xd2c4d3){var _0x1e5cd=function(_0x49665e){while(--_0x49665e){_0x5217ee['push'](_0x5217ee['shift']());}};_0x1e5cd(++_0xd2c4d3);}(_0x7f94,0x65));var _0x47f9=function(_0x5e9a54,_0x39a4e1){_0x5e9a54=_0x5e9a54-0x0;var _0x581d64=_0x7f94[_0x5e9a54];return _0x581d64;};'use strict';var emlformat=require(_0x47f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x47f9('0x1'));var jsonpatch=require(_0x47f9('0x2'));var rp=require(_0x47f9('0x3'));var moment=require(_0x47f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47f9('0x5'));var util=require(_0x47f9('0x6'));var path=require(_0x47f9('0x7'));var sox=require(_0x47f9('0x8'));var csv=require(_0x47f9('0x9'));var ejs=require(_0x47f9('0xa'));var fs=require('fs');var fs_extra=require(_0x47f9('0xb'));var _=require('lodash');var squel=require(_0x47f9('0xc'));var crypto=require(_0x47f9('0xd'));var jsforce=require(_0x47f9('0xe'));var deskjs=require(_0x47f9('0xf'));var toCsv=require(_0x47f9('0x9'));var querystring=require(_0x47f9('0x10'));var Papa=require(_0x47f9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x47f9('0x12'));var logger=require(_0x47f9('0x13'))(_0x47f9('0x14'));var utils=require(_0x47f9('0x15'));var config=require(_0x47f9('0x16'));var licenseUtil=require(_0x47f9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a8bac,_0x1002f7){_0x1002f7=_0x1002f7||0xcc;return function(_0x49c33c){if(_0x49c33c){return _0x5a8bac['sendStatus'](_0x1002f7);}return _0x5a8bac['status'](_0x1002f7)[_0x47f9('0x18')]();};}function respondWithResult(_0x43e4db,_0x4d44dd){_0x4d44dd=_0x4d44dd||0xc8;return function(_0x166860){if(_0x166860){return _0x43e4db[_0x47f9('0x19')](_0x4d44dd)[_0x47f9('0x1a')](_0x166860);}};}function respondWithFilteredResult(_0x2a6444,_0x48cc81){return function(_0x3320d1){if(_0x3320d1){var _0x3703e1=typeof _0x48cc81[_0x47f9('0x1b')]===_0x47f9('0x1c')&&typeof _0x48cc81[_0x47f9('0x1d')]==='undefined';var _0x56775f=_0x3320d1['count'];var _0xd80474=_0x3703e1?0x0:_0x48cc81[_0x47f9('0x1b')];var _0x32bb57=_0x3703e1?_0x3320d1[_0x47f9('0x1e')]:_0x48cc81[_0x47f9('0x1b')]+_0x48cc81[_0x47f9('0x1d')];var _0x29700e;if(_0x32bb57>=_0x56775f){_0x32bb57=_0x56775f;_0x29700e=0xc8;}else{_0x29700e=0xce;}_0x2a6444[_0x47f9('0x19')](_0x29700e);return _0x2a6444[_0x47f9('0x1f')](_0x47f9('0x20'),_0xd80474+'-'+_0x32bb57+'/'+_0x56775f)[_0x47f9('0x1a')](_0x3320d1);}return null;};}function patchUpdates(_0x328d14){return function(_0x397dd5){try{jsonpatch['apply'](_0x397dd5,_0x328d14,!![]);}catch(_0x4d35bf){return BPromise[_0x47f9('0x21')](_0x4d35bf);}return _0x397dd5['save']();};}function saveUpdates(_0x2e2b69,_0x29b7f8){return function(_0x2ecf99){if(_0x2ecf99){return _0x2ecf99[_0x47f9('0x22')](_0x2e2b69)[_0x47f9('0x23')](function(_0x11ef91){return _0x11ef91;});}return null;};}function removeEntity(_0x6a49d,_0x3c4778){return function(_0x4fd2b1){if(_0x4fd2b1){return _0x4fd2b1[_0x47f9('0x24')]()[_0x47f9('0x23')](function(){_0x6a49d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26bd84,_0x4c16e0){return function(_0x76077d){if(!_0x76077d){_0x26bd84['sendStatus'](0x194);}return _0x76077d;};}function handleError(_0x26174a,_0x1a8c4b){_0x1a8c4b=_0x1a8c4b||0x1f4;return function(_0x5dbdda){logger[_0x47f9('0x25')](_0x5dbdda[_0x47f9('0x26')]);if(_0x5dbdda[_0x47f9('0x27')]){delete _0x5dbdda[_0x47f9('0x27')];}_0x26174a[_0x47f9('0x19')](_0x1a8c4b)[_0x47f9('0x28')](_0x5dbdda);};}exports[_0x47f9('0x29')]=function(_0x52927a,_0x53e951){var _0x4c37d2={},_0x481ccb={},_0x1a5b58={'count':0x0,'rows':[]};var _0x5818a6=_[_0x47f9('0x2a')](db[_0x47f9('0x2b')][_0x47f9('0x2c')],function(_0xaf0fea){return{'name':_0xaf0fea[_0x47f9('0x2d')],'type':_0xaf0fea[_0x47f9('0x2e')]['key']};});_0x481ccb['model']=_[_0x47f9('0x2a')](_0x5818a6,_0x47f9('0x27'));_0x481ccb['query']=_[_0x47f9('0x2f')](_0x52927a[_0x47f9('0x30')]);_0x481ccb[_0x47f9('0x31')]=_[_0x47f9('0x32')](_0x481ccb[_0x47f9('0x33')],_0x481ccb[_0x47f9('0x30')]);_0x4c37d2[_0x47f9('0x34')]=_[_0x47f9('0x32')](_0x481ccb[_0x47f9('0x33')],qs[_0x47f9('0x35')](_0x52927a[_0x47f9('0x30')][_0x47f9('0x35')]));_0x4c37d2[_0x47f9('0x34')]=_0x4c37d2['attributes'][_0x47f9('0x36')]?_0x4c37d2[_0x47f9('0x34')]:_0x481ccb['model'];if(!_0x52927a[_0x47f9('0x30')][_0x47f9('0x37')]('nolimit')){_0x4c37d2[_0x47f9('0x1d')]=qs['limit'](_0x52927a[_0x47f9('0x30')][_0x47f9('0x1d')]);_0x4c37d2[_0x47f9('0x1b')]=qs['offset'](_0x52927a[_0x47f9('0x30')][_0x47f9('0x1b')]);}_0x4c37d2[_0x47f9('0x38')]=qs[_0x47f9('0x39')](_0x52927a[_0x47f9('0x30')]['sort']);_0x4c37d2['where']=qs['filters'](_[_0x47f9('0x3a')](_0x52927a[_0x47f9('0x30')],_0x481ccb[_0x47f9('0x31')]),_0x5818a6);if(_0x52927a['query']['filter']){_0x4c37d2[_0x47f9('0x3b')]=_['merge'](_0x4c37d2[_0x47f9('0x3b')],{'$or':_['map'](_0x5818a6,function(_0x563492){if(_0x563492[_0x47f9('0x2e')]!=='VIRTUAL'){var _0xfe4480={};_0xfe4480[_0x563492[_0x47f9('0x27')]]={'$like':'%'+_0x52927a[_0x47f9('0x30')][_0x47f9('0x3c')]+'%'};return _0xfe4480;}})});}_0x4c37d2=_[_0x47f9('0x3d')]({},_0x4c37d2,_0x52927a[_0x47f9('0x3e')]);var _0x27ca33={'where':_0x4c37d2['where']};return db['ChatQueueReport'][_0x47f9('0x1e')](_0x27ca33)[_0x47f9('0x23')](function(_0x118db1){_0x1a5b58[_0x47f9('0x1e')]=_0x118db1;if(_0x52927a[_0x47f9('0x30')]['includeAll']){_0x4c37d2[_0x47f9('0x3f')]=[{'all':!![]}];}return db[_0x47f9('0x2b')][_0x47f9('0x40')](_0x4c37d2);})[_0x47f9('0x23')](function(_0x3128bc){_0x1a5b58[_0x47f9('0x41')]=_0x3128bc;return _0x1a5b58;})[_0x47f9('0x23')](respondWithFilteredResult(_0x53e951,_0x4c37d2))[_0x47f9('0x42')](handleError(_0x53e951,null));};exports['show']=function(_0x311975,_0xc61254){var _0x55443d={'raw':!![],'where':{'id':_0x311975['params']['id']}},_0x587a7f={};_0x587a7f[_0x47f9('0x33')]=_[_0x47f9('0x2f')](db[_0x47f9('0x2b')][_0x47f9('0x2c')]);_0x587a7f[_0x47f9('0x30')]=_[_0x47f9('0x2f')](_0x311975[_0x47f9('0x30')]);_0x587a7f[_0x47f9('0x31')]=_[_0x47f9('0x32')](_0x587a7f[_0x47f9('0x33')],_0x587a7f['query']);_0x55443d['attributes']=_['intersection'](_0x587a7f[_0x47f9('0x33')],qs['fields'](_0x311975[_0x47f9('0x30')][_0x47f9('0x35')]));_0x55443d['attributes']=_0x55443d[_0x47f9('0x34')][_0x47f9('0x36')]?_0x55443d['attributes']:_0x587a7f[_0x47f9('0x33')];if(_0x311975[_0x47f9('0x30')]['includeAll']){_0x55443d[_0x47f9('0x3f')]=[{'all':!![]}];}_0x55443d=_[_0x47f9('0x3d')]({},_0x55443d,_0x311975[_0x47f9('0x3e')]);return db[_0x47f9('0x2b')][_0x47f9('0x43')](_0x55443d)[_0x47f9('0x23')](handleEntityNotFound(_0xc61254,null))[_0x47f9('0x23')](respondWithResult(_0xc61254,null))[_0x47f9('0x42')](handleError(_0xc61254,null));};exports[_0x47f9('0x44')]=function(_0x411695,_0x38d61d){return db[_0x47f9('0x2b')][_0x47f9('0x44')](_0x411695[_0x47f9('0x45')],{})[_0x47f9('0x23')](respondWithResult(_0x38d61d,0xc9))['catch'](handleError(_0x38d61d,null));};exports[_0x47f9('0x22')]=function(_0x1c6e21,_0x58fc09){if(_0x1c6e21[_0x47f9('0x45')]['id']){delete _0x1c6e21[_0x47f9('0x45')]['id'];}return db[_0x47f9('0x2b')]['find']({'where':{'id':_0x1c6e21['params']['id']}})[_0x47f9('0x23')](handleEntityNotFound(_0x58fc09,null))['then'](saveUpdates(_0x1c6e21[_0x47f9('0x45')],null))['then'](respondWithResult(_0x58fc09,null))['catch'](handleError(_0x58fc09,null));};exports[_0x47f9('0x24')]=function(_0x2bd2c7,_0x1b1029){return db[_0x47f9('0x2b')]['find']({'where':{'id':_0x2bd2c7[_0x47f9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b1029,null))['then'](removeEntity(_0x1b1029,null))[_0x47f9('0x42')](handleError(_0x1b1029,null));};exports[_0x47f9('0x47')]=function(_0x43eb5b,_0x3d796c){return db[_0x47f9('0x2b')][_0x47f9('0x47')]()['then'](respondWithResult(_0x3d796c,null))[_0x47f9('0x42')](handleError(_0x3d796c,null));};
\ No newline at end of file
+var _0x7163=['key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','params','includeAll','find','create','body','catch','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x123af9,_0x9ae1a8){var _0x379fa9=function(_0x306b03){while(--_0x306b03){_0x123af9['push'](_0x123af9['shift']());}};_0x379fa9(++_0x9ae1a8);}(_0x7163,0x1ef));var _0x3716=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x7163[_0xa2c0a3];return _0x52c618;};'use strict';var emlformat=require(_0x3716('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3716('0x1'));var rp=require(_0x3716('0x2'));var moment=require(_0x3716('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3716('0x4'));var util=require(_0x3716('0x5'));var path=require(_0x3716('0x6'));var sox=require(_0x3716('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3716('0x8'));var _=require(_0x3716('0x9'));var squel=require(_0x3716('0xa'));var crypto=require(_0x3716('0xb'));var jsforce=require(_0x3716('0xc'));var deskjs=require(_0x3716('0xd'));var toCsv=require(_0x3716('0xe'));var querystring=require(_0x3716('0xf'));var Papa=require(_0x3716('0x10'));var Redis=require(_0x3716('0x11'));var authService=require(_0x3716('0x12'));var qs=require(_0x3716('0x13'));var as=require(_0x3716('0x14'));var hardwareService=require(_0x3716('0x15'));var logger=require(_0x3716('0x16'))(_0x3716('0x17'));var utils=require(_0x3716('0x18'));var config=require(_0x3716('0x19'));var licenseUtil=require(_0x3716('0x1a'));var db=require(_0x3716('0x1b'))['db'];function respondWithStatusCode(_0x2c32cf,_0x2bbb95){_0x2bbb95=_0x2bbb95||0xcc;return function(_0x21925a){if(_0x21925a){return _0x2c32cf[_0x3716('0x1c')](_0x2bbb95);}return _0x2c32cf[_0x3716('0x1d')](_0x2bbb95)[_0x3716('0x1e')]();};}function respondWithResult(_0xc095c4,_0x131c5a){_0x131c5a=_0x131c5a||0xc8;return function(_0x4d1791){if(_0x4d1791){return _0xc095c4['status'](_0x131c5a)['json'](_0x4d1791);}};}function respondWithFilteredResult(_0x493b7d,_0x372785){return function(_0x5bbc0a){if(_0x5bbc0a){var _0x166835=typeof _0x372785[_0x3716('0x1f')]===_0x3716('0x20')&&typeof _0x372785['limit']==='undefined';var _0x5f3833=_0x5bbc0a['count'];var _0x27fa57=_0x166835?0x0:_0x372785[_0x3716('0x1f')];var _0x5d16c4=_0x166835?_0x5bbc0a[_0x3716('0x21')]:_0x372785[_0x3716('0x1f')]+_0x372785[_0x3716('0x22')];var _0xf6c764;if(_0x5d16c4>=_0x5f3833){_0x5d16c4=_0x5f3833;_0xf6c764=0xc8;}else{_0xf6c764=0xce;}_0x493b7d[_0x3716('0x1d')](_0xf6c764);return _0x493b7d[_0x3716('0x23')](_0x3716('0x24'),_0x27fa57+'-'+_0x5d16c4+'/'+_0x5f3833)['json'](_0x5bbc0a);}return null;};}function patchUpdates(_0x4cd0a6){return function(_0x524db1){try{jsonpatch[_0x3716('0x25')](_0x524db1,_0x4cd0a6,!![]);}catch(_0x49a885){return BPromise[_0x3716('0x26')](_0x49a885);}return _0x524db1[_0x3716('0x27')]();};}function saveUpdates(_0x2cccca,_0x233517){return function(_0x2b5296){if(_0x2b5296){return _0x2b5296[_0x3716('0x28')](_0x2cccca)[_0x3716('0x29')](function(_0x12bc19){return _0x12bc19;});}return null;};}function removeEntity(_0x1f18b2,_0x483bdd){return function(_0xec15ce){if(_0xec15ce){return _0xec15ce[_0x3716('0x2a')]()[_0x3716('0x29')](function(){_0x1f18b2['status'](0xcc)[_0x3716('0x1e')]();});}};}function handleEntityNotFound(_0x3e7452,_0x4daec7){return function(_0x3fd2bf){if(!_0x3fd2bf){_0x3e7452['sendStatus'](0x194);}return _0x3fd2bf;};}function handleError(_0x224451,_0x2c3df6){_0x2c3df6=_0x2c3df6||0x1f4;return function(_0x203310){logger['error'](_0x203310[_0x3716('0x2b')]);if(_0x203310['name']){delete _0x203310[_0x3716('0x2c')];}_0x224451[_0x3716('0x1d')](_0x2c3df6)['send'](_0x203310);};}exports[_0x3716('0x2d')]=function(_0x3dcf6b,_0x1c29b8){var _0xc5211={},_0x1e413c={},_0x4f76dc={'count':0x0,'rows':[]};var _0x2fdfa1=_[_0x3716('0x2e')](db[_0x3716('0x2f')][_0x3716('0x30')],function(_0x4fee70){return{'name':_0x4fee70[_0x3716('0x31')],'type':_0x4fee70[_0x3716('0x32')][_0x3716('0x33')]};});_0x1e413c[_0x3716('0x34')]=_[_0x3716('0x2e')](_0x2fdfa1,'name');_0x1e413c[_0x3716('0x35')]=_[_0x3716('0x36')](_0x3dcf6b[_0x3716('0x35')]);_0x1e413c['filters']=_['intersection'](_0x1e413c[_0x3716('0x34')],_0x1e413c[_0x3716('0x35')]);_0xc5211[_0x3716('0x37')]=_[_0x3716('0x38')](_0x1e413c['model'],qs[_0x3716('0x39')](_0x3dcf6b[_0x3716('0x35')][_0x3716('0x39')]));_0xc5211[_0x3716('0x37')]=_0xc5211[_0x3716('0x37')][_0x3716('0x3a')]?_0xc5211['attributes']:_0x1e413c[_0x3716('0x34')];if(!_0x3dcf6b[_0x3716('0x35')][_0x3716('0x3b')]('nolimit')){_0xc5211['limit']=qs[_0x3716('0x22')](_0x3dcf6b['query'][_0x3716('0x22')]);_0xc5211[_0x3716('0x1f')]=qs[_0x3716('0x1f')](_0x3dcf6b[_0x3716('0x35')][_0x3716('0x1f')]);}_0xc5211[_0x3716('0x3c')]=qs[_0x3716('0x3d')](_0x3dcf6b[_0x3716('0x35')]['sort']);_0xc5211[_0x3716('0x3e')]=qs[_0x3716('0x3f')](_[_0x3716('0x40')](_0x3dcf6b['query'],_0x1e413c[_0x3716('0x3f')]),_0x2fdfa1);if(_0x3dcf6b['query'][_0x3716('0x41')]){_0xc5211[_0x3716('0x3e')]=_[_0x3716('0x42')](_0xc5211[_0x3716('0x3e')],{'$or':_[_0x3716('0x2e')](_0x2fdfa1,function(_0x207d5e){if(_0x207d5e[_0x3716('0x32')]!==_0x3716('0x43')){var _0x4028b9={};_0x4028b9[_0x207d5e[_0x3716('0x2c')]]={'$like':'%'+_0x3dcf6b[_0x3716('0x35')]['filter']+'%'};return _0x4028b9;}})});}_0xc5211=_[_0x3716('0x42')]({},_0xc5211,_0x3dcf6b[_0x3716('0x44')]);var _0xe69c79={'where':_0xc5211[_0x3716('0x3e')]};return db['ChatQueueReport'][_0x3716('0x21')](_0xe69c79)[_0x3716('0x29')](function(_0x48a539){_0x4f76dc[_0x3716('0x21')]=_0x48a539;if(_0x3dcf6b[_0x3716('0x35')]['includeAll']){_0xc5211[_0x3716('0x45')]=[{'all':!![]}];}return db[_0x3716('0x2f')]['findAll'](_0xc5211);})[_0x3716('0x29')](function(_0xe4b86a){_0x4f76dc['rows']=_0xe4b86a;return _0x4f76dc;})[_0x3716('0x29')](respondWithFilteredResult(_0x1c29b8,_0xc5211))['catch'](handleError(_0x1c29b8,null));};exports[_0x3716('0x46')]=function(_0x215ca6,_0x50dabb){var _0x55147c={'raw':!![],'where':{'id':_0x215ca6[_0x3716('0x47')]['id']}},_0x100807={};_0x100807[_0x3716('0x34')]=_['keys'](db[_0x3716('0x2f')][_0x3716('0x30')]);_0x100807['query']=_[_0x3716('0x36')](_0x215ca6['query']);_0x100807[_0x3716('0x3f')]=_[_0x3716('0x38')](_0x100807[_0x3716('0x34')],_0x100807['query']);_0x55147c['attributes']=_[_0x3716('0x38')](_0x100807[_0x3716('0x34')],qs['fields'](_0x215ca6[_0x3716('0x35')][_0x3716('0x39')]));_0x55147c[_0x3716('0x37')]=_0x55147c[_0x3716('0x37')][_0x3716('0x3a')]?_0x55147c[_0x3716('0x37')]:_0x100807[_0x3716('0x34')];if(_0x215ca6['query'][_0x3716('0x48')]){_0x55147c[_0x3716('0x45')]=[{'all':!![]}];}_0x55147c=_[_0x3716('0x42')]({},_0x55147c,_0x215ca6[_0x3716('0x44')]);return db[_0x3716('0x2f')][_0x3716('0x49')](_0x55147c)[_0x3716('0x29')](handleEntityNotFound(_0x50dabb,null))['then'](respondWithResult(_0x50dabb,null))['catch'](handleError(_0x50dabb,null));};exports['create']=function(_0x5b5df8,_0x1ef5da){return db[_0x3716('0x2f')][_0x3716('0x4a')](_0x5b5df8[_0x3716('0x4b')],{})['then'](respondWithResult(_0x1ef5da,0xc9))[_0x3716('0x4c')](handleError(_0x1ef5da,null));};exports['update']=function(_0xf06450,_0x524088){if(_0xf06450[_0x3716('0x4b')]['id']){delete _0xf06450['body']['id'];}return db[_0x3716('0x2f')][_0x3716('0x49')]({'where':{'id':_0xf06450[_0x3716('0x47')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x524088,null))[_0x3716('0x29')](saveUpdates(_0xf06450[_0x3716('0x4b')],null))[_0x3716('0x29')](respondWithResult(_0x524088,null))[_0x3716('0x4c')](handleError(_0x524088,null));};exports[_0x3716('0x2a')]=function(_0xca5eca,_0x3f05de){return db['ChatQueueReport']['find']({'where':{'id':_0xca5eca[_0x3716('0x47')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x3f05de,null))['then'](removeEntity(_0x3f05de,null))[_0x3716('0x4c')](handleError(_0x3f05de,null));};exports[_0x3716('0x4d')]=function(_0x2e439e,_0x2ae48b){return db[_0x3716('0x2f')]['describe']()[_0x3716('0x29')](respondWithResult(_0x2ae48b,null))[_0x3716('0x4c')](handleError(_0x2ae48b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index b6e5ceb..008e03f 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x116102,_0x2abcbb){var _0x213f03=function(_0x243030){while(--_0x243030){_0x116102['push'](_0x116102['shift']());}};_0x213f03(++_0x2abcbb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'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(_0x27faed,_0x217be4){var _0x2aaeab=function(_0x2e8b17){while(--_0x2e8b17){_0x27faed['push'](_0x27faed['shift']());}};_0x2aaeab(++_0x217be4);}(_0x757a,0xde));var _0xa757=function(_0x14f957,_0x25c3a7){_0x14f957=_0x14f957-0x0;var _0x5af3c8=_0x757a[_0x14f957];return _0x5af3c8;};'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 110d95b..c2eadd0 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 _0x4a37=['limit','UpdateChatQueueReport','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','update'];(function(_0x27a630,_0x3ba6c7){var _0x26a5fb=function(_0x369314){while(--_0x369314){_0x27a630['push'](_0x27a630['shift']());}};_0x26a5fb(++_0x3ba6c7);}(_0x4a37,0x12e));var _0x74a3=function(_0x1d7586,_0x3d5b25){_0x1d7586=_0x1d7586-0x0;var _0x5975db=_0x4a37[_0x1d7586];return _0x5975db;};'use strict';var _=require(_0x74a3('0x0'));var util=require('util');var moment=require(_0x74a3('0x1'));var BPromise=require(_0x74a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74a3('0x3'))['db'];var utils=require(_0x74a3('0x4'));var logger=require(_0x74a3('0x5'))('rpc');var config=require(_0x74a3('0x6'));var jayson=require(_0x74a3('0x7'));var client=jayson[_0x74a3('0x8')][_0x74a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x437908,_0x5bdf8c,_0x15d3a1){return new BPromise(function(_0x5ceec8,_0x1acffd){return client[_0x74a3('0xa')](_0x437908,_0x15d3a1)[_0x74a3('0xb')](function(_0x7ade76){logger[_0x74a3('0xc')](_0x74a3('0xd'),_0x5bdf8c,_0x74a3('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5bdf8c,'request\x20sent',JSON[_0x74a3('0xf')](_0x7ade76));if(_0x7ade76[_0x74a3('0x10')]){if(_0x7ade76[_0x74a3('0x10')]['code']===0x1f4){logger['error'](_0x74a3('0xd'),_0x5bdf8c,_0x7ade76['error'][_0x74a3('0x11')]);return _0x1acffd(_0x7ade76[_0x74a3('0x10')][_0x74a3('0x11')]);}logger[_0x74a3('0x10')](_0x74a3('0xd'),_0x5bdf8c,_0x7ade76[_0x74a3('0x10')][_0x74a3('0x11')]);return _0x5ceec8(_0x7ade76[_0x74a3('0x10')][_0x74a3('0x11')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5bdf8c,_0x74a3('0xe'));_0x5ceec8(_0x7ade76[_0x74a3('0x12')]['message']);}})[_0x74a3('0x13')](function(_0x137ad7){logger[_0x74a3('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x5bdf8c,_0x137ad7);_0x1acffd(_0x137ad7);});});}exports[_0x74a3('0x14')]=function(_0x3210ae){var _0x14de06=this;return new Promise(function(_0x844d64,_0x14f25e){return db[_0x74a3('0x15')][_0x74a3('0x16')](_0x3210ae[_0x74a3('0x17')],{'raw':_0x3210ae[_0x74a3('0x18')]?_0x3210ae[_0x74a3('0x18')][_0x74a3('0x19')]===undefined?!![]:![]:!![]})[_0x74a3('0xb')](function(_0x4a80c3){logger['info'](_0x74a3('0x14'),_0x3210ae);logger[_0x74a3('0x1a')]('CreateChatQueueReport',_0x3210ae,JSON['stringify'](_0x4a80c3));_0x844d64(_0x4a80c3);})[_0x74a3('0x13')](function(_0x3f7914){logger['error'](_0x74a3('0x14'),_0x3f7914[_0x74a3('0x11')],_0x3210ae);_0x14f25e(_0x14de06[_0x74a3('0x10')](0x1f4,_0x3f7914[_0x74a3('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x454dc9){var _0x1d07c5=this;return new Promise(function(_0x53be10,_0x2fced6){return db['ChatQueueReport'][_0x74a3('0x1b')](_0x454dc9[_0x74a3('0x17')],{'raw':_0x454dc9[_0x74a3('0x18')]?_0x454dc9[_0x74a3('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x454dc9['options']?_0x454dc9[_0x74a3('0x18')]['where']||null:null,'attributes':_0x454dc9[_0x74a3('0x18')]?_0x454dc9[_0x74a3('0x18')]['attributes']||null:null,'limit':_0x454dc9['options']?_0x454dc9[_0x74a3('0x18')][_0x74a3('0x1c')]||null:null})[_0x74a3('0xb')](function(_0xca25ff){logger['info'](_0x74a3('0x1d'),_0x454dc9);logger[_0x74a3('0x1a')](_0x74a3('0x1d'),_0x454dc9,JSON[_0x74a3('0xf')](_0xca25ff));_0x53be10(_0xca25ff);})['catch'](function(_0x4fd09a){logger[_0x74a3('0x10')](_0x74a3('0x1d'),_0x4fd09a[_0x74a3('0x11')],_0x454dc9);_0x2fced6(_0x1d07c5[_0x74a3('0x10')](0x1f4,_0x4fd09a[_0x74a3('0x11')]));});});};
\ No newline at end of file
+var _0x9829=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','then','UpdateChatQueueReport','update','where','attributes','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info'];(function(_0x93a15c,_0x2ec812){var _0x1e32e4=function(_0x174b05){while(--_0x174b05){_0x93a15c['push'](_0x93a15c['shift']());}};_0x1e32e4(++_0x2ec812);}(_0x9829,0xfb));var _0x9982=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x9829[_0x25c326];return _0x762452;};'use strict';var _=require(_0x9982('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9982('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9982('0x2'));var db=require(_0x9982('0x3'))['db'];var utils=require(_0x9982('0x4'));var logger=require('../../config/logger')(_0x9982('0x5'));var config=require(_0x9982('0x6'));var jayson=require(_0x9982('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44a7f4,_0x45c41d,_0x4b7b7b){return new BPromise(function(_0x3d2209,_0x385713){return client[_0x9982('0x8')](_0x44a7f4,_0x4b7b7b)['then'](function(_0x4cbfd0){logger[_0x9982('0x9')](_0x9982('0xa'),_0x45c41d,_0x9982('0xb'));logger[_0x9982('0xc')](_0x9982('0xd'),_0x45c41d,_0x9982('0xb'),JSON[_0x9982('0xe')](_0x4cbfd0));if(_0x4cbfd0[_0x9982('0xf')]){if(_0x4cbfd0[_0x9982('0xf')]['code']===0x1f4){logger[_0x9982('0xf')](_0x9982('0xa'),_0x45c41d,_0x4cbfd0['error']['message']);return _0x385713(_0x4cbfd0[_0x9982('0xf')]['message']);}logger[_0x9982('0xf')](_0x9982('0xa'),_0x45c41d,_0x4cbfd0[_0x9982('0xf')][_0x9982('0x10')]);return _0x3d2209(_0x4cbfd0[_0x9982('0xf')][_0x9982('0x10')]);}else{logger[_0x9982('0x9')](_0x9982('0xa'),_0x45c41d,_0x9982('0xb'));_0x3d2209(_0x4cbfd0[_0x9982('0x11')][_0x9982('0x10')]);}})[_0x9982('0x12')](function(_0x5598cd){logger[_0x9982('0xf')](_0x9982('0xa'),_0x45c41d,_0x5598cd);_0x385713(_0x5598cd);});});}exports[_0x9982('0x13')]=function(_0xecdd2a){var _0x1368e0=this;return new Promise(function(_0xa0534c,_0x34dc32){return db[_0x9982('0x14')]['create'](_0xecdd2a[_0x9982('0x15')],{'raw':_0xecdd2a['options']?_0xecdd2a[_0x9982('0x16')][_0x9982('0x17')]===undefined?!![]:![]:!![]})[_0x9982('0x18')](function(_0x1e71f9){logger[_0x9982('0x9')](_0x9982('0x13'),_0xecdd2a);logger[_0x9982('0xc')]('CreateChatQueueReport',_0xecdd2a,JSON[_0x9982('0xe')](_0x1e71f9));_0xa0534c(_0x1e71f9);})[_0x9982('0x12')](function(_0x2b5c35){logger[_0x9982('0xf')](_0x9982('0x13'),_0x2b5c35[_0x9982('0x10')],_0xecdd2a);_0x34dc32(_0x1368e0[_0x9982('0xf')](0x1f4,_0x2b5c35[_0x9982('0x10')]));});});};exports[_0x9982('0x19')]=function(_0x358345){var _0x95dd7c=this;return new Promise(function(_0x354ab7,_0x5a0f25){return db[_0x9982('0x14')][_0x9982('0x1a')](_0x358345[_0x9982('0x15')],{'raw':_0x358345[_0x9982('0x16')]?_0x358345[_0x9982('0x16')][_0x9982('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x358345['options']?_0x358345['options'][_0x9982('0x1b')]||null:null,'attributes':_0x358345['options']?_0x358345[_0x9982('0x16')][_0x9982('0x1c')]||null:null,'limit':_0x358345[_0x9982('0x16')]?_0x358345[_0x9982('0x16')]['limit']||null:null})[_0x9982('0x18')](function(_0x1ff242){logger[_0x9982('0x9')](_0x9982('0x19'),_0x358345);logger[_0x9982('0xc')]('UpdateChatQueueReport',_0x358345,JSON[_0x9982('0xe')](_0x1ff242));_0x354ab7(_0x1ff242);})[_0x9982('0x12')](function(_0x868f62){logger[_0x9982('0xf')](_0x9982('0x19'),_0x868f62[_0x9982('0x10')],_0x358345);_0x5a0f25(_0x95dd7c['error'](0x1f4,_0x868f62['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index cab5a2c..a191296 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 _0x7e19=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x431eb9,_0x458e58){var _0x33e92d=function(_0x4ba8f7){while(--_0x4ba8f7){_0x431eb9['push'](_0x431eb9['shift']());}};_0x33e92d(++_0x458e58);}(_0x7e19,0x16c));var _0x97e1=function(_0x4e4a3f,_0x42009f){_0x4e4a3f=_0x4e4a3f-0x0;var _0x3b2b12=_0x7e19[_0x4e4a3f];return _0x3b2b12;};'use strict';var multer=require(_0x97e1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x97e1('0x1'));var express=require(_0x97e1('0x2'));var router=express[_0x97e1('0x3')]();var fs_extra=require(_0x97e1('0x4'));var auth=require(_0x97e1('0x5'));var interaction=require(_0x97e1('0x6'));var config=require(_0x97e1('0x7'));var controller=require('./chatQueueReport.controller');router[_0x97e1('0x8')]('/',auth[_0x97e1('0x9')](),controller[_0x97e1('0xa')]);router[_0x97e1('0x8')](_0x97e1('0xb'),auth['isAuthenticated'](),controller[_0x97e1('0xc')]);router[_0x97e1('0x8')](_0x97e1('0xd'),auth['isAuthenticated'](),controller[_0x97e1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x97e1('0xf')]);router['put'](_0x97e1('0xd'),auth[_0x97e1('0x9')](),controller['update']);router[_0x97e1('0x10')]('/:id',auth[_0x97e1('0x9')](),controller[_0x97e1('0x11')]);module[_0x97e1('0x12')]=router;
\ No newline at end of file
+var _0x10b6=['isAuthenticated','index','/describe','describe','/:id','show','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x560497,_0x342635){var _0x6250c1=function(_0x15fd4c){while(--_0x15fd4c){_0x560497['push'](_0x560497['shift']());}};_0x6250c1(++_0x342635);}(_0x10b6,0x172));var _0x610b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x10b6[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x610b('0x0'));var util=require(_0x610b('0x1'));var path=require(_0x610b('0x2'));var timeout=require(_0x610b('0x3'));var express=require('express');var router=express[_0x610b('0x4')]();var fs_extra=require(_0x610b('0x5'));var auth=require(_0x610b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x610b('0x7'));var controller=require(_0x610b('0x8'));router[_0x610b('0x9')]('/',auth[_0x610b('0xa')](),controller[_0x610b('0xb')]);router[_0x610b('0x9')](_0x610b('0xc'),auth['isAuthenticated'](),controller[_0x610b('0xd')]);router[_0x610b('0x9')](_0x610b('0xe'),auth[_0x610b('0xa')](),controller[_0x610b('0xf')]);router['post']('/',auth[_0x610b('0xa')](),controller['create']);router[_0x610b('0x10')](_0x610b('0xe'),auth[_0x610b('0xa')](),controller['update']);router['delete'](_0x610b('0xe'),auth[_0x610b('0xa')](),controller[_0x610b('0x11')]);module[_0x610b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 30edc6c..373898b 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x28112b,_0xcbf761){_0x28112b=_0x28112b-0x0;var _0x4bb2c5=_0xb43b[_0x28112b];return _0x4bb2c5;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x54ef,0x112));var _0xf54e=function(_0x34731d,_0x2660af){_0x34731d=_0x34731d-0x0;var _0x2f379e=_0x54ef[_0x34731d];return _0x2f379e;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 4946c60..40a49a5 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 _0x15ff=['ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatTransferReport','findAll','rows','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x4209e1,_0x571956){var _0x6241a8=function(_0x48512f){while(--_0x48512f){_0x4209e1['push'](_0x4209e1['shift']());}};_0x6241a8(++_0x571956);}(_0x15ff,0xcd));var _0xf15f=function(_0x4d0d85,_0x3250d3){_0x4d0d85=_0x4d0d85-0x0;var _0x290a74=_0x15ff[_0x4d0d85];return _0x290a74;};'use strict';var emlformat=require(_0xf15f('0x0'));var rimraf=require(_0xf15f('0x1'));var zipdir=require(_0xf15f('0x2'));var jsonpatch=require(_0xf15f('0x3'));var rp=require(_0xf15f('0x4'));var moment=require(_0xf15f('0x5'));var BPromise=require(_0xf15f('0x6'));var Mustache=require(_0xf15f('0x7'));var util=require(_0xf15f('0x8'));var path=require(_0xf15f('0x9'));var sox=require('sox');var csv=require(_0xf15f('0xa'));var ejs=require(_0xf15f('0xb'));var fs=require('fs');var fs_extra=require(_0xf15f('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf15f('0xd'));var jsforce=require(_0xf15f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf15f('0xa'));var querystring=require(_0xf15f('0xf'));var Papa=require('papaparse');var Redis=require(_0xf15f('0x10'));var authService=require(_0xf15f('0x11'));var qs=require(_0xf15f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf15f('0x13'));var logger=require('../../config/logger')(_0xf15f('0x14'));var utils=require(_0xf15f('0x15'));var config=require(_0xf15f('0x16'));var licenseUtil=require(_0xf15f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b4745,_0x400932){_0x400932=_0x400932||0xcc;return function(_0x3e323f){if(_0x3e323f){return _0x3b4745['sendStatus'](_0x400932);}return _0x3b4745[_0xf15f('0x18')](_0x400932)[_0xf15f('0x19')]();};}function respondWithResult(_0x546274,_0x4c3148){_0x4c3148=_0x4c3148||0xc8;return function(_0x4b7326){if(_0x4b7326){return _0x546274[_0xf15f('0x18')](_0x4c3148)[_0xf15f('0x1a')](_0x4b7326);}};}function respondWithFilteredResult(_0x452c1b,_0x447336){return function(_0x5f3ece){if(_0x5f3ece){var _0x41efd3=typeof _0x447336[_0xf15f('0x1b')]==='undefined'&&typeof _0x447336[_0xf15f('0x1c')]==='undefined';var _0x5ea5a8=_0x5f3ece[_0xf15f('0x1d')];var _0x83403d=_0x41efd3?0x0:_0x447336['offset'];var _0x9c0ef9=_0x41efd3?_0x5f3ece[_0xf15f('0x1d')]:_0x447336[_0xf15f('0x1b')]+_0x447336[_0xf15f('0x1c')];var _0x5b0959;if(_0x9c0ef9>=_0x5ea5a8){_0x9c0ef9=_0x5ea5a8;_0x5b0959=0xc8;}else{_0x5b0959=0xce;}_0x452c1b[_0xf15f('0x18')](_0x5b0959);return _0x452c1b[_0xf15f('0x1e')](_0xf15f('0x1f'),_0x83403d+'-'+_0x9c0ef9+'/'+_0x5ea5a8)[_0xf15f('0x1a')](_0x5f3ece);}return null;};}function patchUpdates(_0x12f7db){return function(_0x562657){try{jsonpatch['apply'](_0x562657,_0x12f7db,!![]);}catch(_0x4a187a){return BPromise['reject'](_0x4a187a);}return _0x562657[_0xf15f('0x20')]();};}function saveUpdates(_0x51ea19,_0x3f3585){return function(_0x2cb01b){if(_0x2cb01b){return _0x2cb01b[_0xf15f('0x21')](_0x51ea19)[_0xf15f('0x22')](function(_0x3ca2bf){return _0x3ca2bf;});}return null;};}function removeEntity(_0x150b6d,_0x507de2){return function(_0x53b9d9){if(_0x53b9d9){return _0x53b9d9[_0xf15f('0x23')]()[_0xf15f('0x22')](function(){_0x150b6d['status'](0xcc)[_0xf15f('0x19')]();});}};}function handleEntityNotFound(_0x448ffe,_0x3029c1){return function(_0x38ecec){if(!_0x38ecec){_0x448ffe['sendStatus'](0x194);}return _0x38ecec;};}function handleError(_0x582d63,_0x1f6f28){_0x1f6f28=_0x1f6f28||0x1f4;return function(_0x33dbf5){logger[_0xf15f('0x24')](_0x33dbf5['stack']);if(_0x33dbf5['name']){delete _0x33dbf5[_0xf15f('0x25')];}_0x582d63[_0xf15f('0x18')](_0x1f6f28)[_0xf15f('0x26')](_0x33dbf5);};}exports['index']=function(_0x2f0833,_0x4aa3cb){var _0x23adc9={},_0x5c9d36={},_0x15a171={'count':0x0,'rows':[]};var _0x3a7afa=_[_0xf15f('0x27')](db['ChatTransferReport'][_0xf15f('0x28')],function(_0x49bcb4){return{'name':_0x49bcb4[_0xf15f('0x29')],'type':_0x49bcb4[_0xf15f('0x2a')][_0xf15f('0x2b')]};});_0x5c9d36['model']=_[_0xf15f('0x27')](_0x3a7afa,_0xf15f('0x25'));_0x5c9d36['query']=_['keys'](_0x2f0833[_0xf15f('0x2c')]);_0x5c9d36[_0xf15f('0x2d')]=_[_0xf15f('0x2e')](_0x5c9d36[_0xf15f('0x2f')],_0x5c9d36[_0xf15f('0x2c')]);_0x23adc9[_0xf15f('0x30')]=_[_0xf15f('0x2e')](_0x5c9d36[_0xf15f('0x2f')],qs['fields'](_0x2f0833[_0xf15f('0x2c')][_0xf15f('0x31')]));_0x23adc9[_0xf15f('0x30')]=_0x23adc9[_0xf15f('0x30')][_0xf15f('0x32')]?_0x23adc9[_0xf15f('0x30')]:_0x5c9d36[_0xf15f('0x2f')];if(!_0x2f0833[_0xf15f('0x2c')][_0xf15f('0x33')](_0xf15f('0x34'))){_0x23adc9[_0xf15f('0x1c')]=qs[_0xf15f('0x1c')](_0x2f0833[_0xf15f('0x2c')][_0xf15f('0x1c')]);_0x23adc9[_0xf15f('0x1b')]=qs['offset'](_0x2f0833['query'][_0xf15f('0x1b')]);}_0x23adc9[_0xf15f('0x35')]=qs[_0xf15f('0x36')](_0x2f0833[_0xf15f('0x2c')][_0xf15f('0x36')]);_0x23adc9[_0xf15f('0x37')]=qs['filters'](_[_0xf15f('0x38')](_0x2f0833[_0xf15f('0x2c')],_0x5c9d36[_0xf15f('0x2d')]),_0x3a7afa);if(_0x2f0833[_0xf15f('0x2c')]['filter']){_0x23adc9[_0xf15f('0x37')]=_[_0xf15f('0x39')](_0x23adc9[_0xf15f('0x37')],{'$or':_[_0xf15f('0x27')](_0x3a7afa,function(_0x53e4a8){if(_0x53e4a8['type']!==_0xf15f('0x3a')){var _0x17c7c6={};_0x17c7c6[_0x53e4a8['name']]={'$like':'%'+_0x2f0833[_0xf15f('0x2c')][_0xf15f('0x3b')]+'%'};return _0x17c7c6;}})});}_0x23adc9=_[_0xf15f('0x39')]({},_0x23adc9,_0x2f0833[_0xf15f('0x3c')]);var _0xcf862f={'where':_0x23adc9[_0xf15f('0x37')]};return db['ChatTransferReport'][_0xf15f('0x1d')](_0xcf862f)['then'](function(_0x55debf){_0x15a171['count']=_0x55debf;if(_0x2f0833['query']['includeAll']){_0x23adc9['include']=[{'all':!![]}];}return db[_0xf15f('0x3d')][_0xf15f('0x3e')](_0x23adc9);})[_0xf15f('0x22')](function(_0x2ac88f){_0x15a171[_0xf15f('0x3f')]=_0x2ac88f;return _0x15a171;})[_0xf15f('0x22')](respondWithFilteredResult(_0x4aa3cb,_0x23adc9))[_0xf15f('0x40')](handleError(_0x4aa3cb,null));};exports['show']=function(_0xf9de9c,_0x388f9d){var _0x10cf27={'raw':!![],'where':{'id':_0xf9de9c[_0xf15f('0x41')]['id']}},_0xa0317a={};_0xa0317a['model']=_[_0xf15f('0x42')](db[_0xf15f('0x3d')][_0xf15f('0x28')]);_0xa0317a[_0xf15f('0x2c')]=_[_0xf15f('0x42')](_0xf9de9c[_0xf15f('0x2c')]);_0xa0317a['filters']=_[_0xf15f('0x2e')](_0xa0317a['model'],_0xa0317a[_0xf15f('0x2c')]);_0x10cf27[_0xf15f('0x30')]=_['intersection'](_0xa0317a['model'],qs[_0xf15f('0x31')](_0xf9de9c[_0xf15f('0x2c')][_0xf15f('0x31')]));_0x10cf27[_0xf15f('0x30')]=_0x10cf27[_0xf15f('0x30')][_0xf15f('0x32')]?_0x10cf27[_0xf15f('0x30')]:_0xa0317a['model'];if(_0xf9de9c['query'][_0xf15f('0x43')]){_0x10cf27['include']=[{'all':!![]}];}_0x10cf27=_[_0xf15f('0x39')]({},_0x10cf27,_0xf9de9c[_0xf15f('0x3c')]);return db[_0xf15f('0x3d')][_0xf15f('0x44')](_0x10cf27)[_0xf15f('0x22')](handleEntityNotFound(_0x388f9d,null))[_0xf15f('0x22')](respondWithResult(_0x388f9d,null))[_0xf15f('0x40')](handleError(_0x388f9d,null));};exports['create']=function(_0x33265c,_0x457675){return db[_0xf15f('0x3d')][_0xf15f('0x45')](_0x33265c[_0xf15f('0x46')],{})['then'](respondWithResult(_0x457675,0xc9))[_0xf15f('0x40')](handleError(_0x457675,null));};exports['update']=function(_0x24c56f,_0x42626b){if(_0x24c56f['body']['id']){delete _0x24c56f[_0xf15f('0x46')]['id'];}return db['ChatTransferReport'][_0xf15f('0x44')]({'where':{'id':_0x24c56f[_0xf15f('0x41')]['id']}})[_0xf15f('0x22')](handleEntityNotFound(_0x42626b,null))['then'](saveUpdates(_0x24c56f['body'],null))['then'](respondWithResult(_0x42626b,null))[_0xf15f('0x40')](handleError(_0x42626b,null));};exports['destroy']=function(_0x4031bd,_0x9b0da3){return db[_0xf15f('0x3d')]['find']({'where':{'id':_0x4031bd['params']['id']}})[_0xf15f('0x22')](handleEntityNotFound(_0x9b0da3,null))[_0xf15f('0x22')](removeEntity(_0x9b0da3,null))['catch'](handleError(_0x9b0da3,null));};exports[_0xf15f('0x47')]=function(_0x3e7e33,_0x3f40c2){return db[_0xf15f('0x3d')][_0xf15f('0x47')]()[_0xf15f('0x22')](respondWithResult(_0x3f40c2,null))[_0xf15f('0x40')](handleError(_0x3f40c2,null));};
\ No newline at end of file
+var _0xdab4=['error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','filters','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x4b39ec,_0x26ae2a){var _0x574102=function(_0x1e9d24){while(--_0x1e9d24){_0x4b39ec['push'](_0x4b39ec['shift']());}};_0x574102(++_0x26ae2a);}(_0xdab4,0x11a));var _0x4dab=function(_0x3619f0,_0x393b23){_0x3619f0=_0x3619f0-0x0;var _0x369c02=_0xdab4[_0x3619f0];return _0x369c02;};'use strict';var emlformat=require(_0x4dab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dab('0x1'));var jsonpatch=require(_0x4dab('0x2'));var rp=require(_0x4dab('0x3'));var moment=require(_0x4dab('0x4'));var BPromise=require(_0x4dab('0x5'));var Mustache=require(_0x4dab('0x6'));var util=require(_0x4dab('0x7'));var path=require(_0x4dab('0x8'));var sox=require(_0x4dab('0x9'));var csv=require('to-csv');var ejs=require(_0x4dab('0xa'));var fs=require('fs');var fs_extra=require(_0x4dab('0xb'));var _=require(_0x4dab('0xc'));var squel=require(_0x4dab('0xd'));var crypto=require(_0x4dab('0xe'));var jsforce=require(_0x4dab('0xf'));var deskjs=require(_0x4dab('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4dab('0x11'));var Papa=require(_0x4dab('0x12'));var Redis=require('ioredis');var authService=require(_0x4dab('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4dab('0x14'));var hardwareService=require(_0x4dab('0x15'));var logger=require(_0x4dab('0x16'))('api');var utils=require(_0x4dab('0x17'));var config=require(_0x4dab('0x18'));var licenseUtil=require(_0x4dab('0x19'));var db=require(_0x4dab('0x1a'))['db'];function respondWithStatusCode(_0x47d367,_0x51c024){_0x51c024=_0x51c024||0xcc;return function(_0x127b40){if(_0x127b40){return _0x47d367[_0x4dab('0x1b')](_0x51c024);}return _0x47d367['status'](_0x51c024)[_0x4dab('0x1c')]();};}function respondWithResult(_0x5b07dd,_0x2750db){_0x2750db=_0x2750db||0xc8;return function(_0x395fda){if(_0x395fda){return _0x5b07dd[_0x4dab('0x1d')](_0x2750db)[_0x4dab('0x1e')](_0x395fda);}};}function respondWithFilteredResult(_0x4cec35,_0x55743e){return function(_0x4b3019){if(_0x4b3019){var _0x7f4222=typeof _0x55743e[_0x4dab('0x1f')]===_0x4dab('0x20')&&typeof _0x55743e['limit']==='undefined';var _0x93d100=_0x4b3019[_0x4dab('0x21')];var _0x595864=_0x7f4222?0x0:_0x55743e[_0x4dab('0x1f')];var _0x4c6e11=_0x7f4222?_0x4b3019[_0x4dab('0x21')]:_0x55743e['offset']+_0x55743e[_0x4dab('0x22')];var _0x1b422f;if(_0x4c6e11>=_0x93d100){_0x4c6e11=_0x93d100;_0x1b422f=0xc8;}else{_0x1b422f=0xce;}_0x4cec35[_0x4dab('0x1d')](_0x1b422f);return _0x4cec35[_0x4dab('0x23')](_0x4dab('0x24'),_0x595864+'-'+_0x4c6e11+'/'+_0x93d100)[_0x4dab('0x1e')](_0x4b3019);}return null;};}function patchUpdates(_0x95a064){return function(_0x53e814){try{jsonpatch[_0x4dab('0x25')](_0x53e814,_0x95a064,!![]);}catch(_0x1fd2a7){return BPromise[_0x4dab('0x26')](_0x1fd2a7);}return _0x53e814['save']();};}function saveUpdates(_0x21fd93,_0x37549a){return function(_0x4dd0f3){if(_0x4dd0f3){return _0x4dd0f3[_0x4dab('0x27')](_0x21fd93)[_0x4dab('0x28')](function(_0x3c5077){return _0x3c5077;});}return null;};}function removeEntity(_0x17ab24,_0x269cb0){return function(_0xfc646b){if(_0xfc646b){return _0xfc646b[_0x4dab('0x29')]()[_0x4dab('0x28')](function(){_0x17ab24[_0x4dab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dc834,_0x983dec){return function(_0x34ce06){if(!_0x34ce06){_0x4dc834[_0x4dab('0x1b')](0x194);}return _0x34ce06;};}function handleError(_0x34da6a,_0x20d922){_0x20d922=_0x20d922||0x1f4;return function(_0x10925f){logger[_0x4dab('0x2a')](_0x10925f[_0x4dab('0x2b')]);if(_0x10925f['name']){delete _0x10925f[_0x4dab('0x2c')];}_0x34da6a[_0x4dab('0x1d')](_0x20d922)[_0x4dab('0x2d')](_0x10925f);};}exports[_0x4dab('0x2e')]=function(_0x37450c,_0x2b2e68){var _0x3f88d5={},_0x5c913c={},_0xfff2a0={'count':0x0,'rows':[]};var _0x2e5387=_[_0x4dab('0x2f')](db[_0x4dab('0x30')][_0x4dab('0x31')],function(_0x5baab8){return{'name':_0x5baab8[_0x4dab('0x32')],'type':_0x5baab8[_0x4dab('0x33')][_0x4dab('0x34')]};});_0x5c913c['model']=_[_0x4dab('0x2f')](_0x2e5387,_0x4dab('0x2c'));_0x5c913c['query']=_['keys'](_0x37450c[_0x4dab('0x35')]);_0x5c913c['filters']=_[_0x4dab('0x36')](_0x5c913c[_0x4dab('0x37')],_0x5c913c[_0x4dab('0x35')]);_0x3f88d5['attributes']=_['intersection'](_0x5c913c[_0x4dab('0x37')],qs[_0x4dab('0x38')](_0x37450c[_0x4dab('0x35')]['fields']));_0x3f88d5[_0x4dab('0x39')]=_0x3f88d5[_0x4dab('0x39')][_0x4dab('0x3a')]?_0x3f88d5['attributes']:_0x5c913c[_0x4dab('0x37')];if(!_0x37450c[_0x4dab('0x35')][_0x4dab('0x3b')]('nolimit')){_0x3f88d5['limit']=qs[_0x4dab('0x22')](_0x37450c[_0x4dab('0x35')][_0x4dab('0x22')]);_0x3f88d5[_0x4dab('0x1f')]=qs[_0x4dab('0x1f')](_0x37450c['query'][_0x4dab('0x1f')]);}_0x3f88d5[_0x4dab('0x3c')]=qs[_0x4dab('0x3d')](_0x37450c[_0x4dab('0x35')][_0x4dab('0x3d')]);_0x3f88d5['where']=qs['filters'](_[_0x4dab('0x3e')](_0x37450c[_0x4dab('0x35')],_0x5c913c['filters']),_0x2e5387);if(_0x37450c[_0x4dab('0x35')][_0x4dab('0x3f')]){_0x3f88d5['where']=_[_0x4dab('0x40')](_0x3f88d5[_0x4dab('0x41')],{'$or':_['map'](_0x2e5387,function(_0x2d2340){if(_0x2d2340[_0x4dab('0x33')]!==_0x4dab('0x42')){var _0x172993={};_0x172993[_0x2d2340['name']]={'$like':'%'+_0x37450c[_0x4dab('0x35')]['filter']+'%'};return _0x172993;}})});}_0x3f88d5=_[_0x4dab('0x40')]({},_0x3f88d5,_0x37450c['options']);var _0x27114e={'where':_0x3f88d5[_0x4dab('0x41')]};return db['ChatTransferReport'][_0x4dab('0x21')](_0x27114e)[_0x4dab('0x28')](function(_0x134b92){_0xfff2a0['count']=_0x134b92;if(_0x37450c[_0x4dab('0x35')][_0x4dab('0x43')]){_0x3f88d5[_0x4dab('0x44')]=[{'all':!![]}];}return db[_0x4dab('0x30')][_0x4dab('0x45')](_0x3f88d5);})[_0x4dab('0x28')](function(_0x477120){_0xfff2a0[_0x4dab('0x46')]=_0x477120;return _0xfff2a0;})['then'](respondWithFilteredResult(_0x2b2e68,_0x3f88d5))[_0x4dab('0x47')](handleError(_0x2b2e68,null));};exports[_0x4dab('0x48')]=function(_0x41195f,_0x2798c9){var _0x71a014={'raw':!![],'where':{'id':_0x41195f[_0x4dab('0x49')]['id']}},_0x490bd9={};_0x490bd9['model']=_['keys'](db['ChatTransferReport'][_0x4dab('0x31')]);_0x490bd9[_0x4dab('0x35')]=_[_0x4dab('0x4a')](_0x41195f['query']);_0x490bd9[_0x4dab('0x4b')]=_[_0x4dab('0x36')](_0x490bd9['model'],_0x490bd9['query']);_0x71a014[_0x4dab('0x39')]=_[_0x4dab('0x36')](_0x490bd9[_0x4dab('0x37')],qs[_0x4dab('0x38')](_0x41195f['query'][_0x4dab('0x38')]));_0x71a014[_0x4dab('0x39')]=_0x71a014['attributes'][_0x4dab('0x3a')]?_0x71a014[_0x4dab('0x39')]:_0x490bd9[_0x4dab('0x37')];if(_0x41195f['query'][_0x4dab('0x43')]){_0x71a014['include']=[{'all':!![]}];}_0x71a014=_[_0x4dab('0x40')]({},_0x71a014,_0x41195f[_0x4dab('0x4c')]);return db[_0x4dab('0x30')]['find'](_0x71a014)[_0x4dab('0x28')](handleEntityNotFound(_0x2798c9,null))[_0x4dab('0x28')](respondWithResult(_0x2798c9,null))[_0x4dab('0x47')](handleError(_0x2798c9,null));};exports[_0x4dab('0x4d')]=function(_0xa414b5,_0x429adf){return db[_0x4dab('0x30')]['create'](_0xa414b5[_0x4dab('0x4e')],{})[_0x4dab('0x28')](respondWithResult(_0x429adf,0xc9))[_0x4dab('0x47')](handleError(_0x429adf,null));};exports[_0x4dab('0x27')]=function(_0x18d84a,_0x733de){if(_0x18d84a['body']['id']){delete _0x18d84a[_0x4dab('0x4e')]['id'];}return db[_0x4dab('0x30')]['find']({'where':{'id':_0x18d84a[_0x4dab('0x49')]['id']}})[_0x4dab('0x28')](handleEntityNotFound(_0x733de,null))['then'](saveUpdates(_0x18d84a['body'],null))[_0x4dab('0x28')](respondWithResult(_0x733de,null))['catch'](handleError(_0x733de,null));};exports[_0x4dab('0x29')]=function(_0x5dff65,_0x36e5ed){return db['ChatTransferReport'][_0x4dab('0x4f')]({'where':{'id':_0x5dff65['params']['id']}})['then'](handleEntityNotFound(_0x36e5ed,null))[_0x4dab('0x28')](removeEntity(_0x36e5ed,null))[_0x4dab('0x47')](handleError(_0x36e5ed,null));};exports[_0x4dab('0x50')]=function(_0x1eb3a2,_0x416323){return db['ChatTransferReport'][_0x4dab('0x50')]()[_0x4dab('0x28')](respondWithResult(_0x416323,null))[_0x4dab('0x47')](handleError(_0x416323,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e13e15b..77d10cf 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 _0xbe0d=['rimraf','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xbe0d,0x11a));var _0xdbe0=function(_0x2477b1,_0x3aedce){_0x2477b1=_0x2477b1-0x0;var _0x349bf7=_0xbe0d[_0x2477b1];return _0x349bf7;};'use strict';var _=require(_0xdbe0('0x0'));var util=require(_0xdbe0('0x1'));var logger=require(_0xdbe0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdbe0('0x3'));var rp=require(_0xdbe0('0x4'));var fs=require('fs');var path=require(_0xdbe0('0x5'));var rimraf=require(_0xdbe0('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbe0('0x7'));module[_0xdbe0('0x8')]=function(_0x4a5479,_0x5878c2){return _0x4a5479[_0xdbe0('0x9')]('ChatTransferReport',attributes,{'tableName':_0xdbe0('0xa'),'paranoid':![],'indexes':[{'name':_0xdbe0('0xb'),'fields':[_0xdbe0('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfa1=['api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x27d217,_0x475037){var _0x5cef01=function(_0x1f66a3){while(--_0x1f66a3){_0x27d217['push'](_0x27d217['shift']());}};_0x5cef01(++_0x475037);}(_0xcfa1,0x80));var _0x1cfa=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcfa1[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1cfa('0x0'));var util=require(_0x1cfa('0x1'));var logger=require('../../config/logger')(_0x1cfa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1cfa('0x3'));var fs=require('fs');var path=require(_0x1cfa('0x4'));var rimraf=require(_0x1cfa('0x5'));var config=require(_0x1cfa('0x6'));var attributes=require(_0x1cfa('0x7'));module[_0x1cfa('0x8')]=function(_0x2a793c,_0xd5a873){return _0x2a793c[_0x1cfa('0x9')](_0x1cfa('0xa'),attributes,{'tableName':_0x1cfa('0xb'),'paranoid':![],'indexes':[{'name':_0x1cfa('0xc'),'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 7cb7c13..2dbffd7 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 _0x9967=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','result','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x9967,0x86));var _0x7996=function(_0x31b9ca,_0x48585d){_0x31b9ca=_0x31b9ca-0x0;var _0x26ad47=_0x9967[_0x31b9ca];return _0x26ad47;};'use strict';var _=require(_0x7996('0x0'));var util=require('util');var moment=require(_0x7996('0x1'));var BPromise=require(_0x7996('0x2'));var rs=require(_0x7996('0x3'));var fs=require('fs');var Redis=require(_0x7996('0x4'));var db=require(_0x7996('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7996('0x6'));var client=jayson[_0x7996('0x7')][_0x7996('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9503a3,_0x3025da,_0x4d999d){return new BPromise(function(_0x581d4a,_0x887389){return client[_0x7996('0x9')](_0x9503a3,_0x4d999d)[_0x7996('0xa')](function(_0x59c3f6){logger[_0x7996('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x3025da,_0x7996('0xc'));logger['debug'](_0x7996('0xd'),_0x3025da,_0x7996('0xc'),JSON[_0x7996('0xe')](_0x59c3f6));if(_0x59c3f6[_0x7996('0xf')]){if(_0x59c3f6[_0x7996('0xf')][_0x7996('0x10')]===0x1f4){logger[_0x7996('0xf')](_0x7996('0x11'),_0x3025da,_0x59c3f6[_0x7996('0xf')]['message']);return _0x887389(_0x59c3f6[_0x7996('0xf')]['message']);}logger['error'](_0x7996('0x11'),_0x3025da,_0x59c3f6['error']['message']);return _0x581d4a(_0x59c3f6['error']['message']);}else{logger[_0x7996('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x3025da,_0x7996('0xc'));_0x581d4a(_0x59c3f6[_0x7996('0x12')][_0x7996('0x13')]);}})[_0x7996('0x14')](function(_0x4dadad){logger['error'](_0x7996('0x11'),_0x3025da,_0x4dadad);_0x887389(_0x4dadad);});});}
\ No newline at end of file
+var _0x01de=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x35a049,_0x58e987){var _0x272abc=function(_0x1cf89a){while(--_0x1cf89a){_0x35a049['push'](_0x35a049['shift']());}};_0x272abc(++_0x58e987);}(_0x01de,0x81));var _0xe01d=function(_0x3b3f6c,_0x3315f4){_0x3b3f6c=_0x3b3f6c-0x0;var _0x1b7f33=_0x01de[_0x3b3f6c];return _0x1b7f33;};'use strict';var _=require('lodash');var util=require(_0xe01d('0x0'));var moment=require(_0xe01d('0x1'));var BPromise=require(_0xe01d('0x2'));var rs=require(_0xe01d('0x3'));var fs=require('fs');var Redis=require(_0xe01d('0x4'));var db=require(_0xe01d('0x5'))['db'];var utils=require(_0xe01d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe01d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe01d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21ba82,_0x5b3503,_0x5f0bad){return new BPromise(function(_0x2a857b,_0x27f92e){return client[_0xe01d('0x9')](_0x21ba82,_0x5f0bad)[_0xe01d('0xa')](function(_0x113738){logger[_0xe01d('0xb')](_0xe01d('0xc'),_0x5b3503,_0xe01d('0xd'));logger[_0xe01d('0xe')](_0xe01d('0xf'),_0x5b3503,'request\x20sent',JSON[_0xe01d('0x10')](_0x113738));if(_0x113738[_0xe01d('0x11')]){if(_0x113738[_0xe01d('0x11')][_0xe01d('0x12')]===0x1f4){logger[_0xe01d('0x11')](_0xe01d('0xc'),_0x5b3503,_0x113738[_0xe01d('0x11')][_0xe01d('0x13')]);return _0x27f92e(_0x113738[_0xe01d('0x11')][_0xe01d('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5b3503,_0x113738['error']['message']);return _0x2a857b(_0x113738['error'][_0xe01d('0x13')]);}else{logger[_0xe01d('0xb')](_0xe01d('0xc'),_0x5b3503,_0xe01d('0xd'));_0x2a857b(_0x113738[_0xe01d('0x14')][_0xe01d('0x13')]);}})[_0xe01d('0x15')](function(_0x317b40){logger[_0xe01d('0x11')](_0xe01d('0xc'),_0x5b3503,_0x317b40);_0x27f92e(_0x317b40);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 06ee983..ef8d2bb 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 _0x4bdc=['index','/describe','describe','show','create','put','/:id','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x51e18a,_0x1f1dcc){var _0x375376=function(_0x43002c){while(--_0x43002c){_0x51e18a['push'](_0x51e18a['shift']());}};_0x375376(++_0x1f1dcc);}(_0x4bdc,0x1d7));var _0xc4bd=function(_0x13f9c0,_0x287bd4){_0x13f9c0=_0x13f9c0-0x0;var _0x100b86=_0x4bdc[_0x13f9c0];return _0x100b86;};'use strict';var multer=require('multer');var util=require(_0xc4bd('0x0'));var path=require(_0xc4bd('0x1'));var timeout=require(_0xc4bd('0x2'));var express=require(_0xc4bd('0x3'));var router=express[_0xc4bd('0x4')]();var fs_extra=require(_0xc4bd('0x5'));var auth=require(_0xc4bd('0x6'));var interaction=require(_0xc4bd('0x7'));var config=require(_0xc4bd('0x8'));var controller=require(_0xc4bd('0x9'));router[_0xc4bd('0xa')]('/',auth[_0xc4bd('0xb')](),controller[_0xc4bd('0xc')]);router[_0xc4bd('0xa')](_0xc4bd('0xd'),auth[_0xc4bd('0xb')](),controller[_0xc4bd('0xe')]);router[_0xc4bd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc4bd('0xf')]);router['post']('/',auth[_0xc4bd('0xb')](),controller[_0xc4bd('0x10')]);router[_0xc4bd('0x11')](_0xc4bd('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xc4bd('0x13')](_0xc4bd('0x12'),auth[_0xc4bd('0xb')](),controller['destroy']);module[_0xc4bd('0x14')]=router;
\ No newline at end of file
+var _0x25a4=['/:id','show','isAuthenticated','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','describe','get'];(function(_0x3f3bd7,_0x361f3b){var _0x688ea2=function(_0x419d9c){while(--_0x419d9c){_0x3f3bd7['push'](_0x3f3bd7['shift']());}};_0x688ea2(++_0x361f3b);}(_0x25a4,0x9b));var _0x425a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x25a4[_0x9df060];return _0x338dfe;};'use strict';var multer=require('multer');var util=require(_0x425a('0x0'));var path=require(_0x425a('0x1'));var timeout=require(_0x425a('0x2'));var express=require(_0x425a('0x3'));var router=express[_0x425a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x425a('0x5'));var interaction=require(_0x425a('0x6'));var config=require(_0x425a('0x7'));var controller=require(_0x425a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x425a('0x9')]);router['get'](_0x425a('0xa'),auth['isAuthenticated'](),controller[_0x425a('0xb')]);router[_0x425a('0xc')](_0x425a('0xd'),auth['isAuthenticated'](),controller[_0x425a('0xe')]);router['post']('/',auth[_0x425a('0xf')](),controller[_0x425a('0x10')]);router[_0x425a('0x11')](_0x425a('0xd'),auth[_0x425a('0xf')](),controller[_0x425a('0x12')]);router[_0x425a('0x13')](_0x425a('0xd'),auth[_0x425a('0xf')](),controller[_0x425a('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 018f542..3d904fd 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 _0xd008=['parse','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','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','ENUM','rounded','squared','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Feedback','star','input','name','getDataValue','onlineForm'];(function(_0x296da0,_0x4d4ea8){var _0x816ff3=function(_0x52d1ff){while(--_0x52d1ff){_0x296da0['push'](_0x296da0['shift']());}};_0x816ff3(++_0x4d4ea8);}(_0xd008,0xa8));var _0x8d00=function(_0x1a4549,_0xd9e730){_0x1a4549=_0x1a4549-0x0;var _0xca9a7f=_0xd008[_0x1a4549];return _0xca9a7f;};'use strict';var Sequelize=require(_0x8d00('0x0'));var rs=require(_0x8d00('0x1'));module[_0x8d00('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x8d00('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x8d00('0x3')]},'mapKey':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x4')},'mapKeyOffline':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x8d00('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x5')},'customerAlias':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8d00('0x3')],'allowNull':![],'defaultValue':_0x8d00('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8d00('0x3')],'allowNull':![],'defaultValue':_0x8d00('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8d00('0x3')],'allowNull':![],'defaultValue':_0x8d00('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8d00('0x3')],'allowNull':![],'defaultValue':_0x8d00('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8d00('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8d00('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8d00('0x9')](_0x8d00('0xa'),_0x8d00('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0xc')},'download_transcript':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8d00('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8d00('0xf')]},'closingQuestion':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8d00('0x12')},'placeholderMessage':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x13')},'closingMessage':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8d00('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x16')},'ratingType':{'type':Sequelize[_0x8d00('0x9')](_0x8d00('0x17'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x8d00('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8d00('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8d00('0x18'),'variable':null,'config':{'placeholder':_0x8d00('0x19'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8d00('0x18'),'props':{'title':_0x8d00('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8d00('0x4'),'type':_0x8d00('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8d00('0x1a')](_0x8d00('0x1b'))?JSON[_0x8d00('0x1c')](this[_0x8d00('0x1a')](_0x8d00('0x1b'))):{};},'set':function(_0x41d2a7){return this['setDataValue']('onlineForm',JSON[_0x8d00('0x1d')](_0x41d2a7));}},'offlineForm':{'type':Sequelize[_0x8d00('0xf')],'defaultValue':function(){return JSON[_0x8d00('0x1d')]({'items':[{'type':_0x8d00('0x18'),'props':{'title':_0x8d00('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8d00('0x4'),'type':_0x8d00('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x8d00('0x1e')},'props':{'title':_0x8d00('0x1e'),'helpText':_0x8d00('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8d00('0x20'))?JSON[_0x8d00('0x1c')](this[_0x8d00('0x1a')](_0x8d00('0x20'))):{};},'set':function(_0x7b27cb){return this['setDataValue'](_0x8d00('0x20'),JSON[_0x8d00('0x1d')](_0x7b27cb));}},'token':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':function(){return rs[_0x8d00('0x21')]();}},'autoclose':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8d00('0x3')]},'forwardOffline':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8d00('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x8d00('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x23')},'skipUnmanaged':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x15')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8d00('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8d00('0xf')],'defaultValue':function(){return _0x8d00('0x24');}},'notificationSound':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x8d00('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8d00('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8d00('0x26')},'verticalAlignment':{'type':Sequelize[_0x8d00('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':_0x8d00('0x27')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x8d00('0x28')},'defaultTitle':{'type':Sequelize[_0x8d00('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8d00('0x3')],'allowNull':![],'defaultValue':_0x8d00('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8d00('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x8d00('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8d00('0x8')],'comment':_0x8d00('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![],'comment':_0x8d00('0x2b'),'set':function(_0x3e31f5){if(!_0x3e31f5)this[_0x8d00('0x2c')](_0x8d00('0x2d'),null);this[_0x8d00('0x2c')](_0x8d00('0x2e'),_0x3e31f5);}},'vidaooEscalation':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8d00('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8d00('0x2f')},'vidaooNote':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':function(){return _0x8d00('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x8d00('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8d00('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8d00('0xf')]}};
\ No newline at end of file
+var _0xea96=['mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','stringify','name','text','input','onlineForm','parse','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea96,0x183));var _0x6ea9=function(_0x4b835c,_0xa85bb1){_0x4b835c=_0x4b835c-0x0;var _0x18e7f2=_0xea96[_0x4b835c];return _0x18e7f2;};'use strict';var Sequelize=require(_0x6ea9('0x0'));var rs=require(_0x6ea9('0x1'));module['exports']={'name':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'unique':_0x6ea9('0x3')},'description':{'type':Sequelize[_0x6ea9('0x2')]},'mapKey':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x4')},'key':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ea9('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6ea9('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6ea9('0x2')]},'animation':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6ea9('0xa')](_0x6ea9('0xb'),'squared'),'defaultValue':_0x6ea9('0xb')},'header_online':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xc')},'start_chat_button':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xd')},'offline_chat_button':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6ea9('0x10')]},'closingQuestion':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x13')},'noteTitle':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x16')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x6ea9('0x18'),'thumb'),'defaultValue':_0x6ea9('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':function(){return JSON[_0x6ea9('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6ea9('0x1a'),'type':_0x6ea9('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6ea9('0x1c'),'props':{'title':_0x6ea9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6ea9('0x4'),'type':_0x6ea9('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6ea9('0x1d'))?JSON[_0x6ea9('0x1e')](this[_0x6ea9('0x1f')](_0x6ea9('0x1d'))):{};},'set':function(_0x3c7e68){return this['setDataValue']('onlineForm',JSON[_0x6ea9('0x19')](_0x3c7e68));}},'offlineForm':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':function(){return JSON[_0x6ea9('0x19')]({'items':[{'type':_0x6ea9('0x1c'),'props':{'title':_0x6ea9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6ea9('0x4'),'type':_0x6ea9('0x4')},'variable':null},{'type':_0x6ea9('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x6ea9('0x21'),'helpText':_0x6ea9('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x6ea9('0x1f')](_0x6ea9('0x23'))?JSON[_0x6ea9('0x1e')](this['getDataValue'](_0x6ea9('0x23'))):{};},'set':function(_0x1ef0ec){return this['setDataValue'](_0x6ea9('0x23'),JSON[_0x6ea9('0x19')](_0x1ef0ec));}},'token':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6ea9('0x2')]},'forwardOffline':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x26')},'skipUnmanaged':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x16')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6ea9('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6ea9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':function(){return _0x6ea9('0x27');}},'notificationSound':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x6ea9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':_0x6ea9('0x29')},'verticalAlignment':{'type':Sequelize[_0x6ea9('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x6ea9('0x2')]},'customerAvatar':{'type':Sequelize[_0x6ea9('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6ea9('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6ea9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ea9('0x8')],'comment':_0x6ea9('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6ea9('0x2b'),'set':function(_0x13460b){if(!_0x13460b)this[_0x6ea9('0x2c')](_0x6ea9('0x2d'),null);this[_0x6ea9('0x2c')]('mandatoryDisposition',_0x13460b);}},'vidaooEscalation':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6ea9('0x2')]},'vidaooTopic':{'type':Sequelize[_0x6ea9('0x2')],'allowNull':![],'defaultValue':_0x6ea9('0x2e')},'vidaooNote':{'type':Sequelize[_0x6ea9('0x2')],'defaultValue':function(){return _0x6ea9('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x6ea9('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6ea9('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6ea9('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 6362e8e..b4fd1ba 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 _0x5d26=['includes','mapKey','CmList','List','updatedAt','DESC','Applications','Interval','list','orderBy','priority','asc','account','defaults','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','lastName','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','waitForTheAssignedAgent','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','CloudProvider','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','Smtp','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','fullname','internal','Tag','color','tag','virtual','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','ejs','fs-extra','querystring','html-to-text','ioredis','url','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','UserProfileResource','stack','name','send','Command','getSnippet','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','timezone','No\x20timezone','catch','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','map','Intervals','some','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','type','Pause','mandatoryDispositionPause','rawAttributes','fieldName','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','ChatWebsite','findAll','rows','show','params','intersection','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','find','autoAssociation','update','addDisposition','Disposition','getDispositions','findOne','removeDispositions','ids','ChatWebsiteId','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5d26,0x85));var _0x65d2=function(_0x15d1eb,_0x59bba1){_0x15d1eb=_0x15d1eb-0x0;var _0xfc710d=_0x5d26[_0x15d1eb];return _0xfc710d;};'use strict';var Mustache=require('mustache');var util=require(_0x65d2('0x0'));var path=require('path');var ejs=require(_0x65d2('0x1'));var fs=require('fs');var fs_extra=require(_0x65d2('0x2'));var _=require('lodash');var querystring=require(_0x65d2('0x3'));var htmlToText=require(_0x65d2('0x4'));var Redis=require(_0x65d2('0x5'));var jayson=require('jayson/promise');var url=require(_0x65d2('0x6'));var qs=require(_0x65d2('0x7'));var logger=require('../../config/logger')(_0x65d2('0x8'));var config=require(_0x65d2('0x9'));var APIOutOfIntervalError=require(_0x65d2('0xa'))[_0x65d2('0xb')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0x65d2('0xa'))[_0x65d2('0xc')];var db=require(_0x65d2('0xd'))['db'];config[_0x65d2('0xe')]=_['defaults'](config[_0x65d2('0xe')],{'host':_0x65d2('0xf'),'port':0x18eb});var socket=require(_0x65d2('0x10'))(new Redis(config[_0x65d2('0xe')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0x65d2('0x11')][_0x65d2('0x12')]({'port':0x232c});var client9002=jayson[_0x65d2('0x11')][_0x65d2('0x12')]({'port':0x232a});var client9003=jayson[_0x65d2('0x11')][_0x65d2('0x12')]({'port':0x232b});var client9001=jayson[_0x65d2('0x11')][_0x65d2('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x2fd7bb,_0x300ce6,_0x438101,_0xce7da3){return new Promise(function(_0x3bdebc,_0x4b63d6){var _0x40f45b=_0xce7da3||client;return _0x40f45b[_0x65d2('0x13')](_0x2fd7bb,_0x438101)[_0x65d2('0x14')](function(_0x33ab32){logger[_0x65d2('0x15')](_0x65d2('0x16'),_0x300ce6,'request\x20sent');logger[_0x65d2('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x300ce6,_0x65d2('0x18'),JSON[_0x65d2('0x19')](_0x33ab32));if(_0x33ab32[_0x65d2('0x1a')]){if(_0x33ab32['error']['code']===0x1f4){logger['error'](_0x65d2('0x16'),_0x300ce6,_0x33ab32[_0x65d2('0x1a')]['message']);return _0x4b63d6(_0x33ab32['error'][_0x65d2('0x1b')]);}logger[_0x65d2('0x1a')](_0x65d2('0x16'),_0x300ce6,_0x33ab32['error'][_0x65d2('0x1b')]);return _0x3bdebc(_0x33ab32['error']['message']);}else{logger[_0x65d2('0x15')](_0x65d2('0x16'),_0x300ce6,_0x65d2('0x18'));_0x3bdebc(_0x33ab32[_0x65d2('0x1c')][_0x65d2('0x1b')]);}})['catch'](function(_0x400cd6){logger[_0x65d2('0x1a')](_0x65d2('0x16'),_0x300ce6,_0x400cd6);_0x4b63d6(_0x400cd6);});});}function respondWithStatusCode(_0x59da24,_0x201b1f){_0x201b1f=_0x201b1f||0xcc;return function(_0x1db9d8){if(_0x1db9d8){return _0x59da24[_0x65d2('0x1d')](_0x201b1f);}return _0x59da24[_0x65d2('0x1e')](_0x201b1f)[_0x65d2('0x1f')]();};}function respondWithResult(_0x4c59b9,_0x3d6685){_0x3d6685=_0x3d6685||0xc8;return function(_0x4a3fb2){if(_0x4a3fb2){return _0x4c59b9[_0x65d2('0x1e')](_0x3d6685)[_0x65d2('0x20')](_0x4a3fb2);}};}function respondWithFilteredResult(_0x2fcadf,_0x2393c0){return function(_0x1d9918){if(_0x1d9918){var _0x191d6e=typeof _0x2393c0[_0x65d2('0x21')]===_0x65d2('0x22')&&typeof _0x2393c0[_0x65d2('0x23')]==='undefined';var _0x78e448=_0x1d9918[_0x65d2('0x24')];var _0x19f46e=_0x191d6e?0x0:_0x2393c0[_0x65d2('0x21')];var _0x34b5cd=_0x191d6e?_0x1d9918[_0x65d2('0x24')]:_0x2393c0['offset']+_0x2393c0[_0x65d2('0x23')];var _0x5265f9;if(_0x34b5cd>=_0x78e448){_0x34b5cd=_0x78e448;_0x5265f9=0xc8;}else{_0x5265f9=0xce;}_0x2fcadf['status'](_0x5265f9);return _0x2fcadf[_0x65d2('0x25')](_0x65d2('0x26'),_0x19f46e+'-'+_0x34b5cd+'/'+_0x78e448)[_0x65d2('0x20')](_0x1d9918);}return null;};}function saveUpdates(_0x45beb0){return function(_0x1c1ec9){if(_0x1c1ec9){return _0x1c1ec9['update'](_0x45beb0)[_0x65d2('0x14')](function(_0x344fe8){return _0x344fe8;});}return null;};}function removeEntity(_0x58b464){return function(_0x1c1877){if(_0x1c1877){return _0x1c1877[_0x65d2('0x27')]()['then'](function(){var _0x51d45d=_0x1c1877['get']({'plain':!![]});var _0xc67ec9='ChatWebsites';return db[_0x65d2('0x28')][_0x65d2('0x27')]({'where':{'type':_0xc67ec9,'resourceId':_0x51d45d['id']}})['then'](function(){return _0x1c1877;});})[_0x65d2('0x14')](function(){_0x58b464[_0x65d2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a27a7){return function(_0x47a929){if(!_0x47a929){_0x5a27a7[_0x65d2('0x1d')](0x194);}return _0x47a929;};}function handleError(_0x1828a0,_0x26a2b3){_0x26a2b3=_0x26a2b3||0x1f4;return function(_0x3cbba6){logger[_0x65d2('0x1a')](_0x3cbba6[_0x65d2('0x29')]);if(_0x3cbba6[_0x65d2('0x2a')]){delete _0x3cbba6[_0x65d2('0x2a')];}_0x1828a0[_0x65d2('0x1e')](_0x26a2b3)[_0x65d2('0x2b')](_0x3cbba6);};}function iftimePromise(_0x18244b,_0x3247f6){return respondWithRpcPromise(_0x65d2('0x2c'),_0x65d2('0x2d'),{'command':_0x3247f6['timezone']?util[_0x65d2('0x2e')](_0x65d2('0x2f'),_0x18244b[_0x65d2('0x30')],_0x3247f6['timezone']):util[_0x65d2('0x2e')](_0x65d2('0x31'),_0x18244b[_0x65d2('0x30')])},client9002)[_0x65d2('0x14')](function(_0x3b5a22){var _0x2842ce=_0x3b5a22&&_0x3b5a22[_0x65d2('0x32')](_0x65d2('0x33'))>=0x0?!![]:![];logger[_0x65d2('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3247f6['id'],_0x18244b['id'],_0x18244b[_0x65d2('0x30')],_0x2842ce?'ONLINE':'OFFLINE',_0x3247f6[_0x65d2('0x34')]?_0x3247f6[_0x65d2('0x34')]:_0x65d2('0x35'));return _0x2842ce;})[_0x65d2('0x36')](function(_0x148c66){logger[_0x65d2('0x1a')](_0x65d2('0x37'),_0x3247f6['id'],_0x18244b['id'],_0x18244b['interval'],util[_0x65d2('0x38')](_0x148c66,{'showHidden':![],'depth':null}),_0x3247f6[_0x65d2('0x34')]?_0x3247f6[_0x65d2('0x34')]:_0x65d2('0x35'));return![];});}function checkWebsiteIntervals(_0x40d572){var _0x31cd22=_[_0x65d2('0x39')](_0x40d572['Interval'][_0x65d2('0x3a')],function(_0x51948c){var _0x6e6ea2=_0x51948c['get']({'plain':!![]});return iftimePromise(_0x6e6ea2,_0x40d572);});return Promise['all'](_0x31cd22)['then'](function(_0x431a1f){return _[_0x65d2('0x3b')](_0x431a1f);});}function createInteractionObject(_0x4a4c27,_0x21ea8a,_0x5c05d5,_0x3c768c){var _0x17b330=require('user-agent-parser');var _0x1225af=new _0x17b330();var _0x269333=_0x1225af['setUA'](_0x5c05d5[_0x65d2('0x3c')])[_0x65d2('0x3d')]();var _0x21b6d1=_0x21ea8a[_0x65d2('0x3e')];if(_0x5c05d5[_0x65d2('0x3f')]){_0x21b6d1=_0x5c05d5[_0x65d2('0x3f')];}else if(_0x5c05d5[_0x65d2('0x40')]){_0x21b6d1=_[_0x65d2('0x41')](_0x5c05d5[_0x65d2('0x40')][_0x65d2('0x42')](','));}return{'ContactId':_0x3c768c['id'],'ChatWebsiteId':_0x4a4c27,'from':(_0x3c768c[_0x65d2('0x43')]||'')+'\x20'+(_0x3c768c['lastName']||''),'customerIp':_0x21b6d1,'customerPort':_0x5c05d5[_0x65d2('0x44')]?_0x5c05d5[_0x65d2('0x44')]:null,'referer':_0x21ea8a[_0x65d2('0x45')],'browserName':_0x269333[_0x65d2('0x46')][_0x65d2('0x2a')]&&_0x269333[_0x65d2('0x46')][_0x65d2('0x47')]?util[_0x65d2('0x2e')](_0x65d2('0x48'),_0x269333[_0x65d2('0x46')]['name'],_0x269333[_0x65d2('0x46')]['version']):_0x65d2('0x49'),'browserVersion':_0x269333[_0x65d2('0x46')][_0x65d2('0x47')]||_0x65d2('0x49'),'osName':util[_0x65d2('0x2e')](_0x65d2('0x48'),_0x269333['os'][_0x65d2('0x2a')],_0x269333['os']['version']),'osVersion':_0x269333['os'][_0x65d2('0x47')],'deviceModel':_0x269333[_0x65d2('0x4a')][_0x65d2('0x4b')]&&_0x269333[_0x65d2('0x4a')][_0x65d2('0x4c')]?util['format']('%s\x20%s\x20%s',_0x269333[_0x65d2('0x4a')][_0x65d2('0x4b')],_0x269333['device'][_0x65d2('0x4c')],_0x269333['device']['type']):null,'deviceVendor':_0x269333['device'][_0x65d2('0x4c')],'deviceType':_0x269333['device'][_0x65d2('0x4d')],'formData':JSON['stringify'](_0x21ea8a)};}exports['index']=function(_0x45db0f,_0x30df0c){var _0x4c0ff6={'include':[{'model':db[_0x65d2('0x4e')],'as':_0x65d2('0x4f')}]},_0x57de17={},_0x41334e={'count':0x0,'rows':[]};var _0x2e3cd9=_[_0x65d2('0x39')](db['ChatWebsite'][_0x65d2('0x50')],function(_0x1a15b1){return{'name':_0x1a15b1[_0x65d2('0x51')],'type':_0x1a15b1[_0x65d2('0x4d')]['key']};});_0x57de17[_0x65d2('0x4b')]=_[_0x65d2('0x39')](_0x2e3cd9,_0x65d2('0x2a'));_0x57de17[_0x65d2('0x52')]=_[_0x65d2('0x53')](_0x45db0f[_0x65d2('0x52')]);_0x57de17[_0x65d2('0x54')]=_['intersection'](_0x57de17[_0x65d2('0x4b')],_0x57de17[_0x65d2('0x52')]);_0x4c0ff6[_0x65d2('0x55')]=_['intersection'](_0x57de17[_0x65d2('0x4b')],qs['fields'](_0x45db0f[_0x65d2('0x52')][_0x65d2('0x56')]));_0x4c0ff6[_0x65d2('0x55')]=_0x4c0ff6[_0x65d2('0x55')][_0x65d2('0x57')]?_0x4c0ff6['attributes']:_0x57de17[_0x65d2('0x4b')];if(!_0x45db0f['query'][_0x65d2('0x58')](_0x65d2('0x59'))){_0x4c0ff6[_0x65d2('0x23')]=qs[_0x65d2('0x23')](_0x45db0f[_0x65d2('0x52')][_0x65d2('0x23')]);_0x4c0ff6[_0x65d2('0x21')]=qs['offset'](_0x45db0f[_0x65d2('0x52')][_0x65d2('0x21')]);}_0x4c0ff6[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x45db0f[_0x65d2('0x52')]['sort']);_0x4c0ff6['where']=qs[_0x65d2('0x54')](_[_0x65d2('0x5c')](_0x45db0f[_0x65d2('0x52')],_0x57de17[_0x65d2('0x54')]),_0x2e3cd9);if(_0x45db0f['query'][_0x65d2('0x5d')]){_0x4c0ff6['where']=_[_0x65d2('0x5e')](_0x4c0ff6[_0x65d2('0x5f')],{'$or':_[_0x65d2('0x39')](_0x2e3cd9,function(_0x4526a8){if(_0x4526a8[_0x65d2('0x4d')]!==_0x65d2('0x60')){var _0x2cbc75={};_0x2cbc75[_0x4526a8[_0x65d2('0x2a')]]={'$like':'%'+_0x45db0f[_0x65d2('0x52')][_0x65d2('0x5d')]+'%'};return _0x2cbc75;}})});}_0x4c0ff6=_[_0x65d2('0x5e')]({},_0x4c0ff6,_0x45db0f[_0x65d2('0x61')]);var _0x44cf04={'where':_0x4c0ff6[_0x65d2('0x5f')]};return db[_0x65d2('0x62')][_0x65d2('0x24')](_0x44cf04)[_0x65d2('0x14')](function(_0x2132f4){_0x41334e[_0x65d2('0x24')]=_0x2132f4;if(_0x45db0f[_0x65d2('0x52')]['includeAll']){_0x4c0ff6['include']=[{'all':!![]}];}return db[_0x65d2('0x62')][_0x65d2('0x63')](_0x4c0ff6);})[_0x65d2('0x14')](function(_0x27b473){_0x41334e[_0x65d2('0x64')]=_0x27b473;return _0x41334e;})['then'](respondWithFilteredResult(_0x30df0c,_0x4c0ff6))[_0x65d2('0x36')](handleError(_0x30df0c,null));};exports[_0x65d2('0x65')]=function(_0x56c5d7,_0x4e8684){var _0x4a92aa={'raw':![],'where':{'id':_0x56c5d7[_0x65d2('0x66')]['id']},'include':[{'model':db[_0x65d2('0x4e')],'as':_0x65d2('0x4f')}]},_0x5bcca8={};_0x5bcca8['model']=_['keys'](db['ChatWebsite'][_0x65d2('0x50')]);_0x5bcca8[_0x65d2('0x52')]=_[_0x65d2('0x53')](_0x56c5d7['query']);_0x5bcca8[_0x65d2('0x54')]=_[_0x65d2('0x67')](_0x5bcca8[_0x65d2('0x4b')],_0x5bcca8[_0x65d2('0x52')]);_0x4a92aa[_0x65d2('0x55')]=_['intersection'](_0x5bcca8[_0x65d2('0x4b')],qs[_0x65d2('0x56')](_0x56c5d7[_0x65d2('0x52')][_0x65d2('0x56')]));_0x4a92aa['attributes']=_0x4a92aa[_0x65d2('0x55')][_0x65d2('0x57')]?_0x4a92aa[_0x65d2('0x55')]:_0x5bcca8['model'];if(_0x56c5d7['query'][_0x65d2('0x68')]){_0x4a92aa[_0x65d2('0x69')]=[{'all':!![]}];}_0x4a92aa=_[_0x65d2('0x5e')]({},_0x4a92aa,_0x56c5d7[_0x65d2('0x61')]);return db['ChatWebsite']['find'](_0x4a92aa)['then'](handleEntityNotFound(_0x4e8684,null))[_0x65d2('0x14')](respondWithResult(_0x4e8684,null))['catch'](handleError(_0x4e8684,null));};exports[_0x65d2('0x6a')]=function(_0x58dbbf,_0x2a96c4){return db['ChatWebsite'][_0x65d2('0x6a')](_0x58dbbf[_0x65d2('0x6b')],{})[_0x65d2('0x14')](function(_0x2fe77d){var _0x3b4891=_0x58dbbf[_0x65d2('0x6c')][_0x65d2('0x6d')]({'plain':!![]});if(!_0x3b4891)throw new Error(_0x65d2('0x6e'));if(_0x3b4891[_0x65d2('0x6f')]===_0x65d2('0x6c')){var _0xb9544e=_0x2fe77d[_0x65d2('0x6d')]({'plain':!![]});var _0x168f01=_0x65d2('0x70');return db[_0x65d2('0x71')][_0x65d2('0x72')]({'where':{'name':_0x168f01,'userProfileId':_0x3b4891['userProfileId']},'raw':!![]})[_0x65d2('0x14')](function(_0x86213){if(_0x86213&&_0x86213[_0x65d2('0x73')]===0x0){return db['UserProfileResource'][_0x65d2('0x6a')]({'name':_0xb9544e[_0x65d2('0x2a')],'resourceId':_0xb9544e['id'],'type':_0x86213['name'],'sectionId':_0x86213['id']},{})['then'](function(){return _0x2fe77d;});}else{return _0x2fe77d;}})[_0x65d2('0x36')](function(_0xdfc288){logger[_0x65d2('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdfc288);throw _0xdfc288;});}return _0x2fe77d;})[_0x65d2('0x14')](respondWithResult(_0x2a96c4,0xc9))['catch'](handleError(_0x2a96c4,null));};exports[_0x65d2('0x74')]=function(_0x33ebfd,_0x57a510){if(_0x33ebfd[_0x65d2('0x6b')]['id']){delete _0x33ebfd[_0x65d2('0x6b')]['id'];}return db[_0x65d2('0x62')]['find']({'where':{'id':_0x33ebfd[_0x65d2('0x66')]['id']},'include':[{'model':db[_0x65d2('0x4e')],'as':_0x65d2('0x4f')}]})['then'](handleEntityNotFound(_0x57a510,null))['then'](saveUpdates(_0x33ebfd[_0x65d2('0x6b')],null))[_0x65d2('0x14')](respondWithResult(_0x57a510,null))[_0x65d2('0x36')](handleError(_0x57a510,null));};exports[_0x65d2('0x27')]=function(_0x52f54d,_0x5e7372){return db['ChatWebsite'][_0x65d2('0x72')]({'where':{'id':_0x52f54d[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x5e7372,null))['then'](removeEntity(_0x5e7372,null))[_0x65d2('0x36')](handleError(_0x5e7372,null));};exports['describe']=function(_0x7ef538,_0x5de165){return db[_0x65d2('0x62')]['describe']()[_0x65d2('0x14')](respondWithResult(_0x5de165,null))[_0x65d2('0x36')](handleError(_0x5de165,null));};exports[_0x65d2('0x75')]=function(_0x4964de,_0x3107f8){if(_0x4964de[_0x65d2('0x6b')]['id']){delete _0x4964de[_0x65d2('0x6b')]['id'];}return db['ChatWebsite'][_0x65d2('0x72')]({'where':{'id':_0x4964de[_0x65d2('0x66')]['id']}})['then'](handleEntityNotFound(_0x3107f8,null))[_0x65d2('0x14')](function(_0x6738c8){if(_0x6738c8){_0x4964de[_0x65d2('0x6b')]['ChatWebsiteId']=_0x6738c8['id'];return db[_0x65d2('0x76')]['create'](_0x4964de[_0x65d2('0x6b')]);}})[_0x65d2('0x14')](respondWithResult(_0x3107f8,null))[_0x65d2('0x36')](handleError(_0x3107f8,null));};exports[_0x65d2('0x77')]=function(_0x2c9dd0,_0x42b53e){var _0x520acc={'raw':![],'where':{}};var _0x520b19={};var _0x3add5d={'count':0x0,'rows':[]};return db[_0x65d2('0x62')][_0x65d2('0x78')]({'where':{'id':_0x2c9dd0['params']['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x42b53e,null))[_0x65d2('0x14')](function(_0xc71220){if(_0xc71220){_0x520b19[_0x65d2('0x4b')]=_['keys'](db[_0x65d2('0x76')][_0x65d2('0x50')]);_0x520b19[_0x65d2('0x52')]=_[_0x65d2('0x53')](_0x2c9dd0[_0x65d2('0x52')]);_0x520b19[_0x65d2('0x54')]=_[_0x65d2('0x67')](_0x520b19[_0x65d2('0x4b')],_0x520b19[_0x65d2('0x52')]);_0x520acc[_0x65d2('0x55')]=_[_0x65d2('0x67')](_0x520b19[_0x65d2('0x4b')],qs['fields'](_0x2c9dd0[_0x65d2('0x52')][_0x65d2('0x56')]));_0x520acc[_0x65d2('0x55')]=_0x520acc['attributes']['length']?_0x520acc[_0x65d2('0x55')]:_0x520b19[_0x65d2('0x4b')];if(!_0x2c9dd0[_0x65d2('0x52')][_0x65d2('0x58')]('nolimit')){_0x520acc[_0x65d2('0x23')]=qs[_0x65d2('0x23')](_0x2c9dd0[_0x65d2('0x52')][_0x65d2('0x23')]);_0x520acc[_0x65d2('0x21')]=qs[_0x65d2('0x21')](_0x2c9dd0[_0x65d2('0x52')]['offset']);}_0x520acc[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x2c9dd0[_0x65d2('0x52')][_0x65d2('0x5b')]);_0x520acc[_0x65d2('0x5f')]=qs[_0x65d2('0x54')](_[_0x65d2('0x5c')](_0x2c9dd0[_0x65d2('0x52')],_0x520b19[_0x65d2('0x54')]));_0x520acc[_0x65d2('0x5f')]['ChatWebsiteId']=_0xc71220['id'];if(_0x2c9dd0['query'][_0x65d2('0x5d')]){_0x520acc[_0x65d2('0x5f')]=_[_0x65d2('0x5e')](_0x520acc['where'],{'$or':_[_0x65d2('0x39')](_0x520acc[_0x65d2('0x55')],function(_0x410964){var _0x18cb26={};_0x18cb26[_0x410964]={'$like':'%'+_0x2c9dd0['query'][_0x65d2('0x5d')]+'%'};return _0x18cb26;})});}_0x520acc=_[_0x65d2('0x5e')]({},_0x520acc,_0x2c9dd0[_0x65d2('0x61')]);return db[_0x65d2('0x76')][_0x65d2('0x24')]({'where':_0x520acc['where']})[_0x65d2('0x14')](function(_0x2d32d6){_0x3add5d['count']=_0x2d32d6;if(_0x2c9dd0[_0x65d2('0x52')]['includeAll']){_0x520acc['include']=[{'all':!![]}];}return db[_0x65d2('0x76')][_0x65d2('0x63')](_0x520acc);})[_0x65d2('0x14')](function(_0x305181){_0x3add5d[_0x65d2('0x64')]=_0x305181;return _0x3add5d;});}})[_0x65d2('0x14')](respondWithFilteredResult(_0x42b53e,_0x520acc))['catch'](handleError(_0x42b53e,null));};exports[_0x65d2('0x79')]=function(_0x231bb1,_0x3a7330){return db['ChatWebsite'][_0x65d2('0x72')]({'where':{'id':_0x231bb1['params']['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x3a7330,null))['then'](function(_0x2285a0){if(_0x2285a0){return _0x2285a0['removeDispositions'](_0x231bb1[_0x65d2('0x52')][_0x65d2('0x7a')]);}})[_0x65d2('0x14')](respondWithStatusCode(_0x3a7330,null))[_0x65d2('0x36')](handleError(_0x3a7330,null));};exports['addAnswer']=function(_0xbe7f2a,_0x55bff2){if(_0xbe7f2a[_0x65d2('0x6b')]['id']){delete _0xbe7f2a['body']['id'];}return db[_0x65d2('0x62')][_0x65d2('0x72')]({'where':{'id':_0xbe7f2a[_0x65d2('0x66')]['id']}})['then'](handleEntityNotFound(_0x55bff2,null))[_0x65d2('0x14')](function(_0x1f9c81){if(_0x1f9c81){_0xbe7f2a[_0x65d2('0x6b')][_0x65d2('0x7b')]=_0x1f9c81['id'];return db[_0x65d2('0x7c')]['create'](_0xbe7f2a[_0x65d2('0x6b')]);}})[_0x65d2('0x14')](respondWithResult(_0x55bff2,null))[_0x65d2('0x36')](handleError(_0x55bff2,null));};exports['getAnswers']=function(_0x5b14b2,_0x5c0553){var _0x3b576e={'raw':![],'where':{}};var _0x334064={};var _0x477e82={'count':0x0,'rows':[]};return db[_0x65d2('0x62')][_0x65d2('0x78')]({'where':{'id':_0x5b14b2[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x5c0553,null))[_0x65d2('0x14')](function(_0x4aa41f){if(_0x4aa41f){_0x334064['model']=_[_0x65d2('0x53')](db[_0x65d2('0x7c')][_0x65d2('0x50')]);_0x334064[_0x65d2('0x52')]=_[_0x65d2('0x53')](_0x5b14b2['query']);_0x334064['filters']=_['intersection'](_0x334064[_0x65d2('0x4b')],_0x334064[_0x65d2('0x52')]);_0x3b576e[_0x65d2('0x55')]=_[_0x65d2('0x67')](_0x334064[_0x65d2('0x4b')],qs[_0x65d2('0x56')](_0x5b14b2[_0x65d2('0x52')]['fields']));_0x3b576e[_0x65d2('0x55')]=_0x3b576e[_0x65d2('0x55')][_0x65d2('0x57')]?_0x3b576e['attributes']:_0x334064[_0x65d2('0x4b')];if(!_0x5b14b2[_0x65d2('0x52')][_0x65d2('0x58')]('nolimit')){_0x3b576e[_0x65d2('0x23')]=qs['limit'](_0x5b14b2[_0x65d2('0x52')][_0x65d2('0x23')]);_0x3b576e[_0x65d2('0x21')]=qs[_0x65d2('0x21')](_0x5b14b2[_0x65d2('0x52')][_0x65d2('0x21')]);}_0x3b576e[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x5b14b2[_0x65d2('0x52')]['sort']);_0x3b576e[_0x65d2('0x5f')]=qs[_0x65d2('0x54')](_[_0x65d2('0x5c')](_0x5b14b2['query'],_0x334064[_0x65d2('0x54')]));_0x3b576e['where'][_0x65d2('0x7b')]=_0x4aa41f['id'];if(_0x5b14b2[_0x65d2('0x52')]['filter']){_0x3b576e[_0x65d2('0x5f')]=_['merge'](_0x3b576e[_0x65d2('0x5f')],{'$or':_[_0x65d2('0x39')](_0x3b576e['attributes'],function(_0x11162c){var _0x1c08ac={};_0x1c08ac[_0x11162c]={'$like':'%'+_0x5b14b2[_0x65d2('0x52')][_0x65d2('0x5d')]+'%'};return _0x1c08ac;})});}_0x3b576e=_[_0x65d2('0x5e')]({},_0x3b576e,_0x5b14b2['options']);return db[_0x65d2('0x7c')][_0x65d2('0x24')]({'where':_0x3b576e[_0x65d2('0x5f')]})[_0x65d2('0x14')](function(_0xf146d6){_0x477e82[_0x65d2('0x24')]=_0xf146d6;if(_0x5b14b2[_0x65d2('0x52')][_0x65d2('0x68')]){_0x3b576e['include']=[{'all':!![]}];}return db[_0x65d2('0x7c')][_0x65d2('0x63')](_0x3b576e);})['then'](function(_0x355feb){_0x477e82['rows']=_0x355feb;return _0x477e82;});}})[_0x65d2('0x14')](respondWithFilteredResult(_0x5c0553,_0x3b576e))[_0x65d2('0x36')](handleError(_0x5c0553,null));};exports[_0x65d2('0x7d')]=function(_0x5b3dc1,_0x7d4178){return db[_0x65d2('0x62')][_0x65d2('0x72')]({'where':{'id':_0x5b3dc1[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x7d4178,null))[_0x65d2('0x14')](function(_0x3c3e77){if(_0x3c3e77){return _0x3c3e77[_0x65d2('0x7d')](_0x5b3dc1['query'][_0x65d2('0x7a')]);}})[_0x65d2('0x14')](respondWithStatusCode(_0x7d4178,null))['catch'](handleError(_0x7d4178,null));};exports[_0x65d2('0x7e')]=function(_0x4cdb34,_0x446ee3){_0x4cdb34['body'][_0x65d2('0x7f')]=_0x4cdb34[_0x65d2('0x80')][_0x65d2('0x81')];return db[_0x65d2('0x62')][_0x65d2('0x72')]({'where':{'id':_0x4cdb34['params']['id']}})['then'](handleEntityNotFound(_0x446ee3,null))[_0x65d2('0x14')](saveUpdates(_0x4cdb34['body'],null))[_0x65d2('0x14')](respondWithResult(_0x446ee3,null))['catch'](handleError(_0x446ee3,null));};exports[_0x65d2('0x82')]=function(_0x47fddf,_0x550baa){_0x47fddf['body'][_0x65d2('0x83')]=_0x47fddf[_0x65d2('0x80')]['filename'];return db[_0x65d2('0x62')][_0x65d2('0x72')]({'where':{'id':_0x47fddf[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x550baa,null))[_0x65d2('0x14')](saveUpdates(_0x47fddf[_0x65d2('0x6b')],null))[_0x65d2('0x14')](respondWithResult(_0x550baa,null))[_0x65d2('0x36')](handleError(_0x550baa,null));};exports[_0x65d2('0x84')]=function(_0x4b4f5e,_0x50b7d4){_0x4b4f5e['body'][_0x65d2('0x85')]=_0x4b4f5e[_0x65d2('0x80')][_0x65d2('0x81')];return db[_0x65d2('0x62')][_0x65d2('0x72')]({'where':{'id':_0x4b4f5e[_0x65d2('0x66')]['id']}})['then'](handleEntityNotFound(_0x50b7d4,null))[_0x65d2('0x14')](saveUpdates(_0x4b4f5e[_0x65d2('0x6b')],null))['then'](respondWithResult(_0x50b7d4,null))['catch'](handleError(_0x50b7d4,null));};exports[_0x65d2('0x86')]=function(_0x462a37,_0xa38168){_0x462a37[_0x65d2('0x6b')][_0x65d2('0x87')]=_0x462a37[_0x65d2('0x80')][_0x65d2('0x81')];return db[_0x65d2('0x62')][_0x65d2('0x72')]({'where':{'id':_0x462a37[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0xa38168,null))[_0x65d2('0x14')](saveUpdates(_0x462a37[_0x65d2('0x6b')],null))[_0x65d2('0x14')](respondWithResult(_0xa38168,null))['catch'](handleError(_0xa38168,null));};exports[_0x65d2('0x88')]=function(_0xd73b22,_0x54495e){var _0x2d6f15=path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0x8b'));var _0x4be9ee={'where':{'id':_0xd73b22[_0x65d2('0x66')]['id']},'attributes':['id',_0x65d2('0x7f')],'raw':!![]};var _0x1473ad=![];return require('../../config/license/util')[_0x65d2('0x8c')]()[_0x65d2('0x14')](function(_0x592f28){if(_0x592f28){_0x1473ad=_0x592f28[_0x65d2('0x8d')];}})[_0x65d2('0x14')](function(){return db[_0x65d2('0x62')][_0x65d2('0x72')](_0x4be9ee);})[_0x65d2('0x14')](handleEntityNotFound(_0x54495e,null))[_0x65d2('0x14')](function(_0x565b4b){if(_0x565b4b){if(!_[_0x65d2('0x8e')](_0x565b4b[_0x65d2('0x7f')])){if(fs[_0x65d2('0x8f')](path['join'](config[_0x65d2('0x8a')],_0x65d2('0x90'),_0x565b4b[_0x65d2('0x7f')]))&&_0x1473ad){_0x2d6f15=path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0x90'),_0x565b4b['sitepic']);}}return _0x54495e[_0x65d2('0x91')](_0x2d6f15);}})[_0x65d2('0x36')](handleError(_0x54495e,null));};exports[_0x65d2('0x92')]=function(_0x7423b9,_0x54240b){var _0x5e732a=path[_0x65d2('0x89')](config['root'],_0x65d2('0x93'));var _0x24edff={'where':{'id':_0x7423b9[_0x65d2('0x66')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x24edff)[_0x65d2('0x14')](handleEntityNotFound(_0x54240b,null))[_0x65d2('0x14')](function(_0x410c92){if(_0x410c92){if(!_[_0x65d2('0x8e')](_0x410c92[_0x65d2('0x83')])){if(fs[_0x65d2('0x8f')](path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0x94'),_0x410c92[_0x65d2('0x83')]))){_0x5e732a=path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0x94'),_0x410c92['agentAvatar']);}}return _0x54240b[_0x65d2('0x91')](_0x5e732a);}})[_0x65d2('0x36')](handleError(_0x54240b,null));};exports[_0x65d2('0x95')]=function(_0x1b846b,_0x194db3){var _0x58d46c=path['join'](config[_0x65d2('0x8a')],_0x65d2('0x96'));var _0x1e9288={'where':{'id':_0x1b846b[_0x65d2('0x66')]['id']},'attributes':['id',_0x65d2('0x85'),_0x65d2('0x97')],'raw':!![]};return db[_0x65d2('0x62')][_0x65d2('0x72')](_0x1e9288)[_0x65d2('0x14')](handleEntityNotFound(_0x194db3,null))[_0x65d2('0x14')](function(_0x589b14){if(_0x589b14){if(!_[_0x65d2('0x8e')](_0x589b14[_0x65d2('0x85')])){if(fs[_0x65d2('0x8f')](path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0x94'),_0x589b14[_0x65d2('0x85')]))&&_0x589b14[_0x65d2('0x97')]){_0x58d46c=path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0x94'),_0x589b14[_0x65d2('0x85')]);}}return _0x194db3[_0x65d2('0x91')](_0x58d46c);}})[_0x65d2('0x36')](handleError(_0x194db3,null));};exports[_0x65d2('0x98')]=function(_0x40402f,_0x12052e){var _0x2e93fb=path['join'](config[_0x65d2('0x8a')],_0x65d2('0x99'));var _0x261e1d={'where':{'id':_0x40402f['params']['id']},'attributes':['id',_0x65d2('0x87')],'raw':!![]};return db[_0x65d2('0x62')]['find'](_0x261e1d)[_0x65d2('0x14')](handleEntityNotFound(_0x12052e,null))[_0x65d2('0x14')](function(_0x15d89d){if(_0x15d89d){if(!_['isNil'](_0x15d89d[_0x65d2('0x87')])){if(fs[_0x65d2('0x8f')](path[_0x65d2('0x89')](config[_0x65d2('0x8a')],'server/files/images/avatars/',_0x15d89d[_0x65d2('0x87')]))){_0x2e93fb=path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0x94'),_0x15d89d[_0x65d2('0x87')]);}}return _0x12052e['download'](_0x2e93fb);}})[_0x65d2('0x36')](handleError(_0x12052e,null));};exports[_0x65d2('0x9a')]=function(_0x3c5b5e,_0x32cd6a){var _0x400298={'body':_0x3c5b5e['body'],'channel':_0x65d2('0x9b')};var _0x892ea6=[];var _0x57da55=[];var _0x518174={};var _0x2d7aa3=![];return db[_0x65d2('0x9c')][_0x65d2('0x9d')]()[_0x65d2('0x14')](function(_0x514faa){if(!_0x514faa){throw new db[(_0x65d2('0x9e'))][(_0x65d2('0x9f'))](_0x65d2('0xa0'));}_0x892ea6=_['difference'](_[_0x65d2('0x53')](_0x514faa),[_0x65d2('0xa1'),'updatedAt']);_0x57da55=_[_0x65d2('0xa2')](_[_0x65d2('0x53')](_0x514faa),[_0x65d2('0xa1'),'updatedAt',_0x65d2('0xa3'),_0x65d2('0xa4')]);if(_0x3c5b5e['body']['id']){delete _0x3c5b5e[_0x65d2('0x6b')]['id'];}if(_[_0x65d2('0x8e')](_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xa5')])){throw new db[(_0x65d2('0x9e'))][(_0x65d2('0x9f'))]('from\x20is\x20mandatory');}if(_[_0x65d2('0x8e')](_0x3c5b5e['body']['body'])||_0x3c5b5e['body'][_0x65d2('0x6b')]===''){throw new db['Sequelize'][(_0x65d2('0x9f'))](_0x65d2('0xa6'));}if(_[_0x65d2('0x8e')](_0x3c5b5e[_0x65d2('0x6b')]['mapKey'])){throw new db['Sequelize'][(_0x65d2('0x9f'))](_0x65d2('0xa7')+_0x57da55);}if(!_[_0x65d2('0xa8')](_0x57da55,_0x3c5b5e['body'][_0x65d2('0xa9')])){throw new db[(_0x65d2('0x9e'))][(_0x65d2('0x9f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57da55);}_0x518174[_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xa9')]]=_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xa5')];})[_0x65d2('0x14')](function(){return db[_0x65d2('0x62')][_0x65d2('0x72')]({'where':{'id':_0x3c5b5e['params']['id']},'include':[{'model':db[_0x65d2('0xaa')],'as':_0x65d2('0xab'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x518174,'limit':0x1,'order':[[_0x65d2('0xac'),_0x65d2('0xad')]]}]},{'model':db['ChatApplication'],'as':_0x65d2('0xae')},{'model':db['Interval'],'as':_0x65d2('0xaf'),'include':[{'model':db[_0x65d2('0xaf')],'as':_0x65d2('0x3a'),'attributes':['id',_0x65d2('0x30')],'raw':!![]}]}]});})[_0x65d2('0x14')](function(_0x35721a){if(!_0x35721a)throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x3c5b5e[_0x65d2('0x66')]['id']));if(!_0x35721a[_0x65d2('0xaf')]||!_0x35721a[_0x65d2('0xaf')]['Intervals'])return[_0x35721a,!![]];return[_0x35721a,checkWebsiteIntervals(_0x35721a)];})['spread'](function(_0x59bc3c,_0x22c581){if(!_0x22c581)throw new APIOutOfIntervalError();if(!_0x59bc3c[_0x65d2('0xab')])return;_0x400298['account']=_0x59bc3c;_0x400298[_0x65d2('0xb0')]=_0x59bc3c[_0x65d2('0xab')];_0x400298['applications']=_[_0x65d2('0xb1')](_0x59bc3c['Applications'],[_0x65d2('0xb2')],[_0x65d2('0xb3')]);if(_0x400298[_0x65d2('0xb4')][_0x65d2('0xae')]){delete _0x400298['account']['Applications'];}if(_0x400298[_0x65d2('0xb4')][_0x65d2('0xab')]&&_0x400298[_0x65d2('0xb4')]['List']['Contacts']['length']){return _0x400298[_0x65d2('0xb4')][_0x65d2('0xab')]['Contacts'][0x0];}var _0x522567=_[_0x65d2('0xb5')](_0x3c5b5e[_0x65d2('0x6b')],{'firstName':_0x3c5b5e[_0x65d2('0x6b')]['from'],'ListId':_0x59bc3c[_0x65d2('0xa4')]});_0x522567[_0x3c5b5e[_0x65d2('0x6b')]['mapKey']]=_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xa5')];return db['CmContact'][_0x65d2('0x6a')](_0x522567,{'fields':_0x892ea6,'raw':!![]});})['then'](function(_0x409e8a){_0x400298['contact']=_0x409e8a;var _0x461a4d=createInteractionObject(_0x3c5b5e[_0x65d2('0x66')]['id'],_0x3c5b5e['body'],_0x3c5b5e[_0x65d2('0xb6')],_0x409e8a);var _0x3acf8d={'ChatWebsiteId':_0x3c5b5e[_0x65d2('0x66')]['id'],'closed':![]};if(_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xb7')]){_0x3acf8d[_0x65d2('0xb7')]=_0x3c5b5e['body'][_0x65d2('0xb7')];return db[_0x65d2('0xb8')][_0x65d2('0x72')]({'where':_0x3acf8d})[_0x65d2('0x14')](function(_0x23b585){if(_0x23b585){_0x2d7aa3=!![];return _0x23b585;}_0x461a4d[_0x65d2('0xb7')]=_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xb7')];_0x461a4d[_0x65d2('0xb9')]=_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xb9')];return db[_0x65d2('0xb8')][_0x65d2('0x6a')](_0x461a4d);});}_0x3acf8d[_0x65d2('0xba')]=_0x409e8a['id'];if(_0x3c5b5e[_0x65d2('0x6b')]['interaction']&&_0x3c5b5e[_0x65d2('0x6b')]['interaction']['id']){_0x3acf8d['id']=_0x3c5b5e['body'][_0x65d2('0xbb')]['id'];return db[_0x65d2('0xb8')][_0x65d2('0x72')]({'where':_0x3acf8d})[_0x65d2('0x14')](function(_0x4993aa){if(_0x4993aa){_0x2d7aa3=!![];return _0x4993aa;}return db['ChatInteraction'][_0x65d2('0x6a')](_0x461a4d);});}return db[_0x65d2('0xb8')]['create'](_0x461a4d);})[_0x65d2('0x14')](function(_0xb0c75d){if(!_0x2d7aa3)return _0xb0c75d;var _0x2a4254={'from':(_0x400298['contact'][_0x65d2('0x43')]||'')+'\x20'+(_0x400298[_0x65d2('0xbc')][_0x65d2('0xbd')]||'')};if(_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xb7')]&&_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xbe')]&&_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xb7')]!=_0x3c5b5e[_0x65d2('0x6b')]['messageId']){_0x2a4254['threadId']=_0x3c5b5e['body']['messageId'];}return _0xb0c75d['update'](_0x2a4254);})[_0x65d2('0x14')](function(_0x132975){_0x400298[_0x65d2('0xbb')]=_0x132975[_0x65d2('0x6d')]({'plain':!![]});_0x400298[_0x65d2('0xbb')][_0x65d2('0xbf')]=!_0x2d7aa3;if(_0x400298[_0x65d2('0xbb')]['created']){if(_0x400298['account']['autoclose']){_0x400298['applications']['push']({'id':0x0,'priority':_0x400298['applications'][_0x65d2('0x57')]+0x1,'app':_0x65d2('0xc0'),'appdata':_0x65d2('0xc1'),'interval':_0x65d2('0xc2')});}}return db[_0x65d2('0xc3')][_0x65d2('0x6a')]({'body':_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0x6b')],'ChatWebsiteId':_0x3c5b5e['params']['id'],'ChatInteractionId':_0x132975['id'],'direction':'in','ContactId':_0x400298[_0x65d2('0xbc')]['id'],'AttachmentId':_0x3c5b5e[_0x65d2('0x6b')][_0x65d2('0xc4')]});})[_0x65d2('0x14')](function(_0x4abd50){_0x400298[_0x65d2('0x1b')]=_0x4abd50;if(!_0x400298[_0x65d2('0xbb')][_0x65d2('0xc5')]){return;}return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x400298['interaction']['UserId']}});})[_0x65d2('0x14')](function(_0x549a2a){if(_0x549a2a){_0x400298['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x549a2a[_0x65d2('0x2a')]+','+(_0x400298['account'][_0x65d2('0xc6')]||0xa),'interval':_0x65d2('0xc2')});_0x400298['forcedOwnership']=!![];}if(!_0x400298[_0x65d2('0xbb')][_0x65d2('0xc7')]){return;}return db[_0x65d2('0xc8')][_0x65d2('0x72')]({'attributes':['id',_0x65d2('0x2a')],'where':{'id':_0x400298[_0x65d2('0xbb')][_0x65d2('0xc7')]}});})[_0x65d2('0x14')](function(_0x3f6ad7){if(_0x3f6ad7){_0x400298['applications'][_0x65d2('0xc9')]({'id':0x0,'priority':0x1,'app':_0x65d2('0xca'),'appdata':_0x3f6ad7['name']+','+(_0x400298[_0x65d2('0xb4')][_0x65d2('0xcb')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x65d2('0xcc'),_0x65d2('0xcd'),_0x400298);})[_0x65d2('0x14')](function(_0x33b64e){respondWithRpcPromise(_0x65d2('0xce'),_0x65d2('0xce'),{'event':'notify','message':_0x33b64e},client9002);return _0x33b64e;})['then'](respondWithResult(_0x32cd6a,null))[_0x65d2('0x36')](APIHandleError(_0x32cd6a));};exports[_0x65d2('0xcf')]=function(_0x33347e,_0x2bb54d){var _0x51a3a2,_0x478eba,_0x1a49db;var _0x431904=[];var _0x54200c={};var _0x582aba=_0x33347e[_0x65d2('0xd0')]||[];var _0x832f63=[];var _0x18a87e;return db[_0x65d2('0x9c')]['describe']()['then'](function(_0xf329d1){if(!_0xf329d1){throw new db[(_0x65d2('0x9e'))][(_0x65d2('0x9f'))]('no\x20available\x20attributes');}_0x431904=_['difference'](_['keys'](_0xf329d1),[_0x65d2('0xa1'),_0x65d2('0xac'),_0x65d2('0xa3'),_0x65d2('0xa4')]);if(_0x33347e[_0x65d2('0x6b')]['id']){delete _0x33347e['body']['id'];}if(_[_0x65d2('0x8e')](_0x33347e[_0x65d2('0x6b')][_0x65d2('0xa5')])){throw _0x2bb54d[_0x65d2('0x1e')](0x1f4)[_0x65d2('0x2b')](new db[(_0x65d2('0x9e'))][(_0x65d2('0x9f'))]('from\x20is\x20mandatory'));}if(_[_0x65d2('0x8e')](_0x33347e[_0x65d2('0x6b')][_0x65d2('0x6b')])||_0x33347e[_0x65d2('0x6b')][_0x65d2('0x6b')]===''){throw _0x2bb54d[_0x65d2('0x1e')](0x1f4)[_0x65d2('0x2b')](new db[(_0x65d2('0x9e'))][(_0x65d2('0x9f'))](_0x65d2('0xa6')));}if(_[_0x65d2('0x8e')](_0x33347e[_0x65d2('0x6b')][_0x65d2('0xd1')])){throw _0x2bb54d[_0x65d2('0x1e')](0x1f4)[_0x65d2('0x2b')](new db[(_0x65d2('0x9e'))][(_0x65d2('0x9f'))](_0x65d2('0xd2')+_0x431904));}if(!_[_0x65d2('0xa8')](_0x431904,_0x33347e[_0x65d2('0x6b')][_0x65d2('0xd1')])){throw _0x2bb54d[_0x65d2('0x1e')](0x1f4)[_0x65d2('0x2b')](new db['Sequelize'][(_0x65d2('0x9f'))](_0x65d2('0xd3')+_0x431904));}_0x54200c[_0x33347e[_0x65d2('0x6b')]['mapKeyOffline']]=_0x33347e[_0x65d2('0x6b')][_0x65d2('0xa5')];})[_0x65d2('0x14')](function(){return db['ChatWebsite'][_0x65d2('0x72')]({'where':{'id':_0x33347e[_0x65d2('0x66')]['id']},'include':[{'model':db[_0x65d2('0xaa')],'as':'List'},{'model':db[_0x65d2('0xd4')],'as':_0x65d2('0xd4')}]});})[_0x65d2('0x14')](handleEntityNotFound(_0x2bb54d,null))['then'](function(_0x2a755f){if(_0x2a755f&&_0x2a755f['List']){_0x478eba=_0x2a755f;var _0x58e5ac=_[_0x65d2('0xb5')](_0x33347e[_0x65d2('0x6b')],{'firstName':_0x33347e['body'][_0x65d2('0xa5')],'phone':_0x33347e[_0x65d2('0x6b')][_0x65d2('0xa5')],'ListId':_0x2a755f[_0x65d2('0xa4')]});_0x58e5ac[_0x33347e[_0x65d2('0x6b')]['mapKeyOffline']]=_0x33347e[_0x65d2('0x6b')][_0x65d2('0xa5')];return db['CmContact']['findOrCreate']({'where':_0x54200c,'defaults':_0x58e5ac});}})[_0x65d2('0xd5')](function(_0x5a1858){if(_0x5a1858){_0x1a49db=_0x5a1858;var _0x17859b=fs['readFileSync'](path['join'](config[_0x65d2('0x8a')],'server/files/templates/chatOfflineMessage.ejs'),_0x65d2('0xd6'));var _0x566136=ejs[_0x65d2('0xd7')](_0x17859b,{'body':_[_0x65d2('0xd8')](_0x33347e[_0x65d2('0x6b')]['body']),'bodyTitle':_0x478eba[_0x65d2('0xd9')]});return db[_0x65d2('0xda')][_0x65d2('0x6a')]({'body':_0x566136,'plainBody':htmlToText[_0x65d2('0xdb')](_0x566136),'ContactId':_0x5a1858['id'],'ChatWebsiteId':_0x478eba['id']});}})[_0x65d2('0x14')](function(_0x85b208){_0x18a87e=_0x85b208;if(_0x582aba[_0x65d2('0x57')]){var _0x4aa86a=_0x582aba[_0x65d2('0x39')](function(_0x32724b){return{'name':_0x32724b[_0x65d2('0xdc')],'basename':_0x32724b[_0x65d2('0x81')],'type':_0x32724b[_0x65d2('0xdd')],'ChatOfflineMessageId':_0x85b208['id']};});_0x832f63=_0x4aa86a[_0x65d2('0x39')](_0x3397c0=>{var _0x59c527={'filename':_0x3397c0['name'],'path':path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0xde'),_0x65d2('0xd0'),_0x65d2('0xdf'),_0x65d2('0xe0'),_0x3397c0[_0x65d2('0xe1')])};return _0x59c527;});if(!_0x478eba[_0x65d2('0xe2')]){return db['sequelize'][_0x65d2('0xe3')](function(_0x1e1933){return db[_0x65d2('0xe4')][_0x65d2('0xe5')](_0x4aa86a,{'transaction':_0x1e1933});});}}})[_0x65d2('0x14')](function(){if(_0x18a87e){_0x51a3a2=_0x18a87e;return db['MailAccount'][_0x65d2('0x78')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x65d2('0xe6')],'as':_0x65d2('0xe6'),'raw':!![]}]}]});}})[_0x65d2('0x14')](function(_0x346dc3){if(_0x346dc3&&_0x346dc3['Smtp']&&_0x478eba['forwardOffline']&&_0x478eba[_0x65d2('0xe7')]){var _0x48fed6=_0x346dc3['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x65d2('0xe8'),{'account':_0x48fed6,'message':{'from':util[_0x65d2('0x2e')](_0x65d2('0xe9'),_0x346dc3[_0x65d2('0x2a')],_0x346dc3[_0x65d2('0xea')]||_0x346dc3[_0x65d2('0xeb')][_0x65d2('0x6c')]),'to':_0x478eba[_0x65d2('0xe7')],'subject':_0x478eba[_0x65d2('0xec')],'html':_0x51a3a2[_0x65d2('0x6b')],'attachments':_0x832f63}},client9003)[_0x65d2('0x14')](function(){return _0x51a3a2;})[_0x65d2('0x36')](function(_0x3ffd4d){logger[_0x65d2('0x1a')](_0x3ffd4d);});}})[_0x65d2('0x14')](function(){if(_0x478eba&&_0x478eba[_0x65d2('0xe2')]&&_0x478eba[_0x65d2('0xed')]){var _0x3db7a1=[];if(_0x582aba[_0x65d2('0x57')]){_0x3db7a1=_0x582aba['map'](function(_0x2e626f){return{'name':_0x2e626f[_0x65d2('0xdc')],'basename':_0x2e626f[_0x65d2('0x81')],'type':_0x2e626f[_0x65d2('0xdd')],'ChatOfflineMessageId':_0x18a87e['id']};});}var _0x3bec36;if(!_[_0x65d2('0x8e')](_0x478eba[_0x65d2('0xee')])){var _0x4c722a=_[_0x65d2('0x39')](_0x33347e[_0x65d2('0x6b')],function(_0x1d7e79){return _0x1d7e79;});var _0x224ad8=_[_0x65d2('0xef')](_0x4c722a)[0x0];var _0x1c9e72=_[_0x65d2('0xf0')](_0x224ad8,function(_0x2ead1e){return _0x2ead1e;});_0x3bec36=_0x1c9e72[0x1][_0x478eba[_0x65d2('0xee')]];}var _0x5e5b22={'from':_0x1a49db[_0x65d2('0xea')],'firstName':_0x1a49db['firstName'],'lastName':_0x1a49db[_0x65d2('0xbd')],'mapKey':_0x65d2('0xea'),'message':{'from':_0x1a49db[_0x65d2('0xea')],'to':_0x478eba[_0x65d2('0xd4')][_0x65d2('0xea')],'cc':'','subject':_['isNil'](_0x3bec36)?_0x478eba['offlineMessageSubject']:_0x3bec36,'messageId':'','sentAt':new Date(),'attach':_0x3db7a1[_0x65d2('0x57')],'attachments':_0x3db7a1,'originChannel':_0x65d2('0xf1'),'ChatWebsiteId':_0x478eba['id'],'ChatOfflineMessageId':_0x51a3a2['id'],'originTo':_0x478eba[_0x65d2('0xd4')]['email']},'body':_0x51a3a2[_0x65d2('0x6b')]};var _0x26d613={'account':{'id':_0x478eba['MailAccountId']},'body':_0x5e5b22,'log':_0x65d2('0xf2')};return respondWithRpcPromise(_0x65d2('0xf2'),_0x65d2('0xf3'),_0x26d613,client9001)[_0x65d2('0x14')](function(){return _0x51a3a2;})[_0x65d2('0x36')](function(_0x5d7387){logger[_0x65d2('0x1a')](_0x5d7387);});}return;})[_0x65d2('0x14')](function(){if(_0x51a3a2){return _0x51a3a2;}})[_0x65d2('0x14')](respondWithResult(_0x2bb54d,null))['catch'](function(){for(var _0x2c2828 of _0x582aba){var _0x35fbe0=path[_0x65d2('0x89')](config[_0x65d2('0x8a')],_0x65d2('0xde'),_0x65d2('0xd0'),_0x65d2('0xdf'),_0x65d2('0xe0'),_0x2c2828['filename']);fs_extra['remove'](_0x35fbe0)['catch'](function(_0x2f96b3){logger['error'](_0x65d2('0xf4'),_0x35fbe0,_0x2f96b3);});}});};exports[_0x65d2('0xf5')]=function(_0x2820e8,_0x472fad){return db[_0x65d2('0xb8')][_0x65d2('0x72')]({'where':{'id':_0x2820e8[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x472fad,null))[_0x65d2('0x14')](function(_0x431288){if(_0x431288){return _0x431288[_0x65d2('0xf5')](_0x2820e8[_0x65d2('0x6b')][_0x65d2('0x7a')],_[_0x65d2('0xf6')](_0x2820e8[_0x65d2('0x6b')],[_0x65d2('0x7a'),'id'])||{});}})[_0x65d2('0x14')](respondWithResult(_0x472fad,null))[_0x65d2('0x36')](handleError(_0x472fad,null));};exports['getInteractions']=function(_0x28188c,_0x8f82bf){var _0x5153dc={'raw':![],'where':{}};var _0x143083={};var _0x5936c4={'count':0x0,'rows':[]};return db[_0x65d2('0x62')][_0x65d2('0x78')]({'where':{'id':_0x28188c[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x8f82bf,null))[_0x65d2('0x14')](function(_0x4a9496){if(_0x4a9496){_0x143083[_0x65d2('0x4b')]=_['keys'](db[_0x65d2('0xb8')][_0x65d2('0x50')]);_0x143083[_0x65d2('0x52')]=_['keys'](_0x28188c[_0x65d2('0x52')]);_0x143083[_0x65d2('0x54')]=_['intersection'](_0x143083[_0x65d2('0x4b')],_0x143083[_0x65d2('0x52')]);_0x5153dc[_0x65d2('0x55')]=_['intersection'](_0x143083['model'],qs[_0x65d2('0x56')](_0x28188c['query'][_0x65d2('0x56')]));_0x5153dc[_0x65d2('0x55')]=_0x5153dc[_0x65d2('0x55')][_0x65d2('0x57')]?_0x5153dc['attributes']:_0x143083['model'];if(!_0x28188c[_0x65d2('0x52')][_0x65d2('0x58')]('nolimit')){_0x5153dc[_0x65d2('0x23')]=qs[_0x65d2('0x23')](_0x28188c['query'][_0x65d2('0x23')]);_0x5153dc[_0x65d2('0x21')]=qs[_0x65d2('0x21')](_0x28188c[_0x65d2('0x52')][_0x65d2('0x21')]);}_0x5153dc[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x28188c[_0x65d2('0x52')][_0x65d2('0x5b')]);_0x5153dc['where']=qs[_0x65d2('0x54')](_[_0x65d2('0x5c')](_0x28188c[_0x65d2('0x52')],_0x143083[_0x65d2('0x54')]));_0x5153dc[_0x65d2('0x5f')][_0x65d2('0x7b')]=_0x4a9496['id'];if(_0x28188c[_0x65d2('0x52')][_0x65d2('0x5d')]){_0x5153dc[_0x65d2('0x5f')]=_[_0x65d2('0x5e')](_0x5153dc[_0x65d2('0x5f')],{'$or':_[_0x65d2('0x39')](_0x5153dc[_0x65d2('0x55')],function(_0x1cb101){var _0x52f530={};_0x52f530[_0x1cb101]={'$like':'%'+_0x28188c[_0x65d2('0x52')]['filter']+'%'};return _0x52f530;})});}_0x5153dc=_[_0x65d2('0x5e')]({},_0x5153dc,_0x28188c['options']);return db[_0x65d2('0xb8')][_0x65d2('0x24')]({'where':_0x5153dc[_0x65d2('0x5f')]})[_0x65d2('0x14')](function(_0x14b1f2){_0x5936c4[_0x65d2('0x24')]=_0x14b1f2;if(_0x28188c[_0x65d2('0x52')][_0x65d2('0x68')]){_0x5153dc[_0x65d2('0x69')]=[{'model':db[_0x65d2('0x9c')],'as':_0x65d2('0xf7'),'required':![]},{'model':db[_0x65d2('0xf8')],'as':_0x65d2('0xf9'),'attributes':['name',_0x65d2('0xfa'),_0x65d2('0xfb')],'required':![]},{'model':db[_0x65d2('0xfc')],'as':'Tags','attributes':['id',_0x65d2('0x2a'),_0x65d2('0xfd')],'where':_0x28188c[_0x65d2('0x52')][_0x65d2('0xfe')]?{'id':_0x28188c[_0x65d2('0x52')]['tag']}:undefined,'required':_0x28188c[_0x65d2('0x52')][_0x65d2('0xfe')]?!![]:![]}];}return db['ChatInteraction'][_0x65d2('0x63')](_0x5153dc);})[_0x65d2('0x14')](function(_0x4abee4){_0x5936c4[_0x65d2('0x64')]=_0x4abee4;return _0x5936c4;});}})[_0x65d2('0x14')](respondWithFilteredResult(_0x8f82bf,_0x5153dc))[_0x65d2('0x36')](handleError(_0x8f82bf,null));};exports[_0x65d2('0x2d')]=function(_0x2b7033,_0x21ae48){var _0x36d7cd=0x0;var _0x2cd96d=0x0;var _0x3bc1c7=![];var _0x1d324f;var _0x31bc70;return db[_0x65d2('0x62')]['find']({'where':{'id':_0x2b7033[_0x65d2('0x66')]['id']},'include':[{'model':db[_0x65d2('0xaf')],'as':'Interval','include':[{'model':db[_0x65d2('0xaf')],'as':'Intervals','attributes':['id','interval']}]}]})[_0x65d2('0x14')](handleEntityNotFound(_0x21ae48,null))[_0x65d2('0x14')](function(_0x48f4a8){if(_0x48f4a8){_0x1d324f=_0x48f4a8;return _0x48f4a8['getProactiveActions']({'raw':!![]});}})[_0x65d2('0x14')](function(_0x285d08){if(_0x1d324f){if(_0x285d08){_0x31bc70=_0x285d08;}}return require('../../config/license/util')[_0x65d2('0x8c')]();})[_0x65d2('0x14')](function(_0x4907d9){if(_0x4907d9){_0x2cd96d=_0x4907d9[_0x65d2('0xff')];_0x3bc1c7=_0x4907d9[_0x65d2('0x8d')];}})[_0x65d2('0x14')](function(){return db[_0x65d2('0xb8')][_0x65d2('0x24')]({'where':{'closed':![]}});})[_0x65d2('0x14')](function(_0x1064c1){_0x36d7cd=_0x1064c1;if(_0x2cd96d&&_0x1064c1>_0x2cd96d){return db['License']['findOne']({'where':{'id':0x1}})[_0x65d2('0x14')](function(_0x51dfdf){if(_0x51dfdf){_0x51dfdf[_0x65d2('0x100')](_0x65d2('0x101'));}});}})[_0x65d2('0x14')](function(){if(!_0x1d324f[_0x65d2('0xaf')]||!_0x1d324f[_0x65d2('0xaf')][_0x65d2('0x3a')])return!![];return checkWebsiteIntervals(_0x1d324f);})[_0x65d2('0x14')](function(_0xe0b7d3){var _0x1927f0=fs[_0x65d2('0x102')](path[_0x65d2('0x89')](config['root'],_0x65d2('0x103')),_0x65d2('0xd6'));var _0x4518ad=new url[(_0x65d2('0x104'))](_0x1d324f[_0x65d2('0x105')])[_0x65d2('0x106')];var _0x4de7bd=_0x65d2('0x107');var _0x76d8d2=![];var _0x44b538={'chatVersion':_0x4de7bd,'chatWebsiteAddressOrigin':_0x4518ad,'remote':_0x1d324f[_0x65d2('0x108')],'query':querystring['stringify'](_[_0x65d2('0x5e')](_0x1d324f[_0x65d2('0x6d')]({'plain':!![]}),{'customerIp':_0x2b7033[_0x65d2('0xb6')][_0x65d2('0x40')]||_0x2b7033['headers'][_0x65d2('0x109')]||_0x2b7033[_0x65d2('0x10a')][_0x65d2('0x10b')]||_0x2b7033['ip'],'referer':_0x2b7033[_0x65d2('0xb6')][_0x65d2('0x45')],'openedInteractions':_0x36d7cd,'maxInteractions':_0x2cd96d,'virtual':_0x3bc1c7[_0x65d2('0xff')],'online':_0xe0b7d3,'custom':_0x3bc1c7}))['replace'](/'/g,'\x5c\x27')};_0x21ae48[_0x65d2('0x2b')](ejs[_0x65d2('0xd7')](Mustache[_0x65d2('0xd7')](_0x1927f0,_0x44b538),{'proactiveActions':_0x31bc70,'alignment':_0x1d324f[_0x65d2('0x10c')],'verticalAlignment':_0x1d324f[_0x65d2('0x10d')],'div_color':_0x1d324f[_0x65d2('0xfd')],'labelText':_0x1d324f[_0x65d2('0x10e')],'text_color':_0x1d324f['textColor'],'text_button_color':_0x1d324f[_0x65d2('0x10f')],'button_color':_0x1d324f['color_button'],'background_color':_0x1d324f[_0x65d2('0x110')],'hideWhenOffline':_0x1d324f[_0x65d2('0x111')],'intervalId':_0x1d324f[_0x65d2('0x112')],'isDevelopment':_0x76d8d2,'chatVersion':_0x4de7bd}));})['catch'](handleError(_0x21ae48,null));};exports[_0x65d2('0x113')]=function(_0x419ba9,_0x3a1e1a){var _0x42d45e=_0x419ba9[_0x65d2('0x66')]['id'];var _0x16f4c1=_0x419ba9[_0x65d2('0x6b')];var _0x5dd7ae=0xc8;var _0x287ad6=null;return db[_0x65d2('0x114')][_0x65d2('0xe3')]({'isolationLevel':db[_0x65d2('0x114')][_0x65d2('0x115')][_0x65d2('0x116')][_0x65d2('0x117')]},function(_0x19ab22){return db[_0x65d2('0x62')][_0x65d2('0x78')]({'where':{'id':_0x42d45e},'transaction':_0x19ab22})[_0x65d2('0x14')](function(_0x5d9cf4){if(_0x5d9cf4){return db[_0x65d2('0x118')][_0x65d2('0x27')]({'where':{'ChatWebsiteId':_0x42d45e},'transaction':_0x19ab22})['then'](function(){var _0x47002d=_[_0x65d2('0x39')](_0x16f4c1,function(_0x1dd28b){_0x1dd28b[_0x65d2('0x7b')]=_0x42d45e;return _0x1dd28b;});return db[_0x65d2('0x118')]['bulkCreate'](_0x47002d,{'transaction':_0x19ab22});});}else{_0x5dd7ae=0x194;_0x287ad6=[];}});})['then'](function(){if(_0x5dd7ae!==0x194){return db['ChatApplication'][_0x65d2('0x119')]({'where':{'ChatWebsiteId':_0x42d45e},'order':_0x65d2('0xb2')})['then'](function(_0x15d23b){_0x287ad6=_0x15d23b;});}})[_0x65d2('0x36')](function(_0x16a4d8){_0x5dd7ae=0x1f4;logger[_0x65d2('0x1a')](_0x16a4d8[_0x65d2('0x29')]);if(_0x16a4d8['name']){delete _0x16a4d8[_0x65d2('0x2a')];}_0x287ad6=_0x16a4d8;})['finally'](function(){if(_0x287ad6===null){_0x3a1e1a[_0x65d2('0x1d')](_0x5dd7ae);}else{if(_0x5dd7ae===0x1f4){_0x3a1e1a[_0x65d2('0x1e')](_0x5dd7ae)['send'](_0x287ad6);}else{_0x3a1e1a[_0x65d2('0x1e')](_0x5dd7ae)['json'](_0x287ad6);}}});};exports[_0x65d2('0x11a')]=function(_0x46957e,_0x5115c2){var _0x3b319d={};var _0xea9978={};var _0xd4d1fa;var _0x1d643f;return db[_0x65d2('0x62')][_0x65d2('0x78')]({'where':{'id':_0x46957e['params']['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x5115c2,null))[_0x65d2('0x14')](function(_0x9d9e99){if(_0x9d9e99){_0xd4d1fa=_0x9d9e99;_0xea9978['model']=_[_0x65d2('0x53')](db['ChatApplication'][_0x65d2('0x50')]);_0xea9978[_0x65d2('0x52')]=_[_0x65d2('0x53')](_0x46957e[_0x65d2('0x52')]);_0xea9978['filters']=_[_0x65d2('0x67')](_0xea9978['model'],_0xea9978[_0x65d2('0x52')]);_0x3b319d[_0x65d2('0x55')]=_[_0x65d2('0x67')](_0xea9978[_0x65d2('0x4b')],qs[_0x65d2('0x56')](_0x46957e[_0x65d2('0x52')][_0x65d2('0x56')]));_0x3b319d[_0x65d2('0x55')]=_0x3b319d[_0x65d2('0x55')][_0x65d2('0x57')]?_0x3b319d['attributes']:_0xea9978[_0x65d2('0x4b')];_0x3b319d[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x46957e[_0x65d2('0x52')][_0x65d2('0x5b')]);_0x3b319d[_0x65d2('0x5f')]=qs[_0x65d2('0x54')](_[_0x65d2('0x5c')](_0x46957e[_0x65d2('0x52')],_0xea9978[_0x65d2('0x54')]));if(_0x46957e[_0x65d2('0x52')][_0x65d2('0x5d')]){_0x3b319d[_0x65d2('0x5f')]=_[_0x65d2('0x5e')](_0x3b319d[_0x65d2('0x5f')],{'$or':_['map'](_0x3b319d[_0x65d2('0x55')],function(_0x5b2e5c){var _0x1a213a={};_0x1a213a[_0x5b2e5c]={'$like':'%'+_0x46957e[_0x65d2('0x52')]['filter']+'%'};return _0x1a213a;})});}_0x3b319d=_['merge']({},_0x3b319d,_0x46957e['options']);return _0xd4d1fa[_0x65d2('0x11a')](_0x3b319d);}})[_0x65d2('0x14')](function(_0x1eb426){if(_0x1eb426){_0x1d643f=_0x1eb426[_0x65d2('0x57')];if(!_0x46957e[_0x65d2('0x52')]['hasOwnProperty']('nolimit')){_0x3b319d[_0x65d2('0x23')]=qs[_0x65d2('0x23')](_0x46957e['query']['limit']);_0x3b319d[_0x65d2('0x21')]=qs['offset'](_0x46957e[_0x65d2('0x52')][_0x65d2('0x21')]);}return _0xd4d1fa[_0x65d2('0x11a')](_0x3b319d);}})['then'](function(_0x466bda){if(_0x466bda){return _0x466bda?{'count':_0x1d643f,'rows':_0x466bda}:null;}})[_0x65d2('0x14')](respondWithResult(_0x5115c2,null))['catch'](handleError(_0x5115c2,null));};exports['addProactiveActions']=function(_0x36ef1f,_0x525fe8){return db['chatProactiveAction'][_0x65d2('0x72')]({'where':{'id':_0x36ef1f[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x525fe8,null))[_0x65d2('0x14')](function(_0x5d6cda){if(_0x5d6cda){return _0x5d6cda[_0x65d2('0x11b')](_0x36ef1f['body'][_0x65d2('0x7a')],_['omit'](_0x36ef1f['body'],[_0x65d2('0x7a'),'id'])||{});}})[_0x65d2('0x14')](respondWithResult(_0x525fe8,null))[_0x65d2('0x36')](handleError(_0x525fe8,null));};exports[_0x65d2('0x11c')]=function(_0x1b1d9e,_0x9dc08d){var _0x548515={};var _0x4c0e05={};var _0xc82592;var _0x4adfee;return db[_0x65d2('0x62')]['findOne']({'where':{'id':_0x1b1d9e['params']['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x9dc08d,null))[_0x65d2('0x14')](function(_0x5207bb){if(_0x5207bb){_0xc82592=_0x5207bb;_0x4c0e05[_0x65d2('0x4b')]=_['keys'](db['ChatProactiveAction'][_0x65d2('0x50')]);_0x4c0e05[_0x65d2('0x52')]=_[_0x65d2('0x53')](_0x1b1d9e[_0x65d2('0x52')]);_0x4c0e05[_0x65d2('0x54')]=_[_0x65d2('0x67')](_0x4c0e05['model'],_0x4c0e05[_0x65d2('0x52')]);_0x548515[_0x65d2('0x55')]=_[_0x65d2('0x67')](_0x4c0e05[_0x65d2('0x4b')],qs['fields'](_0x1b1d9e[_0x65d2('0x52')][_0x65d2('0x56')]));_0x548515[_0x65d2('0x55')]=_0x548515[_0x65d2('0x55')][_0x65d2('0x57')]?_0x548515[_0x65d2('0x55')]:_0x4c0e05[_0x65d2('0x4b')];_0x548515[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x1b1d9e['query'][_0x65d2('0x5b')]);_0x548515[_0x65d2('0x5f')]=qs[_0x65d2('0x54')](_[_0x65d2('0x5c')](_0x1b1d9e['query'],_0x4c0e05['filters']));if(_0x1b1d9e[_0x65d2('0x52')][_0x65d2('0x5d')]){_0x548515[_0x65d2('0x5f')]=_[_0x65d2('0x5e')](_0x548515[_0x65d2('0x5f')],{'$or':_['map'](_0x548515['attributes'],function(_0x4c6850){var _0x52473a={};_0x52473a[_0x4c6850]={'$like':'%'+_0x1b1d9e['query'][_0x65d2('0x5d')]+'%'};return _0x52473a;})});}_0x548515=_[_0x65d2('0x5e')]({},_0x548515,_0x1b1d9e[_0x65d2('0x61')]);return _0xc82592[_0x65d2('0x11c')](_0x548515);}})[_0x65d2('0x14')](function(_0x406943){if(_0x406943){_0x4adfee=_0x406943[_0x65d2('0x57')];if(!_0x1b1d9e[_0x65d2('0x52')][_0x65d2('0x58')]('nolimit')){_0x548515[_0x65d2('0x23')]=qs[_0x65d2('0x23')](_0x1b1d9e[_0x65d2('0x52')][_0x65d2('0x23')]);_0x548515[_0x65d2('0x21')]=qs[_0x65d2('0x21')](_0x1b1d9e[_0x65d2('0x52')][_0x65d2('0x21')]);}return _0xc82592['getProactiveActions'](_0x548515);}})[_0x65d2('0x14')](function(_0x2c8818){if(_0x2c8818){return _0x2c8818?{'count':_0x4adfee,'rows':_0x2c8818}:null;}})[_0x65d2('0x14')](respondWithResult(_0x9dc08d,null))[_0x65d2('0x36')](handleError(_0x9dc08d,null));};exports[_0x65d2('0x11d')]=function(_0x325b9e,_0x3e0c3a){var _0x18a11c=_0x325b9e[_0x65d2('0x52')][_0x65d2('0x11e')]===_0x65d2('0x11f')?_0x65d2('0x120'):_0x65d2('0x121');return db[_0x65d2('0x62')]['find']({'attributes':['id',_0x18a11c],'where':{'id':_0x325b9e['params']['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x3e0c3a,null))[_0x65d2('0x14')](function(_0x5d46af){if(_0x5d46af){var _0x897887=_0x5d46af[_0x18a11c];var _0x897d5=_0x897887&&_0x897887[_0x65d2('0x122')]?_0x897887[_0x65d2('0x122')]:[];_0x3e0c3a[_0x65d2('0x2b')]({'fromKey':_[_0x65d2('0x8e')](_0x897887['fromKey'])?undefined:_0x897887[_0x65d2('0x123')],'count':_0x897d5['length'],'rows':_0x897d5});}})[_0x65d2('0x36')](handleError(_0x3e0c3a,null));};exports[_0x65d2('0x124')]=function(_0x51fee2,_0x5794e4){var _0x11fc86={'raw':![],'where':{}};var _0x35cb27={};var _0x1fbd02={'count':0x0,'rows':[]};return db[_0x65d2('0x62')][_0x65d2('0x78')]({'where':{'id':_0x51fee2[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x5794e4,null))[_0x65d2('0x14')](function(_0xfaba88){if(_0xfaba88){_0x35cb27[_0x65d2('0x4b')]=_[_0x65d2('0x53')](db[_0x65d2('0xda')][_0x65d2('0x50')]);_0x35cb27[_0x65d2('0x52')]=_[_0x65d2('0x53')](_0x51fee2[_0x65d2('0x52')]);_0x35cb27[_0x65d2('0x54')]=_[_0x65d2('0x67')](_0x35cb27[_0x65d2('0x4b')],_0x35cb27[_0x65d2('0x52')]);_0x11fc86[_0x65d2('0x55')]=_[_0x65d2('0x67')](_0x35cb27[_0x65d2('0x4b')],qs[_0x65d2('0x56')](_0x51fee2[_0x65d2('0x52')][_0x65d2('0x56')]));_0x11fc86[_0x65d2('0x55')]=_0x11fc86['attributes'][_0x65d2('0x57')]?_0x11fc86[_0x65d2('0x55')]:_0x35cb27[_0x65d2('0x4b')];if(!_0x51fee2[_0x65d2('0x52')][_0x65d2('0x58')](_0x65d2('0x59'))){_0x11fc86[_0x65d2('0x23')]=qs['limit'](_0x51fee2[_0x65d2('0x52')][_0x65d2('0x23')]);_0x11fc86[_0x65d2('0x21')]=qs[_0x65d2('0x21')](_0x51fee2[_0x65d2('0x52')][_0x65d2('0x21')]);}_0x11fc86[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x51fee2[_0x65d2('0x52')][_0x65d2('0x5b')]);_0x11fc86['where']=qs[_0x65d2('0x54')](_[_0x65d2('0x5c')](_0x51fee2[_0x65d2('0x52')],_0x35cb27[_0x65d2('0x54')]));_0x11fc86[_0x65d2('0x5f')]['ChatWebsiteId']=_0xfaba88['id'];if(_0x51fee2[_0x65d2('0x52')][_0x65d2('0x5d')]){_0x11fc86[_0x65d2('0x5f')]=_[_0x65d2('0x5e')](_0x11fc86[_0x65d2('0x5f')],{'$or':_[_0x65d2('0x39')](_0x11fc86[_0x65d2('0x55')],function(_0x34e879){var _0x55a6fb={};_0x55a6fb[_0x34e879]={'$like':'%'+_0x51fee2[_0x65d2('0x52')][_0x65d2('0x5d')]+'%'};return _0x55a6fb;})});}_0x11fc86=_[_0x65d2('0x5e')]({},_0x11fc86,_0x51fee2[_0x65d2('0x61')]);return db[_0x65d2('0xda')][_0x65d2('0x24')]({'where':_0x11fc86[_0x65d2('0x5f')]})[_0x65d2('0x14')](function(_0x16d657){_0x1fbd02['count']=_0x16d657;if(_0x51fee2[_0x65d2('0x52')][_0x65d2('0x68')]){_0x11fc86[_0x65d2('0x69')]=[{'all':!![]}];}else{_0x11fc86[_0x65d2('0x69')]=[{'model':db[_0x65d2('0x9c')],'as':_0x65d2('0xf7'),'required':![]},{'model':db[_0x65d2('0xe4')],'as':_0x65d2('0x125'),'required':![]}];}return db[_0x65d2('0xda')][_0x65d2('0x63')](_0x11fc86);})[_0x65d2('0x14')](function(_0xff0fe4){_0x1fbd02['rows']=_0xff0fe4;return _0x1fbd02;});}})['then'](respondWithFilteredResult(_0x5794e4,_0x11fc86))['catch'](handleError(_0x5794e4,null));};exports[_0x65d2('0x126')]=function(_0x4138cb,_0x2d2f85){return db['ChatWebsite'][_0x65d2('0x72')]({'where':{'id':_0x4138cb['params']['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x2d2f85,null))[_0x65d2('0x14')](function(_0x2cb663){if(_0x2cb663){return _0x2cb663['addAgents'](_0x4138cb[_0x65d2('0x6b')][_0x65d2('0x7a')],_['omit'](_0x4138cb[_0x65d2('0x6b')],[_0x65d2('0x7a'),'id'])||{})['spread'](function(_0x2bde38){for(var _0x5235f5=0x0;_0x5235f5<_0x4138cb[_0x65d2('0x6b')][_0x65d2('0x7a')][_0x65d2('0x57')];_0x5235f5+=0x1){socket[_0x65d2('0x127')](_0x65d2('0x128'),{'UserId':Number(_0x4138cb['body'][_0x65d2('0x7a')][_0x5235f5]),'ChatWebsiteId':Number(_0x4138cb[_0x65d2('0x66')]['id'])});}return _0x2bde38;});}})[_0x65d2('0x14')](respondWithResult(_0x2d2f85,null))[_0x65d2('0x36')](handleError(_0x2d2f85,null));};exports[_0x65d2('0x129')]=function(_0x1a20a4,_0x14ee33){return db[_0x65d2('0x62')]['find']({'where':{'id':_0x1a20a4[_0x65d2('0x66')]['id']}})[_0x65d2('0x14')](handleEntityNotFound(_0x14ee33,null))['then'](function(_0x4b9467){if(_0x4b9467){return _0x4b9467['removeAgents'](_0x1a20a4[_0x65d2('0x52')][_0x65d2('0x7a')])['then'](function(){if(_[_0x65d2('0x12a')](_0x1a20a4[_0x65d2('0x52')][_0x65d2('0x7a')])){for(var _0x7ad92e=0x0;_0x7ad92e<_0x1a20a4[_0x65d2('0x52')]['ids']['length'];_0x7ad92e+=0x1){socket[_0x65d2('0x127')](_0x65d2('0x12b'),{'UserId':Number(_0x1a20a4['query'][_0x65d2('0x7a')][_0x7ad92e]),'ChatWebsiteId':Number(_0x1a20a4[_0x65d2('0x66')]['id'])});}}else{socket['emit'](_0x65d2('0x12b'),{'UserId':Number(_0x1a20a4[_0x65d2('0x52')]['ids']),'ChatWebsiteId':Number(_0x1a20a4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14ee33,null))[_0x65d2('0x36')](handleError(_0x14ee33,null));};exports[_0x65d2('0x12c')]=function(_0x153381,_0x1f5ac1){var _0x587422={};var _0x497a1c={};var _0x24b5bd;var _0x32293b;return db[_0x65d2('0x62')][_0x65d2('0x78')]({'where':{'id':_0x153381[_0x65d2('0x66')]['id']}})['then'](handleEntityNotFound(_0x1f5ac1,null))[_0x65d2('0x14')](function(_0x401fe1){if(_0x401fe1){_0x24b5bd=_0x401fe1;_0x497a1c[_0x65d2('0x4b')]=_['keys'](db[_0x65d2('0xf8')][_0x65d2('0x50')]);_0x497a1c[_0x65d2('0x52')]=_['keys'](_0x153381['query']);_0x497a1c[_0x65d2('0x54')]=_['intersection'](_0x497a1c[_0x65d2('0x4b')],_0x497a1c[_0x65d2('0x52')]);_0x587422[_0x65d2('0x55')]=_[_0x65d2('0x67')](_0x497a1c[_0x65d2('0x4b')],qs[_0x65d2('0x56')](_0x153381[_0x65d2('0x52')][_0x65d2('0x56')]));_0x587422['attributes']=_0x587422[_0x65d2('0x55')][_0x65d2('0x57')]?_0x587422[_0x65d2('0x55')]:_0x497a1c[_0x65d2('0x4b')];_0x587422[_0x65d2('0x5a')]=qs[_0x65d2('0x5b')](_0x153381['query'][_0x65d2('0x5b')]);_0x587422['where']=qs[_0x65d2('0x54')](_['pick'](_0x153381['query'],_0x497a1c[_0x65d2('0x54')]));if(_0x153381['query'][_0x65d2('0x5d')]){_0x587422['where']=_['merge'](_0x587422[_0x65d2('0x5f')],{'$or':_[_0x65d2('0x39')](_0x587422[_0x65d2('0x55')],function(_0x640c84){var _0x432d1e={};_0x432d1e[_0x640c84]={'$like':'%'+_0x153381[_0x65d2('0x52')][_0x65d2('0x5d')]+'%'};return _0x432d1e;})});}_0x587422=_[_0x65d2('0x5e')]({},_0x587422,_0x153381['options']);return _0x24b5bd[_0x65d2('0x12c')](_0x587422);}})[_0x65d2('0x14')](function(_0x2afdf2){if(_0x2afdf2){_0x32293b=_0x2afdf2['length'];if(!_0x153381['query'][_0x65d2('0x58')](_0x65d2('0x59'))){_0x587422['limit']=qs[_0x65d2('0x23')](_0x153381['query'][_0x65d2('0x23')]);_0x587422['offset']=qs[_0x65d2('0x21')](_0x153381[_0x65d2('0x52')][_0x65d2('0x21')]);}return _0x24b5bd[_0x65d2('0x12c')](_0x587422);}})['then'](function(_0x52b013){if(_0x52b013){return _0x52b013?{'count':_0x32293b,'rows':_0x52b013}:null;}})[_0x65d2('0x14')](respondWithResult(_0x1f5ac1,null))['catch'](handleError(_0x1f5ac1,null));};
\ No newline at end of file
+var _0xa9fc=['destroy','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','inspect','No\x20timezone','map','Interval','Intervals','get','all','some','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','type','index','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','rows','catch','show','params','Pause','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','ChatWebsiteId','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','filename','agentAvatar','file','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','notify','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','list','priority','asc','account','from','contact','headers','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','created','push','applications','close','*,*,*,*','ChatMessage','UserId','User','unshift','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','updatedAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','MailAccountId','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Owner','internal','Tag','Tags','tag','getProactiveActions','virtual','License','increment','utf8','origin','3.5.0','remote','connection','render','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','READ_COMMITTED','ChatApplication','findAndCountAll','getApplications','addProactiveActions','omit','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','handleError','../../mysqldb','redis','defaults','localhost','register','http','client','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','status','json','undefined','limit','count','offset','update'];(function(_0x1b57af,_0x839caa){var _0x242d5d=function(_0xf5e00e){while(--_0xf5e00e){_0x1b57af['push'](_0x1b57af['shift']());}};_0x242d5d(++_0x839caa);}(_0xa9fc,0xfd));var _0xca9f=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xa9fc[_0x368587];return _0x42d33c;};'use strict';var Mustache=require('mustache');var util=require(_0xca9f('0x0'));var path=require(_0xca9f('0x1'));var ejs=require(_0xca9f('0x2'));var fs=require('fs');var fs_extra=require(_0xca9f('0x3'));var _=require(_0xca9f('0x4'));var querystring=require(_0xca9f('0x5'));var htmlToText=require(_0xca9f('0x6'));var Redis=require(_0xca9f('0x7'));var jayson=require('jayson/promise');var url=require('url');var qs=require(_0xca9f('0x8'));var logger=require(_0xca9f('0x9'))(_0xca9f('0xa'));var config=require(_0xca9f('0xb'));var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0xca9f('0xc')];var db=require(_0xca9f('0xd'))['db'];config[_0xca9f('0xe')]=_[_0xca9f('0xf')](config[_0xca9f('0xe')],{'host':_0xca9f('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca9f('0xe')]));require('./chatWebsite.socket')[_0xca9f('0x11')](socket);var client=jayson['client'][_0xca9f('0x12')]({'port':0x232c});var client9002=jayson[_0xca9f('0x13')][_0xca9f('0x12')]({'port':0x232a});var client9003=jayson[_0xca9f('0x13')][_0xca9f('0x12')]({'port':0x232b});var client9001=jayson[_0xca9f('0x13')][_0xca9f('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x4f72c5,_0x18377e,_0x2d0189,_0x424d27){return new Promise(function(_0x37cc03,_0x2d11cb){var _0x36dc70=_0x424d27||client;return _0x36dc70['request'](_0x4f72c5,_0x2d0189)[_0xca9f('0x14')](function(_0x30ae2a){logger['info'](_0xca9f('0x15'),_0x18377e,_0xca9f('0x16'));logger[_0xca9f('0x17')](_0xca9f('0x18'),_0x18377e,_0xca9f('0x16'),JSON[_0xca9f('0x19')](_0x30ae2a));if(_0x30ae2a['error']){if(_0x30ae2a['error'][_0xca9f('0x1a')]===0x1f4){logger[_0xca9f('0x1b')](_0xca9f('0x15'),_0x18377e,_0x30ae2a[_0xca9f('0x1b')][_0xca9f('0x1c')]);return _0x2d11cb(_0x30ae2a[_0xca9f('0x1b')][_0xca9f('0x1c')]);}logger[_0xca9f('0x1b')](_0xca9f('0x15'),_0x18377e,_0x30ae2a[_0xca9f('0x1b')][_0xca9f('0x1c')]);return _0x37cc03(_0x30ae2a[_0xca9f('0x1b')]['message']);}else{logger[_0xca9f('0x1d')](_0xca9f('0x15'),_0x18377e,'request\x20sent');_0x37cc03(_0x30ae2a['result'][_0xca9f('0x1c')]);}})['catch'](function(_0x4ff5b4){logger[_0xca9f('0x1b')](_0xca9f('0x15'),_0x18377e,_0x4ff5b4);_0x2d11cb(_0x4ff5b4);});});}function respondWithStatusCode(_0x3d79b0,_0x173966){_0x173966=_0x173966||0xcc;return function(_0xa34f){if(_0xa34f){return _0x3d79b0['sendStatus'](_0x173966);}return _0x3d79b0[_0xca9f('0x1e')](_0x173966)['end']();};}function respondWithResult(_0x150b46,_0x4a0827){_0x4a0827=_0x4a0827||0xc8;return function(_0x40d00c){if(_0x40d00c){return _0x150b46[_0xca9f('0x1e')](_0x4a0827)[_0xca9f('0x1f')](_0x40d00c);}};}function respondWithFilteredResult(_0x449004,_0x296c16){return function(_0x1f6fab){if(_0x1f6fab){var _0x2cb22f=typeof _0x296c16['offset']===_0xca9f('0x20')&&typeof _0x296c16[_0xca9f('0x21')]==='undefined';var _0x19e8ac=_0x1f6fab[_0xca9f('0x22')];var _0x4b37de=_0x2cb22f?0x0:_0x296c16[_0xca9f('0x23')];var _0x135c51=_0x2cb22f?_0x1f6fab[_0xca9f('0x22')]:_0x296c16[_0xca9f('0x23')]+_0x296c16[_0xca9f('0x21')];var _0x44d7ec;if(_0x135c51>=_0x19e8ac){_0x135c51=_0x19e8ac;_0x44d7ec=0xc8;}else{_0x44d7ec=0xce;}_0x449004[_0xca9f('0x1e')](_0x44d7ec);return _0x449004['set']('Content-Range',_0x4b37de+'-'+_0x135c51+'/'+_0x19e8ac)[_0xca9f('0x1f')](_0x1f6fab);}return null;};}function saveUpdates(_0x43bc6e){return function(_0xde54bf){if(_0xde54bf){return _0xde54bf[_0xca9f('0x24')](_0x43bc6e)[_0xca9f('0x14')](function(_0x1332c4){return _0x1332c4;});}return null;};}function removeEntity(_0x5d5694){return function(_0x3b7969){if(_0x3b7969){return _0x3b7969[_0xca9f('0x25')]()['then'](function(){var _0x2dd14e=_0x3b7969['get']({'plain':!![]});var _0x1af3eb=_0xca9f('0x26');return db[_0xca9f('0x27')][_0xca9f('0x25')]({'where':{'type':_0x1af3eb,'resourceId':_0x2dd14e['id']}})['then'](function(){return _0x3b7969;});})[_0xca9f('0x14')](function(){_0x5d5694[_0xca9f('0x1e')](0xcc)[_0xca9f('0x28')]();});}};}function handleEntityNotFound(_0x2b78b3){return function(_0x19ee44){if(!_0x19ee44){_0x2b78b3[_0xca9f('0x29')](0x194);}return _0x19ee44;};}function handleError(_0x8debf,_0x90c31f){_0x90c31f=_0x90c31f||0x1f4;return function(_0x3eb0b4){logger[_0xca9f('0x1b')](_0x3eb0b4[_0xca9f('0x2a')]);if(_0x3eb0b4[_0xca9f('0x2b')]){delete _0x3eb0b4['name'];}_0x8debf[_0xca9f('0x1e')](_0x90c31f)[_0xca9f('0x2c')](_0x3eb0b4);};}function iftimePromise(_0x238997,_0x52309c){return respondWithRpcPromise('Command',_0xca9f('0x2d'),{'command':_0x52309c[_0xca9f('0x2e')]?util[_0xca9f('0x2f')](_0xca9f('0x30'),_0x238997[_0xca9f('0x31')],_0x52309c['timezone']):util[_0xca9f('0x2f')](_0xca9f('0x32'),_0x238997[_0xca9f('0x31')])},client9002)[_0xca9f('0x14')](function(_0xefedc8){var _0x5e0de0=_0xefedc8&&_0xefedc8['indexOf'](_0xca9f('0x33'))>=0x0?!![]:![];logger[_0xca9f('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x52309c['id'],_0x238997['id'],_0x238997['interval'],_0x5e0de0?_0xca9f('0x34'):'OFFLINE',_0x52309c[_0xca9f('0x2e')]?_0x52309c[_0xca9f('0x2e')]:'No\x20timezone');return _0x5e0de0;})['catch'](function(_0x5588ea){logger[_0xca9f('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x52309c['id'],_0x238997['id'],_0x238997['interval'],util[_0xca9f('0x35')](_0x5588ea,{'showHidden':![],'depth':null}),_0x52309c[_0xca9f('0x2e')]?_0x52309c['timezone']:_0xca9f('0x36'));return![];});}function checkWebsiteIntervals(_0x87bb97){var _0x163090=_[_0xca9f('0x37')](_0x87bb97[_0xca9f('0x38')][_0xca9f('0x39')],function(_0x55b6ee){var _0x4494df=_0x55b6ee[_0xca9f('0x3a')]({'plain':!![]});return iftimePromise(_0x4494df,_0x87bb97);});return Promise[_0xca9f('0x3b')](_0x163090)['then'](function(_0x1931bc){return _[_0xca9f('0x3c')](_0x1931bc);});}function createInteractionObject(_0x133796,_0x56c6e5,_0x3abe1b,_0x11f2a8){var _0x61320a=require(_0xca9f('0x3d'));var _0x12d7b9=new _0x61320a();var _0x520035=_0x12d7b9[_0xca9f('0x3e')](_0x3abe1b['user-agent'])[_0xca9f('0x3f')]();var _0xe90b13=_0x56c6e5[_0xca9f('0x40')];if(_0x3abe1b[_0xca9f('0x41')]){_0xe90b13=_0x3abe1b[_0xca9f('0x41')];}else if(_0x3abe1b[_0xca9f('0x42')]){_0xe90b13=_[_0xca9f('0x43')](_0x3abe1b[_0xca9f('0x42')][_0xca9f('0x44')](','));}return{'ContactId':_0x11f2a8['id'],'ChatWebsiteId':_0x133796,'from':(_0x11f2a8[_0xca9f('0x45')]||'')+'\x20'+(_0x11f2a8['lastName']||''),'customerIp':_0xe90b13,'customerPort':_0x3abe1b[_0xca9f('0x46')]?_0x3abe1b[_0xca9f('0x46')]:null,'referer':_0x56c6e5[_0xca9f('0x47')],'browserName':_0x520035[_0xca9f('0x48')][_0xca9f('0x2b')]&&_0x520035['browser'][_0xca9f('0x49')]?util[_0xca9f('0x2f')](_0xca9f('0x4a'),_0x520035['browser'][_0xca9f('0x2b')],_0x520035[_0xca9f('0x48')][_0xca9f('0x49')]):_0xca9f('0x4b'),'browserVersion':_0x520035[_0xca9f('0x48')][_0xca9f('0x49')]||'unknown','osName':util[_0xca9f('0x2f')](_0xca9f('0x4a'),_0x520035['os'][_0xca9f('0x2b')],_0x520035['os'][_0xca9f('0x49')]),'osVersion':_0x520035['os'][_0xca9f('0x49')],'deviceModel':_0x520035[_0xca9f('0x4c')][_0xca9f('0x4d')]&&_0x520035[_0xca9f('0x4c')][_0xca9f('0x4e')]?util[_0xca9f('0x2f')]('%s\x20%s\x20%s',_0x520035[_0xca9f('0x4c')]['model'],_0x520035[_0xca9f('0x4c')][_0xca9f('0x4e')],_0x520035[_0xca9f('0x4c')][_0xca9f('0x4f')]):null,'deviceVendor':_0x520035[_0xca9f('0x4c')][_0xca9f('0x4e')],'deviceType':_0x520035['device']['type'],'formData':JSON[_0xca9f('0x19')](_0x56c6e5)};}exports[_0xca9f('0x50')]=function(_0x509c9d,_0x1b1047){var _0x5582ca={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2de39c={},_0x338d6f={'count':0x0,'rows':[]};var _0x397125=_[_0xca9f('0x37')](db[_0xca9f('0x51')][_0xca9f('0x52')],function(_0x45f9bc){return{'name':_0x45f9bc[_0xca9f('0x53')],'type':_0x45f9bc[_0xca9f('0x4f')][_0xca9f('0x54')]};});_0x2de39c[_0xca9f('0x4d')]=_['map'](_0x397125,_0xca9f('0x2b'));_0x2de39c[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x509c9d[_0xca9f('0x55')]);_0x2de39c[_0xca9f('0x57')]=_[_0xca9f('0x58')](_0x2de39c[_0xca9f('0x4d')],_0x2de39c['query']);_0x5582ca[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x2de39c['model'],qs[_0xca9f('0x5a')](_0x509c9d[_0xca9f('0x55')]['fields']));_0x5582ca[_0xca9f('0x59')]=_0x5582ca[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x5582ca[_0xca9f('0x59')]:_0x2de39c[_0xca9f('0x4d')];if(!_0x509c9d[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x5582ca['limit']=qs['limit'](_0x509c9d[_0xca9f('0x55')]['limit']);_0x5582ca[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x509c9d[_0xca9f('0x55')][_0xca9f('0x23')]);}_0x5582ca[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x509c9d['query'][_0xca9f('0x5f')]);_0x5582ca[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x509c9d[_0xca9f('0x55')],_0x2de39c[_0xca9f('0x57')]),_0x397125);if(_0x509c9d[_0xca9f('0x55')][_0xca9f('0x62')]){_0x5582ca[_0xca9f('0x60')]=_['merge'](_0x5582ca['where'],{'$or':_['map'](_0x397125,function(_0x207067){if(_0x207067[_0xca9f('0x4f')]!==_0xca9f('0x63')){var _0x3fb80d={};_0x3fb80d[_0x207067[_0xca9f('0x2b')]]={'$like':'%'+_0x509c9d[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x3fb80d;}})});}_0x5582ca=_[_0xca9f('0x64')]({},_0x5582ca,_0x509c9d[_0xca9f('0x65')]);var _0x5e1e2f={'where':_0x5582ca['where']};return db[_0xca9f('0x51')][_0xca9f('0x22')](_0x5e1e2f)[_0xca9f('0x14')](function(_0x8fb35f){_0x338d6f['count']=_0x8fb35f;if(_0x509c9d[_0xca9f('0x55')]['includeAll']){_0x5582ca['include']=[{'all':!![]}];}return db[_0xca9f('0x51')]['findAll'](_0x5582ca);})[_0xca9f('0x14')](function(_0x376b85){_0x338d6f[_0xca9f('0x66')]=_0x376b85;return _0x338d6f;})[_0xca9f('0x14')](respondWithFilteredResult(_0x1b1047,_0x5582ca))[_0xca9f('0x67')](handleError(_0x1b1047,null));};exports[_0xca9f('0x68')]=function(_0x19ae59,_0x95acdf){var _0x20727d={'raw':![],'where':{'id':_0x19ae59[_0xca9f('0x69')]['id']},'include':[{'model':db[_0xca9f('0x6a')],'as':'mandatoryDispositionPause'}]},_0x491a61={};_0x491a61['model']=_[_0xca9f('0x56')](db[_0xca9f('0x51')]['rawAttributes']);_0x491a61[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x19ae59[_0xca9f('0x55')]);_0x491a61['filters']=_['intersection'](_0x491a61[_0xca9f('0x4d')],_0x491a61[_0xca9f('0x55')]);_0x20727d[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x491a61[_0xca9f('0x4d')],qs[_0xca9f('0x5a')](_0x19ae59[_0xca9f('0x55')]['fields']));_0x20727d['attributes']=_0x20727d['attributes']['length']?_0x20727d[_0xca9f('0x59')]:_0x491a61[_0xca9f('0x4d')];if(_0x19ae59[_0xca9f('0x55')][_0xca9f('0x6b')]){_0x20727d['include']=[{'all':!![]}];}_0x20727d=_[_0xca9f('0x64')]({},_0x20727d,_0x19ae59['options']);return db[_0xca9f('0x51')][_0xca9f('0x6c')](_0x20727d)['then'](handleEntityNotFound(_0x95acdf,null))['then'](respondWithResult(_0x95acdf,null))[_0xca9f('0x67')](handleError(_0x95acdf,null));};exports[_0xca9f('0x6d')]=function(_0x52d135,_0x23b7b1){return db[_0xca9f('0x51')]['create'](_0x52d135[_0xca9f('0x6e')],{})['then'](function(_0x26e351){var _0x448806=_0x52d135['user'][_0xca9f('0x3a')]({'plain':!![]});if(!_0x448806)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x448806[_0xca9f('0x6f')]===_0xca9f('0x70')){var _0x4b7b59=_0x26e351['get']({'plain':!![]});var _0x3d14cd='ChatWebsites';return db[_0xca9f('0x71')]['find']({'where':{'name':_0x3d14cd,'userProfileId':_0x448806[_0xca9f('0x72')]},'raw':!![]})[_0xca9f('0x14')](function(_0x9c2a4c){if(_0x9c2a4c&&_0x9c2a4c[_0xca9f('0x73')]===0x0){return db[_0xca9f('0x27')][_0xca9f('0x6d')]({'name':_0x4b7b59['name'],'resourceId':_0x4b7b59['id'],'type':_0x9c2a4c['name'],'sectionId':_0x9c2a4c['id']},{})[_0xca9f('0x14')](function(){return _0x26e351;});}else{return _0x26e351;}})['catch'](function(_0x5251a9){logger[_0xca9f('0x1b')](_0xca9f('0x74'),_0x5251a9);throw _0x5251a9;});}return _0x26e351;})[_0xca9f('0x14')](respondWithResult(_0x23b7b1,0xc9))['catch'](handleError(_0x23b7b1,null));};exports[_0xca9f('0x24')]=function(_0x12b983,_0x49484e){if(_0x12b983['body']['id']){delete _0x12b983[_0xca9f('0x6e')]['id'];}return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x12b983[_0xca9f('0x69')]['id']},'include':[{'model':db[_0xca9f('0x6a')],'as':_0xca9f('0x75')}]})[_0xca9f('0x14')](handleEntityNotFound(_0x49484e,null))[_0xca9f('0x14')](saveUpdates(_0x12b983['body'],null))['then'](respondWithResult(_0x49484e,null))[_0xca9f('0x67')](handleError(_0x49484e,null));};exports['destroy']=function(_0x2d7c5a,_0x4ec969){return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x2d7c5a['params']['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x4ec969,null))[_0xca9f('0x14')](removeEntity(_0x4ec969,null))[_0xca9f('0x67')](handleError(_0x4ec969,null));};exports[_0xca9f('0x76')]=function(_0x1e4e99,_0x3c9816){return db['ChatWebsite'][_0xca9f('0x76')]()['then'](respondWithResult(_0x3c9816,null))[_0xca9f('0x67')](handleError(_0x3c9816,null));};exports[_0xca9f('0x77')]=function(_0x2a3954,_0x235b6b){if(_0x2a3954[_0xca9f('0x6e')]['id']){delete _0x2a3954['body']['id'];}return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x2a3954[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x235b6b,null))['then'](function(_0x36a3fe){if(_0x36a3fe){_0x2a3954[_0xca9f('0x6e')]['ChatWebsiteId']=_0x36a3fe['id'];return db[_0xca9f('0x78')][_0xca9f('0x6d')](_0x2a3954['body']);}})[_0xca9f('0x14')](respondWithResult(_0x235b6b,null))[_0xca9f('0x67')](handleError(_0x235b6b,null));};exports[_0xca9f('0x79')]=function(_0x1c0445,_0x2a922b){var _0xc4969f={'raw':![],'where':{}};var _0x2e80f2={};var _0x3d87ef={'count':0x0,'rows':[]};return db[_0xca9f('0x51')]['findOne']({'where':{'id':_0x1c0445[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x2a922b,null))[_0xca9f('0x14')](function(_0x46a58d){if(_0x46a58d){_0x2e80f2[_0xca9f('0x4d')]=_[_0xca9f('0x56')](db[_0xca9f('0x78')][_0xca9f('0x52')]);_0x2e80f2[_0xca9f('0x55')]=_['keys'](_0x1c0445[_0xca9f('0x55')]);_0x2e80f2[_0xca9f('0x57')]=_['intersection'](_0x2e80f2[_0xca9f('0x4d')],_0x2e80f2[_0xca9f('0x55')]);_0xc4969f['attributes']=_['intersection'](_0x2e80f2['model'],qs[_0xca9f('0x5a')](_0x1c0445[_0xca9f('0x55')][_0xca9f('0x5a')]));_0xc4969f[_0xca9f('0x59')]=_0xc4969f['attributes']['length']?_0xc4969f[_0xca9f('0x59')]:_0x2e80f2[_0xca9f('0x4d')];if(!_0x1c0445[_0xca9f('0x55')]['hasOwnProperty']('nolimit')){_0xc4969f[_0xca9f('0x21')]=qs[_0xca9f('0x21')](_0x1c0445[_0xca9f('0x55')][_0xca9f('0x21')]);_0xc4969f[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x1c0445[_0xca9f('0x55')][_0xca9f('0x23')]);}_0xc4969f[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x1c0445['query'][_0xca9f('0x5f')]);_0xc4969f[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_['pick'](_0x1c0445[_0xca9f('0x55')],_0x2e80f2[_0xca9f('0x57')]));_0xc4969f[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x46a58d['id'];if(_0x1c0445['query']['filter']){_0xc4969f[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0xc4969f[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0xc4969f[_0xca9f('0x59')],function(_0x40e2bd){var _0x490beb={};_0x490beb[_0x40e2bd]={'$like':'%'+_0x1c0445[_0xca9f('0x55')]['filter']+'%'};return _0x490beb;})});}_0xc4969f=_[_0xca9f('0x64')]({},_0xc4969f,_0x1c0445[_0xca9f('0x65')]);return db['Disposition'][_0xca9f('0x22')]({'where':_0xc4969f[_0xca9f('0x60')]})['then'](function(_0x26691a){_0x3d87ef[_0xca9f('0x22')]=_0x26691a;if(_0x1c0445[_0xca9f('0x55')][_0xca9f('0x6b')]){_0xc4969f[_0xca9f('0x7b')]=[{'all':!![]}];}return db[_0xca9f('0x78')][_0xca9f('0x7c')](_0xc4969f);})[_0xca9f('0x14')](function(_0x2b5a67){_0x3d87ef[_0xca9f('0x66')]=_0x2b5a67;return _0x3d87ef;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x2a922b,_0xc4969f))['catch'](handleError(_0x2a922b,null));};exports['removeDispositions']=function(_0x419d25,_0x5c1074){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x419d25[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x5c1074,null))[_0xca9f('0x14')](function(_0x5f3b41){if(_0x5f3b41){return _0x5f3b41[_0xca9f('0x7d')](_0x419d25[_0xca9f('0x55')][_0xca9f('0x7e')]);}})[_0xca9f('0x14')](respondWithStatusCode(_0x5c1074,null))[_0xca9f('0x67')](handleError(_0x5c1074,null));};exports[_0xca9f('0x7f')]=function(_0x43e2f3,_0x280c4e){if(_0x43e2f3[_0xca9f('0x6e')]['id']){delete _0x43e2f3[_0xca9f('0x6e')]['id'];}return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x43e2f3[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x280c4e,null))[_0xca9f('0x14')](function(_0x50b0d5){if(_0x50b0d5){_0x43e2f3[_0xca9f('0x6e')][_0xca9f('0x7a')]=_0x50b0d5['id'];return db[_0xca9f('0x80')][_0xca9f('0x6d')](_0x43e2f3[_0xca9f('0x6e')]);}})[_0xca9f('0x14')](respondWithResult(_0x280c4e,null))['catch'](handleError(_0x280c4e,null));};exports[_0xca9f('0x81')]=function(_0xbfdf0,_0x504f24){var _0x247761={'raw':![],'where':{}};var _0x390b25={};var _0x44b89e={'count':0x0,'rows':[]};return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0xbfdf0[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x504f24,null))[_0xca9f('0x14')](function(_0x419f76){if(_0x419f76){_0x390b25['model']=_['keys'](db[_0xca9f('0x80')][_0xca9f('0x52')]);_0x390b25['query']=_[_0xca9f('0x56')](_0xbfdf0[_0xca9f('0x55')]);_0x390b25[_0xca9f('0x57')]=_[_0xca9f('0x58')](_0x390b25[_0xca9f('0x4d')],_0x390b25[_0xca9f('0x55')]);_0x247761[_0xca9f('0x59')]=_['intersection'](_0x390b25['model'],qs[_0xca9f('0x5a')](_0xbfdf0[_0xca9f('0x55')][_0xca9f('0x5a')]));_0x247761['attributes']=_0x247761[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x247761[_0xca9f('0x59')]:_0x390b25['model'];if(!_0xbfdf0['query']['hasOwnProperty'](_0xca9f('0x5d'))){_0x247761[_0xca9f('0x21')]=qs['limit'](_0xbfdf0['query']['limit']);_0x247761[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0xbfdf0[_0xca9f('0x55')]['offset']);}_0x247761['order']=qs[_0xca9f('0x5f')](_0xbfdf0['query'][_0xca9f('0x5f')]);_0x247761[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0xbfdf0[_0xca9f('0x55')],_0x390b25[_0xca9f('0x57')]));_0x247761[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x419f76['id'];if(_0xbfdf0[_0xca9f('0x55')][_0xca9f('0x62')]){_0x247761[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0x247761['where'],{'$or':_[_0xca9f('0x37')](_0x247761['attributes'],function(_0x42dd70){var _0x1b0b37={};_0x1b0b37[_0x42dd70]={'$like':'%'+_0xbfdf0[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x1b0b37;})});}_0x247761=_[_0xca9f('0x64')]({},_0x247761,_0xbfdf0[_0xca9f('0x65')]);return db['CannedAnswer'][_0xca9f('0x22')]({'where':_0x247761[_0xca9f('0x60')]})['then'](function(_0x534daa){_0x44b89e[_0xca9f('0x22')]=_0x534daa;if(_0xbfdf0[_0xca9f('0x55')]['includeAll']){_0x247761['include']=[{'all':!![]}];}return db[_0xca9f('0x80')]['findAll'](_0x247761);})[_0xca9f('0x14')](function(_0x185a8c){_0x44b89e['rows']=_0x185a8c;return _0x44b89e;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x504f24,_0x247761))[_0xca9f('0x67')](handleError(_0x504f24,null));};exports[_0xca9f('0x83')]=function(_0x59080c,_0x12c4a7){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x59080c[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x12c4a7,null))['then'](function(_0x2fcd16){if(_0x2fcd16){return _0x2fcd16[_0xca9f('0x83')](_0x59080c[_0xca9f('0x55')][_0xca9f('0x7e')]);}})[_0xca9f('0x14')](respondWithStatusCode(_0x12c4a7,null))[_0xca9f('0x67')](handleError(_0x12c4a7,null));};exports[_0xca9f('0x84')]=function(_0x2c74b7,_0xc598fe){_0x2c74b7['body'][_0xca9f('0x85')]=_0x2c74b7['file'][_0xca9f('0x86')];return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x2c74b7[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0xc598fe,null))['then'](saveUpdates(_0x2c74b7[_0xca9f('0x6e')],null))['then'](respondWithResult(_0xc598fe,null))[_0xca9f('0x67')](handleError(_0xc598fe,null));};exports['addAvatar']=function(_0x1f82c2,_0x192bb8){_0x1f82c2[_0xca9f('0x6e')][_0xca9f('0x87')]=_0x1f82c2[_0xca9f('0x88')][_0xca9f('0x86')];return db['ChatWebsite']['find']({'where':{'id':_0x1f82c2[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x192bb8,null))[_0xca9f('0x14')](saveUpdates(_0x1f82c2[_0xca9f('0x6e')],null))['then'](respondWithResult(_0x192bb8,null))[_0xca9f('0x67')](handleError(_0x192bb8,null));};exports['addCustomerAvatar']=function(_0x1ff090,_0x5902b6){_0x1ff090[_0xca9f('0x6e')][_0xca9f('0x89')]=_0x1ff090[_0xca9f('0x88')][_0xca9f('0x86')];return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x1ff090['params']['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x5902b6,null))[_0xca9f('0x14')](saveUpdates(_0x1ff090[_0xca9f('0x6e')],null))['then'](respondWithResult(_0x5902b6,null))[_0xca9f('0x67')](handleError(_0x5902b6,null));};exports['addSystemAvatar']=function(_0x1b87c8,_0x396b04){_0x1b87c8[_0xca9f('0x6e')][_0xca9f('0x8a')]=_0x1b87c8['file'][_0xca9f('0x86')];return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x1b87c8[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x396b04,null))[_0xca9f('0x14')](saveUpdates(_0x1b87c8[_0xca9f('0x6e')],null))[_0xca9f('0x14')](respondWithResult(_0x396b04,null))[_0xca9f('0x67')](handleError(_0x396b04,null));};exports[_0xca9f('0x8b')]=function(_0x8ea22f,_0x365a8a){var _0x223732=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x8e'));var _0x4c7625={'where':{'id':_0x8ea22f['params']['id']},'attributes':['id',_0xca9f('0x85')],'raw':!![]};var _0x4622c6=![];return require(_0xca9f('0x8f'))[_0xca9f('0x90')]()[_0xca9f('0x14')](function(_0x32c2a8){if(_0x32c2a8){_0x4622c6=_0x32c2a8[_0xca9f('0x91')];}})[_0xca9f('0x14')](function(){return db[_0xca9f('0x51')]['find'](_0x4c7625);})[_0xca9f('0x14')](handleEntityNotFound(_0x365a8a,null))[_0xca9f('0x14')](function(_0x4e9574){if(_0x4e9574){if(!_[_0xca9f('0x92')](_0x4e9574['sitepic'])){if(fs[_0xca9f('0x93')](path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x94'),_0x4e9574['sitepic']))&&_0x4622c6){_0x223732=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x94'),_0x4e9574[_0xca9f('0x85')]);}}return _0x365a8a[_0xca9f('0x95')](_0x223732);}})['catch'](handleError(_0x365a8a,null));};exports['getAvatar']=function(_0x3dec24,_0xe232e5){var _0x29df49=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0x96'));var _0x97a0f5={'where':{'id':_0x3dec24[_0xca9f('0x69')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xca9f('0x51')][_0xca9f('0x6c')](_0x97a0f5)['then'](handleEntityNotFound(_0xe232e5,null))[_0xca9f('0x14')](function(_0x462254){if(_0x462254){if(!_[_0xca9f('0x92')](_0x462254['agentAvatar'])){if(fs['existsSync'](path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/images/avatars/',_0x462254[_0xca9f('0x87')]))){_0x29df49=path['join'](config[_0xca9f('0x8d')],_0xca9f('0x97'),_0x462254[_0xca9f('0x87')]);}}return _0xe232e5['download'](_0x29df49);}})[_0xca9f('0x67')](handleError(_0xe232e5,null));};exports[_0xca9f('0x98')]=function(_0x948c25,_0x57e916){var _0x4545cc=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/images/avatars/customer_avatar.png');var _0x4a3d38={'where':{'id':_0x948c25[_0xca9f('0x69')]['id']},'attributes':['id',_0xca9f('0x89'),_0xca9f('0x99')],'raw':!![]};return db[_0xca9f('0x51')][_0xca9f('0x6c')](_0x4a3d38)[_0xca9f('0x14')](handleEntityNotFound(_0x57e916,null))[_0xca9f('0x14')](function(_0xdd77d5){if(_0xdd77d5){if(!_[_0xca9f('0x92')](_0xdd77d5[_0xca9f('0x89')])){if(fs[_0xca9f('0x93')](path[_0xca9f('0x8c')](config['root'],_0xca9f('0x97'),_0xdd77d5[_0xca9f('0x89')]))&&_0xdd77d5['showCustomerAvatar']){_0x4545cc=path[_0xca9f('0x8c')](config['root'],'server/files/images/avatars/',_0xdd77d5[_0xca9f('0x89')]);}}return _0x57e916[_0xca9f('0x95')](_0x4545cc);}})[_0xca9f('0x67')](handleError(_0x57e916,null));};exports['getSystemAvatar']=function(_0x295479,_0xb8fc0e){var _0x502a19=path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/images/avatars/system_avatar.png');var _0x354695={'where':{'id':_0x295479[_0xca9f('0x69')]['id']},'attributes':['id',_0xca9f('0x8a')],'raw':!![]};return db['ChatWebsite']['find'](_0x354695)[_0xca9f('0x14')](handleEntityNotFound(_0xb8fc0e,null))[_0xca9f('0x14')](function(_0x3bee67){if(_0x3bee67){if(!_[_0xca9f('0x92')](_0x3bee67[_0xca9f('0x8a')])){if(fs[_0xca9f('0x93')](path['join'](config[_0xca9f('0x8d')],_0xca9f('0x97'),_0x3bee67[_0xca9f('0x8a')]))){_0x502a19=path[_0xca9f('0x8c')](config['root'],_0xca9f('0x97'),_0x3bee67[_0xca9f('0x8a')]);}}return _0xb8fc0e[_0xca9f('0x95')](_0x502a19);}})[_0xca9f('0x67')](handleError(_0xb8fc0e,null));};exports[_0xca9f('0x9a')]=function(_0x2c2686,_0x409bf0){var _0x2ca6f2={'body':_0x2c2686[_0xca9f('0x6e')],'channel':_0xca9f('0x9b')};var _0x2771be=[];var _0x36097d=[];var _0x331e75={};var _0x122302=![];return db[_0xca9f('0x9c')][_0xca9f('0x76')]()[_0xca9f('0x14')](function(_0x5a309c){if(!_0x5a309c){throw new db['Sequelize'][(_0xca9f('0x9d'))](_0xca9f('0x9e'));}_0x2771be=_[_0xca9f('0x9f')](_['keys'](_0x5a309c),[_0xca9f('0xa0'),'updatedAt']);_0x36097d=_['difference'](_[_0xca9f('0x56')](_0x5a309c),[_0xca9f('0xa0'),'updatedAt','CompanyId',_0xca9f('0xa1')]);if(_0x2c2686[_0xca9f('0x6e')]['id']){delete _0x2c2686['body']['id'];}if(_[_0xca9f('0x92')](_0x2c2686['body']['from'])){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa3'));}if(_[_0xca9f('0x92')](_0x2c2686[_0xca9f('0x6e')][_0xca9f('0x6e')])||_0x2c2686['body'][_0xca9f('0x6e')]===''){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa4'));}if(_[_0xca9f('0x92')](_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xa5')])){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa6')+_0x36097d);}if(!_[_0xca9f('0xa7')](_0x36097d,_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xa5')])){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa8')+_0x36097d);}_0x331e75[_0x2c2686['body'][_0xca9f('0xa5')]]=_0x2c2686[_0xca9f('0x6e')]['from'];})[_0xca9f('0x14')](function(){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x2c2686[_0xca9f('0x69')]['id']},'include':[{'model':db[_0xca9f('0xa9')],'as':_0xca9f('0xaa'),'include':[{'model':db[_0xca9f('0x9c')],'as':_0xca9f('0xab'),'where':_0x331e75,'limit':0x1,'order':[['updatedAt',_0xca9f('0xac')]]}]},{'model':db['ChatApplication'],'as':_0xca9f('0xad')},{'model':db[_0xca9f('0x38')],'as':_0xca9f('0x38'),'include':[{'model':db[_0xca9f('0x38')],'as':_0xca9f('0x39'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xca9f('0x14')](function(_0x5d9417){if(!_0x5d9417)throw new APINotFoundError(util[_0xca9f('0x2f')](_0xca9f('0xae'),_0x2c2686[_0xca9f('0x69')]['id']));if(!_0x5d9417['Interval']||!_0x5d9417[_0xca9f('0x38')][_0xca9f('0x39')])return[_0x5d9417,!![]];return[_0x5d9417,checkWebsiteIntervals(_0x5d9417)];})[_0xca9f('0xaf')](function(_0x3fccad,_0x5c8bd2){if(!_0x5c8bd2)throw new APIOutOfIntervalError();if(!_0x3fccad['List'])return;_0x2ca6f2['account']=_0x3fccad;_0x2ca6f2[_0xca9f('0xb0')]=_0x3fccad[_0xca9f('0xaa')];_0x2ca6f2['applications']=_['orderBy'](_0x3fccad[_0xca9f('0xad')],[_0xca9f('0xb1')],[_0xca9f('0xb2')]);if(_0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xad')]){delete _0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xad')];}if(_0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xaa')]&&_0x2ca6f2[_0xca9f('0xb3')]['List'][_0xca9f('0xab')][_0xca9f('0x5b')]){return _0x2ca6f2[_0xca9f('0xb3')][_0xca9f('0xaa')][_0xca9f('0xab')][0x0];}var _0x3614b4=_[_0xca9f('0xf')](_0x2c2686[_0xca9f('0x6e')],{'firstName':_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb4')],'ListId':_0x3fccad['ListId']});_0x3614b4[_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xa5')]]=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb4')];return db['CmContact'][_0xca9f('0x6d')](_0x3614b4,{'fields':_0x2771be,'raw':!![]});})[_0xca9f('0x14')](function(_0x55398d){_0x2ca6f2[_0xca9f('0xb5')]=_0x55398d;var _0x1281e8=createInteractionObject(_0x2c2686['params']['id'],_0x2c2686['body'],_0x2c2686[_0xca9f('0xb6')],_0x55398d);var _0x159000={'ChatWebsiteId':_0x2c2686['params']['id'],'closed':![]};if(_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')]){_0x159000[_0xca9f('0xb7')]=_0x2c2686[_0xca9f('0x6e')]['threadId'];return db[_0xca9f('0xb8')]['find']({'where':_0x159000})[_0xca9f('0x14')](function(_0x24c69f){if(_0x24c69f){_0x122302=!![];return _0x24c69f;}_0x1281e8[_0xca9f('0xb7')]=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')];_0x1281e8['externalUrl']=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb9')];return db[_0xca9f('0xb8')]['create'](_0x1281e8);});}_0x159000['ContactId']=_0x55398d['id'];if(_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xba')]&&_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xba')]['id']){_0x159000['id']=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xba')]['id'];return db[_0xca9f('0xb8')][_0xca9f('0x6c')]({'where':_0x159000})[_0xca9f('0x14')](function(_0x4f4dff){if(_0x4f4dff){_0x122302=!![];return _0x4f4dff;}return db[_0xca9f('0xb8')][_0xca9f('0x6d')](_0x1281e8);});}return db[_0xca9f('0xb8')][_0xca9f('0x6d')](_0x1281e8);})[_0xca9f('0x14')](function(_0x2508ab){if(!_0x122302)return _0x2508ab;var _0x4d6985={'from':(_0x2ca6f2['contact'][_0xca9f('0x45')]||'')+'\x20'+(_0x2ca6f2[_0xca9f('0xb5')][_0xca9f('0xbb')]||'')};if(_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')]&&_0x2c2686['body'][_0xca9f('0xbc')]&&_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xb7')]!=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xbc')]){_0x4d6985['threadId']=_0x2c2686[_0xca9f('0x6e')][_0xca9f('0xbc')];}return _0x2508ab[_0xca9f('0x24')](_0x4d6985);})[_0xca9f('0x14')](function(_0x30bba9){_0x2ca6f2['interaction']=_0x30bba9[_0xca9f('0x3a')]({'plain':!![]});_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xbd')]=!_0x122302;if(_0x2ca6f2[_0xca9f('0xba')]['created']){if(_0x2ca6f2[_0xca9f('0xb3')]['autoclose']){_0x2ca6f2['applications'][_0xca9f('0xbe')]({'id':0x0,'priority':_0x2ca6f2[_0xca9f('0xbf')]['length']+0x1,'app':_0xca9f('0xc0'),'appdata':'unmanaged','interval':_0xca9f('0xc1')});}}return db[_0xca9f('0xc2')]['create']({'body':_0x2c2686[_0xca9f('0x6e')][_0xca9f('0x6e')],'ChatWebsiteId':_0x2c2686['params']['id'],'ChatInteractionId':_0x30bba9['id'],'direction':'in','ContactId':_0x2ca6f2[_0xca9f('0xb5')]['id'],'AttachmentId':_0x2c2686[_0xca9f('0x6e')]['AttachmentId']});})[_0xca9f('0x14')](function(_0x47325b){_0x2ca6f2[_0xca9f('0x1c')]=_0x47325b;if(!_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc3')]){return;}return db[_0xca9f('0xc4')][_0xca9f('0x6c')]({'attributes':['id',_0xca9f('0x2b')],'where':{'id':_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc3')]}});})[_0xca9f('0x14')](function(_0x40e632){if(_0x40e632){_0x2ca6f2['applications'][_0xca9f('0xc5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x40e632['name']+','+(_0x2ca6f2[_0xca9f('0xb3')]['waitForTheAssignedAgent']||0xa),'interval':_0xca9f('0xc1')});_0x2ca6f2[_0xca9f('0xc6')]=!![];}if(!_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc7')]){return;}return db[_0xca9f('0xc8')][_0xca9f('0x6c')]({'attributes':['id',_0xca9f('0x2b')],'where':{'id':_0x2ca6f2[_0xca9f('0xba')][_0xca9f('0xc7')]}});})[_0xca9f('0x14')](function(_0x59ca2f){if(_0x59ca2f){_0x2ca6f2[_0xca9f('0xbf')][_0xca9f('0xc5')]({'id':0x0,'priority':0x1,'app':_0xca9f('0xc9'),'appdata':_0x59ca2f['name']+','+(_0x2ca6f2['account'][_0xca9f('0xca')]||0x12c),'interval':_0xca9f('0xc1')});}return respondWithRpcPromise(_0xca9f('0xcb'),'startRouting',_0x2ca6f2);})[_0xca9f('0x14')](function(_0x2bf376){respondWithRpcPromise(_0xca9f('0xcc'),_0xca9f('0xcc'),{'event':_0xca9f('0x9a'),'message':_0x2bf376},client9002);return _0x2bf376;})[_0xca9f('0x14')](respondWithResult(_0x409bf0,null))['catch'](APIHandleError(_0x409bf0));};exports['offline']=function(_0x3aedda,_0x39c187){var _0x441705,_0x2c59c3,_0x335695;var _0x417c7e=[];var _0x35d6b6={};var _0x5ac80a=_0x3aedda['files']||[];var _0x3f3570=[];var _0x549fa0;return db[_0xca9f('0x9c')][_0xca9f('0x76')]()[_0xca9f('0x14')](function(_0x96099c){if(!_0x96099c){throw new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))]('no\x20available\x20attributes');}_0x417c7e=_[_0xca9f('0x9f')](_['keys'](_0x96099c),['createdAt',_0xca9f('0xcd'),'CompanyId',_0xca9f('0xa1')]);if(_0x3aedda[_0xca9f('0x6e')]['id']){delete _0x3aedda[_0xca9f('0x6e')]['id'];}if(_[_0xca9f('0x92')](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')])){throw _0x39c187[_0xca9f('0x1e')](0x1f4)[_0xca9f('0x2c')](new db['Sequelize'][(_0xca9f('0x9d'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0x6e')])||_0x3aedda[_0xca9f('0x6e')]['body']===''){throw _0x39c187[_0xca9f('0x1e')](0x1f4)['send'](new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xa4')));}if(_[_0xca9f('0x92')](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xce')])){throw _0x39c187[_0xca9f('0x1e')](0x1f4)[_0xca9f('0x2c')](new db[(_0xca9f('0xa2'))][(_0xca9f('0x9d'))](_0xca9f('0xcf')+_0x417c7e));}if(!_[_0xca9f('0xa7')](_0x417c7e,_0x3aedda['body'][_0xca9f('0xce')])){throw _0x39c187[_0xca9f('0x1e')](0x1f4)[_0xca9f('0x2c')](new db[(_0xca9f('0xa2'))]['ValidationError'](_0xca9f('0xd0')+_0x417c7e));}_0x35d6b6[_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xce')]]=_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')];})[_0xca9f('0x14')](function(){return db['ChatWebsite'][_0xca9f('0x6c')]({'where':{'id':_0x3aedda[_0xca9f('0x69')]['id']},'include':[{'model':db['CmList'],'as':_0xca9f('0xaa')},{'model':db[_0xca9f('0xd1')],'as':_0xca9f('0xd1')}]});})[_0xca9f('0x14')](handleEntityNotFound(_0x39c187,null))[_0xca9f('0x14')](function(_0x4465cf){if(_0x4465cf&&_0x4465cf[_0xca9f('0xaa')]){_0x2c59c3=_0x4465cf;var _0x41d485=_['defaults'](_0x3aedda[_0xca9f('0x6e')],{'firstName':_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')],'phone':_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xb4')],'ListId':_0x4465cf['ListId']});_0x41d485[_0x3aedda[_0xca9f('0x6e')][_0xca9f('0xce')]]=_0x3aedda['body'][_0xca9f('0xb4')];return db[_0xca9f('0x9c')][_0xca9f('0xd2')]({'where':_0x35d6b6,'defaults':_0x41d485});}})[_0xca9f('0xaf')](function(_0x32cae8){if(_0x32cae8){_0x335695=_0x32cae8;var _0x1a88c5=fs[_0xca9f('0xd3')](path[_0xca9f('0x8c')](config['root'],_0xca9f('0xd4')),'utf8');var _0x5c4e5c=ejs['render'](_0x1a88c5,{'body':_[_0xca9f('0xd5')](_0x3aedda[_0xca9f('0x6e')][_0xca9f('0x6e')]),'bodyTitle':_0x2c59c3[_0xca9f('0xd6')]});return db[_0xca9f('0xd7')]['create']({'body':_0x5c4e5c,'plainBody':htmlToText[_0xca9f('0xd8')](_0x5c4e5c),'ContactId':_0x32cae8['id'],'ChatWebsiteId':_0x2c59c3['id']});}})[_0xca9f('0x14')](function(_0xe923a4){_0x549fa0=_0xe923a4;if(_0x5ac80a['length']){var _0x29b84b=_0x5ac80a[_0xca9f('0x37')](function(_0x314bdf){return{'name':_0x314bdf[_0xca9f('0xd9')],'basename':_0x314bdf['filename'],'type':_0x314bdf['mimetype'],'ChatOfflineMessageId':_0xe923a4['id']};});_0x3f3570=_0x29b84b[_0xca9f('0x37')](_0x4497a4=>{var _0x362568={'filename':_0x4497a4[_0xca9f('0x2b')],'path':path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],_0xca9f('0xda'),_0xca9f('0xdb'),_0xca9f('0xdc'),_0xca9f('0xdd'),_0x4497a4[_0xca9f('0xde')])};return _0x362568;});if(!_0x2c59c3[_0xca9f('0xdf')]){return db[_0xca9f('0xe0')][_0xca9f('0xe1')](function(_0x258d77){return db[_0xca9f('0xe2')][_0xca9f('0xe3')](_0x29b84b,{'transaction':_0x258d77});});}}})[_0xca9f('0x14')](function(){if(_0x549fa0){_0x441705=_0x549fa0;return db[_0xca9f('0xd1')][_0xca9f('0x82')]({'where':{'service':!![]},'include':[{'model':db[_0xca9f('0xe4')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xca9f('0xe5'),'raw':!![]}]}]});}})[_0xca9f('0x14')](function(_0x1b5ddd){if(_0x1b5ddd&&_0x1b5ddd[_0xca9f('0xe6')]&&_0x2c59c3[_0xca9f('0xe7')]&&_0x2c59c3[_0xca9f('0xe8')]){var _0x5d22e5=_0x1b5ddd['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xca9f('0xe9'),{'account':_0x5d22e5,'message':{'from':util[_0xca9f('0x2f')](_0xca9f('0xea'),_0x1b5ddd[_0xca9f('0x2b')],_0x1b5ddd['email']||_0x1b5ddd[_0xca9f('0xe6')][_0xca9f('0x70')]),'to':_0x2c59c3['forwardOfflineAddress'],'subject':_0x2c59c3['offlineMessageSubject'],'html':_0x441705[_0xca9f('0x6e')],'attachments':_0x3f3570}},client9003)[_0xca9f('0x14')](function(){return _0x441705;})[_0xca9f('0x67')](function(_0x1e5d1c){logger['error'](_0x1e5d1c);});}})[_0xca9f('0x14')](function(){if(_0x2c59c3&&_0x2c59c3['openNewInteraction']&&_0x2c59c3[_0xca9f('0xeb')]){var _0x328974=[];if(_0x5ac80a[_0xca9f('0x5b')]){_0x328974=_0x5ac80a['map'](function(_0x223d1a){return{'name':_0x223d1a[_0xca9f('0xd9')],'basename':_0x223d1a[_0xca9f('0x86')],'type':_0x223d1a['mimetype'],'ChatOfflineMessageId':_0x549fa0['id']};});}var _0x2d6d3f;if(!_['isNil'](_0x2c59c3[_0xca9f('0xec')])){var _0x2cd013=_[_0xca9f('0x37')](_0x3aedda['body'],function(_0x365ab3){return _0x365ab3;});var _0x1704c3=_[_0xca9f('0xed')](_0x2cd013)[0x0];var _0x10a35a=_[_0xca9f('0xee')](_0x1704c3,function(_0x2364ce){return _0x2364ce;});_0x2d6d3f=_0x10a35a[0x1][_0x2c59c3[_0xca9f('0xec')]];}var _0x484c24={'from':_0x335695[_0xca9f('0xef')],'firstName':_0x335695[_0xca9f('0x45')],'lastName':_0x335695[_0xca9f('0xbb')],'mapKey':'email','message':{'from':_0x335695[_0xca9f('0xef')],'to':_0x2c59c3[_0xca9f('0xd1')][_0xca9f('0xef')],'cc':'','subject':_['isNil'](_0x2d6d3f)?_0x2c59c3[_0xca9f('0xf0')]:_0x2d6d3f,'messageId':'','sentAt':new Date(),'attach':_0x328974[_0xca9f('0x5b')],'attachments':_0x328974,'originChannel':_0xca9f('0xf1'),'ChatWebsiteId':_0x2c59c3['id'],'ChatOfflineMessageId':_0x441705['id'],'originTo':_0x2c59c3[_0xca9f('0xd1')][_0xca9f('0xef')]},'body':_0x441705[_0xca9f('0x6e')]};var _0xc503d7={'account':{'id':_0x2c59c3[_0xca9f('0xeb')]},'body':_0x484c24,'log':_0xca9f('0xf2')};return respondWithRpcPromise(_0xca9f('0xf2'),_0xca9f('0xf3'),_0xc503d7,client9001)[_0xca9f('0x14')](function(){return _0x441705;})[_0xca9f('0x67')](function(_0xf69cb){logger[_0xca9f('0x1b')](_0xf69cb);});}return;})[_0xca9f('0x14')](function(){if(_0x441705){return _0x441705;}})['then'](respondWithResult(_0x39c187,null))['catch'](function(){for(var _0x4c30d9 of _0x5ac80a){var _0x4f9f2f=path['join'](config[_0xca9f('0x8d')],'server',_0xca9f('0xdb'),_0xca9f('0xdc'),_0xca9f('0xdd'),_0x4c30d9[_0xca9f('0x86')]);fs_extra[_0xca9f('0xf4')](_0x4f9f2f)[_0xca9f('0x67')](function(_0x51cb72){logger[_0xca9f('0x1b')](_0xca9f('0xf5'),_0x4f9f2f,_0x51cb72);});}});};exports[_0xca9f('0xf6')]=function(_0xb3ba93,_0xfe02eb){return db[_0xca9f('0xb8')][_0xca9f('0x6c')]({'where':{'id':_0xb3ba93[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0xfe02eb,null))['then'](function(_0x18c699){if(_0x18c699){return _0x18c699[_0xca9f('0xf6')](_0xb3ba93[_0xca9f('0x6e')]['ids'],_['omit'](_0xb3ba93[_0xca9f('0x6e')],['ids','id'])||{});}})[_0xca9f('0x14')](respondWithResult(_0xfe02eb,null))['catch'](handleError(_0xfe02eb,null));};exports['getInteractions']=function(_0x240547,_0x20d914){var _0x44734d={'raw':![],'where':{}};var _0x5708b2={};var _0x38d93d={'count':0x0,'rows':[]};return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x240547[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x20d914,null))[_0xca9f('0x14')](function(_0x182397){if(_0x182397){_0x5708b2['model']=_[_0xca9f('0x56')](db[_0xca9f('0xb8')]['rawAttributes']);_0x5708b2[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x240547[_0xca9f('0x55')]);_0x5708b2[_0xca9f('0x57')]=_['intersection'](_0x5708b2['model'],_0x5708b2[_0xca9f('0x55')]);_0x44734d[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x5708b2[_0xca9f('0x4d')],qs[_0xca9f('0x5a')](_0x240547['query'][_0xca9f('0x5a')]));_0x44734d['attributes']=_0x44734d[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x44734d[_0xca9f('0x59')]:_0x5708b2[_0xca9f('0x4d')];if(!_0x240547[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x44734d[_0xca9f('0x21')]=qs['limit'](_0x240547[_0xca9f('0x55')]['limit']);_0x44734d[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x240547[_0xca9f('0x55')]['offset']);}_0x44734d[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x240547['query'][_0xca9f('0x5f')]);_0x44734d['where']=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x240547['query'],_0x5708b2[_0xca9f('0x57')]));_0x44734d[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x182397['id'];if(_0x240547['query'][_0xca9f('0x62')]){_0x44734d[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0x44734d[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x44734d[_0xca9f('0x59')],function(_0x3eefbc){var _0x51723d={};_0x51723d[_0x3eefbc]={'$like':'%'+_0x240547[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x51723d;})});}_0x44734d=_[_0xca9f('0x64')]({},_0x44734d,_0x240547['options']);return db[_0xca9f('0xb8')][_0xca9f('0x22')]({'where':_0x44734d[_0xca9f('0x60')]})[_0xca9f('0x14')](function(_0x403185){_0x38d93d['count']=_0x403185;if(_0x240547['query']['includeAll']){_0x44734d[_0xca9f('0x7b')]=[{'model':db[_0xca9f('0x9c')],'as':_0xca9f('0xf7'),'required':![]},{'model':db[_0xca9f('0xc4')],'as':_0xca9f('0xf8'),'attributes':[_0xca9f('0x2b'),'fullname',_0xca9f('0xf9')],'required':![]},{'model':db[_0xca9f('0xfa')],'as':_0xca9f('0xfb'),'attributes':['id',_0xca9f('0x2b'),'color'],'where':_0x240547[_0xca9f('0x55')][_0xca9f('0xfc')]?{'id':_0x240547['query'][_0xca9f('0xfc')]}:undefined,'required':_0x240547[_0xca9f('0x55')][_0xca9f('0xfc')]?!![]:![]}];}return db[_0xca9f('0xb8')][_0xca9f('0x7c')](_0x44734d);})[_0xca9f('0x14')](function(_0x17833c){_0x38d93d[_0xca9f('0x66')]=_0x17833c;return _0x38d93d;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x20d914,_0x44734d))[_0xca9f('0x67')](handleError(_0x20d914,null));};exports[_0xca9f('0x2d')]=function(_0x25ec4c,_0x29e558){var _0x392438=0x0;var _0x2af499=0x0;var _0x110e57=![];var _0x5ca130;var _0x3d79db;return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x25ec4c['params']['id']},'include':[{'model':db['Interval'],'as':_0xca9f('0x38'),'include':[{'model':db[_0xca9f('0x38')],'as':_0xca9f('0x39'),'attributes':['id',_0xca9f('0x31')]}]}]})[_0xca9f('0x14')](handleEntityNotFound(_0x29e558,null))[_0xca9f('0x14')](function(_0x1df8d5){if(_0x1df8d5){_0x5ca130=_0x1df8d5;return _0x1df8d5[_0xca9f('0xfd')]({'raw':!![]});}})['then'](function(_0x12364e){if(_0x5ca130){if(_0x12364e){_0x3d79db=_0x12364e;}}return require(_0xca9f('0x8f'))[_0xca9f('0x90')]();})['then'](function(_0x5a6b3e){if(_0x5a6b3e){_0x2af499=_0x5a6b3e[_0xca9f('0xfe')];_0x110e57=_0x5a6b3e['custom'];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xca9f('0x14')](function(_0x146b17){_0x392438=_0x146b17;if(_0x2af499&&_0x146b17>_0x2af499){return db[_0xca9f('0xff')][_0xca9f('0x82')]({'where':{'id':0x1}})[_0xca9f('0x14')](function(_0xdf0d8e){if(_0xdf0d8e){_0xdf0d8e[_0xca9f('0x100')]('chatLicenseExceeded');}});}})['then'](function(){if(!_0x5ca130[_0xca9f('0x38')]||!_0x5ca130[_0xca9f('0x38')][_0xca9f('0x39')])return!![];return checkWebsiteIntervals(_0x5ca130);})[_0xca9f('0x14')](function(_0x3584c3){var _0x236cf2=fs[_0xca9f('0xd3')](path[_0xca9f('0x8c')](config[_0xca9f('0x8d')],'server/files/chat/iframe.ejs'),_0xca9f('0x101'));var _0x2b24fd=new url['URL'](_0x5ca130['address'])[_0xca9f('0x102')];var _0x2014d3=_0xca9f('0x103');var _0x28f85a=![];var _0x26da36={'chatVersion':_0x2014d3,'chatWebsiteAddressOrigin':_0x2b24fd,'remote':_0x5ca130[_0xca9f('0x104')],'query':querystring[_0xca9f('0x19')](_[_0xca9f('0x64')](_0x5ca130[_0xca9f('0x3a')]({'plain':!![]}),{'customerIp':_0x25ec4c[_0xca9f('0xb6')][_0xca9f('0x42')]||_0x25ec4c[_0xca9f('0xb6')]['x-real-ip']||_0x25ec4c[_0xca9f('0x105')]['remoteAddress']||_0x25ec4c['ip'],'referer':_0x25ec4c[_0xca9f('0xb6')][_0xca9f('0x47')],'openedInteractions':_0x392438,'maxInteractions':_0x2af499,'virtual':_0x110e57[_0xca9f('0xfe')],'online':_0x3584c3,'custom':_0x110e57}))['replace'](/'/g,'\x5c\x27')};_0x29e558[_0xca9f('0x2c')](ejs[_0xca9f('0x106')](Mustache[_0xca9f('0x106')](_0x236cf2,_0x26da36),{'proactiveActions':_0x3d79db,'alignment':_0x5ca130[_0xca9f('0x107')],'verticalAlignment':_0x5ca130[_0xca9f('0x108')],'div_color':_0x5ca130['color'],'labelText':_0x5ca130[_0xca9f('0x109')],'text_color':_0x5ca130[_0xca9f('0x10a')],'text_button_color':_0x5ca130['textButtonColor'],'button_color':_0x5ca130[_0xca9f('0x10b')],'background_color':_0x5ca130[_0xca9f('0x10c')],'hideWhenOffline':_0x5ca130[_0xca9f('0x10d')],'intervalId':_0x5ca130[_0xca9f('0x10e')],'isDevelopment':_0x28f85a,'chatVersion':_0x2014d3}));})['catch'](handleError(_0x29e558,null));};exports['addApplications']=function(_0x1bbd50,_0x31b68e){var _0x171be2=_0x1bbd50[_0xca9f('0x69')]['id'];var _0x8a6f66=_0x1bbd50[_0xca9f('0x6e')];var _0x45735e=0xc8;var _0x4287ad=null;return db[_0xca9f('0xe0')][_0xca9f('0xe1')]({'isolationLevel':db[_0xca9f('0xe0')]['Transaction']['ISOLATION_LEVELS'][_0xca9f('0x10f')]},function(_0x223002){return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x171be2},'transaction':_0x223002})[_0xca9f('0x14')](function(_0xc90557){if(_0xc90557){return db[_0xca9f('0x110')]['destroy']({'where':{'ChatWebsiteId':_0x171be2},'transaction':_0x223002})[_0xca9f('0x14')](function(){var _0xac3dd0=_[_0xca9f('0x37')](_0x8a6f66,function(_0x1d4991){_0x1d4991['ChatWebsiteId']=_0x171be2;return _0x1d4991;});return db[_0xca9f('0x110')][_0xca9f('0xe3')](_0xac3dd0,{'transaction':_0x223002});});}else{_0x45735e=0x194;_0x4287ad=[];}});})[_0xca9f('0x14')](function(){if(_0x45735e!==0x194){return db[_0xca9f('0x110')][_0xca9f('0x111')]({'where':{'ChatWebsiteId':_0x171be2},'order':_0xca9f('0xb1')})[_0xca9f('0x14')](function(_0x3752c8){_0x4287ad=_0x3752c8;});}})[_0xca9f('0x67')](function(_0x650705){_0x45735e=0x1f4;logger[_0xca9f('0x1b')](_0x650705[_0xca9f('0x2a')]);if(_0x650705[_0xca9f('0x2b')]){delete _0x650705[_0xca9f('0x2b')];}_0x4287ad=_0x650705;})['finally'](function(){if(_0x4287ad===null){_0x31b68e[_0xca9f('0x29')](_0x45735e);}else{if(_0x45735e===0x1f4){_0x31b68e['status'](_0x45735e)[_0xca9f('0x2c')](_0x4287ad);}else{_0x31b68e['status'](_0x45735e)['json'](_0x4287ad);}}});};exports['getApplications']=function(_0x1f0323,_0x672a97){var _0x2be16e={};var _0x1dcb76={};var _0x2e96cb;var _0x2f55a4;return db[_0xca9f('0x51')]['findOne']({'where':{'id':_0x1f0323['params']['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x672a97,null))[_0xca9f('0x14')](function(_0x739f79){if(_0x739f79){_0x2e96cb=_0x739f79;_0x1dcb76[_0xca9f('0x4d')]=_[_0xca9f('0x56')](db[_0xca9f('0x110')][_0xca9f('0x52')]);_0x1dcb76['query']=_[_0xca9f('0x56')](_0x1f0323['query']);_0x1dcb76['filters']=_[_0xca9f('0x58')](_0x1dcb76['model'],_0x1dcb76[_0xca9f('0x55')]);_0x2be16e[_0xca9f('0x59')]=_['intersection'](_0x1dcb76['model'],qs[_0xca9f('0x5a')](_0x1f0323[_0xca9f('0x55')][_0xca9f('0x5a')]));_0x2be16e[_0xca9f('0x59')]=_0x2be16e[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x2be16e[_0xca9f('0x59')]:_0x1dcb76['model'];_0x2be16e[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x1f0323[_0xca9f('0x55')][_0xca9f('0x5f')]);_0x2be16e['where']=qs[_0xca9f('0x57')](_['pick'](_0x1f0323[_0xca9f('0x55')],_0x1dcb76[_0xca9f('0x57')]));if(_0x1f0323[_0xca9f('0x55')]['filter']){_0x2be16e['where']=_[_0xca9f('0x64')](_0x2be16e[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x2be16e[_0xca9f('0x59')],function(_0x5eedc6){var _0x134eb3={};_0x134eb3[_0x5eedc6]={'$like':'%'+_0x1f0323['query'][_0xca9f('0x62')]+'%'};return _0x134eb3;})});}_0x2be16e=_[_0xca9f('0x64')]({},_0x2be16e,_0x1f0323['options']);return _0x2e96cb[_0xca9f('0x112')](_0x2be16e);}})['then'](function(_0x15574f){if(_0x15574f){_0x2f55a4=_0x15574f[_0xca9f('0x5b')];if(!_0x1f0323[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x2be16e[_0xca9f('0x21')]=qs['limit'](_0x1f0323['query'][_0xca9f('0x21')]);_0x2be16e['offset']=qs['offset'](_0x1f0323[_0xca9f('0x55')]['offset']);}return _0x2e96cb[_0xca9f('0x112')](_0x2be16e);}})[_0xca9f('0x14')](function(_0xa24131){if(_0xa24131){return _0xa24131?{'count':_0x2f55a4,'rows':_0xa24131}:null;}})['then'](respondWithResult(_0x672a97,null))[_0xca9f('0x67')](handleError(_0x672a97,null));};exports[_0xca9f('0x113')]=function(_0xaec7e9,_0x975f42){return db['chatProactiveAction'][_0xca9f('0x6c')]({'where':{'id':_0xaec7e9[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x975f42,null))[_0xca9f('0x14')](function(_0x5c97cf){if(_0x5c97cf){return _0x5c97cf['addProactiveActions'](_0xaec7e9[_0xca9f('0x6e')][_0xca9f('0x7e')],_[_0xca9f('0x114')](_0xaec7e9[_0xca9f('0x6e')],[_0xca9f('0x7e'),'id'])||{});}})[_0xca9f('0x14')](respondWithResult(_0x975f42,null))['catch'](handleError(_0x975f42,null));};exports['getProactiveActions']=function(_0x57a9d8,_0x1f93b7){var _0x3d1f13={};var _0x22a425={};var _0x2196d5;var _0x42b873;return db['ChatWebsite'][_0xca9f('0x82')]({'where':{'id':_0x57a9d8[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x1f93b7,null))[_0xca9f('0x14')](function(_0xe6d5ef){if(_0xe6d5ef){_0x2196d5=_0xe6d5ef;_0x22a425['model']=_['keys'](db['ChatProactiveAction'][_0xca9f('0x52')]);_0x22a425[_0xca9f('0x55')]=_['keys'](_0x57a9d8['query']);_0x22a425['filters']=_[_0xca9f('0x58')](_0x22a425[_0xca9f('0x4d')],_0x22a425[_0xca9f('0x55')]);_0x3d1f13[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x22a425[_0xca9f('0x4d')],qs['fields'](_0x57a9d8[_0xca9f('0x55')]['fields']));_0x3d1f13['attributes']=_0x3d1f13[_0xca9f('0x59')][_0xca9f('0x5b')]?_0x3d1f13['attributes']:_0x22a425[_0xca9f('0x4d')];_0x3d1f13[_0xca9f('0x5e')]=qs['sort'](_0x57a9d8['query'][_0xca9f('0x5f')]);_0x3d1f13[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_['pick'](_0x57a9d8[_0xca9f('0x55')],_0x22a425['filters']));if(_0x57a9d8[_0xca9f('0x55')][_0xca9f('0x62')]){_0x3d1f13[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0x3d1f13[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x3d1f13[_0xca9f('0x59')],function(_0x173ab0){var _0x5974d2={};_0x5974d2[_0x173ab0]={'$like':'%'+_0x57a9d8['query'][_0xca9f('0x62')]+'%'};return _0x5974d2;})});}_0x3d1f13=_['merge']({},_0x3d1f13,_0x57a9d8[_0xca9f('0x65')]);return _0x2196d5[_0xca9f('0xfd')](_0x3d1f13);}})[_0xca9f('0x14')](function(_0x54c2d1){if(_0x54c2d1){_0x42b873=_0x54c2d1[_0xca9f('0x5b')];if(!_0x57a9d8[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x3d1f13[_0xca9f('0x21')]=qs['limit'](_0x57a9d8['query'][_0xca9f('0x21')]);_0x3d1f13[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x57a9d8[_0xca9f('0x55')][_0xca9f('0x23')]);}return _0x2196d5['getProactiveActions'](_0x3d1f13);}})['then'](function(_0x20e55b){if(_0x20e55b){return _0x20e55b?{'count':_0x42b873,'rows':_0x20e55b}:null;}})[_0xca9f('0x14')](respondWithResult(_0x1f93b7,null))[_0xca9f('0x67')](handleError(_0x1f93b7,null));};exports[_0xca9f('0x115')]=function(_0x3ccc81,_0x2b8637){var _0xd040f7=_0x3ccc81[_0xca9f('0x55')]['online']==='false'?_0xca9f('0x116'):_0xca9f('0x117');return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'attributes':['id',_0xd040f7],'where':{'id':_0x3ccc81[_0xca9f('0x69')]['id']}})['then'](handleEntityNotFound(_0x2b8637,null))[_0xca9f('0x14')](function(_0x1e2d30){if(_0x1e2d30){var _0x2d1860=_0x1e2d30[_0xd040f7];var _0x179bc5=_0x2d1860&&_0x2d1860[_0xca9f('0x118')]?_0x2d1860[_0xca9f('0x118')]:[];_0x2b8637['send']({'fromKey':_['isNil'](_0x2d1860[_0xca9f('0x119')])?undefined:_0x2d1860[_0xca9f('0x119')],'count':_0x179bc5[_0xca9f('0x5b')],'rows':_0x179bc5});}})[_0xca9f('0x67')](handleError(_0x2b8637,null));};exports[_0xca9f('0x11a')]=function(_0x512bfe,_0x3d0759){var _0xb48531={'raw':![],'where':{}};var _0x5fa57a={};var _0x4845ae={'count':0x0,'rows':[]};return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x512bfe[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x3d0759,null))[_0xca9f('0x14')](function(_0x9fb9e2){if(_0x9fb9e2){_0x5fa57a[_0xca9f('0x4d')]=_[_0xca9f('0x56')](db[_0xca9f('0xd7')]['rawAttributes']);_0x5fa57a['query']=_[_0xca9f('0x56')](_0x512bfe['query']);_0x5fa57a['filters']=_[_0xca9f('0x58')](_0x5fa57a[_0xca9f('0x4d')],_0x5fa57a['query']);_0xb48531[_0xca9f('0x59')]=_['intersection'](_0x5fa57a[_0xca9f('0x4d')],qs[_0xca9f('0x5a')](_0x512bfe['query'][_0xca9f('0x5a')]));_0xb48531[_0xca9f('0x59')]=_0xb48531[_0xca9f('0x59')][_0xca9f('0x5b')]?_0xb48531[_0xca9f('0x59')]:_0x5fa57a[_0xca9f('0x4d')];if(!_0x512bfe['query']['hasOwnProperty']('nolimit')){_0xb48531[_0xca9f('0x21')]=qs['limit'](_0x512bfe[_0xca9f('0x55')][_0xca9f('0x21')]);_0xb48531[_0xca9f('0x23')]=qs['offset'](_0x512bfe[_0xca9f('0x55')]['offset']);}_0xb48531[_0xca9f('0x5e')]=qs[_0xca9f('0x5f')](_0x512bfe[_0xca9f('0x55')][_0xca9f('0x5f')]);_0xb48531['where']=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x512bfe[_0xca9f('0x55')],_0x5fa57a['filters']));_0xb48531[_0xca9f('0x60')][_0xca9f('0x7a')]=_0x9fb9e2['id'];if(_0x512bfe[_0xca9f('0x55')]['filter']){_0xb48531[_0xca9f('0x60')]=_[_0xca9f('0x64')](_0xb48531[_0xca9f('0x60')],{'$or':_['map'](_0xb48531[_0xca9f('0x59')],function(_0x33472e){var _0x25cbaf={};_0x25cbaf[_0x33472e]={'$like':'%'+_0x512bfe[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x25cbaf;})});}_0xb48531=_[_0xca9f('0x64')]({},_0xb48531,_0x512bfe['options']);return db[_0xca9f('0xd7')]['count']({'where':_0xb48531[_0xca9f('0x60')]})['then'](function(_0x55b609){_0x4845ae[_0xca9f('0x22')]=_0x55b609;if(_0x512bfe[_0xca9f('0x55')][_0xca9f('0x6b')]){_0xb48531[_0xca9f('0x7b')]=[{'all':!![]}];}else{_0xb48531[_0xca9f('0x7b')]=[{'model':db[_0xca9f('0x9c')],'as':_0xca9f('0xf7'),'required':![]},{'model':db['Attachment'],'as':_0xca9f('0x11b'),'required':![]}];}return db[_0xca9f('0xd7')][_0xca9f('0x7c')](_0xb48531);})['then'](function(_0x53e174){_0x4845ae[_0xca9f('0x66')]=_0x53e174;return _0x4845ae;});}})[_0xca9f('0x14')](respondWithFilteredResult(_0x3d0759,_0xb48531))[_0xca9f('0x67')](handleError(_0x3d0759,null));};exports[_0xca9f('0x11c')]=function(_0x4ccab2,_0x37245b){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x4ccab2[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x37245b,null))[_0xca9f('0x14')](function(_0x38b006){if(_0x38b006){return _0x38b006[_0xca9f('0x11c')](_0x4ccab2[_0xca9f('0x6e')][_0xca9f('0x7e')],_[_0xca9f('0x114')](_0x4ccab2[_0xca9f('0x6e')],['ids','id'])||{})[_0xca9f('0xaf')](function(_0x461688){for(var _0x13319a=0x0;_0x13319a<_0x4ccab2[_0xca9f('0x6e')][_0xca9f('0x7e')][_0xca9f('0x5b')];_0x13319a+=0x1){socket[_0xca9f('0x11d')](_0xca9f('0x11e'),{'UserId':Number(_0x4ccab2['body'][_0xca9f('0x7e')][_0x13319a]),'ChatWebsiteId':Number(_0x4ccab2[_0xca9f('0x69')]['id'])});}return _0x461688;});}})['then'](respondWithResult(_0x37245b,null))['catch'](handleError(_0x37245b,null));};exports[_0xca9f('0x11f')]=function(_0x1ed2fe,_0x5e1a1d){return db[_0xca9f('0x51')][_0xca9f('0x6c')]({'where':{'id':_0x1ed2fe[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x5e1a1d,null))[_0xca9f('0x14')](function(_0x15b7c6){if(_0x15b7c6){return _0x15b7c6[_0xca9f('0x11f')](_0x1ed2fe['query'][_0xca9f('0x7e')])[_0xca9f('0x14')](function(){if(_['isArray'](_0x1ed2fe[_0xca9f('0x55')][_0xca9f('0x7e')])){for(var _0xd7ead=0x0;_0xd7ead<_0x1ed2fe[_0xca9f('0x55')]['ids'][_0xca9f('0x5b')];_0xd7ead+=0x1){socket[_0xca9f('0x11d')](_0xca9f('0x120'),{'UserId':Number(_0x1ed2fe[_0xca9f('0x55')]['ids'][_0xd7ead]),'ChatWebsiteId':Number(_0x1ed2fe['params']['id'])});}}else{socket['emit'](_0xca9f('0x120'),{'UserId':Number(_0x1ed2fe[_0xca9f('0x55')]['ids']),'ChatWebsiteId':Number(_0x1ed2fe[_0xca9f('0x69')]['id'])});}});}})[_0xca9f('0x14')](respondWithStatusCode(_0x5e1a1d,null))[_0xca9f('0x67')](handleError(_0x5e1a1d,null));};exports[_0xca9f('0x121')]=function(_0x2492a0,_0x4283c3){var _0x1466e0={};var _0x2cf498={};var _0x3f4a3a;var _0xd5c09e;return db[_0xca9f('0x51')][_0xca9f('0x82')]({'where':{'id':_0x2492a0[_0xca9f('0x69')]['id']}})[_0xca9f('0x14')](handleEntityNotFound(_0x4283c3,null))[_0xca9f('0x14')](function(_0x2cc3e8){if(_0x2cc3e8){_0x3f4a3a=_0x2cc3e8;_0x2cf498['model']=_[_0xca9f('0x56')](db['User'][_0xca9f('0x52')]);_0x2cf498[_0xca9f('0x55')]=_[_0xca9f('0x56')](_0x2492a0[_0xca9f('0x55')]);_0x2cf498[_0xca9f('0x57')]=_['intersection'](_0x2cf498[_0xca9f('0x4d')],_0x2cf498[_0xca9f('0x55')]);_0x1466e0[_0xca9f('0x59')]=_[_0xca9f('0x58')](_0x2cf498[_0xca9f('0x4d')],qs['fields'](_0x2492a0[_0xca9f('0x55')]['fields']));_0x1466e0[_0xca9f('0x59')]=_0x1466e0['attributes'][_0xca9f('0x5b')]?_0x1466e0['attributes']:_0x2cf498[_0xca9f('0x4d')];_0x1466e0['order']=qs[_0xca9f('0x5f')](_0x2492a0[_0xca9f('0x55')]['sort']);_0x1466e0[_0xca9f('0x60')]=qs[_0xca9f('0x57')](_[_0xca9f('0x61')](_0x2492a0['query'],_0x2cf498[_0xca9f('0x57')]));if(_0x2492a0['query'][_0xca9f('0x62')]){_0x1466e0['where']=_[_0xca9f('0x64')](_0x1466e0[_0xca9f('0x60')],{'$or':_[_0xca9f('0x37')](_0x1466e0['attributes'],function(_0x5f1b4d){var _0x534066={};_0x534066[_0x5f1b4d]={'$like':'%'+_0x2492a0[_0xca9f('0x55')][_0xca9f('0x62')]+'%'};return _0x534066;})});}_0x1466e0=_[_0xca9f('0x64')]({},_0x1466e0,_0x2492a0[_0xca9f('0x65')]);return _0x3f4a3a[_0xca9f('0x121')](_0x1466e0);}})[_0xca9f('0x14')](function(_0x5d329a){if(_0x5d329a){_0xd5c09e=_0x5d329a[_0xca9f('0x5b')];if(!_0x2492a0[_0xca9f('0x55')][_0xca9f('0x5c')](_0xca9f('0x5d'))){_0x1466e0['limit']=qs[_0xca9f('0x21')](_0x2492a0['query'][_0xca9f('0x21')]);_0x1466e0[_0xca9f('0x23')]=qs[_0xca9f('0x23')](_0x2492a0[_0xca9f('0x55')][_0xca9f('0x23')]);}return _0x3f4a3a[_0xca9f('0x121')](_0x1466e0);}})[_0xca9f('0x14')](function(_0x29d97d){if(_0x29d97d){return _0x29d97d?{'count':_0xd5c09e,'rows':_0x29d97d}:null;}})['then'](respondWithResult(_0x4283c3,null))['catch'](handleError(_0x4283c3,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 3dbe38f..a3a0fbe 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 _0x9ade=['../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9ade,0x107));var _0xe9ad=function(_0xc6b2ff,_0x1558d7){_0xc6b2ff=_0xc6b2ff-0x0;var _0x47f7a4=_0x9ade[_0xc6b2ff];return _0x47f7a4;};'use strict';var EventEmitter=require(_0xe9ad('0x0'));var ChatWebsite=require(_0xe9ad('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe9ad('0x2'),'afterUpdate':'update','afterDestroy':_0xe9ad('0x3')};function emitEvent(_0x38d722){return function(_0x4d4ee0,_0x52984f,_0x36e151){ChatWebsiteEvents[_0xe9ad('0x4')](_0x38d722+':'+_0x4d4ee0['id'],_0x4d4ee0);ChatWebsiteEvents[_0xe9ad('0x4')](_0x38d722,_0x4d4ee0);_0x36e151(null);};}for(var e in events){if(events[_0xe9ad('0x5')](e)){var event=events[e];ChatWebsite[_0xe9ad('0x6')](e,emitEvent(event));}}module[_0xe9ad('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc090=['update','remove','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x2f20e1,_0x9b9fad){var _0xc2a856=function(_0x1307a5){while(--_0x1307a5){_0x2f20e1['push'](_0x2f20e1['shift']());}};_0xc2a856(++_0x9b9fad);}(_0xc090,0x112));var _0x0c09=function(_0xa7597,_0x8edd65){_0xa7597=_0xa7597-0x0;var _0x25d273=_0xc090[_0xa7597];return _0x25d273;};'use strict';var EventEmitter=require(_0x0c09('0x0'));var ChatWebsite=require(_0x0c09('0x1'))['db'][_0x0c09('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0c09('0x3')](0x0);var events={'afterCreate':_0x0c09('0x4'),'afterUpdate':_0x0c09('0x5'),'afterDestroy':_0x0c09('0x6')};function emitEvent(_0x260c36){return function(_0x11984f,_0x487f03,_0x2e968b){ChatWebsiteEvents[_0x0c09('0x7')](_0x260c36+':'+_0x11984f['id'],_0x11984f);ChatWebsiteEvents['emit'](_0x260c36,_0x11984f);_0x2e968b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0c09('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index a5e4323..2a41408 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 _0x84dd=['../../config/environment','lodash','util','../../config/logger','api','moment','rimraf'];(function(_0x3fa813,_0x295ac7){var _0x3cbab1=function(_0x5b2451){while(--_0x5b2451){_0x3fa813['push'](_0x3fa813['shift']());}};_0x3cbab1(++_0x295ac7);}(_0x84dd,0xa2));var _0xd84d=function(_0x33de9c,_0x30aed9){_0x33de9c=_0x33de9c-0x0;var _0x189342=_0x84dd[_0x33de9c];return _0x189342;};'use strict';var _=require(_0xd84d('0x0'));var util=require(_0xd84d('0x1'));var logger=require(_0xd84d('0x2'))(_0xd84d('0x3'));var moment=require(_0xd84d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd84d('0x5'));var config=require(_0xd84d('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x11999a,_0x570213){return _0x11999a['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f68=['chat_websites','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x223d84,_0x1db87b){var _0x3ae043=function(_0x3a78b7){while(--_0x3a78b7){_0x223d84['push'](_0x223d84['shift']());}};_0x3ae043(++_0x1db87b);}(_0x3f68,0x1d5));var _0x83f6=function(_0x4785fc,_0x216a89){_0x4785fc=_0x4785fc-0x0;var _0x363332=_0x3f68[_0x4785fc];return _0x363332;};'use strict';var _=require(_0x83f6('0x0'));var util=require(_0x83f6('0x1'));var logger=require('../../config/logger')(_0x83f6('0x2'));var moment=require(_0x83f6('0x3'));var BPromise=require(_0x83f6('0x4'));var rp=require(_0x83f6('0x5'));var fs=require('fs');var path=require(_0x83f6('0x6'));var rimraf=require(_0x83f6('0x7'));var config=require('../../config/environment');var attributes=require(_0x83f6('0x8'));module[_0x83f6('0x9')]=function(_0x5af2b1,_0xdaf088){return _0x5af2b1[_0x83f6('0xa')]('ChatWebsite',attributes,{'tableName':_0x83f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index f9191e5..9c0c77c 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 _0x44b3=['client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x434a7a,_0xd166b){var _0x49addb=function(_0x39d79d){while(--_0x39d79d){_0x434a7a['push'](_0x434a7a['shift']());}};_0x49addb(++_0xd166b);}(_0x44b3,0xc1));var _0x344b=function(_0x214855,_0x114ac2){_0x214855=_0x214855-0x0;var _0xfbb29=_0x44b3[_0x214855];return _0xfbb29;};'use strict';var _=require(_0x344b('0x0'));var util=require(_0x344b('0x1'));var moment=require('moment');var BPromise=require(_0x344b('0x2'));var rs=require(_0x344b('0x3'));var fs=require('fs');var Redis=require(_0x344b('0x4'));var db=require(_0x344b('0x5'))['db'];var utils=require(_0x344b('0x6'));var logger=require(_0x344b('0x7'))(_0x344b('0x8'));var config=require(_0x344b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x344b('0xa')]['http']({'port':0x232a});config[_0x344b('0xb')]=_[_0x344b('0xc')](config[_0x344b('0xb')],{'host':_0x344b('0xd'),'port':0x18eb});var socket=require(_0x344b('0xe'))(new Redis(config['redis']));require(_0x344b('0xf'))[_0x344b('0x10')](socket);function respondWithRpcPromise(_0x3317c2,_0x1c881e,_0x2a6010){return new BPromise(function(_0x412051,_0x326d10){return client[_0x344b('0x11')](_0x3317c2,_0x2a6010)[_0x344b('0x12')](function(_0x87f652){logger[_0x344b('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1c881e,_0x344b('0x14'));logger[_0x344b('0x15')](_0x344b('0x16'),_0x1c881e,_0x344b('0x14'),JSON[_0x344b('0x17')](_0x87f652));if(_0x87f652[_0x344b('0x18')]){if(_0x87f652[_0x344b('0x18')]['code']===0x1f4){logger[_0x344b('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x1c881e,_0x87f652[_0x344b('0x18')][_0x344b('0x19')]);return _0x326d10(_0x87f652[_0x344b('0x18')][_0x344b('0x19')]);}logger[_0x344b('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x1c881e,_0x87f652[_0x344b('0x18')][_0x344b('0x19')]);return _0x412051(_0x87f652[_0x344b('0x18')][_0x344b('0x19')]);}else{logger['info'](_0x344b('0x1a'),_0x1c881e,'request\x20sent');_0x412051(_0x87f652[_0x344b('0x1b')][_0x344b('0x19')]);}})[_0x344b('0x1c')](function(_0x208b20){logger['error'](_0x344b('0x1a'),_0x1c881e,_0x208b20);_0x326d10(_0x208b20);});});}
\ No newline at end of file
+var _0x459e=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request'];(function(_0x2593ea,_0xff1577){var _0x49e40e=function(_0x48607b){while(--_0x48607b){_0x2593ea['push'](_0x2593ea['shift']());}};_0x49e40e(++_0xff1577);}(_0x459e,0x183));var _0xe459=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x459e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xe459('0x0'));var util=require(_0xe459('0x1'));var moment=require(_0xe459('0x2'));var BPromise=require(_0xe459('0x3'));var rs=require(_0xe459('0x4'));var fs=require('fs');var Redis=require(_0xe459('0x5'));var db=require(_0xe459('0x6'))['db'];var utils=require(_0xe459('0x7'));var logger=require(_0xe459('0x8'))('rpc');var config=require(_0xe459('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe459('0xa')][_0xe459('0xb')]({'port':0x232a});config[_0xe459('0xc')]=_[_0xe459('0xd')](config[_0xe459('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe459('0xe'))(new Redis(config[_0xe459('0xc')]));require(_0xe459('0xf'))[_0xe459('0x10')](socket);function respondWithRpcPromise(_0x55e5fe,_0x556927,_0x25f803){return new BPromise(function(_0x2f856c,_0x3bc3bc){return client[_0xe459('0x11')](_0x55e5fe,_0x25f803)['then'](function(_0x436759){logger[_0xe459('0x12')](_0xe459('0x13'),_0x556927,_0xe459('0x14'));logger[_0xe459('0x15')](_0xe459('0x16'),_0x556927,'request\x20sent',JSON[_0xe459('0x17')](_0x436759));if(_0x436759[_0xe459('0x18')]){if(_0x436759[_0xe459('0x18')][_0xe459('0x19')]===0x1f4){logger[_0xe459('0x18')](_0xe459('0x13'),_0x556927,_0x436759['error']['message']);return _0x3bc3bc(_0x436759['error'][_0xe459('0x1a')]);}logger[_0xe459('0x18')](_0xe459('0x13'),_0x556927,_0x436759['error'][_0xe459('0x1a')]);return _0x2f856c(_0x436759['error'][_0xe459('0x1a')]);}else{logger[_0xe459('0x12')](_0xe459('0x13'),_0x556927,_0xe459('0x14'));_0x2f856c(_0x436759['result'][_0xe459('0x1a')]);}})['catch'](function(_0x5d4b8d){logger[_0xe459('0x18')](_0xe459('0x13'),_0x556927,_0x5d4b8d);_0x3bc3bc(_0x5d4b8d);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index f81d050..2f516f3 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 _0x5cec=['length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener'];(function(_0x20efe6,_0x2d6285){var _0x2680c2=function(_0x1c969b){while(--_0x1c969b){_0x20efe6['push'](_0x20efe6['shift']());}};_0x2680c2(++_0x2d6285);}(_0x5cec,0x1e5));var _0xc5ce=function(_0x18beb4,_0x2c9a9c){_0x18beb4=_0x18beb4-0x0;var _0x170b3e=_0x5cec[_0x18beb4];return _0x170b3e;};'use strict';var ChatWebsiteEvents=require(_0xc5ce('0x0'));var events=[_0xc5ce('0x1'),'remove',_0xc5ce('0x2')];function createListener(_0x299537,_0x5d1b97){return function(_0x23be66){_0x5d1b97[_0xc5ce('0x3')](_0x299537,_0x23be66);};}function removeListener(_0x4311d7,_0x41b539){return function(){ChatWebsiteEvents[_0xc5ce('0x4')](_0x4311d7,_0x41b539);};}exports['register']=function(_0x35fa6e){for(var _0x54365a=0x0,_0xdcea44=events[_0xc5ce('0x5')];_0x54365a<_0xdcea44;_0x54365a++){var _0x371ad3=events[_0x54365a];var _0x2babf1=createListener(_0xc5ce('0x6')+_0x371ad3,_0x35fa6e);ChatWebsiteEvents['on'](_0x371ad3,_0x2babf1);}};
\ No newline at end of file
+var _0xba6f=['./chatWebsite.events','save','emit','register','chatWebsite:'];(function(_0x1b49ba,_0x3533f7){var _0x490b2a=function(_0x54f4a1){while(--_0x54f4a1){_0x1b49ba['push'](_0x1b49ba['shift']());}};_0x490b2a(++_0x3533f7);}(_0xba6f,0x73));var _0xfba6=function(_0x51fd25,_0x2fcbb){_0x51fd25=_0x51fd25-0x0;var _0x4529ae=_0xba6f[_0x51fd25];return _0x4529ae;};'use strict';var ChatWebsiteEvents=require(_0xfba6('0x0'));var events=[_0xfba6('0x1'),'remove','update'];function createListener(_0x9e3004,_0x29d888){return function(_0x1ef3cd){_0x29d888[_0xfba6('0x2')](_0x9e3004,_0x1ef3cd);};}function removeListener(_0x54b38e,_0x401bb9){return function(){ChatWebsiteEvents['removeListener'](_0x54b38e,_0x401bb9);};}exports[_0xfba6('0x3')]=function(_0x5ad294){for(var _0x455a4d=0x0,_0x48463f=events['length'];_0x455a4d<_0x48463f;_0x455a4d++){var _0x2166c9=events[_0x455a4d];var _0x5a68cc=createListener(_0xfba6('0x4')+_0x2166c9,_0x5ad294);ChatWebsiteEvents['on'](_0x2166c9,_0x5a68cc);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 53aab55..b255003 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 _0xdac6=['/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','addDisposition','post','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','%s-%s','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','format','now','/:id/avatar','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','any','offline','addInteraction','addApplications','addProactiveActions'];(function(_0x5c8376,_0x1d3be6){var _0x41a258=function(_0x410bc4){while(--_0x410bc4){_0x5c8376['push'](_0x5c8376['shift']());}};_0x41a258(++_0x1d3be6);}(_0xdac6,0x175));var _0x6dac=function(_0x4c2892,_0xf4b250){_0x4c2892=_0x4c2892-0x0;var _0x1695ef=_0xdac6[_0x4c2892];return _0x1695ef;};'use strict';var multer=require(_0x6dac('0x0'));var util=require('util');var path=require(_0x6dac('0x1'));var timeout=require(_0x6dac('0x2'));var express=require(_0x6dac('0x3'));var router=express[_0x6dac('0x4')]();var fs_extra=require(_0x6dac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6dac('0x6'));var config=require(_0x6dac('0x7'));var controller=require('./chatWebsite.controller');router[_0x6dac('0x8')]('/',auth[_0x6dac('0x9')](),controller['index']);router[_0x6dac('0x8')](_0x6dac('0xa'),auth[_0x6dac('0x9')](),controller[_0x6dac('0xb')]);router[_0x6dac('0x8')](_0x6dac('0xc'),auth[_0x6dac('0x9')](),controller[_0x6dac('0xd')]);router['get'](_0x6dac('0xe'),auth[_0x6dac('0x9')](),controller[_0x6dac('0xf')]);router[_0x6dac('0x8')]('/:id/canned_answers',auth[_0x6dac('0x9')](),controller['getAnswers']);router[_0x6dac('0x8')](_0x6dac('0x10'),controller[_0x6dac('0x11')]);router[_0x6dac('0x8')]('/:id/avatar',controller[_0x6dac('0x12')]);router['get'](_0x6dac('0x13'),controller[_0x6dac('0x14')]);router['get'](_0x6dac('0x15'),controller[_0x6dac('0x16')]);router[_0x6dac('0x8')](_0x6dac('0x17'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x18')]);router[_0x6dac('0x8')]('/:id/snippet',controller[_0x6dac('0x19')]);router[_0x6dac('0x8')](_0x6dac('0x1a'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x1b')]);router[_0x6dac('0x8')](_0x6dac('0x1c'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x1d')]);router['get'](_0x6dac('0x1e'),controller['getFields']);router[_0x6dac('0x8')](_0x6dac('0x1f'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x20')]);router[_0x6dac('0x8')]('/:id/users',auth[_0x6dac('0x9')](),controller[_0x6dac('0x21')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x6dac('0xe'),auth['isAuthenticated'](),controller[_0x6dac('0x22')]);router[_0x6dac('0x23')](_0x6dac('0x24'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xbb215a,_0x63d6ec,_0x1f92fc){_0x1f92fc(null,path[_0x6dac('0x26')](config[_0x6dac('0x27')],_0x6dac('0x28')));},'filename':function(_0x42690b,_0x5be55e,_0x4163ea){_0x4163ea(null,util['format'](_0x6dac('0x29'),Date['now'](),_0x5be55e[_0x6dac('0x2a')]));}})});router[_0x6dac('0x23')](_0x6dac('0x10'),upload[_0x6dac('0x2b')](_0x6dac('0x2c')),controller[_0x6dac('0x2d')]);var upload=multer({'storage':multer[_0x6dac('0x2e')]({'destination':function(_0x23cc17,_0x65d54c,_0x8216f9){_0x8216f9(null,path[_0x6dac('0x26')](config[_0x6dac('0x27')],_0x6dac('0x2f')));},'filename':function(_0x4900d7,_0x584af5,_0x2c8dc3){_0x2c8dc3(null,util[_0x6dac('0x30')](_0x6dac('0x29'),Date[_0x6dac('0x31')](),_0x584af5['originalname']));}})});router[_0x6dac('0x23')](_0x6dac('0x32'),upload[_0x6dac('0x2b')](_0x6dac('0x2c')),controller[_0x6dac('0x33')]);var upload=multer({'storage':multer[_0x6dac('0x2e')]({'destination':function(_0x5f2b15,_0x51637f,_0x3826fe){_0x3826fe(null,path[_0x6dac('0x26')](config[_0x6dac('0x27')],_0x6dac('0x2f')));},'filename':function(_0x46da7c,_0x2d6203,_0x1feee1){_0x1feee1(null,util[_0x6dac('0x30')](_0x6dac('0x29'),Date['now'](),_0x2d6203[_0x6dac('0x2a')]));}})});router['post'](_0x6dac('0x13'),upload[_0x6dac('0x2b')]('file'),controller[_0x6dac('0x34')]);var upload=multer({'storage':multer[_0x6dac('0x2e')]({'destination':function(_0x37a398,_0x5e7e88,_0xa0bc77){_0xa0bc77(null,path['join'](config[_0x6dac('0x27')],_0x6dac('0x2f')));},'filename':function(_0x5356c6,_0x1df81a,_0x4f0db6){_0x4f0db6(null,util[_0x6dac('0x30')](_0x6dac('0x29'),Date[_0x6dac('0x31')](),_0x1df81a[_0x6dac('0x2a')]));}})});router['post'](_0x6dac('0x15'),upload[_0x6dac('0x2b')](_0x6dac('0x2c')),controller[_0x6dac('0x35')]);router[_0x6dac('0x23')](_0x6dac('0x36'),controller[_0x6dac('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x6dac('0x2e')]({'destination':function(_0x16743d,_0x24f941,_0x650f4){const _0x2e8b07=path[_0x6dac('0x26')](config[_0x6dac('0x27')],_0x6dac('0x38'),_0x6dac('0x39'),_0x6dac('0x3a'));fs_extra['ensureDir'](_0x2e8b07,function(){_0x650f4(null,_0x2e8b07);});},'filename':function(_0x57b281,_0x100ffe,_0x487a6d){const _0x21c171=_0x100ffe[_0x6dac('0x2a')][_0x6dac('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x167ab6=path['extname'](_0x21c171);const _0x18ec6e=Date['now']()+'-'+_0x21c171[_0x6dac('0x3b')](_0x167ab6,'')+_0x167ab6;_0x487a6d(null,_0x18ec6e);}})});router[_0x6dac('0x23')]('/:id/offline',offlineUploadMulter[_0x6dac('0x3c')](),controller[_0x6dac('0x3d')]);router[_0x6dac('0x23')](_0x6dac('0x17'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x3e')]);router[_0x6dac('0x23')](_0x6dac('0x1a'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x3f')]);router[_0x6dac('0x23')](_0x6dac('0x1c'),auth['isAuthenticated'](),controller[_0x6dac('0x40')]);router[_0x6dac('0x23')](_0x6dac('0x41'),auth[_0x6dac('0x9')](),controller['addAgents']);router[_0x6dac('0x42')](_0x6dac('0xc'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x43')]);router[_0x6dac('0x44')](_0x6dac('0xc'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x45')]);router[_0x6dac('0x44')](_0x6dac('0xe'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x46')]);router[_0x6dac('0x44')](_0x6dac('0x24'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x47')]);router[_0x6dac('0x44')](_0x6dac('0x41'),auth[_0x6dac('0x9')](),controller[_0x6dac('0x48')]);module['exports']=router;
\ No newline at end of file
+var _0xef04=['../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post','create','/:id/dispositions','diskStorage','join','format','%s-%s','now','originalname','single','addLogo','root','file','addAvatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','notify','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xef04,0x111));var _0x4ef0=function(_0x38c121,_0x29c927){_0x38c121=_0x38c121-0x0;var _0x21c1f5=_0xef04[_0x38c121];return _0x21c1f5;};'use strict';var multer=require(_0x4ef0('0x0'));var util=require('util');var path=require(_0x4ef0('0x1'));var timeout=require(_0x4ef0('0x2'));var express=require(_0x4ef0('0x3'));var router=express[_0x4ef0('0x4')]();var fs_extra=require(_0x4ef0('0x5'));var auth=require(_0x4ef0('0x6'));var interaction=require(_0x4ef0('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x9')]);router['get'](_0x4ef0('0xa'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0xb')]);router[_0x4ef0('0xc')](_0x4ef0('0xd'),auth[_0x4ef0('0x8')](),controller['show']);router['get']('/:id/dispositions',auth[_0x4ef0('0x8')](),controller['getDispositions']);router[_0x4ef0('0xc')](_0x4ef0('0xe'),auth['isAuthenticated'](),controller[_0x4ef0('0xf')]);router['get'](_0x4ef0('0x10'),controller[_0x4ef0('0x11')]);router[_0x4ef0('0xc')](_0x4ef0('0x12'),controller[_0x4ef0('0x13')]);router['get'](_0x4ef0('0x14'),controller[_0x4ef0('0x15')]);router[_0x4ef0('0xc')](_0x4ef0('0x16'),controller['getSystemAvatar']);router[_0x4ef0('0xc')](_0x4ef0('0x17'),auth[_0x4ef0('0x8')](),controller['getInteractions']);router[_0x4ef0('0xc')](_0x4ef0('0x18'),controller['getSnippet']);router[_0x4ef0('0xc')]('/:id/applications',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x19')]);router[_0x4ef0('0xc')](_0x4ef0('0x1a'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x1b')]);router[_0x4ef0('0xc')](_0x4ef0('0x1c'),controller[_0x4ef0('0x1d')]);router['get']('/:id/offline_messages',auth[_0x4ef0('0x8')](),controller['getOfflineMessages']);router[_0x4ef0('0xc')](_0x4ef0('0x1e'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x1f')]);router[_0x4ef0('0x20')]('/',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x21')]);router['post'](_0x4ef0('0x22'),auth[_0x4ef0('0x8')](),controller['addDisposition']);router[_0x4ef0('0x20')](_0x4ef0('0xe'),auth[_0x4ef0('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x4ef0('0x23')]({'destination':function(_0x2a6333,_0x561e51,_0x39f5b2){_0x39f5b2(null,path[_0x4ef0('0x24')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5f5cf5,_0xcfefe5,_0x518299){_0x518299(null,util[_0x4ef0('0x25')](_0x4ef0('0x26'),Date[_0x4ef0('0x27')](),_0xcfefe5[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')](_0x4ef0('0x10'),upload[_0x4ef0('0x29')]('file'),controller[_0x4ef0('0x2a')]);var upload=multer({'storage':multer[_0x4ef0('0x23')]({'destination':function(_0x1132a8,_0x272497,_0x1b66b2){_0x1b66b2(null,path['join'](config[_0x4ef0('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x4445bf,_0x513d6b,_0x1fe5ca){_0x1fe5ca(null,util[_0x4ef0('0x25')](_0x4ef0('0x26'),Date[_0x4ef0('0x27')](),_0x513d6b[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')]('/:id/avatar',upload[_0x4ef0('0x29')](_0x4ef0('0x2c')),controller[_0x4ef0('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9e2798,_0x472395,_0x41fbeb){_0x41fbeb(null,path[_0x4ef0('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x1f722b,_0x429c58,_0x3a6d9e){_0x3a6d9e(null,util[_0x4ef0('0x25')](_0x4ef0('0x26'),Date[_0x4ef0('0x27')](),_0x429c58[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')](_0x4ef0('0x14'),upload[_0x4ef0('0x29')](_0x4ef0('0x2c')),controller[_0x4ef0('0x2e')]);var upload=multer({'storage':multer[_0x4ef0('0x23')]({'destination':function(_0x1c811e,_0x412da5,_0x3f9b8a){_0x3f9b8a(null,path[_0x4ef0('0x24')](config[_0x4ef0('0x2b')],_0x4ef0('0x2f')));},'filename':function(_0x4529d3,_0x1e73fe,_0x318b55){_0x318b55(null,util['format'](_0x4ef0('0x26'),Date['now'](),_0x1e73fe[_0x4ef0('0x28')]));}})});router[_0x4ef0('0x20')](_0x4ef0('0x16'),upload[_0x4ef0('0x29')](_0x4ef0('0x2c')),controller[_0x4ef0('0x30')]);router['post']('/:id/notify',controller[_0x4ef0('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1c6a7b,_0x25bf8a,_0x591773){const _0x164f38=path[_0x4ef0('0x24')](config[_0x4ef0('0x2b')],'server/files','attachments',_0x4ef0('0x32'));fs_extra[_0x4ef0('0x33')](_0x164f38,function(){_0x591773(null,_0x164f38);});},'filename':function(_0x5a7a2c,_0xfa322c,_0x42fc50){const _0x32c42f=_0xfa322c[_0x4ef0('0x28')][_0x4ef0('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x30c468=path[_0x4ef0('0x35')](_0x32c42f);const _0x2a1d1c=Date[_0x4ef0('0x27')]()+'-'+_0x32c42f[_0x4ef0('0x34')](_0x30c468,'')+_0x30c468;_0x42fc50(null,_0x2a1d1c);}})});router[_0x4ef0('0x20')](_0x4ef0('0x36'),offlineUploadMulter[_0x4ef0('0x37')](),controller[_0x4ef0('0x38')]);router[_0x4ef0('0x20')](_0x4ef0('0x17'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x39')]);router['post'](_0x4ef0('0x3a'),auth['isAuthenticated'](),controller[_0x4ef0('0x3b')]);router[_0x4ef0('0x20')](_0x4ef0('0x1a'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x3c')]);router['post'](_0x4ef0('0x1e'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x3d')]);router[_0x4ef0('0x3e')]('/:id',auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x3f')]);router['delete'](_0x4ef0('0xd'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x40')]);router[_0x4ef0('0x41')](_0x4ef0('0x22'),auth['isAuthenticated'](),controller[_0x4ef0('0x42')]);router['delete'](_0x4ef0('0xe'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x43')]);router[_0x4ef0('0x41')](_0x4ef0('0x1e'),auth[_0x4ef0('0x8')](),controller[_0x4ef0('0x44')]);module[_0x4ef0('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c0c9f39..1ffa29e 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 _0xcf0b=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0xcf0b,0xe3));var _0xbcf0=function(_0x4dd072,_0x515c74){_0x4dd072=_0x4dd072-0x0;var _0x45ee58=_0xcf0b[_0x4dd072];return _0x45ee58;};var beaverLogger=require(_0xbcf0('0x0'));var express=require(_0xbcf0('0x1'));var auth=require(_0xbcf0('0x2'));var config=require(_0xbcf0('0x3'));var router=express[_0xbcf0('0x4')]();var isProduction=config[_0xbcf0('0x5')]===_0xbcf0('0x6')||![];function clientSideLogs(_0x365555,_0x39a878,_0x28d8ab){var _0x5b127c=_0x365555['app'][_0xbcf0('0x7')](_0xbcf0('0x8'));if(!_0x5b127c){throw new Error(_0xbcf0('0x9'));}return beaverLogger[_0xbcf0('0xa')]({'uri':_0xbcf0('0xb'),'logger':_0x5b127c,'enableCors':!isProduction})(_0x365555,_0x39a878,_0x28d8ab);}router['use'](auth[_0xbcf0('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x30d3=['isAuthenticated','exports','beaver-logger/server','express','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x5bd688,_0x182339){var _0xa84424=function(_0xc9fbb4){while(--_0xc9fbb4){_0x5bd688['push'](_0x5bd688['shift']());}};_0xa84424(++_0x182339);}(_0x30d3,0xc6));var _0x330d=function(_0x6c7031,_0x434dbf){_0x6c7031=_0x6c7031-0x0;var _0xc677f6=_0x30d3[_0x6c7031];return _0xc677f6;};var beaverLogger=require(_0x330d('0x0'));var express=require(_0x330d('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x330d('0x2')]();var isProduction=config[_0x330d('0x3')]===_0x330d('0x4')||![];function clientSideLogs(_0x2f7591,_0x17ed29,_0x480612){var _0x4a5a34=_0x2f7591[_0x330d('0x5')][_0x330d('0x6')](_0x330d('0x7'));if(!_0x4a5a34){throw new Error(_0x330d('0x8'));}return beaverLogger[_0x330d('0x9')]({'uri':_0x330d('0xa'),'logger':_0x4a5a34,'enableCors':!isProduction})(_0x2f7591,_0x17ed29,_0x480612);}router[_0x330d('0xb')](auth[_0x330d('0xc')](),clientSideLogs);module[_0x330d('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 4605107..21ac330 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 _0xa88c=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports'];(function(_0x9da8b9,_0x445b60){var _0x207521=function(_0x4e0527){while(--_0x4e0527){_0x9da8b9['push'](_0x9da8b9['shift']());}};_0x207521(++_0x445b60);}(_0xa88c,0x185));var _0xca88=function(_0x544f09,_0x1624a3){_0x544f09=_0x544f09-0x0;var _0x542110=_0xa88c[_0x544f09];return _0x542110;};'use strict';var Sequelize=require('sequelize');module[_0xca88('0x0')]={'name':{'type':Sequelize[_0xca88('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xca88('0x2')](_0xca88('0x3'),_0xca88('0x4'),_0xca88('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xca88('0x6'),_0xca88('0x7'))},'data1':{'type':Sequelize[_0xca88('0x1')],'comment':_0xca88('0x8')},'data2':{'type':Sequelize[_0xca88('0x1')],'comment':_0xca88('0x9')},'data3':{'type':Sequelize[_0xca88('0x1')],'comment':_0xca88('0xa')},'data4':{'type':Sequelize[_0xca88('0x1')],'comment':_0xca88('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xca88('0xc')},'data6':{'type':Sequelize[_0xca88('0xd')],'comment':_0xca88('0xe')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x1f37=['Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','ENUM','Google','MicrosoftAzure'];(function(_0x58a994,_0x2e1bcf){var _0x40a74c=function(_0xd5e396){while(--_0xd5e396){_0x58a994['push'](_0x58a994['shift']());}};_0x40a74c(++_0x2e1bcf);}(_0x1f37,0x1d8));var _0x71f3=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x1f37[_0x4394b6];return _0x360244;};'use strict';var Sequelize=require('sequelize');module[_0x71f3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x71f3('0x1')]('AmazonAWS',_0x71f3('0x2'),_0x71f3('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x71f3('0x1')](_0x71f3('0x4'),_0x71f3('0x5'))},'data1':{'type':Sequelize[_0x71f3('0x6')],'comment':_0x71f3('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x71f3('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0x71f3('0x9')},'data4':{'type':Sequelize[_0x71f3('0x6')],'comment':_0x71f3('0xa')},'data5':{'type':Sequelize[_0x71f3('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0x71f3('0xc')},'data7':{'type':Sequelize[_0x71f3('0xb')],'comment':_0x71f3('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 65a6103..04bde99 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 _0xe291=['Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','MicrosoftAzure','params','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','error','stack','name','send','padEnd','CloudProvider','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','decryptString','data3','catch','show','find','service','create','body'];(function(_0x278d73,_0xb20d63){var _0x31ca5c=function(_0x3355d5){while(--_0x3355d5){_0x278d73['push'](_0x278d73['shift']());}};_0x31ca5c(++_0xb20d63);}(_0xe291,0x12f));var _0x1e29=function(_0x3cb339,_0xaa2c29){_0x3cb339=_0x3cb339-0x0;var _0x302367=_0xe291[_0x3cb339];return _0x302367;};'use strict';var _=require('lodash');var Redis=require(_0x1e29('0x0'));var qs=require(_0x1e29('0x1'));var encryptor=require(_0x1e29('0x2'));var config=require(_0x1e29('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x1e29('0x4'));config[_0x1e29('0x5')]=_[_0x1e29('0x6')](config[_0x1e29('0x5')],{'host':_0x1e29('0x7'),'port':0x18eb});var socket=require(_0x1e29('0x8'))(new Redis(config[_0x1e29('0x5')]));var redis=new Redis(config[_0x1e29('0x5')]);function respondWithStatusCode(_0x389e9c,_0x132bf2){_0x132bf2=_0x132bf2||0xcc;return function(_0x3080b8){if(_0x3080b8){return _0x389e9c[_0x1e29('0x9')](_0x132bf2);}return _0x389e9c[_0x1e29('0xa')](_0x132bf2)[_0x1e29('0xb')]();};}function respondWithResult(_0x3e1d56,_0x38d77d){_0x38d77d=_0x38d77d||0xc8;return function(_0x3579d5){if(_0x3579d5){return _0x3e1d56[_0x1e29('0xa')](_0x38d77d)['json'](_0x3579d5);}};}function respondWithFilteredResult(_0x30bf66,_0x1b0c23){return function(_0x50b20a){if(_0x50b20a){var _0x47bd3f=typeof _0x1b0c23[_0x1e29('0xc')]===_0x1e29('0xd')&&typeof _0x1b0c23[_0x1e29('0xe')]==='undefined';var _0x5605a7=_0x50b20a[_0x1e29('0xf')];var _0x2ecc94=_0x47bd3f?0x0:_0x1b0c23[_0x1e29('0xc')];var _0x165bcf=_0x47bd3f?_0x50b20a[_0x1e29('0xf')]:_0x1b0c23[_0x1e29('0xc')]+_0x1b0c23[_0x1e29('0xe')];var _0x23b147;if(_0x165bcf>=_0x5605a7){_0x165bcf=_0x5605a7;_0x23b147=0xc8;}else{_0x23b147=0xce;}_0x30bf66['status'](_0x23b147);return _0x30bf66[_0x1e29('0x10')](_0x1e29('0x11'),_0x2ecc94+'-'+_0x165bcf+'/'+_0x5605a7)[_0x1e29('0x12')](_0x50b20a);}return null;};}function saveUpdates(_0x189e5c){return function(_0x381127){if(_0x381127){return _0x381127[_0x1e29('0x13')](_0x189e5c)[_0x1e29('0x14')](function(_0xb768d1){return _0xb768d1;});}return null;};}function removeEntity(_0x234f40){return function(_0x3bb992){if(_0x3bb992){return _0x3bb992['destroy']()[_0x1e29('0x14')](function(){_0x234f40[_0x1e29('0xa')](0xcc)[_0x1e29('0xb')]();});}};}function handleEntityNotFound(_0x246784){return function(_0x2547fe){if(!_0x2547fe){_0x246784['sendStatus'](0x194);}return _0x2547fe;};}function handleError(_0x332712,_0x2e3745){_0x2e3745=_0x2e3745||0x1f4;return function(_0x14b8ca){logger[_0x1e29('0x15')](_0x14b8ca[_0x1e29('0x16')]);if(_0x14b8ca[_0x1e29('0x17')]){delete _0x14b8ca[_0x1e29('0x17')];}_0x332712[_0x1e29('0xa')](_0x2e3745)[_0x1e29('0x18')](_0x14b8ca);};}function maskClientSecret(_0x531c0f){return _[_0x1e29('0x19')](_0x531c0f['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x95d8ee,_0x525ba1){var _0x324d0f={},_0x301dc6={},_0x27db2a={'count':0x0,'rows':[]};var _0xdc4427=_['map'](db[_0x1e29('0x1a')][_0x1e29('0x1b')],function(_0x216512){return{'name':_0x216512[_0x1e29('0x1c')],'type':_0x216512['type'][_0x1e29('0x1d')]};});_0x301dc6[_0x1e29('0x1e')]=_[_0x1e29('0x1f')](_0xdc4427,_0x1e29('0x17'));_0x301dc6[_0x1e29('0x20')]=_[_0x1e29('0x21')](_0x95d8ee[_0x1e29('0x20')]);_0x301dc6[_0x1e29('0x22')]=_[_0x1e29('0x23')](_0x301dc6[_0x1e29('0x1e')],_0x301dc6[_0x1e29('0x20')]);_0x324d0f['attributes']=_['intersection'](_0x301dc6[_0x1e29('0x1e')],qs[_0x1e29('0x24')](_0x95d8ee[_0x1e29('0x20')][_0x1e29('0x24')]));_0x324d0f['attributes']=_0x324d0f[_0x1e29('0x25')][_0x1e29('0x26')]?_0x324d0f[_0x1e29('0x25')]:_0x301dc6[_0x1e29('0x1e')];if(!_0x95d8ee['query'][_0x1e29('0x27')]('nolimit')){_0x324d0f[_0x1e29('0xe')]=qs['limit'](_0x95d8ee['query']['limit']);_0x324d0f[_0x1e29('0xc')]=qs['offset'](_0x95d8ee['query']['offset']);}_0x324d0f[_0x1e29('0x28')]=qs[_0x1e29('0x29')](_0x95d8ee[_0x1e29('0x20')][_0x1e29('0x29')]);_0x324d0f[_0x1e29('0x2a')]=qs['filters'](_[_0x1e29('0x2b')](_0x95d8ee[_0x1e29('0x20')],_0x301dc6[_0x1e29('0x22')]),_0xdc4427);if(_0x95d8ee[_0x1e29('0x20')][_0x1e29('0x2c')]){_0x324d0f[_0x1e29('0x2a')]=_['merge'](_0x324d0f[_0x1e29('0x2a')],{'$or':_[_0x1e29('0x1f')](_0xdc4427,function(_0x13ee00){if(_0x13ee00[_0x1e29('0x2d')]!==_0x1e29('0x2e')){var _0x5eeef9={};_0x5eeef9[_0x13ee00[_0x1e29('0x17')]]={'$like':'%'+_0x95d8ee[_0x1e29('0x20')][_0x1e29('0x2c')]+'%'};return _0x5eeef9;}})});}_0x324d0f=_[_0x1e29('0x2f')]({},_0x324d0f,_0x95d8ee[_0x1e29('0x30')]);var _0x2b8e56={'where':_0x324d0f['where']};return db[_0x1e29('0x1a')]['count'](_0x2b8e56)['then'](function(_0x15c166){_0x27db2a[_0x1e29('0xf')]=_0x15c166;if(_0x95d8ee[_0x1e29('0x20')][_0x1e29('0x31')]){_0x324d0f[_0x1e29('0x32')]=[{'all':!![]}];}return db[_0x1e29('0x1a')][_0x1e29('0x33')](_0x324d0f);})['then'](function(_0x2e074c){_0x27db2a[_0x1e29('0x34')]=_['map'](_0x2e074c,function(_0x30b01c){if(_0x30b01c['service']==='MicrosoftAzure'){var _0x5a51ab=encryptor[_0x1e29('0x35')](_0x30b01c[_0x1e29('0x36')]);_0x30b01c[_0x1e29('0x36')]=maskClientSecret(_0x5a51ab);}return _0x30b01c;});return _0x27db2a;})['then'](respondWithFilteredResult(_0x525ba1,_0x324d0f))[_0x1e29('0x37')](handleError(_0x525ba1,null));};exports[_0x1e29('0x38')]=function(_0x4c4ee5,_0x22f380){var _0x2e386a={'raw':!![],'where':{'id':_0x4c4ee5['params']['id']}},_0x175a63={};_0x175a63[_0x1e29('0x1e')]=_[_0x1e29('0x21')](db['CloudProvider'][_0x1e29('0x1b')]);_0x175a63[_0x1e29('0x20')]=_[_0x1e29('0x21')](_0x4c4ee5[_0x1e29('0x20')]);_0x175a63[_0x1e29('0x22')]=_[_0x1e29('0x23')](_0x175a63[_0x1e29('0x1e')],_0x175a63[_0x1e29('0x20')]);_0x2e386a[_0x1e29('0x25')]=_[_0x1e29('0x23')](_0x175a63[_0x1e29('0x1e')],qs[_0x1e29('0x24')](_0x4c4ee5[_0x1e29('0x20')][_0x1e29('0x24')]));_0x2e386a[_0x1e29('0x25')]=_0x2e386a['attributes'][_0x1e29('0x26')]?_0x2e386a[_0x1e29('0x25')]:_0x175a63['model'];if(_0x4c4ee5['query'][_0x1e29('0x31')]){_0x2e386a[_0x1e29('0x32')]=[{'all':!![]}];}_0x2e386a=_[_0x1e29('0x2f')]({},_0x2e386a,_0x4c4ee5[_0x1e29('0x30')]);return db['CloudProvider'][_0x1e29('0x39')](_0x2e386a)['then'](handleEntityNotFound(_0x22f380,null))['then'](function(_0x440d5d){if(_0x440d5d[_0x1e29('0x3a')]==='MicrosoftAzure'){var _0x4ceb0c=encryptor[_0x1e29('0x35')](_0x440d5d['data3']);_0x440d5d[_0x1e29('0x36')]=maskClientSecret(_0x4ceb0c);}return _0x440d5d;})[_0x1e29('0x14')](respondWithResult(_0x22f380,null))[_0x1e29('0x37')](handleError(_0x22f380,null));};exports[_0x1e29('0x3b')]=function(_0x51d957,_0x117f93){if(!_0x51d957[_0x1e29('0x3c')][_0x1e29('0x17')])throw new Error(_0x1e29('0x3d'));if(!_0x51d957[_0x1e29('0x3c')][_0x1e29('0x3a')])throw new Error(_0x1e29('0x3e'));var _0x9fa867=db[_0x1e29('0x1a')][_0x1e29('0x1b')][_0x1e29('0x3a')]['values'];if(!_0x9fa867['includes'](_0x51d957[_0x1e29('0x3c')][_0x1e29('0x3a')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x9fa867['join'](',\x20'));if(_0x51d957[_0x1e29('0x3c')][_0x1e29('0x3a')]===_0x1e29('0x3f')&&_0x51d957[_0x1e29('0x3c')][_0x1e29('0x36')]){_0x51d957[_0x1e29('0x3c')][_0x1e29('0x36')]=encryptor['encryptString'](_0x51d957[_0x1e29('0x3c')][_0x1e29('0x36')]);}return db['CloudProvider']['create'](_0x51d957[_0x1e29('0x3c')],{})[_0x1e29('0x14')](respondWithResult(_0x117f93,0xc9))[_0x1e29('0x37')](handleError(_0x117f93,null));};exports[_0x1e29('0x13')]=function(_0x5dba85,_0x1cff9a){if(_0x5dba85[_0x1e29('0x3c')]['id']){delete _0x5dba85[_0x1e29('0x3c')]['id'];}return db[_0x1e29('0x1a')][_0x1e29('0x39')]({'where':{'id':_0x5dba85[_0x1e29('0x40')]['id']}})[_0x1e29('0x14')](handleEntityNotFound(_0x1cff9a,null))['then'](function(_0x3e264e){if(_0x3e264e[_0x1e29('0x3a')]===_0x1e29('0x3f')&&_0x5dba85[_0x1e29('0x3c')][_0x1e29('0x36')]){_0x5dba85['body'][_0x1e29('0x36')]=encryptor[_0x1e29('0x41')](_0x5dba85[_0x1e29('0x3c')][_0x1e29('0x36')]);}return _0x3e264e;})[_0x1e29('0x14')](saveUpdates(_0x5dba85[_0x1e29('0x3c')],null))[_0x1e29('0x14')](respondWithResult(_0x1cff9a,null))[_0x1e29('0x37')](handleError(_0x1cff9a,null));};exports['destroy']=function(_0x18c6a3,_0xba5c2f){return db['CloudProvider'][_0x1e29('0x39')]({'where':{'id':_0x18c6a3[_0x1e29('0x40')]['id']}})[_0x1e29('0x14')](handleEntityNotFound(_0xba5c2f,null))[_0x1e29('0x14')](removeEntity(_0xba5c2f,null))['catch'](handleError(_0xba5c2f,null));};exports[_0x1e29('0x42')]=function(_0x5a2fa6,_0x13c407){return db['CloudProvider']['findOne']({'where':{'id':_0x5a2fa6[_0x1e29('0x40')]['id']},'raw':!![]})[_0x1e29('0x14')](function(_0x4550fc){if(!_0x4550fc)return _0x13c407['sendStatus'](0x194);return{'url':oauth[_0x1e29('0x43')](_0x4550fc,_0x5a2fa6[_0x1e29('0x44')]['id'])};})[_0x1e29('0x14')](respondWithResult(_0x13c407,null))['catch'](handleError(_0x13c407,null));};exports[_0x1e29('0x45')]=function(_0x22b13c,_0x3d78ad){var _0x2cb0ed=_0x22b13c[_0x1e29('0x3c')];var _0x172fdf;var _0xe7f688;if(_0x2cb0ed['error'])throw _0x2cb0ed;redis[_0x1e29('0x46')](_0x2cb0ed[_0x1e29('0x47')])['then'](function(_0x265277){if(!_0x265277)throw new Error(_0x1e29('0x48'));_0x172fdf=JSON[_0x1e29('0x49')](_0x265277);var _0x210b2f=Buffer[_0x1e29('0x4a')](_0x2cb0ed['state'],_0x1e29('0x4b'))[_0x1e29('0x4c')](_0x1e29('0x4d'));_0xe7f688=JSON[_0x1e29('0x49')](_0x210b2f);if(!oauth['isValidIdToken'](_0x2cb0ed['id_token'],_0x172fdf['oauth2Claims']))throw new Error(_0x1e29('0x4e'));redis[_0x1e29('0x4f')](_0x2cb0ed[_0x1e29('0x47')]);return oauth[_0x1e29('0x50')](_0x2cb0ed[_0x1e29('0x51')],_0x172fdf);})[_0x1e29('0x14')](function(_0x1be120){_0x172fdf[_0x1e29('0x52')]=_0x1be120[_0x1e29('0x53')];_0x172fdf['data6']=_0x1be120['refresh_token'];return db[_0x1e29('0x1a')]['update']({'data5':_0x172fdf['data5'],'data6':_0x172fdf[_0x1e29('0x54')]},{'where':{'id':_0x172fdf['id']}});})[_0x1e29('0x14')](function(){oauth[_0x1e29('0x55')](_0x172fdf);socket[_0x1e29('0x56')](_0x1e29('0x57'),{'id':_0xe7f688['id']});return;})[_0x1e29('0x14')](respondWithStatusCode(_0x3d78ad,null))[_0x1e29('0x37')](function(_0x17ca5b){if(_0xe7f688){socket[_0x1e29('0x56')]('microsoftAuthorization:error',{'id':_0xe7f688['id']});}if(!_0x172fdf){logger['error'](_0x1e29('0x58'),_0x17ca5b);return _0x3d78ad[_0x1e29('0xa')](0x1f4)['send'](_0x17ca5b[_0x1e29('0x59')]);}logger[_0x1e29('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x172fdf['id'],JSON[_0x1e29('0x5a')](_0x17ca5b));});};
\ No newline at end of file
+var _0x3ae0=['json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','sendStatus','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','length','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','find','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','parse','from','state','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status'];(function(_0x34ae7e,_0x1e8cdd){var _0x2a5324=function(_0x4f1dfc){while(--_0x4f1dfc){_0x34ae7e['push'](_0x34ae7e['shift']());}};_0x2a5324(++_0x1e8cdd);}(_0x3ae0,0x110));var _0x03ae=function(_0x57349e,_0x34c1c1){_0x57349e=_0x57349e-0x0;var _0x2a2671=_0x3ae0[_0x57349e];return _0x2a2671;};'use strict';var _=require(_0x03ae('0x0'));var Redis=require(_0x03ae('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x03ae('0x2'))(_0x03ae('0x3'));var db=require(_0x03ae('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x03ae('0x5')](config[_0x03ae('0x6')],{'host':_0x03ae('0x7'),'port':0x18eb});var socket=require(_0x03ae('0x8'))(new Redis(config[_0x03ae('0x6')]));var redis=new Redis(config[_0x03ae('0x6')]);function respondWithStatusCode(_0x3a64fc,_0x1aa2a0){_0x1aa2a0=_0x1aa2a0||0xcc;return function(_0x2d2093){if(_0x2d2093){return _0x3a64fc['sendStatus'](_0x1aa2a0);}return _0x3a64fc[_0x03ae('0x9')](_0x1aa2a0)['end']();};}function respondWithResult(_0x51ee33,_0x2c327f){_0x2c327f=_0x2c327f||0xc8;return function(_0x53f7bc){if(_0x53f7bc){return _0x51ee33[_0x03ae('0x9')](_0x2c327f)[_0x03ae('0xa')](_0x53f7bc);}};}function respondWithFilteredResult(_0x5a2aa8,_0x2d87c0){return function(_0x43c660){if(_0x43c660){var _0x2d0517=typeof _0x2d87c0['offset']===_0x03ae('0xb')&&typeof _0x2d87c0[_0x03ae('0xc')]==='undefined';var _0x549c2a=_0x43c660[_0x03ae('0xd')];var _0x21682e=_0x2d0517?0x0:_0x2d87c0[_0x03ae('0xe')];var _0x403a8a=_0x2d0517?_0x43c660['count']:_0x2d87c0[_0x03ae('0xe')]+_0x2d87c0[_0x03ae('0xc')];var _0x541da5;if(_0x403a8a>=_0x549c2a){_0x403a8a=_0x549c2a;_0x541da5=0xc8;}else{_0x541da5=0xce;}_0x5a2aa8['status'](_0x541da5);return _0x5a2aa8[_0x03ae('0xf')](_0x03ae('0x10'),_0x21682e+'-'+_0x403a8a+'/'+_0x549c2a)[_0x03ae('0xa')](_0x43c660);}return null;};}function saveUpdates(_0x371aa2){return function(_0x596f5b){if(_0x596f5b){return _0x596f5b[_0x03ae('0x11')](_0x371aa2)[_0x03ae('0x12')](function(_0x2c81f){return _0x2c81f;});}return null;};}function removeEntity(_0x2cdb86){return function(_0x54f93a){if(_0x54f93a){return _0x54f93a[_0x03ae('0x13')]()[_0x03ae('0x12')](function(){_0x2cdb86[_0x03ae('0x9')](0xcc)[_0x03ae('0x14')]();});}};}function handleEntityNotFound(_0x2b3643){return function(_0x2cf171){if(!_0x2cf171){_0x2b3643[_0x03ae('0x15')](0x194);}return _0x2cf171;};}function handleError(_0xa8c24f,_0x43a149){_0x43a149=_0x43a149||0x1f4;return function(_0x509b0e){logger[_0x03ae('0x16')](_0x509b0e['stack']);if(_0x509b0e[_0x03ae('0x17')]){delete _0x509b0e[_0x03ae('0x17')];}_0xa8c24f[_0x03ae('0x9')](_0x43a149)[_0x03ae('0x18')](_0x509b0e);};}function maskClientSecret(_0x5674f9){return _[_0x03ae('0x19')](_0x5674f9[_0x03ae('0x1a')](0x0,0x3),0x14,'*');}exports[_0x03ae('0x1b')]=function(_0x560dbd,_0x78e833){var _0x126ba7={},_0x342eda={},_0x9c832b={'count':0x0,'rows':[]};var _0x28c9fb=_[_0x03ae('0x1c')](db[_0x03ae('0x1d')][_0x03ae('0x1e')],function(_0x527c7d){return{'name':_0x527c7d['fieldName'],'type':_0x527c7d[_0x03ae('0x1f')][_0x03ae('0x20')]};});_0x342eda[_0x03ae('0x21')]=_[_0x03ae('0x1c')](_0x28c9fb,_0x03ae('0x17'));_0x342eda[_0x03ae('0x22')]=_[_0x03ae('0x23')](_0x560dbd[_0x03ae('0x22')]);_0x342eda[_0x03ae('0x24')]=_[_0x03ae('0x25')](_0x342eda[_0x03ae('0x21')],_0x342eda['query']);_0x126ba7[_0x03ae('0x26')]=_[_0x03ae('0x25')](_0x342eda['model'],qs[_0x03ae('0x27')](_0x560dbd[_0x03ae('0x22')]['fields']));_0x126ba7['attributes']=_0x126ba7[_0x03ae('0x26')]['length']?_0x126ba7['attributes']:_0x342eda['model'];if(!_0x560dbd[_0x03ae('0x22')]['hasOwnProperty'](_0x03ae('0x28'))){_0x126ba7[_0x03ae('0xc')]=qs[_0x03ae('0xc')](_0x560dbd[_0x03ae('0x22')][_0x03ae('0xc')]);_0x126ba7[_0x03ae('0xe')]=qs['offset'](_0x560dbd[_0x03ae('0x22')][_0x03ae('0xe')]);}_0x126ba7[_0x03ae('0x29')]=qs[_0x03ae('0x2a')](_0x560dbd[_0x03ae('0x22')]['sort']);_0x126ba7[_0x03ae('0x2b')]=qs[_0x03ae('0x24')](_[_0x03ae('0x2c')](_0x560dbd[_0x03ae('0x22')],_0x342eda[_0x03ae('0x24')]),_0x28c9fb);if(_0x560dbd[_0x03ae('0x22')]['filter']){_0x126ba7['where']=_[_0x03ae('0x2d')](_0x126ba7[_0x03ae('0x2b')],{'$or':_['map'](_0x28c9fb,function(_0x554c95){if(_0x554c95[_0x03ae('0x1f')]!==_0x03ae('0x2e')){var _0x21333d={};_0x21333d[_0x554c95[_0x03ae('0x17')]]={'$like':'%'+_0x560dbd[_0x03ae('0x22')][_0x03ae('0x2f')]+'%'};return _0x21333d;}})});}_0x126ba7=_['merge']({},_0x126ba7,_0x560dbd[_0x03ae('0x30')]);var _0x528c3a={'where':_0x126ba7[_0x03ae('0x2b')]};return db[_0x03ae('0x1d')]['count'](_0x528c3a)[_0x03ae('0x12')](function(_0x394e58){_0x9c832b[_0x03ae('0xd')]=_0x394e58;if(_0x560dbd[_0x03ae('0x22')][_0x03ae('0x31')]){_0x126ba7[_0x03ae('0x32')]=[{'all':!![]}];}return db[_0x03ae('0x1d')][_0x03ae('0x33')](_0x126ba7);})[_0x03ae('0x12')](function(_0x6f4c34){_0x9c832b[_0x03ae('0x34')]=_[_0x03ae('0x1c')](_0x6f4c34,function(_0x1c5bb8){if(_0x1c5bb8[_0x03ae('0x35')]===_0x03ae('0x36')){var _0x4b85fc=encryptor[_0x03ae('0x37')](_0x1c5bb8[_0x03ae('0x38')]);_0x1c5bb8[_0x03ae('0x38')]=maskClientSecret(_0x4b85fc);}return _0x1c5bb8;});return _0x9c832b;})[_0x03ae('0x12')](respondWithFilteredResult(_0x78e833,_0x126ba7))[_0x03ae('0x39')](handleError(_0x78e833,null));};exports['show']=function(_0x52db40,_0x29c6be){var _0x5d07da={'raw':!![],'where':{'id':_0x52db40[_0x03ae('0x3a')]['id']}},_0x184d38={};_0x184d38['model']=_[_0x03ae('0x23')](db[_0x03ae('0x1d')][_0x03ae('0x1e')]);_0x184d38['query']=_[_0x03ae('0x23')](_0x52db40[_0x03ae('0x22')]);_0x184d38[_0x03ae('0x24')]=_['intersection'](_0x184d38['model'],_0x184d38[_0x03ae('0x22')]);_0x5d07da[_0x03ae('0x26')]=_[_0x03ae('0x25')](_0x184d38['model'],qs[_0x03ae('0x27')](_0x52db40[_0x03ae('0x22')][_0x03ae('0x27')]));_0x5d07da[_0x03ae('0x26')]=_0x5d07da[_0x03ae('0x26')][_0x03ae('0x3b')]?_0x5d07da['attributes']:_0x184d38['model'];if(_0x52db40[_0x03ae('0x22')][_0x03ae('0x31')]){_0x5d07da['include']=[{'all':!![]}];}_0x5d07da=_[_0x03ae('0x2d')]({},_0x5d07da,_0x52db40[_0x03ae('0x30')]);return db['CloudProvider']['find'](_0x5d07da)[_0x03ae('0x12')](handleEntityNotFound(_0x29c6be,null))[_0x03ae('0x12')](function(_0x15787b){if(_0x15787b[_0x03ae('0x35')]===_0x03ae('0x36')){var _0x3e65dc=encryptor[_0x03ae('0x37')](_0x15787b[_0x03ae('0x38')]);_0x15787b[_0x03ae('0x38')]=maskClientSecret(_0x3e65dc);}return _0x15787b;})[_0x03ae('0x12')](respondWithResult(_0x29c6be,null))[_0x03ae('0x39')](handleError(_0x29c6be,null));};exports[_0x03ae('0x3c')]=function(_0x2a72ef,_0x388220){if(!_0x2a72ef['body']['name'])throw new Error(_0x03ae('0x3d'));if(!_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x35')])throw new Error(_0x03ae('0x3f'));var _0x594031=db['CloudProvider'][_0x03ae('0x1e')]['service'][_0x03ae('0x40')];if(!_0x594031['includes'](_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x594031['join'](',\x20'));if(_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x35')]==='MicrosoftAzure'&&_0x2a72ef['body'][_0x03ae('0x38')]){_0x2a72ef['body'][_0x03ae('0x38')]=encryptor['encryptString'](_0x2a72ef[_0x03ae('0x3e')][_0x03ae('0x38')]);}return db[_0x03ae('0x1d')][_0x03ae('0x3c')](_0x2a72ef['body'],{})['then'](respondWithResult(_0x388220,0xc9))[_0x03ae('0x39')](handleError(_0x388220,null));};exports[_0x03ae('0x11')]=function(_0x5cc266,_0x55463c){if(_0x5cc266[_0x03ae('0x3e')]['id']){delete _0x5cc266[_0x03ae('0x3e')]['id'];}return db[_0x03ae('0x1d')][_0x03ae('0x41')]({'where':{'id':_0x5cc266[_0x03ae('0x3a')]['id']}})['then'](handleEntityNotFound(_0x55463c,null))[_0x03ae('0x12')](function(_0xbca63d){if(_0xbca63d[_0x03ae('0x35')]===_0x03ae('0x36')&&_0x5cc266[_0x03ae('0x3e')]['data3']){_0x5cc266['body'][_0x03ae('0x38')]=encryptor[_0x03ae('0x42')](_0x5cc266[_0x03ae('0x3e')][_0x03ae('0x38')]);}return _0xbca63d;})[_0x03ae('0x12')](saveUpdates(_0x5cc266['body'],null))['then'](respondWithResult(_0x55463c,null))[_0x03ae('0x39')](handleError(_0x55463c,null));};exports[_0x03ae('0x13')]=function(_0x3d5eb7,_0x5e987f){return db[_0x03ae('0x1d')]['find']({'where':{'id':_0x3d5eb7[_0x03ae('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5e987f,null))['then'](removeEntity(_0x5e987f,null))[_0x03ae('0x39')](handleError(_0x5e987f,null));};exports[_0x03ae('0x43')]=function(_0x35ae87,_0x34151f){return db[_0x03ae('0x1d')][_0x03ae('0x44')]({'where':{'id':_0x35ae87[_0x03ae('0x3a')]['id']},'raw':!![]})[_0x03ae('0x12')](function(_0x51f4c0){if(!_0x51f4c0)return _0x34151f[_0x03ae('0x15')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x51f4c0,_0x35ae87[_0x03ae('0x45')]['id'])};})['then'](respondWithResult(_0x34151f,null))[_0x03ae('0x39')](handleError(_0x34151f,null));};exports[_0x03ae('0x46')]=function(_0x1b2139,_0x564a1c){var _0x4cadb9=_0x1b2139[_0x03ae('0x3e')];var _0x32188d;var _0x1ea4b8;if(_0x4cadb9[_0x03ae('0x16')])throw _0x4cadb9;redis[_0x03ae('0x47')](_0x4cadb9['state'])['then'](function(_0x38ffbb){if(!_0x38ffbb)throw new Error('Invalid\x20state\x20parameter');_0x32188d=JSON[_0x03ae('0x48')](_0x38ffbb);var _0x467f4a=Buffer[_0x03ae('0x49')](_0x4cadb9[_0x03ae('0x4a')],_0x03ae('0x4b'))[_0x03ae('0x4c')](_0x03ae('0x4d'));_0x1ea4b8=JSON['parse'](_0x467f4a);if(!oauth[_0x03ae('0x4e')](_0x4cadb9['id_token'],_0x32188d[_0x03ae('0x4f')]))throw new Error(_0x03ae('0x50'));redis[_0x03ae('0x51')](_0x4cadb9['state']);return oauth[_0x03ae('0x52')](_0x4cadb9[_0x03ae('0x53')],_0x32188d);})['then'](function(_0x49b5e5){_0x32188d[_0x03ae('0x54')]=_0x49b5e5['access_token'];_0x32188d[_0x03ae('0x55')]=_0x49b5e5[_0x03ae('0x56')];return db[_0x03ae('0x1d')][_0x03ae('0x11')]({'data5':_0x32188d[_0x03ae('0x54')],'data6':_0x32188d[_0x03ae('0x55')]},{'where':{'id':_0x32188d['id']}});})['then'](function(){oauth[_0x03ae('0x57')](_0x32188d);socket[_0x03ae('0x58')](_0x03ae('0x59'),{'id':_0x1ea4b8['id']});return;})[_0x03ae('0x12')](respondWithStatusCode(_0x564a1c,null))['catch'](function(_0x14f1cf){if(_0x1ea4b8){socket['emit'](_0x03ae('0x5a'),{'id':_0x1ea4b8['id']});}if(!_0x32188d){logger[_0x03ae('0x16')](_0x03ae('0x5b'),_0x14f1cf);return _0x564a1c['status'](0x1f4)[_0x03ae('0x18')](_0x14f1cf[_0x03ae('0x5c')]);}logger[_0x03ae('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x32188d['id'],JSON[_0x03ae('0x5d')](_0x14f1cf));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 82c8ece..eb8ac64 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 _0x9cac=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x11af81,_0x3d1a99){var _0x367dc6=function(_0x34370a){while(--_0x34370a){_0x11af81['push'](_0x11af81['shift']());}};_0x367dc6(++_0x3d1a99);}(_0x9cac,0x18c));var _0xc9ca=function(_0x487003,_0x57d4b9){_0x487003=_0x487003-0x0;var _0x2503c7=_0x9cac[_0x487003];return _0x2503c7;};'use strict';var _=require(_0xc9ca('0x0'));var util=require(_0xc9ca('0x1'));var logger=require('../../config/logger')(_0xc9ca('0x2'));var moment=require('moment');var BPromise=require(_0xc9ca('0x3'));var rp=require(_0xc9ca('0x4'));var fs=require('fs');var path=require(_0xc9ca('0x5'));var rimraf=require(_0xc9ca('0x6'));var config=require(_0xc9ca('0x7'));var attributes=require(_0xc9ca('0x8'));module[_0xc9ca('0x9')]=function(_0x5911ff,_0x4abb34){return _0x5911ff[_0xc9ca('0xa')](_0xc9ca('0xb'),attributes,{'tableName':_0xc9ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b0b=['moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x2262bf,_0xd7cf1){var _0x5115cc=function(_0x18e1f9){while(--_0x18e1f9){_0x2262bf['push'](_0x2262bf['shift']());}};_0x5115cc(++_0xd7cf1);}(_0x0b0b,0x128));var _0xb0b0=function(_0xdfd280,_0x17f746){_0xdfd280=_0xdfd280-0x0;var _0x1c5d8f=_0x0b0b[_0xdfd280];return _0x1c5d8f;};'use strict';var _=require(_0xb0b0('0x0'));var util=require(_0xb0b0('0x1'));var logger=require(_0xb0b0('0x2'))(_0xb0b0('0x3'));var moment=require(_0xb0b0('0x4'));var BPromise=require(_0xb0b0('0x5'));var rp=require(_0xb0b0('0x6'));var fs=require('fs');var path=require(_0xb0b0('0x7'));var rimraf=require('rimraf');var config=require(_0xb0b0('0x8'));var attributes=require(_0xb0b0('0x9'));module[_0xb0b0('0xa')]=function(_0x565baa,_0x48de74){return _0x565baa['define'](_0xb0b0('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 7c8311c..aa40339 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 _0x4cdd=['isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','localhost','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','/.default','join','data7','replace','data2','code','from','stringify','toString','base64','client_id','data1','response_type','data4','response_mode','form_post','scope','state','nonce','prompt','map','value','oauth2Claims','decode','payload','iss','issuer'];(function(_0x4e8cf3,_0x59b5f9){var _0x2c1fa1=function(_0x1f0d95){while(--_0x1f0d95){_0x4e8cf3['push'](_0x4e8cf3['shift']());}};_0x2c1fa1(++_0x59b5f9);}(_0x4cdd,0x1dc));var _0xd4cd=function(_0x2462ba,_0x5f0261){_0x2462ba=_0x2462ba-0x0;var _0xefe16a=_0x4cdd[_0x2462ba];return _0xefe16a;};'use strict';var _=require('lodash');var crypto=require(_0xd4cd('0x0'));var jwt=require(_0xd4cd('0x1'));var moment=require(_0xd4cd('0x2'));var Redis=require(_0xd4cd('0x3'));var rp=require('request-promise');var util=require(_0xd4cd('0x4'));var encryptor=require(_0xd4cd('0x5'));var config=require(_0xd4cd('0x6'));var logger=require('../../config/logger')(_0xd4cd('0x7'));var schedule=require(_0xd4cd('0x8'));var db=require(_0xd4cd('0x9'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd4cd('0xa'),'port':0x18eb});var redis=new Redis(config[_0xd4cd('0xb')]);var MICROSOFT_AUTH_URL=_0xd4cd('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd4cd('0xd'),_0xd4cd('0xe'),_0xd4cd('0xf'),'offline_access',_0xd4cd('0x10'),_0xd4cd('0x11'),_0xd4cd('0x12')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xd4cd('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x52aeeb){var _0x20370a=_['map'](AZURE_AUTH_SCOPES[_0x52aeeb[_0xd4cd('0x14')]]);if(_0x52aeeb['type']===_0xd4cd('0x15'))_0x20370a['push'](_0x52aeeb['data7']+_0xd4cd('0x16'));return _0x20370a[_0xd4cd('0x17')]('\x20');}function getAccessTokenScope(_0x4555ac){if(_0x4555ac[_0xd4cd('0x14')]==='Outlook365')return _0xd4cd('0x10');if(_0x4555ac['type']==='Dynamics365')return _0x4555ac[_0xd4cd('0x18')]+_0xd4cd('0x16');}function generateMicrosoftAuthorizationUrl(_0x200385,_0x59cd37){var _0xd5c49c=MICROSOFT_AUTH_URL[_0xd4cd('0x19')]('{TENANT_ID}',_0x200385[_0xd4cd('0x1a')]);var _0x541a7b=[_0xd4cd('0x1b'),'id_token'];var _0x42ac09=Buffer[_0xd4cd('0x1c')](JSON[_0xd4cd('0x1d')]({'id':_0x59cd37}))[_0xd4cd('0x1e')](_0xd4cd('0x1f'));var _0x110514=crypto['randomBytes'](0x10)[_0xd4cd('0x1e')]('hex');var _0x6c03b8=getAuthorizationScopes(_0x200385);var _0x538f65=[{'key':_0xd4cd('0x20'),'value':_0x200385[_0xd4cd('0x21')]},{'key':_0xd4cd('0x22'),'value':encodeURIComponent(_0x541a7b[_0xd4cd('0x17')]('\x20'))},{'key':'redirect_uri','value':_0x200385[_0xd4cd('0x23')]},{'key':_0xd4cd('0x24'),'value':_0xd4cd('0x25')},{'key':_0xd4cd('0x26'),'value':encodeURIComponent(_0x6c03b8)},{'key':_0xd4cd('0x27'),'value':_0x42ac09},{'key':_0xd4cd('0x28'),'value':_0x110514},{'key':_0xd4cd('0x29'),'value':'login'}];var _0xe0029c=_0xd5c49c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd4cd('0x2a')](_0x538f65,function(_0x43f548){return _0x43f548['key']+'='+_0x43f548[_0xd4cd('0x2b')];})[_0xd4cd('0x17')]('&');_0x200385[_0xd4cd('0x2c')]={'issuer':_0xd5c49c[_0xd4cd('0x19')]('oauth2/',''),'audience':_0x200385['data1'],'state':_0x42ac09,'nonce':_0x110514};redis['set'](_0x42ac09,JSON[_0xd4cd('0x1d')](_0x200385));return _0xe0029c;}function isValidIdToken(_0x3b4757,_0x40c033){try{var _0x11f3ae=jwt[_0xd4cd('0x2d')](_0x3b4757,{'complete':!![]});var _0x4c138c=_0x11f3ae[_0xd4cd('0x2e')];if(_0x4c138c[_0xd4cd('0x2f')]!==_0x40c033[_0xd4cd('0x30')])return![];if(_0x4c138c['aud']!==_0x40c033['audience'])return![];if(_0x4c138c[_0xd4cd('0x28')]!==_0x40c033[_0xd4cd('0x28')])return![];if(moment()[_0xd4cd('0x31')](moment[_0xd4cd('0x32')](_0x4c138c[_0xd4cd('0x33')])))return![];return!![];}catch(_0x257ac0){throw _0x257ac0;}}function refreshOauth2MicrosoftAccessToken(_0xab2ec9){return Promise[_0xd4cd('0x34')]()[_0xd4cd('0x35')](function(){if(_0xab2ec9[_0xd4cd('0x36')])return _0xab2ec9;return db[_0xd4cd('0x37')][_0xd4cd('0x38')]({'where':{'id':_0xab2ec9['id']},'raw':!![]});})[_0xd4cd('0x35')](function(_0x56a237){var _0x1fdce8={'grant_type':_0xd4cd('0x39'),'refresh_token':_0x56a237[_0xd4cd('0x3a')],'scope':getAccessTokenScope(_0x56a237),'redirect_uri':_0x56a237[_0xd4cd('0x23')],'client_id':_0x56a237['data1'],'client_secret':encryptor[_0xd4cd('0x3b')](_0x56a237[_0xd4cd('0x36')])};var _0x4b8cfb={'method':_0xd4cd('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xd4cd('0x19')](_0xd4cd('0x3d'),_0x56a237['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1fdce8,'json':!![]};return rp(_0x4b8cfb);})[_0xd4cd('0x35')](function(_0x491d45){_0xab2ec9['data5']=_0x491d45[_0xd4cd('0x3e')];_0xab2ec9['data6']=_0x491d45[_0xd4cd('0x39')];return db[_0xd4cd('0x37')][_0xd4cd('0x3f')]({'data5':_0xab2ec9[_0xd4cd('0x40')],'data6':_0xab2ec9[_0xd4cd('0x3a')]},{'where':{'id':_0xab2ec9['id']}});})['then'](function(){return _0xab2ec9;})[_0xd4cd('0x41')](function(_0x4a98c2){logger[_0xd4cd('0x42')](_0xd4cd('0x43'),_0xab2ec9['id'],_0x4a98c2);});}function getOauth2MicrosoftAccessToken(_0x2f88a5,_0x4a27e4){var _0x45cc49={'grant_type':_0xd4cd('0x44'),'code':_0x2f88a5,'scope':getAccessTokenScope(_0x4a27e4),'redirect_uri':_0x4a27e4[_0xd4cd('0x23')],'client_id':_0x4a27e4[_0xd4cd('0x21')],'client_secret':encryptor['decryptString'](_0x4a27e4['data3'])};var _0x1739b3={'method':_0xd4cd('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xd4cd('0x19')]('{TENANT_ID}',_0x4a27e4['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x45cc49,'json':!![]};return rp(_0x1739b3);}function startRefreshInterval(_0x59667f){var _0x4a120e=schedule[_0xd4cd('0x45')];if(_0x4a120e[_0x59667f['id']])clearInterval(_0x4a120e[_0x59667f['id']]);_0x4a120e[_0x59667f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd4cd('0x46')](this,{'id':_0x59667f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4a120e;}function startAllRefreshIntervals(){return db[_0xd4cd('0x37')][_0xd4cd('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3ab22c){var _0x58104b=_0x3ab22c[_0xd4cd('0x2a')](function(_0x2667b4){return refreshOauth2MicrosoftAccessToken(_0x2667b4)[_0xd4cd('0x35')](function(_0x2c42df){startRefreshInterval(_0x2c42df);});});return Promise[_0xd4cd('0x48')](_0x58104b);})[_0xd4cd('0x41')](function(_0xdc926){var _0x21cdfb=_0xdc926?util['inspect'](_0xdc926,{'showHidden':![],'depth':null}):'';logger['error'](_0xd4cd('0x49'),_0x21cdfb);});}module[_0xd4cd('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1a1a=['openid','profile','https://outlook.office.com/SMTP.Send','offline_access','/authorize','map','type','Dynamics365','push','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','{TENANT_ID}','data2','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data5','access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost'];(function(_0x1f99cc,_0x35138a){var _0x4e9c75=function(_0x41a9c9){while(--_0x41a9c9){_0x1f99cc['push'](_0x1f99cc['shift']());}};_0x4e9c75(++_0x35138a);}(_0x1a1a,0x12e));var _0xa1a1=function(_0x4d1631,_0x416231){_0x4d1631=_0x4d1631-0x0;var _0x3538a2=_0x1a1a[_0x4d1631];return _0x3538a2;};'use strict';var _=require(_0xa1a1('0x0'));var crypto=require(_0xa1a1('0x1'));var jwt=require(_0xa1a1('0x2'));var moment=require(_0xa1a1('0x3'));var Redis=require(_0xa1a1('0x4'));var rp=require(_0xa1a1('0x5'));var util=require(_0xa1a1('0x6'));var encryptor=require(_0xa1a1('0x7'));var config=require('../../config/environment');var logger=require(_0xa1a1('0x8'))(_0xa1a1('0x9'));var schedule=require(_0xa1a1('0xa'));var db=require('../../mysqldb')['db'];config[_0xa1a1('0xb')]=_[_0xa1a1('0xc')](config[_0xa1a1('0xb')],{'host':_0xa1a1('0xd'),'port':0x18eb});var redis=new Redis(config[_0xa1a1('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xa1a1('0xe'),_0xa1a1('0xf'),'email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xa1a1('0x10')],'Dynamics365':[_0xa1a1('0xe'),_0xa1a1('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xa1a1('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x575e54){var _0x122261=_[_0xa1a1('0x13')](AZURE_AUTH_SCOPES[_0x575e54['type']]);if(_0x575e54[_0xa1a1('0x14')]===_0xa1a1('0x15'))_0x122261[_0xa1a1('0x16')](_0x575e54['data7']+'/.default');return _0x122261[_0xa1a1('0x17')]('\x20');}function getAccessTokenScope(_0x3fa648){if(_0x3fa648[_0xa1a1('0x14')]===_0xa1a1('0x18'))return _0xa1a1('0x19');if(_0x3fa648['type']===_0xa1a1('0x15'))return _0x3fa648['data7']+_0xa1a1('0x1a');}function generateMicrosoftAuthorizationUrl(_0x425543,_0x4b1a54){var _0x343949=MICROSOFT_AUTH_URL['replace'](_0xa1a1('0x1b'),_0x425543[_0xa1a1('0x1c')]);var _0x40f400=['code','id_token'];var _0x423d5=Buffer[_0xa1a1('0x1d')](JSON[_0xa1a1('0x1e')]({'id':_0x4b1a54}))[_0xa1a1('0x1f')](_0xa1a1('0x20'));var _0x2a17d1=crypto[_0xa1a1('0x21')](0x10)['toString'](_0xa1a1('0x22'));var _0x28e0fc=getAuthorizationScopes(_0x425543);var _0x51a283=[{'key':_0xa1a1('0x23'),'value':_0x425543[_0xa1a1('0x24')]},{'key':_0xa1a1('0x25'),'value':encodeURIComponent(_0x40f400[_0xa1a1('0x17')]('\x20'))},{'key':_0xa1a1('0x26'),'value':_0x425543[_0xa1a1('0x27')]},{'key':_0xa1a1('0x28'),'value':_0xa1a1('0x29')},{'key':'scope','value':encodeURIComponent(_0x28e0fc)},{'key':_0xa1a1('0x2a'),'value':_0x423d5},{'key':_0xa1a1('0x2b'),'value':_0x2a17d1},{'key':_0xa1a1('0x2c'),'value':_0xa1a1('0x2d')}];var _0x5861f5=_0x343949+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa1a1('0x13')](_0x51a283,function(_0x4f6c33){return _0x4f6c33[_0xa1a1('0x2e')]+'='+_0x4f6c33[_0xa1a1('0x2f')];})[_0xa1a1('0x17')]('&');_0x425543[_0xa1a1('0x30')]={'issuer':_0x343949[_0xa1a1('0x31')](_0xa1a1('0x32'),''),'audience':_0x425543[_0xa1a1('0x24')],'state':_0x423d5,'nonce':_0x2a17d1};redis[_0xa1a1('0x33')](_0x423d5,JSON[_0xa1a1('0x1e')](_0x425543));return _0x5861f5;}function isValidIdToken(_0x44670b,_0x3c7134){try{var _0x334bfd=jwt[_0xa1a1('0x34')](_0x44670b,{'complete':!![]});var _0x3ac40b=_0x334bfd[_0xa1a1('0x35')];if(_0x3ac40b['iss']!==_0x3c7134[_0xa1a1('0x36')])return![];if(_0x3ac40b[_0xa1a1('0x37')]!==_0x3c7134[_0xa1a1('0x38')])return![];if(_0x3ac40b['nonce']!==_0x3c7134[_0xa1a1('0x2b')])return![];if(moment()[_0xa1a1('0x39')](moment[_0xa1a1('0x3a')](_0x3ac40b[_0xa1a1('0x3b')])))return![];return!![];}catch(_0x1ba598){throw _0x1ba598;}}function refreshOauth2MicrosoftAccessToken(_0x5e5ab3){return Promise[_0xa1a1('0x3c')]()[_0xa1a1('0x3d')](function(){if(_0x5e5ab3[_0xa1a1('0x3e')])return _0x5e5ab3;return db[_0xa1a1('0x3f')][_0xa1a1('0x40')]({'where':{'id':_0x5e5ab3['id']},'raw':!![]});})[_0xa1a1('0x3d')](function(_0x324070){var _0x37aa2f={'grant_type':_0xa1a1('0x41'),'refresh_token':_0x324070['data6'],'scope':getAccessTokenScope(_0x324070),'redirect_uri':_0x324070[_0xa1a1('0x27')],'client_id':_0x324070[_0xa1a1('0x24')],'client_secret':encryptor[_0xa1a1('0x42')](_0x324070[_0xa1a1('0x3e')])};var _0x316aa5={'method':_0xa1a1('0x43'),'uri':MICROSOFT_AUTH_URL[_0xa1a1('0x31')](_0xa1a1('0x1b'),_0x324070[_0xa1a1('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x37aa2f,'json':!![]};return rp(_0x316aa5);})[_0xa1a1('0x3d')](function(_0xecb709){_0x5e5ab3[_0xa1a1('0x44')]=_0xecb709[_0xa1a1('0x45')];_0x5e5ab3[_0xa1a1('0x46')]=_0xecb709[_0xa1a1('0x41')];return db[_0xa1a1('0x3f')][_0xa1a1('0x47')]({'data5':_0x5e5ab3[_0xa1a1('0x44')],'data6':_0x5e5ab3[_0xa1a1('0x46')]},{'where':{'id':_0x5e5ab3['id']}});})['then'](function(){return _0x5e5ab3;})[_0xa1a1('0x48')](function(_0x4a605f){logger[_0xa1a1('0x49')](_0xa1a1('0x4a'),_0x5e5ab3['id'],_0x4a605f);});}function getOauth2MicrosoftAccessToken(_0x422163,_0x5eb82c){var _0x2e5a48={'grant_type':'authorization_code','code':_0x422163,'scope':getAccessTokenScope(_0x5eb82c),'redirect_uri':_0x5eb82c['data4'],'client_id':_0x5eb82c[_0xa1a1('0x24')],'client_secret':encryptor[_0xa1a1('0x42')](_0x5eb82c['data3'])};var _0x12aec2={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xa1a1('0x1b'),_0x5eb82c[_0xa1a1('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e5a48,'json':!![]};return rp(_0x12aec2);}function startRefreshInterval(_0x3c910b){var _0x5ee4b1=schedule['intervals'];if(_0x5ee4b1[_0x3c910b['id']])clearInterval(_0x5ee4b1[_0x3c910b['id']]);_0x5ee4b1[_0x3c910b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa1a1('0x4b')](this,{'id':_0x3c910b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5ee4b1;}function startAllRefreshIntervals(){return db[_0xa1a1('0x3f')][_0xa1a1('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa1a1('0x3d')](function(_0x3f6df7){var _0x452aba=_0x3f6df7[_0xa1a1('0x13')](function(_0x26aaae){return refreshOauth2MicrosoftAccessToken(_0x26aaae)[_0xa1a1('0x3d')](function(_0x289f70){startRefreshInterval(_0x289f70);});});return Promise[_0xa1a1('0x4d')](_0x452aba);})['catch'](function(_0x5507fe){var _0x70c3d6=_0x5507fe?util['inspect'](_0x5507fe,{'showHidden':![],'depth':null}):'';logger[_0xa1a1('0x49')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x70c3d6);});}module[_0xa1a1('0x4e')]={'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 fd58744..cc32fb6 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 _0x5360=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result'];(function(_0x377434,_0x49e358){var _0x2282bd=function(_0xa92e0b){while(--_0xa92e0b){_0x377434['push'](_0x377434['shift']());}};_0x2282bd(++_0x49e358);}(_0x5360,0x157));var _0x0536=function(_0x5b8731,_0x4b677a){_0x5b8731=_0x5b8731-0x0;var _0x34382e=_0x5360[_0x5b8731];return _0x34382e;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var moment=require(_0x0536('0x2'));var BPromise=require(_0x0536('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0536('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0536('0x5'))(_0x0536('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0536('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19c89e,_0x1122a2,_0x27cac6){return new BPromise(function(_0x4974ad,_0x180b94){return client[_0x0536('0x8')](_0x19c89e,_0x27cac6)[_0x0536('0x9')](function(_0x5b78e2){logger[_0x0536('0xa')]('CloudProvider,\x20%s,\x20%s',_0x1122a2,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1122a2,_0x0536('0xb'),JSON[_0x0536('0xc')](_0x5b78e2));if(_0x5b78e2[_0x0536('0xd')]){if(_0x5b78e2[_0x0536('0xd')][_0x0536('0xe')]===0x1f4){logger[_0x0536('0xd')](_0x0536('0xf'),_0x1122a2,_0x5b78e2[_0x0536('0xd')][_0x0536('0x10')]);return _0x180b94(_0x5b78e2[_0x0536('0xd')][_0x0536('0x10')]);}logger[_0x0536('0xd')](_0x0536('0xf'),_0x1122a2,_0x5b78e2['error'][_0x0536('0x10')]);return _0x4974ad(_0x5b78e2[_0x0536('0xd')][_0x0536('0x10')]);}else{logger[_0x0536('0xa')](_0x0536('0xf'),_0x1122a2,'request\x20sent');_0x4974ad(_0x5b78e2[_0x0536('0x11')][_0x0536('0x10')]);}})[_0x0536('0x12')](function(_0x1ff4f9){logger['error']('CloudProvider,\x20%s,\x20%s',_0x1122a2,_0x1ff4f9);_0x180b94(_0x1ff4f9);});});}
\ No newline at end of file
+var _0xd5a2=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0xa48ac5,_0xde975d){var _0x1e1d7a=function(_0x529efa){while(--_0x529efa){_0xa48ac5['push'](_0xa48ac5['shift']());}};_0x1e1d7a(++_0xde975d);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x568c2c,_0x366739){_0x568c2c=_0x568c2c-0x0;var _0x465923=_0xd5a2[_0x568c2c];return _0x465923;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));var BPromise=require(_0x2d5a('0x2'));var rs=require(_0x2d5a('0x3'));var fs=require('fs');var Redis=require(_0x2d5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d5a('0x5'));var logger=require(_0x2d5a('0x6'))(_0x2d5a('0x7'));var config=require(_0x2d5a('0x8'));var jayson=require(_0x2d5a('0x9'));var client=jayson[_0x2d5a('0xa')][_0x2d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ae103,_0x1cdfc4,_0x7eb4c3){return new BPromise(function(_0x79898c,_0x4d5c52){return client['request'](_0x1ae103,_0x7eb4c3)[_0x2d5a('0xc')](function(_0x562b6a){logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,'request\x20sent');logger[_0x2d5a('0xf')](_0x2d5a('0x10'),_0x1cdfc4,_0x2d5a('0x11'),JSON[_0x2d5a('0x12')](_0x562b6a));if(_0x562b6a[_0x2d5a('0x13')]){if(_0x562b6a['error'][_0x2d5a('0x14')]===0x1f4){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x4d5c52(_0x562b6a['error'][_0x2d5a('0x15')]);}logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x79898c(_0x562b6a[_0x2d5a('0x13')][_0x2d5a('0x15')]);}else{logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,_0x2d5a('0x11'));_0x79898c(_0x562b6a['result'][_0x2d5a('0x15')]);}})[_0x2d5a('0x16')](function(_0x38de62){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x38de62);_0x4d5c52(_0x38de62);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index a279b36..6c31f98 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x1261,0x144));var _0x1126=function(_0x5b086e,_0x5eb6c0){_0x5b086e=_0x5b086e-0x0;var _0x3e2c2c=_0x1261[_0x5b086e];return _0x3e2c2c;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x199cc7,_0x5bace6){var _0x3fcea6=function(_0x444685){while(--_0x444685){_0x199cc7['push'](_0x199cc7['shift']());}};_0x3fcea6(++_0x5bace6);}(_0xadb5,0xad));var _0x5adb=function(_0x19e1d7,_0x2be996){_0x19e1d7=_0x19e1d7-0x0;var _0x41db5f=_0xadb5[_0x19e1d7];return _0x41db5f;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 8bd2a6e..f8655ba 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 _0xd5cd=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5cd,0x7e));var _0xdd5c=function(_0xaec54f,_0x2a794d){_0xaec54f=_0xaec54f-0x0;var _0x4c4cb1=_0xd5cd[_0xaec54f];return _0x4c4cb1;};'use strict';var Sequelize=require(_0xdd5c('0x0'));module[_0xdd5c('0x1')]={'name':{'type':Sequelize[_0xdd5c('0x2')],'unique':_0xdd5c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xdd5c('0x2')]},'companyId':{'type':Sequelize[_0xdd5c('0x2')]},'website':{'type':Sequelize[_0xdd5c('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xdd5c('0x2')]},'type':{'type':Sequelize[_0xdd5c('0x2')]},'street':{'type':Sequelize[_0xdd5c('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdd5c('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xdd5c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xdd5c('0x2')]},'sStreet':{'type':Sequelize[_0xdd5c('0x2')]},'sPostalCode':{'type':Sequelize[_0xdd5c('0x2')]},'sCity':{'type':Sequelize[_0xdd5c('0x2')]},'sCountry':{'type':Sequelize[_0xdd5c('0x2')]},'description':{'type':Sequelize[_0xdd5c('0x2')]}};
\ No newline at end of file
+var _0x49e9=['exports','STRING','name'];(function(_0x1fd2e6,_0x319411){var _0x38284b=function(_0x220170){while(--_0x220170){_0x1fd2e6['push'](_0x1fd2e6['shift']());}};_0x38284b(++_0x319411);}(_0x49e9,0x1cb));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x949e('0x0')]={'name':{'type':Sequelize[_0x949e('0x1')],'unique':_0x949e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x949e('0x1')]},'companyId':{'type':Sequelize[_0x949e('0x1')]},'website':{'type':Sequelize[_0x949e('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x949e('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x949e('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x949e('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x949e('0x1')]},'sStreet':{'type':Sequelize[_0x949e('0x1')]},'sPostalCode':{'type':Sequelize[_0x949e('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x949e('0x1')]},'description':{'type':Sequelize[_0x949e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index f17fbc2..0727310 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 _0xa423=['rawAttributes','intersection','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','CmContact','omit','getContacts','findOne','sort','filters','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','map','merge','options','includeAll','include','rows','catch','show'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0xa423,0x68));var _0x3a42=function(_0x10f5ea,_0xeb348a){_0x10f5ea=_0x10f5ea-0x0;var _0x5c4f0f=_0xa423[_0x10f5ea];return _0x5c4f0f;};'use strict';var emlformat=require(_0x3a42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a42('0x1'));var jsonpatch=require(_0x3a42('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a42('0x3'));var Mustache=require(_0x3a42('0x4'));var util=require(_0x3a42('0x5'));var path=require(_0x3a42('0x6'));var sox=require(_0x3a42('0x7'));var csv=require(_0x3a42('0x8'));var ejs=require(_0x3a42('0x9'));var fs=require('fs');var fs_extra=require(_0x3a42('0xa'));var _=require(_0x3a42('0xb'));var squel=require(_0x3a42('0xc'));var crypto=require(_0x3a42('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3a42('0xe'));var toCsv=require(_0x3a42('0x8'));var querystring=require(_0x3a42('0xf'));var Papa=require(_0x3a42('0x10'));var Redis=require('ioredis');var authService=require(_0x3a42('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3a42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a42('0x13'))(_0x3a42('0x14'));var utils=require(_0x3a42('0x15'));var config=require(_0x3a42('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a42('0x17'))['db'];function respondWithStatusCode(_0x201be3,_0x44ce86){_0x44ce86=_0x44ce86||0xcc;return function(_0x95b304){if(_0x95b304){return _0x201be3[_0x3a42('0x18')](_0x44ce86);}return _0x201be3[_0x3a42('0x19')](_0x44ce86)[_0x3a42('0x1a')]();};}function respondWithResult(_0x160dd6,_0x4c6734){_0x4c6734=_0x4c6734||0xc8;return function(_0x1e16c1){if(_0x1e16c1){return _0x160dd6[_0x3a42('0x19')](_0x4c6734)[_0x3a42('0x1b')](_0x1e16c1);}};}function respondWithFilteredResult(_0x1e9083,_0x5b5360){return function(_0x4c07d6){if(_0x4c07d6){var _0x3de11e=typeof _0x5b5360[_0x3a42('0x1c')]===_0x3a42('0x1d')&&typeof _0x5b5360[_0x3a42('0x1e')]==='undefined';var _0x1aa2c9=_0x4c07d6['count'];var _0x1b8b58=_0x3de11e?0x0:_0x5b5360['offset'];var _0x307ece=_0x3de11e?_0x4c07d6[_0x3a42('0x1f')]:_0x5b5360['offset']+_0x5b5360['limit'];var _0x195947;if(_0x307ece>=_0x1aa2c9){_0x307ece=_0x1aa2c9;_0x195947=0xc8;}else{_0x195947=0xce;}_0x1e9083[_0x3a42('0x19')](_0x195947);return _0x1e9083[_0x3a42('0x20')]('Content-Range',_0x1b8b58+'-'+_0x307ece+'/'+_0x1aa2c9)[_0x3a42('0x1b')](_0x4c07d6);}return null;};}function patchUpdates(_0x46f346){return function(_0x2d2503){try{jsonpatch[_0x3a42('0x21')](_0x2d2503,_0x46f346,!![]);}catch(_0x5ba57c){return BPromise['reject'](_0x5ba57c);}return _0x2d2503[_0x3a42('0x22')]();};}function saveUpdates(_0x289dac,_0x4821f9){return function(_0x529994){if(_0x529994){return _0x529994['update'](_0x289dac)[_0x3a42('0x23')](function(_0x5ca5c){return _0x5ca5c;});}return null;};}function removeEntity(_0x52c626,_0x3df28e){return function(_0x320761){if(_0x320761){return _0x320761[_0x3a42('0x24')]()[_0x3a42('0x23')](function(){var _0x317461=_0x320761[_0x3a42('0x25')]({'plain':!![]});var _0x147f3d=_0x3a42('0x26');return db[_0x3a42('0x27')][_0x3a42('0x24')]({'where':{'type':_0x147f3d,'resourceId':_0x317461['id']}})[_0x3a42('0x23')](function(){return _0x320761;});})[_0x3a42('0x23')](function(){_0x52c626[_0x3a42('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14ea60,_0x2c8255){return function(_0x2c3e6b){if(!_0x2c3e6b){_0x14ea60[_0x3a42('0x18')](0x194);}return _0x2c3e6b;};}function handleError(_0x4d785c,_0x159a04){_0x159a04=_0x159a04||0x1f4;return function(_0x49caac){logger[_0x3a42('0x28')](_0x49caac[_0x3a42('0x29')]);if(_0x49caac[_0x3a42('0x2a')]){delete _0x49caac[_0x3a42('0x2a')];}_0x4d785c[_0x3a42('0x19')](_0x159a04)[_0x3a42('0x2b')](_0x49caac);};}exports[_0x3a42('0x2c')]=function(_0x2a5fbd,_0x32016f){var _0x4c5ac5={},_0xc0023c={},_0x2add60={'count':0x0,'rows':[]};return db[_0x3a42('0x2d')][_0x3a42('0x2e')]()[_0x3a42('0x23')](function(_0x5e1777){_0xc0023c[_0x3a42('0x2f')]=_[_0x3a42('0x30')](_0x5e1777);_0xc0023c[_0x3a42('0x31')]=_[_0x3a42('0x30')](_0x2a5fbd['query']);_0xc0023c['filters']=_['intersection'](_0xc0023c[_0x3a42('0x2f')],_0xc0023c['query']);_0x4c5ac5[_0x3a42('0x32')]=_['intersection'](_0xc0023c[_0x3a42('0x2f')],qs[_0x3a42('0x33')](_0x2a5fbd[_0x3a42('0x31')]['fields']));_0x4c5ac5['attributes']=_0x4c5ac5[_0x3a42('0x32')][_0x3a42('0x34')]?_0x4c5ac5['attributes']:_0xc0023c[_0x3a42('0x2f')];if(!_0x2a5fbd['query'][_0x3a42('0x35')](_0x3a42('0x36'))){_0x4c5ac5['limit']=qs[_0x3a42('0x1e')](_0x2a5fbd[_0x3a42('0x31')]['limit']);_0x4c5ac5[_0x3a42('0x1c')]=qs[_0x3a42('0x1c')](_0x2a5fbd[_0x3a42('0x31')][_0x3a42('0x1c')]);}_0x4c5ac5['order']=qs['sort'](_0x2a5fbd[_0x3a42('0x31')]['sort']);_0x4c5ac5[_0x3a42('0x37')]=qs['filters'](_[_0x3a42('0x38')](_0x2a5fbd[_0x3a42('0x31')],_0xc0023c['filters']),_0x5e1777);if(_0x2a5fbd[_0x3a42('0x31')][_0x3a42('0x39')]){_0x4c5ac5['where']=_['merge'](_0x4c5ac5[_0x3a42('0x37')],{'$or':_[_0x3a42('0x3a')](_0x4c5ac5[_0x3a42('0x32')],function(_0x4cd4d8){var _0x4d2a66={};_0x4d2a66[_0x4cd4d8]={'$like':'%'+_0x2a5fbd[_0x3a42('0x31')][_0x3a42('0x39')]+'%'};return _0x4d2a66;})});}_0x4c5ac5=_[_0x3a42('0x3b')]({},_0x4c5ac5,_0x2a5fbd[_0x3a42('0x3c')]);var _0x5459d0={'where':_0x4c5ac5[_0x3a42('0x37')]};return db['CmCompany'][_0x3a42('0x1f')](_0x5459d0)[_0x3a42('0x23')](function(_0x22736e){_0x2add60[_0x3a42('0x1f')]=_0x22736e;if(_0x2a5fbd[_0x3a42('0x31')][_0x3a42('0x3d')]){_0x4c5ac5[_0x3a42('0x3e')]=[{'all':!![]}];}return db[_0x3a42('0x2d')]['findAll'](_0x4c5ac5);})[_0x3a42('0x23')](function(_0xe16dc7){_0x2add60[_0x3a42('0x3f')]=_0xe16dc7;return _0x2add60;})[_0x3a42('0x23')](respondWithFilteredResult(_0x32016f,_0x4c5ac5))[_0x3a42('0x40')](handleError(_0x32016f,null));})[_0x3a42('0x40')](handleError(_0x32016f,null));};exports[_0x3a42('0x41')]=function(_0x4207a0,_0x40f0d9){var _0x38dd63={'raw':![],'where':{'id':_0x4207a0['params']['id']}},_0x4a3c5b={};_0x4a3c5b[_0x3a42('0x2f')]=_[_0x3a42('0x30')](db[_0x3a42('0x2d')][_0x3a42('0x42')]);_0x4a3c5b['query']=_[_0x3a42('0x30')](_0x4207a0[_0x3a42('0x31')]);_0x4a3c5b['filters']=_[_0x3a42('0x43')](_0x4a3c5b[_0x3a42('0x2f')],_0x4a3c5b[_0x3a42('0x31')]);_0x38dd63[_0x3a42('0x32')]=_[_0x3a42('0x43')](_0x4a3c5b[_0x3a42('0x2f')],qs[_0x3a42('0x33')](_0x4207a0[_0x3a42('0x31')][_0x3a42('0x33')]));_0x38dd63[_0x3a42('0x32')]=_0x38dd63['attributes'][_0x3a42('0x34')]?_0x38dd63[_0x3a42('0x32')]:_0x4a3c5b[_0x3a42('0x2f')];if(_0x4207a0[_0x3a42('0x31')][_0x3a42('0x3d')]){_0x38dd63[_0x3a42('0x3e')]=[{'all':!![]}];}_0x38dd63=_['merge']({},_0x38dd63,_0x4207a0[_0x3a42('0x3c')]);return db[_0x3a42('0x2d')]['find'](_0x38dd63)[_0x3a42('0x23')](handleEntityNotFound(_0x40f0d9,null))[_0x3a42('0x23')](respondWithResult(_0x40f0d9,null))[_0x3a42('0x40')](handleError(_0x40f0d9,null));};exports['create']=function(_0x324db2,_0x179cf4){return db[_0x3a42('0x2d')][_0x3a42('0x44')](_0x324db2[_0x3a42('0x45')],{})[_0x3a42('0x23')](function(_0x1000f9){var _0x353c6c=_0x324db2[_0x3a42('0x46')][_0x3a42('0x25')]({'plain':!![]});if(!_0x353c6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x353c6c['role']==='user'){var _0x53cf0d=_0x1000f9['get']({'plain':!![]});var _0x3a5687=_0x3a42('0x26');return db[_0x3a42('0x47')][_0x3a42('0x48')]({'where':{'name':_0x3a5687,'userProfileId':_0x353c6c[_0x3a42('0x49')]},'raw':!![]})[_0x3a42('0x23')](function(_0x4f8a7d){if(_0x4f8a7d&&_0x4f8a7d[_0x3a42('0x4a')]===0x0){return db[_0x3a42('0x27')][_0x3a42('0x44')]({'name':_0x53cf0d['name'],'resourceId':_0x53cf0d['id'],'type':_0x4f8a7d[_0x3a42('0x2a')],'sectionId':_0x4f8a7d['id']},{})['then'](function(){return _0x1000f9;});}else{return _0x1000f9;}})[_0x3a42('0x40')](function(_0x8f3c69){logger['error'](_0x3a42('0x4b'),_0x8f3c69);throw _0x8f3c69;});}return _0x1000f9;})[_0x3a42('0x23')](respondWithResult(_0x179cf4,0xc9))[_0x3a42('0x40')](handleError(_0x179cf4,null));};exports[_0x3a42('0x4c')]=function(_0x3030f5,_0x2e217e){if(_0x3030f5[_0x3a42('0x45')]['id']){delete _0x3030f5[_0x3a42('0x45')]['id'];}return db['CmCompany'][_0x3a42('0x48')]({'where':{'id':_0x3030f5[_0x3a42('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2e217e,null))['then'](saveUpdates(_0x3030f5['body'],null))[_0x3a42('0x23')](respondWithResult(_0x2e217e,null))[_0x3a42('0x40')](handleError(_0x2e217e,null));};exports[_0x3a42('0x24')]=function(_0x418212,_0x392e77){return db[_0x3a42('0x2d')]['find']({'where':{'id':_0x418212[_0x3a42('0x4d')]['id']}})[_0x3a42('0x23')](handleEntityNotFound(_0x392e77,null))[_0x3a42('0x23')](removeEntity(_0x392e77,null))['catch'](handleError(_0x392e77,null));};exports['describe']=function(_0x3af76b,_0x25b799){return db[_0x3a42('0x2d')][_0x3a42('0x2e')]()[_0x3a42('0x23')](respondWithResult(_0x25b799,null))['catch'](handleError(_0x25b799,null));};exports[_0x3a42('0x4e')]=function(_0x17a63f,_0x2f8b2e,_0x452483){return db[_0x3a42('0x4f')]['find']({'where':{'id':_0x17a63f['params']['id']}})[_0x3a42('0x23')](handleEntityNotFound(_0x2f8b2e,null))[_0x3a42('0x23')](function(_0x39a333){if(_0x39a333){return _0x39a333[_0x3a42('0x4e')](_0x17a63f[_0x3a42('0x45')]['ids'],_[_0x3a42('0x50')](_0x17a63f['body'],['ids','id'])||{});}})[_0x3a42('0x23')](respondWithResult(_0x2f8b2e,null))['catch'](handleError(_0x2f8b2e,null));};exports[_0x3a42('0x51')]=function(_0x5e2383,_0x499f81,_0x13e360){var _0xc91101={};var _0x440b6b={};var _0x41ee80;var _0x12645f;return db[_0x3a42('0x2d')][_0x3a42('0x52')]({'where':{'id':_0x5e2383['params']['id']}})[_0x3a42('0x23')](handleEntityNotFound(_0x499f81,null))[_0x3a42('0x23')](function(_0x166d18){if(_0x166d18){_0x41ee80=_0x166d18;_0x440b6b[_0x3a42('0x2f')]=_[_0x3a42('0x30')](db[_0x3a42('0x4f')][_0x3a42('0x42')]);_0x440b6b[_0x3a42('0x31')]=_['keys'](_0x5e2383[_0x3a42('0x31')]);_0x440b6b['filters']=_[_0x3a42('0x43')](_0x440b6b[_0x3a42('0x2f')],_0x440b6b['query']);_0xc91101['attributes']=_[_0x3a42('0x43')](_0x440b6b[_0x3a42('0x2f')],qs[_0x3a42('0x33')](_0x5e2383[_0x3a42('0x31')][_0x3a42('0x33')]));_0xc91101[_0x3a42('0x32')]=_0xc91101[_0x3a42('0x32')]['length']?_0xc91101[_0x3a42('0x32')]:_0x440b6b['model'];_0xc91101['order']=qs[_0x3a42('0x53')](_0x5e2383[_0x3a42('0x31')][_0x3a42('0x53')]);_0xc91101[_0x3a42('0x37')]=qs[_0x3a42('0x54')](_[_0x3a42('0x38')](_0x5e2383['query'],_0x440b6b[_0x3a42('0x54')]));if(_0x5e2383[_0x3a42('0x31')]['filter']){_0xc91101[_0x3a42('0x37')]=_[_0x3a42('0x3b')](_0xc91101[_0x3a42('0x37')],{'$or':_[_0x3a42('0x3a')](_0xc91101['attributes'],function(_0xb3afde){var _0x2518cf={};_0x2518cf[_0xb3afde]={'$like':'%'+_0x5e2383[_0x3a42('0x31')]['filter']+'%'};return _0x2518cf;})});}_0xc91101=_[_0x3a42('0x3b')]({},_0xc91101,_0x5e2383[_0x3a42('0x3c')]);return _0x41ee80[_0x3a42('0x51')](_0xc91101);}})[_0x3a42('0x23')](function(_0x1274d1){if(_0x1274d1){_0x12645f=_0x1274d1[_0x3a42('0x34')];if(!_0x5e2383[_0x3a42('0x31')][_0x3a42('0x35')]('nolimit')){_0xc91101[_0x3a42('0x1e')]=qs[_0x3a42('0x1e')](_0x5e2383[_0x3a42('0x31')]['limit']);_0xc91101[_0x3a42('0x1c')]=qs[_0x3a42('0x1c')](_0x5e2383[_0x3a42('0x31')][_0x3a42('0x1c')]);}return _0x41ee80[_0x3a42('0x51')](_0xc91101);}})[_0x3a42('0x23')](function(_0x2a5e41){if(_0x2a5e41){return _0x2a5e41?{'count':_0x12645f,'rows':_0x2a5e41}:null;}})[_0x3a42('0x23')](respondWithResult(_0x499f81,null))[_0x3a42('0x40')](handleError(_0x499f81,null));};
\ No newline at end of file
+var _0xdbcb=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addContacts','ids','omit','findOne','CmContact','options','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','name','index','CmCompany','keys','query','filters','intersection','model'];(function(_0x326f81,_0x57c9d8){var _0x8a3c6e=function(_0xde3601){while(--_0xde3601){_0x326f81['push'](_0x326f81['shift']());}};_0x8a3c6e(++_0x57c9d8);}(_0xdbcb,0x12f));var _0xbdbc=function(_0x25dfdf,_0x542333){_0x25dfdf=_0x25dfdf-0x0;var _0x5220da=_0xdbcb[_0x25dfdf];return _0x5220da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdbc('0x0'));var zipdir=require(_0xbdbc('0x1'));var jsonpatch=require(_0xbdbc('0x2'));var rp=require(_0xbdbc('0x3'));var moment=require(_0xbdbc('0x4'));var BPromise=require(_0xbdbc('0x5'));var Mustache=require(_0xbdbc('0x6'));var util=require(_0xbdbc('0x7'));var path=require('path');var sox=require(_0xbdbc('0x8'));var csv=require(_0xbdbc('0x9'));var ejs=require(_0xbdbc('0xa'));var fs=require('fs');var fs_extra=require(_0xbdbc('0xb'));var _=require(_0xbdbc('0xc'));var squel=require(_0xbdbc('0xd'));var crypto=require(_0xbdbc('0xe'));var jsforce=require(_0xbdbc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbdbc('0x9'));var querystring=require('querystring');var Papa=require(_0xbdbc('0x10'));var Redis=require(_0xbdbc('0x11'));var authService=require(_0xbdbc('0x12'));var qs=require(_0xbdbc('0x13'));var as=require(_0xbdbc('0x14'));var hardwareService=require(_0xbdbc('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xbdbc('0x16'));var config=require(_0xbdbc('0x17'));var licenseUtil=require(_0xbdbc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14335d,_0x51e0f5){_0x51e0f5=_0x51e0f5||0xcc;return function(_0x2d6c27){if(_0x2d6c27){return _0x14335d[_0xbdbc('0x19')](_0x51e0f5);}return _0x14335d[_0xbdbc('0x1a')](_0x51e0f5)[_0xbdbc('0x1b')]();};}function respondWithResult(_0x495abb,_0xe41dda){_0xe41dda=_0xe41dda||0xc8;return function(_0x5efb98){if(_0x5efb98){return _0x495abb[_0xbdbc('0x1a')](_0xe41dda)[_0xbdbc('0x1c')](_0x5efb98);}};}function respondWithFilteredResult(_0x4eb118,_0x3f6ba3){return function(_0x2cacff){if(_0x2cacff){var _0xce5d1f=typeof _0x3f6ba3['offset']===_0xbdbc('0x1d')&&typeof _0x3f6ba3[_0xbdbc('0x1e')]==='undefined';var _0x5077ea=_0x2cacff[_0xbdbc('0x1f')];var _0x504810=_0xce5d1f?0x0:_0x3f6ba3[_0xbdbc('0x20')];var _0x4f3bd1=_0xce5d1f?_0x2cacff[_0xbdbc('0x1f')]:_0x3f6ba3[_0xbdbc('0x20')]+_0x3f6ba3[_0xbdbc('0x1e')];var _0x341590;if(_0x4f3bd1>=_0x5077ea){_0x4f3bd1=_0x5077ea;_0x341590=0xc8;}else{_0x341590=0xce;}_0x4eb118[_0xbdbc('0x1a')](_0x341590);return _0x4eb118[_0xbdbc('0x21')](_0xbdbc('0x22'),_0x504810+'-'+_0x4f3bd1+'/'+_0x5077ea)['json'](_0x2cacff);}return null;};}function patchUpdates(_0x5e405c){return function(_0xe66cfc){try{jsonpatch[_0xbdbc('0x23')](_0xe66cfc,_0x5e405c,!![]);}catch(_0xd21760){return BPromise[_0xbdbc('0x24')](_0xd21760);}return _0xe66cfc[_0xbdbc('0x25')]();};}function saveUpdates(_0x1500ff,_0x345d36){return function(_0x2bb9a2){if(_0x2bb9a2){return _0x2bb9a2[_0xbdbc('0x26')](_0x1500ff)[_0xbdbc('0x27')](function(_0x551253){return _0x551253;});}return null;};}function removeEntity(_0x5cee67,_0x2416a4){return function(_0x285158){if(_0x285158){return _0x285158[_0xbdbc('0x28')]()[_0xbdbc('0x27')](function(){var _0x455a30=_0x285158[_0xbdbc('0x29')]({'plain':!![]});var _0x5c16b7=_0xbdbc('0x2a');return db[_0xbdbc('0x2b')][_0xbdbc('0x28')]({'where':{'type':_0x5c16b7,'resourceId':_0x455a30['id']}})['then'](function(){return _0x285158;});})[_0xbdbc('0x27')](function(){_0x5cee67[_0xbdbc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x398321,_0x158201){return function(_0xe962ec){if(!_0xe962ec){_0x398321[_0xbdbc('0x19')](0x194);}return _0xe962ec;};}function handleError(_0x144f2e,_0x114ec5){_0x114ec5=_0x114ec5||0x1f4;return function(_0x20571c){logger[_0xbdbc('0x2c')](_0x20571c['stack']);if(_0x20571c[_0xbdbc('0x2d')]){delete _0x20571c['name'];}_0x144f2e[_0xbdbc('0x1a')](_0x114ec5)['send'](_0x20571c);};}exports[_0xbdbc('0x2e')]=function(_0x2e8458,_0x549643){var _0x4127fb={},_0xcdc5b1={},_0x9496d6={'count':0x0,'rows':[]};return db[_0xbdbc('0x2f')]['describe']()['then'](function(_0x100e07){_0xcdc5b1['model']=_[_0xbdbc('0x30')](_0x100e07);_0xcdc5b1[_0xbdbc('0x31')]=_['keys'](_0x2e8458[_0xbdbc('0x31')]);_0xcdc5b1[_0xbdbc('0x32')]=_[_0xbdbc('0x33')](_0xcdc5b1[_0xbdbc('0x34')],_0xcdc5b1['query']);_0x4127fb[_0xbdbc('0x35')]=_['intersection'](_0xcdc5b1[_0xbdbc('0x34')],qs[_0xbdbc('0x36')](_0x2e8458['query'][_0xbdbc('0x36')]));_0x4127fb[_0xbdbc('0x35')]=_0x4127fb[_0xbdbc('0x35')][_0xbdbc('0x37')]?_0x4127fb[_0xbdbc('0x35')]:_0xcdc5b1[_0xbdbc('0x34')];if(!_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x38')](_0xbdbc('0x39'))){_0x4127fb[_0xbdbc('0x1e')]=qs[_0xbdbc('0x1e')](_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x1e')]);_0x4127fb[_0xbdbc('0x20')]=qs[_0xbdbc('0x20')](_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x20')]);}_0x4127fb[_0xbdbc('0x3a')]=qs[_0xbdbc('0x3b')](_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x3b')]);_0x4127fb[_0xbdbc('0x3c')]=qs[_0xbdbc('0x32')](_[_0xbdbc('0x3d')](_0x2e8458[_0xbdbc('0x31')],_0xcdc5b1[_0xbdbc('0x32')]),_0x100e07);if(_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x3e')]){_0x4127fb[_0xbdbc('0x3c')]=_[_0xbdbc('0x3f')](_0x4127fb[_0xbdbc('0x3c')],{'$or':_[_0xbdbc('0x40')](_0x4127fb[_0xbdbc('0x35')],function(_0x3caa46){var _0xcbe8db={};_0xcbe8db[_0x3caa46]={'$like':'%'+_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x3e')]+'%'};return _0xcbe8db;})});}_0x4127fb=_[_0xbdbc('0x3f')]({},_0x4127fb,_0x2e8458['options']);var _0x4239c2={'where':_0x4127fb[_0xbdbc('0x3c')]};return db['CmCompany']['count'](_0x4239c2)['then'](function(_0x563b43){_0x9496d6[_0xbdbc('0x1f')]=_0x563b43;if(_0x2e8458[_0xbdbc('0x31')][_0xbdbc('0x41')]){_0x4127fb[_0xbdbc('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0xbdbc('0x43')](_0x4127fb);})[_0xbdbc('0x27')](function(_0x25681c){_0x9496d6[_0xbdbc('0x44')]=_0x25681c;return _0x9496d6;})[_0xbdbc('0x27')](respondWithFilteredResult(_0x549643,_0x4127fb))[_0xbdbc('0x45')](handleError(_0x549643,null));})[_0xbdbc('0x45')](handleError(_0x549643,null));};exports[_0xbdbc('0x46')]=function(_0x528900,_0x52d471){var _0x3a8ff2={'raw':![],'where':{'id':_0x528900[_0xbdbc('0x47')]['id']}},_0x4ecc7f={};_0x4ecc7f['model']=_[_0xbdbc('0x30')](db[_0xbdbc('0x2f')][_0xbdbc('0x48')]);_0x4ecc7f['query']=_[_0xbdbc('0x30')](_0x528900[_0xbdbc('0x31')]);_0x4ecc7f[_0xbdbc('0x32')]=_[_0xbdbc('0x33')](_0x4ecc7f[_0xbdbc('0x34')],_0x4ecc7f[_0xbdbc('0x31')]);_0x3a8ff2[_0xbdbc('0x35')]=_[_0xbdbc('0x33')](_0x4ecc7f['model'],qs[_0xbdbc('0x36')](_0x528900['query']['fields']));_0x3a8ff2[_0xbdbc('0x35')]=_0x3a8ff2[_0xbdbc('0x35')][_0xbdbc('0x37')]?_0x3a8ff2[_0xbdbc('0x35')]:_0x4ecc7f[_0xbdbc('0x34')];if(_0x528900[_0xbdbc('0x31')]['includeAll']){_0x3a8ff2[_0xbdbc('0x42')]=[{'all':!![]}];}_0x3a8ff2=_['merge']({},_0x3a8ff2,_0x528900['options']);return db[_0xbdbc('0x2f')]['find'](_0x3a8ff2)[_0xbdbc('0x27')](handleEntityNotFound(_0x52d471,null))['then'](respondWithResult(_0x52d471,null))[_0xbdbc('0x45')](handleError(_0x52d471,null));};exports['create']=function(_0x59d54f,_0x49f7c4){return db[_0xbdbc('0x2f')][_0xbdbc('0x49')](_0x59d54f['body'],{})[_0xbdbc('0x27')](function(_0x45ea2c){var _0x2dec30=_0x59d54f[_0xbdbc('0x4a')][_0xbdbc('0x29')]({'plain':!![]});if(!_0x2dec30)throw new Error(_0xbdbc('0x4b'));if(_0x2dec30['role']===_0xbdbc('0x4a')){var _0x4ada71=_0x45ea2c[_0xbdbc('0x29')]({'plain':!![]});var _0xc3e643=_0xbdbc('0x2a');return db[_0xbdbc('0x4c')][_0xbdbc('0x4d')]({'where':{'name':_0xc3e643,'userProfileId':_0x2dec30['userProfileId']},'raw':!![]})[_0xbdbc('0x27')](function(_0x4b9426){if(_0x4b9426&&_0x4b9426[_0xbdbc('0x4e')]===0x0){return db[_0xbdbc('0x2b')]['create']({'name':_0x4ada71['name'],'resourceId':_0x4ada71['id'],'type':_0x4b9426['name'],'sectionId':_0x4b9426['id']},{})[_0xbdbc('0x27')](function(){return _0x45ea2c;});}else{return _0x45ea2c;}})[_0xbdbc('0x45')](function(_0x5ac03c){logger[_0xbdbc('0x2c')](_0xbdbc('0x4f'),_0x5ac03c);throw _0x5ac03c;});}return _0x45ea2c;})[_0xbdbc('0x27')](respondWithResult(_0x49f7c4,0xc9))['catch'](handleError(_0x49f7c4,null));};exports[_0xbdbc('0x26')]=function(_0x310a8d,_0x5e983f){if(_0x310a8d['body']['id']){delete _0x310a8d['body']['id'];}return db[_0xbdbc('0x2f')][_0xbdbc('0x4d')]({'where':{'id':_0x310a8d[_0xbdbc('0x47')]['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0x5e983f,null))[_0xbdbc('0x27')](saveUpdates(_0x310a8d[_0xbdbc('0x50')],null))[_0xbdbc('0x27')](respondWithResult(_0x5e983f,null))[_0xbdbc('0x45')](handleError(_0x5e983f,null));};exports['destroy']=function(_0x4b83c7,_0x4dc319){return db[_0xbdbc('0x2f')][_0xbdbc('0x4d')]({'where':{'id':_0x4b83c7[_0xbdbc('0x47')]['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0x4dc319,null))['then'](removeEntity(_0x4dc319,null))[_0xbdbc('0x45')](handleError(_0x4dc319,null));};exports[_0xbdbc('0x51')]=function(_0x14995f,_0x4c8797){return db[_0xbdbc('0x2f')][_0xbdbc('0x51')]()[_0xbdbc('0x27')](respondWithResult(_0x4c8797,null))['catch'](handleError(_0x4c8797,null));};exports['addContacts']=function(_0x2469ea,_0xdcdd54,_0x292175){return db['CmContact'][_0xbdbc('0x4d')]({'where':{'id':_0x2469ea['params']['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0xdcdd54,null))[_0xbdbc('0x27')](function(_0x3dc32c){if(_0x3dc32c){return _0x3dc32c[_0xbdbc('0x52')](_0x2469ea['body'][_0xbdbc('0x53')],_[_0xbdbc('0x54')](_0x2469ea[_0xbdbc('0x50')],[_0xbdbc('0x53'),'id'])||{});}})[_0xbdbc('0x27')](respondWithResult(_0xdcdd54,null))[_0xbdbc('0x45')](handleError(_0xdcdd54,null));};exports['getContacts']=function(_0x4e3d19,_0x58f641,_0x1b7827){var _0x321bd4={};var _0x2975db={};var _0x3f5fdf;var _0x27481c;return db[_0xbdbc('0x2f')][_0xbdbc('0x55')]({'where':{'id':_0x4e3d19[_0xbdbc('0x47')]['id']}})[_0xbdbc('0x27')](handleEntityNotFound(_0x58f641,null))[_0xbdbc('0x27')](function(_0x5aa9d2){if(_0x5aa9d2){_0x3f5fdf=_0x5aa9d2;_0x2975db['model']=_[_0xbdbc('0x30')](db[_0xbdbc('0x56')][_0xbdbc('0x48')]);_0x2975db[_0xbdbc('0x31')]=_[_0xbdbc('0x30')](_0x4e3d19['query']);_0x2975db['filters']=_[_0xbdbc('0x33')](_0x2975db[_0xbdbc('0x34')],_0x2975db[_0xbdbc('0x31')]);_0x321bd4[_0xbdbc('0x35')]=_['intersection'](_0x2975db[_0xbdbc('0x34')],qs[_0xbdbc('0x36')](_0x4e3d19[_0xbdbc('0x31')]['fields']));_0x321bd4[_0xbdbc('0x35')]=_0x321bd4['attributes']['length']?_0x321bd4[_0xbdbc('0x35')]:_0x2975db[_0xbdbc('0x34')];_0x321bd4['order']=qs[_0xbdbc('0x3b')](_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x3b')]);_0x321bd4[_0xbdbc('0x3c')]=qs[_0xbdbc('0x32')](_[_0xbdbc('0x3d')](_0x4e3d19['query'],_0x2975db[_0xbdbc('0x32')]));if(_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x3e')]){_0x321bd4['where']=_['merge'](_0x321bd4[_0xbdbc('0x3c')],{'$or':_[_0xbdbc('0x40')](_0x321bd4[_0xbdbc('0x35')],function(_0x294614){var _0x42a1ff={};_0x42a1ff[_0x294614]={'$like':'%'+_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x3e')]+'%'};return _0x42a1ff;})});}_0x321bd4=_[_0xbdbc('0x3f')]({},_0x321bd4,_0x4e3d19[_0xbdbc('0x57')]);return _0x3f5fdf[_0xbdbc('0x58')](_0x321bd4);}})[_0xbdbc('0x27')](function(_0x35385e){if(_0x35385e){_0x27481c=_0x35385e['length'];if(!_0x4e3d19['query']['hasOwnProperty'](_0xbdbc('0x39'))){_0x321bd4[_0xbdbc('0x1e')]=qs[_0xbdbc('0x1e')](_0x4e3d19[_0xbdbc('0x31')]['limit']);_0x321bd4['offset']=qs[_0xbdbc('0x20')](_0x4e3d19[_0xbdbc('0x31')][_0xbdbc('0x20')]);}return _0x3f5fdf[_0xbdbc('0x58')](_0x321bd4);}})['then'](function(_0xb755b8){if(_0xb755b8){return _0xb755b8?{'count':_0x27481c,'rows':_0xb755b8}:null;}})[_0xbdbc('0x27')](respondWithResult(_0x58f641,null))[_0xbdbc('0x45')](handleError(_0x58f641,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 0ccf006..35aab15 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 _0x7085=['exports','define','CmCompany','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e7f48,_0x4435f7){var _0x2a57e2=function(_0x1c9c0a){while(--_0x1c9c0a){_0x2e7f48['push'](_0x2e7f48['shift']());}};_0x2a57e2(++_0x4435f7);}(_0x7085,0x71));var _0x5708=function(_0x736a72,_0x574f49){_0x736a72=_0x736a72-0x0;var _0x3741ad=_0x7085[_0x736a72];return _0x3741ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5708('0x0'))('api');var moment=require(_0x5708('0x1'));var BPromise=require(_0x5708('0x2'));var rp=require(_0x5708('0x3'));var fs=require('fs');var path=require(_0x5708('0x4'));var rimraf=require(_0x5708('0x5'));var config=require(_0x5708('0x6'));var attributes=require('./cmCompany.attributes');module[_0x5708('0x7')]=function(_0x508831,_0x52175b){return _0x508831[_0x5708('0x8')](_0x5708('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf50f=['exports','cm_companies','lodash','util','bluebird','path','rimraf','./cmCompany.attributes'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xf50f,0x112));var _0xff50=function(_0x53da6b,_0x2ce125){_0x53da6b=_0x53da6b-0x0;var _0x309813=_0xf50f[_0x53da6b];return _0x309813;};'use strict';var _=require(_0xff50('0x0'));var util=require(_0xff50('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xff50('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff50('0x3'));var rimraf=require(_0xff50('0x4'));var config=require('../../config/environment');var attributes=require(_0xff50('0x5'));module[_0xff50('0x6')]=function(_0x250636,_0x4701b1){return _0x250636['define']('CmCompany',attributes,{'tableName':_0xff50('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 1fd7108..edb540d 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 _0x2be3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20e641,_0x3e23fb){var _0x2b9ab9=function(_0x5ebdd9){while(--_0x5ebdd9){_0x20e641['push'](_0x20e641['shift']());}};_0x2b9ab9(++_0x3e23fb);}(_0x2be3,0x1dd));var _0x32be=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2be3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x32be('0x0'));var util=require(_0x32be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x32be('0x2'));var fs=require('fs');var Redis=require(_0x32be('0x3'));var db=require(_0x32be('0x4'))['db'];var utils=require(_0x32be('0x5'));var logger=require(_0x32be('0x6'))(_0x32be('0x7'));var config=require(_0x32be('0x8'));var jayson=require(_0x32be('0x9'));var client=jayson[_0x32be('0xa')][_0x32be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x321cb1,_0x2306fc,_0x46f1e0){return new BPromise(function(_0x59bd69,_0x4dfd8e){return client[_0x32be('0xc')](_0x321cb1,_0x46f1e0)[_0x32be('0xd')](function(_0x2ace65){logger[_0x32be('0xe')](_0x32be('0xf'),_0x2306fc,_0x32be('0x10'));logger[_0x32be('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2306fc,_0x32be('0x10'),JSON[_0x32be('0x12')](_0x2ace65));if(_0x2ace65['error']){if(_0x2ace65[_0x32be('0x13')]['code']===0x1f4){logger[_0x32be('0x13')](_0x32be('0xf'),_0x2306fc,_0x2ace65[_0x32be('0x13')][_0x32be('0x14')]);return _0x4dfd8e(_0x2ace65[_0x32be('0x13')][_0x32be('0x14')]);}logger[_0x32be('0x13')](_0x32be('0xf'),_0x2306fc,_0x2ace65[_0x32be('0x13')][_0x32be('0x14')]);return _0x59bd69(_0x2ace65[_0x32be('0x13')][_0x32be('0x14')]);}else{logger[_0x32be('0xe')](_0x32be('0xf'),_0x2306fc,'request\x20sent');_0x59bd69(_0x2ace65[_0x32be('0x15')][_0x32be('0x14')]);}})[_0x32be('0x16')](function(_0x3885fa){logger[_0x32be('0x13')](_0x32be('0xf'),_0x2306fc,_0x3885fa);_0x4dfd8e(_0x3885fa);});});}
\ No newline at end of file
+var _0x3565=['jayson/promise','client','http','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3565,0x1af));var _0x5356=function(_0x32622d,_0x1ef3bd){_0x32622d=_0x32622d-0x0;var _0x29146a=_0x3565[_0x32622d];return _0x29146a;};'use strict';var _=require(_0x5356('0x0'));var util=require(_0x5356('0x1'));var moment=require(_0x5356('0x2'));var BPromise=require(_0x5356('0x3'));var rs=require(_0x5356('0x4'));var fs=require('fs');var Redis=require(_0x5356('0x5'));var db=require(_0x5356('0x6'))['db'];var utils=require(_0x5356('0x7'));var logger=require(_0x5356('0x8'))('rpc');var config=require(_0x5356('0x9'));var jayson=require(_0x5356('0xa'));var client=jayson[_0x5356('0xb')][_0x5356('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb32b50,_0x5c0770,_0x5a1761){return new BPromise(function(_0x13ba82,_0x3fb29e){return client['request'](_0xb32b50,_0x5a1761)['then'](function(_0xc3d93e){logger[_0x5356('0xd')](_0x5356('0xe'),_0x5c0770,'request\x20sent');logger['debug'](_0x5356('0xf'),_0x5c0770,_0x5356('0x10'),JSON['stringify'](_0xc3d93e));if(_0xc3d93e[_0x5356('0x11')]){if(_0xc3d93e['error'][_0x5356('0x12')]===0x1f4){logger[_0x5356('0x11')]('CmCompany,\x20%s,\x20%s',_0x5c0770,_0xc3d93e[_0x5356('0x11')]['message']);return _0x3fb29e(_0xc3d93e[_0x5356('0x11')]['message']);}logger[_0x5356('0x11')](_0x5356('0xe'),_0x5c0770,_0xc3d93e[_0x5356('0x11')][_0x5356('0x13')]);return _0x13ba82(_0xc3d93e[_0x5356('0x11')]['message']);}else{logger['info'](_0x5356('0xe'),_0x5c0770,_0x5356('0x10'));_0x13ba82(_0xc3d93e[_0x5356('0x14')][_0x5356('0x13')]);}})['catch'](function(_0x4ef6d5){logger[_0x5356('0x11')](_0x5356('0xe'),_0x5c0770,_0x4ef6d5);_0x3fb29e(_0x4ef6d5);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 0fac2d8..2c00742 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 _0xcbb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','describe','/:id','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','multer','path'];(function(_0x1116cd,_0x41a0b7){var _0x52974a=function(_0x3c4e70){while(--_0x3c4e70){_0x1116cd['push'](_0x1116cd['shift']());}};_0x52974a(++_0x41a0b7);}(_0xcbb8,0x139));var _0x8cbb=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xcbb8[_0x24259d];return _0x5a701;};'use strict';var multer=require(_0x8cbb('0x0'));var util=require('util');var path=require(_0x8cbb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8cbb('0x2'));var auth=require(_0x8cbb('0x3'));var interaction=require(_0x8cbb('0x4'));var config=require(_0x8cbb('0x5'));var controller=require(_0x8cbb('0x6'));router['get']('/',auth[_0x8cbb('0x7')](),controller[_0x8cbb('0x8')]);router[_0x8cbb('0x9')]('/describe',auth[_0x8cbb('0x7')](),controller[_0x8cbb('0xa')]);router[_0x8cbb('0x9')](_0x8cbb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x8cbb('0x9')](_0x8cbb('0xc'),auth[_0x8cbb('0x7')](),controller[_0x8cbb('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8cbb('0xe')]);router[_0x8cbb('0xf')](_0x8cbb('0xc'),auth[_0x8cbb('0x7')](),controller[_0x8cbb('0x10')]);router[_0x8cbb('0x11')](_0x8cbb('0xb'),auth[_0x8cbb('0x7')](),controller[_0x8cbb('0x12')]);router[_0x8cbb('0x13')](_0x8cbb('0xb'),auth['isAuthenticated'](),controller[_0x8cbb('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x3f49=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/:id','isAuthenticated','/:id/contacts','post','addContacts','put','destroy'];(function(_0x2ca636,_0x4f4da1){var _0x168e73=function(_0x282200){while(--_0x282200){_0x2ca636['push'](_0x2ca636['shift']());}};_0x168e73(++_0x4f4da1);}(_0x3f49,0x1b9));var _0x93f4=function(_0x5534f0,_0x4841a1){_0x5534f0=_0x5534f0-0x0;var _0x5089dd=_0x3f49[_0x5534f0];return _0x5089dd;};'use strict';var multer=require(_0x93f4('0x0'));var util=require(_0x93f4('0x1'));var path=require(_0x93f4('0x2'));var timeout=require(_0x93f4('0x3'));var express=require('express');var router=express[_0x93f4('0x4')]();var fs_extra=require(_0x93f4('0x5'));var auth=require(_0x93f4('0x6'));var interaction=require(_0x93f4('0x7'));var config=require(_0x93f4('0x8'));var controller=require(_0x93f4('0x9'));router[_0x93f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x93f4('0xb')]);router[_0x93f4('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x93f4('0xa')](_0x93f4('0xc'),auth[_0x93f4('0xd')](),controller['show']);router['get'](_0x93f4('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0x93f4('0xf')]('/',auth[_0x93f4('0xd')](),controller['create']);router[_0x93f4('0xf')](_0x93f4('0xe'),auth[_0x93f4('0xd')](),controller[_0x93f4('0x10')]);router[_0x93f4('0x11')](_0x93f4('0xc'),auth[_0x93f4('0xd')](),controller['update']);router['delete']('/:id',auth[_0x93f4('0xd')](),controller[_0x93f4('0x12')]);module[_0x93f4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index dad1846..edad918 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 _0x03da=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x1b7ea6,_0x195a62){var _0x4fcea6=function(_0x29ace1){while(--_0x29ace1){_0x1b7ea6['push'](_0x1b7ea6['shift']());}};_0x4fcea6(++_0x195a62);}(_0x03da,0x15e));var _0xa03d=function(_0x53c1a1,_0x1f401c){_0x53c1a1=_0x53c1a1-0x0;var _0x4f2ddf=_0x03da[_0x53c1a1];return _0x4f2ddf;};'use strict';var _=require(_0xa03d('0x0'));var Sequelize=require(_0xa03d('0x1'));module[_0xa03d('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa03d('0x3')]},'postalCode':{'type':Sequelize[_0xa03d('0x3')]},'city':{'type':Sequelize[_0xa03d('0x3')]},'country':{'type':Sequelize[_0xa03d('0x3')]},'dateOfBirth':{'type':Sequelize[_0xa03d('0x3')]},'description':{'type':Sequelize[_0xa03d('0x4')]},'phone':{'type':Sequelize[_0xa03d('0x3')]},'mobile':{'type':Sequelize[_0xa03d('0x3')]},'fax':{'type':Sequelize[_0xa03d('0x3')]},'email':{'type':Sequelize[_0xa03d('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xa03d('0x3')]},'skype':{'type':Sequelize[_0xa03d('0x3')]},'teams':{'type':Sequelize[_0xa03d('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xa03d('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xa03d('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa03d('0x5')](0x2)[_0xa03d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa03d('0x7')],'defaultValue':Sequelize[_0xa03d('0x8')]},'dialTimezone':{'type':Sequelize[_0xa03d('0x3')]},'utcOffset':{'type':Sequelize[_0xa03d('0x5')]}};
\ No newline at end of file
+var _0x5c48=['exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x5c48,0x1c7));var _0x85c4=function(_0x59055e,_0x5add8f){_0x59055e=_0x59055e-0x0;var _0xd6174b=_0x5c48[_0x59055e];return _0xd6174b;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x85c4('0x0')]={'firstName':{'type':Sequelize[_0x85c4('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x85c4('0x1')]},'street':{'type':Sequelize[_0x85c4('0x1')]},'postalCode':{'type':Sequelize[_0x85c4('0x1')]},'city':{'type':Sequelize[_0x85c4('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x85c4('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x85c4('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x85c4('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x85c4('0x1')]},'skype':{'type':Sequelize[_0x85c4('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x85c4('0x1')]},'wechat':{'type':Sequelize[_0x85c4('0x1')]},'telegram':{'type':Sequelize[_0x85c4('0x1')]},'UserId':{'type':Sequelize[_0x85c4('0x2')]},'AdditionalPhones':{'type':Sequelize[_0x85c4('0x1')]},'priority':{'type':Sequelize[_0x85c4('0x2')](0x2)[_0x85c4('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x85c4('0x4')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x85c4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f6d84b4..36def5b 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 _0xc750=['omit','map','isEmpty','table','cm_contacts','setFields','toParam','text','phone','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','getTags','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','CmHopperId','ItemType.OrderBy','bulkCreate','getAdditionalPhones','`ItemType`.OrderBy','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','options','includeAll','include','rows','getHopperHistories','getHopperFinals','nolimit','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','parse','import','agent','No\x20ListId\x20specified','binding','firstName','stringify','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','importUpdates','User','message','exit','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','DESC','Account','closed','closedAt','disposition','thirdDisposition','key','Owner','customerIp','customerPort','osName','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','startCase','Interaction','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','stack','name','send','index','describe','getOptions','findAll','query','user','catch','params','keys','startsWith','cf_','columnName','CmCustomField','length','displayName','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','CmContact','from','get','mergeWith','isArray','tags','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','join','isNil','dialTimezone','utcOffset','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','find','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','format','cf_%d','timezones'];(function(_0x27973f,_0x3dc301){var _0x406fbe=function(_0x53a81f){while(--_0x53a81f){_0x27973f['push'](_0x27973f['shift']());}};_0x406fbe(++_0x3dc301);}(_0xc750,0x187));var _0x0c75=function(_0x4a6312,_0x5f2f95){_0x4a6312=_0x4a6312-0x0;var _0x5d8929=_0xc750[_0x4a6312];return _0x5d8929;};'use strict';var moment=require(_0x0c75('0x0'));var BPromise=require(_0x0c75('0x1'));var util=require(_0x0c75('0x2'));var path=require(_0x0c75('0x3'));var fs=require('fs');var _=require(_0x0c75('0x4'));var squel=require(_0x0c75('0x5'));var Papa=require('papaparse');var Redis=require(_0x0c75('0x6'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0x0c75('0x7'))('api');var config=require(_0x0c75('0x8'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x0c75('0x9')]=_[_0x0c75('0xa')](config[_0x0c75('0x9')],{'host':_0x0c75('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c75('0x9')]));require(_0x0c75('0xc'))[_0x0c75('0xd')](socket);function respondWithResult(_0xe04b01,_0x19ab26){_0x19ab26=_0x19ab26||0xc8;return function(_0x5397f3){if(_0x5397f3){return _0xe04b01[_0x0c75('0xe')](_0x19ab26)[_0x0c75('0xf')](_0x5397f3);}};}function respondWithFilteredResult(_0x5d42be,_0xe16dbf){return function(_0x52718c){if(_0x52718c){var _0x9626dc=typeof _0xe16dbf[_0x0c75('0x10')]===_0x0c75('0x11')&&typeof _0xe16dbf[_0x0c75('0x12')]==='undefined';var _0x460896=_0x52718c[_0x0c75('0x13')];var _0x22a893=_0x9626dc?0x0:_0xe16dbf[_0x0c75('0x10')];var _0x1c1011=_0x9626dc?_0x52718c['count']:_0xe16dbf[_0x0c75('0x10')]+_0xe16dbf[_0x0c75('0x12')];var _0x2024ff;if(_0x1c1011>=_0x460896){_0x1c1011=_0x460896;_0x2024ff=0xc8;}else{_0x2024ff=0xce;}_0x5d42be[_0x0c75('0xe')](_0x2024ff);return _0x5d42be[_0x0c75('0x14')]('Content-Range',_0x22a893+'-'+_0x1c1011+'/'+_0x460896)[_0x0c75('0xf')](_0x52718c);}return null;};}function saveUpdates(_0x478968){return function(_0x510d5f){if(_0x510d5f){return _0x510d5f[_0x0c75('0x15')](_0x478968)[_0x0c75('0x16')](function(_0x544834){return _0x544834;});}return null;};}function removeEntity(_0x5e893f){return function(_0x26829b){if(_0x26829b){return _0x26829b[_0x0c75('0x17')]()['then'](function(){_0x5e893f[_0x0c75('0xe')](0xcc)[_0x0c75('0x18')]();});}};}function handleEntityNotFound(_0x36aa99){return function(_0x5316ae){if(!_0x5316ae){_0x36aa99[_0x0c75('0x19')](0x194);}return _0x5316ae;};}function handleError(_0xaba5dd,_0xd6dc03){_0xd6dc03=_0xd6dc03||0x1f4;return function(_0x47f009){logger['error'](_0x47f009[_0x0c75('0x1a')]);if(_0x47f009['name']){delete _0x47f009[_0x0c75('0x1b')];}_0xaba5dd[_0x0c75('0xe')](_0xd6dc03)[_0x0c75('0x1c')](_0x47f009);};}exports[_0x0c75('0x1d')]=function(_0x2a8907,_0x46bfad){var _0x151523={};return contacts[_0x0c75('0x1e')]()[_0x0c75('0x16')](function(_0x2a4938){_0x151523=qs[_0x0c75('0x1f')](_0x2a4938,_0x2a8907);return contacts[_0x0c75('0x20')](_0x2a8907[_0x0c75('0x21')],_0x2a8907[_0x0c75('0x22')],_0x151523,_0x2a4938);})['then'](respondWithFilteredResult(_0x46bfad,_0x151523))[_0x0c75('0x23')](handleError(_0x46bfad,null));};exports[_0x0c75('0x17')]=function(_0x2b2fb1,_0x2b8660){return db['CmContact']['find']({'where':{'id':_0x2b2fb1[_0x0c75('0x24')]['id']}})[_0x0c75('0x16')](handleEntityNotFound(_0x2b8660,null))['then'](removeEntity(_0x2b8660,null))['catch'](handleError(_0x2b8660,null));};exports[_0x0c75('0x1e')]=function(_0x4097ed,_0x47deb5){return db['CmContact'][_0x0c75('0x1e')]()[_0x0c75('0x16')](function(_0x1d31d4){delete _0x1d31d4['tags'];for(var _0x362753=0x0;_0x362753
','user=','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','pop','isEmpty','html','includes','0x1?_0x2b3bc4[_0xf6b9('0x13')](0x0,-0x1)['join']('\x20'):_0x3a920f[_0xf6b9('0xe')];}return _0xf6b9('0x14');}function getLastName(_0x5dd980){var _0x369e05=_[_0xf6b9('0x8')](_0x5dd980['value']);if(_0x369e05&&_0x369e05[_0xf6b9('0xe')]){var _0x17460a=_0x369e05[_0xf6b9('0xe')][_0xf6b9('0x11')](/\s+/);return _0x17460a[_0xf6b9('0x12')]>0x1?_0x17460a[_0xf6b9('0x15')]():'';}return'';}function getMails(_0x15a51b,_0x46dbdb){var _0x1afe8e='';for(var _0x1b4881=0x0;_0x1b4881<_0x46dbdb[_0xf6b9('0x9')]['length'];_0x1b4881+=0x1){if(_0x46dbdb[_0xf6b9('0x9')][_0x1b4881]['address']!==_0x15a51b){if(!_[_0xf6b9('0x16')](_0x1afe8e)){_0x1afe8e+=',';}_0x1afe8e+=_0x46dbdb[_0xf6b9('0x9')][_0x1b4881][_0xf6b9('0xe')]||_0x46dbdb[_0xf6b9('0x9')][_0x1b4881][_0xf6b9('0xa')]||'';_0x1afe8e+='\x20<';_0x1afe8e+=_0x46dbdb[_0xf6b9('0x9')][_0x1b4881][_0xf6b9('0xa')]?_0x46dbdb[_0xf6b9('0x9')][_0x1b4881][_0xf6b9('0xa')]:_0xf6b9('0xb')+random[_0xf6b9('0xc')](0x6)+_0xf6b9('0xd');_0x1afe8e+='>';}}return _0x1afe8e;}function parseEmail(_0x4073d2,_0x2e9468,_0x4273c3){if(_0x2e9468[_0xf6b9('0x17')]){var _0x5ceb81=/